gz-research-assistant 1.0.11 → 1.0.12

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