gz-research-assistant 1.0.13 → 1.0.15

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,23 +1,23 @@
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
- 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
- import { StyleProvider as ae } from "@ant-design/cssinjs";
4
- import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as w, Collapse as T, ConfigProvider as ce, Dropdown as le, Empty as ue, Input as E, InputNumber as de, Select as D, Tabs as fe, Tag as O, Tooltip as pe, Upload as me, getDesignTokenCssVariables as k } from "gz-ui-web";
5
- import { ApiOutlined as A, BulbOutlined as j, CameraOutlined as he, CheckCircleOutlined as M, CheckOutlined as ge, CloseOutlined as _e, CodeOutlined as N, DashboardOutlined as P, DeleteOutlined as ve, DesktopOutlined as ye, DownloadOutlined as be, EditOutlined as F, EllipsisOutlined as I, ExperimentOutlined as xe, FieldTimeOutlined as Se, FileAddOutlined as Ce, FileTextOutlined as we, FlagOutlined as Te, FolderOpenOutlined as Ee, FullscreenExitOutlined as L, FullscreenOutlined as R, HistoryOutlined as De, InfoCircleOutlined as z, LineChartOutlined as Oe, LinkOutlined as ke, MessageOutlined as Ae, MinusOutlined as B, PauseOutlined as je, PlayCircleOutlined as Me, PlusOutlined as V, ReadOutlined as Ne, SaveOutlined as H, ScissorOutlined as U, SearchOutlined as Pe, StopOutlined as Fe, UploadOutlined as Ie, VideoCameraOutlined as Le, WarningOutlined as Re } from "@ant-design/icons";
6
- import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
- import { OverlayScrollbars as ze } from "overlayscrollbars";
8
- import { createRoot as Be } from "react-dom/client";
2
+ import { Component as _, createElement as v, useCallback as y, useEffect as b, useId as x, useLayoutEffect as ee, useMemo as te, useRef as ne, useState as S, useSyncExternalStore as C } from "react";
3
+ import { StyleProvider as re } from "@ant-design/cssinjs";
4
+ import { Alert as w, Badge as ie, Button as T, Card as ae, Checkbox as oe, Collapse as E, ConfigProvider as se, Dropdown as ce, Empty as le, Input as D, InputNumber as ue, Select as O, Tabs as de, Tag as k, Tooltip as fe, Upload as pe, getDesignTokenCssVariables as me } from "gz-ui-web";
5
+ import { ApiOutlined as he, BulbOutlined as A, CameraOutlined as j, CheckCircleOutlined as M, CheckOutlined as ge, CloseOutlined as _e, CodeOutlined as ve, DashboardOutlined as ye, DeleteOutlined as N, DesktopOutlined as P, DownloadOutlined as be, EditOutlined as xe, EllipsisOutlined as Se, ExperimentOutlined as F, FieldTimeOutlined as Ce, FileAddOutlined as we, FileTextOutlined as Te, FlagOutlined as Ee, FolderOpenOutlined as De, FullscreenExitOutlined as Oe, FullscreenOutlined as ke, HistoryOutlined as Ae, InfoCircleOutlined as I, LineChartOutlined as L, LinkOutlined as je, MessageOutlined as Me, MinusOutlined as R, PauseOutlined as Ne, PlayCircleOutlined as Pe, PlusOutlined as z, ReadOutlined as Fe, SaveOutlined as Ie, ScissorOutlined as B, SearchOutlined as Le, StopOutlined as V, UploadOutlined as H, VideoCameraOutlined as Re, WarningOutlined as ze } from "@ant-design/icons";
6
+ import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
+ import { OverlayScrollbars as Be } from "overlayscrollbars";
8
+ import { createRoot as Ve } from "react-dom/client";
9
9
  // \0rolldown/runtime.js
10
- var Ve = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ue = Object.getOwnPropertyNames, We = Object.prototype.hasOwnProperty, Ge = (e, t) => {
10
+ var He = Object.defineProperty, K = Object.getOwnPropertyDescriptor, Ue = Object.getOwnPropertyNames, We = Object.prototype.hasOwnProperty, Ge = (e, t) => {
11
11
  let n = {};
12
- for (var r in e) Ve(n, r, {
12
+ for (var r in e) He(n, r, {
13
13
  get: e[r],
14
14
  enumerable: !0
15
15
  });
16
- return t || Ve(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ return t || He(n, Symbol.toStringTag, { value: "Module" }), n;
17
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, {
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 && He(e, s, {
19
19
  get: ((e) => t[e]).bind(null, s),
20
- enumerable: !(r = He(t, s)) || r.enumerable
20
+ enumerable: !(r = K(t, s)) || r.enumerable
21
21
  });
22
22
  return e;
23
23
  }, qe = (e, t, n) => (Ke(e, t, "default"), n && Ke(n, t, "default")), Je = { scope: "_scope_tudpr_1" }, q = {
@@ -60,7 +60,7 @@ var Ve = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ue = Objec
60
60
  y: Math.max(0, Math.min(e.y, Math.max(0, window.innerHeight - t.height - 12)))
61
61
  });
62
62
  function Xe(e, t, n) {
63
- y(() => {
63
+ b(() => {
64
64
  let r = e.current, i = r?.closest("[data-assistant-part=\"dock\"]");
65
65
  if (!r || !i) return;
66
66
  let a = null, o = {
@@ -108,18 +108,18 @@ function Xe(e, t, n) {
108
108
  s?.id === e.pointerId && (e.stopPropagation(), e.type === "pointercancel" && (c = !0), h());
109
109
  }, _ = (e) => {
110
110
  u(e) && (e.preventDefault(), e.stopPropagation(), c && e.detail !== 0 ? c = !1 : (c = !1, t()));
111
- }, ee = (e) => {
111
+ }, v = (e) => {
112
112
  u(e) && e.preventDefault();
113
- }, v = () => {
114
- a && (a = Ye(a, o), f());
115
113
  }, y = () => {
114
+ a && (a = Ye(a, o), f());
115
+ }, b = () => {
116
116
  s && (c = !0, h());
117
117
  };
118
118
  return window.addEventListener("pointerdown", p, !0), window.addEventListener("pointermove", m, {
119
119
  capture: !0,
120
120
  passive: !1
121
- }), window.addEventListener("pointerup", g, !0), window.addEventListener("pointercancel", g, !0), window.addEventListener("lostpointercapture", g, !0), window.addEventListener("click", _, !0), window.addEventListener("dragstart", ee, !0), window.addEventListener("resize", v), window.addEventListener("blur", y), () => {
122
- window.removeEventListener("pointerdown", p, !0), window.removeEventListener("pointermove", m, !0), window.removeEventListener("pointerup", g, !0), window.removeEventListener("pointercancel", g, !0), window.removeEventListener("lostpointercapture", g, !0), window.removeEventListener("click", _, !0), window.removeEventListener("dragstart", ee, !0), window.removeEventListener("resize", v), window.removeEventListener("blur", y), h();
121
+ }), window.addEventListener("pointerup", g, !0), window.addEventListener("pointercancel", g, !0), window.addEventListener("lostpointercapture", g, !0), window.addEventListener("click", _, !0), window.addEventListener("dragstart", v, !0), window.addEventListener("resize", y), window.addEventListener("blur", b), () => {
122
+ window.removeEventListener("pointerdown", p, !0), window.removeEventListener("pointermove", m, !0), window.removeEventListener("pointerup", g, !0), window.removeEventListener("pointercancel", g, !0), window.removeEventListener("lostpointercapture", g, !0), window.removeEventListener("click", _, !0), window.removeEventListener("dragstart", v, !0), window.removeEventListener("resize", y), window.removeEventListener("blur", b), h();
123
123
  };
124
124
  }, [
125
125
  e,
@@ -128,33 +128,35 @@ function Xe(e, t, n) {
128
128
  ]);
129
129
  }
130
130
  var J = {
131
- formStack: "_formStack_175v2_1 _formStack_13kbl_763",
132
- subheading: "_subheading_175v2_4 _subheading_13kbl_639",
133
- json: "_json_175v2_7 _json_13kbl_377",
134
- stepHeading: "_stepHeading_175v2_10 _stepHeading_13kbl_631",
135
- field: "_field_175v2_13 _field_13kbl_761",
136
- hint: "_hint_175v2_16 _hint_13kbl_515",
137
- buttonRow: "_buttonRow_175v2_19 _buttonRow_13kbl_627",
138
- cardHeading: "_cardHeading_175v2_22 _cardHeading_13kbl_633",
139
- card: "_card_175v2_22 _card_13kbl_633",
140
- headingIcon: "_headingIcon_175v2_28 _headingIcon_13kbl_735",
141
- sectionHeading: "_sectionHeading_175v2_31 _sectionHeading_13kbl_689",
142
- section: "_section_175v2_31 _section_13kbl_369",
143
- caseSteps: "_caseSteps_175v2_37",
144
- upload: "_upload_175v2_40",
145
- delayRow: "_delayRow_175v2_79",
146
- automationLayout: "_automationLayout_175v2_82",
147
- cardActions: "_cardActions_175v2_89",
148
- checkpointRow: "_checkpointRow_175v2_93",
149
- stepNumber: "_stepNumber_175v2_119",
150
- stepActions: "_stepActions_175v2_124",
151
- savedCase: "_savedCase_175v2_127",
152
- help: "_help_175v2_136",
153
- emptySteps: "_emptySteps_175v2_148",
154
- assertionArea: "_assertionArea_175v2_174",
155
- assertionResults: "_assertionResults_175v2_175",
156
- assertionResult: "_assertionResult_175v2_175",
157
- assertionSummary: "_assertionSummary_175v2_202"
131
+ formStack: "_formStack_1x5b1_1 _formStack_13kbl_763",
132
+ subheading: "_subheading_1x5b1_4 _subheading_13kbl_639",
133
+ json: "_json_1x5b1_7 _json_13kbl_377",
134
+ stepHeading: "_stepHeading_1x5b1_10 _stepHeading_13kbl_631",
135
+ field: "_field_1x5b1_13 _field_13kbl_761",
136
+ hint: "_hint_1x5b1_16 _hint_13kbl_515",
137
+ buttonRow: "_buttonRow_1x5b1_19 _buttonRow_13kbl_627",
138
+ cardHeading: "_cardHeading_1x5b1_22 _cardHeading_13kbl_633",
139
+ card: "_card_1x5b1_22 _card_13kbl_633",
140
+ headingIcon: "_headingIcon_1x5b1_28 _headingIcon_13kbl_735",
141
+ sectionHeading: "_sectionHeading_1x5b1_31 _sectionHeading_13kbl_689",
142
+ section: "_section_1x5b1_31 _section_13kbl_369",
143
+ caseSteps: "_caseSteps_1x5b1_37",
144
+ upload: "_upload_1x5b1_40",
145
+ delayRow: "_delayRow_1x5b1_79",
146
+ automationLayout: "_automationLayout_1x5b1_82",
147
+ cardActions: "_cardActions_1x5b1_89",
148
+ checkpointRow: "_checkpointRow_1x5b1_93",
149
+ stepNumber: "_stepNumber_1x5b1_119",
150
+ stepActions: "_stepActions_1x5b1_124",
151
+ savedCase: "_savedCase_1x5b1_127",
152
+ help: "_help_1x5b1_136",
153
+ emptySteps: "_emptySteps_1x5b1_148",
154
+ assertionArea: "_assertionArea_1x5b1_174",
155
+ assertionResults: "_assertionResults_1x5b1_175",
156
+ assertionResult: "_assertionResult_1x5b1_175",
157
+ assertionSummary: "_assertionSummary_1x5b1_202",
158
+ stickyToolbar: "_stickyToolbar_1x5b1_230 _stickyToolbar_1lsno_111",
159
+ toolbarHeading: "_toolbarHeading_1x5b1_233"
158
160
  }, Ze = {
159
161
  click: "点击",
160
162
  fill: "输入",
@@ -169,13 +171,13 @@ import * as Qe from "gz-laya-pilot/schema";
169
171
  qe(Y, Qe);
170
172
  // src/pages/assistant/components/ActionMenu.tsx
171
173
  function $e({ label: e, items: t, disabled: n }) {
172
- return /* @__PURE__ */ G(le, {
174
+ return /* @__PURE__ */ W(ce, {
173
175
  trigger: ["click"],
174
176
  menu: { items: t },
175
177
  disabled: n,
176
- children: /* @__PURE__ */ G(C, {
178
+ children: /* @__PURE__ */ W(T, {
177
179
  type: "text",
178
- icon: /* @__PURE__ */ G(I, {}),
180
+ icon: /* @__PURE__ */ W(Se, {}),
179
181
  "aria-label": e,
180
182
  disabled: n,
181
183
  children: "更多"
@@ -193,33 +195,33 @@ var X = {
193
195
  };
194
196
  // src/pages/assistant/components/AssertionEditor/index.tsx
195
197
  function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
196
- let o = b(), [s, c] = x(e ?? {
198
+ let o = x(), [s, c] = S(e ?? {
197
199
  name: "",
198
200
  source: "page-text",
199
201
  operator: "contains",
200
202
  expected: "",
201
203
  timeout: 1e4
202
- }), [l, u] = x(n), [d, f] = x(""), p = (e) => c((t) => ({
204
+ }), [l, u] = S(n), [d, f] = S(""), p = (e) => c((t) => ({
203
205
  ...t,
204
206
  ...e
205
207
  })), m = (0, Y.isRequestAssertion)(s.source), h = t.slice(0, l).some((e) => e.target);
206
- return /* @__PURE__ */ K("div", {
208
+ return /* @__PURE__ */ G("div", {
207
209
  className: [X.assertionEditor, X.formStack].join(" "),
208
210
  "data-assistant-part": "assertion-editor form-stack",
209
211
  "aria-label": e ? "编辑断言配置" : "新增断言配置",
210
212
  children: [
211
- /* @__PURE__ */ K("h3", {
213
+ /* @__PURE__ */ G("h3", {
212
214
  className: X.subheading,
213
215
  "data-assistant-part": "subheading",
214
- children: [/* @__PURE__ */ G(M, {}), e ? "编辑断言" : "添加断言"]
216
+ children: [/* @__PURE__ */ W(M, {}), e ? "编辑断言" : "添加断言"]
215
217
  }),
216
- /* @__PURE__ */ K("div", {
218
+ /* @__PURE__ */ G("div", {
217
219
  className: X.field,
218
220
  "data-assistant-part": "field",
219
- children: [/* @__PURE__ */ G("label", {
221
+ children: [/* @__PURE__ */ W("label", {
220
222
  htmlFor: `${o}-name`,
221
223
  children: "断言名称"
222
- }), /* @__PURE__ */ G(E, {
224
+ }), /* @__PURE__ */ W(D, {
223
225
  id: `${o}-name`,
224
226
  placeholder: "例如:保存后显示成功提示",
225
227
  value: s.name,
@@ -228,13 +230,13 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
228
230
  onChange: (e) => p({ name: e.target.value })
229
231
  })]
230
232
  }),
231
- !e && /* @__PURE__ */ K("div", {
233
+ !e && /* @__PURE__ */ G("div", {
232
234
  className: X.field,
233
235
  "data-assistant-part": "field",
234
- children: [/* @__PURE__ */ G("label", {
236
+ children: [/* @__PURE__ */ W("label", {
235
237
  htmlFor: `${o}-position`,
236
238
  children: "执行位置"
237
- }), /* @__PURE__ */ G(D, {
239
+ }), /* @__PURE__ */ W(O, {
238
240
  id: `${o}-position`,
239
241
  value: l,
240
242
  disabled: r,
@@ -248,16 +250,16 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
248
250
  }))]
249
251
  })]
250
252
  }),
251
- /* @__PURE__ */ K("div", {
253
+ /* @__PURE__ */ G("div", {
252
254
  className: X.assertionFields,
253
255
  "data-assistant-part": "assertion-fields",
254
- children: [/* @__PURE__ */ K("div", {
256
+ children: [/* @__PURE__ */ G("div", {
255
257
  className: X.field,
256
258
  "data-assistant-part": "field",
257
- children: [/* @__PURE__ */ G("label", {
259
+ children: [/* @__PURE__ */ W("label", {
258
260
  htmlFor: `${o}-source`,
259
261
  children: "断言对象"
260
- }), /* @__PURE__ */ G(D, {
262
+ }), /* @__PURE__ */ W(O, {
261
263
  id: `${o}-source`,
262
264
  value: s.source,
263
265
  disabled: r,
@@ -274,13 +276,13 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
274
276
  selector: s.selector ?? ""
275
277
  })
276
278
  })]
277
- }), /* @__PURE__ */ K("div", {
279
+ }), /* @__PURE__ */ G("div", {
278
280
  className: X.field,
279
281
  "data-assistant-part": "field",
280
- children: [/* @__PURE__ */ G("label", {
282
+ children: [/* @__PURE__ */ W("label", {
281
283
  htmlFor: `${o}-operator`,
282
284
  children: "比较条件"
283
- }), /* @__PURE__ */ G(D, {
285
+ }), /* @__PURE__ */ W(O, {
284
286
  id: `${o}-operator`,
285
287
  value: s.operator,
286
288
  disabled: r,
@@ -292,16 +294,16 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
292
294
  })]
293
295
  })]
294
296
  }),
295
- m && /* @__PURE__ */ K(W, { children: [
296
- /* @__PURE__ */ K("div", {
297
+ m && /* @__PURE__ */ G(U, { children: [
298
+ /* @__PURE__ */ G("div", {
297
299
  className: X.assertionFields,
298
300
  "data-assistant-part": "assertion-fields",
299
- children: [/* @__PURE__ */ K("div", {
301
+ children: [/* @__PURE__ */ G("div", {
300
302
  className: X.field,
301
- children: [/* @__PURE__ */ G("label", {
303
+ children: [/* @__PURE__ */ W("label", {
302
304
  htmlFor: `${o}-method`,
303
305
  children: "请求方法"
304
- }), /* @__PURE__ */ G(D, {
306
+ }), /* @__PURE__ */ W(O, {
305
307
  id: `${o}-method`,
306
308
  value: s.method,
307
309
  disabled: r,
@@ -319,12 +321,12 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
319
321
  })),
320
322
  onChange: (e) => p({ method: e })
321
323
  })]
322
- }), /* @__PURE__ */ K("div", {
324
+ }), /* @__PURE__ */ G("div", {
323
325
  className: X.field,
324
- children: [/* @__PURE__ */ G("label", {
326
+ children: [/* @__PURE__ */ W("label", {
325
327
  htmlFor: `${o}-pathname`,
326
328
  children: "接口路径"
327
- }), /* @__PURE__ */ G(E, {
329
+ }), /* @__PURE__ */ W(D, {
328
330
  id: `${o}-pathname`,
329
331
  placeholder: "/api/orders",
330
332
  maxLength: 2e3,
@@ -334,24 +336,24 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
334
336
  })]
335
337
  })]
336
338
  }),
337
- /* @__PURE__ */ K("p", {
339
+ /* @__PURE__ */ G("p", {
338
340
  className: X.hint,
339
341
  children: ["从上一操作开始,只统计同源 Fetch / XHR,忽略查询参数。", s.source === "request-success" && " 至少调用一次,且所有调用须在窗口内完成并返回 HTTP 2xx。"]
340
342
  }),
341
- !h && /* @__PURE__ */ G(S, {
343
+ !h && /* @__PURE__ */ W(w, {
342
344
  type: "warning",
343
345
  title: "接口断言必须放在一次操作之后"
344
346
  })
345
347
  ] }),
346
- (0, Y.assertionNeedsSelector)(s.source) && /* @__PURE__ */ K("div", {
348
+ (0, Y.assertionNeedsSelector)(s.source) && /* @__PURE__ */ G("div", {
347
349
  className: X.field,
348
350
  "data-assistant-part": "field",
349
351
  children: [
350
- /* @__PURE__ */ G("label", {
352
+ /* @__PURE__ */ W("label", {
351
353
  htmlFor: `${o}-selector`,
352
354
  children: "元素定位(CSS)"
353
355
  }),
354
- /* @__PURE__ */ G(E, {
356
+ /* @__PURE__ */ W(D, {
355
357
  id: `${o}-selector`,
356
358
  value: s.selector,
357
359
  maxLength: 2e3,
@@ -359,20 +361,20 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
359
361
  disabled: r,
360
362
  onChange: (e) => p({ selector: e.target.value })
361
363
  }),
362
- /* @__PURE__ */ G("p", {
364
+ /* @__PURE__ */ W("p", {
363
365
  className: X.hint,
364
366
  "data-assistant-part": "hint",
365
367
  children: "可从步骤定位信息复制。除数量断言外,必须匹配唯一元素。"
366
368
  })
367
369
  ]
368
370
  }),
369
- (0, Y.assertionNeedsExpected)(s.source) && /* @__PURE__ */ K("div", {
371
+ (0, Y.assertionNeedsExpected)(s.source) && /* @__PURE__ */ G("div", {
370
372
  className: X.field,
371
373
  "data-assistant-part": "field",
372
- children: [/* @__PURE__ */ G("label", {
374
+ children: [/* @__PURE__ */ W("label", {
373
375
  htmlFor: `${o}-expected`,
374
376
  children: m ? "调用次数" : "期望值"
375
- }), /* @__PURE__ */ G(E, {
377
+ }), /* @__PURE__ */ W(D, {
376
378
  id: `${o}-expected`,
377
379
  value: s.expected,
378
380
  maxLength: 2e3,
@@ -381,13 +383,13 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
381
383
  onChange: (e) => p({ expected: e.target.value })
382
384
  })]
383
385
  }),
384
- /* @__PURE__ */ K("div", {
386
+ /* @__PURE__ */ G("div", {
385
387
  className: X.field,
386
388
  "data-assistant-part": "field",
387
- children: [/* @__PURE__ */ G("label", {
389
+ children: [/* @__PURE__ */ W("label", {
388
390
  htmlFor: `${o}-timeout`,
389
391
  children: m ? "观察时间(毫秒)" : "最长等待时间(毫秒)"
390
- }), /* @__PURE__ */ G(de, {
392
+ }), /* @__PURE__ */ W(ue, {
391
393
  id: `${o}-timeout`,
392
394
  min: 500,
393
395
  max: 3e4,
@@ -397,16 +399,16 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
397
399
  onChange: (e) => p({ timeout: e ?? (m ? 3e3 : 1e4) })
398
400
  })]
399
401
  }),
400
- d && /* @__PURE__ */ G(S, {
402
+ d && /* @__PURE__ */ W(w, {
401
403
  showIcon: !0,
402
404
  type: "error",
403
405
  title: d
404
406
  }),
405
- /* @__PURE__ */ K("div", {
407
+ /* @__PURE__ */ G("div", {
406
408
  className: X.buttonRow,
407
409
  "data-assistant-part": "button-row",
408
- children: [/* @__PURE__ */ G(C, {
409
- icon: /* @__PURE__ */ G(H, {}),
410
+ children: [/* @__PURE__ */ W(T, {
411
+ icon: /* @__PURE__ */ W(Ie, {}),
410
412
  type: "primary",
411
413
  disabled: r || m && !h,
412
414
  onClick: () => {
@@ -423,7 +425,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
423
425
  }
424
426
  },
425
427
  children: "保存断言"
426
- }), /* @__PURE__ */ G(C, {
428
+ }), /* @__PURE__ */ W(T, {
427
429
  onClick: a,
428
430
  children: "取消"
429
431
  })]
@@ -438,11 +440,12 @@ var tt = {
438
440
  supplement: "_supplement_1qtxy_10"
439
441
  };
440
442
  // src/pages/assistant/components/StepSupplement/index.tsx
441
- function nt({ step: e, disabled: t, onApply: n }) {
442
- let r = b(), [i, a] = x("click"), [o, s] = x(""), [c, l] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, h] = x("");
443
- return /* @__PURE__ */ G(T, {
443
+ function nt({ step: e, disabled: t, defaultExpanded: n = !1, onApply: r }) {
444
+ let i = x(), [a, o] = S("click"), [s, c] = S(""), [l, u] = S(""), [d, f] = S(""), [p, m] = S(!0), [h, g] = S("");
445
+ return /* @__PURE__ */ W(E, {
444
446
  className: tt.supplement,
445
447
  "data-assistant-part": "supplement",
448
+ defaultActiveKey: n ? ["details"] : [],
446
449
  ghost: !0,
447
450
  size: "small",
448
451
  styles: {
@@ -455,27 +458,27 @@ function nt({ step: e, disabled: t, onApply: n }) {
455
458
  },
456
459
  items: [{
457
460
  key: "details",
458
- label: /* @__PURE__ */ G(W, { children: "补充为可执行步骤" }),
459
- children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
461
+ label: /* @__PURE__ */ W(U, { children: "补充为可执行步骤" }),
462
+ children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
460
463
  className: tt.hint,
461
464
  "data-assistant-part": "hint",
462
465
  children: "补充步骤不会改写原始事件。无法定位控件时,可退出选段后重新录制。"
463
- }), /* @__PURE__ */ K("div", {
466
+ }), /* @__PURE__ */ G("div", {
464
467
  className: tt.formStack,
465
468
  "data-assistant-part": "form-stack",
466
469
  children: [
467
- /* @__PURE__ */ K("div", {
470
+ /* @__PURE__ */ G("div", {
468
471
  className: tt.field,
469
472
  "data-assistant-part": "field",
470
- children: [/* @__PURE__ */ G("label", {
471
- htmlFor: r,
473
+ children: [/* @__PURE__ */ W("label", {
474
+ htmlFor: i,
472
475
  children: "操作类型"
473
- }), /* @__PURE__ */ G(D, {
474
- id: r,
476
+ }), /* @__PURE__ */ W(O, {
477
+ id: i,
475
478
  "aria-label": "补充操作类型",
476
- value: i,
479
+ value: a,
477
480
  disabled: t,
478
- onChange: a,
481
+ onChange: o,
479
482
  style: { width: "100%" },
480
483
  options: [
481
484
  {
@@ -505,35 +508,35 @@ function nt({ step: e, disabled: t, onApply: n }) {
505
508
  ]
506
509
  })]
507
510
  }),
508
- i !== "assert-text" && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("div", {
511
+ a !== "assert-text" && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
509
512
  className: tt.field,
510
513
  "data-assistant-part": "field",
511
- children: [/* @__PURE__ */ G("label", {
512
- htmlFor: `${r}-selector`,
514
+ children: [/* @__PURE__ */ W("label", {
515
+ htmlFor: `${i}-selector`,
513
516
  children: "CSS 定位"
514
- }), /* @__PURE__ */ G(E, {
515
- id: `${r}-selector`,
516
- prefix: /* @__PURE__ */ G(N, {}),
517
+ }), /* @__PURE__ */ W(D, {
518
+ id: `${i}-selector`,
519
+ prefix: /* @__PURE__ */ W(ve, {}),
517
520
  placeholder: "例如 button[aria-label=\"展开\"]",
518
521
  maxLength: 2e3,
519
- value: o,
522
+ value: s,
520
523
  disabled: t,
521
- onChange: (e) => s(e.target.value)
524
+ onChange: (e) => c(e.target.value)
522
525
  })]
523
- }), /* @__PURE__ */ K("div", {
526
+ }), /* @__PURE__ */ G("div", {
524
527
  className: tt.field,
525
528
  "data-assistant-part": "field",
526
- children: [/* @__PURE__ */ G("label", {
527
- htmlFor: `${r}-label`,
529
+ children: [/* @__PURE__ */ W("label", {
530
+ htmlFor: `${i}-label`,
528
531
  children: "控件文字"
529
- }), /* @__PURE__ */ G(E, {
530
- id: `${r}-label`,
531
- prefix: /* @__PURE__ */ G(F, {}),
532
+ }), /* @__PURE__ */ W(D, {
533
+ id: `${i}-label`,
534
+ prefix: /* @__PURE__ */ W(xe, {}),
532
535
  placeholder: "如按钮文字、无障碍名称或输入提示",
533
536
  maxLength: 200,
534
- value: c,
537
+ value: l,
535
538
  disabled: t,
536
- onChange: (e) => l(e.target.value)
539
+ onChange: (e) => u(e.target.value)
537
540
  })]
538
541
  })] }),
539
542
  [
@@ -541,67 +544,67 @@ function nt({ step: e, disabled: t, onApply: n }) {
541
544
  "select",
542
545
  "press",
543
546
  "assert-text"
544
- ].includes(i) && /* @__PURE__ */ K("div", {
547
+ ].includes(a) && /* @__PURE__ */ G("div", {
545
548
  className: tt.field,
546
549
  "data-assistant-part": "field",
547
- children: [/* @__PURE__ */ G("label", {
548
- htmlFor: `${r}-value`,
549
- children: i === "press" ? "按键" : i === "assert-text" ? "预期文字" : "输入值"
550
- }), /* @__PURE__ */ G(E, {
551
- id: `${r}-value`,
552
- placeholder: i === "press" ? "Enter / Escape / Tab" : void 0,
550
+ children: [/* @__PURE__ */ W("label", {
551
+ htmlFor: `${i}-value`,
552
+ children: a === "press" ? "按键" : a === "assert-text" ? "预期文字" : "输入值"
553
+ }), /* @__PURE__ */ W(D, {
554
+ id: `${i}-value`,
555
+ placeholder: a === "press" ? "Enter / Escape / Tab" : void 0,
553
556
  maxLength: 2e3,
554
- value: u,
557
+ value: d,
555
558
  disabled: t,
556
- onChange: (e) => d(e.target.value)
559
+ onChange: (e) => f(e.target.value)
557
560
  })]
558
561
  }),
559
- i === "check" && /* @__PURE__ */ G(w, {
560
- checked: f,
562
+ a === "check" && /* @__PURE__ */ W(oe, {
563
+ checked: p,
561
564
  disabled: t,
562
- onChange: (e) => p(e.target.checked),
565
+ onChange: (e) => m(e.target.checked),
563
566
  children: "选中"
564
567
  }),
565
- /* @__PURE__ */ G(C, {
566
- icon: /* @__PURE__ */ G(ge, {}),
568
+ /* @__PURE__ */ W(T, {
569
+ icon: /* @__PURE__ */ W(ge, {}),
567
570
  disabled: t,
568
571
  onClick: () => {
569
572
  try {
570
- if (i !== "assert-text") {
571
- if (!o.trim() || !c.trim()) throw Error("请补充定位及控件文字");
572
- document.querySelector(o);
573
+ if (a !== "assert-text") {
574
+ if (!s.trim() || !l.trim()) throw Error("请补充定位及控件文字");
575
+ document.querySelector(s);
573
576
  }
574
- if (i === "assert-text" && !u.trim()) throw Error("检查点文字不能为空");
575
- if (i === "press" && ![
577
+ if (a === "assert-text" && !d.trim()) throw Error("检查点文字不能为空");
578
+ if (a === "press" && ![
576
579
  "Enter",
577
580
  "Escape",
578
581
  "Tab"
579
- ].includes(u)) throw Error("请选择支持的按键");
580
- n({
581
- kind: i,
582
+ ].includes(d)) throw Error("请选择支持的按键");
583
+ r({
584
+ kind: a,
582
585
  supplemented: !0,
583
586
  ...e.sourceEventId ? { sourceEventId: e.sourceEventId } : {},
584
- ...i === "assert-text" ? {} : { target: {
585
- selector: o.trim(),
586
- label: c.trim()
587
+ ...a === "assert-text" ? {} : { target: {
588
+ selector: s.trim(),
589
+ label: l.trim()
587
590
  } },
588
591
  ...[
589
592
  "fill",
590
593
  "select",
591
594
  "press",
592
595
  "assert-text"
593
- ].includes(i) ? { value: u } : {},
594
- ...i === "check" ? { checked: f } : {}
595
- }), h("");
596
+ ].includes(a) ? { value: d } : {},
597
+ ...a === "check" ? { checked: p } : {}
598
+ }), g("");
596
599
  } catch (e) {
597
- h(e instanceof Error ? e.message : "内容无效");
600
+ g(e instanceof Error ? e.message : "内容无效");
598
601
  }
599
602
  },
600
603
  children: "应用补充"
601
604
  }),
602
- m && /* @__PURE__ */ G("span", {
605
+ h && /* @__PURE__ */ W("span", {
603
606
  role: "alert",
604
- children: m
607
+ children: h
605
608
  })
606
609
  ]
607
610
  })] })
@@ -661,8 +664,8 @@ var it = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchPar
661
664
  decisions: 0
662
665
  };
663
666
  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();
665
- y(() => {
667
+ let [r, i] = S(st), [a, o] = S(), [s, c] = S(""), [l, u] = S(!1), [d, f] = S(!1), [p, m] = S(""), [h, g] = S(!1), [_, v] = S();
668
+ b(() => {
666
669
  let t = !1, r, a = async () => {
667
670
  try {
668
671
  let r = await rt(e, "status");
@@ -677,7 +680,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
677
680
  t = !0, clearTimeout(r);
678
681
  };
679
682
  }, [e, n]);
680
- let v = d || r.state === "running", b = async (t) => {
683
+ let y = d || r.state === "running", x = async (t) => {
681
684
  f(!0), m("");
682
685
  try {
683
686
  let r = await rt(e, t, {
@@ -691,13 +694,13 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
691
694
  } finally {
692
695
  f(!1);
693
696
  }
694
- }, te = (t, n) => r.id && /* @__PURE__ */ G(C, {
697
+ }, ee = (t, n) => r.id && /* @__PURE__ */ W(T, {
695
698
  type: "link",
696
- icon: /* @__PURE__ */ G(be, {}),
699
+ icon: /* @__PURE__ */ W(be, {}),
697
700
  href: it(e, r.id, t),
698
701
  children: n
699
702
  });
700
- return /* @__PURE__ */ K(se, {
703
+ return /* @__PURE__ */ G(ae, {
701
704
  className: Z.card,
702
705
  "aria-label": "自主探索",
703
706
  "data-assistant-part": "agent-card",
@@ -708,32 +711,32 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
708
711
  gap: 16
709
712
  } },
710
713
  children: [
711
- /* @__PURE__ */ K("div", {
714
+ /* @__PURE__ */ G("div", {
712
715
  className: Z.cardHeading,
713
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(xe, {}), "自主探索"] }), /* @__PURE__ */ G(O, {
714
- color: v ? "processing" : r.state === "passed" ? "success" : "default",
716
+ children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(F, {}), "自主探索"] }), /* @__PURE__ */ W(k, {
717
+ color: y ? "processing" : r.state === "passed" ? "success" : "default",
715
718
  children: at[r.state]
716
719
  })]
717
720
  }),
718
- h ? !a?.configured && /* @__PURE__ */ G(S, {
721
+ h ? !a?.configured && /* @__PURE__ */ W(w, {
719
722
  type: "info",
720
723
  title: a?.message ?? "模型尚未配置"
721
- }) : /* @__PURE__ */ G(S, {
724
+ }) : /* @__PURE__ */ W(w, {
722
725
  type: "info",
723
726
  title: "自主探索服务未连接,请启动宿主的 Laya 服务。"
724
727
  }),
725
- /* @__PURE__ */ K("div", {
728
+ /* @__PURE__ */ G("div", {
726
729
  className: Z.field,
727
- children: [/* @__PURE__ */ G("label", {
730
+ children: [/* @__PURE__ */ W("label", {
728
731
  htmlFor: "assistant-explore-target",
729
732
  children: "测试页面"
730
- }), /* @__PURE__ */ G(D, {
733
+ }), /* @__PURE__ */ W(O, {
731
734
  id: "assistant-explore-target",
732
735
  "aria-label": "自主探索测试页面",
733
736
  placeholder: "选择测试页面",
734
737
  showSearch: !0,
735
738
  value: s || void 0,
736
- disabled: v || t,
739
+ disabled: y || t,
737
740
  onChange: c,
738
741
  options: a?.targets.map((e) => ({
739
742
  label: e,
@@ -741,30 +744,30 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
741
744
  })) ?? []
742
745
  })]
743
746
  }),
744
- /* @__PURE__ */ G(w, {
745
- disabled: v || t,
747
+ /* @__PURE__ */ W(oe, {
748
+ disabled: y || t,
746
749
  checked: l,
747
750
  onChange: (e) => u(e.target.checked),
748
751
  children: "允许创建、修改和删除本轮测试数据"
749
752
  }),
750
- /* @__PURE__ */ G("div", {
753
+ /* @__PURE__ */ W("div", {
751
754
  className: Z.buttonRow,
752
- children: v ? /* @__PURE__ */ G(C, {
755
+ children: y ? /* @__PURE__ */ W(T, {
753
756
  type: "primary",
754
757
  danger: !0,
755
- icon: /* @__PURE__ */ G(Fe, {}),
756
- disabled: !v || d,
757
- onClick: () => void b("stop"),
758
+ icon: /* @__PURE__ */ W(V, {}),
759
+ disabled: !y || d,
760
+ onClick: () => void x("stop"),
758
761
  children: "停止探索"
759
- }) : /* @__PURE__ */ G(C, {
762
+ }) : /* @__PURE__ */ W(T, {
760
763
  type: "primary",
761
- icon: /* @__PURE__ */ G(xe, {}),
762
- disabled: v || t || !s || !h || !a?.configured,
763
- onClick: () => void b("explore"),
764
+ icon: /* @__PURE__ */ W(F, {}),
765
+ disabled: y || t || !s || !h || !a?.configured,
766
+ onClick: () => void x("explore"),
764
767
  children: "开始自主探索"
765
768
  })
766
769
  }),
767
- r.state !== "idle" && /* @__PURE__ */ K("span", {
770
+ r.state !== "idle" && /* @__PURE__ */ G("span", {
768
771
  className: Z.hint,
769
772
  children: [
770
773
  r.message,
@@ -772,39 +775,39 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
772
775
  r.decisions > 0 && `· ${r.decisions} 次模型决策`
773
776
  ]
774
777
  }),
775
- p && /* @__PURE__ */ G(S, {
778
+ p && /* @__PURE__ */ W(w, {
776
779
  closable: !0,
777
780
  type: "error",
778
781
  title: p,
779
782
  onClose: () => m("")
780
783
  }),
781
- /* @__PURE__ */ K("div", {
784
+ /* @__PURE__ */ G("div", {
782
785
  className: Z.buttonRow,
783
786
  children: [
784
- r.workbook && te(r.workbook, "下载 Excel 用例"),
785
- r.id && !v && r.cases.length > 0 && te("results.xlsx", "下载执行报告"),
786
- r.trace && te(r.trace, "下载 Trace")
787
+ r.workbook && ee(r.workbook, "下载 Excel 用例"),
788
+ r.id && !y && r.cases.length > 0 && ee("results.xlsx", "下载执行报告"),
789
+ r.trace && ee(r.trace, "下载 Trace")
787
790
  ]
788
791
  }),
789
- /* @__PURE__ */ G(T, {
792
+ /* @__PURE__ */ W(E, {
790
793
  size: "small",
791
794
  items: [{
792
795
  key: "replay",
793
796
  label: "Excel 回放",
794
- children: /* @__PURE__ */ K("div", {
797
+ children: /* @__PURE__ */ G("div", {
795
798
  className: Z.stack,
796
799
  children: [
797
- /* @__PURE__ */ G("span", {
800
+ /* @__PURE__ */ W("span", {
798
801
  className: Z.hint,
799
802
  children: "使用自主探索生成的 Excel,入口需与所选测试页面一致。"
800
803
  }),
801
- /* @__PURE__ */ K("div", {
804
+ /* @__PURE__ */ G("div", {
802
805
  className: Z.buttonRow,
803
- children: [/* @__PURE__ */ G(me, {
806
+ children: [/* @__PURE__ */ W(pe, {
804
807
  accept: ".xlsx",
805
808
  maxCount: 1,
806
809
  showUploadList: !1,
807
- disabled: v || t,
810
+ disabled: y || t,
808
811
  beforeUpload: async (e) => {
809
812
  try {
810
813
  if (e.size > 2097152) throw Error("Excel 文件不能超过 2 MB");
@@ -812,7 +815,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
812
815
  let r = new FileReader();
813
816
  r.onload = () => t(String(r.result).split(",")[1]), r.onerror = n, r.readAsDataURL(e);
814
817
  });
815
- ee({
818
+ v({
816
819
  name: e.name,
817
820
  data: t
818
821
  }), m("");
@@ -821,54 +824,54 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
821
824
  }
822
825
  return !1;
823
826
  },
824
- children: /* @__PURE__ */ G(C, {
827
+ children: /* @__PURE__ */ W(T, {
825
828
  type: "text",
826
- icon: /* @__PURE__ */ G(Ie, {}),
827
- disabled: v || t,
829
+ icon: /* @__PURE__ */ W(H, {}),
830
+ disabled: y || t,
828
831
  children: "导入 Excel"
829
832
  })
830
- }), /* @__PURE__ */ G(C, {
833
+ }), /* @__PURE__ */ W(T, {
831
834
  type: "primary",
832
- icon: /* @__PURE__ */ G(Me, {}),
833
- disabled: v || t || !h || !a?.configured || !s || !_,
834
- onClick: () => void b("replay"),
835
+ icon: /* @__PURE__ */ W(Pe, {}),
836
+ disabled: y || t || !h || !a?.configured || !s || !_,
837
+ onClick: () => void x("replay"),
835
838
  children: "新会话回放"
836
839
  })]
837
840
  }),
838
- _ && /* @__PURE__ */ G("span", { children: _.name })
841
+ _ && /* @__PURE__ */ W("span", { children: _.name })
839
842
  ]
840
843
  })
841
844
  }]
842
845
  }),
843
- r.cases.length > 0 && /* @__PURE__ */ G(T, {
846
+ r.cases.length > 0 && /* @__PURE__ */ W(E, {
844
847
  size: "small",
845
848
  items: r.cases.map((e) => ({
846
849
  key: e.id,
847
- label: /* @__PURE__ */ K("div", {
850
+ label: /* @__PURE__ */ G("div", {
848
851
  className: Z.caseHeading,
849
- children: [/* @__PURE__ */ G(O, {
852
+ children: [/* @__PURE__ */ W(k, {
850
853
  color: e.state === "passed" ? "success" : e.state === "failed" ? "error" : "default",
851
854
  children: ot[e.state]
852
- }), /* @__PURE__ */ G("span", { children: e.title })]
855
+ }), /* @__PURE__ */ W("span", { children: e.title })]
853
856
  }),
854
- children: /* @__PURE__ */ K("div", {
857
+ children: /* @__PURE__ */ G("div", {
855
858
  className: Z.stack,
856
859
  children: [
857
- /* @__PURE__ */ G("span", { children: e.reason }),
858
- e.assertions.map((e, t) => /* @__PURE__ */ G(S, {
860
+ /* @__PURE__ */ W("span", { children: e.reason }),
861
+ e.assertions.map((e, t) => /* @__PURE__ */ W(w, {
859
862
  type: e.passed ? "success" : "error",
860
863
  title: e.expected,
861
864
  description: `实际:${e.actual}`
862
865
  }, t)),
863
- e.errors.map((e, t) => /* @__PURE__ */ G(S, {
866
+ e.errors.map((e, t) => /* @__PURE__ */ W(w, {
864
867
  type: "error",
865
868
  title: e
866
869
  }, t)),
867
- e.cleanup && /* @__PURE__ */ G("span", {
870
+ e.cleanup && /* @__PURE__ */ W("span", {
868
871
  className: Z.hint,
869
872
  children: e.cleanup
870
873
  }),
871
- e.screenshot && te(e.screenshot, "查看截图证据")
874
+ e.screenshot && ee(e.screenshot, "查看截图证据")
872
875
  ]
873
876
  })
874
877
  }))
@@ -878,7 +881,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
878
881
  }
879
882
  // src/pages/assistant/components/TestLibraryPanel/libraryRequest.ts
880
883
  function lt(e) {
881
- return v(async (t = "", n = "GET", r, i) => {
884
+ return y(async (t = "", n = "GET", r, i) => {
882
885
  let a = await fetch(e + t, {
883
886
  method: n,
884
887
  headers: {
@@ -896,20 +899,22 @@ function lt(e) {
896
899
  }, [e]);
897
900
  }
898
901
  var Q = {
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"
902
+ card: "_card_hzvqq_1 _card_13kbl_633",
903
+ hint: "_hint_hzvqq_4 _hint_13kbl_515",
904
+ buttonRow: "_buttonRow_hzvqq_7 _buttonRow_13kbl_627",
905
+ stack: "_stack_hzvqq_10",
906
+ list: "_list_hzvqq_11",
907
+ entryLink: "_entryLink_hzvqq_26",
908
+ resourceList: "_resourceList_hzvqq_33",
909
+ header: "_header_hzvqq_54",
910
+ headerAction: "_headerAction_hzvqq_71",
911
+ tabAction: "_tabAction_hzvqq_75",
912
+ fitButton: "_fitButton_hzvqq_78",
913
+ resourceName: "_resourceName_hzvqq_88",
914
+ breadcrumbs: "_breadcrumbs_hzvqq_95",
915
+ breadcrumbName: "_breadcrumbName_hzvqq_103",
916
+ stickyToolbar: "_stickyToolbar_hzvqq_106",
917
+ libraryTabs: "_libraryTabs_hzvqq_122"
913
918
  }, ut = {
914
919
  running: "执行中",
915
920
  stopping: "停止中",
@@ -921,233 +926,243 @@ var Q = {
921
926
  interrupted: "已中断"
922
927
  };
923
928
  function dt({ run: e, base: t, onExport: n }) {
924
- return /* @__PURE__ */ K("div", {
929
+ return /* @__PURE__ */ G("div", {
925
930
  className: Q.stack,
926
931
  children: [
927
- /* @__PURE__ */ G("div", {
932
+ n && /* @__PURE__ */ W("div", {
928
933
  className: Q.buttonRow,
929
- children: /* @__PURE__ */ G(C, {
934
+ children: /* @__PURE__ */ W(T, {
930
935
  type: "text",
931
936
  onClick: n,
932
937
  children: "导出报告 JSON"
933
938
  })
934
939
  }),
935
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(O, { children: ut[e.state] ?? e.state }), e.message] }),
936
- e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ K("details", { children: [/* @__PURE__ */ K("summary", { children: [
937
- "第 ",
938
- n,
939
- " / ",
940
- e.repeat,
941
- " 轮 · ",
942
- r.length,
943
- " 个用例"
944
- ] }), /* @__PURE__ */ G("ul", {
945
- className: Q.list,
946
- children: r.map((r) => /* @__PURE__ */ K("li", { children: [
947
- /* @__PURE__ */ K("strong", { children: [
948
- r.suiteName,
949
- " · ",
950
- r.caseName
951
- ] }),
952
- /* @__PURE__ */ G("code", { children: r.url ?? r.path }),
953
- /* @__PURE__ */ K("span", { children: [
954
- /* @__PURE__ */ G(O, { children: ut[r.status.state] ?? r.status.state }),
955
- "步骤 ",
956
- r.status.step,
957
- " / ",
958
- r.status.total,
959
- " · ",
960
- r.status.message
961
- ] }),
962
- r.status.failure && /* @__PURE__ */ K("div", { children: [
963
- /* @__PURE__ */ G("strong", { children: "已观察" }),
964
- /* @__PURE__ */ K("div", { children: [
965
- r.status.failure.label,
966
- " ",
967
- r.status.failure.selector && /* @__PURE__ */ G("code", { children: r.status.failure.selector })
940
+ /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(k, { children: ut[e.state] ?? e.state }), e.message] }),
941
+ e.iterations?.map(({ iteration: r, cases: i }) => /* @__PURE__ */ G("details", {
942
+ open: !n || void 0,
943
+ children: [/* @__PURE__ */ G("summary", { children: [
944
+ "第 ",
945
+ r,
946
+ " / ",
947
+ e.repeat,
948
+ " 轮 · ",
949
+ i.length,
950
+ " 个用例"
951
+ ] }), /* @__PURE__ */ W("ul", {
952
+ className: Q.list,
953
+ children: i.map((n) => /* @__PURE__ */ G("li", { children: [
954
+ /* @__PURE__ */ G("strong", { children: [
955
+ n.suiteName,
956
+ " · ",
957
+ n.caseName
968
958
  ] }),
969
- r.status.failure.matchedCount !== void 0 && /* @__PURE__ */ K("div", { children: [
970
- "匹配到 ",
971
- r.status.failure.matchedCount,
972
- " 个元素"
959
+ /* @__PURE__ */ W("code", { children: n.url ?? n.path }),
960
+ /* @__PURE__ */ G("span", { children: [
961
+ /* @__PURE__ */ W(k, { children: ut[n.status.state] ?? n.status.state }),
962
+ "步骤 ",
963
+ n.status.step,
964
+ " / ",
965
+ n.status.total,
966
+ " · ",
967
+ n.status.message
973
968
  ] }),
974
- r.status.failure.hint && /* @__PURE__ */ K("div", { children: ["建议检查:", r.status.failure.hint] })
975
- ] }),
976
- r.status.assertions?.map((e) => /* @__PURE__ */ K("div", { children: [
977
- /* @__PURE__ */ G(O, {
978
- color: e.passed ? "green" : "red",
979
- children: e.passed ? "通过" : "失败"
980
- }),
981
- "第 ",
982
- e.step,
983
- " 步 · ",
984
- e.name,
985
- " · 期望 ",
986
- e.expected,
987
- " · 实际",
988
- " ",
989
- e.actual
990
- ] }, e.step)),
991
- r.trace && /* @__PURE__ */ K("div", {
992
- className: Q.buttonRow,
993
- children: [/* @__PURE__ */ G(C, {
994
- size: "small",
995
- href: `${t}/runs/${e.id}/trace?iteration=${n}&caseIndex=${r.caseIndex}`,
996
- download: !0,
997
- children: "下载 Trace"
998
- }), /* @__PURE__ */ G("small", {
999
- className: Q.hint,
1000
- children: "含页面与网络信息,仅在本机查看"
1001
- })]
1002
- })
1003
- ] }, r.caseIndex))
1004
- })] }, n))
969
+ n.status.failure && /* @__PURE__ */ G("div", { children: [
970
+ /* @__PURE__ */ W("strong", { children: "已观察" }),
971
+ /* @__PURE__ */ G("div", { children: [
972
+ n.status.failure.label,
973
+ " ",
974
+ n.status.failure.selector && /* @__PURE__ */ W("code", { children: n.status.failure.selector })
975
+ ] }),
976
+ n.status.failure.matchedCount !== void 0 && /* @__PURE__ */ G("div", { children: [
977
+ "匹配到 ",
978
+ n.status.failure.matchedCount,
979
+ " 个元素"
980
+ ] }),
981
+ n.status.failure.hint && /* @__PURE__ */ G("div", { children: ["建议检查:", n.status.failure.hint] })
982
+ ] }),
983
+ n.status.assertions?.map((e) => /* @__PURE__ */ G("div", { children: [
984
+ /* @__PURE__ */ W(k, {
985
+ color: e.passed ? "green" : "red",
986
+ children: e.passed ? "通过" : "失败"
987
+ }),
988
+ "第 ",
989
+ e.step,
990
+ " 步 · ",
991
+ e.name,
992
+ " · 期望 ",
993
+ e.expected,
994
+ " · 实际",
995
+ " ",
996
+ e.actual
997
+ ] }, e.step)),
998
+ n.trace && /* @__PURE__ */ G("div", {
999
+ className: Q.buttonRow,
1000
+ children: [/* @__PURE__ */ W(T, {
1001
+ size: "small",
1002
+ href: `${t}/runs/${e.id}/trace?iteration=${r}&caseIndex=${n.caseIndex}`,
1003
+ download: !0,
1004
+ children: "下载 Trace"
1005
+ }), /* @__PURE__ */ W("small", {
1006
+ className: Q.hint,
1007
+ children: "含页面与网络信息,仅在本机查看"
1008
+ })]
1009
+ })
1010
+ ] }, n.caseIndex))
1011
+ })]
1012
+ }, r))
1005
1013
  ]
1006
1014
  });
1007
1015
  }
1008
1016
  // src/pages/assistant/components/TestLibraryPanel/LibraryDetail.tsx
1009
- function ft({ options: e, values: t, onChange: n }) {
1010
- return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(D, {
1017
+ function ft({ options: e, values: t, disabled: n = !1, onOpen: r, onChange: i }) {
1018
+ return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(O, {
1011
1019
  "aria-label": "添加到执行顺序",
1012
1020
  placeholder: "选择要添加的项目",
1013
1021
  value: null,
1014
1022
  options: e,
1015
- disabled: !e.length,
1023
+ disabled: n || !e.length,
1016
1024
  onChange: (e) => {
1017
- e && n([...t, e]);
1025
+ e && i([...t, e]);
1018
1026
  }
1019
- }), /* @__PURE__ */ G("ol", {
1027
+ }), /* @__PURE__ */ W("ol", {
1020
1028
  className: Q.list,
1021
- children: t.map((r, i) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G("span", { children: e.find(({ value: e }) => e === r)?.label ?? r }), /* @__PURE__ */ K("div", {
1029
+ children: t.map((a, o) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W("span", { children: r ? /* @__PURE__ */ W(T, {
1030
+ type: "link",
1031
+ size: "small",
1032
+ disabled: n,
1033
+ onClick: () => r(a),
1034
+ children: e.find(({ value: e }) => e === a)?.label ?? a
1035
+ }) : e.find(({ value: e }) => e === a)?.label ?? a }), /* @__PURE__ */ G("div", {
1022
1036
  className: Q.buttonRow,
1023
- children: [/* @__PURE__ */ G(C, {
1037
+ children: [/* @__PURE__ */ W(T, {
1024
1038
  size: "small",
1025
1039
  type: "text",
1026
- "aria-label": `上移第 ${i + 1} 项`,
1027
- disabled: i === 0,
1040
+ "aria-label": `上移第 ${o + 1} 项`,
1041
+ disabled: n || o === 0,
1028
1042
  onClick: () => {
1029
1043
  let e = [...t];
1030
- [e[i - 1], e[i]] = [e[i], e[i - 1]], n(e);
1044
+ [e[o - 1], e[o]] = [e[o], e[o - 1]], i(e);
1031
1045
  },
1032
1046
  children: "上移"
1033
- }), /* @__PURE__ */ G(C, {
1047
+ }), /* @__PURE__ */ W(T, {
1034
1048
  size: "small",
1035
1049
  type: "text",
1036
- "aria-label": `移除第 ${i + 1} 项`,
1037
- onClick: () => n(t.filter((e, t) => t !== i)),
1050
+ "aria-label": `移除第 ${o + 1} 项`,
1051
+ disabled: n,
1052
+ onClick: () => i(t.filter((e, t) => t !== o)),
1038
1053
  children: "移除"
1039
1054
  })]
1040
- })] }, i))
1055
+ })] }, o))
1041
1056
  })] });
1042
1057
  }
1043
1058
  function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderCase: u }) {
1044
- let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, w] = x(), [T, ce] = x(), [le, pe] = x(!1), [me, k] = x(!1), [A, j] = x(), he = !!(A && A.baseline !== JSON.stringify(i)), M = () => !s && (!he || window.confirm("当前用例有未保存修改,确定离开?")), ge = (e, t, n) => {
1045
- o(e), w(t), be(void 0), ce(n), j({
1059
+ let [d, f] = S(), [m, h] = S([]), [g, _] = S(), [v, x] = S("cases"), te = ne(null), [C, re] = S(!1), [ie, oe] = S(""), [E, se] = S(), [ce, fe] = S(!1), [pe, me] = S(!1), [he, A] = S(!1), [j, M] = S(), ge = !!(j && j.baseline !== JSON.stringify(i)), _e = () => !s && (!ge || window.confirm("当前用例有未保存修改,确定离开?")), ve = (e, t, n) => {
1060
+ o(e), se(t), Se(void 0), M({
1046
1061
  caseId: t,
1047
1062
  suiteId: n,
1048
1063
  baseline: JSON.stringify(e)
1049
- }), _("cases");
1050
- }, _e = (e) => {
1051
- !b && !s && M() && Le() && Re() && (j(void 0), pe(!1), k(!1), _(e));
1052
- }, [N, P] = x({
1064
+ }), x("cases");
1065
+ }, ye = (e) => {
1066
+ !C && !s && _e() && Ve() && He() && (M(void 0), se(void 0), V && P(V), me(!1), fe(!1), A(!1), x(e));
1067
+ }, [N, P] = S({
1053
1068
  id: "",
1054
1069
  name: "",
1055
1070
  caseIds: []
1056
- }), ve = re(null), [ye, be] = x(), [F, I] = x({
1071
+ }), be = ne(null), [xe, Se] = S(), [F, Ce] = S({
1057
1072
  id: "",
1058
1073
  name: "",
1059
1074
  suiteIds: [],
1060
1075
  repeat: 1
1061
- }), [xe, Se] = x(), [Ce, we] = x();
1062
- y(() => {
1063
- c && d && !s && !b && ((!he || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Le() && Re() && (pe(!1), k(!1), w(void 0), ce(void 0), o(c), j({ baseline: "" }), _("cases")), l?.());
1076
+ }), [we, Te] = S(), [Ee, De] = S();
1077
+ b(() => {
1078
+ c && d && !s && !C && ((!ge || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Ve() && He() && (fe(!1), A(!1), se(void 0), o(c), M({ baseline: "" }), x("cases")), l?.());
1064
1079
  }, [
1065
1080
  c,
1066
1081
  d,
1067
1082
  s,
1068
- b,
1069
- he,
1083
+ C,
1084
+ ge,
1070
1085
  o,
1071
1086
  l
1072
1087
  ]);
1073
- let Te = xe ?? m[0]?.id, Ee = m.some((e) => e.state === "running" || e.state === "stopping"), L = lt(e), R = async (e) => {
1074
- if (!b) {
1075
- ne(!0), ae("");
1088
+ let Oe = we ?? m[0]?.id, ke = g?.state === "running" || g?.state === "stopping", Ae = ke || m.some((e) => e.state === "running" || e.state === "stopping"), I = lt(e), L = async (e) => {
1089
+ if (!C) {
1090
+ re(!0), oe("");
1076
1091
  try {
1077
1092
  await e();
1078
1093
  } catch (e) {
1079
- ae(e instanceof Error ? e.message : "操作失败");
1094
+ oe(e instanceof Error ? e.message : "操作失败");
1080
1095
  } finally {
1081
- ne(!1);
1096
+ re(!1);
1082
1097
  }
1083
1098
  }
1084
- }, De = v(async (e) => {
1085
- let t = await L("", "GET", void 0, e);
1099
+ }, je = y(async (e) => {
1100
+ let t = await I("", "GET", void 0, e);
1086
1101
  if (t.version !== 1 || !Array.isArray(t.cases)) throw Error("本机测试库服务版本不匹配");
1087
- let n = await L("/runs", "GET", void 0, e);
1088
- e?.aborted || (f(t), h(n));
1089
- }, [L]), z = () => void R(De);
1090
- y(() => {
1102
+ let n = await I("/runs", "GET", void 0, e), r = await I("/execution", "GET", void 0, e);
1103
+ e?.aborted || (_(r?.id ? r : void 0), f(t), h(n));
1104
+ }, [I]), Me = () => void L(je);
1105
+ b(() => {
1091
1106
  let e = new AbortController();
1092
- return ne(!0), De(e.signal).catch((t) => {
1093
- e.signal.aborted || ae(t instanceof Error ? t.message : "本机测试库服务未连接");
1107
+ return re(!0), je(e.signal).catch((t) => {
1108
+ e.signal.aborted || oe(t instanceof Error ? t.message : "本机测试库服务未连接");
1094
1109
  }).finally(() => {
1095
- e.signal.aborted || ne(!1);
1110
+ e.signal.aborted || re(!1);
1096
1111
  }), () => e.abort();
1097
- }, [De]), y(() => {
1098
- if (!Ee && (!Te || g !== "reports")) return;
1112
+ }, [je]), b(() => {
1113
+ if (!Ae && (!Oe || v !== "reports")) return;
1099
1114
  let e = new AbortController(), t = async () => {
1100
- let t = await L("/runs", "GET", void 0, e.signal), n = g === "reports" && Te ? await L(`/runs/${Te}`, "GET", void 0, e.signal) : void 0;
1101
- e.signal.aborted || (h(t), n && we(n));
1115
+ let t = await I("/runs", "GET", void 0, e.signal), n = await I("/execution", "GET", void 0, e.signal), r = v === "reports" && Oe ? await I(`/runs/${Oe}`, "GET", void 0, e.signal) : void 0;
1116
+ e.signal.aborted || (h(t), _(n?.id ? n : void 0), r && De(r));
1102
1117
  }, n = () => void t().catch(() => {});
1103
1118
  n();
1104
- let r = Ee ? setInterval(n, 1e3) : void 0;
1119
+ let r = Ae ? setInterval(n, 1e3) : void 0;
1105
1120
  return () => {
1106
1121
  clearInterval(r), e.abort();
1107
1122
  };
1108
1123
  }, [
1109
- L,
1110
- Te,
1111
- Ee,
1112
- g
1124
+ I,
1125
+ Oe,
1126
+ Ae,
1127
+ v,
1128
+ g?.id
1113
1129
  ]);
1114
- let Oe = async (e) => {
1115
- f(await L("", "PUT", e));
1116
- }, ke = (e, t) => {
1130
+ let R = async (e) => {
1131
+ f(await I("", "PUT", e));
1132
+ }, Ne = (e, t) => {
1117
1133
  let n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
1118
1134
  r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
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 }) => ({
1135
+ }, Pe = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], z = !a && !C && !Ae, Fe = d?.cases.map(({ id: e, testCase: t }) => ({
1120
1136
  label: t.name,
1121
1137
  value: e
1122
- })) ?? [], Me = d?.suites.map(({ id: e, name: t }) => ({
1138
+ })) ?? [], Ie = d?.suites.map(({ id: e, name: t }) => ({
1123
1139
  label: t,
1124
1140
  value: e
1125
- })) ?? [], V = d?.cases.find(({ id: e }) => e === oe), Ne = V ? d?.suites.filter((e) => !e.caseIds.includes(V.id)) ?? [] : [], H = d?.suites.find(({ id: e }) => e === N.id), U = d?.plans.find(({ id: e }) => e === F.id), Pe = H?.caseIds ?? [], Fe = N.name !== (H?.name ?? "") || JSON.stringify(N.caseIds) !== JSON.stringify(Pe), Ie = F.name !== (U?.name ?? "") || F.repeat !== (U?.repeat ?? 1) || JSON.stringify(F.suiteIds) !== JSON.stringify(U?.suiteIds ?? []), Le = () => !le || !Fe || window.confirm("当前套件有未保存修改,确定放弃?"), Re = () => !me || !Ie || window.confirm("当前计划有未保存修改,确定放弃?");
1126
- te(() => {
1127
- let e = ee.current?.closest("[role=\"dialog\"]");
1128
- if (e) for (let t = ee.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
1141
+ })) ?? [], B = d?.cases.find(({ id: e }) => e === E), Le = B ? d?.suites.filter((e) => !e.caseIds.includes(B.id)) ?? [] : [], V = d?.suites.find(({ id: e }) => e === N.id), H = d?.plans.find(({ id: e }) => e === F.id), Re = V?.caseIds ?? [], ze = N.name !== (V?.name ?? "") || JSON.stringify(N.caseIds) !== JSON.stringify(Re), Be = F.name !== (H?.name ?? "") || F.repeat !== (H?.repeat ?? 1) || JSON.stringify(F.suiteIds) !== JSON.stringify(H?.suiteIds ?? []), Ve = () => !ce || !ze || window.confirm("当前套件有未保存修改,确定放弃?"), He = () => !he || !Be || window.confirm("当前计划有未保存修改,确定放弃?");
1142
+ ee(() => {
1143
+ let e = te.current?.closest("[role=\"dialog\"]");
1144
+ if (e) for (let t = te.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
1129
1145
  }, [
1130
- g,
1131
- oe,
1132
- A,
1146
+ v,
1147
+ E,
1148
+ j?.caseId,
1133
1149
  N.id,
1134
- le,
1135
1150
  F.id,
1136
- me
1151
+ he
1137
1152
  ]);
1138
- let ze = g === "cases" ? V?.testCase.name : g === "suites" ? H?.name : g === "plans" ? U?.name : void 0, Be = () => {
1139
- !b && M() && Le() && Re() && (w(void 0), j(void 0), pe(!1), k(!1), P({
1153
+ let K = v === "cases" ? B?.testCase.name : v === "suites" ? V?.name : v === "plans" ? H?.name : void 0, Ue = () => {
1154
+ !C && _e() && Ve() && He() && (se(void 0), M(void 0), fe(!1), me(!1), A(!1), P({
1140
1155
  id: "",
1141
1156
  name: "",
1142
1157
  caseIds: []
1143
- }), I({
1158
+ }), Ce({
1144
1159
  id: "",
1145
1160
  name: "",
1146
1161
  suiteIds: [],
1147
1162
  repeat: 1
1148
1163
  }));
1149
1164
  };
1150
- return /* @__PURE__ */ K(se, {
1165
+ return /* @__PURE__ */ G(ae, {
1151
1166
  className: Q.card,
1152
1167
  "aria-label": "本机测试库",
1153
1168
  styles: { body: {
@@ -1157,156 +1172,174 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1157
1172
  gap: 16
1158
1173
  } },
1159
1174
  children: [
1160
- /* @__PURE__ */ K("header", {
1175
+ /* @__PURE__ */ G("header", {
1161
1176
  className: Q.header,
1162
- children: [/* @__PURE__ */ K("nav", {
1163
- ref: ee,
1177
+ children: [/* @__PURE__ */ G("nav", {
1178
+ ref: te,
1164
1179
  "aria-label": "当前位置",
1165
1180
  className: Q.breadcrumbs,
1166
1181
  children: [
1167
- /* @__PURE__ */ G(C, {
1182
+ /* @__PURE__ */ W(T, {
1168
1183
  type: "link",
1169
1184
  size: "small",
1170
1185
  className: Q.entryLink,
1171
- disabled: b || s,
1186
+ disabled: C || s,
1172
1187
  onClick: () => {
1173
- M() && Le() && Re() && n();
1188
+ _e() && Ve() && He() && n();
1174
1189
  },
1175
1190
  children: "测试库"
1176
1191
  }),
1177
- /* @__PURE__ */ G("span", {
1192
+ /* @__PURE__ */ W("span", {
1178
1193
  "aria-hidden": "true",
1179
1194
  children: "/"
1180
1195
  }),
1181
- ze || A || le || me ? /* @__PURE__ */ K(W, { children: [
1182
- /* @__PURE__ */ G(C, {
1196
+ K || j || ce || he ? /* @__PURE__ */ G(U, { children: [
1197
+ /* @__PURE__ */ W(T, {
1183
1198
  type: "link",
1184
1199
  size: "small",
1185
1200
  className: Q.breadcrumbName,
1186
1201
  title: t,
1187
- disabled: b || s,
1188
- onClick: Be,
1189
- children: /* @__PURE__ */ G("span", {
1202
+ disabled: C || s,
1203
+ onClick: Ue,
1204
+ children: /* @__PURE__ */ W("span", {
1190
1205
  className: Q.resourceName,
1191
1206
  children: t
1192
1207
  })
1193
1208
  }),
1194
- /* @__PURE__ */ G("span", {
1209
+ /* @__PURE__ */ W("span", {
1195
1210
  "aria-hidden": "true",
1196
1211
  children: "/"
1197
1212
  }),
1198
- /* @__PURE__ */ G("span", {
1213
+ /* @__PURE__ */ W("span", {
1199
1214
  "aria-current": "page",
1200
1215
  className: Q.resourceName,
1201
- title: ze,
1202
- children: ze ?? (A ? "新建用例" : le ? "新建套件" : "新建计划")
1216
+ title: K,
1217
+ children: K ?? (j ? "新建用例" : ce ? "新建套件" : "新建计划")
1203
1218
  })
1204
- ] }) : /* @__PURE__ */ G("h3", {
1219
+ ] }) : /* @__PURE__ */ W("h3", {
1205
1220
  className: Q.resourceName,
1206
1221
  title: t,
1207
1222
  children: t
1208
1223
  })
1209
1224
  ]
1210
- }), d && !ze && !A && !le && !me && /* @__PURE__ */ K("div", {
1225
+ }), d && !K && !j && !ce && !he && /* @__PURE__ */ G("div", {
1211
1226
  className: Q.headerAction,
1212
- children: [/* @__PURE__ */ G($e, {
1227
+ children: [/* @__PURE__ */ W($e, {
1213
1228
  label: "测试库更多操作",
1214
1229
  items: [
1215
1230
  {
1216
1231
  key: "rename",
1217
1232
  label: "重命名",
1218
- disabled: !B,
1233
+ disabled: !z,
1219
1234
  onClick: r
1220
1235
  },
1221
1236
  {
1222
1237
  key: "refresh",
1223
1238
  label: "刷新测试库",
1224
- disabled: b,
1225
- onClick: z
1239
+ disabled: C,
1240
+ onClick: Me
1226
1241
  },
1227
1242
  {
1228
1243
  key: "import",
1229
1244
  label: "导入测试库",
1230
- disabled: !B,
1231
- onClick: () => ve.current?.click()
1245
+ disabled: !z,
1246
+ onClick: () => be.current?.click()
1232
1247
  },
1233
1248
  {
1234
1249
  key: "export",
1235
1250
  label: "导出测试库",
1236
1251
  title: "导出包含用例入口的查询参数和片段,分享前请移除敏感值。",
1237
- disabled: b,
1238
- onClick: () => ke(d, "研发小蜜测试库.json")
1252
+ disabled: C,
1253
+ onClick: () => Ne(d, "研发小蜜测试库.json")
1239
1254
  }
1240
1255
  ]
1241
- }), /* @__PURE__ */ G("input", {
1256
+ }), /* @__PURE__ */ W("input", {
1242
1257
  hidden: !0,
1243
1258
  type: "file",
1244
- ref: ve,
1259
+ ref: be,
1245
1260
  accept: ".json,application/json",
1246
1261
  onChange: (e) => {
1247
1262
  let t = e.target.files?.[0];
1248
- e.target.value = "", t && B && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && R(async () => {
1263
+ e.target.value = "", t && z && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && L(async () => {
1249
1264
  if (t.size > 2097152) throw Error("测试库文件不能超过 2 MB");
1250
1265
  let e = JSON.parse(await t.text());
1251
- await Oe({
1266
+ await R({
1252
1267
  ...e,
1253
1268
  revision: d.revision
1254
- }), Be(), Se(void 0), _("cases");
1269
+ }), Ue(), Te(void 0), x("cases");
1255
1270
  });
1256
1271
  }
1257
1272
  })]
1258
1273
  })]
1259
1274
  }),
1260
- ie && /* @__PURE__ */ G(S, {
1275
+ ie && /* @__PURE__ */ W(w, {
1261
1276
  type: "error",
1262
1277
  title: ie,
1263
- action: d && /* @__PURE__ */ G(C, {
1278
+ action: d && /* @__PURE__ */ W(T, {
1264
1279
  type: "text",
1265
1280
  size: "small",
1266
- disabled: b || s,
1267
- onClick: z,
1281
+ disabled: C || s,
1282
+ onClick: Me,
1268
1283
  children: "刷新测试库"
1269
1284
  })
1270
1285
  }),
1271
- d ? /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(fe, {
1272
- activeKey: g,
1273
- onChange: _e,
1274
- tabBarExtraContent: { right: /* @__PURE__ */ K("div", {
1286
+ d ? /* @__PURE__ */ G(U, { children: [g && /* @__PURE__ */ G("section", {
1287
+ className: Q.stack,
1288
+ "aria-label": "单独执行状态",
1289
+ children: [/* @__PURE__ */ G("div", {
1290
+ className: Q.header,
1291
+ children: [/* @__PURE__ */ G("h4", { children: ["单独执行 · ", g.planName] }), ke && /* @__PURE__ */ W(T, {
1292
+ danger: !0,
1293
+ disabled: C || g.state === "stopping",
1294
+ onClick: () => void L(async () => {
1295
+ _(await I("/stop", "POST", {}));
1296
+ }),
1297
+ children: "停止执行"
1298
+ })]
1299
+ }), /* @__PURE__ */ W(dt, {
1300
+ run: g,
1301
+ base: e
1302
+ })]
1303
+ }), /* @__PURE__ */ W(de, {
1304
+ className: Q.libraryTabs,
1305
+ activeKey: v,
1306
+ onChange: ye,
1307
+ tabBarExtraContent: { right: /* @__PURE__ */ G("div", {
1275
1308
  className: Q.tabAction,
1276
1309
  children: [
1277
- g === "cases" && !A && !V && /* @__PURE__ */ G(C, {
1310
+ v === "cases" && !j && !B && /* @__PURE__ */ W(T, {
1278
1311
  type: "primary",
1279
1312
  size: "small",
1280
- disabled: !B,
1313
+ disabled: !z,
1281
1314
  onClick: () => {
1282
- ge(p());
1315
+ ve(p());
1283
1316
  },
1284
1317
  children: "新建用例"
1285
1318
  }),
1286
- g === "suites" && !le && !H && /* @__PURE__ */ G(C, {
1319
+ v === "suites" && !ce && !V && /* @__PURE__ */ W(T, {
1287
1320
  type: "primary",
1288
1321
  size: "small",
1289
- disabled: !B,
1322
+ disabled: !z,
1290
1323
  onClick: () => {
1291
1324
  P({
1292
1325
  id: "",
1293
1326
  name: "",
1294
1327
  caseIds: []
1295
- }), pe(!0);
1328
+ }), fe(!0);
1296
1329
  },
1297
1330
  children: "新建套件"
1298
1331
  }),
1299
- g === "plans" && !me && !U && /* @__PURE__ */ G(C, {
1332
+ v === "plans" && !he && !H && /* @__PURE__ */ W(T, {
1300
1333
  type: "primary",
1301
1334
  size: "small",
1302
- disabled: !B,
1335
+ disabled: !z,
1303
1336
  onClick: () => {
1304
- I({
1337
+ Ce({
1305
1338
  id: "",
1306
1339
  name: "",
1307
1340
  suiteIds: [],
1308
1341
  repeat: 1
1309
- }), k(!0);
1342
+ }), A(!0);
1310
1343
  },
1311
1344
  children: "新建计划"
1312
1345
  })
@@ -1316,155 +1349,139 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1316
1349
  {
1317
1350
  key: "cases",
1318
1351
  label: "用例",
1319
- children: A ? /* @__PURE__ */ K("div", {
1352
+ children: j ? /* @__PURE__ */ G("div", {
1320
1353
  className: Q.stack,
1321
- children: [/* @__PURE__ */ K("div", {
1322
- className: Q.buttonRow,
1323
- children: [/* @__PURE__ */ G("h4", { children: A.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ G(O, { children: he ? "未保存" : A.caseId ? "已保存" : "新用例" })]
1324
- }), u({
1354
+ children: [u({
1325
1355
  testCase: i,
1326
- busy: b || Ee || a && !s,
1327
- dirty: he,
1356
+ title: j.caseId ? "用例详情" : "新建用例",
1357
+ execute: j.caseId ? () => void L(async () => {
1358
+ _(await I("/run", "POST", { caseId: j.caseId }));
1359
+ }) : void 0,
1360
+ busy: C || Ae || a && !s,
1361
+ dirty: ge,
1328
1362
  cancel: () => {
1329
- M() && (j(void 0), A.suiteId && !A.caseId && _("suites"));
1363
+ _e() && (B ? ve(B.testCase, B.id, j.suiteId) : (M(void 0), j.suiteId && !j.caseId && x("suites")));
1330
1364
  },
1331
- save: (e) => R(async () => {
1332
- let t = A.caseId ?? crypto.randomUUID();
1333
- if (A.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1334
- let n = d.suites.find(({ id: e }) => e === A.suiteId);
1335
- if (A.suiteId && !n) throw Error("原套件已被删除");
1365
+ save: (e) => L(async () => {
1366
+ let t = j.caseId ?? crypto.randomUUID();
1367
+ if (j.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1368
+ let n = d.suites.find(({ id: e }) => e === j.suiteId);
1369
+ if (j.suiteId && !n) throw Error("原套件已被删除");
1336
1370
  let r = n && !n.caseIds.includes(t) ? {
1337
1371
  ...n,
1338
1372
  caseIds: [...n.caseIds, t]
1339
1373
  } : n;
1340
- await Oe({
1374
+ await R({
1341
1375
  ...d,
1342
- cases: Ae(d.cases, {
1376
+ cases: Pe(d.cases, {
1343
1377
  id: t,
1344
1378
  testCase: e
1345
1379
  }),
1346
- suites: r ? Ae(d.suites, r) : d.suites
1347
- }), r && P(r), o(e), w(t), j(void 0);
1380
+ suites: r ? Pe(d.suites, r) : d.suites
1381
+ }), r && P(r), o(e), se(t), M({
1382
+ caseId: t,
1383
+ suiteId: j.suiteId,
1384
+ baseline: JSON.stringify(e)
1385
+ });
1348
1386
  })
1349
- })]
1350
- }) : V ? /* @__PURE__ */ K("section", {
1351
- className: Q.stack,
1352
- "aria-label": "用例详情",
1353
- children: [
1354
- /* @__PURE__ */ K("div", {
1355
- className: Q.buttonRow,
1356
- children: [/* @__PURE__ */ G("h4", { children: "用例详情" }), /* @__PURE__ */ G(O, { children: "已保存" })]
1357
- }),
1358
- u({
1359
- testCase: V.testCase,
1360
- readOnly: !0,
1361
- busy: b || Ee
1362
- }),
1363
- /* @__PURE__ */ K("div", {
1364
- className: Q.buttonRow,
1365
- children: [/* @__PURE__ */ G(C, {
1366
- type: "primary",
1367
- disabled: !B,
1368
- onClick: () => ge(V.testCase, V.id, T),
1369
- children: "编辑用例"
1370
- }), /* @__PURE__ */ G($e, {
1371
- label: "用例更多操作",
1372
- disabled: !B,
1373
- items: [{
1374
- key: "delete",
1375
- label: "删除用例",
1376
- danger: !0,
1377
- onClick: () => void R(async () => {
1378
- if (d.suites.some((e) => e.caseIds.includes(V.id))) throw Error("请先从套件移除此用例");
1379
- window.confirm("删除该用例?") && (await Oe({
1380
- ...d,
1381
- cases: d.cases.filter(({ id: e }) => e !== V.id)
1382
- }), w(void 0));
1383
- })
1384
- }]
1385
- })]
1386
- }),
1387
- /* @__PURE__ */ K("section", {
1388
- className: Q.stack,
1389
- "aria-label": "所属套件",
1390
- children: [/* @__PURE__ */ G("h5", { children: "所属套件" }), /* @__PURE__ */ K("div", {
1391
- className: Q.buttonRow,
1392
- children: [
1393
- d.suites.filter((e) => e.caseIds.includes(V.id)).map((e) => /* @__PURE__ */ G(C, {
1394
- className: Q.entryLink,
1395
- type: "link",
1396
- size: "small",
1397
- onClick: () => {
1398
- P(e), _("suites");
1399
- },
1400
- children: e.name
1401
- }, e.id)),
1402
- Ne.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(D, {
1403
- "aria-label": "选择套件",
1404
- placeholder: "选择套件",
1405
- value: ye,
1406
- options: Ne.map(({ id: e, name: t }) => ({
1407
- value: e,
1408
- label: t
1409
- })),
1410
- loading: b,
1411
- disabled: !B,
1412
- onChange: be
1413
- }), /* @__PURE__ */ G(C, {
1414
- type: "text",
1415
- disabled: !B || !ye,
1416
- onClick: () => {
1417
- let e = Ne.find((e) => e.id === ye);
1418
- e && R(async () => {
1419
- await Oe({
1420
- ...d,
1421
- suites: Ae(d.suites, {
1422
- ...e,
1423
- caseIds: [...e.caseIds, V.id]
1424
- })
1425
- }), be(void 0);
1426
- });
1427
- },
1428
- children: "添加到套件"
1429
- })] }),
1430
- /* @__PURE__ */ G(C, {
1431
- type: "link",
1432
- disabled: !B,
1433
- onClick: () => {
1434
- P({
1435
- id: "",
1436
- name: "",
1437
- caseIds: [V.id]
1438
- }), pe(!0), _("suites");
1439
- },
1440
- children: "新建套件"
1441
- })
1442
- ]
1443
- })]
1387
+ }), B && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
1388
+ className: Q.buttonRow,
1389
+ children: /* @__PURE__ */ W($e, {
1390
+ label: "用例更多操作",
1391
+ disabled: !z,
1392
+ items: [{
1393
+ key: "delete",
1394
+ label: "删除用例",
1395
+ danger: !0,
1396
+ onClick: () => void L(async () => {
1397
+ if (d.suites.some((e) => e.caseIds.includes(B.id))) throw Error("请先从套件移除此用例");
1398
+ window.confirm("删除该用例?") && (await R({
1399
+ ...d,
1400
+ cases: d.cases.filter(({ id: e }) => e !== B.id)
1401
+ }), se(void 0), M(void 0));
1402
+ })
1403
+ }]
1444
1404
  })
1445
- ]
1446
- }) : /* @__PURE__ */ K("div", {
1405
+ }), /* @__PURE__ */ G("section", {
1406
+ className: Q.stack,
1407
+ "aria-label": "所属套件",
1408
+ children: [/* @__PURE__ */ W("h5", { children: "所属套件" }), /* @__PURE__ */ G("div", {
1409
+ className: Q.buttonRow,
1410
+ children: [
1411
+ d.suites.filter((e) => e.caseIds.includes(B.id)).map((e) => /* @__PURE__ */ W(T, {
1412
+ className: Q.entryLink,
1413
+ type: "link",
1414
+ size: "small",
1415
+ onClick: () => {
1416
+ _e() && (M(void 0), se(void 0), P(e), x("suites"));
1417
+ },
1418
+ children: e.name
1419
+ }, e.id)),
1420
+ Le.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(O, {
1421
+ "aria-label": "选择套件",
1422
+ placeholder: "选择套件",
1423
+ value: xe,
1424
+ options: Le.map(({ id: e, name: t }) => ({
1425
+ value: e,
1426
+ label: t
1427
+ })),
1428
+ loading: C,
1429
+ disabled: !z,
1430
+ onChange: Se
1431
+ }), /* @__PURE__ */ W(T, {
1432
+ type: "text",
1433
+ disabled: !z || !xe,
1434
+ onClick: () => {
1435
+ let e = Le.find((e) => e.id === xe);
1436
+ e && L(async () => {
1437
+ await R({
1438
+ ...d,
1439
+ suites: Pe(d.suites, {
1440
+ ...e,
1441
+ caseIds: [...e.caseIds, B.id]
1442
+ })
1443
+ }), Se(void 0);
1444
+ });
1445
+ },
1446
+ children: "添加到套件"
1447
+ })] }),
1448
+ /* @__PURE__ */ W(T, {
1449
+ type: "link",
1450
+ disabled: !z,
1451
+ onClick: () => {
1452
+ _e() && (M(void 0), se(void 0), P({
1453
+ id: "",
1454
+ name: "",
1455
+ caseIds: [B.id]
1456
+ }), fe(!0), x("suites"));
1457
+ },
1458
+ children: "新建套件"
1459
+ })
1460
+ ]
1461
+ })]
1462
+ })] })]
1463
+ }) : /* @__PURE__ */ G("div", {
1447
1464
  className: Q.stack,
1448
- children: [!d.cases.length && /* @__PURE__ */ G(ue, { description: "暂无用例" }), /* @__PURE__ */ G("ul", {
1465
+ children: [!d.cases.length && /* @__PURE__ */ W(le, { description: "暂无用例" }), /* @__PURE__ */ W("ul", {
1449
1466
  className: Q.resourceList,
1450
- children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("div", { children: [
1451
- /* @__PURE__ */ G(C, {
1467
+ children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G("div", { children: [
1468
+ /* @__PURE__ */ W(T, {
1452
1469
  type: "link",
1453
1470
  size: "small",
1454
1471
  className: Q.entryLink,
1455
1472
  onClick: () => {
1456
- ce(void 0), w(e), be(void 0);
1473
+ ve(t, e);
1457
1474
  },
1458
- children: /* @__PURE__ */ G("span", {
1475
+ children: /* @__PURE__ */ W("span", {
1459
1476
  className: Q.resourceName,
1460
1477
  title: t.name,
1461
1478
  children: t.name
1462
1479
  })
1463
1480
  }),
1464
1481
  " ",
1465
- /* @__PURE__ */ K(O, { children: [t.steps.length, " 步"] }),
1466
- /* @__PURE__ */ G("br", {}),
1467
- /* @__PURE__ */ G("code", { children: n ?? t.path })
1482
+ /* @__PURE__ */ G(k, { children: [t.steps.length, " 步"] }),
1483
+ /* @__PURE__ */ W("br", {}),
1484
+ /* @__PURE__ */ W("code", { children: n ?? t.path })
1468
1485
  ] }) }, e))
1469
1486
  })]
1470
1487
  })
@@ -1472,284 +1489,271 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1472
1489
  {
1473
1490
  key: "suites",
1474
1491
  label: "套件",
1475
- children: le ? /* @__PURE__ */ K("section", {
1492
+ children: ce || V ? /* @__PURE__ */ G("section", {
1476
1493
  className: Q.stack,
1477
- "aria-label": "套件编辑",
1494
+ "aria-label": "套件详情",
1478
1495
  children: [
1479
- /* @__PURE__ */ G(C, {
1480
- disabled: b,
1481
- onClick: () => {
1482
- Le() && pe(!1);
1483
- },
1484
- children: "取消"
1496
+ /* @__PURE__ */ G("div", {
1497
+ className: Q.stickyToolbar,
1498
+ children: [/* @__PURE__ */ W("h4", { children: N.id ? "套件详情" : "新建套件" }), /* @__PURE__ */ G("div", {
1499
+ className: Q.buttonRow,
1500
+ children: [
1501
+ V && /* @__PURE__ */ W(T, {
1502
+ disabled: !z || ze || !N.caseIds.length,
1503
+ onClick: () => void L(async () => {
1504
+ _(await I("/run", "POST", { suiteId: V.id }));
1505
+ }),
1506
+ children: "执行套件"
1507
+ }),
1508
+ /* @__PURE__ */ W(T, {
1509
+ type: "primary",
1510
+ disabled: !z || !ze || !N.name.trim() || !N.caseIds.length,
1511
+ onClick: () => void L(async () => {
1512
+ let e = {
1513
+ ...N,
1514
+ id: N.id || crypto.randomUUID(),
1515
+ name: N.name.trim()
1516
+ };
1517
+ await R({
1518
+ ...d,
1519
+ suites: Pe(d.suites, e)
1520
+ }), P(e), fe(!1), me(!1);
1521
+ }),
1522
+ children: "保存套件"
1523
+ }),
1524
+ /* @__PURE__ */ W(T, {
1525
+ disabled: C || !(!V || ze || pe),
1526
+ onClick: () => {
1527
+ Ve() && (P(V ?? {
1528
+ id: "",
1529
+ name: "",
1530
+ caseIds: []
1531
+ }), fe(!1), me(!1));
1532
+ },
1533
+ children: "取消"
1534
+ }),
1535
+ V && /* @__PURE__ */ W($e, {
1536
+ label: "套件更多操作",
1537
+ disabled: !z,
1538
+ items: [{
1539
+ key: "delete",
1540
+ label: "删除套件",
1541
+ danger: !0,
1542
+ onClick: () => void L(async () => {
1543
+ if (d.plans.some((e) => e.suiteIds.includes(V.id))) throw Error("请先从计划移除此套件");
1544
+ window.confirm("删除该套件?") && (await R({
1545
+ ...d,
1546
+ suites: d.suites.filter(({ id: e }) => e !== V.id)
1547
+ }), P({
1548
+ id: "",
1549
+ name: "",
1550
+ caseIds: []
1551
+ }));
1552
+ })
1553
+ }]
1554
+ })
1555
+ ]
1556
+ })]
1485
1557
  }),
1486
- /* @__PURE__ */ G("h4", { children: N.id ? "编辑套件" : "新建套件" }),
1487
- /* @__PURE__ */ K("div", {
1558
+ /* @__PURE__ */ G("div", {
1488
1559
  className: Q.stack,
1489
1560
  children: [
1490
- /* @__PURE__ */ G("label", {
1561
+ /* @__PURE__ */ W("label", {
1491
1562
  htmlFor: "assistant-suite-name",
1492
1563
  children: "套件名称"
1493
1564
  }),
1494
- /* @__PURE__ */ G(E, {
1565
+ V && !pe ? /* @__PURE__ */ W(T, {
1566
+ type: "text",
1567
+ className: Q.entryLink,
1568
+ disabled: !z,
1569
+ id: "assistant-suite-name",
1570
+ onClick: () => me(!0),
1571
+ children: N.name
1572
+ }) : /* @__PURE__ */ W(D, {
1573
+ autoFocus: pe,
1574
+ disabled: !z,
1495
1575
  id: "assistant-suite-name",
1496
1576
  "aria-required": "true",
1497
1577
  "aria-invalid": !N.name.trim(),
1498
1578
  "aria-describedby": N.name.trim() ? void 0 : "assistant-suite-name-error",
1499
1579
  maxLength: 100,
1500
1580
  value: N.name,
1501
- onChange: (e) => P({
1502
- ...N,
1503
- name: e.target.value
1504
- })
1581
+ onChange: (e) => {
1582
+ fe(!0), P({
1583
+ ...N,
1584
+ name: e.target.value
1585
+ });
1586
+ }
1505
1587
  }),
1506
- !N.name.trim() && /* @__PURE__ */ G("span", {
1588
+ !N.name.trim() && /* @__PURE__ */ W("span", {
1507
1589
  className: Q.hint,
1508
1590
  id: "assistant-suite-name-error",
1509
1591
  children: "请输入套件名称"
1510
1592
  })
1511
1593
  ]
1512
1594
  }),
1513
- /* @__PURE__ */ G(ft, {
1514
- options: je,
1595
+ /* @__PURE__ */ W(ft, {
1596
+ options: Fe,
1597
+ disabled: !z,
1598
+ onOpen: (e) => {
1599
+ if (!Ve()) return;
1600
+ let t = d.cases.find((t) => t.id === e);
1601
+ t && (V && P(V), fe(!1), ve(t.testCase, e, V?.id));
1602
+ },
1515
1603
  values: N.caseIds,
1516
- onChange: (e) => P({
1517
- ...N,
1518
- caseIds: e
1519
- })
1520
- }),
1521
- /* @__PURE__ */ G(C, {
1522
- type: "primary",
1523
- disabled: !B || !N.name.trim() || !N.caseIds.length,
1524
- onClick: () => void R(async () => {
1525
- let e = {
1604
+ onChange: (e) => {
1605
+ fe(!0), P({
1526
1606
  ...N,
1527
- id: N.id || crypto.randomUUID(),
1528
- name: N.name.trim()
1529
- };
1530
- await Oe({
1531
- ...d,
1532
- suites: Ae(d.suites, e)
1533
- }), P(e), pe(!1);
1534
- }),
1535
- children: "保存套件"
1536
- })
1537
- ]
1538
- }) : H ? /* @__PURE__ */ K("section", {
1539
- className: Q.stack,
1540
- "aria-label": "套件详情",
1541
- children: [
1542
- /* @__PURE__ */ G("h4", { children: H.name }),
1543
- /* @__PURE__ */ G("ol", {
1544
- className: Q.list,
1545
- children: H.caseIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1546
- type: "link",
1547
- size: "small",
1548
- className: Q.entryLink,
1549
- onClick: () => {
1550
- w(e), ce(H.id), be(void 0), _("cases");
1551
- },
1552
- children: je.find(({ value: t }) => t === e)?.label ?? e
1553
- }) }, t))
1554
- }),
1555
- /* @__PURE__ */ K("div", {
1556
- className: Q.buttonRow,
1557
- children: [
1558
- /* @__PURE__ */ G(C, {
1559
- type: "primary",
1560
- disabled: !B,
1561
- onClick: () => {
1562
- P(H), pe(!0);
1563
- },
1564
- children: "编辑套件"
1565
- }),
1566
- /* @__PURE__ */ G(C, {
1567
- type: "text",
1568
- disabled: !B,
1569
- onClick: () => ge(p(), void 0, H.id),
1570
- children: "新建用例"
1571
- }),
1572
- /* @__PURE__ */ G(C, {
1573
- type: "text",
1574
- disabled: !B,
1575
- onClick: () => {
1576
- I({
1577
- id: "",
1578
- name: "",
1579
- suiteIds: [H.id],
1580
- repeat: 1
1581
- }), k(!0), _("plans");
1582
- },
1583
- children: "创建计划"
1584
- }),
1585
- /* @__PURE__ */ G($e, {
1586
- label: "套件更多操作",
1587
- disabled: !B,
1588
- items: [{
1589
- key: "delete",
1590
- label: "删除套件",
1591
- danger: !0,
1592
- onClick: () => void R(async () => {
1593
- if (d.plans.some((e) => e.suiteIds.includes(H.id))) throw Error("请先从计划移除此套件");
1594
- window.confirm("删除该套件?") && (await Oe({
1595
- ...d,
1596
- suites: d.suites.filter(({ id: e }) => e !== H.id)
1597
- }), P({
1598
- id: "",
1599
- name: "",
1600
- caseIds: []
1601
- }));
1602
- })
1603
- }]
1604
- })
1605
- ]
1607
+ caseIds: e
1608
+ });
1609
+ }
1606
1610
  })
1607
1611
  ]
1608
- }) : /* @__PURE__ */ K("div", {
1612
+ }) : /* @__PURE__ */ G("div", {
1609
1613
  className: Q.stack,
1610
- children: [!d.suites.length && /* @__PURE__ */ G(ue, { description: "暂无套件" }), /* @__PURE__ */ G("ul", {
1614
+ children: [!d.suites.length && /* @__PURE__ */ W(le, { description: "暂无套件" }), /* @__PURE__ */ W("ul", {
1611
1615
  className: Q.resourceList,
1612
- children: d.suites.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1616
+ children: d.suites.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(T, {
1613
1617
  type: "link",
1614
1618
  size: "small",
1615
1619
  className: Q.entryLink,
1616
1620
  onClick: () => {
1617
1621
  P(e);
1618
1622
  },
1619
- children: /* @__PURE__ */ G("span", {
1623
+ children: /* @__PURE__ */ W("span", {
1620
1624
  className: Q.resourceName,
1621
1625
  title: e.name,
1622
1626
  children: e.name
1623
1627
  })
1624
- }), /* @__PURE__ */ K("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1628
+ }), /* @__PURE__ */ G("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1625
1629
  })]
1626
1630
  })
1627
1631
  },
1628
1632
  {
1629
1633
  key: "plans",
1630
1634
  label: "计划",
1631
- children: me ? /* @__PURE__ */ K("section", {
1635
+ children: he ? /* @__PURE__ */ G("section", {
1632
1636
  className: Q.stack,
1633
1637
  "aria-label": "计划编辑",
1634
1638
  children: [
1635
- /* @__PURE__ */ G(C, {
1636
- disabled: b,
1639
+ /* @__PURE__ */ W(T, {
1640
+ disabled: C,
1637
1641
  onClick: () => {
1638
- Re() && k(!1);
1642
+ He() && A(!1);
1639
1643
  },
1640
1644
  children: "取消"
1641
1645
  }),
1642
- /* @__PURE__ */ G("h4", { children: F.id ? "编辑计划" : "新建计划" }),
1643
- /* @__PURE__ */ K("div", {
1646
+ /* @__PURE__ */ W("h4", { children: F.id ? "编辑计划" : "新建计划" }),
1647
+ /* @__PURE__ */ G("div", {
1644
1648
  className: Q.stack,
1645
1649
  children: [
1646
- /* @__PURE__ */ G("label", {
1650
+ /* @__PURE__ */ W("label", {
1647
1651
  htmlFor: "assistant-plan-name",
1648
1652
  children: "计划名称"
1649
1653
  }),
1650
- /* @__PURE__ */ G(E, {
1654
+ /* @__PURE__ */ W(D, {
1651
1655
  id: "assistant-plan-name",
1652
1656
  "aria-required": "true",
1653
1657
  "aria-invalid": !F.name.trim(),
1654
1658
  "aria-describedby": F.name.trim() ? void 0 : "assistant-plan-name-error",
1655
1659
  maxLength: 100,
1656
1660
  value: F.name,
1657
- onChange: (e) => I({
1661
+ onChange: (e) => Ce({
1658
1662
  ...F,
1659
1663
  name: e.target.value
1660
1664
  })
1661
1665
  }),
1662
- !F.name.trim() && /* @__PURE__ */ G("span", {
1666
+ !F.name.trim() && /* @__PURE__ */ W("span", {
1663
1667
  className: Q.hint,
1664
1668
  id: "assistant-plan-name-error",
1665
1669
  children: "请输入计划名称"
1666
1670
  })
1667
1671
  ]
1668
1672
  }),
1669
- /* @__PURE__ */ K("label", { children: [
1673
+ /* @__PURE__ */ G("label", { children: [
1670
1674
  "重复轮数",
1671
1675
  " ",
1672
- /* @__PURE__ */ G(de, {
1676
+ /* @__PURE__ */ W(ue, {
1673
1677
  min: 1,
1674
1678
  max: 20,
1675
1679
  precision: 0,
1676
1680
  "aria-label": "重复轮数",
1677
1681
  value: F.repeat,
1678
- onChange: (e) => I({
1682
+ onChange: (e) => Ce({
1679
1683
  ...F,
1680
1684
  repeat: e ?? 1
1681
1685
  })
1682
1686
  })
1683
1687
  ] }),
1684
- /* @__PURE__ */ G(ft, {
1685
- options: Me,
1688
+ /* @__PURE__ */ W(ft, {
1689
+ options: Ie,
1686
1690
  values: F.suiteIds,
1687
- onChange: (e) => I({
1691
+ onChange: (e) => Ce({
1688
1692
  ...F,
1689
1693
  suiteIds: e
1690
1694
  })
1691
1695
  }),
1692
- /* @__PURE__ */ G(C, {
1696
+ /* @__PURE__ */ W(T, {
1693
1697
  type: "primary",
1694
- disabled: !B || !F.name.trim() || !F.suiteIds.length,
1695
- onClick: () => void R(async () => {
1698
+ disabled: !z || !F.name.trim() || !F.suiteIds.length,
1699
+ onClick: () => void L(async () => {
1696
1700
  let e = {
1697
1701
  ...F,
1698
1702
  id: F.id || crypto.randomUUID(),
1699
1703
  name: F.name.trim()
1700
1704
  };
1701
- await Oe({
1705
+ await R({
1702
1706
  ...d,
1703
- plans: Ae(d.plans, e)
1704
- }), I(e), k(!1);
1707
+ plans: Pe(d.plans, e)
1708
+ }), Ce(e), A(!1);
1705
1709
  }),
1706
1710
  children: "保存计划"
1707
1711
  })
1708
1712
  ]
1709
- }) : U ? /* @__PURE__ */ K("section", {
1713
+ }) : H ? /* @__PURE__ */ G("section", {
1710
1714
  className: Q.stack,
1711
1715
  "aria-label": "计划详情",
1712
1716
  children: [
1713
- /* @__PURE__ */ G("h4", { children: U.name }),
1714
- /* @__PURE__ */ K("span", { children: [
1717
+ /* @__PURE__ */ W("h4", { children: H.name }),
1718
+ /* @__PURE__ */ G("span", { children: [
1715
1719
  "重复 ",
1716
- U.repeat,
1720
+ H.repeat,
1717
1721
  " 轮"
1718
1722
  ] }),
1719
- /* @__PURE__ */ G("ol", {
1723
+ /* @__PURE__ */ W("ol", {
1720
1724
  className: Q.list,
1721
- children: U.suiteIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1725
+ children: H.suiteIds.map((e, t) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(T, {
1722
1726
  type: "link",
1723
1727
  size: "small",
1724
1728
  className: Q.entryLink,
1725
1729
  onClick: () => {
1726
1730
  let t = d.suites.find((t) => t.id === e);
1727
- t && (P(t), _("suites"));
1731
+ t && (P(t), x("suites"));
1728
1732
  },
1729
- children: Me.find(({ value: t }) => t === e)?.label ?? e
1733
+ children: Ie.find(({ value: t }) => t === e)?.label ?? e
1730
1734
  }) }, t))
1731
1735
  }),
1732
- /* @__PURE__ */ K("div", {
1736
+ /* @__PURE__ */ G("div", {
1733
1737
  className: Q.buttonRow,
1734
- children: [/* @__PURE__ */ G(C, {
1738
+ children: [/* @__PURE__ */ W(T, {
1735
1739
  type: "text",
1736
- disabled: !B,
1740
+ disabled: !z,
1737
1741
  onClick: () => {
1738
- I(U), k(!0);
1742
+ Ce(H), A(!0);
1739
1743
  },
1740
1744
  children: "编辑计划"
1741
- }), /* @__PURE__ */ G($e, {
1745
+ }), /* @__PURE__ */ W($e, {
1742
1746
  label: "计划更多操作",
1743
- disabled: !B,
1747
+ disabled: !z,
1744
1748
  items: [{
1745
1749
  key: "delete",
1746
1750
  label: "删除计划",
1747
1751
  danger: !0,
1748
- onClick: () => void R(async () => {
1749
- window.confirm("删除该计划?") && (await Oe({
1752
+ onClick: () => void L(async () => {
1753
+ window.confirm("删除该计划?") && (await R({
1750
1754
  ...d,
1751
- plans: d.plans.filter(({ id: e }) => e !== U.id)
1752
- }), I({
1755
+ plans: d.plans.filter(({ id: e }) => e !== H.id)
1756
+ }), Ce({
1753
1757
  id: "",
1754
1758
  name: "",
1755
1759
  suiteIds: [],
@@ -1759,35 +1763,35 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1759
1763
  }]
1760
1764
  })]
1761
1765
  }),
1762
- /* @__PURE__ */ G("p", {
1766
+ /* @__PURE__ */ W("p", {
1763
1767
  className: Q.hint,
1764
1768
  children: "回放会实际操作测试数据,且不会自动恢复。"
1765
1769
  }),
1766
- /* @__PURE__ */ G(C, {
1770
+ /* @__PURE__ */ W(T, {
1767
1771
  type: "primary",
1768
- disabled: !B,
1769
- onClick: () => void R(async () => {
1770
- let e = await L("/run", "POST", { planId: U.id });
1771
- h([e, ...m]), Se(e.id), _("reports");
1772
+ disabled: !z,
1773
+ onClick: () => void L(async () => {
1774
+ let e = await I("/run", "POST", { planId: H.id });
1775
+ h([e, ...m]), Te(e.id), x("reports");
1772
1776
  }),
1773
1777
  children: "运行计划"
1774
1778
  })
1775
1779
  ]
1776
- }) : /* @__PURE__ */ K("div", {
1780
+ }) : /* @__PURE__ */ G("div", {
1777
1781
  className: Q.stack,
1778
- children: [!d.plans.length && /* @__PURE__ */ G(ue, { description: "暂无计划" }), /* @__PURE__ */ G("ul", {
1782
+ children: [!d.plans.length && /* @__PURE__ */ W(le, { description: "暂无计划" }), /* @__PURE__ */ W("ul", {
1779
1783
  className: Q.resourceList,
1780
- children: d.plans.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1784
+ children: d.plans.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(T, {
1781
1785
  type: "link",
1782
1786
  size: "small",
1783
1787
  className: Q.entryLink,
1784
- onClick: () => I(e),
1785
- children: /* @__PURE__ */ G("span", {
1788
+ onClick: () => Ce(e),
1789
+ children: /* @__PURE__ */ W("span", {
1786
1790
  className: Q.resourceName,
1787
1791
  title: e.name,
1788
1792
  children: e.name
1789
1793
  })
1790
- }), /* @__PURE__ */ K("span", { children: [
1794
+ }), /* @__PURE__ */ G("span", { children: [
1791
1795
  e.suiteIds.length,
1792
1796
  " 个套件 · 重复 ",
1793
1797
  e.repeat,
@@ -1799,60 +1803,60 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1799
1803
  {
1800
1804
  key: "reports",
1801
1805
  label: "报告",
1802
- children: /* @__PURE__ */ K("div", {
1806
+ children: /* @__PURE__ */ G("div", {
1803
1807
  className: Q.stack,
1804
1808
  children: [
1805
- /* @__PURE__ */ K("div", {
1809
+ /* @__PURE__ */ G("div", {
1806
1810
  className: Q.buttonRow,
1807
- children: [/* @__PURE__ */ G(C, {
1811
+ children: [/* @__PURE__ */ W(T, {
1808
1812
  type: "text",
1809
- disabled: b,
1810
- onClick: () => void R(async () => {
1811
- h(await L("/runs")), Te && we(await L(`/runs/${Te}`));
1813
+ disabled: C,
1814
+ onClick: () => void L(async () => {
1815
+ h(await I("/runs")), Oe && De(await I(`/runs/${Oe}`));
1812
1816
  }),
1813
1817
  children: "刷新报告"
1814
- }), /* @__PURE__ */ G(C, {
1818
+ }), /* @__PURE__ */ W(T, {
1815
1819
  type: "primary",
1816
1820
  danger: !0,
1817
- disabled: b || !Ee,
1818
- onClick: () => void R(async () => {
1819
- let e = await L("/stop", "POST", {});
1821
+ disabled: C || !Ae,
1822
+ onClick: () => void L(async () => {
1823
+ let e = await I("/stop", "POST", {});
1820
1824
  h(m.map((t) => t.id === e.id ? e : t));
1821
1825
  }),
1822
1826
  children: "停止计划"
1823
1827
  })]
1824
1828
  }),
1825
- !m.length && /* @__PURE__ */ G(ue, { description: "暂无运行报告" }),
1826
- m.length > 0 && /* @__PURE__ */ G(D, {
1829
+ !m.length && /* @__PURE__ */ W(le, { description: "暂无运行报告" }),
1830
+ m.length > 0 && /* @__PURE__ */ W(O, {
1827
1831
  "aria-label": "运行报告",
1828
- value: xe ?? m[0].id,
1829
- onChange: Se,
1832
+ value: we ?? m[0].id,
1833
+ onChange: Te,
1830
1834
  options: m.map((e) => ({
1831
1835
  value: e.id,
1832
1836
  label: `${e.planName} · ${ut[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1833
1837
  }))
1834
1838
  }),
1835
- Ce && Ce.id === Te && /* @__PURE__ */ G(dt, {
1836
- run: Ce,
1839
+ Ee && Ee.id === Oe && /* @__PURE__ */ W(dt, {
1840
+ run: Ee,
1837
1841
  base: e,
1838
- onExport: () => ke(Ce, `研发小蜜报告-${Ce.id}.json`)
1842
+ onExport: () => Ne(Ee, `研发小蜜报告-${Ee.id}.json`)
1839
1843
  })
1840
1844
  ]
1841
1845
  })
1842
1846
  }
1843
1847
  ]
1844
- }) }) : /* @__PURE__ */ G(C, {
1848
+ })] }) : /* @__PURE__ */ W(T, {
1845
1849
  className: Q.fitButton,
1846
- loading: b,
1847
- onClick: z,
1848
- children: b ? "正在读取测试库" : "重试读取测试库"
1850
+ loading: C,
1851
+ onClick: Me,
1852
+ children: C ? "正在读取测试库" : "重试读取测试库"
1849
1853
  })
1850
1854
  ]
1851
1855
  });
1852
1856
  }
1853
1857
  // src/pages/assistant/components/TestLibraryPanel/index.tsx
1854
1858
  function mt({ bridgeUrl: e, exploration: t, ...n }) {
1855
- let r = `${e.replace(/\/$/, "")}/library`, i = lt(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x(!1), [p, m] = x(""), h = async (e) => {
1859
+ let r = `${e.replace(/\/$/, "")}/library`, i = lt(r), [a, o] = S(), [s, c] = S(), [l, u] = S(), [d, f] = S(!1), [p, m] = S(""), h = async (e) => {
1856
1860
  let t = await i("/collections", "GET", void 0, e);
1857
1861
  e?.aborted || o(t.collections);
1858
1862
  }, g = async (e, t) => {
@@ -1865,11 +1869,11 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1865
1869
  t?.aborted || f(!1);
1866
1870
  }
1867
1871
  };
1868
- y(() => {
1872
+ b(() => {
1869
1873
  let e = new AbortController();
1870
1874
  return g(() => h(e.signal), e.signal), () => e.abort();
1871
1875
  }, [i]);
1872
- let _ = /* @__PURE__ */ K(se, {
1876
+ let _ = /* @__PURE__ */ G(ae, {
1873
1877
  className: Q.card,
1874
1878
  "aria-label": "测试库列表",
1875
1879
  styles: { body: {
@@ -1879,24 +1883,24 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1879
1883
  gap: 16
1880
1884
  } },
1881
1885
  children: [
1882
- /* @__PURE__ */ K("header", {
1886
+ /* @__PURE__ */ G("header", {
1883
1887
  className: Q.header,
1884
- children: [/* @__PURE__ */ G("h3", { children: "测试库" }), a && !l && /* @__PURE__ */ G(C, {
1888
+ children: [/* @__PURE__ */ W("h3", { children: "测试库" }), a && !l && /* @__PURE__ */ W(T, {
1885
1889
  type: "primary",
1886
1890
  disabled: d || n.disabled,
1887
1891
  onClick: () => u({ name: "" }),
1888
1892
  children: "新建测试库"
1889
1893
  })]
1890
1894
  }),
1891
- p && /* @__PURE__ */ G(S, {
1895
+ p && /* @__PURE__ */ W(w, {
1892
1896
  type: "error",
1893
1897
  title: p
1894
1898
  }),
1895
- n.incomingDraft && /* @__PURE__ */ G(S, {
1899
+ n.incomingDraft && /* @__PURE__ */ W(w, {
1896
1900
  type: "info",
1897
1901
  title: "请选择测试库,继续编辑时间线用例"
1898
1902
  }),
1899
- a ? l ? /* @__PURE__ */ K("form", {
1903
+ a ? l ? /* @__PURE__ */ G("form", {
1900
1904
  className: Q.stack,
1901
1905
  onSubmit: (e) => {
1902
1906
  e.preventDefault(), l.name.trim() && !d && g(async () => {
@@ -1905,11 +1909,11 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1905
1909
  });
1906
1910
  },
1907
1911
  children: [
1908
- /* @__PURE__ */ G("label", {
1912
+ /* @__PURE__ */ W("label", {
1909
1913
  htmlFor: "assistant-library-name",
1910
1914
  children: "测试库名称"
1911
1915
  }),
1912
- /* @__PURE__ */ G(E, {
1916
+ /* @__PURE__ */ W(D, {
1913
1917
  id: "assistant-library-name",
1914
1918
  "aria-required": "true",
1915
1919
  "aria-invalid": !l.name.trim(),
@@ -1922,40 +1926,40 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1922
1926
  name: e.target.value
1923
1927
  })
1924
1928
  }),
1925
- !l.name.trim() && /* @__PURE__ */ G("span", {
1929
+ !l.name.trim() && /* @__PURE__ */ W("span", {
1926
1930
  className: Q.hint,
1927
1931
  id: "assistant-library-name-error",
1928
1932
  children: "请输入测试库名称"
1929
1933
  }),
1930
- /* @__PURE__ */ K("div", {
1934
+ /* @__PURE__ */ G("div", {
1931
1935
  className: Q.buttonRow,
1932
- children: [/* @__PURE__ */ G(C, {
1936
+ children: [/* @__PURE__ */ W(T, {
1933
1937
  htmlType: "submit",
1934
1938
  type: "primary",
1935
1939
  loading: d,
1936
1940
  disabled: !l.name.trim(),
1937
1941
  children: l.id ? "保存" : "创建"
1938
- }), /* @__PURE__ */ G(C, {
1942
+ }), /* @__PURE__ */ W(T, {
1939
1943
  disabled: d,
1940
1944
  onClick: () => u(void 0),
1941
1945
  children: "取消"
1942
1946
  })]
1943
1947
  })
1944
1948
  ]
1945
- }) : /* @__PURE__ */ K(W, { children: [!a.length && /* @__PURE__ */ G(ue, { description: "暂无测试库" }), /* @__PURE__ */ G("ul", {
1949
+ }) : /* @__PURE__ */ G(U, { children: [!a.length && /* @__PURE__ */ W(le, { description: "暂无测试库" }), /* @__PURE__ */ W("ul", {
1946
1950
  className: Q.resourceList,
1947
- children: a.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1951
+ children: a.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(T, {
1948
1952
  type: "link",
1949
1953
  size: "small",
1950
1954
  className: Q.entryLink,
1951
1955
  title: e.name,
1952
1956
  disabled: d || n.recording,
1953
1957
  onClick: () => c(e),
1954
- children: /* @__PURE__ */ G("span", {
1958
+ children: /* @__PURE__ */ W("span", {
1955
1959
  className: Q.resourceName,
1956
1960
  children: e.name
1957
1961
  })
1958
- }), /* @__PURE__ */ K("span", { children: [
1962
+ }), /* @__PURE__ */ G("span", { children: [
1959
1963
  e.caseCount,
1960
1964
  " 个用例 · ",
1961
1965
  e.suiteCount,
@@ -1964,7 +1968,7 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1964
1968
  e.planCount,
1965
1969
  " 个计划"
1966
1970
  ] })] }, e.id))
1967
- })] }) : /* @__PURE__ */ G(C, {
1971
+ })] }) : /* @__PURE__ */ W(T, {
1968
1972
  className: Q.fitButton,
1969
1973
  loading: d,
1970
1974
  onClick: () => void g(h),
@@ -1972,10 +1976,10 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1972
1976
  })
1973
1977
  ]
1974
1978
  });
1975
- return /* @__PURE__ */ K(W, { children: [
1976
- s && /* @__PURE__ */ G("div", {
1979
+ return /* @__PURE__ */ G(U, { children: [
1980
+ s && /* @__PURE__ */ W("div", {
1977
1981
  hidden: !!l,
1978
- children: /* @__PURE__ */ ee(pt, {
1982
+ children: /* @__PURE__ */ v(pt, {
1979
1983
  ...n,
1980
1984
  key: s.id,
1981
1985
  base: `${r}/collections/${encodeURIComponent(s.id)}`,
@@ -1991,11 +1995,11 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1991
1995
  }
1992
1996
  })
1993
1997
  }),
1994
- /* @__PURE__ */ G("div", {
1998
+ /* @__PURE__ */ W("div", {
1995
1999
  hidden: !!s && !l,
1996
2000
  children: _
1997
2001
  }),
1998
- /* @__PURE__ */ G("div", {
2002
+ /* @__PURE__ */ W("div", {
1999
2003
  hidden: !!s || !!l,
2000
2004
  children: t
2001
2005
  })
@@ -2003,105 +2007,188 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
2003
2007
  }
2004
2008
  // src/pages/assistant/components/AutomationPanel/index.tsx
2005
2009
  function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2006
- let i = ie(s.subscribe, s.getState), a = re(null), [o, c] = x(""), [l, u] = x(null), d = re(null), f = (e, t) => {
2010
+ let i = C(s.subscribe, s.getState), a = ne(null), [o, c] = S(""), [l, u] = S(null), d = (e, t, n) => {
2007
2011
  u({
2008
2012
  position: e,
2009
- edit: t
2010
- }), requestAnimationFrame(() => d.current?.scrollIntoView({
2011
- behavior: "smooth",
2012
- block: "nearest"
2013
- }));
2014
- }, [p, m] = x(!1), h = async (e) => {
2013
+ edit: t,
2014
+ anchor: n
2015
+ });
2016
+ }, [f, p] = S(!1), m = async (e) => {
2015
2017
  try {
2016
2018
  c(""), await e();
2017
2019
  } catch (e) {
2018
2020
  c(e instanceof Error ? e.message : "操作失败");
2019
2021
  }
2020
- }, g = (e, t) => s.edit({
2022
+ }, h = (e, t) => s.edit({
2021
2023
  ...i.draft,
2022
2024
  steps: i.draft.steps.map((n, r) => r === e ? {
2023
2025
  ...n,
2024
2026
  ...t,
2025
2027
  supplemented: !0
2026
2028
  } : n)
2027
- });
2028
- return /* @__PURE__ */ K("div", {
2029
+ }), g = (e, t) => l && /* @__PURE__ */ W(et, {
2030
+ initial: l.edit === void 0 ? void 0 : e.steps[l.edit]?.assertion,
2031
+ steps: e.steps,
2032
+ position: l.position,
2033
+ disabled: t || i.recording,
2034
+ onCancel: () => u(null),
2035
+ onSave: (t, n) => {
2036
+ let r = [...e.steps];
2037
+ l.edit === void 0 ? r.splice(n, 0, {
2038
+ kind: "assert",
2039
+ assertion: t,
2040
+ supplemented: !0
2041
+ }) : r[l.edit] = {
2042
+ ...r[l.edit],
2043
+ kind: "assert",
2044
+ assertion: t,
2045
+ supplemented: !0
2046
+ }, s.edit((0, Y.parseCase)({
2047
+ ...e,
2048
+ steps: r
2049
+ })), u(null);
2050
+ }
2051
+ }, `${l.position}-${l.edit ?? "new"}`);
2052
+ return /* @__PURE__ */ G("div", {
2029
2053
  className: J.section,
2030
2054
  "data-assistant-part": "section automation",
2031
- children: [o && /* @__PURE__ */ G(S, {
2055
+ children: [o && /* @__PURE__ */ W(w, {
2032
2056
  closable: !0,
2033
2057
  onClose: () => c(""),
2034
2058
  type: "error",
2035
2059
  title: o
2036
- }), /* @__PURE__ */ G("div", {
2060
+ }), /* @__PURE__ */ W("div", {
2037
2061
  className: J.automationLayout,
2038
2062
  "data-assistant-part": "automation-layout",
2039
- children: /* @__PURE__ */ G(mt, {
2063
+ children: /* @__PURE__ */ W(mt, {
2040
2064
  bridgeUrl: t,
2041
2065
  draft: i.draft,
2042
- disabled: p || i.recording,
2066
+ disabled: f || i.recording,
2043
2067
  recording: i.recording,
2044
2068
  incomingDraft: n,
2045
2069
  onConsumeDraft: r,
2046
2070
  onEdit: (e) => {
2047
2071
  s.loadDraft(e), u(null);
2048
2072
  },
2049
- exploration: /* @__PURE__ */ G(ct, {
2073
+ exploration: /* @__PURE__ */ W(ct, {
2050
2074
  bridgeUrl: t,
2051
2075
  disabled: i.recording,
2052
- onRunningChange: m
2076
+ onRunningChange: p
2053
2077
  }),
2054
- renderCase: ({ testCase: t, readOnly: n = !1, save: r, busy: o, dirty: c, cancel: p }) => /* @__PURE__ */ K(W, { children: [
2055
- /* @__PURE__ */ K("div", {
2078
+ renderCase: ({ testCase: t, readOnly: n = !1, title: r, execute: o, save: c, busy: f, dirty: p, cancel: _ }) => /* @__PURE__ */ G(U, { children: [
2079
+ !n && /* @__PURE__ */ G("div", {
2080
+ className: J.stickyToolbar,
2081
+ "data-assistant-part": "case-toolbar",
2082
+ children: [/* @__PURE__ */ G("div", {
2083
+ className: J.toolbarHeading,
2084
+ children: [/* @__PURE__ */ W("h4", { children: r ?? "用例详情" }), /* @__PURE__ */ W(k, { children: p ? "未保存" : o ? "已保存" : "新用例" })]
2085
+ }), /* @__PURE__ */ G("div", {
2086
+ className: J.buttonRow,
2087
+ children: [
2088
+ o && /* @__PURE__ */ W(T, {
2089
+ disabled: f || i.recording || p,
2090
+ title: p ? "请先保存修改再执行" : void 0,
2091
+ onClick: o,
2092
+ children: "执行用例"
2093
+ }),
2094
+ /* @__PURE__ */ W(T, {
2095
+ icon: /* @__PURE__ */ W(Ie, {}),
2096
+ type: "primary",
2097
+ disabled: i.recording || f || !p || !t.name.trim() || !t.steps.length,
2098
+ onClick: () => void m(() => {
2099
+ let e = (0, Y.parseCase)(t);
2100
+ return c?.(e);
2101
+ }),
2102
+ children: "保存用例"
2103
+ }),
2104
+ /* @__PURE__ */ W(T, {
2105
+ disabled: f || i.recording,
2106
+ onClick: _,
2107
+ children: "取消"
2108
+ }),
2109
+ /* @__PURE__ */ W($e, {
2110
+ label: "用例文件操作",
2111
+ disabled: f || i.recording,
2112
+ items: [{
2113
+ key: "import",
2114
+ label: "导入用例",
2115
+ onClick: () => a.current?.click()
2116
+ }, {
2117
+ key: "export",
2118
+ label: "导出用例 JSON",
2119
+ disabled: !t.steps.length,
2120
+ onClick: () => void m(() => {
2121
+ let e = (0, Y.parseCase)(t), n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
2122
+ r.href = n, r.download = "页面录制用例.json", document.body.append(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
2123
+ })
2124
+ }]
2125
+ }),
2126
+ /* @__PURE__ */ W("input", {
2127
+ hidden: !0,
2128
+ type: "file",
2129
+ ref: a,
2130
+ accept: ".json,application/json",
2131
+ onChange: (e) => {
2132
+ let t = e.target.files?.[0];
2133
+ e.target.value = "", !t || i.recording || f || m(async () => {
2134
+ if (t.size > 524288) throw Error("用例不能超过 512 KB");
2135
+ (!p || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2136
+ });
2137
+ }
2138
+ })
2139
+ ]
2140
+ })]
2141
+ }),
2142
+ /* @__PURE__ */ G("div", {
2056
2143
  className: J.field,
2057
2144
  "data-assistant-part": "field",
2058
2145
  children: [
2059
- /* @__PURE__ */ G("label", {
2146
+ /* @__PURE__ */ W("label", {
2060
2147
  htmlFor: "assistant-case-name",
2061
2148
  children: "用例名称"
2062
2149
  }),
2063
- /* @__PURE__ */ G(E, {
2150
+ /* @__PURE__ */ W(D, {
2064
2151
  id: "assistant-case-name",
2065
2152
  readOnly: n,
2066
2153
  "aria-required": !n,
2067
2154
  "aria-invalid": !t.name.trim(),
2068
2155
  "aria-describedby": t.name.trim() ? void 0 : "assistant-case-name-error",
2069
- prefix: /* @__PURE__ */ G(we, {}),
2156
+ prefix: /* @__PURE__ */ W(Te, {}),
2070
2157
  "aria-label": "测试用例名称",
2071
2158
  value: t.name,
2072
2159
  maxLength: 100,
2073
- disabled: i.recording || o,
2160
+ disabled: i.recording || f,
2074
2161
  onChange: (e) => s.edit({
2075
2162
  ...t,
2076
2163
  name: e.target.value
2077
2164
  })
2078
2165
  }),
2079
- !t.name.trim() && /* @__PURE__ */ G("span", {
2166
+ !t.name.trim() && /* @__PURE__ */ W("span", {
2080
2167
  className: J.hint,
2081
2168
  id: "assistant-case-name-error",
2082
2169
  children: "请输入用例名称"
2083
2170
  })
2084
2171
  ]
2085
2172
  }),
2086
- /* @__PURE__ */ K("div", {
2173
+ /* @__PURE__ */ G("div", {
2087
2174
  className: J.field,
2088
2175
  "data-assistant-part": "field",
2089
- children: [/* @__PURE__ */ G("label", {
2176
+ children: [/* @__PURE__ */ W("label", {
2090
2177
  htmlFor: "assistant-case-path",
2091
2178
  children: "用例入口"
2092
- }), /* @__PURE__ */ G(E, {
2179
+ }), /* @__PURE__ */ W(D, {
2093
2180
  id: "assistant-case-path",
2094
2181
  readOnly: n,
2095
2182
  value: t.path,
2096
2183
  maxLength: 2e3,
2097
- disabled: i.recording || o,
2184
+ disabled: i.recording || f,
2098
2185
  onChange: (e) => s.edit({
2099
2186
  ...t,
2100
2187
  path: e.target.value
2101
2188
  })
2102
2189
  })]
2103
2190
  }),
2104
- /* @__PURE__ */ K(se, {
2191
+ /* @__PURE__ */ G(ae, {
2105
2192
  className: J.card,
2106
2193
  "data-assistant-part": "card record-card",
2107
2194
  "aria-label": "录制操作",
@@ -2112,10 +2199,10 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2112
2199
  gap: 16
2113
2200
  } },
2114
2201
  children: [
2115
- /* @__PURE__ */ K("div", {
2202
+ /* @__PURE__ */ G("div", {
2116
2203
  className: J.cardHeading,
2117
2204
  "data-assistant-part": "card-heading",
2118
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Le, {}), "录制操作"] }), /* @__PURE__ */ K(O, {
2205
+ children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(Re, {}), "录制操作"] }), /* @__PURE__ */ G(k, {
2119
2206
  color: i.recording ? "red" : "default",
2120
2207
  children: [
2121
2208
  n ? "已保存" : i.recording ? "录制中" : "待录制",
@@ -2126,21 +2213,21 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2126
2213
  ]
2127
2214
  })]
2128
2215
  }),
2129
- !n && /* @__PURE__ */ G("div", {
2216
+ !n && /* @__PURE__ */ W("div", {
2130
2217
  className: J.buttonRow,
2131
2218
  "data-assistant-part": "button-row",
2132
- children: i.recording ? /* @__PURE__ */ G(C, {
2219
+ children: i.recording ? /* @__PURE__ */ W(T, {
2133
2220
  type: "primary",
2134
2221
  danger: !0,
2135
- icon: /* @__PURE__ */ G(Fe, {}),
2222
+ icon: /* @__PURE__ */ W(V, {}),
2136
2223
  disabled: !i.recording,
2137
2224
  onClick: () => s.stop(),
2138
2225
  children: "结束录制"
2139
- }) : /* @__PURE__ */ G(C, {
2140
- icon: /* @__PURE__ */ G(Le, {}),
2226
+ }) : /* @__PURE__ */ W(T, {
2227
+ icon: /* @__PURE__ */ W(Re, {}),
2141
2228
  type: "primary",
2142
- disabled: o || i.recording,
2143
- onClick: () => void h(() => {
2229
+ disabled: f || i.recording,
2230
+ onClick: () => void m(() => {
2144
2231
  (!t.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (u(null), s.start(), s.edit({
2145
2232
  ...s.getState().draft,
2146
2233
  name: t.name
@@ -2149,12 +2236,12 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2149
2236
  children: "开始录制"
2150
2237
  })
2151
2238
  }),
2152
- /* @__PURE__ */ G("p", {
2239
+ /* @__PURE__ */ W("p", {
2153
2240
  className: J.hint,
2154
2241
  "data-assistant-part": "hint",
2155
2242
  children: "展开、切换页签等准备操作也需录下来。"
2156
2243
  }),
2157
- /* @__PURE__ */ G(T, {
2244
+ /* @__PURE__ */ W(E, {
2158
2245
  className: J.help,
2159
2246
  "data-assistant-part": "help",
2160
2247
  ghost: !0,
@@ -2169,12 +2256,12 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2169
2256
  },
2170
2257
  items: [{
2171
2258
  key: "details",
2172
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(z, {}), "录制范围"] }),
2173
- children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
2259
+ label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(I, {}), "录制范围"] }),
2260
+ children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
2174
2261
  className: J.hint,
2175
2262
  "data-assistant-part": "hint",
2176
2263
  children: "从业务页面的初始状态开始录制。回放目标由宿主配置。"
2177
- }), /* @__PURE__ */ G("p", {
2264
+ }), /* @__PURE__ */ W("p", {
2178
2265
  className: J.hint,
2179
2266
  "data-assistant-part": "hint",
2180
2267
  children: "普通字段的输入值会写入用例。密码等敏感输入、文件上传、跨域 iframe、拖动和刷新不记录或不支持。"
@@ -2183,7 +2270,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2183
2270
  })
2184
2271
  ]
2185
2272
  }),
2186
- /* @__PURE__ */ K(se, {
2273
+ /* @__PURE__ */ G(ae, {
2187
2274
  className: J.card,
2188
2275
  "data-assistant-part": "card editor-card",
2189
2276
  "aria-label": "用例步骤",
@@ -2194,55 +2281,55 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2194
2281
  gap: 16
2195
2282
  } },
2196
2283
  children: [
2197
- /* @__PURE__ */ K("div", {
2284
+ /* @__PURE__ */ G("div", {
2198
2285
  className: J.cardHeading,
2199
2286
  "data-assistant-part": "card-heading",
2200
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(F, {}), "用例步骤"] }), /* @__PURE__ */ K("span", { children: [t.steps.length, " 个步骤"] })]
2287
+ children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(xe, {}), "用例步骤"] }), /* @__PURE__ */ G("span", { children: [t.steps.length, " 个步骤"] })]
2201
2288
  }),
2202
- !t.steps.length && /* @__PURE__ */ K("div", {
2289
+ !t.steps.length && /* @__PURE__ */ G("div", {
2203
2290
  className: J.emptySteps,
2204
2291
  "data-assistant-part": "empty-steps",
2205
- children: [/* @__PURE__ */ G(we, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2292
+ children: [/* @__PURE__ */ W(Te, {}), /* @__PURE__ */ W("span", { children: "暂无操作步骤" })]
2206
2293
  }),
2207
- /* @__PURE__ */ G("ol", {
2294
+ /* @__PURE__ */ W("ol", {
2208
2295
  className: J.caseSteps,
2209
2296
  "data-assistant-part": "case-steps",
2210
- children: t.steps.map((e, r) => /* @__PURE__ */ K("li", { children: [
2211
- /* @__PURE__ */ K("div", {
2297
+ children: t.steps.map((e, r) => /* @__PURE__ */ G("li", { children: [
2298
+ /* @__PURE__ */ G("div", {
2212
2299
  className: J.stepHeading,
2213
2300
  "data-assistant-part": "step-heading",
2214
2301
  children: [
2215
- /* @__PURE__ */ G("span", {
2302
+ /* @__PURE__ */ W("span", {
2216
2303
  className: J.stepNumber,
2217
2304
  "data-assistant-part": "step-number",
2218
2305
  children: String(r + 1).padStart(2, "0")
2219
2306
  }),
2220
- /* @__PURE__ */ G(O, {
2307
+ /* @__PURE__ */ W(k, {
2221
2308
  color: e.kind === "unsupported" ? "red" : "blue",
2222
2309
  children: Ze[e.kind]
2223
2310
  }),
2224
- /* @__PURE__ */ G("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2225
- e.sourceEventId && /* @__PURE__ */ K(O, { children: ["源事件 #", e.sourceEventId] }),
2226
- e.supplemented && /* @__PURE__ */ G(O, {
2311
+ /* @__PURE__ */ W("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2312
+ e.sourceEventId && /* @__PURE__ */ G(k, { children: ["源事件 #", e.sourceEventId] }),
2313
+ e.supplemented && /* @__PURE__ */ W(k, {
2227
2314
  color: "orange",
2228
2315
  children: "人工补充"
2229
2316
  })
2230
2317
  ]
2231
2318
  }),
2232
- e.assertion && /* @__PURE__ */ K("div", {
2319
+ e.assertion && /* @__PURE__ */ G("div", {
2233
2320
  className: J.assertionSummary,
2234
2321
  "data-assistant-part": "assertion-summary",
2235
2322
  children: [
2236
- /* @__PURE__ */ G(O, {
2323
+ /* @__PURE__ */ W(k, {
2237
2324
  color: "green",
2238
2325
  children: Y.assertionSources[e.assertion.source]
2239
2326
  }),
2240
- /* @__PURE__ */ K("span", { children: [
2327
+ /* @__PURE__ */ G("span", { children: [
2241
2328
  Y.assertionOperators[e.assertion.operator],
2242
2329
  " ",
2243
2330
  e.assertion.expected === "" ? "空字符串" : e.assertion.expected
2244
2331
  ] }),
2245
- /* @__PURE__ */ K("span", {
2332
+ /* @__PURE__ */ G("span", {
2246
2333
  className: J.hint,
2247
2334
  "data-assistant-part": "hint",
2248
2335
  children: [
@@ -2252,32 +2339,33 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2252
2339
  " 秒"
2253
2340
  ]
2254
2341
  }),
2255
- e.assertion.selector && /* @__PURE__ */ G("code", { children: e.assertion.selector }),
2256
- e.assertion.method && /* @__PURE__ */ K("code", { children: [
2342
+ e.assertion.selector && /* @__PURE__ */ W("code", { children: e.assertion.selector }),
2343
+ e.assertion.method && /* @__PURE__ */ G("code", { children: [
2257
2344
  e.assertion.method,
2258
2345
  " ",
2259
2346
  e.assertion.pathname
2260
2347
  ] })
2261
2348
  ]
2262
2349
  }),
2263
- e.kind === "unsupported" && !n && /* @__PURE__ */ G(nt, {
2350
+ e.kind === "unsupported" && !n && /* @__PURE__ */ W(nt, {
2264
2351
  step: e,
2265
- disabled: i.recording || o,
2352
+ defaultExpanded: e.supplemented,
2353
+ disabled: i.recording || f,
2266
2354
  onApply: (e) => s.edit({
2267
2355
  ...t,
2268
2356
  steps: t.steps.map((t, n) => n === r ? e : t)
2269
2357
  })
2270
2358
  }, JSON.stringify(e)),
2271
- e.value !== void 0 && (n || e.kind !== "unsupported") && /* @__PURE__ */ G(E, {
2359
+ e.value !== void 0 && (n || e.kind !== "unsupported") && /* @__PURE__ */ W(D, {
2272
2360
  "aria-label": `第 ${r + 1} 步内容`,
2273
2361
  readOnly: n,
2274
2362
  value: e.value,
2275
2363
  maxLength: 2e3,
2276
- disabled: i.recording || o,
2277
- onChange: (e) => g(r, { value: e.target.value })
2364
+ disabled: i.recording || f,
2365
+ onChange: (e) => h(r, { value: e.target.value })
2278
2366
  }),
2279
- e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
2280
- e.target && /* @__PURE__ */ G(T, {
2367
+ e.kind === "check" && /* @__PURE__ */ W("span", { children: e.checked ? "选中" : "取消选中" }),
2368
+ e.target && /* @__PURE__ */ W(E, {
2281
2369
  ghost: !0,
2282
2370
  size: "small",
2283
2371
  styles: {
@@ -2290,27 +2378,27 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2290
2378
  },
2291
2379
  items: [{
2292
2380
  key: "details",
2293
- label: /* @__PURE__ */ G(W, { children: "定位信息" }),
2294
- children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("code", { children: e.target.selector }) })
2381
+ label: /* @__PURE__ */ W(U, { children: "定位信息" }),
2382
+ children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("code", { children: e.target.selector }) })
2295
2383
  }]
2296
2384
  }),
2297
- !n && /* @__PURE__ */ K("div", {
2385
+ !n && /* @__PURE__ */ G("div", {
2298
2386
  className: [J.buttonRow, J.stepActions].join(" "),
2299
2387
  "data-assistant-part": "button-row step-actions",
2300
2388
  children: [
2301
- /* @__PURE__ */ G(C, {
2389
+ /* @__PURE__ */ W(T, {
2302
2390
  size: "small",
2303
2391
  type: "text",
2304
- icon: /* @__PURE__ */ G(M, {}),
2305
- disabled: i.recording || o || !e.assertion && t.steps.length >= 100,
2306
- onClick: () => f(r + 1, e.assertion ? r : void 0),
2392
+ icon: /* @__PURE__ */ W(M, {}),
2393
+ disabled: i.recording || f || !e.assertion && t.steps.length >= 100,
2394
+ onClick: () => d(r + 1, e.assertion ? r : void 0, r),
2307
2395
  children: e.assertion ? "编辑断言" : "在此步后添加断言"
2308
2396
  }),
2309
- /* @__PURE__ */ K(C, {
2397
+ /* @__PURE__ */ G(T, {
2310
2398
  type: "text",
2311
- icon: /* @__PURE__ */ G(V, {}),
2399
+ icon: /* @__PURE__ */ W(z, {}),
2312
2400
  size: "small",
2313
- disabled: i.recording || o || t.steps.length >= 100,
2401
+ disabled: i.recording || f || t.steps.length >= 100,
2314
2402
  onClick: () => {
2315
2403
  u(null), s.edit({
2316
2404
  ...t,
@@ -2318,6 +2406,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2318
2406
  ...t.steps.slice(0, r),
2319
2407
  {
2320
2408
  kind: "unsupported",
2409
+ supplemented: !0,
2321
2410
  value: "人工前置步骤待补充"
2322
2411
  },
2323
2412
  ...t.steps.slice(r)
@@ -2330,12 +2419,12 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2330
2419
  " 步前插入"
2331
2420
  ]
2332
2421
  }),
2333
- /* @__PURE__ */ K(C, {
2422
+ /* @__PURE__ */ G(T, {
2334
2423
  type: "text",
2335
- icon: /* @__PURE__ */ G(ve, {}),
2424
+ icon: /* @__PURE__ */ W(N, {}),
2336
2425
  danger: !0,
2337
2426
  size: "small",
2338
- disabled: i.recording || o,
2427
+ disabled: i.recording || f,
2339
2428
  onClick: () => {
2340
2429
  u(null), s.edit({
2341
2430
  ...t,
@@ -2349,10 +2438,11 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2349
2438
  ]
2350
2439
  })
2351
2440
  ]
2352
- })
2441
+ }),
2442
+ !n && l?.anchor === r && g(t, f)
2353
2443
  ] }, r))
2354
2444
  }),
2355
- t.timeline && /* @__PURE__ */ G(T, {
2445
+ t.timeline && /* @__PURE__ */ W(E, {
2356
2446
  ghost: !0,
2357
2447
  size: "small",
2358
2448
  styles: {
@@ -2365,110 +2455,36 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2365
2455
  },
2366
2456
  items: [{
2367
2457
  key: "details",
2368
- label: /* @__PURE__ */ K(W, { children: [
2458
+ label: /* @__PURE__ */ G(U, { children: [
2369
2459
  "选段原始证据(",
2370
2460
  t.timeline.events.length,
2371
2461
  " 条,只读)"
2372
2462
  ] }),
2373
- children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ G("pre", {
2463
+ children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ W("pre", {
2374
2464
  className: J.json,
2375
2465
  "data-assistant-part": "json",
2376
2466
  children: JSON.stringify(t.timeline, null, 2)
2377
2467
  })] })
2378
2468
  }]
2379
2469
  }),
2380
- /* @__PURE__ */ K("div", {
2381
- ref: d,
2470
+ /* @__PURE__ */ G("div", {
2382
2471
  className: J.assertionArea,
2383
2472
  "data-assistant-part": "assertion-area",
2384
- children: [/* @__PURE__ */ K("div", {
2473
+ children: [/* @__PURE__ */ G("div", {
2385
2474
  className: J.cardHeading,
2386
2475
  "data-assistant-part": "card-heading",
2387
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(M, {}), " 结果断言"] }), /* @__PURE__ */ K(O, { children: [
2476
+ children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(M, {}), " 结果断言"] }), /* @__PURE__ */ G(k, { children: [
2388
2477
  t.steps.filter((e) => e.kind === "assert" || e.kind === "assert-text").length,
2389
2478
  " ",
2390
2479
  "条"
2391
2480
  ] })]
2392
- }), !n && (l ? /* @__PURE__ */ G(et, {
2393
- initial: l.edit === void 0 ? void 0 : t.steps[l.edit]?.assertion,
2394
- steps: t.steps,
2395
- position: l.position,
2396
- disabled: o || i.recording,
2397
- onCancel: () => u(null),
2398
- onSave: (e, n) => {
2399
- let r = [...t.steps];
2400
- l.edit === void 0 ? r.splice(n, 0, {
2401
- kind: "assert",
2402
- assertion: e,
2403
- supplemented: !0
2404
- }) : r[l.edit] = {
2405
- ...r[l.edit],
2406
- kind: "assert",
2407
- assertion: e,
2408
- supplemented: !0
2409
- }, s.edit((0, Y.parseCase)({
2410
- ...t,
2411
- steps: r
2412
- })), u(null);
2413
- }
2414
- }, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ G(C, {
2481
+ }), !n && (l?.anchor === void 0 && l ? g(t, f) : !l && /* @__PURE__ */ W(T, {
2415
2482
  type: "text",
2416
- icon: /* @__PURE__ */ G(V, {}),
2417
- disabled: o || i.recording || t.steps.length >= 100,
2418
- onClick: () => f(t.steps.length),
2483
+ icon: /* @__PURE__ */ W(z, {}),
2484
+ disabled: f || i.recording || t.steps.length >= 100,
2485
+ onClick: () => d(t.steps.length),
2419
2486
  children: "添加断言"
2420
2487
  }))]
2421
- }),
2422
- !n && /* @__PURE__ */ K("div", {
2423
- className: [J.buttonRow, J.cardActions].join(" "),
2424
- "data-assistant-part": "button-row card-actions",
2425
- children: [
2426
- /* @__PURE__ */ G(C, {
2427
- icon: /* @__PURE__ */ G(H, {}),
2428
- type: "primary",
2429
- disabled: i.recording || o || !t.name.trim() || !t.steps.length,
2430
- onClick: () => void h(() => {
2431
- let e = (0, Y.parseCase)(t);
2432
- return r?.(e);
2433
- }),
2434
- children: "保存用例"
2435
- }),
2436
- /* @__PURE__ */ G(C, {
2437
- disabled: o || i.recording,
2438
- onClick: p,
2439
- children: "取消"
2440
- }),
2441
- /* @__PURE__ */ G($e, {
2442
- label: "用例文件操作",
2443
- disabled: o || i.recording,
2444
- items: [{
2445
- key: "import",
2446
- label: "导入用例",
2447
- onClick: () => a.current?.click()
2448
- }, {
2449
- key: "export",
2450
- label: "导出用例 JSON",
2451
- disabled: !t.steps.length,
2452
- onClick: () => void h(() => {
2453
- let e = (0, Y.parseCase)(t), n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
2454
- r.href = n, r.download = "页面录制用例.json", document.body.append(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
2455
- })
2456
- }]
2457
- }),
2458
- /* @__PURE__ */ G("input", {
2459
- hidden: !0,
2460
- type: "file",
2461
- ref: a,
2462
- accept: ".json,application/json",
2463
- onChange: (e) => {
2464
- let t = e.target.files?.[0];
2465
- e.target.value = "", !t || i.recording || o || h(async () => {
2466
- if (t.size > 524288) throw Error("用例不能超过 512 KB");
2467
- (!c || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2468
- });
2469
- }
2470
- })
2471
- ]
2472
2488
  })
2473
2489
  ]
2474
2490
  })
@@ -2549,25 +2565,25 @@ var bt = {
2549
2565
  performance: "性能"
2550
2566
  };
2551
2567
  function xt({ events: e, onDraft: t }) {
2552
- 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));
2553
- return /* @__PURE__ */ K("div", {
2568
+ let n = C(s.subscribe, s.getState), [r, i] = S(null), [a, o] = S(), [c, l] = S(), [u, d] = S("all"), [f, p] = S(""), [m, h] = S(""), g = r ? vt(r, a, c) : [], _ = new Set(g.map((e) => e.id)), v = r ?? e.filter((e) => (u === "all" || e.kind === u) && (e.title + e.page).includes(f));
2569
+ return /* @__PURE__ */ G("div", {
2554
2570
  className: gt.section,
2555
2571
  "data-assistant-part": "section",
2556
2572
  children: [
2557
- /* @__PURE__ */ K("div", {
2573
+ /* @__PURE__ */ G("div", {
2558
2574
  className: gt.sectionHeading,
2559
2575
  "data-assistant-part": "section-heading",
2560
- children: [/* @__PURE__ */ G("span", {
2576
+ children: [/* @__PURE__ */ W("span", {
2561
2577
  className: gt.headingIcon,
2562
2578
  "data-assistant-part": "heading-icon",
2563
- children: /* @__PURE__ */ G(De, {})
2564
- }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "操作时间线" }) })]
2579
+ children: /* @__PURE__ */ W(Ae, {})
2580
+ }), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "操作时间线" }) })]
2565
2581
  }),
2566
- t && /* @__PURE__ */ K("div", {
2582
+ t && /* @__PURE__ */ G("div", {
2567
2583
  className: gt.buttonRow,
2568
2584
  "data-assistant-part": "button-row",
2569
- children: [!r && /* @__PURE__ */ G(C, {
2570
- icon: /* @__PURE__ */ G(U, {}),
2585
+ children: [!r && /* @__PURE__ */ W(T, {
2586
+ icon: /* @__PURE__ */ W(B, {}),
2571
2587
  disabled: n.recording || !e.length,
2572
2588
  onClick: () => {
2573
2589
  try {
@@ -2577,14 +2593,14 @@ function xt({ events: e, onDraft: t }) {
2577
2593
  }
2578
2594
  },
2579
2595
  children: "开始选段"
2580
- }), r && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
2581
- icon: /* @__PURE__ */ G(_e, {}),
2596
+ }), r && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(T, {
2597
+ icon: /* @__PURE__ */ W(_e, {}),
2582
2598
  onClick: () => {
2583
2599
  i(null), o(void 0), l(void 0), h("");
2584
2600
  },
2585
2601
  children: "退出选段"
2586
- }), /* @__PURE__ */ G(C, {
2587
- icon: /* @__PURE__ */ G(Ce, {}),
2602
+ }), /* @__PURE__ */ W(T, {
2603
+ icon: /* @__PURE__ */ W(we, {}),
2588
2604
  type: "primary",
2589
2605
  disabled: !g.length || n.recording,
2590
2606
  onClick: () => {
@@ -2597,7 +2613,7 @@ function xt({ events: e, onDraft: t }) {
2597
2613
  children: "生成用例草稿"
2598
2614
  })] })]
2599
2615
  }),
2600
- r && /* @__PURE__ */ K("p", {
2616
+ r && /* @__PURE__ */ G("p", {
2601
2617
  className: gt.hint,
2602
2618
  "aria-live": "polite",
2603
2619
  children: [
@@ -2610,14 +2626,14 @@ function xt({ events: e, onDraft: t }) {
2610
2626
  g.length > 0 && " · 输入值与定位需补充"
2611
2627
  ]
2612
2628
  }),
2613
- m && /* @__PURE__ */ G(S, {
2629
+ m && /* @__PURE__ */ W(w, {
2614
2630
  type: "warning",
2615
2631
  title: m
2616
2632
  }),
2617
- !r && /* @__PURE__ */ K("div", {
2633
+ !r && /* @__PURE__ */ G("div", {
2618
2634
  className: gt.filters,
2619
2635
  "data-assistant-part": "filters",
2620
- children: [/* @__PURE__ */ G(D, {
2636
+ children: [/* @__PURE__ */ W(O, {
2621
2637
  "aria-label": "事件类型",
2622
2638
  value: u,
2623
2639
  onChange: d,
@@ -2628,8 +2644,8 @@ function xt({ events: e, onDraft: t }) {
2628
2644
  value: e,
2629
2645
  label: t
2630
2646
  }))]
2631
- }), /* @__PURE__ */ G(E, {
2632
- prefix: /* @__PURE__ */ G(Pe, {}),
2647
+ }), /* @__PURE__ */ W(D, {
2648
+ prefix: /* @__PURE__ */ W(Le, {}),
2633
2649
  "aria-label": "搜索时间线",
2634
2650
  placeholder: "搜索操作或页面",
2635
2651
  value: f,
@@ -2637,35 +2653,35 @@ function xt({ events: e, onDraft: t }) {
2637
2653
  allowClear: !0
2638
2654
  })]
2639
2655
  }),
2640
- !ee.length && /* @__PURE__ */ G(ue, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2641
- /* @__PURE__ */ G("ol", {
2656
+ !v.length && /* @__PURE__ */ W(le, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2657
+ /* @__PURE__ */ W("ol", {
2642
2658
  className: gt.timeline,
2643
2659
  "data-assistant-part": "timeline",
2644
- children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ K("li", {
2660
+ children: v.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ G("li", {
2645
2661
  className: e.kind === "error" ? gt.error : "",
2646
2662
  children: [
2647
- /* @__PURE__ */ K("div", {
2663
+ /* @__PURE__ */ G("div", {
2648
2664
  className: gt.eventMeta,
2649
2665
  "data-assistant-part": "event-meta",
2650
2666
  children: [
2651
- /* @__PURE__ */ G(O, {
2667
+ /* @__PURE__ */ W(k, {
2652
2668
  color: e.kind === "error" ? "red" : "blue",
2653
2669
  children: bt[e.kind]
2654
2670
  }),
2655
- /* @__PURE__ */ G("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2656
- /* @__PURE__ */ K("small", { children: ["#", e.id] }),
2657
- _.has(e.id) && /* @__PURE__ */ G(O, {
2671
+ /* @__PURE__ */ W("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2672
+ /* @__PURE__ */ G("small", { children: ["#", e.id] }),
2673
+ _.has(e.id) && /* @__PURE__ */ W(k, {
2658
2674
  color: "gold",
2659
2675
  children: "已选"
2660
2676
  })
2661
2677
  ]
2662
2678
  }),
2663
- /* @__PURE__ */ G("strong", { children: e.title }),
2664
- r && /* @__PURE__ */ K("div", {
2679
+ /* @__PURE__ */ W("strong", { children: e.title }),
2680
+ r && /* @__PURE__ */ G("div", {
2665
2681
  className: gt.buttonRow,
2666
2682
  "data-assistant-part": "button-row",
2667
- children: [/* @__PURE__ */ G(C, {
2668
- icon: /* @__PURE__ */ G(Te, {}),
2683
+ children: [/* @__PURE__ */ W(T, {
2684
+ icon: /* @__PURE__ */ W(Ee, {}),
2669
2685
  size: "small",
2670
2686
  "aria-label": `从事件 ${e.id} 开始`,
2671
2687
  "aria-pressed": a === e.id,
@@ -2673,8 +2689,8 @@ function xt({ events: e, onDraft: t }) {
2673
2689
  o(e.id), l(void 0);
2674
2690
  },
2675
2691
  children: "设为起点"
2676
- }), /* @__PURE__ */ G(C, {
2677
- icon: /* @__PURE__ */ G(M, {}),
2692
+ }), /* @__PURE__ */ W(T, {
2693
+ icon: /* @__PURE__ */ W(M, {}),
2678
2694
  size: "small",
2679
2695
  "aria-label": `到事件 ${e.id} 结束`,
2680
2696
  "aria-pressed": c === e.id,
@@ -2683,7 +2699,7 @@ function xt({ events: e, onDraft: t }) {
2683
2699
  children: "设为终点"
2684
2700
  })]
2685
2701
  }),
2686
- /* @__PURE__ */ G(T, {
2702
+ /* @__PURE__ */ W(E, {
2687
2703
  ghost: !0,
2688
2704
  size: "small",
2689
2705
  styles: {
@@ -2696,8 +2712,8 @@ function xt({ events: e, onDraft: t }) {
2696
2712
  },
2697
2713
  items: [{
2698
2714
  key: "details",
2699
- label: /* @__PURE__ */ K(W, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
2700
- children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("pre", {
2715
+ label: /* @__PURE__ */ G(U, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
2716
+ children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("pre", {
2701
2717
  className: gt.json,
2702
2718
  "data-assistant-part": "json",
2703
2719
  children: JSON.stringify({
@@ -2716,22 +2732,22 @@ function xt({ events: e, onDraft: t }) {
2716
2732
  var St = { avatar: "_avatar_1modk_1" };
2717
2733
  // src/components/AssistantAvatar/index.tsx
2718
2734
  function Ct({ className: e }) {
2719
- return /* @__PURE__ */ G("span", {
2735
+ return /* @__PURE__ */ W("span", {
2720
2736
  className: [St.avatar, e].filter(Boolean).join(" "),
2721
2737
  "data-assistant-part": "avatar",
2722
2738
  "aria-hidden": "true",
2723
- children: /* @__PURE__ */ K("svg", {
2739
+ children: /* @__PURE__ */ G("svg", {
2724
2740
  viewBox: "0 0 40 40",
2725
2741
  fill: "none",
2726
2742
  focusable: "false",
2727
2743
  children: [
2728
- /* @__PURE__ */ G("path", {
2744
+ /* @__PURE__ */ W("path", {
2729
2745
  d: "M19 5v6M16 5h6",
2730
2746
  stroke: "currentColor",
2731
2747
  strokeWidth: "2.5",
2732
2748
  strokeLinecap: "round"
2733
2749
  }),
2734
- /* @__PURE__ */ G("rect", {
2750
+ /* @__PURE__ */ W("rect", {
2735
2751
  x: "6",
2736
2752
  y: "11",
2737
2753
  width: "28",
@@ -2739,7 +2755,7 @@ function Ct({ className: e }) {
2739
2755
  rx: "11",
2740
2756
  fill: "currentColor"
2741
2757
  }),
2742
- /* @__PURE__ */ G("rect", {
2758
+ /* @__PURE__ */ W("rect", {
2743
2759
  x: "2",
2744
2760
  y: "20",
2745
2761
  width: "2.5",
@@ -2747,7 +2763,7 @@ function Ct({ className: e }) {
2747
2763
  rx: "1.25",
2748
2764
  fill: "currentColor"
2749
2765
  }),
2750
- /* @__PURE__ */ G("rect", {
2766
+ /* @__PURE__ */ W("rect", {
2751
2767
  x: "35.5",
2752
2768
  y: "20",
2753
2769
  width: "2.5",
@@ -2755,7 +2771,7 @@ function Ct({ className: e }) {
2755
2771
  rx: "1.25",
2756
2772
  fill: "currentColor"
2757
2773
  }),
2758
- /* @__PURE__ */ G("rect", {
2774
+ /* @__PURE__ */ W("rect", {
2759
2775
  x: "11",
2760
2776
  y: "17",
2761
2777
  width: "18",
@@ -2763,7 +2779,7 @@ function Ct({ className: e }) {
2763
2779
  rx: "6",
2764
2780
  fill: "#244b40"
2765
2781
  }),
2766
- /* @__PURE__ */ G("rect", {
2782
+ /* @__PURE__ */ W("rect", {
2767
2783
  x: "15",
2768
2784
  y: "21",
2769
2785
  width: "3",
@@ -2771,7 +2787,7 @@ function Ct({ className: e }) {
2771
2787
  rx: "1.5",
2772
2788
  fill: "currentColor"
2773
2789
  }),
2774
- /* @__PURE__ */ G("rect", {
2790
+ /* @__PURE__ */ W("rect", {
2775
2791
  x: "22",
2776
2792
  y: "21",
2777
2793
  width: "3",
@@ -2779,7 +2795,7 @@ function Ct({ className: e }) {
2779
2795
  rx: "1.5",
2780
2796
  fill: "currentColor"
2781
2797
  }),
2782
- /* @__PURE__ */ G("path", {
2798
+ /* @__PURE__ */ W("path", {
2783
2799
  d: "m32 3 1.3 3.7L37 8l-3.7 1.3L32 13l-1.3-3.7L27 8l3.7-1.3Z",
2784
2800
  fill: "#ffe2ac"
2785
2801
  })
@@ -2799,12 +2815,12 @@ var wt = {
2799
2815
  };
2800
2816
  // src/layouts/FloatingPanel/useOverlayScrollbars.ts
2801
2817
  function Tt(e, t) {
2802
- y(() => {
2818
+ b(() => {
2803
2819
  let n = e.current;
2804
2820
  if (!n || !t) return;
2805
2821
  let r = /* @__PURE__ */ new Map(), i = 0, a = () => {
2806
2822
  for (let [e, t] of r) n.contains(e) || (t.destroy(), r.delete(e));
2807
- 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({
2823
+ 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, Be({
2808
2824
  target: e,
2809
2825
  elements: { viewport: e }
2810
2826
  }, {
@@ -2840,18 +2856,18 @@ var Et = 12, Dt = (e) => {
2840
2856
  y: Math.max(Et, Math.min(e.y, window.innerHeight - n - Et))
2841
2857
  };
2842
2858
  }, Ot = (e) => {
2843
- let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = x(() => Dt({
2859
+ let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = S(() => Dt({
2844
2860
  x: window.innerWidth - 564,
2845
2861
  y: window.innerHeight - 744,
2846
2862
  width: 540,
2847
2863
  height: 720
2848
- })), [s, c] = x(!1), [l, u] = x(!1), d = re(null);
2864
+ })), [s, c] = S(!1), [l, u] = S(!1), d = ne(null);
2849
2865
  Tt(d, t);
2850
- let f = re(null);
2851
- y(() => {
2866
+ let f = ne(null);
2867
+ b(() => {
2852
2868
  let e = () => o((e) => Dt(e));
2853
2869
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
2854
- }, []), y(() => {
2870
+ }, []), b(() => {
2855
2871
  t && d.current?.focus({ preventScroll: !0 });
2856
2872
  }, [t]);
2857
2873
  let p = (e, t = !1) => {
@@ -2877,7 +2893,7 @@ var Et = 12, Dt = (e) => {
2877
2893
  }, h = () => {
2878
2894
  f.current = null, u(!1);
2879
2895
  };
2880
- return /* @__PURE__ */ K("section", {
2896
+ return /* @__PURE__ */ G("section", {
2881
2897
  ref: d,
2882
2898
  id: "research-assistant-window",
2883
2899
  role: "dialog",
@@ -2904,10 +2920,10 @@ var Et = 12, Dt = (e) => {
2904
2920
  e.key === "Escape" && e.target === e.currentTarget && n();
2905
2921
  },
2906
2922
  children: [
2907
- /* @__PURE__ */ K("header", {
2923
+ /* @__PURE__ */ G("header", {
2908
2924
  className: wt.header,
2909
2925
  "data-assistant-part": "header",
2910
- children: [/* @__PURE__ */ K("div", {
2926
+ children: [/* @__PURE__ */ G("div", {
2911
2927
  className: wt.drag,
2912
2928
  "data-assistant-part": "drag",
2913
2929
  tabIndex: 0,
@@ -2934,30 +2950,30 @@ var Et = 12, Dt = (e) => {
2934
2950
  y: n.y + (e.key === "ArrowUp" ? -t : e.key === "ArrowDown" ? t : 0)
2935
2951
  }));
2936
2952
  },
2937
- children: [/* @__PURE__ */ G(Ct, {}), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ K("h2", {
2953
+ children: [/* @__PURE__ */ W(Ct, {}), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ G("h2", {
2938
2954
  id: "research-assistant-title",
2939
- children: ["研发小蜜 ", /* @__PURE__ */ G("span", { children: i ? "开发助手" : "问题反馈" })]
2955
+ children: ["研发小蜜 ", /* @__PURE__ */ W("span", { children: i ? "开发助手" : "问题反馈" })]
2940
2956
  }) })]
2941
- }), /* @__PURE__ */ K("div", {
2957
+ }), /* @__PURE__ */ G("div", {
2942
2958
  className: wt.windowActions,
2943
2959
  "data-assistant-part": "window-actions",
2944
- children: [/* @__PURE__ */ G(C, {
2960
+ children: [/* @__PURE__ */ W(T, {
2945
2961
  type: "text",
2946
2962
  "aria-label": s ? "还原小窗" : "放大分析",
2947
2963
  title: s ? "还原小窗" : "放大分析",
2948
2964
  onClick: () => c((e) => !e),
2949
- children: G(s ? L : R, {})
2950
- }), /* @__PURE__ */ G(C, {
2965
+ children: W(s ? Oe : ke, {})
2966
+ }), /* @__PURE__ */ W(T, {
2951
2967
  type: "text",
2952
2968
  "aria-label": "最小化研发小蜜",
2953
2969
  title: "最小化",
2954
2970
  onClick: n,
2955
- children: /* @__PURE__ */ G(B, {})
2971
+ children: /* @__PURE__ */ W(R, {})
2956
2972
  })]
2957
2973
  })]
2958
2974
  }),
2959
2975
  r,
2960
- !s && /* @__PURE__ */ G("div", {
2976
+ !s && /* @__PURE__ */ W("div", {
2961
2977
  className: wt.resize,
2962
2978
  "data-assistant-part": "resize",
2963
2979
  role: "group",
@@ -2999,28 +3015,28 @@ var Et = 12, Dt = (e) => {
2999
3015
  // src/pages/assistant/components/PerformancePanel/index.tsx
3000
3016
  function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3001
3017
  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(" ");
3002
- return /* @__PURE__ */ K("div", {
3018
+ return /* @__PURE__ */ G("div", {
3003
3019
  className: $.section,
3004
3020
  "data-assistant-part": "section",
3005
3021
  children: [
3006
- /* @__PURE__ */ K("div", {
3022
+ /* @__PURE__ */ G("div", {
3007
3023
  className: $.sectionHeading,
3008
3024
  "data-assistant-part": "section-heading",
3009
3025
  children: [
3010
- /* @__PURE__ */ G("span", {
3026
+ /* @__PURE__ */ W("span", {
3011
3027
  className: $.headingIcon,
3012
3028
  "data-assistant-part": "heading-icon",
3013
- children: /* @__PURE__ */ G(P, {})
3029
+ children: /* @__PURE__ */ W(ye, {})
3014
3030
  }),
3015
- /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "性能诊断" }) }),
3016
- /* @__PURE__ */ G(O, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3017
- !a.length && /* @__PURE__ */ G(O, { children: "未触发告警" })
3031
+ /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "性能诊断" }) }),
3032
+ /* @__PURE__ */ W(k, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3033
+ !a.length && /* @__PURE__ */ W(k, { children: "未触发告警" })
3018
3034
  ]
3019
3035
  }),
3020
- /* @__PURE__ */ G("div", {
3036
+ /* @__PURE__ */ W("div", {
3021
3037
  className: $.issueList,
3022
3038
  "data-assistant-part": "issue-list",
3023
- children: a.map((e) => /* @__PURE__ */ K(se, {
3039
+ children: a.map((e) => /* @__PURE__ */ G(ae, {
3024
3040
  className: [$.card, $.performanceIssue].join(" "),
3025
3041
  "data-assistant-part": "card performance-issue",
3026
3042
  styles: { body: {
@@ -3030,16 +3046,16 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3030
3046
  gap: 16
3031
3047
  } },
3032
3048
  children: [
3033
- /* @__PURE__ */ G("div", {
3049
+ /* @__PURE__ */ W("div", {
3034
3050
  className: $.cardHeading,
3035
3051
  "data-assistant-part": "card-heading",
3036
- children: /* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(O, {
3052
+ children: /* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(k, {
3037
3053
  color: e.severity === "error" ? "red" : "orange",
3038
3054
  children: e.severity === "error" ? "较高风险" : "需关注"
3039
3055
  }), e.title] })
3040
3056
  }),
3041
- /* @__PURE__ */ G("p", { children: e.evidence }),
3042
- /* @__PURE__ */ G(T, {
3057
+ /* @__PURE__ */ W("p", { children: e.evidence }),
3058
+ /* @__PURE__ */ W(E, {
3043
3059
  ghost: !0,
3044
3060
  size: "small",
3045
3061
  styles: {
@@ -3052,19 +3068,19 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3052
3068
  },
3053
3069
  items: [{
3054
3070
  key: "details",
3055
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(j, {}), " 排查建议与触发依据"] }),
3056
- children: /* @__PURE__ */ K(W, { children: [
3057
- /* @__PURE__ */ G("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ G("li", { children: e }, e)) }),
3058
- /* @__PURE__ */ G("p", {
3071
+ label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(A, {}), " 排查建议与触发依据"] }),
3072
+ children: /* @__PURE__ */ G(U, { children: [
3073
+ /* @__PURE__ */ W("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ W("li", { children: e }, e)) }),
3074
+ /* @__PURE__ */ W("p", {
3059
3075
  className: $.hint,
3060
3076
  "data-assistant-part": "hint",
3061
3077
  children: e.rule
3062
3078
  }),
3063
- /* @__PURE__ */ K("a", {
3079
+ /* @__PURE__ */ G("a", {
3064
3080
  href: e.url,
3065
3081
  target: "_blank",
3066
3082
  rel: "noreferrer",
3067
- children: [/* @__PURE__ */ G(ke, {}), " 查看官方排查文档"]
3083
+ children: [/* @__PURE__ */ W(je, {}), " 查看官方排查文档"]
3068
3084
  })
3069
3085
  ] })
3070
3086
  }]
@@ -3072,7 +3088,7 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3072
3088
  ]
3073
3089
  }, e.id))
3074
3090
  }),
3075
- /* @__PURE__ */ K(se, {
3091
+ /* @__PURE__ */ G(ae, {
3076
3092
  className: $.card,
3077
3093
  "data-assistant-part": "card",
3078
3094
  styles: { body: {
@@ -3081,51 +3097,51 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3081
3097
  flexDirection: "column",
3082
3098
  gap: 16
3083
3099
  } },
3084
- children: [/* @__PURE__ */ K("div", {
3100
+ children: [/* @__PURE__ */ G("div", {
3085
3101
  className: $.cardHeading,
3086
3102
  "data-assistant-part": "card-heading",
3087
- children: [/* @__PURE__ */ G("h3", { children: "JS 堆内存趋势" }), /* @__PURE__ */ G("span", { children: c ? o(c.used) : "暂无采样" })]
3088
- }), s.length > 1 ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("svg", {
3103
+ children: [/* @__PURE__ */ W("h3", { children: "JS 堆内存趋势" }), /* @__PURE__ */ W("span", { children: c ? o(c.used) : "暂无采样" })]
3104
+ }), s.length > 1 ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("svg", {
3089
3105
  className: $.memoryChart,
3090
3106
  "data-assistant-part": "memory-chart",
3091
3107
  viewBox: "0 0 600 90",
3092
3108
  role: "img",
3093
3109
  "aria-label": `内存趋势,最低 ${o(l)},最高 ${o(u)},当前 ${o(c.used)}`,
3094
- children: [/* @__PURE__ */ G("path", {
3110
+ children: [/* @__PURE__ */ W("path", {
3095
3111
  d: "M4 76 H596",
3096
3112
  stroke: "currentColor",
3097
3113
  opacity: ".2"
3098
- }), /* @__PURE__ */ G("polyline", {
3114
+ }), /* @__PURE__ */ W("polyline", {
3099
3115
  points: p,
3100
3116
  fill: "none",
3101
3117
  stroke: "currentColor",
3102
3118
  strokeWidth: "2",
3103
3119
  vectorEffect: "non-scaling-stroke"
3104
3120
  })]
3105
- }), /* @__PURE__ */ K("div", {
3121
+ }), /* @__PURE__ */ G("div", {
3106
3122
  className: $.cardHeading,
3107
3123
  "data-assistant-part": "card-heading",
3108
- children: [/* @__PURE__ */ K("span", { children: [
3124
+ children: [/* @__PURE__ */ G("span", { children: [
3109
3125
  new Date(d).toLocaleTimeString(),
3110
3126
  " · ",
3111
3127
  o(l)
3112
- ] }), /* @__PURE__ */ K("span", { children: [
3128
+ ] }), /* @__PURE__ */ G("span", { children: [
3113
3129
  new Date(c.time).toLocaleTimeString(),
3114
3130
  " · 峰值 ",
3115
3131
  o(u)
3116
3132
  ] })]
3117
- })] }) : /* @__PURE__ */ G("p", {
3133
+ })] }) : /* @__PURE__ */ W("p", {
3118
3134
  className: $.hint,
3119
3135
  "data-assistant-part": "hint",
3120
3136
  children: c ? "正在积累连续采样,持续增长风险至少需要观察 60 秒。" : "暂无连续采样,可能因浏览器不支持、采集暂停或快照过旧。"
3121
3137
  })]
3122
3138
  }),
3123
- /* @__PURE__ */ K("h3", {
3139
+ /* @__PURE__ */ G("h3", {
3124
3140
  className: $.subheading,
3125
3141
  "data-assistant-part": "subheading",
3126
- children: [/* @__PURE__ */ G(P, {}), " 页面指标"]
3142
+ children: [/* @__PURE__ */ W(ye, {}), " 页面指标"]
3127
3143
  }),
3128
- /* @__PURE__ */ G("div", {
3144
+ /* @__PURE__ */ W("div", {
3129
3145
  className: $.metrics,
3130
3146
  "data-assistant-part": "metrics",
3131
3147
  children: [
@@ -3137,18 +3153,18 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3137
3153
  ["load", "页面加载"],
3138
3154
  ["longTasks", "长任务次数"],
3139
3155
  ["longTaskDuration", "长任务总耗时"]
3140
- ].map(([t, n]) => /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("span", { children: [
3156
+ ].map(([t, n]) => /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("span", { children: [
3141
3157
  n,
3142
3158
  " · ",
3143
3159
  t
3144
- ] }), /* @__PURE__ */ G("strong", { children: e[t] == null ? "不可用" : t === "CLS" ? e[t].toFixed(4) : `${Math.round(e[t])}${t === "longTasks" ? " 次" : " ms"}` })] }, t))
3160
+ ] }), /* @__PURE__ */ W("strong", { children: e[t] == null ? "不可用" : t === "CLS" ? e[t].toFixed(4) : `${Math.round(e[t])}${t === "longTasks" ? " 次" : " ms"}` })] }, t))
3145
3161
  }),
3146
- /* @__PURE__ */ K("details", {
3162
+ /* @__PURE__ */ G("details", {
3147
3163
  className: $.hint,
3148
3164
  children: [
3149
- /* @__PURE__ */ G("summary", { children: "采集范围" }),
3150
- /* @__PURE__ */ K("p", { children: [i ? "仅分析快照数据,旧快照可能没有连续采样。" : "前台每 5 秒采样,最多保留 15 分钟。", "堆内存为估算值,请用 DevTools 堆快照确认泄漏。"] }),
3151
- /* @__PURE__ */ G("p", { children: "LCP / CLS 按文档统计,业务路由切换不重置。尚未采集完整 INP。" })
3165
+ /* @__PURE__ */ W("summary", { children: "采集范围" }),
3166
+ /* @__PURE__ */ G("p", { children: [i ? "仅分析快照数据,旧快照可能没有连续采样。" : "前台每 5 秒采样,最多保留 15 分钟。", "堆内存为估算值,请用 DevTools 堆快照确认泄漏。"] }),
3167
+ /* @__PURE__ */ W("p", { children: "LCP / CLS 按文档统计,业务路由切换不重置。尚未采集完整 INP。" })
3152
3168
  ]
3153
3169
  })
3154
3170
  ]
@@ -3156,7 +3172,7 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3156
3172
  }
3157
3173
  // src/pages/assistant/index.tsx
3158
3174
  function At({ value: e }) {
3159
- return /* @__PURE__ */ G("pre", {
3175
+ return /* @__PURE__ */ W("pre", {
3160
3176
  className: q.json,
3161
3177
  "data-assistant-part": "json",
3162
3178
  children: JSON.stringify(e, null, 2)
@@ -3164,93 +3180,93 @@ function At({ value: e }) {
3164
3180
  }
3165
3181
  var jt = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
3166
3182
  function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
3167
- let a = ie(m.subscribe, m.getState), o = ie(s.subscribe, s.getState), [u, p] = x(!1), [h, _] = x(i ? "diagnostics" : "feedback"), [ee, b] = x("timeline"), [te, ne] = x(), ae = re(null), se = () => {
3168
- p(!1), requestAnimationFrame(() => ae.current?.focus({ preventScroll: !0 }));
3169
- }, [w, ce] = x(""), [le, de] = x(""), [D, k] = x(null), [j, M] = x("live"), [ge, N] = x(c), [I, Ce] = x(!1), [we, Te] = x(!1), L = v(() => {
3170
- Te(!1), p(!0), N(c());
3183
+ let a = C(m.subscribe, m.getState), o = C(s.subscribe, s.getState), [u, p] = S(!1), [h, _] = S(i ? "diagnostics" : "feedback"), [v, x] = S("timeline"), [ee, te] = S(), re = ne(null), ae = () => {
3184
+ p(!1), requestAnimationFrame(() => re.current?.focus({ preventScroll: !0 }));
3185
+ }, [oe, se] = S(""), [ce, ue] = S(""), [O, me] = S(null), [A, M] = S("live"), [ge, ve] = S(c), [Se, we] = S(!1), [Te, Ee] = S(!1), Oe = y(() => {
3186
+ Ee(!1), p(!0), ve(c());
3171
3187
  }, []);
3172
- Xe(ae, L, v((e) => {
3173
- Ce(e), e && Te(!1);
3188
+ Xe(re, Oe, y((e) => {
3189
+ we(e), e && Ee(!1);
3174
3190
  }, []));
3175
- let R = v(() => {
3176
- m.clear(), i && s.clear(), M("live"), k(null), de("内存记录已清空");
3191
+ let ke = y(() => {
3192
+ m.clear(), i && s.clear(), M("live"), me(null), ue("内存记录已清空");
3177
3193
  }, [i]);
3178
- y(() => {
3179
- if (i) return window.addEventListener("gz-research-assistant:clear-data", R), () => window.removeEventListener("gz-research-assistant:clear-data", R);
3180
- }, [i, R]), y(() => {
3194
+ b(() => {
3195
+ if (i) return window.addEventListener("gz-research-assistant:clear-data", ke), () => window.removeEventListener("gz-research-assistant:clear-data", ke);
3196
+ }, [i, ke]), b(() => {
3181
3197
  if (!u) return;
3182
- let e = setInterval(() => N(c()), 2e3);
3198
+ let e = setInterval(() => ve(c()), 2e3);
3183
3199
  return () => clearInterval(e);
3184
3200
  }, [u]);
3185
- let z = j === "imported" ? D : j === "frozen" ? a.frozen : null, ke = z?.events ?? a.events, B = z?.requests ?? a.requests, V = z?.metrics ?? a.metrics, H = z?.environment ?? ge, U = z ?? a.frozen, Pe = /* @__PURE__ */ K("div", {
3201
+ let I = A === "imported" ? O : A === "frozen" ? a.frozen : null, je = I?.events ?? a.events, R = I?.requests ?? a.requests, z = I?.metrics ?? a.metrics, Ie = I?.environment ?? ge, B = I ?? a.frozen, Le = /* @__PURE__ */ G("div", {
3186
3202
  className: q.section,
3187
3203
  "data-assistant-part": "section",
3188
3204
  children: [
3189
- /* @__PURE__ */ K("div", {
3205
+ /* @__PURE__ */ G("div", {
3190
3206
  className: q.stats,
3191
3207
  "data-assistant-part": "stats",
3192
3208
  children: [
3193
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [ke.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3209
+ /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [je.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3194
3210
  className: q.statLabel,
3195
3211
  "data-assistant-part": "stat-label",
3196
- children: [/* @__PURE__ */ G(De, {}), "操作与事件"]
3212
+ children: [/* @__PURE__ */ W(Ae, {}), "操作与事件"]
3197
3213
  })] }),
3198
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [B.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3214
+ /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [R.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3199
3215
  className: q.statLabel,
3200
3216
  "data-assistant-part": "stat-label",
3201
- children: [/* @__PURE__ */ G(A, {}), "接口记录"]
3217
+ children: [/* @__PURE__ */ W(he, {}), "接口记录"]
3202
3218
  })] }),
3203
- /* @__PURE__ */ K("div", {
3204
- className: B.some((e) => e.failed) ? q.hasErrors : "",
3205
- children: [/* @__PURE__ */ K("strong", { children: [B.filter((e) => e.failed).length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3219
+ /* @__PURE__ */ G("div", {
3220
+ className: R.some((e) => e.failed) ? q.hasErrors : "",
3221
+ children: [/* @__PURE__ */ G("strong", { children: [R.filter((e) => e.failed).length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3206
3222
  className: q.statLabel,
3207
3223
  "data-assistant-part": "stat-label",
3208
- children: [/* @__PURE__ */ G(Re, {}), "失败接口"]
3224
+ children: [/* @__PURE__ */ W(ze, {}), "失败接口"]
3209
3225
  })]
3210
3226
  })
3211
3227
  ]
3212
3228
  }),
3213
- /* @__PURE__ */ K("div", {
3229
+ /* @__PURE__ */ G("div", {
3214
3230
  className: [q.buttonRow, q.actions].join(" "),
3215
3231
  "data-assistant-part": "button-row actions",
3216
- children: [/* @__PURE__ */ G(C, {
3232
+ children: [/* @__PURE__ */ W(T, {
3217
3233
  type: "primary",
3218
- icon: /* @__PURE__ */ G(he, {}),
3234
+ icon: /* @__PURE__ */ W(j, {}),
3219
3235
  onClick: () => {
3220
- g("用户手动截取现场"), M("frozen"), de("已冻结现场。后续操作不会改变这份快照。");
3236
+ g("用户手动截取现场"), M("frozen"), ue("已冻结现场。后续操作不会改变这份快照。");
3221
3237
  },
3222
3238
  children: "截取当前现场"
3223
- }), /* @__PURE__ */ G(C, {
3224
- icon: /* @__PURE__ */ G(be, {}),
3239
+ }), /* @__PURE__ */ W(T, {
3240
+ icon: /* @__PURE__ */ W(be, {}),
3225
3241
  onClick: () => {
3226
- let e = U ?? n();
3227
- t(e, w), de(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3242
+ let e = B ?? n();
3243
+ t(e, oe), ue(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3228
3244
  },
3229
3245
  children: "导出快照 JSON"
3230
3246
  })]
3231
3247
  }),
3232
- /* @__PURE__ */ K("p", {
3248
+ /* @__PURE__ */ G("p", {
3233
3249
  className: q.hint,
3234
3250
  "data-assistant-part": "hint",
3235
- children: [U ? `导出:${U.reason} · ${jt(U.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3251
+ children: [B ? `导出:${B.reason} · ${jt(B.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3236
3252
  }),
3237
- /* @__PURE__ */ K("div", {
3253
+ /* @__PURE__ */ G("div", {
3238
3254
  className: q.field,
3239
3255
  "data-assistant-part": "field",
3240
- children: [/* @__PURE__ */ K("label", {
3256
+ children: [/* @__PURE__ */ G("label", {
3241
3257
  htmlFor: "research-feedback",
3242
- children: [/* @__PURE__ */ G(F, {}), "问题描述"]
3243
- }), /* @__PURE__ */ G(E.TextArea, {
3258
+ children: [/* @__PURE__ */ W(xe, {}), "问题描述"]
3259
+ }), /* @__PURE__ */ W(D.TextArea, {
3244
3260
  id: "research-feedback",
3245
- value: w,
3246
- onChange: (e) => ce(e.target.value),
3261
+ value: oe,
3262
+ onChange: (e) => se(e.target.value),
3247
3263
  maxLength: 1e3,
3248
3264
  showCount: !0,
3249
3265
  rows: 3,
3250
3266
  placeholder: "例如:保存表单时报错"
3251
3267
  })]
3252
3268
  }),
3253
- /* @__PURE__ */ G(T, {
3269
+ /* @__PURE__ */ W(E, {
3254
3270
  ghost: !0,
3255
3271
  size: "small",
3256
3272
  styles: {
@@ -3263,39 +3279,39 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3263
3279
  },
3264
3280
  items: [{
3265
3281
  key: "details",
3266
- label: /* @__PURE__ */ G(W, { children: "快照包含哪些内容" }),
3267
- children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", { children: "最近 15 分钟内最多 300 条事件、60 条接口记录,页面地址与布局信息、浏览器环境、性能指标及已脱敏的 JSON 正文。页面状态快照不包含屏幕截图或输入框值。" }), /* @__PURE__ */ G("p", { children: "数据只在当前页面内存中保存,不自动上传。字段脱敏无法识别所有业务敏感内容,分享前可先查看导出的 JSON。" })] })
3282
+ label: /* @__PURE__ */ W(U, { children: "快照包含哪些内容" }),
3283
+ children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "最近 15 分钟内最多 300 条事件、60 条接口记录,页面地址与布局信息、浏览器环境、性能指标及已脱敏的 JSON 正文。页面状态快照不包含屏幕截图或输入框值。" }), /* @__PURE__ */ W("p", { children: "数据只在当前页面内存中保存,不自动上传。字段脱敏无法识别所有业务敏感内容,分享前可先查看导出的 JSON。" })] })
3268
3284
  }]
3269
3285
  })
3270
3286
  ]
3271
- }), Fe = /* @__PURE__ */ G(xt, {
3272
- events: ke,
3287
+ }), V = /* @__PURE__ */ W(xt, {
3288
+ events: je,
3273
3289
  onDraft: i ? void 0 : (e) => {
3274
- ne(e), _("automation");
3290
+ te(e), _("automation");
3275
3291
  }
3276
- }, 0 + j + (z?.capturedAt ?? "live")), Le = /* @__PURE__ */ K("div", {
3292
+ }, 0 + A + (I?.capturedAt ?? "live")), Re = /* @__PURE__ */ G("div", {
3277
3293
  className: q.section,
3278
3294
  "data-assistant-part": "section",
3279
3295
  children: [
3280
- /* @__PURE__ */ K("div", {
3296
+ /* @__PURE__ */ G("div", {
3281
3297
  className: q.sectionHeading,
3282
3298
  "data-assistant-part": "section-heading",
3283
3299
  children: [
3284
- /* @__PURE__ */ G("span", {
3300
+ /* @__PURE__ */ W("span", {
3285
3301
  className: q.headingIcon,
3286
3302
  "data-assistant-part": "heading-icon",
3287
- children: /* @__PURE__ */ G(A, {})
3303
+ children: /* @__PURE__ */ W(he, {})
3288
3304
  }),
3289
- /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "接口记录" }) }),
3290
- /* @__PURE__ */ K(O, { children: [B.length, " 条"] })
3305
+ /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "接口记录" }) }),
3306
+ /* @__PURE__ */ G(k, { children: [R.length, " 条"] })
3291
3307
  ]
3292
3308
  }),
3293
- /* @__PURE__ */ K("details", {
3309
+ /* @__PURE__ */ G("details", {
3294
3310
  className: q.hint,
3295
- children: [/* @__PURE__ */ G("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3311
+ children: [/* @__PURE__ */ W("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3296
3312
  }),
3297
- !B.length && /* @__PURE__ */ G(ue, { description: "暂无接口记录" }),
3298
- B.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(T, {
3313
+ !R.length && /* @__PURE__ */ W(le, { description: "暂无接口记录" }),
3314
+ R.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ W(E, {
3299
3315
  className: q.request,
3300
3316
  "data-assistant-part": "request",
3301
3317
  ghost: !0,
@@ -3310,210 +3326,210 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3310
3326
  },
3311
3327
  items: [{
3312
3328
  key: "details",
3313
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("span", {
3329
+ label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("span", {
3314
3330
  className: q.requestMeta,
3315
3331
  "data-assistant-part": "request-meta",
3316
3332
  children: [
3317
- /* @__PURE__ */ G(O, {
3333
+ /* @__PURE__ */ W(k, {
3318
3334
  color: e.failed ? "red" : "green",
3319
3335
  children: e.status || "失败"
3320
3336
  }),
3321
- /* @__PURE__ */ G("b", { children: e.method }),
3337
+ /* @__PURE__ */ W("b", { children: e.method }),
3322
3338
  " ",
3323
- /* @__PURE__ */ K("span", { children: [
3324
- /* @__PURE__ */ G(Se, {}),
3339
+ /* @__PURE__ */ G("span", { children: [
3340
+ /* @__PURE__ */ W(Ce, {}),
3325
3341
  Math.round(e.duration),
3326
3342
  " ms"
3327
3343
  ] })
3328
3344
  ]
3329
- }), /* @__PURE__ */ G("span", {
3345
+ }), /* @__PURE__ */ W("span", {
3330
3346
  className: q.requestUrl,
3331
3347
  "data-assistant-part": "request-url",
3332
3348
  children: e.url
3333
3349
  })] }),
3334
- children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(At, { value: e }) })
3350
+ children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W(At, { value: e }) })
3335
3351
  }]
3336
3352
  }, e.id))
3337
3353
  ]
3338
- }), 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, {
3339
- metrics: V,
3340
- data: ze,
3341
- now: Be,
3354
+ }), Be = I ? I.performance ?? l() : a.performance, Ve = I ? Date.parse(I.capturedAt) : a.performanceUpdatedAt, He = f(z, Be, Ve), K = f(a.metrics, a.performance, a.performanceUpdatedAt).length, Ue = /* @__PURE__ */ W(kt, {
3355
+ metrics: z,
3356
+ data: Be,
3357
+ now: Ve,
3342
3358
  paused: a.paused,
3343
- offline: !!z
3344
- }), We = /* @__PURE__ */ K("div", {
3359
+ offline: !!I
3360
+ }), We = /* @__PURE__ */ G("div", {
3345
3361
  className: q.section,
3346
3362
  "data-assistant-part": "section",
3347
3363
  children: [
3348
- /* @__PURE__ */ K("div", {
3364
+ /* @__PURE__ */ G("div", {
3349
3365
  className: q.sectionHeading,
3350
3366
  "data-assistant-part": "section-heading",
3351
- children: [/* @__PURE__ */ G("span", {
3367
+ children: [/* @__PURE__ */ W("span", {
3352
3368
  className: q.headingIcon,
3353
3369
  "data-assistant-part": "heading-icon",
3354
- children: /* @__PURE__ */ G(ye, {})
3355
- }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "环境与数据" }) })]
3370
+ children: /* @__PURE__ */ W(P, {})
3371
+ }), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "环境与数据" }) })]
3356
3372
  }),
3357
- /* @__PURE__ */ K("dl", { children: [
3358
- /* @__PURE__ */ G("dt", { children: "网络状态" }),
3359
- /* @__PURE__ */ G("dd", { children: H.online == null ? "未知" : H.online ? "在线" : "离线" }),
3360
- /* @__PURE__ */ G("dt", { children: "浏览器语言" }),
3361
- /* @__PURE__ */ G("dd", { children: H.language || "未知" }),
3362
- /* @__PURE__ */ G("dt", { children: "时区" }),
3363
- /* @__PURE__ */ G("dd", { children: H.timezone || "未知" }),
3364
- /* @__PURE__ */ G("dt", { children: "设备内存" }),
3365
- /* @__PURE__ */ G("dd", { children: typeof H.deviceMemoryGB == "number" ? `${H.deviceMemoryGB} GB` : "不可用" })
3373
+ /* @__PURE__ */ G("dl", { children: [
3374
+ /* @__PURE__ */ W("dt", { children: "网络状态" }),
3375
+ /* @__PURE__ */ W("dd", { children: Ie.online == null ? "未知" : Ie.online ? "在线" : "离线" }),
3376
+ /* @__PURE__ */ W("dt", { children: "浏览器语言" }),
3377
+ /* @__PURE__ */ W("dd", { children: Ie.language || "未知" }),
3378
+ /* @__PURE__ */ W("dt", { children: "时区" }),
3379
+ /* @__PURE__ */ W("dd", { children: Ie.timezone || "未知" }),
3380
+ /* @__PURE__ */ W("dt", { children: "设备内存" }),
3381
+ /* @__PURE__ */ W("dd", { children: typeof Ie.deviceMemoryGB == "number" ? `${Ie.deviceMemoryGB} GB` : "不可用" })
3366
3382
  ] }),
3367
- /* @__PURE__ */ K("details", { children: [
3368
- /* @__PURE__ */ G("summary", { children: "完整环境与采集范围" }),
3369
- /* @__PURE__ */ G("p", {
3383
+ /* @__PURE__ */ G("details", { children: [
3384
+ /* @__PURE__ */ W("summary", { children: "完整环境与采集范围" }),
3385
+ /* @__PURE__ */ W("p", {
3370
3386
  className: q.hint,
3371
3387
  children: "不采集 Cookie、localStorage、sessionStorage 的值。"
3372
3388
  }),
3373
- /* @__PURE__ */ G(At, { value: H })
3389
+ /* @__PURE__ */ W(At, { value: Ie })
3374
3390
  ] }),
3375
- z && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "现场页面状态" }), /* @__PURE__ */ G(At, { value: z.page })] })
3391
+ I && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h3", { children: "现场页面状态" }), /* @__PURE__ */ W(At, { value: I.page })] })
3376
3392
  ]
3377
- }), Ge = /* @__PURE__ */ G("div", {
3393
+ }), Ge = /* @__PURE__ */ W("div", {
3378
3394
  className: q.section,
3379
3395
  "data-assistant-part": "section",
3380
- children: /* @__PURE__ */ G(ue, { description: "知识问答尚未接入" })
3396
+ children: /* @__PURE__ */ W(le, { description: "知识问答尚未接入" })
3381
3397
  });
3382
- return /* @__PURE__ */ K("div", {
3398
+ return /* @__PURE__ */ G("div", {
3383
3399
  "data-research-assistant": !0,
3384
- children: [/* @__PURE__ */ K("div", {
3400
+ children: [/* @__PURE__ */ G("div", {
3385
3401
  className: q.dock,
3386
3402
  "data-assistant-part": "dock",
3387
3403
  "data-recording": o.recording,
3388
3404
  hidden: u,
3389
- children: [/* @__PURE__ */ G(pe, {
3390
- open: we && !I && !u,
3391
- trigger: I ? [] : "hover",
3392
- onOpenChange: (e) => Te(e && !I && !u),
3393
- title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : He ? `研发小蜜 · ${He} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3394
- children: /* @__PURE__ */ G(oe, {
3395
- dot: o.recording || !!a.frozen || He > 0,
3405
+ children: [/* @__PURE__ */ W(fe, {
3406
+ open: Te && !Se && !u,
3407
+ trigger: Se ? [] : "hover",
3408
+ onOpenChange: (e) => Ee(e && !Se && !u),
3409
+ title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : K ? `研发小蜜 · ${K} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3410
+ children: /* @__PURE__ */ W(ie, {
3411
+ dot: o.recording || !!a.frozen || K > 0,
3396
3412
  color: o.recording ? "red" : "orange",
3397
3413
  offset: [-5, 5],
3398
- children: /* @__PURE__ */ G(C, {
3399
- ref: ae,
3414
+ children: /* @__PURE__ */ W(T, {
3415
+ ref: re,
3400
3416
  className: q.launcher,
3401
3417
  "data-assistant-part": "launcher",
3402
3418
  "data-draggable": !0,
3403
3419
  "aria-label": "打开研发小蜜",
3404
3420
  "aria-expanded": u,
3405
3421
  "aria-controls": "research-assistant-window",
3406
- onClick: L,
3407
- icon: /* @__PURE__ */ G(Ct, { className: q.launcherAvatar })
3422
+ onClick: Oe,
3423
+ icon: /* @__PURE__ */ W(Ct, { className: q.launcherAvatar })
3408
3424
  })
3409
3425
  })
3410
- }), /* @__PURE__ */ G("span", {
3426
+ }), /* @__PURE__ */ W("span", {
3411
3427
  className: q.srOnly,
3412
3428
  "data-assistant-part": "sr-only",
3413
3429
  role: "status",
3414
- children: o.recording ? `录制中 ${o.draft.steps.length} 步` : He ? `${He} 项性能告警` : a.frozen ? "已保留异常现场" : ""
3430
+ children: o.recording ? `录制中 ${o.draft.steps.length} 步` : K ? `${K} 项性能告警` : a.frozen ? "已保留异常现场" : ""
3415
3431
  })]
3416
- }), /* @__PURE__ */ G(Ot, {
3432
+ }), /* @__PURE__ */ W(Ot, {
3417
3433
  open: u,
3418
- onMinimize: se,
3434
+ onMinimize: ae,
3419
3435
  developer: e,
3420
- children: /* @__PURE__ */ K("div", {
3436
+ children: /* @__PURE__ */ G("div", {
3421
3437
  "data-research-assistant": !0,
3422
3438
  className: q.body,
3423
3439
  "data-assistant-part": "body",
3424
3440
  children: [
3425
- /* @__PURE__ */ K("div", {
3441
+ /* @__PURE__ */ G("div", {
3426
3442
  className: q.toolbar,
3427
3443
  "data-assistant-part": "toolbar",
3428
- children: [/* @__PURE__ */ K("span", { children: [/* @__PURE__ */ G("i", { className: a.paused ? q.paused : "" }), z ? "查看离线现场" : a.paused ? "采集已暂停" : "正在采集"] }), /* @__PURE__ */ K("div", {
3444
+ children: [/* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("i", { className: a.paused ? q.paused : "" }), I ? "查看离线现场" : a.paused ? "采集已暂停" : "正在采集"] }), /* @__PURE__ */ G("div", {
3429
3445
  className: [q.buttonRow, q.toolbarActions].join(" "),
3430
3446
  "data-assistant-part": "button-row toolbar-actions",
3431
- children: [/* @__PURE__ */ G(C, {
3447
+ children: [/* @__PURE__ */ W(T, {
3432
3448
  type: "text",
3433
3449
  size: "small",
3434
- icon: a.paused ? /* @__PURE__ */ G(Me, {}) : /* @__PURE__ */ G(je, {}),
3450
+ icon: a.paused ? /* @__PURE__ */ W(Pe, {}) : /* @__PURE__ */ W(Ne, {}),
3435
3451
  onClick: () => m.pause(!a.paused),
3436
3452
  children: a.paused ? "继续采集" : "暂停采集"
3437
- }), /* @__PURE__ */ G(C, {
3453
+ }), /* @__PURE__ */ W(T, {
3438
3454
  type: "text",
3439
3455
  danger: !0,
3440
3456
  size: "small",
3441
- icon: /* @__PURE__ */ G(ve, {}),
3442
- onClick: R,
3457
+ icon: /* @__PURE__ */ W(N, {}),
3458
+ onClick: ke,
3443
3459
  children: "清空记录"
3444
3460
  })]
3445
3461
  })]
3446
3462
  }),
3447
- le && /* @__PURE__ */ G(S, {
3463
+ ce && /* @__PURE__ */ W(w, {
3448
3464
  closable: !0,
3449
- title: le,
3465
+ title: ce,
3450
3466
  type: "info",
3451
- onClose: () => de("")
3467
+ onClose: () => ue("")
3452
3468
  }),
3453
- z?.feedback && /* @__PURE__ */ G(S, {
3469
+ I?.feedback && /* @__PURE__ */ W(w, {
3454
3470
  title: "快照中的问题描述",
3455
- description: z.feedback,
3471
+ description: I.feedback,
3456
3472
  type: "info"
3457
3473
  }),
3458
- e && /* @__PURE__ */ K("div", {
3474
+ e && /* @__PURE__ */ G("div", {
3459
3475
  className: q.sources,
3460
3476
  "data-assistant-part": "sources",
3461
3477
  children: [
3462
- /* @__PURE__ */ G(C, {
3478
+ /* @__PURE__ */ W(T, {
3463
3479
  size: "small",
3464
- icon: /* @__PURE__ */ G(De, {}),
3465
- "aria-pressed": j === "live",
3466
- type: j === "live" ? "primary" : "text",
3480
+ icon: /* @__PURE__ */ W(Ae, {}),
3481
+ "aria-pressed": A === "live",
3482
+ type: A === "live" ? "primary" : "text",
3467
3483
  onClick: () => M("live"),
3468
3484
  children: "实时记录"
3469
3485
  }),
3470
- (!i || a.frozen) && /* @__PURE__ */ G(C, {
3486
+ (!i || a.frozen) && /* @__PURE__ */ W(T, {
3471
3487
  size: "small",
3472
- icon: /* @__PURE__ */ G(he, {}),
3488
+ icon: /* @__PURE__ */ W(j, {}),
3473
3489
  disabled: !a.frozen,
3474
- "aria-pressed": j === "frozen",
3475
- type: j === "frozen" ? "primary" : "text",
3490
+ "aria-pressed": A === "frozen",
3491
+ type: A === "frozen" ? "primary" : "text",
3476
3492
  onClick: () => M("frozen"),
3477
3493
  children: "已冻结现场"
3478
3494
  }),
3479
- /* @__PURE__ */ G(me, {
3495
+ /* @__PURE__ */ W(pe, {
3480
3496
  accept: ".json,application/json",
3481
3497
  showUploadList: !1,
3482
3498
  beforeUpload: async (e) => {
3483
3499
  try {
3484
3500
  if (e.size > 2097152) throw Error("快照不能超过 2 MB");
3485
- k(d(await e.text())), M("imported"), _("diagnostics"), b("timeline"), de("已载入本地快照,未上传文件");
3501
+ me(d(await e.text())), M("imported"), _("diagnostics"), x("timeline"), ue("已载入本地快照,未上传文件");
3486
3502
  } catch (e) {
3487
- de(e instanceof Error ? e.message : "快照读取失败");
3503
+ ue(e instanceof Error ? e.message : "快照读取失败");
3488
3504
  }
3489
- return me.LIST_IGNORE;
3505
+ return pe.LIST_IGNORE;
3490
3506
  },
3491
- children: /* @__PURE__ */ G(C, {
3507
+ children: /* @__PURE__ */ W(T, {
3492
3508
  type: "text",
3493
3509
  size: "small",
3494
- icon: /* @__PURE__ */ G(Ie, {}),
3510
+ icon: /* @__PURE__ */ W(H, {}),
3495
3511
  children: "导入快照"
3496
3512
  })
3497
3513
  }),
3498
- D && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3514
+ O && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(T, {
3499
3515
  size: "small",
3500
- icon: /* @__PURE__ */ G(Ee, {}),
3501
- "aria-pressed": j === "imported",
3502
- type: j === "imported" ? "primary" : "text",
3516
+ icon: /* @__PURE__ */ W(De, {}),
3517
+ "aria-pressed": A === "imported",
3518
+ type: A === "imported" ? "primary" : "text",
3503
3519
  onClick: () => M("imported"),
3504
3520
  children: "导入的现场"
3505
- }), /* @__PURE__ */ G(C, {
3521
+ }), /* @__PURE__ */ W(T, {
3506
3522
  type: "text",
3507
3523
  "aria-label": "关闭导入现场",
3508
3524
  size: "small",
3509
- icon: /* @__PURE__ */ G(_e, {}),
3525
+ icon: /* @__PURE__ */ W(_e, {}),
3510
3526
  onClick: () => {
3511
- k(null), M("live");
3527
+ me(null), M("live");
3512
3528
  }
3513
3529
  })] })
3514
3530
  ]
3515
3531
  }),
3516
- /* @__PURE__ */ G(fe, {
3532
+ /* @__PURE__ */ W(de, {
3517
3533
  className: q.mainTabs,
3518
3534
  "data-assistant-part": "main-tabs",
3519
3535
  "data-diagnostics-only": i || void 0,
@@ -3523,51 +3539,51 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3523
3539
  {
3524
3540
  key: "feedback",
3525
3541
  label: "问题反馈",
3526
- icon: /* @__PURE__ */ G(Ae, { "aria-hidden": !0 }),
3527
- children: Pe
3542
+ icon: /* @__PURE__ */ W(Me, { "aria-hidden": !0 }),
3543
+ children: Le
3528
3544
  },
3529
3545
  ...e ? [{
3530
3546
  key: "automation",
3531
3547
  label: "自动化测试",
3532
- icon: /* @__PURE__ */ G(xe, { "aria-hidden": !0 }),
3533
- children: /* @__PURE__ */ G(ht, {
3534
- close: se,
3548
+ icon: /* @__PURE__ */ W(F, { "aria-hidden": !0 }),
3549
+ children: /* @__PURE__ */ W(ht, {
3550
+ close: ae,
3535
3551
  bridgeUrl: r,
3536
- incomingDraft: te,
3537
- onConsumeDraft: () => ne(void 0)
3552
+ incomingDraft: ee,
3553
+ onConsumeDraft: () => te(void 0)
3538
3554
  })
3539
3555
  }, {
3540
3556
  key: "diagnostics",
3541
- label: !z && He > 0 ? `诊断(${He})` : "诊断",
3542
- icon: /* @__PURE__ */ G(Oe, { "aria-hidden": !0 }),
3543
- children: /* @__PURE__ */ G(fe, {
3557
+ label: !I && K > 0 ? `诊断(${K})` : "诊断",
3558
+ icon: /* @__PURE__ */ W(L, { "aria-hidden": !0 }),
3559
+ children: /* @__PURE__ */ W(de, {
3544
3560
  className: q.diagnosticTabs,
3545
3561
  "data-assistant-part": "diagnostic-tabs",
3546
- activeKey: ee,
3547
- onChange: b,
3562
+ activeKey: v,
3563
+ onChange: x,
3548
3564
  items: [
3549
3565
  {
3550
3566
  key: "timeline",
3551
3567
  label: "时间线",
3552
- icon: /* @__PURE__ */ G(De, { "aria-hidden": !0 }),
3553
- children: Fe
3568
+ icon: /* @__PURE__ */ W(Ae, { "aria-hidden": !0 }),
3569
+ children: V
3554
3570
  },
3555
3571
  {
3556
3572
  key: "network",
3557
3573
  label: "接口",
3558
- icon: /* @__PURE__ */ G(A, { "aria-hidden": !0 }),
3559
- children: Le
3574
+ icon: /* @__PURE__ */ W(he, { "aria-hidden": !0 }),
3575
+ children: Re
3560
3576
  },
3561
3577
  {
3562
3578
  key: "performance",
3563
- label: Ve.length ? `性能 (${Ve.length})` : "性能",
3564
- icon: /* @__PURE__ */ G(P, { "aria-hidden": !0 }),
3579
+ label: He.length ? `性能 (${He.length})` : "性能",
3580
+ icon: /* @__PURE__ */ W(ye, { "aria-hidden": !0 }),
3565
3581
  children: Ue
3566
3582
  },
3567
3583
  {
3568
3584
  key: "data",
3569
3585
  label: "环境与数据",
3570
- icon: /* @__PURE__ */ G(ye, { "aria-hidden": !0 }),
3586
+ icon: /* @__PURE__ */ W(P, { "aria-hidden": !0 }),
3571
3587
  children: We
3572
3588
  }
3573
3589
  ]
@@ -3576,7 +3592,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3576
3592
  {
3577
3593
  key: "knowledge",
3578
3594
  label: "知识问答",
3579
- icon: /* @__PURE__ */ G(Ne, { "aria-hidden": !0 }),
3595
+ icon: /* @__PURE__ */ W(Fe, { "aria-hidden": !0 }),
3580
3596
  children: Ge
3581
3597
  }
3582
3598
  ].filter((e) => !i || e.key === "diagnostics")
@@ -3602,7 +3618,7 @@ var Nt = class extends _ {
3602
3618
  // src/App.tsx
3603
3619
  function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, themeMode: r = "gold-dark", popupContainer: a, diagnosticsOnly: o }) {
3604
3620
  let { isBusinessFailure: c, ignoreRequest: l } = n ?? {};
3605
- y(() => {
3621
+ b(() => {
3606
3622
  if (m.isActive()) throw Error("每页只能启动一个研发小蜜;npm 组件和浏览器扩展已管理采集,请勿额外调用 startAssistant");
3607
3623
  let e = new URL(t, location.href), n = e.pathname.replace(/\/$/, "");
3608
3624
  m.clear(), m.pause(!1), s.clear();
@@ -3618,13 +3634,13 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3618
3634
  c,
3619
3635
  l
3620
3636
  ]);
3621
- let u = ne(() => k({
3637
+ let u = te(() => me({
3622
3638
  themeMode: r,
3623
3639
  includeCustom: !1
3624
3640
  }), [r]);
3625
- return /* @__PURE__ */ G(ae, {
3641
+ return /* @__PURE__ */ W(re, {
3626
3642
  hashPriority: "high",
3627
- children: /* @__PURE__ */ G(ce, {
3643
+ children: /* @__PURE__ */ W(se, {
3628
3644
  themeMode: r,
3629
3645
  theme: {
3630
3646
  inherit: !1,
@@ -3656,12 +3672,12 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3656
3672
  tooltip: {},
3657
3673
  empty: {},
3658
3674
  flex: {},
3659
- children: /* @__PURE__ */ G("div", {
3675
+ children: /* @__PURE__ */ W("div", {
3660
3676
  "data-research-assistant": !0,
3661
3677
  "data-assistant-part": "scope",
3662
3678
  className: Je.scope,
3663
3679
  style: u,
3664
- children: /* @__PURE__ */ G(Mt, {
3680
+ children: /* @__PURE__ */ W(Mt, {
3665
3681
  developer: e,
3666
3682
  bridgeUrl: t,
3667
3683
  diagnosticsOnly: o
@@ -3671,14 +3687,14 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3671
3687
  });
3672
3688
  }
3673
3689
  function Ft(e = {}) {
3674
- return e.enabled === !1 ? null : /* @__PURE__ */ G(Nt, { children: /* @__PURE__ */ G(Pt, { ...e }) }, e.sessionKey);
3690
+ return e.enabled === !1 ? null : /* @__PURE__ */ W(Nt, { children: /* @__PURE__ */ W(Pt, { ...e }) }, e.sessionKey);
3675
3691
  }
3676
3692
  // src/inject.tsx
3677
3693
  var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () => {
3678
3694
  if (!zt) return;
3679
3695
  let { enabled: e = !0, sessionKey: t, themeMode: n } = Lt;
3680
3696
  try {
3681
- zt.render(/* @__PURE__ */ G(Ft, {
3697
+ zt.render(/* @__PURE__ */ W(Ft, {
3682
3698
  developer: Lt.developer,
3683
3699
  bridgeUrl: Lt.bridgeUrl,
3684
3700
  runtimeOptions: Lt.runtimeOptions,
@@ -3703,7 +3719,7 @@ var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () =
3703
3719
  }
3704
3720
  }, Ut = () => {
3705
3721
  if (!(zt || typeof document > "u")) {
3706
- Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Be(Rt);
3722
+ Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Ve(Rt);
3707
3723
  try {
3708
3724
  Vt(), Bt = Lt.subscribe?.(Vt);
3709
3725
  } catch (e) {