@skopon-cool/form-sdk 0.4.9 → 0.5.1

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