@skopon-cool/form-sdk 0.4.4 → 0.4.6

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