@skopon-cool/form-sdk 0.4.9 → 0.5.0

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