@skopon-cool/form-sdk 0.4.2 → 0.4.3

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,34 +1,34 @@
1
1
  import './form-sdk.css';
2
- var Fn = Object.defineProperty;
3
- var En = (e, t, n) => t in e ? Fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var G = (e, t, n) => En(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { jsx as c, jsxs as I } from "react/jsx-runtime";
6
- import { useRef as A, useState as R, useCallback as $, useMemo as j, createContext as ye, useContext as ve, useEffect as z, useSyncExternalStore as Un, forwardRef as Rn, useImperativeHandle as wn } from "react";
7
- import { Spin as mt, Button as ze, Typography as te, Avatar as Pn, Tag as fe, Select as ot, Checkbox as zn, Radio as On, Switch as qn, TimePicker as Bn, DatePicker as Ln, Upload as Je, Input as We, InputNumber as Vn, ConfigProvider as jn, Tooltip as pe } from "antd";
8
- import { ReloadOutlined as Gt, FileTextOutlined as Jt, UserOutlined as $n, FileImageOutlined as Dn, FileExcelOutlined as Hn, FileOutlined as Wt, PictureOutlined as Kn, SoundOutlined as Gn, VideoCameraOutlined as Jn } from "@ant-design/icons";
9
- import { createBinderlessComponentImplementation as Q, basicCatalog as Ee, A2uiSurface as Yt } from "@a2ui/react/v0_9";
2
+ var En = Object.defineProperty;
3
+ var Rn = (e, t, n) => t in e ? En(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var G = (e, t, n) => Rn(e, typeof t != "symbol" ? t + "" : t, n);
5
+ import { jsx as c, jsxs as N } from "react/jsx-runtime";
6
+ import { useRef as A, useState as U, useCallback as $, useMemo as j, createContext as ge, useContext as ye, useEffect as z, useSyncExternalStore as Un, forwardRef as wn, useImperativeHandle as Pn } from "react";
7
+ import { Spin as mt, Button as Pe, Typography as te, Avatar as zn, Tag as pe, Select as ot, Checkbox as On, Radio as qn, Switch as Bn, TimePicker as Ln, DatePicker as Vn, Upload as Je, Input as We, InputNumber as jn, ConfigProvider as $n, Tooltip as de } from "antd";
8
+ import { ReloadOutlined as Jt, FileTextOutlined as Wt, UserOutlined as Dn, FileImageOutlined as Hn, FileExcelOutlined as Kn, FileOutlined as Yt, PictureOutlined as Gn, SoundOutlined as Jn, VideoCameraOutlined as Wn } from "@ant-design/icons";
9
+ import { createBinderlessComponentImplementation as Q, basicCatalog as Fe, A2uiSurface as Qt } from "@a2ui/react/v0_9";
10
10
  import { z as h } from "zod";
11
- import { Catalog as Wn, MessageProcessor as Qt } from "@a2ui/web_core/v0_9";
12
- import { injectBasicCatalogStyles as Xt } from "@a2ui/web_core/v0_9/basic_catalog";
13
- import { injectStyles as Zt } from "@a2ui/react/styles";
14
- import Lt from "dayjs";
15
- const ns = "v0.9", Yn = [
11
+ import { Catalog as Yn, MessageProcessor as Xt } from "@a2ui/web_core/v0_9";
12
+ import { injectBasicCatalogStyles as Zt } from "@a2ui/web_core/v0_9/basic_catalog";
13
+ import { injectStyles as en } from "@a2ui/react/styles";
14
+ import Vt from "dayjs";
15
+ const os = "v0.9", Qn = [
16
16
  "huge",
17
17
  "large",
18
18
  "medium",
19
19
  "small",
20
20
  "icon"
21
21
  ];
22
- function Ue(e) {
22
+ function Ee(e) {
23
23
  return e === "image" || e === "video" || e === "audio";
24
24
  }
25
- function Oe(e) {
25
+ function ze(e) {
26
26
  return e === "heading" || e === "paragraph";
27
27
  }
28
28
  function ae(e) {
29
- return !Oe(e) && !Ue(e);
29
+ return !ze(e) && !Ee(e);
30
30
  }
31
- function Qn() {
31
+ function Xn() {
32
32
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
33
33
  return crypto.randomUUID();
34
34
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -42,11 +42,11 @@ function Qn() {
42
42
  return (e === "x" ? t : t & 3 | 8).toString(16);
43
43
  });
44
44
  }
45
- function Se(e) {
46
- const t = Qn().replace(/-/g, "").slice(0, 8);
45
+ function ve(e) {
46
+ const t = Xn().replace(/-/g, "").slice(0, 8);
47
47
  return `${e}${t}`;
48
48
  }
49
- const en = [
49
+ const tn = [
50
50
  { value: "image/*", label: "图片" },
51
51
  { value: "video/*", label: "视频" },
52
52
  { value: "audio/*", label: "音频" },
@@ -57,7 +57,7 @@ const en = [
57
57
  { value: "text/plain", label: "纯文本" },
58
58
  { value: "application/zip", label: "ZIP 压缩包" },
59
59
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
60
- ], Xn = {
60
+ ], Zn = {
61
61
  "image/*": ["image/*"],
62
62
  "video/*": ["video/*"],
63
63
  "audio/*": ["audio/*"],
@@ -77,7 +77,7 @@ const en = [
77
77
  "text/plain": ["text/plain"],
78
78
  "application/zip": ["application/zip"],
79
79
  "application/x-rar-compressed": ["application/x-rar-compressed"]
80
- }, Zn = {
80
+ }, er = {
81
81
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
82
82
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
83
83
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -88,7 +88,7 @@ const en = [
88
88
  "text/plain": [".txt"],
89
89
  "application/zip": [".zip", ".7z"],
90
90
  "application/x-rar-compressed": [".rar"]
91
- }, er = {
91
+ }, tr = {
92
92
  "application/msword": "office/word",
93
93
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
94
94
  "application/vnd.ms-excel": "office/excel",
@@ -121,124 +121,124 @@ const en = [
121
121
  { value: ".zip", label: ".zip" },
122
122
  { value: ".rar", label: ".rar" },
123
123
  { value: ".7z", label: ".7z" }
124
- ], tr = Object.fromEntries(
125
- en.map((e) => [e.value, e.label])
126
- ), nr = Object.fromEntries(
124
+ ], nr = Object.fromEntries(
125
+ tn.map((e) => [e.value, e.label])
126
+ ), rr = Object.fromEntries(
127
127
  dt.map((e) => [e.value, e.label])
128
- ), rr = new Set(en.map((e) => e.value)), or = new Set(
128
+ ), or = new Set(tn.map((e) => e.value)), ir = new Set(
129
129
  dt.map((e) => e.value)
130
130
  );
131
- function ir(e) {
131
+ function sr(e) {
132
132
  const t = e.trim();
133
- return t ? rr.has(t) ? t : er[t] ?? null : null;
133
+ return t ? or.has(t) ? t : tr[t] ?? null : null;
134
134
  }
135
- function sr(e) {
135
+ function ar(e) {
136
136
  return Array.isArray(e) ? e.map((t) => {
137
137
  const n = t.trim().toLowerCase();
138
138
  return n ? n.startsWith(".") ? n : `.${n}` : "";
139
139
  }).filter(Boolean) : [];
140
140
  }
141
- function be(e) {
141
+ function Se(e) {
142
142
  if (!Array.isArray(e)) return [];
143
143
  const t = [], n = /* @__PURE__ */ new Set();
144
144
  for (const r of e) {
145
- const o = ir(r);
145
+ const o = sr(r);
146
146
  o && !n.has(o) && (n.add(o), t.push(o));
147
147
  }
148
148
  return t;
149
149
  }
150
- function ar(e) {
151
- const t = be(e), n = [];
150
+ function lr(e) {
151
+ const t = Se(e), n = [];
152
152
  for (const r of t)
153
- n.push(...Xn[r] ?? [r]);
153
+ n.push(...Zn[r] ?? [r]);
154
154
  return n;
155
155
  }
156
- function lr(e) {
157
- const t = be(e);
156
+ function cr(e) {
157
+ const t = Se(e);
158
158
  if (t.length === 0) return [];
159
159
  const n = /* @__PURE__ */ new Set();
160
160
  for (const r of t)
161
- for (const o of Zn[r] ?? [])
161
+ for (const o of er[r] ?? [])
162
162
  n.add(o);
163
163
  return dt.filter((r) => n.has(r.value));
164
164
  }
165
165
  function pt(e, t) {
166
- const n = sr(t), r = be(e);
166
+ const n = ar(t), r = Se(e);
167
167
  if (r.length === 0)
168
- return n.filter((i) => or.has(i));
168
+ return n.filter((i) => ir.has(i));
169
169
  const o = new Set(
170
- lr(r).map((i) => i.value)
170
+ cr(r).map((i) => i.value)
171
171
  );
172
172
  return n.filter((i) => o.has(i));
173
173
  }
174
- function cr(e, t) {
175
- const n = ar(e), r = pt(e, t), o = [...n, ...r];
174
+ function ur(e, t) {
175
+ const n = lr(e), r = pt(e, t), o = [...n, ...r];
176
176
  return o.length > 0 ? o.join(",") : void 0;
177
177
  }
178
- function ur(e, t) {
179
- const n = be(e), r = pt(
178
+ function mr(e, t) {
179
+ const n = Se(e), r = pt(
180
180
  n,
181
181
  t
182
182
  ), o = [
183
- ...n.map((i) => tr[i] ?? i),
184
- ...r.map((i) => nr[i] ?? i)
183
+ ...n.map((i) => nr[i] ?? i),
184
+ ...r.map((i) => rr[i] ?? i)
185
185
  ];
186
186
  return o.length === 0 ? null : o.join("、");
187
187
  }
188
- const mr = [
188
+ const dr = [
189
189
  "video",
190
190
  "audio",
191
191
  "image",
192
192
  "file",
193
193
  "spreadsheet",
194
194
  "document"
195
- ], dr = new Set(mr);
196
- function pr(e) {
197
- return e && dr.has(e) ? e : "file";
195
+ ], pr = new Set(dr);
196
+ function fr(e) {
197
+ return e && pr.has(e) ? e : "file";
198
198
  }
199
- function ke(e) {
200
- return typeof e == "string" && Yn.includes(e) ? e : "medium";
199
+ function be(e) {
200
+ return typeof e == "string" && Qn.includes(e) ? e : "medium";
201
201
  }
202
- function fr(e, t) {
202
+ function hr(e, t) {
203
203
  var o;
204
204
  const n = Math.max(1, t);
205
205
  let r = [];
206
206
  return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
207
207
  }
208
- function hr(e) {
208
+ function gr(e) {
209
209
  var t;
210
210
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
211
211
  }
212
- function gr(e) {
213
- return `form-media-size-${ke(e)}`;
214
- }
215
212
  function yr(e) {
216
- return `form-media-preview form-media-list ${gr(e)}`;
213
+ return `form-media-size-${be(e)}`;
217
214
  }
218
- const vr = 10;
215
+ function vr(e) {
216
+ return `form-media-preview form-media-list ${yr(e)}`;
217
+ }
218
+ const Sr = 10;
219
219
  function ft(e) {
220
220
  return e && typeof e == "object" && !Array.isArray(e) ? e : {};
221
221
  }
222
- function Ce(e) {
222
+ function ke(e) {
223
223
  return e === !0 || e === "true" || e === 1 || e === "1";
224
224
  }
225
- function Vt(e, t = 1) {
225
+ function jt(e, t = 1) {
226
226
  const n = typeof e == "number" ? e : Number(e);
227
227
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
228
228
  }
229
- function Me(e, t = 1) {
229
+ function Ne(e, t = 1) {
230
230
  const n = typeof e == "number" ? e : Number(e);
231
231
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
232
232
  }
233
- function Sr(e, t) {
233
+ function br(e, t) {
234
234
  if (t !== void 0)
235
- return e === "toggle" ? Ce(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
235
+ return e === "toggle" ? ke(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
236
236
  }
237
- function br(e) {
237
+ function kr(e) {
238
238
  const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
239
239
  return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
240
240
  }
241
- function kr(e) {
241
+ function Cr(e) {
242
242
  const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
243
243
  return {
244
244
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -247,33 +247,33 @@ function kr(e) {
247
247
  pageSize: n
248
248
  };
249
249
  }
250
- function Cr(e) {
250
+ function Ar(e) {
251
251
  if (e.type !== "case_singleselect") return e;
252
252
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
253
253
  return { ...e, type: "case_multiselect", defaultValue: t };
254
254
  }
255
- function Ar(e) {
255
+ function _r(e) {
256
256
  var o, i;
257
- const t = Cr(e), n = be(t.fileAcceptTypes), r = t.type;
257
+ const t = Ar(e), n = Se(t.fileAcceptTypes), r = t.type;
258
258
  return {
259
- id: ((o = t.id) == null ? void 0 : o.trim()) || Se("block-"),
259
+ id: ((o = t.id) == null ? void 0 : o.trim()) || ve("block-"),
260
260
  type: r,
261
261
  name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
262
262
  label: t.label ?? "",
263
263
  placeholder: t.placeholder ?? "",
264
264
  help: t.help ?? "",
265
265
  required: t.required === !0,
266
- mediaUrls: Ue(r) ? fr(t, vr) : void 0,
267
- mediaSize: Ue(r) ? ke(t.mediaSize) : void 0,
266
+ mediaUrls: Ee(r) ? hr(t, Sr) : void 0,
267
+ mediaSize: Ee(r) ? be(t.mediaSize) : void 0,
268
268
  fileAcceptTypes: n,
269
269
  fileAcceptExtensions: pt(
270
270
  n,
271
271
  t.fileAcceptExtensions
272
272
  ),
273
- filePlaceholderIcon: pr(t.filePlaceholderIcon),
274
- fileMinCount: r === "file" ? Vt(t.fileMinCount, 1) : void 0,
275
- fileMaxCount: r === "file" ? Vt(t.fileMaxCount, 1) : void 0,
276
- defaultValue: Sr(r, t.defaultValue),
273
+ filePlaceholderIcon: fr(t.filePlaceholderIcon),
274
+ fileMinCount: r === "file" ? jt(t.fileMinCount, 1) : void 0,
275
+ fileMaxCount: r === "file" ? jt(t.fileMaxCount, 1) : void 0,
276
+ defaultValue: br(r, t.defaultValue),
277
277
  options: Array.isArray(t.options) ? t.options.map((s, a) => {
278
278
  var l, u;
279
279
  return {
@@ -282,13 +282,13 @@ function Ar(e) {
282
282
  };
283
283
  }) : void 0,
284
284
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
285
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? Me(t.resumeMinCount, 1) : void 0,
286
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? Me(t.resumeMaxCount, 1) : void 0,
287
- resumeFilter: r === "resume_multiselect" ? kr(t.resumeFilter) : void 0,
285
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? Ne(t.resumeMinCount, 1) : void 0,
286
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? Ne(t.resumeMaxCount, 1) : void 0,
287
+ resumeFilter: r === "resume_multiselect" ? Cr(t.resumeFilter) : void 0,
288
288
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
289
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? Me(t.caseMinCount, 1) : void 0,
290
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? Me(t.caseMaxCount, 1) : void 0,
291
- caseFilter: r === "case_multiselect" ? br(t.caseFilter) : void 0
289
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? Ne(t.caseMinCount, 1) : void 0,
290
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? Ne(t.caseMaxCount, 1) : void 0,
291
+ caseFilter: r === "case_multiselect" ? kr(t.caseFilter) : void 0
292
292
  };
293
293
  }
294
294
  function Re(e) {
@@ -299,10 +299,10 @@ function Re(e) {
299
299
  jsonSchema: e.jsonSchema ?? {}
300
300
  };
301
301
  }
302
- function ue(e) {
302
+ function Oe(e) {
303
303
  if (!e || !Array.isArray(e.blocks))
304
304
  return Re({ title: "", description: "", blocks: [], jsonSchema: {} });
305
- const t = e.blocks.map(Ar);
305
+ const t = e.blocks.map(_r);
306
306
  return Re({
307
307
  title: typeof e.title == "string" ? e.title : "",
308
308
  description: typeof e.description == "string" ? e.description : "",
@@ -310,7 +310,7 @@ function ue(e) {
310
310
  jsonSchema: ft(e.jsonSchema)
311
311
  });
312
312
  }
313
- function _r(e) {
313
+ function Tr(e) {
314
314
  const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
315
315
  return {
316
316
  agentKind: n,
@@ -321,13 +321,13 @@ function _r(e) {
321
321
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
322
322
  };
323
323
  }
324
- function jt(e) {
324
+ function $t(e) {
325
325
  if (e == null) return;
326
326
  const t = typeof e == "number" ? e : Number(e);
327
327
  if (!(!Number.isFinite(t) || t < 1))
328
328
  return Math.floor(t);
329
329
  }
330
- function Tr(e, t) {
330
+ function xr(e, t) {
331
331
  var s, a, l, u, m, d;
332
332
  const { id: n, label: r, path: o, withData: i } = t;
333
333
  return i({
@@ -350,7 +350,7 @@ function Tr(e, t) {
350
350
  value: { path: o }
351
351
  });
352
352
  }
353
- function xr(e, t, n) {
353
+ function Nr(e, t, n) {
354
354
  const r = n.nameFromValue(e.value), o = {
355
355
  ...t("case_multiselect"),
356
356
  name: r,
@@ -358,13 +358,13 @@ function xr(e, t, n) {
358
358
  }, i = n.asLiteral(e.placeholder);
359
359
  i && (o.placeholder = i);
360
360
  const s = n.asLiteral(e.help);
361
- s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = _r(e.caseFilter));
362
- const a = jt(e.minCount);
361
+ s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Tr(e.caseFilter));
362
+ const a = $t(e.minCount);
363
363
  a !== void 0 && (o.caseMinCount = a);
364
- const l = jt(e.maxCount);
364
+ const l = $t(e.maxCount);
365
365
  return l !== void 0 && (o.caseMaxCount = l), o;
366
366
  }
367
- const tn = ye(
367
+ const nn = ge(
368
368
  null
369
369
  );
370
370
  function Ir(e) {
@@ -383,8 +383,8 @@ const Mr = {
383
383
  clearPendingChangeFields: () => {
384
384
  }
385
385
  };
386
- function Nr({ children: e }) {
387
- const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = R(0), [s, a] = R(() => /* @__PURE__ */ new Map()), [l, u] = R(
386
+ function Fr({ children: e }) {
387
+ const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = U(0), [s, a] = U(() => /* @__PURE__ */ new Map()), [l, u] = U(
388
388
  []
389
389
  ), m = $(
390
390
  (g, b) => {
@@ -415,26 +415,26 @@ function Nr({ children: e }) {
415
415
  d
416
416
  ]
417
417
  );
418
- return /* @__PURE__ */ c(tn.Provider, { value: S, children: e });
418
+ return /* @__PURE__ */ c(nn.Provider, { value: S, children: e });
419
419
  }
420
420
  function ht() {
421
- return ve(tn) ?? Mr;
421
+ return ye(nn) ?? Mr;
422
422
  }
423
- const nn = ye({ interactive: !0 });
423
+ const rn = ge({ interactive: !0 });
424
424
  function it({
425
425
  interactive: e,
426
426
  children: t
427
427
  }) {
428
- return /* @__PURE__ */ c(nn.Provider, { value: { interactive: e }, children: t });
428
+ return /* @__PURE__ */ c(rn.Provider, { value: { interactive: e }, children: t });
429
429
  }
430
430
  function ie() {
431
- return ve(nn);
431
+ return ye(rn);
432
432
  }
433
- const rn = ye(null);
434
- function Fr(e) {
433
+ const on = ge(null);
434
+ function Er(e) {
435
435
  return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
436
436
  }
437
- const Er = {
437
+ const Rr = {
438
438
  reportEvent: () => {
439
439
  },
440
440
  reportData: () => {
@@ -452,7 +452,7 @@ function Ur(e) {
452
452
  form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
453
453
  };
454
454
  }
455
- function Rr({
455
+ function wr({
456
456
  client: e,
457
457
  children: t
458
458
  }) {
@@ -479,7 +479,7 @@ function Rr({
479
479
  } catch (d) {
480
480
  throw n.current = Math.max(0, n.current - 1), d;
481
481
  }
482
- return Fr(m) ? Promise.resolve(m).finally(() => {
482
+ return Er(m) ? Promise.resolve(m).finally(() => {
483
483
  n.current = Math.max(0, n.current - 1);
484
484
  }) : (n.current = Math.max(0, n.current - 1), m);
485
485
  }, []), a = $(
@@ -494,28 +494,28 @@ function Rr({
494
494
  }),
495
495
  [o, i, s, a]
496
496
  );
497
- return /* @__PURE__ */ c(rn.Provider, { value: l, children: t });
497
+ return /* @__PURE__ */ c(on.Provider, { value: l, children: t });
498
498
  }
499
- function on() {
500
- return ve(rn) ?? Er;
499
+ function sn() {
500
+ return ye(on) ?? Rr;
501
501
  }
502
- const wr = 300;
503
- function sn(e) {
502
+ const Pr = 300;
503
+ function an(e) {
504
504
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
505
505
  }
506
- function Pr(e) {
506
+ function zr(e) {
507
507
  if (!e) return;
508
508
  const t = e.trim();
509
509
  if (t)
510
510
  return t.startsWith("/") ? t.slice(1) : t;
511
511
  }
512
- function $t(e, t = "value") {
512
+ function Dt(e, t = "value") {
513
513
  const r = e.componentModel.properties[t];
514
- if (!(!sn(r) || r === void 0))
514
+ if (!(!an(r) || r === void 0))
515
515
  return e.dataContext.resolveDynamicValue(r);
516
516
  }
517
517
  function se(e, t = "value", n = {}) {
518
- const o = e.componentModel.properties[t], i = sn(o), s = Pr(i), a = on(), {
518
+ const o = e.componentModel.properties[t], i = an(o), s = zr(i), a = sn(), {
519
519
  component: l = "Unknown",
520
520
  changeAction: u = "change",
521
521
  debounceChange: m = !1
@@ -545,7 +545,7 @@ function se(e, t = "value", n = {}) {
545
545
  ), v = $(() => {
546
546
  if (!(!i || o === void 0))
547
547
  return e.dataContext.resolveDynamicValue(o);
548
- }, [e, o, i]), x = Un(p, v, v), M = $(
548
+ }, [e, o, i]), x = Un(p, v, v), I = $(
549
549
  (O) => {
550
550
  if (!s) return;
551
551
  const B = () => {
@@ -562,7 +562,7 @@ function se(e, t = "value", n = {}) {
562
562
  }
563
563
  S.current = O, g.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
564
564
  d.current = null, B();
565
- }, wr);
565
+ }, Pr);
566
566
  },
567
567
  [s, u, l, m]
568
568
  ), _ = $(
@@ -572,9 +572,9 @@ function se(e, t = "value", n = {}) {
572
572
  [e, o, i]
573
573
  ), w = $(
574
574
  (O) => {
575
- _(O), M(O);
575
+ _(O), I(O);
576
576
  },
577
- [_, M]
577
+ [_, I]
578
578
  ), C = $(() => {
579
579
  s && b.current.reportEvent({
580
580
  action: "focus",
@@ -592,46 +592,40 @@ function se(e, t = "value", n = {}) {
592
592
  reportFocus: C
593
593
  };
594
594
  }
595
- function he(e) {
595
+ function fe(e) {
596
596
  if (typeof e == "string") return e || void 0;
597
597
  if (typeof e == "number") return String(e);
598
598
  }
599
599
  function Y(e) {
600
600
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
601
601
  }
602
- function an(e, t) {
602
+ function ln(e, t) {
603
603
  return t ? Array.isArray(e) ? null : Y(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
604
604
  }
605
- function we(e) {
605
+ function Ue(e) {
606
606
  if (e == null) return;
607
607
  const t = typeof e == "number" ? e : Number(e);
608
608
  if (!(!Number.isFinite(t) || t < 1))
609
609
  return Math.floor(t);
610
610
  }
611
- function ln(e, t, n, r) {
612
- if (e.includes(t)) {
613
- const i = e.filter((s) => s !== t);
614
- return n !== void 0 && i.length < n ? null : i;
615
- }
616
- return r !== void 0 && e.length >= r ? null : [...e, t];
611
+ function cn(e, t, n, r) {
612
+ return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
617
613
  }
618
- function cn(e, t, n, r, o) {
619
- if (!n) return !0;
620
- const i = e.includes(t);
621
- return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
614
+ function un(e, t, n, r, o) {
615
+ return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
622
616
  }
623
- function un(e, t) {
617
+ function mn(e, t) {
624
618
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
625
619
  }
626
- const mn = ye(null);
620
+ const dn = ge(null);
627
621
  function st({
628
622
  caseSearch: e,
629
623
  children: t
630
624
  }) {
631
- return /* @__PURE__ */ c(mn.Provider, { value: e ?? null, children: t });
625
+ return /* @__PURE__ */ c(dn.Provider, { value: e ?? null, children: t });
632
626
  }
633
- function zr() {
634
- return ve(mn);
627
+ function Or() {
628
+ return ye(dn);
635
629
  }
636
630
  function Ye(e) {
637
631
  return typeof e == "string" ? e : "";
@@ -647,10 +641,10 @@ function Xe(e) {
647
641
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
648
642
  return t || n;
649
643
  }
650
- function Or(e) {
644
+ function qr(e) {
651
645
  return JSON.stringify(e);
652
646
  }
653
- const qr = {
647
+ const Br = {
654
648
  name: "SkoponCaseSelect",
655
649
  schema: h.object({
656
650
  label: h.any().optional(),
@@ -663,13 +657,13 @@ const qr = {
663
657
  value: h.any().optional()
664
658
  }).passthrough()
665
659
  };
666
- function Br({
660
+ function Lr({
667
661
  item: e,
668
662
  selected: t,
669
663
  disabled: n,
670
664
  onToggle: r
671
665
  }) {
672
- return /* @__PURE__ */ I(
666
+ return /* @__PURE__ */ N(
673
667
  "button",
674
668
  {
675
669
  type: "button",
@@ -677,11 +671,11 @@ function Br({
677
671
  disabled: n,
678
672
  onClick: r,
679
673
  children: [
680
- /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(Jt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
681
- /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-body", children: [
674
+ /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(Wt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
675
+ /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-body", children: [
682
676
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name }),
683
677
  e.description ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
684
- /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-meta", children: [
678
+ /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-meta", children: [
685
679
  e.caseUniqueId,
686
680
  e.platform ? ` · ${e.platform}` : "",
687
681
  e.link ? ` · ${e.link}` : ""
@@ -691,16 +685,16 @@ function Br({
691
685
  }
692
686
  );
693
687
  }
694
- function Lr({ context: e }) {
695
- const { interactive: t } = ie(), n = zr(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
688
+ function Vr({ context: e }) {
689
+ const { interactive: t } = ie(), n = Or(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
696
690
  component: "SkoponCaseSelect",
697
691
  changeAction: "click"
698
- }), l = e.componentModel.properties, u = Ye(l.label), m = Ye(l.placeholder), d = Ye(l.help), S = l.enableRefresh !== !1, g = we(l.minCount), b = we(l.maxCount), y = j(() => Qe(l.caseFilter), [l.caseFilter]), k = Or(y), [f, p] = R(1), [v, x] = R(!1), [M, _] = R(""), [w, C] = R([]), [O, B] = R(0), [ne, K] = R(y.pageSize ?? 20), D = A(0), J = Y(o);
692
+ }), l = e.componentModel.properties, u = Ye(l.label), m = Ye(l.placeholder), d = Ye(l.help), S = l.enableRefresh !== !1, g = Ue(l.minCount), b = Ue(l.maxCount), y = j(() => Qe(l.caseFilter), [l.caseFilter]), k = qr(y), [f, p] = U(1), [v, x] = U(!1), [I, _] = U(""), [w, C] = U([]), [O, B] = U(0), [ne, K] = U(y.pageSize ?? 20), D = A(0), J = Y(o);
699
693
  z(() => {
700
- const T = un(J, b);
694
+ const T = mn(J, b);
701
695
  T !== null && s(T);
702
696
  }, [b, J, s]);
703
- const Z = j(() => n ? Xe(y) ? M || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, y, M, m]), ee = $(
697
+ const Z = j(() => n ? Xe(y) ? I || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, y, I, m]), ee = $(
704
698
  async (T) => {
705
699
  const V = Qe(JSON.parse(k)), P = ++D.current;
706
700
  if (!n || !Xe(V)) {
@@ -709,18 +703,18 @@ function Lr({ context: e }) {
709
703
  }
710
704
  x(!0), _("");
711
705
  try {
712
- const N = await n({ filter: V, page: T });
706
+ const M = await n({ filter: V, page: T });
713
707
  if (P !== D.current) return;
714
- C(N.list), B(N.total), p(N.page), K(N.pageSize), a && r(
708
+ C(M.list), B(M.total), p(M.page), K(M.pageSize), a && r(
715
709
  a,
716
- N.list.map((W) => ({
710
+ M.list.map((W) => ({
717
711
  value: W.caseUniqueId,
718
712
  label: W.name || W.caseUniqueId
719
713
  }))
720
714
  );
721
- } catch (N) {
715
+ } catch (M) {
722
716
  if (P !== D.current) return;
723
- C([]), B(0), _(N instanceof Error ? N.message : "加载案例列表失败");
717
+ C([]), B(0), _(M instanceof Error ? M.message : "加载案例列表失败");
724
718
  } finally {
725
719
  P === D.current && x(!1);
726
720
  }
@@ -732,7 +726,7 @@ function Lr({ context: e }) {
732
726
  }, [k, ee]);
733
727
  const F = (T) => {
734
728
  if (!t) return;
735
- const V = ln(
729
+ const V = cn(
736
730
  J,
737
731
  T,
738
732
  g,
@@ -740,27 +734,27 @@ function Lr({ context: e }) {
740
734
  );
741
735
  V !== null && i(V);
742
736
  }, L = () => {
743
- const T = Qe(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), N = f >= P ? 1 : f + 1;
744
- ee(N);
737
+ const T = Qe(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), M = f >= P ? 1 : f + 1;
738
+ ee(M);
745
739
  };
746
- return /* @__PURE__ */ I(
740
+ return /* @__PURE__ */ N(
747
741
  "div",
748
742
  {
749
743
  className: "form-block-preview skopon-resume-select",
750
744
  "data-skopon-field": a || void 0,
751
745
  children: [
752
746
  u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
753
- v && w.length === 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-status", children: [
747
+ v && w.length === 0 ? /* @__PURE__ */ N("div", { className: "skopon-resume-select-status", children: [
754
748
  /* @__PURE__ */ c(mt, { size: "small" }),
755
749
  " 加载案例…"
756
750
  ] }) : null,
757
751
  !v && w.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: Z }) : null,
758
752
  w.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ c(
759
- Br,
753
+ Lr,
760
754
  {
761
755
  item: T,
762
756
  selected: J.includes(T.caseUniqueId),
763
- disabled: cn(
757
+ disabled: un(
764
758
  J,
765
759
  T.caseUniqueId,
766
760
  t,
@@ -772,11 +766,11 @@ function Lr({ context: e }) {
772
766
  T.caseUniqueId
773
767
  )) }) : null,
774
768
  S && n && Xe(y) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
775
- ze,
769
+ Pe,
776
770
  {
777
771
  type: "default",
778
772
  size: "small",
779
- icon: /* @__PURE__ */ c(Gt, {}),
773
+ icon: /* @__PURE__ */ c(Jt, {}),
780
774
  loading: v,
781
775
  disabled: !t,
782
776
  onClick: L,
@@ -788,23 +782,23 @@ function Lr({ context: e }) {
788
782
  }
789
783
  );
790
784
  }
791
- const Vr = Q(
792
- qr,
793
- Lr
794
- ), jr = {
785
+ const jr = Q(
786
+ Br,
787
+ Vr
788
+ ), $r = {
795
789
  type: "case_multiselect",
796
790
  componentName: "SkoponCaseSelect",
797
- toComponent: Tr,
798
- fromComponent: xr,
799
- catalogComponents: [Vr]
791
+ toComponent: xr,
792
+ fromComponent: Nr,
793
+ catalogComponents: [jr]
800
794
  };
801
- function Dt(e) {
795
+ function Ht(e) {
802
796
  if (e == null) return;
803
797
  const t = typeof e == "number" ? e : Number(e);
804
798
  if (!(!Number.isFinite(t) || t < 1))
805
799
  return Math.floor(t);
806
800
  }
807
- function $r(e, t) {
801
+ function Dr(e, t) {
808
802
  var s, a, l, u;
809
803
  const { id: n, label: r, path: o, withData: i } = t;
810
804
  return i({
@@ -825,7 +819,7 @@ function $r(e, t) {
825
819
  value: { path: o }
826
820
  });
827
821
  }
828
- function Dr(e, t, n) {
822
+ function Hr(e, t, n) {
829
823
  const r = n.nameFromValue(e.value), o = {
830
824
  ...t("resume_multiselect"),
831
825
  name: r,
@@ -842,20 +836,20 @@ function Dr(e, t, n) {
842
836
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
843
837
  };
844
838
  }
845
- const a = Dt(e.minCount);
839
+ const a = Ht(e.minCount);
846
840
  a !== void 0 && (o.resumeMinCount = a);
847
- const l = Dt(e.maxCount);
841
+ const l = Ht(e.maxCount);
848
842
  return l !== void 0 && (o.resumeMaxCount = l), o;
849
843
  }
850
- const dn = ye(null);
844
+ const pn = ge(null);
851
845
  function at({
852
846
  resumeSearch: e,
853
847
  children: t
854
848
  }) {
855
- return /* @__PURE__ */ c(dn.Provider, { value: e ?? null, children: t });
849
+ return /* @__PURE__ */ c(pn.Provider, { value: e ?? null, children: t });
856
850
  }
857
- function Hr() {
858
- return ve(dn);
851
+ function Kr() {
852
+ return ye(pn);
859
853
  }
860
854
  function Ze(e) {
861
855
  return typeof e == "string" ? e : "";
@@ -866,10 +860,10 @@ function et(e) {
866
860
  const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
867
861
  return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
868
862
  }
869
- function Kr(e) {
863
+ function Gr(e) {
870
864
  return JSON.stringify(e);
871
865
  }
872
- const Gr = {
866
+ const Jr = {
873
867
  name: "SkoponResumeSelect",
874
868
  schema: h.object({
875
869
  label: h.any().optional(),
@@ -881,40 +875,40 @@ const Gr = {
881
875
  maxCount: h.any().optional(),
882
876
  value: h.any().optional()
883
877
  }).passthrough()
884
- }, Jr = 3, Wr = 2;
878
+ }, Wr = 3, Yr = 2;
885
879
  function tt(e, t) {
886
- const n = (t ?? []).filter(Boolean), r = n.slice(0, Jr), o = n.length - r.length;
887
- return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-tags", children: [
880
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Wr), o = n.length - r.length;
881
+ return /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-tags", children: [
888
882
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: e }),
889
- n.length > 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-tags-list", children: [
890
- r.map((i) => /* @__PURE__ */ c(fe, { className: "skopon-resume-select-card-tag", children: i }, i)),
891
- o > 0 ? /* @__PURE__ */ I(fe, { className: "skopon-resume-select-card-tag", children: [
883
+ n.length > 0 ? /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-tags-list", children: [
884
+ r.map((i) => /* @__PURE__ */ c(pe, { className: "skopon-resume-select-card-tag", children: i }, i)),
885
+ o > 0 ? /* @__PURE__ */ N(pe, { className: "skopon-resume-select-card-tag", children: [
892
886
  "+",
893
887
  o
894
888
  ] }) : null
895
889
  ] }) : /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
896
890
  ] });
897
891
  }
898
- function Yr(e) {
899
- return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-field", children: [
892
+ function Qr(e) {
893
+ return /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-field", children: [
900
894
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
901
895
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
902
896
  ] });
903
897
  }
904
- function Qr({ work: e }) {
905
- return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-work", children: [
906
- /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(Dn, { className: "skopon-resume-select-card-work-placeholder" }) }),
898
+ function Xr({ work: e }) {
899
+ return /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-work", children: [
900
+ /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(Hn, { className: "skopon-resume-select-card-work-placeholder" }) }),
907
901
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
908
902
  ] });
909
903
  }
910
- function Xr({
904
+ function Zr({
911
905
  item: e,
912
906
  selected: t,
913
907
  disabled: n,
914
908
  onToggle: r
915
909
  }) {
916
- const o = (e.works ?? []).slice(0, Wr);
917
- return /* @__PURE__ */ I(
910
+ const o = (e.works ?? []).slice(0, Yr);
911
+ return /* @__PURE__ */ N(
918
912
  "button",
919
913
  {
920
914
  type: "button",
@@ -923,36 +917,36 @@ function Xr({
923
917
  onClick: r,
924
918
  children: [
925
919
  /* @__PURE__ */ c(
926
- Pn,
920
+ zn,
927
921
  {
928
922
  size: 48,
929
923
  src: e.avatarUrl || void 0,
930
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c($n, {}),
924
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c(Dn, {}),
931
925
  className: "skopon-resume-select-card-avatar"
932
926
  }
933
927
  ),
934
928
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
935
- /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-body", children: [
936
- Yr(e.satisfaction),
929
+ /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-body", children: [
930
+ Qr(e.satisfaction),
937
931
  tt("性格", e.personality),
938
932
  tt("专长", e.specialties),
939
933
  tt("擅长领域", e.traits),
940
- /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-works", children: [
934
+ /* @__PURE__ */ N("div", { className: "skopon-resume-select-card-works", children: [
941
935
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
942
- o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(Qr, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
936
+ o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(Xr, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
943
937
  ] })
944
938
  ] })
945
939
  ]
946
940
  }
947
941
  );
948
942
  }
949
- function Zr({ context: e }) {
950
- const { interactive: t } = ie(), n = Hr(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
943
+ function eo({ context: e }) {
944
+ const { interactive: t } = ie(), n = Kr(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
951
945
  component: "SkoponResumeSelect",
952
946
  changeAction: "click"
953
- }), l = e.componentModel.properties, u = Ze(l.label), m = Ze(l.placeholder), d = Ze(l.help), S = l.enableRefresh !== !1, g = we(l.minCount), b = we(l.maxCount), y = j(() => et(l.resumeFilter), [l.resumeFilter]), k = Kr(y), [f, p] = R(1), [v, x] = R(!1), [M, _] = R(""), [w, C] = R([]), [O, B] = R(0), [ne, K] = R(y.pageSize ?? 20), D = A(0), J = Y(o);
947
+ }), l = e.componentModel.properties, u = Ze(l.label), m = Ze(l.placeholder), d = Ze(l.help), S = l.enableRefresh !== !1, g = Ue(l.minCount), b = Ue(l.maxCount), y = j(() => et(l.resumeFilter), [l.resumeFilter]), k = Gr(y), [f, p] = U(1), [v, x] = U(!1), [I, _] = U(""), [w, C] = U([]), [O, B] = U(0), [ne, K] = U(y.pageSize ?? 20), D = A(0), J = Y(o);
954
948
  z(() => {
955
- const T = un(J, b);
949
+ const T = mn(J, b);
956
950
  T !== null && s(T);
957
951
  }, [b, J, s]);
958
952
  const Z = $(
@@ -964,18 +958,18 @@ function Zr({ context: e }) {
964
958
  }
965
959
  x(!0), _("");
966
960
  try {
967
- const N = await n({ filter: V, page: T });
961
+ const M = await n({ filter: V, page: T });
968
962
  if (P !== D.current) return;
969
- C(N.list), B(N.total), p(N.page), K(N.pageSize), a && r(
963
+ C(M.list), B(M.total), p(M.page), K(M.pageSize), a && r(
970
964
  a,
971
- N.list.map((W) => ({
965
+ M.list.map((W) => ({
972
966
  value: W.resumeUniqueId,
973
967
  label: W.name || W.resumeUniqueId
974
968
  }))
975
969
  );
976
- } catch (N) {
970
+ } catch (M) {
977
971
  if (P !== D.current) return;
978
- C([]), B(0), _(N instanceof Error ? N.message : "加载简历列表失败");
972
+ C([]), B(0), _(M instanceof Error ? M.message : "加载简历列表失败");
979
973
  } finally {
980
974
  P === D.current && x(!1);
981
975
  }
@@ -987,7 +981,7 @@ function Zr({ context: e }) {
987
981
  }, [k, Z]);
988
982
  const ee = (T) => {
989
983
  if (!t) return;
990
- const V = ln(
984
+ const V = cn(
991
985
  J,
992
986
  T,
993
987
  g,
@@ -995,28 +989,28 @@ function Zr({ context: e }) {
995
989
  );
996
990
  V !== null && i(V);
997
991
  }, F = () => {
998
- const T = et(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), N = f >= P ? 1 : f + 1;
999
- Z(N);
992
+ const T = et(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), M = f >= P ? 1 : f + 1;
993
+ Z(M);
1000
994
  }, L = m || "暂无匹配的简历";
1001
- return /* @__PURE__ */ I(
995
+ return /* @__PURE__ */ N(
1002
996
  "div",
1003
997
  {
1004
998
  className: "form-block-preview skopon-resume-select",
1005
999
  "data-skopon-field": a || void 0,
1006
1000
  children: [
1007
1001
  u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
1008
- v && w.length === 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-status", children: [
1002
+ v && w.length === 0 ? /* @__PURE__ */ N("div", { className: "skopon-resume-select-status", children: [
1009
1003
  /* @__PURE__ */ c(mt, { size: "small" }),
1010
1004
  " 加载简历…"
1011
1005
  ] }) : null,
1012
- !v && M ? /* @__PURE__ */ c(te.Text, { type: "danger", className: "skopon-resume-select-status", children: M }) : null,
1013
- !v && !M && w.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: L }) : null,
1006
+ !v && I ? /* @__PURE__ */ c(te.Text, { type: "danger", className: "skopon-resume-select-status", children: I }) : null,
1007
+ !v && !I && w.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: L }) : null,
1014
1008
  w.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ c(
1015
- Xr,
1009
+ Zr,
1016
1010
  {
1017
1011
  item: T,
1018
1012
  selected: J.includes(T.resumeUniqueId),
1019
- disabled: cn(
1013
+ disabled: un(
1020
1014
  J,
1021
1015
  T.resumeUniqueId,
1022
1016
  t,
@@ -1028,11 +1022,11 @@ function Zr({ context: e }) {
1028
1022
  T.resumeUniqueId
1029
1023
  )) }) : null,
1030
1024
  S && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
1031
- ze,
1025
+ Pe,
1032
1026
  {
1033
1027
  type: "default",
1034
1028
  size: "small",
1035
- icon: /* @__PURE__ */ c(Gt, {}),
1029
+ icon: /* @__PURE__ */ c(Jt, {}),
1036
1030
  loading: v,
1037
1031
  disabled: !t,
1038
1032
  onClick: F,
@@ -1044,63 +1038,63 @@ function Zr({ context: e }) {
1044
1038
  }
1045
1039
  );
1046
1040
  }
1047
- const eo = Q(
1048
- Gr,
1049
- Zr
1050
- ), to = {
1041
+ const to = Q(
1042
+ Jr,
1043
+ eo
1044
+ ), no = {
1051
1045
  type: "resume_multiselect",
1052
1046
  componentName: "SkoponResumeSelect",
1053
- toComponent: $r,
1054
- fromComponent: Dr,
1055
- catalogComponents: [eo]
1056
- }, qe = [to, jr], no = new Map(
1047
+ toComponent: Dr,
1048
+ fromComponent: Hr,
1049
+ catalogComponents: [to]
1050
+ }, qe = [no, $r], ro = new Map(
1057
1051
  qe.map((e) => [e.type, e])
1058
- ), ro = new Map(
1052
+ ), oo = new Map(
1059
1053
  qe.map((e) => [e.componentName, e])
1060
1054
  );
1061
- function oo(e) {
1062
- return no.get(e);
1063
- }
1064
1055
  function io(e) {
1065
1056
  return ro.get(e);
1066
1057
  }
1067
- function so() {
1068
- return qe.flatMap((e) => e.catalogComponents);
1058
+ function so(e) {
1059
+ return oo.get(e);
1069
1060
  }
1070
1061
  function ao() {
1062
+ return qe.flatMap((e) => e.catalogComponents);
1063
+ }
1064
+ function lo() {
1071
1065
  return qe.map((e) => e.componentName);
1072
1066
  }
1073
- const Pe = "root", lt = "__title__", ct = "__desc__", gt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
1074
- function lo(e) {
1067
+ const we = "root", lt = "__title__", ct = "__desc__", gt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
1068
+ function co(e) {
1075
1069
  return `/${e}`;
1076
1070
  }
1077
- function Ht(e) {
1071
+ function Kt(e) {
1078
1072
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
1079
1073
  }
1080
1074
  function H(e) {
1081
1075
  if (typeof e == "string") return e;
1082
1076
  }
1083
- function co(e) {
1084
- const t = e.id || Se("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
1077
+ function uo(e) {
1078
+ const t = e.id || ve("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
1085
1079
  return {
1086
1080
  id: t,
1087
1081
  component: "SkoponMedia",
1088
1082
  mediaType: n,
1089
- urls: hr(e),
1090
- mediaSize: ke(e.mediaSize),
1083
+ urls: gr(e),
1084
+ mediaSize: be(e.mediaSize),
1091
1085
  label: e.label ?? "",
1092
1086
  help: e.help ?? "",
1093
1087
  placeholder: e.placeholder ?? ""
1094
1088
  };
1095
1089
  }
1096
- function uo(e) {
1090
+ function mo(e) {
1097
1091
  if (Array.isArray(e.urls))
1098
1092
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
1099
1093
  const t = H(e.url);
1100
1094
  return t != null && t.trim() ? [t.trim()] : [];
1101
1095
  }
1102
- function Ne(e, t, n) {
1103
- const r = typeof e.id == "string" ? e.id : Se("block-"), o = uo(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = ke(e.mediaSize);
1096
+ function Ie(e, t, n) {
1097
+ const r = typeof e.id == "string" ? e.id : ve("block-"), o = mo(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = be(e.mediaSize);
1104
1098
  return {
1105
1099
  id: r,
1106
1100
  type: t,
@@ -1111,10 +1105,10 @@ function Ne(e, t, n) {
1111
1105
  mediaUrls: o.length > 0 ? o : [""]
1112
1106
  };
1113
1107
  }
1114
- function mo(e) {
1108
+ function po(e) {
1115
1109
  switch (e.type) {
1116
1110
  case "toggle":
1117
- return Ce(e.defaultValue);
1111
+ return ke(e.defaultValue);
1118
1112
  case "multiselect":
1119
1113
  case "checkbox":
1120
1114
  case "resume_multiselect":
@@ -1128,9 +1122,9 @@ function mo(e) {
1128
1122
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
1129
1123
  }
1130
1124
  }
1131
- function po(e) {
1125
+ function fo(e) {
1132
1126
  var u;
1133
- const t = e.id || Se("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? lo(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: mo(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = oo(e.type);
1127
+ const t = e.id || ve("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? co(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: po(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = io(e.type);
1134
1128
  if (l)
1135
1129
  return l.toComponent(e, a);
1136
1130
  switch (e.type) {
@@ -1241,7 +1235,7 @@ function po(e) {
1241
1235
  case "image":
1242
1236
  case "video":
1243
1237
  case "audio":
1244
- return { node: co(e) };
1238
+ return { node: uo(e) };
1245
1239
  case "file":
1246
1240
  return s({
1247
1241
  id: t,
@@ -1260,23 +1254,23 @@ function po(e) {
1260
1254
  }
1261
1255
  function ut(e) {
1262
1256
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1263
- const t = e.components.find((r) => r.id === Pe);
1257
+ const t = e.components.find((r) => r.id === we);
1264
1258
  if (!t) return e.components.length === 0;
1265
1259
  const n = t.children;
1266
1260
  return !Array.isArray(n) || n.length === 0;
1267
1261
  }
1268
- function pn(e, t) {
1262
+ function fn(e, t) {
1269
1263
  const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
1270
1264
  i && s && (n.push({ id: lt, component: "Text", text: s, variant: "h2" }), r.push(lt)), i && a && (n.push({ id: ct, component: "Text", text: a, variant: "body" }), r.push(ct));
1271
1265
  for (const m of e.blocks ?? []) {
1272
- const { node: d, dataKey: S, dataValue: g } = po(m);
1266
+ const { node: d, dataKey: S, dataValue: g } = fo(m);
1273
1267
  d && (n.push(d), r.push(d.id), S && (o[S] = g));
1274
1268
  }
1275
- n.unshift({ id: Pe, component: "Column", children: r });
1276
- const l = { root: Pe, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1269
+ n.unshift({ id: we, component: "Column", children: r });
1270
+ const l = { root: we, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1277
1271
  return u !== void 0 && (l.surfaceProperties = { styleId: u ?? null }), l;
1278
1272
  }
1279
- function fo(e) {
1273
+ function ho(e) {
1280
1274
  const t = /* @__PURE__ */ new Map();
1281
1275
  for (const n of e.components ?? [])
1282
1276
  n && typeof n.id == "string" && t.set(n.id, n);
@@ -1293,10 +1287,10 @@ function nt(e) {
1293
1287
  };
1294
1288
  }).filter((n) => !!n) : [];
1295
1289
  }
1296
- function ho(e) {
1297
- const t = typeof e.id == "string" ? e.id : Se("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Ht(e.value), i = (a) => ({ id: t, type: a, label: r }), s = io(n);
1290
+ function go(e) {
1291
+ const t = typeof e.id == "string" ? e.id : ve("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Kt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = so(n);
1298
1292
  if (s)
1299
- return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Ht });
1293
+ return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Kt });
1300
1294
  switch (n) {
1301
1295
  case "Text": {
1302
1296
  const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
@@ -1338,14 +1332,14 @@ function ho(e) {
1338
1332
  }
1339
1333
  case "SkoponMedia": {
1340
1334
  const a = String(e.mediaType ?? "image");
1341
- return Ne(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
1335
+ return Ie(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
1342
1336
  }
1343
1337
  case "Image":
1344
- return Ne(e, "image", r);
1338
+ return Ie(e, "image", r);
1345
1339
  case "Video":
1346
- return Ne(e, "video", r);
1340
+ return Ie(e, "video", r);
1347
1341
  case "AudioPlayer":
1348
- return Ne(e, "audio", r);
1342
+ return Ie(e, "audio", r);
1349
1343
  case "FileUpload": {
1350
1344
  const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
1351
1345
  return a && (l.fileAcceptExtensions = a.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
@@ -1354,7 +1348,7 @@ function ho(e) {
1354
1348
  return null;
1355
1349
  }
1356
1350
  }
1357
- function fn(e, t, n, r) {
1351
+ function hn(e, t, n, r) {
1358
1352
  if (n.has(e)) return;
1359
1353
  n.add(e);
1360
1354
  const o = t.get(e);
@@ -1362,25 +1356,25 @@ function fn(e, t, n, r) {
1362
1356
  const i = String(o.component ?? "");
1363
1357
  if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1364
1358
  for (const s of o.children)
1365
- typeof s == "string" && fn(s, t, n, r);
1359
+ typeof s == "string" && hn(s, t, n, r);
1366
1360
  return;
1367
1361
  }
1368
1362
  r.push(o);
1369
1363
  }
1370
- function go(e, t) {
1364
+ function yo(e, t) {
1371
1365
  return t ? e.map((n) => {
1372
1366
  var i;
1373
1367
  const r = (i = n.name) == null ? void 0 : i.trim();
1374
1368
  if (!r || !(r in t)) return n;
1375
1369
  const o = t[r];
1376
- return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Ce(o) } : { ...n, defaultValue: o };
1370
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: ke(o) } : { ...n, defaultValue: o };
1377
1371
  }) : e;
1378
1372
  }
1379
- function yo(e) {
1373
+ function vo(e) {
1380
1374
  if (!e || !Array.isArray(e.components))
1381
1375
  return Re({ title: "", description: "", blocks: [], jsonSchema: {} });
1382
- const t = fo(e), n = [];
1383
- fn(e.root ?? Pe, t, /* @__PURE__ */ new Set(), n);
1376
+ const t = ho(e), n = [];
1377
+ hn(e.root ?? we, t, /* @__PURE__ */ new Set(), n);
1384
1378
  let r = "", o = "";
1385
1379
  const i = [];
1386
1380
  for (const s of n) {
@@ -1392,17 +1386,17 @@ function yo(e) {
1392
1386
  o = H(s.text) ?? o;
1393
1387
  continue;
1394
1388
  }
1395
- const a = ho(s);
1389
+ const a = go(s);
1396
1390
  a && i.push(a);
1397
1391
  }
1398
1392
  return Re({
1399
1393
  title: r,
1400
1394
  description: o,
1401
- blocks: go(i, e.dataModel),
1395
+ blocks: yo(i, e.dataModel),
1402
1396
  jsonSchema: {}
1403
1397
  });
1404
1398
  }
1405
- function vo(e, t) {
1399
+ function So(e, t) {
1406
1400
  const { surfaceId: n, catalogId: r } = t, o = [
1407
1401
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1408
1402
  {
@@ -1415,25 +1409,25 @@ function vo(e, t) {
1415
1409
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1416
1410
  }), o;
1417
1411
  }
1418
- function hn(e) {
1412
+ function gn(e) {
1419
1413
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1420
1414
  }
1421
- function So(e, t) {
1415
+ function bo(e, t) {
1422
1416
  if (!e || typeof e != "object") return null;
1423
- const n = e, r = hn(n.a2ui) ? n.a2ui : void 0;
1417
+ const n = e, r = gn(n.a2ui) ? n.a2ui : void 0;
1424
1418
  if (r && !ut(r)) return r;
1425
1419
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1426
1420
  if (o.length === 0) return null;
1427
- const i = ue({
1421
+ const i = Oe({
1428
1422
  title: typeof n.title == "string" ? n.title : "",
1429
1423
  description: typeof n.description == "string" ? n.description : "",
1430
1424
  blocks: o,
1431
1425
  jsonSchema: ft(n.jsonSchema ?? n.json_schema)
1432
- }), s = pn(i, t);
1426
+ }), s = fn(i, t);
1433
1427
  return ut(s) ? null : s;
1434
1428
  }
1435
- function bo(e, t, n) {
1436
- return pn(
1429
+ function ko(e, t, n) {
1430
+ return fn(
1437
1431
  {
1438
1432
  title: e.title,
1439
1433
  description: e.description,
@@ -1442,18 +1436,18 @@ function bo(e, t, n) {
1442
1436
  n
1443
1437
  );
1444
1438
  }
1445
- function ko(e) {
1439
+ function Co(e) {
1446
1440
  if (!e || typeof e != "object" || Array.isArray(e))
1447
1441
  return;
1448
1442
  const t = e;
1449
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && hn(t.a2ui) ? yo(t.a2ui) : ue({
1443
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gn(t.a2ui) ? vo(t.a2ui) : Oe({
1450
1444
  title: typeof t.title == "string" ? t.title : "",
1451
1445
  description: typeof t.description == "string" ? t.description : "",
1452
1446
  blocks: Array.isArray(t.blocks) ? t.blocks : [],
1453
1447
  jsonSchema: ft(t.jsonSchema ?? t.json_schema)
1454
1448
  });
1455
1449
  }
1456
- function Co(e, t, n) {
1450
+ function Ao(e, t, n) {
1457
1451
  const r = e.model.surfacesMap.get(t);
1458
1452
  if (!r) return {};
1459
1453
  const o = {};
@@ -1463,15 +1457,16 @@ function Co(e, t, n) {
1463
1457
  }
1464
1458
  return o;
1465
1459
  }
1466
- function Ao(e) {
1467
- return ue({
1460
+ const _o = /* @__PURE__ */ new Set(["type", "name", "id"]);
1461
+ function yt(e) {
1462
+ return Oe({
1468
1463
  title: "",
1469
1464
  description: "",
1470
1465
  blocks: [e],
1471
1466
  jsonSchema: {}
1472
1467
  }).blocks[0];
1473
1468
  }
1474
- function _o(e, t) {
1469
+ function To(e, t) {
1475
1470
  var o, i;
1476
1471
  const n = /* @__PURE__ */ new Map();
1477
1472
  for (const s of t) {
@@ -1480,8 +1475,8 @@ function _o(e, t) {
1480
1475
  }
1481
1476
  const r = [];
1482
1477
  for (const s of e.blocks) {
1483
- if (Oe(s.type)) {
1484
- r.push(Ao(s));
1478
+ if (ze(s.type)) {
1479
+ r.push(yt(s));
1485
1480
  continue;
1486
1481
  }
1487
1482
  if (!ae(s.type)) continue;
@@ -1492,30 +1487,45 @@ function _o(e, t) {
1492
1487
  }
1493
1488
  return r;
1494
1489
  }
1495
- function To(e, t) {
1490
+ function xo(e, t, n) {
1491
+ const r = e.rawBlocks;
1492
+ if (!(r != null && r.length)) return n;
1493
+ for (const o of r) {
1494
+ if (!o || typeof o != "object") continue;
1495
+ if ((typeof o.name == "string" ? o.name.trim() : "") === t) return o;
1496
+ }
1497
+ return n;
1498
+ }
1499
+ function No(e, t) {
1496
1500
  var r;
1497
- const n = {
1498
- ...e,
1499
- name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1500
- };
1501
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ue({
1502
- title: "",
1503
- description: "",
1504
- blocks: [n],
1505
- jsonSchema: {}
1506
- }).blocks[0];
1501
+ const n = { ...e };
1502
+ for (const o of Object.keys(t)) {
1503
+ if (_o.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
1504
+ const i = t[o];
1505
+ i !== void 0 && Object.assign(n, { [o]: i });
1506
+ }
1507
+ return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, yt(n);
1507
1508
  }
1508
1509
  function Be(e) {
1509
1510
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1510
1511
  const t = e;
1511
- return Array.isArray(t.blocks) ? ue({
1512
+ if (!Array.isArray(t.blocks)) return null;
1513
+ const n = t.blocks.filter(
1514
+ (o) => !!o && typeof o == "object" && !Array.isArray(o)
1515
+ ), r = Oe({
1512
1516
  title: typeof t.title == "string" ? t.title : "",
1513
1517
  description: typeof t.description == "string" ? t.description : "",
1514
- blocks: t.blocks,
1518
+ blocks: n,
1515
1519
  jsonSchema: {}
1516
- }) : null;
1520
+ });
1521
+ return {
1522
+ title: r.title,
1523
+ description: r.description,
1524
+ blocks: r.blocks,
1525
+ rawBlocks: n
1526
+ };
1517
1527
  }
1518
- function xo(e, t) {
1528
+ function Io(e, t) {
1519
1529
  var i, s, a, l, u, m;
1520
1530
  const n = /* @__PURE__ */ new Map();
1521
1531
  for (const d of (t == null ? void 0 : t.blocks) ?? [])
@@ -1526,38 +1536,35 @@ function xo(e, t) {
1526
1536
  const S = (s = d.name) == null ? void 0 : s.trim();
1527
1537
  if (!S) continue;
1528
1538
  const g = n.get(S);
1529
- g ? r.push(To(g, d)) : o.push(
1530
- ue({
1531
- title: "",
1532
- description: "",
1533
- blocks: [d],
1534
- jsonSchema: {}
1535
- }).blocks[0]
1536
- );
1539
+ if (g) {
1540
+ const b = xo(e, S, d);
1541
+ r.push(No(g, b));
1542
+ } else
1543
+ o.push(yt(d));
1537
1544
  }
1538
1545
  return {
1539
1546
  matchedBlocks: r,
1540
1547
  extraBlocks: o,
1541
- renderBlocks: _o(e, r),
1548
+ renderBlocks: To(e, r),
1542
1549
  title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
1543
1550
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
1544
1551
  };
1545
1552
  }
1546
- function Io(e) {
1553
+ function Mo(e) {
1547
1554
  const { type: t, defaultValue: n } = e;
1548
1555
  return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
1549
1556
  }
1550
- function yt(e) {
1557
+ function vt(e) {
1551
1558
  var n;
1552
1559
  const t = {};
1553
1560
  for (const r of e) {
1554
1561
  if (!ae(r.type)) continue;
1555
1562
  const o = (n = r.name) == null ? void 0 : n.trim();
1556
- o && (t[o] = Io(r));
1563
+ o && (t[o] = Mo(r));
1557
1564
  }
1558
1565
  return t;
1559
1566
  }
1560
- function Mo(e) {
1567
+ function Fo(e) {
1561
1568
  return e.blocks.some(
1562
1569
  (t) => {
1563
1570
  var n;
@@ -1565,61 +1572,61 @@ function Mo(e) {
1565
1572
  }
1566
1573
  );
1567
1574
  }
1568
- function No(e) {
1575
+ function Eo(e) {
1569
1576
  return e.blocks.filter((t) => {
1570
1577
  var n;
1571
- return Oe(t.type) ? !0 : ae(t.type) && !!((n = t.name) != null && n.trim());
1578
+ return ze(t.type) ? !0 : ae(t.type) && !!((n = t.name) != null && n.trim());
1572
1579
  });
1573
1580
  }
1574
- function Fo(e) {
1581
+ function Ro(e) {
1575
1582
  return e.blocks.filter((t) => {
1576
1583
  var n;
1577
1584
  return ae(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1578
1585
  }).map((t) => t.name.trim());
1579
1586
  }
1580
- function vt(e) {
1587
+ function St(e) {
1581
1588
  return e.replace(/'/g, "'\\''");
1582
1589
  }
1583
- function gn(e) {
1590
+ function yn(e) {
1584
1591
  var n;
1585
1592
  const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
1586
- return t ? ` -H 'Authorization: ${vt(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
1593
+ return t ? ` -H 'Authorization: ${St(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
1587
1594
  }
1588
- function yn(e, t, n) {
1595
+ function vn(e, t, n) {
1589
1596
  const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
1590
1597
  return [
1591
1598
  `curl -X POST '${r}' \\`,
1592
1599
  " -H 'Content-Type: application/json' \\",
1593
- gn(n),
1594
- ` -d '${vt(o)}'`
1600
+ yn(n),
1601
+ ` -d '${St(o)}'`
1595
1602
  ].join(`
1596
1603
  `);
1597
1604
  }
1598
- function Eo(e, t) {
1605
+ function Uo(e, t) {
1599
1606
  return JSON.stringify({ ...e, ...t }, null, 2);
1600
1607
  }
1601
- function Uo({
1608
+ function wo({
1602
1609
  cardValues: e,
1603
1610
  extraValues: t = {},
1604
1611
  callbackUrl: n,
1605
1612
  headers: r
1606
1613
  }) {
1607
- const o = (n ?? "").trim() || "<callback_url>", i = Eo(e, t);
1614
+ const o = (n ?? "").trim() || "<callback_url>", i = Uo(e, t);
1608
1615
  return [
1609
1616
  `curl -X POST '${o}' \\`,
1610
1617
  " -H 'Content-Type: application/json' \\",
1611
- gn(r),
1612
- ` -d '${vt(i)}'`
1618
+ yn(r),
1619
+ ` -d '${St(i)}'`
1613
1620
  ].join(`
1614
1621
  `);
1615
1622
  }
1616
- function rs(e, t, n) {
1623
+ function is(e, t, n) {
1617
1624
  const r = Be(e);
1618
- if (!r) return yn(e, t, n);
1619
- const o = yt(r.blocks);
1620
- return Uo({ cardValues: o, callbackUrl: t, headers: n });
1625
+ if (!r) return vn(e, t, n);
1626
+ const o = vt(r.blocks);
1627
+ return wo({ cardValues: o, callbackUrl: t, headers: n });
1621
1628
  }
1622
- async function vn(e, t, n) {
1629
+ async function Sn(e, t, n) {
1623
1630
  const r = e.trim();
1624
1631
  if (!r)
1625
1632
  throw new Error("callback_url 为空");
@@ -1646,7 +1653,7 @@ async function vn(e, t, n) {
1646
1653
  }
1647
1654
  return { ok: i.ok, status: i.status, body: s };
1648
1655
  }
1649
- async function os(e) {
1656
+ async function ss(e) {
1650
1657
  var n;
1651
1658
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1652
1659
  await navigator.clipboard.writeText(e);
@@ -1662,7 +1669,7 @@ async function os(e) {
1662
1669
  document.body.removeChild(t);
1663
1670
  }
1664
1671
  }
1665
- async function St(e) {
1672
+ async function bt(e) {
1666
1673
  let t;
1667
1674
  try {
1668
1675
  t = await e.json();
@@ -1675,8 +1682,8 @@ async function St(e) {
1675
1682
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1676
1683
  return t.data;
1677
1684
  }
1678
- const bt = "auth_user", Ro = "token", wo = "answer_agent_callback_url", Po = "realtime_ws_url", zo = "/api/v1/mock/ask_user_answer_mock";
1679
- function kt(e) {
1685
+ const kt = "auth_user", Po = "token", zo = "answer_agent_callback_url", Oo = "realtime_ws_url", qo = "/api/v1/mock/ask_user_answer_mock";
1686
+ function Ct(e) {
1680
1687
  if (typeof window > "u") return null;
1681
1688
  try {
1682
1689
  return e === "localStorage" ? window.localStorage : window.sessionStorage;
@@ -1684,7 +1691,7 @@ function kt(e) {
1684
1691
  return null;
1685
1692
  }
1686
1693
  }
1687
- function Ct(e) {
1694
+ function At(e) {
1688
1695
  try {
1689
1696
  const t = JSON.parse(e);
1690
1697
  return !t || typeof t != "object" || Array.isArray(t) ? null : t;
@@ -1692,50 +1699,50 @@ function Ct(e) {
1692
1699
  return null;
1693
1700
  }
1694
1701
  }
1695
- function Oo(e, t) {
1696
- const n = Ct(e);
1702
+ function Bo(e, t) {
1703
+ const n = At(e);
1697
1704
  if (!n) return "";
1698
1705
  const r = n[t];
1699
1706
  return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
1700
1707
  }
1701
- function qo(e = {}) {
1702
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.answerAgentCallbackUrlField ?? wo, o = kt(t);
1708
+ function Lo(e = {}) {
1709
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? kt, r = e.answerAgentCallbackUrlField ?? zo, o = Ct(t);
1703
1710
  if (!o) return "";
1704
1711
  const i = o.getItem(n);
1705
1712
  if (!i) return "";
1706
- const s = Ct(i);
1713
+ const s = At(i);
1707
1714
  if (!s) return "";
1708
1715
  const a = s[r];
1709
- return (typeof a == "string" ? a.trim() : "") || zo;
1716
+ return (typeof a == "string" ? a.trim() : "") || qo;
1710
1717
  }
1711
- function Bo(e = {}) {
1712
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.realtimeWsUrlField ?? Po, o = kt(t);
1718
+ function Vo(e = {}) {
1719
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? kt, r = e.realtimeWsUrlField ?? Oo, o = Ct(t);
1713
1720
  if (!o) return "";
1714
1721
  const i = o.getItem(n);
1715
1722
  if (!i) return "";
1716
- const s = Ct(i);
1723
+ const s = At(i);
1717
1724
  if (!s) return "";
1718
1725
  const a = s[r];
1719
1726
  return typeof a == "string" ? a.trim() : "";
1720
1727
  }
1721
- function At(e, t) {
1728
+ function _t(e, t) {
1722
1729
  return {
1723
- ...Sn(t),
1730
+ ...bn(t),
1724
1731
  ...e ?? {}
1725
1732
  };
1726
1733
  }
1727
- function Sn(e = {}) {
1728
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.tokenField ?? Ro, o = kt(t);
1734
+ function bn(e = {}) {
1735
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? kt, r = e.tokenField ?? Po, o = Ct(t);
1729
1736
  if (!o) return {};
1730
1737
  const i = o.getItem(n);
1731
1738
  if (!i) return {};
1732
- const s = Oo(i, r);
1739
+ const s = Bo(i, r);
1733
1740
  return s ? { Authorization: `Bearer ${s}` } : {};
1734
1741
  }
1735
- async function _t(e = {}) {
1736
- return e.getHeaders ? await e.getHeaders() ?? {} : Sn(e.authStorage);
1742
+ async function Tt(e = {}) {
1743
+ return e.getHeaders ? await e.getHeaders() ?? {} : bn(e.authStorage);
1737
1744
  }
1738
- function Lo(e = {}) {
1745
+ function jo(e = {}) {
1739
1746
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1740
1747
  async function o(i) {
1741
1748
  const s = new URLSearchParams();
@@ -1745,21 +1752,21 @@ function Lo(e = {}) {
1745
1752
  s.set("form_unique_id", i.formUniqueId);
1746
1753
  else
1747
1754
  throw new Error("form_id 或 form_unique_id 至少传一个");
1748
- const a = await _t(e), l = await r(`${t}${n}?${s.toString()}`, {
1755
+ const a = await Tt(e), l = await r(`${t}${n}?${s.toString()}`, {
1749
1756
  method: "GET",
1750
1757
  headers: a
1751
- }), u = await St(l), m = ko(u.form_definition);
1758
+ }), u = await bt(l), m = Co(u.form_definition);
1752
1759
  return {
1753
1760
  formUniqueId: u.form_unique_id,
1754
1761
  formId: u.form_id,
1755
1762
  disabled: u.disabled === 1,
1756
1763
  formDefinition: m,
1757
- a2ui: So(u.form_definition) ?? void 0
1764
+ a2ui: bo(u.form_definition) ?? void 0
1758
1765
  };
1759
1766
  }
1760
1767
  return { fetchDetail: o };
1761
1768
  }
1762
- function Vo(e) {
1769
+ function $o(e) {
1763
1770
  if (!e || typeof e != "object" || Array.isArray(e))
1764
1771
  return e ?? null;
1765
1772
  const t = e;
@@ -1769,13 +1776,13 @@ function Vo(e) {
1769
1776
  blocks: t.blocks
1770
1777
  } : e;
1771
1778
  }
1772
- function Tt({
1779
+ function xt({
1773
1780
  context: e,
1774
1781
  payload: t,
1775
1782
  form: n,
1776
1783
  answer: r
1777
1784
  }) {
1778
- const o = Be(t) ?? t, i = n ? Vo(n) : o;
1785
+ const o = Be(t) ?? t, i = n ? $o(n) : o;
1779
1786
  return {
1780
1787
  mission_id: e.missionId ?? null,
1781
1788
  tenant_id: e.tenantId ?? null,
@@ -1788,7 +1795,7 @@ function Tt({
1788
1795
  answer: r
1789
1796
  };
1790
1797
  }
1791
- function xt(e) {
1798
+ function Nt(e) {
1792
1799
  const t = e.callback_url;
1793
1800
  if (typeof t != "string" || !t.trim())
1794
1801
  return "callback_url 为空,无法提交";
@@ -1803,34 +1810,34 @@ function xt(e) {
1803
1810
  const o = e.mission_id;
1804
1811
  return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
1805
1812
  }
1806
- function is(e) {
1807
- return xt(
1808
- Tt({
1813
+ function as(e) {
1814
+ return Nt(
1815
+ xt({
1809
1816
  context: e,
1810
1817
  payload: {},
1811
1818
  answer: {}
1812
1819
  })
1813
1820
  );
1814
1821
  }
1815
- const Kt = "answer_agent_callback_url 未配置,无法提交";
1816
- function jo(e) {
1822
+ const Gt = "answer_agent_callback_url 未配置,无法提交";
1823
+ function Do(e) {
1817
1824
  if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
1818
1825
  const n = e.answerAgentCallbackUrl.trim();
1819
1826
  if (!n)
1820
- throw new Error(Kt);
1827
+ throw new Error(Gt);
1821
1828
  return n;
1822
1829
  }
1823
- const t = qo(e == null ? void 0 : e.authStorage).trim();
1830
+ const t = Lo(e == null ? void 0 : e.authStorage).trim();
1824
1831
  if (!t)
1825
- throw new Error(Kt);
1832
+ throw new Error(Gt);
1826
1833
  return t;
1827
1834
  }
1828
- function bn(e) {
1835
+ function kn(e) {
1829
1836
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1830
1837
  const n = e.data;
1831
1838
  return !n || typeof n != "object" || Array.isArray(n) ? null : n;
1832
1839
  }
1833
- function $o(e, t) {
1840
+ function Ho(e, t) {
1834
1841
  if (t && typeof t == "object" && t !== null && "message" in t) {
1835
1842
  const n = t.message;
1836
1843
  if (typeof n == "string" && n.trim())
@@ -1838,27 +1845,27 @@ function $o(e, t) {
1838
1845
  }
1839
1846
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
1840
1847
  }
1841
- function Do(e) {
1848
+ function Ko(e) {
1842
1849
  return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
1843
1850
  }
1844
- function kn(e) {
1845
- const t = bn(e.body);
1846
- return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: Do(t) } : e.ok ? { type: "success", message: "提交成功" } : {
1851
+ function Cn(e) {
1852
+ const t = kn(e.body);
1853
+ return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: Ko(t) } : e.ok ? { type: "success", message: "提交成功" } : {
1847
1854
  type: "error",
1848
- message: $o(e.status, e.body)
1855
+ message: Ho(e.status, e.body)
1849
1856
  };
1850
1857
  }
1851
- async function Cn(e, t) {
1852
- const n = xt(e);
1858
+ async function An(e, t) {
1859
+ const n = Nt(e);
1853
1860
  if (n)
1854
1861
  throw new Error(n);
1855
- const r = jo(t), o = await vn(r, e, {
1862
+ const r = Do(t), o = await Sn(r, e, {
1856
1863
  ...t,
1857
- headers: At(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
1858
- }), i = bn(o.body);
1864
+ headers: _t(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
1865
+ }), i = kn(o.body);
1859
1866
  return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
1860
1867
  }
1861
- function Ho(e) {
1868
+ function Go(e) {
1862
1869
  return {
1863
1870
  resumeUniqueId: e.resume_unique_id,
1864
1871
  resumeId: e.resume_id,
@@ -1879,7 +1886,7 @@ function Ho(e) {
1879
1886
  }))
1880
1887
  };
1881
1888
  }
1882
- function Ko(e, t, n) {
1889
+ function Jo(e, t, n) {
1883
1890
  const r = new URLSearchParams();
1884
1891
  r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
1885
1892
  for (const o of e.names ?? [])
@@ -1892,27 +1899,27 @@ function Ko(e, t, n) {
1892
1899
  r.append("published", String(o));
1893
1900
  return r;
1894
1901
  }
1895
- function Go(e = {}) {
1902
+ function Wo(e = {}) {
1896
1903
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
1897
1904
  return async ({ filter: i, page: s }) => {
1898
- const a = await _t(e), l = Ko(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
1905
+ const a = await Tt(e), l = Jo(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
1899
1906
  method: "GET",
1900
1907
  headers: a
1901
- }), m = await St(u);
1908
+ }), m = await bt(u);
1902
1909
  return {
1903
- list: (m.list ?? []).map(Ho),
1910
+ list: (m.list ?? []).map(Go),
1904
1911
  total: m.total ?? 0,
1905
1912
  page: m.page ?? s,
1906
1913
  pageSize: m.page_size ?? i.pageSize ?? 20
1907
1914
  };
1908
1915
  };
1909
1916
  }
1910
- function Jo(e) {
1917
+ function Yo(e) {
1911
1918
  var r, o, i, s;
1912
1919
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
1913
1920
  return t || n;
1914
1921
  }
1915
- function Wo(e) {
1922
+ function Qo(e) {
1916
1923
  return {
1917
1924
  caseUniqueId: e.case_unique_id,
1918
1925
  caseId: e.case_id,
@@ -1923,7 +1930,7 @@ function Wo(e) {
1923
1930
  description: e.description ?? void 0
1924
1931
  };
1925
1932
  }
1926
- function Yo(e, t, n) {
1933
+ function Xo(e, t, n) {
1927
1934
  var o, i, s;
1928
1935
  const r = new URLSearchParams();
1929
1936
  r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
@@ -1931,24 +1938,24 @@ function Yo(e, t, n) {
1931
1938
  a && r.append("flow_unique_ids", a);
1932
1939
  return r;
1933
1940
  }
1934
- function Qo(e = {}) {
1941
+ function Zo(e = {}) {
1935
1942
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
1936
1943
  return async ({ filter: i, page: s }) => {
1937
- if (!Jo(i))
1944
+ if (!Yo(i))
1938
1945
  return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
1939
- const a = await _t(e), l = Yo(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
1946
+ const a = await Tt(e), l = Xo(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
1940
1947
  method: "GET",
1941
1948
  headers: a
1942
- }), m = await St(u);
1949
+ }), m = await bt(u);
1943
1950
  return {
1944
- list: (m.list ?? []).map(Wo),
1951
+ list: (m.list ?? []).map(Qo),
1945
1952
  total: m.total ?? 0,
1946
1953
  page: m.page ?? s,
1947
1954
  pageSize: m.page_size ?? i.pageSize ?? 20
1948
1955
  };
1949
1956
  };
1950
1957
  }
1951
- function ss(e = {}) {
1958
+ function ls(e = {}) {
1952
1959
  var r, o, i, s, a;
1953
1960
  const t = {
1954
1961
  baseUrl: e.baseUrl,
@@ -1957,23 +1964,23 @@ function ss(e = {}) {
1957
1964
  authStorage: e.authStorage
1958
1965
  };
1959
1966
  return {
1960
- fetchDetail: Lo({
1967
+ fetchDetail: jo({
1961
1968
  ...t,
1962
1969
  detailPath: (r = e.form) == null ? void 0 : r.detailPath
1963
1970
  }).fetchDetail,
1964
- resumeSearch: Go({
1971
+ resumeSearch: Wo({
1965
1972
  ...t,
1966
1973
  searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
1967
1974
  published: (i = e.resume) == null ? void 0 : i.published
1968
1975
  }),
1969
- caseSearch: Qo({
1976
+ caseSearch: Zo({
1970
1977
  ...t,
1971
1978
  listPath: (s = e.case) == null ? void 0 : s.listPath,
1972
1979
  published: (a = e.case) == null ? void 0 : a.published
1973
1980
  })
1974
1981
  };
1975
1982
  }
1976
- function An(e, t) {
1983
+ function _n(e, t) {
1977
1984
  if (!t.trim()) return !0;
1978
1985
  try {
1979
1986
  return new RegExp(t).test(e);
@@ -1981,10 +1988,10 @@ function An(e, t) {
1981
1988
  return !0;
1982
1989
  }
1983
1990
  }
1984
- function _n(e) {
1991
+ function Tn(e) {
1985
1992
  return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
1986
1993
  }
1987
- function Xo(e, t) {
1994
+ function ei(e, t) {
1988
1995
  switch (e.type) {
1989
1996
  case "multiselect":
1990
1997
  case "checkbox":
@@ -1993,27 +2000,27 @@ function Xo(e, t) {
1993
2000
  case "case_multiselect":
1994
2001
  return Y(t).length === 0;
1995
2002
  case "toggle":
1996
- return !Ce(t);
2003
+ return !ke(t);
1997
2004
  case "number":
1998
2005
  return t == null || t === "";
1999
2006
  default:
2000
- return _n(t);
2007
+ return Tn(t);
2001
2008
  }
2002
2009
  }
2003
2010
  function rt(e, t) {
2004
2011
  return e.required === !0 || t > 0;
2005
2012
  }
2006
- function Zo(e, t) {
2013
+ function ti(e, t) {
2007
2014
  var n, r;
2008
2015
  for (const o of e) {
2009
2016
  const i = (n = o.name) == null ? void 0 : n.trim();
2010
- if (!i || Oe(o.type) || Ue(o.type)) continue;
2017
+ if (!i || ze(o.type) || Ee(o.type)) continue;
2011
2018
  const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
2012
- if (o.required && Xo(o, s))
2019
+ if (o.required && ei(o, s))
2013
2020
  return { fieldName: i, label: a, message: `请填写「${a}」` };
2014
- if (o.type === "email" && !_n(s)) {
2021
+ if (o.type === "email" && !Tn(s)) {
2015
2022
  const l = String(s).trim();
2016
- if (!An(l, gt))
2023
+ if (!_n(l, gt))
2017
2024
  return { fieldName: i, label: a, message: `「${a}」格式不正确` };
2018
2025
  }
2019
2026
  if (o.type === "file") {
@@ -2046,20 +2053,20 @@ function Zo(e, t) {
2046
2053
  }
2047
2054
  return null;
2048
2055
  }
2049
- const ei = {
2050
- video: Jn,
2051
- audio: Gn,
2052
- image: Kn,
2053
- file: Wt,
2054
- spreadsheet: Hn,
2055
- document: Jt
2056
+ const ni = {
2057
+ video: Wn,
2058
+ audio: Jn,
2059
+ image: Gn,
2060
+ file: Yt,
2061
+ spreadsheet: Kn,
2062
+ document: Wt
2056
2063
  };
2057
- function ti({
2064
+ function ri({
2058
2065
  type: e,
2059
2066
  size: t = 40,
2060
2067
  className: n
2061
2068
  }) {
2062
- const r = ei[e] ?? Wt;
2069
+ const r = ni[e] ?? Yt;
2063
2070
  return /* @__PURE__ */ c(
2064
2071
  r,
2065
2072
  {
@@ -2069,7 +2076,7 @@ function ti({
2069
2076
  }
2070
2077
  );
2071
2078
  }
2072
- const Tn = "skopon-form-v0_9", ni = /* @__PURE__ */ new Set([
2079
+ const xn = "skopon-form-v0_9", oi = /* @__PURE__ */ new Set([
2073
2080
  "SkoponMedia",
2074
2081
  "SkoponSelect",
2075
2082
  "Image",
@@ -2081,17 +2088,17 @@ const Tn = "skopon-form-v0_9", ni = /* @__PURE__ */ new Set([
2081
2088
  "FileUpload",
2082
2089
  "TextField",
2083
2090
  "Text",
2084
- ...ao()
2085
- ]), ri = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2086
- function Ae(e) {
2087
- const t = [...Ee.components.values()].find((n) => n.name === e);
2091
+ ...lo()
2092
+ ]), ii = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2093
+ function Ce(e) {
2094
+ const t = [...Fe.components.values()].find((n) => n.name === e);
2088
2095
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
2089
2096
  return t.schema;
2090
2097
  }
2091
2098
  function E(e) {
2092
2099
  return typeof e == "string" ? e : "";
2093
2100
  }
2094
- function xn(e) {
2101
+ function Nn(e) {
2095
2102
  return Array.isArray(e) ? e.map((t) => {
2096
2103
  if (!t || typeof t != "object") return null;
2097
2104
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
@@ -2106,8 +2113,8 @@ function Le({
2106
2113
  help: o,
2107
2114
  placeholder: i
2108
2115
  }) {
2109
- const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = yr(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2110
- return /* @__PURE__ */ I("div", { className: "form-block-preview", children: [
2116
+ const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = vr(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2117
+ return /* @__PURE__ */ N("div", { className: "form-block-preview", children: [
2111
2118
  s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2112
2119
  t.length === 0 ? /* @__PURE__ */ c("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ c("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ c(
2113
2120
  "img",
@@ -2142,13 +2149,13 @@ function Ve(e, t) {
2142
2149
  return {
2143
2150
  mediaType: t,
2144
2151
  urls: n,
2145
- mediaSize: ke(e.mediaSize),
2152
+ mediaSize: be(e.mediaSize),
2146
2153
  label: E(e.label) || E(e.description),
2147
2154
  help: E(e.help),
2148
2155
  placeholder: E(e.placeholder)
2149
2156
  };
2150
2157
  }
2151
- const oi = {
2158
+ const si = {
2152
2159
  name: "SkoponMedia",
2153
2160
  schema: h.object({
2154
2161
  mediaType: h.any().optional(),
@@ -2158,19 +2165,19 @@ const oi = {
2158
2165
  help: h.any().optional(),
2159
2166
  placeholder: h.any().optional()
2160
2167
  }).passthrough()
2161
- }, ii = Q(oi, ({ context: e }) => {
2168
+ }, ai = Q(si, ({ context: e }) => {
2162
2169
  const t = e.componentModel.properties, n = E(t.mediaType);
2163
2170
  return /* @__PURE__ */ c(Le, { ...Ve(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
2164
- }), si = Q(
2165
- { name: "Image", schema: Ae("Image") },
2171
+ }), li = Q(
2172
+ { name: "Image", schema: Ce("Image") },
2166
2173
  ({ context: e }) => /* @__PURE__ */ c(Le, { ...Ve(e.componentModel.properties, "image") })
2167
- ), ai = Q(
2168
- { name: "Video", schema: Ae("Video") },
2174
+ ), ci = Q(
2175
+ { name: "Video", schema: Ce("Video") },
2169
2176
  ({ context: e }) => /* @__PURE__ */ c(Le, { ...Ve(e.componentModel.properties, "video") })
2170
- ), li = Q(
2171
- { name: "AudioPlayer", schema: Ae("AudioPlayer") },
2177
+ ), ui = Q(
2178
+ { name: "AudioPlayer", schema: Ce("AudioPlayer") },
2172
2179
  ({ context: e }) => /* @__PURE__ */ c(Le, { ...Ve(e.componentModel.properties, "audio") })
2173
- ), ci = {
2180
+ ), mi = {
2174
2181
  name: "SkoponSelect",
2175
2182
  schema: h.object({
2176
2183
  label: h.any().optional(),
@@ -2180,15 +2187,15 @@ const oi = {
2180
2187
  value: h.any().optional()
2181
2188
  }).passthrough()
2182
2189
  };
2183
- function ui({ context: e }) {
2190
+ function di({ context: e }) {
2184
2191
  const { interactive: t } = ie(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = se(e, "value", {
2185
2192
  component: "SkoponSelect",
2186
2193
  changeAction: "select"
2187
- }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = xn(s.options), m = E(s.mode) === "multiple";
2194
+ }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = Nn(s.options), m = E(s.mode) === "multiple";
2188
2195
  return z(() => {
2189
- const d = an(n, m);
2196
+ const d = ln(n, m);
2190
2197
  d !== null && o(d);
2191
- }, [m, n, o]), /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2198
+ }, [m, n, o]), /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2192
2199
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2193
2200
  /* @__PURE__ */ c(
2194
2201
  ot,
@@ -2200,25 +2207,25 @@ function ui({ context: e }) {
2200
2207
  style: { width: "100%" },
2201
2208
  placeholder: l || (m ? "请选择多项" : "请选择"),
2202
2209
  options: u,
2203
- value: m ? Y(n) : he(n),
2210
+ value: m ? Y(n) : fe(n),
2204
2211
  onChange: (d) => r(m ? d ?? [] : d ?? "")
2205
2212
  }
2206
2213
  )
2207
2214
  ] });
2208
2215
  }
2209
- const mi = Q(
2210
- ci,
2211
- ui
2216
+ const pi = Q(
2217
+ mi,
2218
+ di
2212
2219
  );
2213
- function di({ context: e }) {
2220
+ function fi({ context: e }) {
2214
2221
  const { interactive: t } = ie(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = se(e, "value", {
2215
2222
  component: "ChoicePicker",
2216
2223
  changeAction: "select"
2217
- }), s = e.componentModel.properties, a = E(s.label), l = E(s.variant) || "mutuallyExclusive", u = E(s.skoponPickerType), m = E(s.placeholder), d = xn(s.options), g = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", b = g === "multiselect" || g === "checkbox";
2224
+ }), s = e.componentModel.properties, a = E(s.label), l = E(s.variant) || "mutuallyExclusive", u = E(s.skoponPickerType), m = E(s.placeholder), d = Nn(s.options), g = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", b = g === "multiselect" || g === "checkbox";
2218
2225
  return z(() => {
2219
- const y = an(n, b);
2226
+ const y = ln(n, b);
2220
2227
  y !== null && o(y);
2221
- }, [b, n, o]), /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2228
+ }, [b, n, o]), /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2222
2229
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2223
2230
  g === "select" ? /* @__PURE__ */ c(
2224
2231
  ot,
@@ -2229,7 +2236,7 @@ function di({ context: e }) {
2229
2236
  style: { width: "100%" },
2230
2237
  placeholder: m || "请选择",
2231
2238
  options: d,
2232
- value: he(n),
2239
+ value: fe(n),
2233
2240
  onChange: (y) => r(y ?? "")
2234
2241
  }
2235
2242
  ) : g === "multiselect" ? /* @__PURE__ */ c(
@@ -2246,7 +2253,7 @@ function di({ context: e }) {
2246
2253
  onChange: (y) => r(y ?? [])
2247
2254
  }
2248
2255
  ) : g === "checkbox" ? /* @__PURE__ */ c(
2249
- zn.Group,
2256
+ On.Group,
2250
2257
  {
2251
2258
  disabled: !t,
2252
2259
  className: "form-block-preview-control",
@@ -2255,18 +2262,18 @@ function di({ context: e }) {
2255
2262
  onChange: (y) => r(y)
2256
2263
  }
2257
2264
  ) : /* @__PURE__ */ c(
2258
- On.Group,
2265
+ qn.Group,
2259
2266
  {
2260
2267
  disabled: !t,
2261
2268
  className: "form-block-preview-control",
2262
2269
  options: d,
2263
- value: he(n),
2270
+ value: fe(n),
2264
2271
  onChange: (y) => r(y.target.value)
2265
2272
  }
2266
2273
  )
2267
2274
  ] });
2268
2275
  }
2269
- const pi = Q(
2276
+ const hi = Q(
2270
2277
  {
2271
2278
  name: "ChoicePicker",
2272
2279
  schema: h.object({
@@ -2278,45 +2285,45 @@ const pi = Q(
2278
2285
  placeholder: h.any().optional()
2279
2286
  }).passthrough()
2280
2287
  },
2281
- di
2288
+ fi
2282
2289
  );
2283
- function fi({ context: e }) {
2290
+ function gi({ context: e }) {
2284
2291
  const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o } = se(e, "value", {
2285
2292
  component: "CheckBox",
2286
2293
  changeAction: "change"
2287
2294
  }), i = e.componentModel.properties, s = E(i.label);
2288
- return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2295
+ return /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2289
2296
  s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2290
2297
  /* @__PURE__ */ c(
2291
- qn,
2298
+ Bn,
2292
2299
  {
2293
2300
  disabled: !t,
2294
2301
  className: "form-block-preview-control",
2295
- checked: Ce(n),
2302
+ checked: ke(n),
2296
2303
  onChange: (a) => r(a)
2297
2304
  }
2298
2305
  )
2299
2306
  ] });
2300
2307
  }
2301
- const hi = Q(
2302
- { name: "CheckBox", schema: Ae("CheckBox") },
2303
- fi
2308
+ const yi = Q(
2309
+ { name: "CheckBox", schema: Ce("CheckBox") },
2310
+ gi
2304
2311
  );
2305
- function gi(e, t, n) {
2306
- const r = he(e);
2312
+ function vi(e, t, n) {
2313
+ const r = fe(e);
2307
2314
  if (!r) return;
2308
2315
  if (!t && n) {
2309
- const i = Lt(r, "HH:mm", !0);
2316
+ const i = Vt(r, "HH:mm", !0);
2310
2317
  return i.isValid() ? i : void 0;
2311
2318
  }
2312
- const o = Lt(r);
2319
+ const o = Vt(r);
2313
2320
  return o.isValid() ? o : void 0;
2314
2321
  }
2315
- function yi({ context: e }) {
2322
+ function Si({ context: e }) {
2316
2323
  const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o, reportFocus: i } = se(e, "value", {
2317
2324
  component: "DateTimeInput",
2318
2325
  changeAction: "change"
2319
- }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = gi(n, u, m), S = (g) => {
2326
+ }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = vi(n, u, m), S = (g) => {
2320
2327
  if (!g) {
2321
2328
  r("");
2322
2329
  return;
@@ -2331,10 +2338,10 @@ function yi({ context: e }) {
2331
2338
  }
2332
2339
  r(g.format("YYYY-MM-DD"));
2333
2340
  };
2334
- return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2341
+ return /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2335
2342
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2336
2343
  !u && m ? /* @__PURE__ */ c(
2337
- Bn,
2344
+ Ln,
2338
2345
  {
2339
2346
  disabled: !t,
2340
2347
  className: "form-block-preview-control",
@@ -2345,7 +2352,7 @@ function yi({ context: e }) {
2345
2352
  onFocus: i
2346
2353
  }
2347
2354
  ) : /* @__PURE__ */ c(
2348
- Ln,
2355
+ Vn,
2349
2356
  {
2350
2357
  showTime: u && m,
2351
2358
  disabled: !t,
@@ -2359,7 +2366,7 @@ function yi({ context: e }) {
2359
2366
  )
2360
2367
  ] });
2361
2368
  }
2362
- const vi = Q(
2369
+ const bi = Q(
2363
2370
  {
2364
2371
  name: "DateTimeInput",
2365
2372
  schema: h.object({
@@ -2372,8 +2379,8 @@ const vi = Q(
2372
2379
  max: h.any().optional()
2373
2380
  }).passthrough()
2374
2381
  },
2375
- yi
2376
- ), Si = {
2382
+ Si
2383
+ ), ki = {
2377
2384
  name: "FileUpload",
2378
2385
  schema: h.object({
2379
2386
  label: h.any().optional(),
@@ -2385,20 +2392,20 @@ const vi = Q(
2385
2392
  value: h.any().optional()
2386
2393
  }).passthrough()
2387
2394
  };
2388
- function bi({ context: e }) {
2395
+ function Ci({ context: e }) {
2389
2396
  const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o } = se(e, "value", {
2390
2397
  component: "FileUpload",
2391
2398
  changeAction: "change"
2392
- }), i = e.componentModel.properties, s = E(i.label), a = E(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, u = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = ur(l, u), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2399
+ }), i = e.componentModel.properties, s = E(i.label), a = E(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, u = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = mr(l, u), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2393
2400
  i.filePlaceholderIcon
2394
2401
  ) ? i.filePlaceholderIcon : "document", S = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1, b = g > 0, y = Y(n), k = b && y.length >= g, f = y.length < S;
2395
- return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2402
+ return /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2396
2403
  s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2397
- /* @__PURE__ */ I(
2404
+ /* @__PURE__ */ N(
2398
2405
  Je.Dragger,
2399
2406
  {
2400
2407
  disabled: !t || k,
2401
- accept: cr(l, u),
2408
+ accept: ur(l, u),
2402
2409
  className: "form-file-upload-preview",
2403
2410
  showUploadList: t && y.length > 0,
2404
2411
  fileList: t ? y.map((p, v) => ({
@@ -2408,23 +2415,23 @@ function bi({ context: e }) {
2408
2415
  })) : [],
2409
2416
  beforeUpload: (p) => {
2410
2417
  if (!t) return Je.LIST_IGNORE;
2411
- const v = Y($t(e));
2418
+ const v = Y(Dt(e));
2412
2419
  if (b && v.length >= g) return Je.LIST_IGNORE;
2413
2420
  const x = b ? [...v, p.name].slice(0, g) : [...v, p.name];
2414
2421
  return r(x), !1;
2415
2422
  },
2416
2423
  onRemove: (p) => {
2417
- const v = Y($t(e)), x = /^(\d+)-/.exec(p.uid ?? ""), M = x ? Number(x[1]) : -1, _ = M >= 0 && M < v.length ? v.filter((w, C) => C !== M) : v.filter((w) => w !== p.name);
2424
+ const v = Y(Dt(e)), x = /^(\d+)-/.exec(p.uid ?? ""), I = x ? Number(x[1]) : -1, _ = I >= 0 && I < v.length ? v.filter((w, C) => C !== I) : v.filter((w) => w !== p.name);
2418
2425
  if (_.length < S) return !1;
2419
2426
  r(_);
2420
2427
  },
2421
2428
  children: [
2422
- /* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(ti, { type: d, size: 40 }) }),
2429
+ /* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(ri, { type: d, size: 40 }) }),
2423
2430
  /* @__PURE__ */ c("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
2424
2431
  ]
2425
2432
  }
2426
2433
  ),
2427
- /* @__PURE__ */ I(te.Text, { type: "secondary", className: "form-block-preview-help", children: [
2434
+ /* @__PURE__ */ N(te.Text, { type: "secondary", className: "form-block-preview-help", children: [
2428
2435
  "允许:",
2429
2436
  m ?? "全部类型",
2430
2437
  S > 0 ? `;至少 ${S} 个文件` : "",
@@ -2434,21 +2441,21 @@ function bi({ context: e }) {
2434
2441
  ] })
2435
2442
  ] });
2436
2443
  }
2437
- const ki = Q(
2438
- Si,
2439
- bi
2444
+ const Ai = Q(
2445
+ ki,
2446
+ Ci
2440
2447
  );
2441
- function Ci({ context: e }) {
2448
+ function _i({ context: e }) {
2442
2449
  const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o, reportFocus: i } = se(e, "value", {
2443
2450
  component: "TextField",
2444
2451
  changeAction: "change",
2445
2452
  debounceChange: !0
2446
- }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = E(s.variant) || "shortText", m = E(s.validationRegexp), d = he(n) ?? "", S = !t, [g, b] = R(""), y = (p) => {
2453
+ }), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), u = E(s.variant) || "shortText", m = E(s.validationRegexp), d = fe(n) ?? "", S = !t, [g, b] = U(""), y = (p) => {
2447
2454
  if (!m || !p.trim()) {
2448
2455
  b("");
2449
2456
  return;
2450
2457
  }
2451
- b(An(p, m) ? "" : "格式不正确");
2458
+ b(_n(p, m) ? "" : "格式不正确");
2452
2459
  };
2453
2460
  z(() => {
2454
2461
  y(d);
@@ -2476,7 +2483,7 @@ function Ci({ context: e }) {
2476
2483
  else if (u === "number") {
2477
2484
  const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
2478
2485
  f = /* @__PURE__ */ c(
2479
- Vn,
2486
+ jn,
2480
2487
  {
2481
2488
  disabled: S,
2482
2489
  className: k,
@@ -2513,13 +2520,13 @@ function Ci({ context: e }) {
2513
2520
  onBlur: (p) => y(p.target.value)
2514
2521
  }
2515
2522
  );
2516
- return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2523
+ return /* @__PURE__ */ N("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2517
2524
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2518
2525
  f,
2519
2526
  g ? /* @__PURE__ */ c(te.Text, { type: "danger", className: "form-block-preview-help", children: g }) : null
2520
2527
  ] });
2521
2528
  }
2522
- const Ai = Q(
2529
+ const Ti = Q(
2523
2530
  {
2524
2531
  name: "TextField",
2525
2532
  schema: h.object({
@@ -2530,35 +2537,35 @@ const Ai = Q(
2530
2537
  value: h.any().optional()
2531
2538
  }).passthrough()
2532
2539
  },
2533
- Ci
2540
+ _i
2534
2541
  );
2535
- function _i({ context: e }) {
2542
+ function xi({ context: e }) {
2536
2543
  const t = e.componentModel.properties, n = E(t.text), r = E(t.variant) || "body";
2537
- return ri.has(r) ? r === "caption" ? /* @__PURE__ */ c(te.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ c("em", { children: n }) }) : /* @__PURE__ */ c(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ c(te.Paragraph, { className: "form-block-preview-paragraph", children: n });
2544
+ return ii.has(r) ? r === "caption" ? /* @__PURE__ */ c(te.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ c("em", { children: n }) }) : /* @__PURE__ */ c(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ c(te.Paragraph, { className: "form-block-preview-paragraph", children: n });
2538
2545
  }
2539
- const Ti = Q(
2540
- { name: "Text", schema: Ae("Text") },
2541
- _i
2546
+ const Ni = Q(
2547
+ { name: "Text", schema: Ce("Text") },
2548
+ xi
2542
2549
  );
2543
2550
  function In() {
2544
2551
  const t = [
2545
- ...[...Ee.components.values()].filter(
2546
- (r) => !ni.has(r.name)
2552
+ ...[...Fe.components.values()].filter(
2553
+ (r) => !oi.has(r.name)
2547
2554
  ),
2548
- ii,
2549
- mi,
2550
- si,
2551
2555
  ai,
2552
- li,
2553
2556
  pi,
2557
+ li,
2558
+ ci,
2559
+ ui,
2554
2560
  hi,
2555
- vi,
2556
- ki,
2561
+ yi,
2562
+ bi,
2557
2563
  Ai,
2558
2564
  Ti,
2559
- ...so()
2560
- ], n = [...Ee.functions.values()];
2561
- return new Wn(Tn, t, n, Ee.themeSchema);
2565
+ Ni,
2566
+ ...ao()
2567
+ ], n = [...Fe.functions.values()];
2568
+ return new Yn(xn, t, n, Fe.themeSchema);
2562
2569
  }
2563
2570
  const oe = {
2564
2571
  jade9: "#29a383",
@@ -2572,7 +2579,7 @@ const oe = {
2572
2579
  primaryHover: "#26997b",
2573
2580
  primaryActive: "#1d3b31",
2574
2581
  onPrimary: "#ffffff"
2575
- }, xi = {
2582
+ }, Ii = {
2576
2583
  cssVar: { key: "vidtempl" },
2577
2584
  token: {
2578
2585
  colorPrimary: oe.primarySolid,
@@ -2657,14 +2664,14 @@ const oe = {
2657
2664
  }
2658
2665
  }
2659
2666
  };
2660
- function ge({
2667
+ function he({
2661
2668
  children: e,
2662
2669
  locale: t,
2663
2670
  theme: n
2664
2671
  }) {
2665
- return /* @__PURE__ */ c(jn, { theme: n ?? xi, locale: t, children: e });
2672
+ return /* @__PURE__ */ c($n, { theme: n ?? Ii, locale: t, children: e });
2666
2673
  }
2667
- const Ii = Rn(
2674
+ const Mi = wn(
2668
2675
  function({
2669
2676
  doc: t,
2670
2677
  surfaceId: n = "skopon-form",
@@ -2676,7 +2683,7 @@ const Ii = Rn(
2676
2683
  wrapProvider: l = !0
2677
2684
  }, u) {
2678
2685
  z(() => {
2679
- Zt(), Xt();
2686
+ en(), Zt();
2680
2687
  }, []);
2681
2688
  const m = A(null), d = A(i);
2682
2689
  d.current = i;
@@ -2691,9 +2698,9 @@ const Ii = Rn(
2691
2698
  if (!S)
2692
2699
  return { surfaces: [], processor: null };
2693
2700
  try {
2694
- const f = JSON.parse(S), p = new Qt([In()]), v = vo(f, {
2701
+ const f = JSON.parse(S), p = new Xt([In()]), v = So(f, {
2695
2702
  surfaceId: n,
2696
- catalogId: Tn
2703
+ catalogId: xn
2697
2704
  });
2698
2705
  return p.processMessages(v), {
2699
2706
  surfaces: Array.from(p.model.surfacesMap.values()),
@@ -2703,39 +2710,39 @@ const Ii = Rn(
2703
2710
  return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", f), { surfaces: [], processor: null };
2704
2711
  }
2705
2712
  }, [S, n]), { surfaces: b, processor: y } = g;
2706
- if (m.current = y, wn(
2713
+ if (m.current = y, Pn(
2707
2714
  u,
2708
2715
  () => ({
2709
2716
  getValues(f) {
2710
2717
  const p = m.current;
2711
2718
  if (!p) return {};
2712
2719
  const v = (f ?? d.current).map((x) => x.trim()).filter(Boolean);
2713
- return Co(p, n, v);
2720
+ return Ao(p, n, v);
2714
2721
  },
2715
2722
  setValues(f) {
2716
2723
  const p = m.current;
2717
2724
  if (!p) return;
2718
2725
  const v = p.model.surfacesMap.get(n);
2719
2726
  if (v)
2720
- for (const [x, M] of Object.entries(f)) {
2727
+ for (const [x, I] of Object.entries(f)) {
2721
2728
  const _ = x.trim();
2722
- _ && v.dataModel.set(`/${_}`, M);
2729
+ _ && v.dataModel.set(`/${_}`, I);
2723
2730
  }
2724
2731
  }
2725
2732
  }),
2726
2733
  [n]
2727
2734
  ), b.length === 0) {
2728
2735
  const f = /* @__PURE__ */ c(at, { resumeSearch: s, children: /* @__PURE__ */ c(st, { caseSearch: a, children: /* @__PURE__ */ c(it, { interactive: o, children: r }) }) });
2729
- return l ? /* @__PURE__ */ c(ge, { children: f }) : f;
2736
+ return l ? /* @__PURE__ */ c(he, { children: f }) : f;
2730
2737
  }
2731
- const k = /* @__PURE__ */ c(at, { resumeSearch: s, children: /* @__PURE__ */ c(st, { caseSearch: a, children: /* @__PURE__ */ c(it, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: b.map((f) => /* @__PURE__ */ c(Yt, { surface: f }, f.id)) }) }) }) });
2732
- return l ? /* @__PURE__ */ c(ge, { children: k }) : k;
2738
+ const k = /* @__PURE__ */ c(at, { resumeSearch: s, children: /* @__PURE__ */ c(st, { caseSearch: a, children: /* @__PURE__ */ c(it, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: b.map((f) => /* @__PURE__ */ c(Qt, { surface: f }, f.id)) }) }) }) });
2739
+ return l ? /* @__PURE__ */ c(he, { children: k }) : k;
2733
2740
  }
2734
2741
  );
2735
- function Fe() {
2736
- return new Qt([In()]);
2742
+ function Me() {
2743
+ return new Xt([In()]);
2737
2744
  }
2738
- function as({
2745
+ function cs({
2739
2746
  messages: e,
2740
2747
  surfaceId: t = "skopon-form-stream",
2741
2748
  emptyHint: n = null,
@@ -2744,10 +2751,10 @@ function as({
2744
2751
  caseSearch: i = null
2745
2752
  }) {
2746
2753
  z(() => {
2747
- Zt(), Xt();
2754
+ en(), Zt();
2748
2755
  }, []);
2749
2756
  const s = A(null);
2750
- s.current === null && (s.current = Fe());
2757
+ s.current === null && (s.current = Me());
2751
2758
  const a = A(0), l = A(""), u = A(!0), m = A(t);
2752
2759
  function d(f, p) {
2753
2760
  s.current = f, a.current = p.length, l.current = JSON.stringify(p), u.current && (b(f), k(Array.from(f.model.surfacesMap.values())));
@@ -2757,15 +2764,15 @@ function as({
2757
2764
  const v = JSON.stringify(f.slice(0, p)), x = l.current;
2758
2765
  if (!x) return !0;
2759
2766
  try {
2760
- const M = JSON.parse(x);
2761
- return JSON.stringify(M.slice(0, p)) !== v;
2767
+ const I = JSON.parse(x);
2768
+ return JSON.stringify(I.slice(0, p)) !== v;
2762
2769
  } catch {
2763
2770
  return !0;
2764
2771
  }
2765
2772
  }
2766
- const [g, b] = R(
2773
+ const [g, b] = U(
2767
2774
  () => s.current
2768
- ), [y, k] = R(
2775
+ ), [y, k] = U(
2769
2776
  () => Array.from(
2770
2777
  s.current.model.surfacesMap.values()
2771
2778
  )
@@ -2785,14 +2792,14 @@ function as({
2785
2792
  let f = !1;
2786
2793
  const p = m.current !== t;
2787
2794
  if (m.current = t, p) {
2788
- const _ = Fe();
2795
+ const _ = Me();
2789
2796
  return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), f || d(_, e)) : (s.current = _, a.current = 0, l.current = "", f || (b(_), k([]))), () => {
2790
2797
  f = !0;
2791
2798
  };
2792
2799
  }
2793
2800
  if (!Array.isArray(e) || e.length === 0) {
2794
2801
  if (a.current > 0) {
2795
- const _ = Fe();
2802
+ const _ = Me();
2796
2803
  s.current = _, a.current = 0, l.current = "", f || (b(_), k([]));
2797
2804
  }
2798
2805
  return () => {
@@ -2801,26 +2808,26 @@ function as({
2801
2808
  }
2802
2809
  const v = s.current, x = a.current;
2803
2810
  if (e.length < x || S(e, x)) {
2804
- const _ = Fe();
2811
+ const _ = Me();
2805
2812
  return _.processMessages(e), f || d(_, e), () => {
2806
2813
  f = !0;
2807
2814
  };
2808
2815
  }
2809
- const M = e.slice(x);
2810
- return M.length === 0 ? () => {
2816
+ const I = e.slice(x);
2817
+ return I.length === 0 ? () => {
2811
2818
  f = !0;
2812
- } : (v.processMessages(M), a.current = e.length, l.current = JSON.stringify(e), f || k(Array.from(v.model.surfacesMap.values())), () => {
2819
+ } : (v.processMessages(I), a.current = e.length, l.current = JSON.stringify(e), f || k(Array.from(v.model.surfacesMap.values())), () => {
2813
2820
  f = !0;
2814
2821
  });
2815
- }, [e, t]), y.length === 0 ? /* @__PURE__ */ c(ge, { children: n }) : /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(at, { resumeSearch: o, children: /* @__PURE__ */ c(st, { caseSearch: i, children: /* @__PURE__ */ c(it, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: y.map((f) => /* @__PURE__ */ c(Yt, { surface: f }, f.id)) }) }) }) }) });
2822
+ }, [e, t]), y.length === 0 ? /* @__PURE__ */ c(he, { children: n }) : /* @__PURE__ */ c(he, { children: /* @__PURE__ */ c(at, { resumeSearch: o, children: /* @__PURE__ */ c(st, { caseSearch: i, children: /* @__PURE__ */ c(it, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: y.map((f) => /* @__PURE__ */ c(Qt, { surface: f }, f.id)) }) }) }) }) });
2816
2823
  }
2817
- const Mi = 100, Ni = 3e4, Fi = 1500, ce = /* @__PURE__ */ new Map();
2818
- function Ei(e) {
2824
+ const Fi = 100, Ei = 3e4, Ri = 1500, ce = /* @__PURE__ */ new Map();
2825
+ function Ui(e) {
2819
2826
  const t = e.trim();
2820
2827
  let n = ce.get(t);
2821
- return n || (n = new Ui(t), ce.set(t, n)), n.acquire(), n;
2828
+ return n || (n = new wi(t), ce.set(t, n)), n.acquire(), n;
2822
2829
  }
2823
- class Ui {
2830
+ class wi {
2824
2831
  constructor(t) {
2825
2832
  G(this, "url");
2826
2833
  G(this, "ws", null);
@@ -2839,7 +2846,7 @@ class Ui {
2839
2846
  release() {
2840
2847
  this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
2841
2848
  this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), ce.get(this.url) === this && ce.delete(this.url));
2842
- }, Fi));
2849
+ }, Ri));
2843
2850
  }
2844
2851
  /** 强制关闭(测试用),跳过宽限期。 */
2845
2852
  forceClose() {
@@ -2912,7 +2919,7 @@ class Ui {
2912
2919
  }
2913
2920
  }
2914
2921
  enqueue(t) {
2915
- for (this.sendQueue.push(t); this.sendQueue.length > Mi; )
2922
+ for (this.sendQueue.push(t); this.sendQueue.length > Fi; )
2916
2923
  this.sendQueue.shift();
2917
2924
  }
2918
2925
  flushQueue() {
@@ -2926,7 +2933,7 @@ class Ui {
2926
2933
  if (!this.connectRequested || this.refCount <= 0) return;
2927
2934
  this.clearReconnectTimer();
2928
2935
  const t = Math.min(
2929
- Ni,
2936
+ Ei,
2930
2937
  1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
2931
2938
  );
2932
2939
  this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
@@ -2964,13 +2971,13 @@ class Ui {
2964
2971
  }
2965
2972
  }
2966
2973
  }
2967
- class Ri {
2974
+ class Pi {
2968
2975
  constructor(t) {
2969
2976
  G(this, "askUserMessageId");
2970
2977
  G(this, "connection");
2971
2978
  G(this, "unsubscribe");
2972
2979
  G(this, "closed", !1);
2973
- this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Ei(t.url);
2980
+ this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Ui(t.url);
2974
2981
  const n = t.onAutoControl;
2975
2982
  this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
2976
2983
  };
@@ -2988,21 +2995,21 @@ class Ri {
2988
2995
  function Mn(e) {
2989
2996
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
2990
2997
  }
2991
- function wi(e, t) {
2998
+ function zi(e, t) {
2992
2999
  if (!e) return !1;
2993
3000
  const n = e.querySelector(`[data-skopon-field="${Mn(t)}"]`);
2994
3001
  return n instanceof HTMLElement ? ((n.querySelector(
2995
3002
  'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
2996
3003
  ) ?? n).focus(), !0) : !1;
2997
3004
  }
2998
- function Pi(e, t) {
3005
+ function Oi(e, t) {
2999
3006
  if (!e) return !1;
3000
3007
  const n = e.querySelector(`[data-skopon-field="${Mn(t)}"]`);
3001
3008
  return n instanceof HTMLElement ? ((n.querySelector(
3002
3009
  'button, [role="button"], .skopon-resume-select-card, input, label'
3003
3010
  ) ?? n).click(), !0) : !1;
3004
3011
  }
3005
- function zi(e, t, n) {
3012
+ function qi(e, t, n) {
3006
3013
  const r = e.action;
3007
3014
  if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
3008
3015
  console.warn("[FormAutoControl] unknown action", r);
@@ -3032,47 +3039,47 @@ function zi(e, t, n) {
3032
3039
  return;
3033
3040
  }
3034
3041
  if (r === "focus") {
3035
- wi(t.rootElement, o), n.reportEvent({
3042
+ zi(t.rootElement, o), n.reportEvent({
3036
3043
  action: "focus",
3037
3044
  component: i,
3038
3045
  field: o
3039
3046
  });
3040
3047
  return;
3041
3048
  }
3042
- Pi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
3049
+ Oi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
3043
3050
  });
3044
3051
  }
3045
- function Oi(e) {
3052
+ function Bi(e) {
3046
3053
  const t = {};
3047
3054
  for (const [n, r] of Object.entries(e))
3048
3055
  r !== void 0 && (t[n] = r);
3049
3056
  return t;
3050
3057
  }
3051
- function qi(e, t) {
3058
+ function Li(e, t) {
3052
3059
  var o;
3053
3060
  const n = (o = e.name) == null ? void 0 : o.trim();
3054
3061
  if (!n || !t) return { ...e };
3055
3062
  const r = t.get(n);
3056
3063
  return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
3057
3064
  }
3058
- function Bi(e) {
3065
+ function Vi(e) {
3059
3066
  var i, s;
3060
3067
  const n = {
3061
3068
  blocks: (e.blocks ?? []).map(
3062
- (a) => qi(a, e.liveOptions)
3069
+ (a) => Li(a, e.liveOptions)
3063
3070
  )
3064
3071
  }, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
3065
3072
  return r && (n.title = r), o && (n.description = o), {
3066
3073
  form_schema: n,
3067
- form_values: Oi(e.values ?? {}),
3074
+ form_values: Bi(e.values ?? {}),
3068
3075
  form_change: [...e.formChange ?? []]
3069
3076
  };
3070
3077
  }
3071
- function Li(e) {
3078
+ function ji(e) {
3072
3079
  const t = Be(e);
3073
- return t ? yt(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
3080
+ return t ? vt(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
3074
3081
  }
3075
- function Vi({
3082
+ function $i({
3076
3083
  payload: e,
3077
3084
  callbackUrl: t,
3078
3085
  title: n,
@@ -3082,15 +3089,15 @@ function Vi({
3082
3089
  submitHeaders: s,
3083
3090
  onNotify: a
3084
3091
  }) {
3085
- const [l, u] = R(!1), m = A(!0);
3092
+ const [l, u] = U(!1), m = A(!0);
3086
3093
  z(() => (m.current = !0, () => {
3087
3094
  m.current = !1;
3088
3095
  }), []);
3089
3096
  const d = j(
3090
- () => At(s),
3097
+ () => _t(s),
3091
3098
  [s]
3092
3099
  ), S = j(
3093
- () => yn(e, t, d),
3100
+ () => vn(e, t, d),
3094
3101
  [e, t, d]
3095
3102
  ), g = j(
3096
3103
  () => ({
@@ -3103,15 +3110,15 @@ function Vi({
3103
3110
  if (!l) {
3104
3111
  u(!0);
3105
3112
  try {
3106
- const y = Li(e), k = Tt({
3113
+ const y = ji(e), k = xt({
3107
3114
  context: g,
3108
3115
  payload: e,
3109
3116
  answer: y
3110
- }), f = await Cn(k, {
3117
+ }), f = await An(k, {
3111
3118
  headers: d
3112
3119
  });
3113
3120
  if (!m.current) return;
3114
- const p = kn(f);
3121
+ const p = Cn(f);
3115
3122
  a == null || a(p.type, p.message);
3116
3123
  } catch (y) {
3117
3124
  if (!m.current) return;
@@ -3122,15 +3129,15 @@ function Vi({
3122
3129
  }
3123
3130
  }
3124
3131
  }
3125
- return /* @__PURE__ */ I("div", { className: "ask-user-curl-card", children: [
3126
- /* @__PURE__ */ I("div", { className: "ask-user-curl-card-header", children: [
3127
- /* @__PURE__ */ I("div", { className: "ask-user-curl-card-header-title", children: [
3132
+ return /* @__PURE__ */ N("div", { className: "ask-user-curl-card", children: [
3133
+ /* @__PURE__ */ N("div", { className: "ask-user-curl-card-header", children: [
3134
+ /* @__PURE__ */ N("div", { className: "ask-user-curl-card-header-title", children: [
3128
3135
  /* @__PURE__ */ c(te.Text, { type: "secondary", children: n ?? "curl 命令" }),
3129
- r ? /* @__PURE__ */ c(pe, { title: r, children: /* @__PURE__ */ c(fe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
3130
- o ? /* @__PURE__ */ c(pe, { title: o, children: /* @__PURE__ */ c(fe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
3136
+ r ? /* @__PURE__ */ c(de, { title: r, children: /* @__PURE__ */ c(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
3137
+ o ? /* @__PURE__ */ c(de, { title: o, children: /* @__PURE__ */ c(pe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
3131
3138
  ] }),
3132
- /* @__PURE__ */ c(pe, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
3133
- ze,
3139
+ /* @__PURE__ */ c(de, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
3140
+ Pe,
3134
3141
  {
3135
3142
  size: "small",
3136
3143
  type: "text",
@@ -3144,8 +3151,8 @@ function Vi({
3144
3151
  /* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: S })
3145
3152
  ] });
3146
3153
  }
3147
- const ji = 80;
3148
- function $i(e, t) {
3154
+ const Di = 80;
3155
+ function Hi(e, t) {
3149
3156
  if (t && typeof t == "object" && t !== null && "message" in t) {
3150
3157
  const n = t.message;
3151
3158
  if (typeof n == "string" && n.trim())
@@ -3153,7 +3160,7 @@ function $i(e, t) {
3153
3160
  }
3154
3161
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
3155
3162
  }
3156
- function Di({
3163
+ function Ki({
3157
3164
  payload: e,
3158
3165
  formUniqueId: t,
3159
3166
  askUserMessageId: n,
@@ -3168,10 +3175,10 @@ function Di({
3168
3175
  onSurfaceReadyChange: d,
3169
3176
  onAutoControlReady: S
3170
3177
  }) {
3171
- const [g, b] = R(null), [y, k] = R(!1), [f, p] = R(!0), [v, x] = R(!1), M = A(null), _ = A(null), w = A(!0), C = A(l);
3178
+ const [g, b] = U(null), [y, k] = U(!1), [f, p] = U(!0), [v, x] = U(!1), I = A(null), _ = A(null), w = A(!0), C = A(l);
3172
3179
  C.current = l;
3173
- const O = on(), B = ht(), ne = A(""), K = A(null), D = (t == null ? void 0 : t.trim()) ?? "", J = (n == null ? void 0 : n.trim()) ?? "", Z = j(
3174
- () => At(s),
3180
+ const O = sn(), B = ht(), ne = A(""), K = A(null), D = (t == null ? void 0 : t.trim()) ?? "", J = (n == null ? void 0 : n.trim()) ?? "", Z = j(
3181
+ () => _t(s),
3175
3182
  [s]
3176
3183
  ), ee = j(
3177
3184
  () => ({
@@ -3183,34 +3190,34 @@ function Di({
3183
3190
  z(() => (w.current = !0, () => {
3184
3191
  w.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
3185
3192
  }), []), z(() => {
3186
- let U = !1;
3193
+ let R = !1;
3187
3194
  return D ? (p(!0), k(!1), a({ formUniqueId: D }).then((q) => {
3188
- U || (k(!!q.disabled), b(q.formDefinition ?? null));
3195
+ R || (k(!!q.disabled), b(q.formDefinition ?? null));
3189
3196
  }).catch((q) => {
3190
3197
  var X;
3191
- if (!U) {
3198
+ if (!R) {
3192
3199
  k(!1), b(null);
3193
- const xe = q instanceof Error ? q.message : "获取表单定义失败";
3194
- (X = C.current) == null || X.call(C, "error", xe);
3200
+ const Te = q instanceof Error ? q.message : "获取表单定义失败";
3201
+ (X = C.current) == null || X.call(C, "error", Te);
3195
3202
  }
3196
3203
  }).finally(() => {
3197
- U || p(!1);
3204
+ R || p(!1);
3198
3205
  }), () => {
3199
- U = !0;
3206
+ R = !0;
3200
3207
  }) : (p(!1), k(!1), b(null), () => {
3201
- U = !0;
3208
+ R = !0;
3202
3209
  });
3203
3210
  }, [D, a]);
3204
- const F = j(() => Be(e), [e]), L = j(() => F ? xo(F, g ?? void 0) : null, [F, g]), T = (L == null ? void 0 : L.matchedBlocks) ?? [], V = !!(F && Mo(F) && T.length === 0), P = j(() => V && F ? No(F) : L && L.renderBlocks.length > 0 ? L.renderBlocks : [], [L, V, F]), N = j(
3205
- () => V ? {} : yt((L == null ? void 0 : L.extraBlocks) ?? []),
3211
+ const F = j(() => Be(e), [e]), L = j(() => F ? Io(F, g ?? void 0) : null, [F, g]), T = (L == null ? void 0 : L.matchedBlocks) ?? [], V = !!(F && Fo(F) && T.length === 0), P = j(() => V && F ? Eo(F) : L && L.renderBlocks.length > 0 ? L.renderBlocks : [], [L, V, F]), M = j(
3212
+ () => V ? {} : vt((L == null ? void 0 : L.extraBlocks) ?? []),
3206
3213
  [V, L]
3207
- ), W = j(() => V && F ? Fo(F) : P.filter((U) => {
3214
+ ), W = j(() => V && F ? Ro(F) : P.filter((R) => {
3208
3215
  var q;
3209
- return (q = U.name) == null ? void 0 : q.trim();
3210
- }).map((U) => U.name.trim()), [V, F, P]), _e = (L == null ? void 0 : L.title) ?? (F == null ? void 0 : F.title) ?? "", Te = (L == null ? void 0 : L.description) ?? (F == null ? void 0 : F.description) ?? "", le = j(() => P.length === 0 ? null : bo(
3211
- { title: _e, description: Te },
3216
+ return (q = R.name) == null ? void 0 : q.trim();
3217
+ }).map((R) => R.name.trim()), [V, F, P]), Ae = (L == null ? void 0 : L.title) ?? (F == null ? void 0 : F.title) ?? "", _e = (L == null ? void 0 : L.description) ?? (F == null ? void 0 : F.description) ?? "", le = j(() => P.length === 0 ? null : ko(
3218
+ { title: Ae, description: _e },
3212
3219
  P
3213
- ), [_e, Te, P]), je = j(() => {
3220
+ ), [Ae, _e, P]), je = j(() => {
3214
3221
  if (!le) return "";
3215
3222
  try {
3216
3223
  return JSON.stringify(le);
@@ -3221,99 +3228,99 @@ function Di({
3221
3228
  z(() => (d(re), () => d(!1)), [re, d]);
3222
3229
  const It = $(() => {
3223
3230
  var q;
3224
- return { ...((q = M.current) == null ? void 0 : q.getValues(W)) ?? {}, ...N };
3225
- }, [W, N]), Mt = A(B.liveOptions);
3231
+ return { ...((q = I.current) == null ? void 0 : q.getValues(W)) ?? {}, ...M };
3232
+ }, [W, M]), Mt = A(B.liveOptions);
3226
3233
  Mt.current = B.liveOptions;
3227
3234
  const De = A(B.pendingChangeFields);
3228
3235
  De.current = B.pendingChangeFields;
3229
- const me = $(
3230
- (U) => {
3231
- const q = Bi({
3232
- title: _e,
3233
- description: Te,
3236
+ const ue = $(
3237
+ (R) => {
3238
+ const q = Vi({
3239
+ title: Ae,
3240
+ description: _e,
3234
3241
  blocks: P,
3235
3242
  values: It(),
3236
3243
  liveOptions: Mt.current,
3237
- formChange: U
3244
+ formChange: R
3238
3245
  });
3239
3246
  O.reportData(q);
3240
3247
  },
3241
- [_e, Te, P, It, O]
3242
- ), He = A(me);
3243
- He.current = me, z(() => {
3248
+ [Ae, _e, P, It, O]
3249
+ ), He = A(ue);
3250
+ He.current = ue, z(() => {
3244
3251
  if (!re) {
3245
3252
  ne.current = "";
3246
3253
  return;
3247
3254
  }
3248
3255
  if (!je) return;
3249
- const U = `${$e}::${je}`;
3250
- if (ne.current === U) return;
3256
+ const R = `${$e}::${je}`;
3257
+ if (ne.current === R) return;
3251
3258
  const q = setTimeout(() => {
3252
- w.current && ne.current !== U && (ne.current = U, He.current([]));
3259
+ w.current && ne.current !== R && (ne.current = R, He.current([]));
3253
3260
  }, 0);
3254
3261
  return () => clearTimeout(q);
3255
3262
  }, [re, $e, je]), z(() => {
3256
3263
  if (!(!re || B.version === 0) && De.current.length !== 0)
3257
3264
  return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
3258
3265
  if (K.current = null, !w.current) return;
3259
- const U = [...De.current];
3260
- B.clearPendingChangeFields(), U.length !== 0 && He.current(U);
3261
- }, ji), () => {
3266
+ const R = [...De.current];
3267
+ B.clearPendingChangeFields(), R.length !== 0 && He.current(R);
3268
+ }, Di), () => {
3262
3269
  K.current != null && (clearTimeout(K.current), K.current = null);
3263
3270
  };
3264
3271
  }, [re, B.version, B.clearPendingChangeFields]);
3265
3272
  const Ke = $(async () => {
3266
- var U, q, X, xe, Et, Ut, Rt, wt;
3273
+ var R, q, X, Te, Rt, Ut, wt, Pt;
3267
3274
  if (!v) {
3268
3275
  x(!0);
3269
3276
  try {
3270
- const de = ((U = M.current) == null ? void 0 : U.getValues(W)) ?? {}, Ie = Zo(P, de);
3271
- if (Ie) {
3272
- (q = C.current) == null || q.call(C, "error", Ie.message);
3277
+ const me = ((R = I.current) == null ? void 0 : R.getValues(W)) ?? {}, xe = ti(P, me);
3278
+ if (xe) {
3279
+ (q = C.current) == null || q.call(C, "error", xe.message);
3273
3280
  return;
3274
3281
  }
3275
- const Pt = { ...de, ...N };
3282
+ const zt = { ...me, ...M };
3276
3283
  if (o === "post") {
3277
- const Bt = (r ?? "").trim();
3278
- if (!Bt) {
3284
+ const Lt = (r ?? "").trim();
3285
+ if (!Lt) {
3279
3286
  (X = C.current) == null || X.call(C, "error", "callback_url 为空,无法提交");
3280
3287
  return;
3281
3288
  }
3282
- me([]), O.reportEvent({
3289
+ ue([]), O.reportEvent({
3283
3290
  action: "submit",
3284
3291
  component: "SubmitButton"
3285
3292
  });
3286
- const Ge = await vn(Bt, Pt, {
3293
+ const Ge = await Sn(Lt, zt, {
3287
3294
  headers: Z
3288
3295
  });
3289
3296
  if (!w.current) return;
3290
- Ge.ok ? (xe = C.current) == null || xe.call(C, "success", "提交成功") : (Et = C.current) == null || Et.call(C, "error", $i(Ge.status, Ge.body));
3297
+ Ge.ok ? (Te = C.current) == null || Te.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error", Hi(Ge.status, Ge.body));
3291
3298
  return;
3292
3299
  }
3293
- const zt = Tt({
3300
+ const Ot = xt({
3294
3301
  context: ee,
3295
3302
  payload: e,
3296
3303
  form: g ?? F,
3297
- answer: Pt
3298
- }), Ot = xt(zt);
3299
- if (Ot) {
3300
- (Ut = C.current) == null || Ut.call(C, "error", Ot);
3304
+ answer: zt
3305
+ }), qt = Nt(Ot);
3306
+ if (qt) {
3307
+ (Ut = C.current) == null || Ut.call(C, "error", qt);
3301
3308
  return;
3302
3309
  }
3303
- me([]), O.reportEvent({
3310
+ ue([]), O.reportEvent({
3304
3311
  action: "submit",
3305
3312
  component: "SubmitButton"
3306
3313
  });
3307
- const Nn = await Cn(zt, {
3314
+ const Fn = await An(Ot, {
3308
3315
  headers: Z
3309
3316
  });
3310
3317
  if (!w.current) return;
3311
- const qt = kn(Nn);
3312
- (Rt = C.current) == null || Rt.call(C, qt.type, qt.message);
3313
- } catch (de) {
3318
+ const Bt = Cn(Fn);
3319
+ (wt = C.current) == null || wt.call(C, Bt.type, Bt.message);
3320
+ } catch (me) {
3314
3321
  if (!w.current) return;
3315
- const Ie = de instanceof Error ? de.message : "提交失败";
3316
- (wt = C.current) == null || wt.call(C, "error", Ie);
3322
+ const xe = me instanceof Error ? me.message : "提交失败";
3323
+ (Pt = C.current) == null || Pt.call(C, "error", xe);
3317
3324
  } finally {
3318
3325
  w.current && x(!1);
3319
3326
  }
@@ -3322,8 +3329,8 @@ function Di({
3322
3329
  v,
3323
3330
  W,
3324
3331
  P,
3325
- N,
3326
- me,
3332
+ M,
3333
+ ue,
3327
3334
  O,
3328
3335
  o,
3329
3336
  r,
@@ -3332,22 +3339,22 @@ function Di({
3332
3339
  e,
3333
3340
  g,
3334
3341
  F
3335
- ]), Nt = A(Ke);
3336
- Nt.current = Ke;
3337
- const Ft = $(
3338
- (U) => {
3339
- zi(
3340
- U,
3342
+ ]), Ft = A(Ke);
3343
+ Ft.current = Ke;
3344
+ const Et = $(
3345
+ (R) => {
3346
+ qi(
3347
+ R,
3341
3348
  {
3342
3349
  setValues: (q) => {
3343
3350
  var X;
3344
- return (X = M.current) == null ? void 0 : X.setValues(q);
3351
+ return (X = I.current) == null ? void 0 : X.setValues(q);
3345
3352
  },
3346
3353
  getValues: (q) => {
3347
3354
  var X;
3348
- return ((X = M.current) == null ? void 0 : X.getValues(q)) ?? {};
3355
+ return ((X = I.current) == null ? void 0 : X.getValues(q)) ?? {};
3349
3356
  },
3350
- submit: () => Nt.current(),
3357
+ submit: () => Ft.current(),
3351
3358
  rootElement: _.current
3352
3359
  },
3353
3360
  {
@@ -3363,9 +3370,9 @@ function Di({
3363
3370
  S(null);
3364
3371
  return;
3365
3372
  }
3366
- return S(Ft), () => S(null);
3367
- }, [re, Ft, S]), f ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(mt, { size: "small" }) }) : !F || P.length === 0 ? /* @__PURE__ */ c(
3368
- Vi,
3373
+ return S(Et), () => S(null);
3374
+ }, [re, Et, S]), f ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(mt, { size: "small" }) }) : !F || P.length === 0 ? /* @__PURE__ */ c(
3375
+ $i,
3369
3376
  {
3370
3377
  payload: e,
3371
3378
  callbackUrl: r,
@@ -3374,18 +3381,18 @@ function Di({
3374
3381
  unpublishedFormId: y && D ? D : void 0,
3375
3382
  onNotify: l
3376
3383
  }
3377
- ) : /* @__PURE__ */ I(
3384
+ ) : /* @__PURE__ */ N(
3378
3385
  "div",
3379
3386
  {
3380
3387
  className: "ask-user-form-card",
3381
3388
  ref: _,
3382
3389
  "data-ask-user-message-id": J || void 0,
3383
3390
  children: [
3384
- y && D ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(pe, { title: D, children: /* @__PURE__ */ c(fe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3391
+ y && D ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(de, { title: D, children: /* @__PURE__ */ c(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3385
3392
  /* @__PURE__ */ c(
3386
- Ii,
3393
+ Mi,
3387
3394
  {
3388
- ref: M,
3395
+ ref: I,
3389
3396
  doc: le,
3390
3397
  surfaceId: $e,
3391
3398
  fieldNames: W,
@@ -3396,11 +3403,11 @@ function Di({
3396
3403
  }
3397
3404
  ),
3398
3405
  /* @__PURE__ */ c("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ c(
3399
- pe,
3406
+ de,
3400
3407
  {
3401
3408
  title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
3402
3409
  children: /* @__PURE__ */ c(
3403
- ze,
3410
+ Pe,
3404
3411
  {
3405
3412
  type: "primary",
3406
3413
  size: "small",
@@ -3416,16 +3423,16 @@ function Di({
3416
3423
  }
3417
3424
  );
3418
3425
  }
3419
- function ls(e) {
3426
+ function us(e) {
3420
3427
  var u;
3421
- const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = j(() => Bo(), []), [r, o] = R(!1), i = A(null), s = $((m) => {
3428
+ const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = j(() => Vo(), []), [r, o] = U(!1), i = A(null), s = $((m) => {
3422
3429
  o(m);
3423
3430
  }, []), a = $(
3424
3431
  (m) => {
3425
3432
  i.current = m;
3426
3433
  },
3427
3434
  []
3428
- ), l = j(() => !n || !t ? null : new Ri({
3435
+ ), l = j(() => !n || !t ? null : new Pi({
3429
3436
  url: n,
3430
3437
  askUserMessageId: t,
3431
3438
  onAutoControl: (m) => {
@@ -3440,8 +3447,8 @@ function ls(e) {
3440
3447
  };
3441
3448
  }, [l]), z(() => {
3442
3449
  !l || !r || l.connect();
3443
- }, [l, r]), /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(Rr, { client: l, children: /* @__PURE__ */ c(Nr, { children: /* @__PURE__ */ c(
3444
- Di,
3450
+ }, [l, r]), /* @__PURE__ */ c(he, { children: /* @__PURE__ */ c(wr, { client: l, children: /* @__PURE__ */ c(Fr, { children: /* @__PURE__ */ c(
3451
+ Ki,
3445
3452
  {
3446
3453
  ...e,
3447
3454
  onSurfaceReadyChange: s,
@@ -3450,61 +3457,61 @@ function ls(e) {
3450
3457
  ) }) }) });
3451
3458
  }
3452
3459
  export {
3453
- ns as A2UI_PROTOCOL_VERSION,
3454
- ls as AskUserFormCard,
3460
+ os as A2UI_PROTOCOL_VERSION,
3461
+ us as AskUserFormCard,
3455
3462
  st as CaseSearchProvider,
3456
- Vi as CurlSubmitBlock,
3457
- zo as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
3458
- wo as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
3459
- Po as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
3460
- bt as DEFAULT_AUTH_STORAGE_KEY,
3461
- Ro as DEFAULT_AUTH_TOKEN_FIELD,
3462
- Yn as FORM_MEDIA_SIZES,
3463
+ $i as CurlSubmitBlock,
3464
+ qo as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
3465
+ zo as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
3466
+ Oo as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
3467
+ kt as DEFAULT_AUTH_STORAGE_KEY,
3468
+ Po as DEFAULT_AUTH_TOKEN_FIELD,
3469
+ Qn as FORM_MEDIA_SIZES,
3463
3470
  at as ResumeSearchProvider,
3464
- as as SkoponA2uiStreamRenderer,
3465
- ge as SkoponFormProvider,
3466
- Ii as SkoponFormRenderer,
3467
- yo as a2uiToBlocks,
3468
- pn as blocksToA2ui,
3469
- Tt as buildAnswerAgentBody,
3470
- Eo as buildAskUserCurlBodyJson,
3471
- Uo as buildAskUserCurlStatement,
3472
- rs as buildAskUserSubmitCurlFromPayload,
3473
- bo as buildAskUserSurface,
3474
- yn as buildCurlStatement,
3475
- os as copyTextToClipboard,
3476
- Qo as createCaseSearchClient,
3477
- Lo as createFormClient,
3478
- Go as createResumeSearchClient,
3479
- ss as createSkoponSdkClients,
3480
- yt as extractExtraBlockValues,
3481
- Co as extractSurfaceValues,
3482
- kn as formatAnswerAgentSubmitMessage,
3483
- Fo as getPayloadInputFieldNames,
3484
- No as getPayloadRenderableBlocks,
3485
- xo as intersectPayloadBlocksWithForm,
3471
+ cs as SkoponA2uiStreamRenderer,
3472
+ he as SkoponFormProvider,
3473
+ Mi as SkoponFormRenderer,
3474
+ vo as a2uiToBlocks,
3475
+ fn as blocksToA2ui,
3476
+ xt as buildAnswerAgentBody,
3477
+ Uo as buildAskUserCurlBodyJson,
3478
+ wo as buildAskUserCurlStatement,
3479
+ is as buildAskUserSubmitCurlFromPayload,
3480
+ ko as buildAskUserSurface,
3481
+ vn as buildCurlStatement,
3482
+ ss as copyTextToClipboard,
3483
+ Zo as createCaseSearchClient,
3484
+ jo as createFormClient,
3485
+ Wo as createResumeSearchClient,
3486
+ ls as createSkoponSdkClients,
3487
+ vt as extractExtraBlockValues,
3488
+ Ao as extractSurfaceValues,
3489
+ Cn as formatAnswerAgentSubmitMessage,
3490
+ Ro as getPayloadInputFieldNames,
3491
+ Eo as getPayloadRenderableBlocks,
3492
+ Io as intersectPayloadBlocksWithForm,
3486
3493
  ut as isA2uiSurfaceEmpty,
3487
3494
  ae as isInputBlockType,
3488
- Oe as isLayoutBlockType,
3489
- Ue as isMediaBlockType,
3490
- ko as mapFormDefinitionFromDto,
3491
- ue as normalizeFormDefinition,
3495
+ ze as isLayoutBlockType,
3496
+ Ee as isMediaBlockType,
3497
+ Co as mapFormDefinitionFromDto,
3498
+ Oe as normalizeFormDefinition,
3492
3499
  Be as parsePayloadBlocksJson,
3493
- Mo as payloadHasInputBlocks,
3494
- qo as resolveAnswerAgentCallbackUrl,
3495
- _t as resolveClientHeaders,
3496
- Bo as resolveRealtimeWsUrl,
3497
- Sn as resolveSkoponAuthHeaders,
3498
- At as resolveSubmitAuthHeaders,
3499
- So as resolveSurfaceFromFormDefinition,
3500
- xi as skoponAntdTheme,
3500
+ Fo as payloadHasInputBlocks,
3501
+ Lo as resolveAnswerAgentCallbackUrl,
3502
+ Tt as resolveClientHeaders,
3503
+ Vo as resolveRealtimeWsUrl,
3504
+ bn as resolveSkoponAuthHeaders,
3505
+ _t as resolveSubmitAuthHeaders,
3506
+ bo as resolveSurfaceFromFormDefinition,
3507
+ Ii as skoponAntdTheme,
3501
3508
  oe as skoponBrandColors,
3502
- Cn as submitAnswerAgent,
3503
- vn as submitFormJson,
3504
- vo as surfaceDocToMessages,
3509
+ An as submitAnswerAgent,
3510
+ Sn as submitFormJson,
3511
+ So as surfaceDocToMessages,
3505
3512
  Re as syncFormDefinition,
3506
- zr as useCaseSearch,
3507
- Hr as useResumeSearch,
3508
- xt as validateAnswerAgentBody,
3509
- is as validateAnswerAgentContext
3513
+ Or as useCaseSearch,
3514
+ Kr as useResumeSearch,
3515
+ Nt as validateAnswerAgentBody,
3516
+ as as validateAnswerAgentContext
3510
3517
  };