@skopon-cool/form-sdk 0.1.9 → 0.2.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 (43) hide show
  1. package/README.md +24 -6
  2. package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
  3. package/dist/adapter/formSchema.d.ts.map +1 -1
  4. package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
  5. package/dist/catalog/skoponCaseSelect.d.ts.map +1 -1
  6. package/dist/catalog/skoponResumeSelect.d.ts.map +1 -1
  7. package/dist/catalog/skoponSelectLoading.test.d.ts +2 -0
  8. package/dist/catalog/skoponSelectLoading.test.d.ts.map +1 -0
  9. package/dist/catalog/useSkoponBoundField.d.ts +2 -0
  10. package/dist/catalog/useSkoponBoundField.d.ts.map +1 -1
  11. package/dist/components/AskUserFormCard.d.ts.map +1 -1
  12. package/dist/components/SkoponA2uiStreamRenderer.d.ts.map +1 -1
  13. package/dist/components/SkoponFormProvider.d.ts +11 -0
  14. package/dist/components/SkoponFormProvider.d.ts.map +1 -0
  15. package/dist/components/SkoponFormRenderer.d.ts +2 -0
  16. package/dist/components/SkoponFormRenderer.d.ts.map +1 -1
  17. package/dist/form-sdk.css +1 -1
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +981 -857
  21. package/dist/theme/antd-theme.d.ts +7 -0
  22. package/dist/theme/antd-theme.d.ts.map +1 -0
  23. package/dist/theme/brand-colors.d.ts +19 -0
  24. package/dist/theme/brand-colors.d.ts.map +1 -0
  25. package/package.json +2 -1
  26. package/src/adapter/a2uiAdapter.ts +2 -3
  27. package/src/adapter/formSchema.test.ts +5 -1
  28. package/src/adapter/formSchema.ts +3 -1
  29. package/src/catalog/a2uiCustomCatalog.tsx +15 -1
  30. package/src/catalog/skoponCaseSelect.tsx +2 -1
  31. package/src/catalog/skoponResumeSelect.tsx +1 -0
  32. package/src/catalog/skoponSelectLoading.test.tsx +182 -0
  33. package/src/catalog/useSkoponBoundField.test.ts +14 -1
  34. package/src/catalog/useSkoponBoundField.ts +14 -0
  35. package/src/components/AskUserFormCard.tsx +20 -12
  36. package/src/components/SkoponA2uiStreamRenderer.tsx +5 -2
  37. package/src/components/SkoponFormProvider.tsx +23 -0
  38. package/src/components/SkoponFormRenderer.tsx +17 -2
  39. package/src/index.ts +6 -0
  40. package/src/styles/index.css +4 -3
  41. package/src/styles/tokens.css +224 -0
  42. package/src/theme/antd-theme.ts +93 -0
  43. package/src/theme/brand-colors.ts +18 -0
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import './form-sdk.css';
2
- import { jsx as s, jsxs as C, Fragment as Ye } from "react/jsx-runtime";
3
- import { createContext as ze, useContext as Re, useCallback as Q, useSyncExternalStore as Nt, useMemo as B, useState as U, useRef as q, useEffect as j, forwardRef as It, useImperativeHandle as Mt } from "react";
4
- import { Spin as Oe, Button as fe, Typography as D, Avatar as Ft, Tag as te, Select as Fe, Checkbox as Pt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as zt, Upload as Se, Input as xe, InputNumber as Rt, Tooltip as ee } from "antd";
5
- import { ReloadOutlined as Xe, FileTextOutlined as Ge, UserOutlined as Ot, FileImageOutlined as Bt, FileExcelOutlined as Vt, FileOutlined as We, PictureOutlined as wt, SoundOutlined as qt, VideoCameraOutlined as jt } from "@ant-design/icons";
6
- import { createBinderlessComponentImplementation as V, basicCatalog as ue, A2uiSurface as Ze } from "@a2ui/react/v0_9";
7
- import { z as d } from "zod";
8
- import { Catalog as $t, MessageProcessor as Qe } from "@a2ui/web_core/v0_9";
9
- import { injectBasicCatalogStyles as et } from "@a2ui/web_core/v0_9/basic_catalog";
10
- import { injectStyles as tt } from "@a2ui/react/styles";
11
- import $e from "dayjs";
12
- const oo = "v0.9", Lt = [
2
+ import { jsx as l, jsxs as C } from "react/jsx-runtime";
3
+ import { createContext as we, useContext as Le, useCallback as te, useSyncExternalStore as It, useMemo as V, useState as P, useRef as L, useEffect as B, forwardRef as Ft, useImperativeHandle as Pt } from "react";
4
+ import { Spin as je, Button as ge, Typography as H, Avatar as zt, Tag as re, Select as Ue, Checkbox as Ut, Radio as _t, Switch as Et, TimePicker as Rt, DatePicker as Bt, Upload as ke, Input as Ae, InputNumber as Ot, ConfigProvider as Vt, Tooltip as ne } from "antd";
5
+ import { ReloadOutlined as Ze, FileTextOutlined as et, UserOutlined as qt, FileImageOutlined as wt, FileExcelOutlined as Lt, FileOutlined as tt, PictureOutlined as jt, SoundOutlined as $t, VideoCameraOutlined as Dt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as q, basicCatalog as de, A2uiSurface as nt } from "@a2ui/react/v0_9";
7
+ import { z as f } from "zod";
8
+ import { Catalog as Ht, MessageProcessor as rt } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as ot } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as it } from "@a2ui/react/styles";
11
+ import Ge from "dayjs";
12
+ const so = "v0.9", Kt = [
13
13
  "huge",
14
14
  "large",
15
15
  "medium",
16
16
  "small",
17
17
  "icon"
18
18
  ];
19
- function Pe(e) {
19
+ function _e(e) {
20
20
  return e === "image" || e === "video" || e === "audio";
21
21
  }
22
- function Be(e) {
22
+ function $e(e) {
23
23
  return e === "heading" || e === "paragraph";
24
24
  }
25
- function X(e) {
26
- return !Be(e) && !Pe(e);
25
+ function W(e) {
26
+ return !$e(e) && !_e(e);
27
27
  }
28
- function Dt() {
28
+ function Gt() {
29
29
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
30
30
  return crypto.randomUUID();
31
31
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -39,11 +39,11 @@ function Dt() {
39
39
  return (e === "x" ? t : t & 3 | 8).toString(16);
40
40
  });
41
41
  }
42
- function re(e) {
43
- const t = Dt().replace(/-/g, "").slice(0, 8);
42
+ function ie(e) {
43
+ const t = Gt().replace(/-/g, "").slice(0, 8);
44
44
  return `${e}${t}`;
45
45
  }
46
- const nt = [
46
+ const at = [
47
47
  { value: "image/*", label: "图片" },
48
48
  { value: "video/*", label: "视频" },
49
49
  { value: "audio/*", label: "音频" },
@@ -54,7 +54,7 @@ const nt = [
54
54
  { value: "text/plain", label: "纯文本" },
55
55
  { value: "application/zip", label: "ZIP 压缩包" },
56
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
57
- ], Kt = {
57
+ ], Jt = {
58
58
  "image/*": ["image/*"],
59
59
  "video/*": ["video/*"],
60
60
  "audio/*": ["audio/*"],
@@ -74,7 +74,7 @@ const nt = [
74
74
  "text/plain": ["text/plain"],
75
75
  "application/zip": ["application/zip"],
76
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
77
- }, Jt = {
77
+ }, Yt = {
78
78
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
79
79
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
80
80
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -85,14 +85,14 @@ const nt = [
85
85
  "text/plain": [".txt"],
86
86
  "application/zip": [".zip", ".7z"],
87
87
  "application/x-rar-compressed": [".rar"]
88
- }, Ht = {
88
+ }, Xt = {
89
89
  "application/msword": "office/word",
90
90
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
91
91
  "application/vnd.ms-excel": "office/excel",
92
92
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
93
93
  "application/vnd.ms-powerpoint": "office/ppt",
94
94
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
95
- }, Ve = [
95
+ }, De = [
96
96
  { value: ".jpg", label: ".jpg" },
97
97
  { value: ".jpeg", label: ".jpeg" },
98
98
  { value: ".png", label: ".png" },
@@ -118,121 +118,121 @@ const nt = [
118
118
  { value: ".zip", label: ".zip" },
119
119
  { value: ".rar", label: ".rar" },
120
120
  { value: ".7z", label: ".7z" }
121
- ], Yt = Object.fromEntries(
122
- nt.map((e) => [e.value, e.label])
123
- ), Xt = Object.fromEntries(
124
- Ve.map((e) => [e.value, e.label])
125
- ), Gt = new Set(nt.map((e) => e.value)), Wt = new Set(
126
- Ve.map((e) => e.value)
121
+ ], Wt = Object.fromEntries(
122
+ at.map((e) => [e.value, e.label])
123
+ ), Qt = Object.fromEntries(
124
+ De.map((e) => [e.value, e.label])
125
+ ), Zt = new Set(at.map((e) => e.value)), en = new Set(
126
+ De.map((e) => e.value)
127
127
  );
128
- function Zt(e) {
128
+ function tn(e) {
129
129
  const t = e.trim();
130
- return t ? Gt.has(t) ? t : Ht[t] ?? null : null;
130
+ return t ? Zt.has(t) ? t : Xt[t] ?? null : null;
131
131
  }
132
- function Qt(e) {
132
+ function nn(e) {
133
133
  return Array.isArray(e) ? e.map((t) => {
134
134
  const n = t.trim().toLowerCase();
135
135
  return n ? n.startsWith(".") ? n : `.${n}` : "";
136
136
  }).filter(Boolean) : [];
137
137
  }
138
- function oe(e) {
138
+ function ae(e) {
139
139
  if (!Array.isArray(e)) return [];
140
140
  const t = [], n = /* @__PURE__ */ new Set();
141
141
  for (const r of e) {
142
- const o = Zt(r);
142
+ const o = tn(r);
143
143
  o && !n.has(o) && (n.add(o), t.push(o));
144
144
  }
145
145
  return t;
146
146
  }
147
- function en(e) {
148
- const t = oe(e), n = [];
147
+ function rn(e) {
148
+ const t = ae(e), n = [];
149
149
  for (const r of t)
150
- n.push(...Kt[r] ?? [r]);
150
+ n.push(...Jt[r] ?? [r]);
151
151
  return n;
152
152
  }
153
- function tn(e) {
154
- const t = oe(e);
153
+ function on(e) {
154
+ const t = ae(e);
155
155
  if (t.length === 0) return [];
156
156
  const n = /* @__PURE__ */ new Set();
157
157
  for (const r of t)
158
- for (const o of Jt[r] ?? [])
158
+ for (const o of Yt[r] ?? [])
159
159
  n.add(o);
160
- return Ve.filter((r) => n.has(r.value));
160
+ return De.filter((r) => n.has(r.value));
161
161
  }
162
- function we(e, t) {
163
- const n = Qt(t), r = oe(e);
162
+ function He(e, t) {
163
+ const n = nn(t), r = ae(e);
164
164
  if (r.length === 0)
165
- return n.filter((i) => Wt.has(i));
165
+ return n.filter((i) => en.has(i));
166
166
  const o = new Set(
167
- tn(r).map((i) => i.value)
167
+ on(r).map((i) => i.value)
168
168
  );
169
169
  return n.filter((i) => o.has(i));
170
170
  }
171
- function nn(e, t) {
172
- const n = en(e), r = we(e, t), o = [...n, ...r];
171
+ function an(e, t) {
172
+ const n = rn(e), r = He(e, t), o = [...n, ...r];
173
173
  return o.length > 0 ? o.join(",") : void 0;
174
174
  }
175
- function rn(e, t) {
176
- const n = oe(e), r = we(
175
+ function ln(e, t) {
176
+ const n = ae(e), r = He(
177
177
  n,
178
178
  t
179
179
  ), o = [
180
- ...n.map((i) => Yt[i] ?? i),
181
- ...r.map((i) => Xt[i] ?? i)
180
+ ...n.map((i) => Wt[i] ?? i),
181
+ ...r.map((i) => Qt[i] ?? i)
182
182
  ];
183
183
  return o.length === 0 ? null : o.join("、");
184
184
  }
185
- const on = [
185
+ const sn = [
186
186
  "video",
187
187
  "audio",
188
188
  "image",
189
189
  "file",
190
190
  "spreadsheet",
191
191
  "document"
192
- ], an = new Set(on);
193
- function ln(e) {
194
- return e && an.has(e) ? e : "file";
192
+ ], cn = new Set(sn);
193
+ function un(e) {
194
+ return e && cn.has(e) ? e : "file";
195
195
  }
196
- function ie(e) {
197
- return typeof e == "string" && Lt.includes(e) ? e : "medium";
196
+ function le(e) {
197
+ return typeof e == "string" && Kt.includes(e) ? e : "medium";
198
198
  }
199
- function sn(e, t) {
199
+ function pn(e, t) {
200
200
  var o;
201
201
  const n = Math.max(1, t);
202
202
  let r = [];
203
203
  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);
204
204
  }
205
- function cn(e) {
205
+ function dn(e) {
206
206
  var t;
207
207
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
208
208
  }
209
- function un(e) {
210
- return `form-media-size-${ie(e)}`;
209
+ function mn(e) {
210
+ return `form-media-size-${le(e)}`;
211
211
  }
212
- function pn(e) {
213
- return `form-media-preview form-media-list ${un(e)}`;
212
+ function fn(e) {
213
+ return `form-media-preview form-media-list ${mn(e)}`;
214
214
  }
215
- const mn = 10;
216
- function qe(e) {
217
- return e === !0 || e === "true";
215
+ const hn = 10;
216
+ function ye(e) {
217
+ return e === !0 || e === "true" || e === 1 || e === "1";
218
218
  }
219
- function Le(e, t = 1) {
219
+ function Je(e, t = 1) {
220
220
  const n = typeof e == "number" ? e : Number(e);
221
221
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
222
222
  }
223
- function le(e, t = 1) {
223
+ function ce(e, t = 1) {
224
224
  const n = typeof e == "number" ? e : Number(e);
225
225
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
226
226
  }
227
- function dn(e, t) {
227
+ function gn(e, t) {
228
228
  if (t !== void 0)
229
- return e === "toggle" ? qe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
229
+ return e === "toggle" ? ye(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
230
230
  }
231
- function fn(e) {
232
- 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, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
- return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: l, pageSize: n };
231
+ function yn(e) {
232
+ 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, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
+ return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: s, pageSize: n };
234
234
  }
235
- function hn(e) {
235
+ function vn(e) {
236
236
  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;
237
237
  return {
238
238
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -241,51 +241,51 @@ function hn(e) {
241
241
  pageSize: n
242
242
  };
243
243
  }
244
- function gn(e) {
244
+ function bn(e) {
245
245
  if (e.type !== "case_singleselect") return e;
246
246
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
247
247
  return { ...e, type: "case_multiselect", defaultValue: t };
248
248
  }
249
- function yn(e) {
249
+ function Sn(e) {
250
250
  var o, i;
251
- const t = gn(e), n = oe(t.fileAcceptTypes), r = t.type;
251
+ const t = bn(e), n = ae(t.fileAcceptTypes), r = t.type;
252
252
  return {
253
- id: ((o = t.id) == null ? void 0 : o.trim()) || re("block-"),
253
+ id: ((o = t.id) == null ? void 0 : o.trim()) || ie("block-"),
254
254
  type: r,
255
255
  name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
256
256
  label: t.label ?? "",
257
257
  placeholder: t.placeholder ?? "",
258
258
  help: t.help ?? "",
259
259
  required: t.required === !0,
260
- mediaUrls: Pe(r) ? sn(t, mn) : void 0,
261
- mediaSize: Pe(r) ? ie(t.mediaSize) : void 0,
260
+ mediaUrls: _e(r) ? pn(t, hn) : void 0,
261
+ mediaSize: _e(r) ? le(t.mediaSize) : void 0,
262
262
  fileAcceptTypes: n,
263
- fileAcceptExtensions: we(
263
+ fileAcceptExtensions: He(
264
264
  n,
265
265
  t.fileAcceptExtensions
266
266
  ),
267
- filePlaceholderIcon: ln(t.filePlaceholderIcon),
268
- fileMinCount: r === "file" ? Le(t.fileMinCount, 1) : void 0,
269
- fileMaxCount: r === "file" ? Le(t.fileMaxCount, 1) : void 0,
270
- defaultValue: dn(r, t.defaultValue),
271
- options: Array.isArray(t.options) ? t.options.map((a, l) => {
267
+ filePlaceholderIcon: un(t.filePlaceholderIcon),
268
+ fileMinCount: r === "file" ? Je(t.fileMinCount, 1) : void 0,
269
+ fileMaxCount: r === "file" ? Je(t.fileMaxCount, 1) : void 0,
270
+ defaultValue: gn(r, t.defaultValue),
271
+ options: Array.isArray(t.options) ? t.options.map((a, s) => {
272
272
  var c, u;
273
273
  return {
274
- value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
275
- label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
274
+ value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${s + 1}`,
275
+ label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${s + 1}`
276
276
  };
277
277
  }) : void 0,
278
278
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
279
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? le(t.resumeMinCount, 1) : void 0,
280
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? le(t.resumeMaxCount, 1) : void 0,
281
- resumeFilter: r === "resume_multiselect" ? hn(t.resumeFilter) : void 0,
279
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ce(t.resumeMinCount, 1) : void 0,
280
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ce(t.resumeMaxCount, 1) : void 0,
281
+ resumeFilter: r === "resume_multiselect" ? vn(t.resumeFilter) : void 0,
282
282
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
283
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? le(t.caseMinCount, 1) : void 0,
284
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? le(t.caseMaxCount, 1) : void 0,
285
- caseFilter: r === "case_multiselect" ? fn(t.caseFilter) : void 0
283
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ce(t.caseMinCount, 1) : void 0,
284
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ce(t.caseMaxCount, 1) : void 0,
285
+ caseFilter: r === "case_multiselect" ? yn(t.caseFilter) : void 0
286
286
  };
287
287
  }
288
- function pe(e) {
288
+ function me(e) {
289
289
  return {
290
290
  title: e.title ?? "",
291
291
  description: e.description ?? "",
@@ -293,18 +293,18 @@ function pe(e) {
293
293
  jsonSchema: e.jsonSchema ?? {}
294
294
  };
295
295
  }
296
- function W(e) {
296
+ function Z(e) {
297
297
  if (!e || !Array.isArray(e.blocks))
298
- return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
299
- const t = e.blocks.map(yn);
300
- return pe({
298
+ return me({ title: "", description: "", blocks: [], jsonSchema: {} });
299
+ const t = e.blocks.map(Sn);
300
+ return me({
301
301
  title: typeof e.title == "string" ? e.title : "",
302
302
  description: typeof e.description == "string" ? e.description : "",
303
303
  blocks: t,
304
304
  jsonSchema: {}
305
305
  });
306
306
  }
307
- function vn(e) {
307
+ function xn(e) {
308
308
  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, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
309
309
  return {
310
310
  agentKind: n,
@@ -315,14 +315,14 @@ function vn(e) {
315
315
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
316
316
  };
317
317
  }
318
- function De(e) {
318
+ function Ye(e) {
319
319
  if (e == null) return;
320
320
  const t = typeof e == "number" ? e : Number(e);
321
321
  if (!(!Number.isFinite(t) || t < 1))
322
322
  return Math.floor(t);
323
323
  }
324
- function bn(e, t) {
325
- var a, l, c, u, m, p;
324
+ function Cn(e, t) {
325
+ var a, s, c, u, d, p;
326
326
  const { id: n, label: r, path: o, withData: i } = t;
327
327
  return i({
328
328
  id: n,
@@ -333,10 +333,10 @@ function bn(e, t) {
333
333
  enableRefresh: e.caseEnableRefresh !== !1,
334
334
  caseFilter: {
335
335
  agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
336
- agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
336
+ agentUniqueId: (s = e.caseFilter) == null ? void 0 : s.agentUniqueId,
337
337
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
338
338
  category: (u = e.caseFilter) == null ? void 0 : u.category,
339
- flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
339
+ flowUniqueIds: ((d = e.caseFilter) == null ? void 0 : d.flowUniqueIds) ?? [],
340
340
  pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
341
341
  },
342
342
  ...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
@@ -344,7 +344,7 @@ function bn(e, t) {
344
344
  value: { path: o }
345
345
  });
346
346
  }
347
- function Sn(e, t, n) {
347
+ function kn(e, t, n) {
348
348
  const r = n.nameFromValue(e.value), o = {
349
349
  ...t("case_multiselect"),
350
350
  name: r,
@@ -352,119 +352,122 @@ function Sn(e, t, n) {
352
352
  }, i = n.asLiteral(e.placeholder);
353
353
  i && (o.placeholder = i);
354
354
  const a = n.asLiteral(e.help);
355
- a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = vn(e.caseFilter));
356
- const l = De(e.minCount);
357
- l !== void 0 && (o.caseMinCount = l);
358
- const c = De(e.maxCount);
355
+ a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = xn(e.caseFilter));
356
+ const s = Ye(e.minCount);
357
+ s !== void 0 && (o.caseMinCount = s);
358
+ const c = Ye(e.maxCount);
359
359
  return c !== void 0 && (o.caseMaxCount = c), o;
360
360
  }
361
- const rt = ze({ interactive: !0 });
362
- function ot({
361
+ const lt = we({ interactive: !0 });
362
+ function Ee({
363
363
  interactive: e,
364
364
  children: t
365
365
  }) {
366
- return /* @__PURE__ */ s(rt.Provider, { value: { interactive: e }, children: t });
366
+ return /* @__PURE__ */ l(lt.Provider, { value: { interactive: e }, children: t });
367
367
  }
368
368
  function K() {
369
- return Re(rt);
369
+ return Le(lt);
370
370
  }
371
- function it(e) {
371
+ function st(e) {
372
372
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
373
373
  }
374
- function Ke(e, t = "value") {
374
+ function Xe(e, t = "value") {
375
375
  const r = e.componentModel.properties[t];
376
- if (!(!it(r) || r === void 0))
376
+ if (!(!st(r) || r === void 0))
377
377
  return e.dataContext.resolveDynamicValue(r);
378
378
  }
379
- function J(e, t = "value") {
380
- const r = e.componentModel.properties[t], o = it(r), i = Q(
379
+ function G(e, t = "value") {
380
+ const r = e.componentModel.properties[t], o = st(r), i = te(
381
381
  (u) => {
382
382
  if (!o || r === void 0) return () => {
383
383
  };
384
- const m = e.dataContext.subscribeDynamicValue(r, () => u());
385
- return () => m.unsubscribe();
384
+ const d = e.dataContext.subscribeDynamicValue(r, () => u());
385
+ return () => d.unsubscribe();
386
386
  },
387
387
  [e, r, o]
388
- ), a = Q(() => {
388
+ ), a = te(() => {
389
389
  if (!(!o || r === void 0))
390
390
  return e.dataContext.resolveDynamicValue(r);
391
- }, [e, r, o]), l = Nt(i, a, a), c = Q(
391
+ }, [e, r, o]), s = It(i, a, a), c = te(
392
392
  (u) => {
393
393
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
394
394
  },
395
395
  [e, r, o]
396
396
  );
397
- return { value: l, setValue: c, hasBinding: !!o };
397
+ return { value: s, setValue: c, hasBinding: !!o };
398
398
  }
399
- function ne(e) {
399
+ function oe(e) {
400
400
  if (typeof e == "string") return e || void 0;
401
401
  if (typeof e == "number") return String(e);
402
402
  }
403
- function L(e) {
403
+ function $(e) {
404
404
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
405
405
  }
406
- function me(e) {
406
+ function ct(e, t) {
407
+ return t ? Array.isArray(e) ? null : $(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
408
+ }
409
+ function fe(e) {
407
410
  if (e == null) return;
408
411
  const t = typeof e == "number" ? e : Number(e);
409
412
  if (!(!Number.isFinite(t) || t < 1))
410
413
  return Math.floor(t);
411
414
  }
412
- function at(e, t, n, r) {
415
+ function ut(e, t, n, r) {
413
416
  if (e.includes(t)) {
414
417
  const i = e.filter((a) => a !== t);
415
418
  return n !== void 0 && i.length < n ? null : i;
416
419
  }
417
420
  return r !== void 0 && e.length >= r ? null : [...e, t];
418
421
  }
419
- function lt(e, t, n, r, o) {
422
+ function pt(e, t, n, r, o) {
420
423
  if (!n) return !0;
421
424
  const i = e.includes(t);
422
425
  return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
423
426
  }
424
- function st(e, t) {
427
+ function dt(e, t) {
425
428
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
426
429
  }
427
- const ct = ze(null);
428
- function ut({
430
+ const mt = we(null);
431
+ function Re({
429
432
  caseSearch: e,
430
433
  children: t
431
434
  }) {
432
- return /* @__PURE__ */ s(ct.Provider, { value: e ?? null, children: t });
435
+ return /* @__PURE__ */ l(mt.Provider, { value: e ?? null, children: t });
433
436
  }
434
- function xn() {
435
- return Re(ct);
437
+ function An() {
438
+ return Le(mt);
436
439
  }
437
- function Ce(e) {
440
+ function Te(e) {
438
441
  return typeof e == "string" ? e : "";
439
442
  }
440
- function ke(e) {
443
+ function Me(e) {
441
444
  if (!e || typeof e != "object")
442
445
  return { flowUniqueIds: [], pageSize: 20 };
443
- 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, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
444
- return { agentKind: o, agentUniqueId: i, flowType: a, category: l, flowUniqueIds: c, pageSize: r };
446
+ 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, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, s = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
447
+ return { agentKind: o, agentUniqueId: i, flowType: a, category: s, flowUniqueIds: c, pageSize: r };
445
448
  }
446
- function Ae(e) {
449
+ function Ne(e) {
447
450
  var r;
448
451
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
449
452
  return t || n;
450
453
  }
451
- function Cn(e) {
454
+ function Tn(e) {
452
455
  return JSON.stringify(e);
453
456
  }
454
- const kn = {
457
+ const Mn = {
455
458
  name: "SkoponCaseSelect",
456
- schema: d.object({
457
- label: d.any().optional(),
458
- placeholder: d.any().optional(),
459
- help: d.any().optional(),
460
- enableRefresh: d.any().optional(),
461
- caseFilter: d.any().optional(),
462
- minCount: d.any().optional(),
463
- maxCount: d.any().optional(),
464
- value: d.any().optional()
459
+ schema: f.object({
460
+ label: f.any().optional(),
461
+ placeholder: f.any().optional(),
462
+ help: f.any().optional(),
463
+ enableRefresh: f.any().optional(),
464
+ caseFilter: f.any().optional(),
465
+ minCount: f.any().optional(),
466
+ maxCount: f.any().optional(),
467
+ value: f.any().optional()
465
468
  }).passthrough()
466
469
  };
467
- function An({
470
+ function Nn({
468
471
  item: e,
469
472
  selected: t,
470
473
  disabled: n,
@@ -478,10 +481,10 @@ function An({
478
481
  disabled: n,
479
482
  onClick: r,
480
483
  children: [
481
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Ge, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
484
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(et, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
482
485
  /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
483
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
484
- e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
486
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name }),
487
+ e.description ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
485
488
  /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
486
489
  e.caseUniqueId,
487
490
  e.platform ? ` · ${e.platform}` : "",
@@ -492,105 +495,105 @@ function An({
492
495
  }
493
496
  );
494
497
  }
495
- function Tn({ context: e }) {
496
- const { interactive: t } = K(), n = xn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Ce(i.label), l = Ce(i.placeholder), c = Ce(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => ke(i.caseFilter), [i.caseFilter]), v = Cn(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
497
- j(() => {
498
- const b = st(O, p);
498
+ function In({ context: e }) {
499
+ const { interactive: t } = K(), n = An(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Te(i.label), s = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), v = V(() => Me(i.caseFilter), [i.caseFilter]), g = Tn(v), [A, E] = P(1), [T, m] = P(!1), [h, x] = P(""), [y, S] = P([]), [N, _] = P(0), [j, Q] = P(v.pageSize ?? 20), w = L(0), O = $(r);
500
+ B(() => {
501
+ const b = dt(O, p);
499
502
  b !== null && o(b);
500
503
  }, [p, O, o]);
501
- const H = B(() => n ? Ae(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), Y = Q(
504
+ const J = V(() => n ? Ne(v) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, v, h, s]), Y = te(
502
505
  async (b) => {
503
- const F = ke(JSON.parse(v)), R = ++w.current;
504
- if (!n || !Ae(F)) {
505
- S([]), z(0), x("");
506
+ const I = Me(JSON.parse(g)), R = ++w.current;
507
+ if (!n || !Ne(I)) {
508
+ S([]), _(0), x(""), m(!1);
506
509
  return;
507
510
  }
508
- f(!0), x("");
511
+ m(!0), x("");
509
512
  try {
510
- const N = await n({ filter: F, page: b });
513
+ const M = await n({ filter: I, page: b });
511
514
  if (R !== w.current) return;
512
- S(N.list), z(N.total), T(N.page), G(N.pageSize);
513
- } catch (N) {
515
+ S(M.list), _(M.total), E(M.page), Q(M.pageSize);
516
+ } catch (M) {
514
517
  if (R !== w.current) return;
515
- S([]), z(0), x(N instanceof Error ? N.message : "加载案例列表失败");
518
+ S([]), _(0), x(M instanceof Error ? M.message : "加载案例列表失败");
516
519
  } finally {
517
- R === w.current && f(!1);
520
+ R === w.current && m(!1);
518
521
  }
519
522
  },
520
- [n, v]
523
+ [n, g]
521
524
  );
522
- j(() => {
523
- T(1), Y(1);
524
- }, [v, Y]);
525
- const P = (b) => {
525
+ B(() => {
526
+ E(1), Y(1);
527
+ }, [g, Y]);
528
+ const F = (b) => {
526
529
  if (!t) return;
527
- const F = at(
530
+ const I = ut(
528
531
  O,
529
532
  b,
530
- m,
533
+ d,
531
534
  p
532
535
  );
533
- F !== null && o(F);
534
- }, _ = () => {
535
- const b = ke(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
536
- Y(N);
536
+ I !== null && o(I);
537
+ }, z = () => {
538
+ const b = Me(JSON.parse(g)), I = j || b.pageSize || 20, R = Math.max(1, Math.ceil(N / I)), M = A >= R ? 1 : A + 1;
539
+ Y(M);
537
540
  };
538
541
  return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
539
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
540
- k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
541
- /* @__PURE__ */ s(Oe, { size: "small" }),
542
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
543
+ T && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
544
+ /* @__PURE__ */ l(je, { size: "small" }),
542
545
  " 加载案例…"
543
546
  ] }) : null,
544
- !k && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: H }) : null,
545
- y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
546
- An,
547
+ !T && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
548
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
549
+ Nn,
547
550
  {
548
551
  item: b,
549
552
  selected: O.includes(b.caseUniqueId),
550
- disabled: lt(
553
+ disabled: pt(
551
554
  O,
552
555
  b.caseUniqueId,
553
556
  t,
554
- m,
557
+ d,
555
558
  p
556
559
  ),
557
- onToggle: () => P(b.caseUniqueId)
560
+ onToggle: () => F(b.caseUniqueId)
558
561
  },
559
562
  b.caseUniqueId
560
563
  )) }) : null,
561
- u && n && Ae(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
562
- fe,
564
+ u && n && Ne(v) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
565
+ ge,
563
566
  {
564
567
  type: "default",
565
568
  size: "small",
566
- icon: /* @__PURE__ */ s(Xe, {}),
567
- loading: k,
569
+ icon: /* @__PURE__ */ l(Ze, {}),
570
+ loading: T,
568
571
  disabled: !t,
569
- onClick: _,
572
+ onClick: z,
570
573
  children: "换一批"
571
574
  }
572
575
  ) }) : null,
573
- c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
576
+ c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
574
577
  ] });
575
578
  }
576
- const Nn = V(
577
- kn,
578
- Tn
579
- ), In = {
579
+ const Fn = q(
580
+ Mn,
581
+ In
582
+ ), Pn = {
580
583
  type: "case_multiselect",
581
584
  componentName: "SkoponCaseSelect",
582
- toComponent: bn,
583
- fromComponent: Sn,
584
- catalogComponents: [Nn]
585
+ toComponent: Cn,
586
+ fromComponent: kn,
587
+ catalogComponents: [Fn]
585
588
  };
586
- function Je(e) {
589
+ function We(e) {
587
590
  if (e == null) return;
588
591
  const t = typeof e == "number" ? e : Number(e);
589
592
  if (!(!Number.isFinite(t) || t < 1))
590
593
  return Math.floor(t);
591
594
  }
592
- function Mn(e, t) {
593
- var a, l, c, u;
595
+ function zn(e, t) {
596
+ var a, s, c, u;
594
597
  const { id: n, label: r, path: o, withData: i } = t;
595
598
  return i({
596
599
  id: n,
@@ -601,7 +604,7 @@ function Mn(e, t) {
601
604
  enableRefresh: e.resumeEnableRefresh !== !1,
602
605
  resumeFilter: {
603
606
  names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
604
- agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
607
+ agentUniqueIds: ((s = e.resumeFilter) == null ? void 0 : s.agentUniqueIds) ?? [],
605
608
  resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
606
609
  pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
607
610
  },
@@ -610,7 +613,7 @@ function Mn(e, t) {
610
613
  value: { path: o }
611
614
  });
612
615
  }
613
- function Fn(e, t, n) {
616
+ function Un(e, t, n) {
614
617
  const r = n.nameFromValue(e.value), o = {
615
618
  ...t("resume_multiselect"),
616
619
  name: r,
@@ -627,78 +630,78 @@ function Fn(e, t, n) {
627
630
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
628
631
  };
629
632
  }
630
- const l = Je(e.minCount);
631
- l !== void 0 && (o.resumeMinCount = l);
632
- const c = Je(e.maxCount);
633
+ const s = We(e.minCount);
634
+ s !== void 0 && (o.resumeMinCount = s);
635
+ const c = We(e.maxCount);
633
636
  return c !== void 0 && (o.resumeMaxCount = c), o;
634
637
  }
635
- const pt = ze(null);
636
- function mt({
638
+ const ft = we(null);
639
+ function Be({
637
640
  resumeSearch: e,
638
641
  children: t
639
642
  }) {
640
- return /* @__PURE__ */ s(pt.Provider, { value: e ?? null, children: t });
643
+ return /* @__PURE__ */ l(ft.Provider, { value: e ?? null, children: t });
641
644
  }
642
- function Pn() {
643
- return Re(pt);
645
+ function _n() {
646
+ return Le(ft);
644
647
  }
645
- function Te(e) {
648
+ function Ie(e) {
646
649
  return typeof e == "string" ? e : "";
647
650
  }
648
- function Ne(e) {
651
+ function Fe(e) {
649
652
  if (!e || typeof e != "object")
650
653
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
651
654
  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), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
652
655
  return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
653
656
  }
654
- function Un(e) {
657
+ function En(e) {
655
658
  return JSON.stringify(e);
656
659
  }
657
- const _n = {
660
+ const Rn = {
658
661
  name: "SkoponResumeSelect",
659
- schema: d.object({
660
- label: d.any().optional(),
661
- placeholder: d.any().optional(),
662
- help: d.any().optional(),
663
- enableRefresh: d.any().optional(),
664
- resumeFilter: d.any().optional(),
665
- minCount: d.any().optional(),
666
- maxCount: d.any().optional(),
667
- value: d.any().optional()
662
+ schema: f.object({
663
+ label: f.any().optional(),
664
+ placeholder: f.any().optional(),
665
+ help: f.any().optional(),
666
+ enableRefresh: f.any().optional(),
667
+ resumeFilter: f.any().optional(),
668
+ minCount: f.any().optional(),
669
+ maxCount: f.any().optional(),
670
+ value: f.any().optional()
668
671
  }).passthrough()
669
- }, En = 3, zn = 2;
670
- function Ie(e, t) {
671
- const n = (t ?? []).filter(Boolean), r = n.slice(0, En), o = n.length - r.length;
672
+ }, Bn = 3, On = 2;
673
+ function Pe(e, t) {
674
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Bn), o = n.length - r.length;
672
675
  return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
673
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
676
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: e }),
674
677
  n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
675
- r.map((i) => /* @__PURE__ */ s(te, { className: "skopon-resume-select-card-tag", children: i }, i)),
676
- o > 0 ? /* @__PURE__ */ C(te, { className: "skopon-resume-select-card-tag", children: [
678
+ r.map((i) => /* @__PURE__ */ l(re, { className: "skopon-resume-select-card-tag", children: i }, i)),
679
+ o > 0 ? /* @__PURE__ */ C(re, { className: "skopon-resume-select-card-tag", children: [
677
680
  "+",
678
681
  o
679
682
  ] }) : null
680
- ] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
683
+ ] }) : /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
681
684
  ] });
682
685
  }
683
- function Rn(e) {
686
+ function Vn(e) {
684
687
  return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
685
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
686
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
688
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
689
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
687
690
  ] });
688
691
  }
689
- function On({ work: e }) {
692
+ function qn({ work: e }) {
690
693
  return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
691
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Bt, { className: "skopon-resume-select-card-work-placeholder" }) }),
692
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
694
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(wt, { className: "skopon-resume-select-card-work-placeholder" }) }),
695
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
693
696
  ] });
694
697
  }
695
- function Bn({
698
+ function wn({
696
699
  item: e,
697
700
  selected: t,
698
701
  disabled: n,
699
702
  onToggle: r
700
703
  }) {
701
- const o = (e.works ?? []).slice(0, zn);
704
+ const o = (e.works ?? []).slice(0, On);
702
705
  return /* @__PURE__ */ C(
703
706
  "button",
704
707
  {
@@ -707,183 +710,183 @@ function Bn({
707
710
  disabled: n,
708
711
  onClick: r,
709
712
  children: [
710
- /* @__PURE__ */ s(
711
- Ft,
713
+ /* @__PURE__ */ l(
714
+ zt,
712
715
  {
713
716
  size: 48,
714
717
  src: e.avatarUrl || void 0,
715
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ot, {}),
718
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(qt, {}),
716
719
  className: "skopon-resume-select-card-avatar"
717
720
  }
718
721
  ),
719
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
722
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
720
723
  /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
721
- Rn(e.satisfaction),
722
- Ie("性格", e.personality),
723
- Ie("专长", e.specialties),
724
- Ie("擅长领域", e.traits),
724
+ Vn(e.satisfaction),
725
+ Pe("性格", e.personality),
726
+ Pe("专长", e.specialties),
727
+ Pe("擅长领域", e.traits),
725
728
  /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
726
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
727
- o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ s(On, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
729
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
730
+ o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(qn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
728
731
  ] })
729
732
  ] })
730
733
  ]
731
734
  }
732
735
  );
733
736
  }
734
- function Vn({ context: e }) {
735
- const { interactive: t } = K(), n = Pn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Te(i.label), l = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => Ne(i.resumeFilter), [i.resumeFilter]), v = Un(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
736
- j(() => {
737
- const b = st(O, p);
737
+ function Ln({ context: e }) {
738
+ const { interactive: t } = K(), n = _n(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ie(i.label), s = Ie(i.placeholder), c = Ie(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), v = V(() => Fe(i.resumeFilter), [i.resumeFilter]), g = En(v), [A, E] = P(1), [T, m] = P(!1), [h, x] = P(""), [y, S] = P([]), [N, _] = P(0), [j, Q] = P(v.pageSize ?? 20), w = L(0), O = $(r);
739
+ B(() => {
740
+ const b = dt(O, p);
738
741
  b !== null && o(b);
739
742
  }, [p, O, o]);
740
- const H = Q(
743
+ const J = te(
741
744
  async (b) => {
742
- const F = Ne(JSON.parse(v)), R = ++w.current;
745
+ const I = Fe(JSON.parse(g)), R = ++w.current;
743
746
  if (!n) {
744
- S([]), z(0), x("未配置简历搜索服务");
747
+ S([]), _(0), x("未配置简历搜索服务"), m(!1);
745
748
  return;
746
749
  }
747
- f(!0), x("");
750
+ m(!0), x("");
748
751
  try {
749
- const N = await n({ filter: F, page: b });
752
+ const M = await n({ filter: I, page: b });
750
753
  if (R !== w.current) return;
751
- S(N.list), z(N.total), T(N.page), G(N.pageSize);
752
- } catch (N) {
754
+ S(M.list), _(M.total), E(M.page), Q(M.pageSize);
755
+ } catch (M) {
753
756
  if (R !== w.current) return;
754
- S([]), z(0), x(N instanceof Error ? N.message : "加载简历列表失败");
757
+ S([]), _(0), x(M instanceof Error ? M.message : "加载简历列表失败");
755
758
  } finally {
756
- R === w.current && f(!1);
759
+ R === w.current && m(!1);
757
760
  }
758
761
  },
759
- [n, v]
762
+ [n, g]
760
763
  );
761
- j(() => {
762
- T(1), H(1);
763
- }, [v, H]);
764
+ B(() => {
765
+ E(1), J(1);
766
+ }, [g, J]);
764
767
  const Y = (b) => {
765
768
  if (!t) return;
766
- const F = at(
769
+ const I = ut(
767
770
  O,
768
771
  b,
769
- m,
772
+ d,
770
773
  p
771
774
  );
772
- F !== null && o(F);
773
- }, P = () => {
774
- const b = Ne(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
775
- H(N);
776
- }, _ = l || "暂无匹配的简历";
775
+ I !== null && o(I);
776
+ }, F = () => {
777
+ const b = Fe(JSON.parse(g)), I = j || b.pageSize || 20, R = Math.max(1, Math.ceil(N / I)), M = A >= R ? 1 : A + 1;
778
+ J(M);
779
+ }, z = s || "暂无匹配的简历";
777
780
  return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
778
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
779
- k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
780
- /* @__PURE__ */ s(Oe, { size: "small" }),
781
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
782
+ T && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
783
+ /* @__PURE__ */ l(je, { size: "small" }),
781
784
  " 加载简历…"
782
785
  ] }) : null,
783
- !k && h ? /* @__PURE__ */ s(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
784
- !k && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
785
- y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
786
- Bn,
786
+ !T && h ? /* @__PURE__ */ l(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
787
+ !T && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: z }) : null,
788
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
789
+ wn,
787
790
  {
788
791
  item: b,
789
792
  selected: O.includes(b.resumeUniqueId),
790
- disabled: lt(
793
+ disabled: pt(
791
794
  O,
792
795
  b.resumeUniqueId,
793
796
  t,
794
- m,
797
+ d,
795
798
  p
796
799
  ),
797
800
  onToggle: () => Y(b.resumeUniqueId)
798
801
  },
799
802
  b.resumeUniqueId
800
803
  )) }) : null,
801
- u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
802
- fe,
804
+ u && n ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
805
+ ge,
803
806
  {
804
807
  type: "default",
805
808
  size: "small",
806
- icon: /* @__PURE__ */ s(Xe, {}),
807
- loading: k,
809
+ icon: /* @__PURE__ */ l(Ze, {}),
810
+ loading: T,
808
811
  disabled: !t,
809
- onClick: P,
812
+ onClick: F,
810
813
  children: "换一批"
811
814
  }
812
815
  ) }) : null,
813
- c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
816
+ c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
814
817
  ] });
815
818
  }
816
- const wn = V(
817
- _n,
818
- Vn
819
- ), qn = {
819
+ const jn = q(
820
+ Rn,
821
+ Ln
822
+ ), $n = {
820
823
  type: "resume_multiselect",
821
824
  componentName: "SkoponResumeSelect",
822
- toComponent: Mn,
823
- fromComponent: Fn,
824
- catalogComponents: [wn]
825
- }, he = [qn, In], jn = new Map(
826
- he.map((e) => [e.type, e])
827
- ), $n = new Map(
828
- he.map((e) => [e.componentName, e])
825
+ toComponent: zn,
826
+ fromComponent: Un,
827
+ catalogComponents: [jn]
828
+ }, ve = [$n, Pn], Dn = new Map(
829
+ ve.map((e) => [e.type, e])
830
+ ), Hn = new Map(
831
+ ve.map((e) => [e.componentName, e])
829
832
  );
830
- function Ln(e) {
831
- return jn.get(e);
833
+ function Kn(e) {
834
+ return Dn.get(e);
832
835
  }
833
- function Dn(e) {
834
- return $n.get(e);
835
- }
836
- function Kn() {
837
- return he.flatMap((e) => e.catalogComponents);
836
+ function Gn(e) {
837
+ return Hn.get(e);
838
838
  }
839
839
  function Jn() {
840
- return he.map((e) => e.componentName);
840
+ return ve.flatMap((e) => e.catalogComponents);
841
+ }
842
+ function Yn() {
843
+ return ve.map((e) => e.componentName);
841
844
  }
842
- const de = "root", Ue = "__title__", _e = "__desc__", dt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
843
- function Hn(e) {
845
+ const he = "root", Oe = "__title__", Ve = "__desc__", ht = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
846
+ function Xn(e) {
844
847
  return `/${e}`;
845
848
  }
846
- function He(e) {
849
+ function Qe(e) {
847
850
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
848
851
  }
849
- function E(e) {
852
+ function U(e) {
850
853
  if (typeof e == "string") return e;
851
854
  }
852
- function Yn(e) {
853
- const t = e.id || re("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
855
+ function Wn(e) {
856
+ const t = e.id || ie("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
854
857
  return {
855
858
  id: t,
856
859
  component: "SkoponMedia",
857
860
  mediaType: n,
858
- urls: cn(e),
859
- mediaSize: ie(e.mediaSize),
861
+ urls: dn(e),
862
+ mediaSize: le(e.mediaSize),
860
863
  label: e.label ?? "",
861
864
  help: e.help ?? "",
862
865
  placeholder: e.placeholder ?? ""
863
866
  };
864
867
  }
865
- function Xn(e) {
868
+ function Qn(e) {
866
869
  if (Array.isArray(e.urls))
867
870
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
868
- const t = E(e.url);
871
+ const t = U(e.url);
869
872
  return t != null && t.trim() ? [t.trim()] : [];
870
873
  }
871
- function se(e, t, n) {
872
- const r = typeof e.id == "string" ? e.id : re("block-"), o = Xn(e), i = E(e.label) ?? E(e.description) ?? n, a = E(e.help), l = E(e.placeholder), c = ie(e.mediaSize);
874
+ function ue(e, t, n) {
875
+ const r = typeof e.id == "string" ? e.id : ie("block-"), o = Qn(e), i = U(e.label) ?? U(e.description) ?? n, a = U(e.help), s = U(e.placeholder), c = le(e.mediaSize);
873
876
  return {
874
877
  id: r,
875
878
  type: t,
876
879
  label: i,
877
880
  ...a ? { help: a } : {},
878
- ...l ? { placeholder: l } : {},
881
+ ...s ? { placeholder: s } : {},
879
882
  mediaSize: c,
880
883
  mediaUrls: o.length > 0 ? o : [""]
881
884
  };
882
885
  }
883
- function Gn(e) {
886
+ function Zn(e) {
884
887
  switch (e.type) {
885
888
  case "toggle":
886
- return qe(e.defaultValue);
889
+ return ye(e.defaultValue);
887
890
  case "multiselect":
888
891
  case "checkbox":
889
892
  case "resume_multiselect":
@@ -897,11 +900,11 @@ function Gn(e) {
897
900
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
898
901
  }
899
902
  }
900
- function Wn(e) {
903
+ function er(e) {
901
904
  var u;
902
- const t = e.id || re("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Hn(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: Gn(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: a }, c = Ln(e.type);
905
+ const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Xn(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: Zn(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = Kn(e.type);
903
906
  if (c)
904
- return c.toComponent(e, l);
907
+ return c.toComponent(e, s);
905
908
  switch (e.type) {
906
909
  case "heading":
907
910
  return { node: { id: t, component: "Text", text: n, variant: "h3" } };
@@ -924,7 +927,7 @@ function Wn(e) {
924
927
  component: "TextField",
925
928
  label: n,
926
929
  variant: "shortText",
927
- validationRegexp: dt,
930
+ validationRegexp: ht,
928
931
  ...e.placeholder ? { placeholder: e.placeholder } : {},
929
932
  value: { path: o }
930
933
  });
@@ -1010,7 +1013,7 @@ function Wn(e) {
1010
1013
  case "image":
1011
1014
  case "video":
1012
1015
  case "audio":
1013
- return { node: Yn(e) };
1016
+ return { node: Wn(e) };
1014
1017
  case "file":
1015
1018
  return a({
1016
1019
  id: t,
@@ -1027,31 +1030,31 @@ function Wn(e) {
1027
1030
  return { node: null };
1028
1031
  }
1029
1032
  }
1030
- function Ee(e) {
1033
+ function qe(e) {
1031
1034
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1032
- const t = e.components.find((r) => r.id === de);
1035
+ const t = e.components.find((r) => r.id === he);
1033
1036
  if (!t) return e.components.length === 0;
1034
1037
  const n = t.children;
1035
1038
  return !Array.isArray(n) || n.length === 0;
1036
1039
  }
1037
- function ft(e, t) {
1038
- const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
1039
- i && a && (n.push({ id: Ue, component: "Text", text: a, variant: "h2" }), r.push(Ue)), i && l && (n.push({ id: _e, component: "Text", text: l, variant: "body" }), r.push(_e));
1040
- for (const m of e.blocks ?? []) {
1041
- const { node: p, dataKey: g, dataValue: v } = Wn(m);
1042
- p && (n.push(p), r.push(p.id), g && (o[g] = v));
1040
+ function gt(e, t) {
1041
+ const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), s = (e.description ?? "").trim();
1042
+ i && a && (n.push({ id: Oe, component: "Text", text: a, variant: "h2" }), r.push(Oe)), i && s && (n.push({ id: Ve, component: "Text", text: s, variant: "body" }), r.push(Ve));
1043
+ for (const d of e.blocks ?? []) {
1044
+ const { node: p, dataKey: v, dataValue: g } = er(d);
1045
+ p && (n.push(p), r.push(p.id), v && (o[v] = g));
1043
1046
  }
1044
- n.unshift({ id: de, component: "Column", children: r });
1045
- const c = { root: de, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1047
+ n.unshift({ id: he, component: "Column", children: r });
1048
+ const c = { root: he, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1046
1049
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
1047
1050
  }
1048
- function Zn(e) {
1051
+ function tr(e) {
1049
1052
  const t = /* @__PURE__ */ new Map();
1050
1053
  for (const n of e.components ?? [])
1051
1054
  n && typeof n.id == "string" && t.set(n.id, n);
1052
1055
  return t;
1053
1056
  }
1054
- function Me(e) {
1057
+ function ze(e) {
1055
1058
  const t = e.options;
1056
1059
  return Array.isArray(t) ? t.map((n) => {
1057
1060
  if (!n || typeof n != "object") return null;
@@ -1062,21 +1065,21 @@ function Me(e) {
1062
1065
  };
1063
1066
  }).filter((n) => !!n) : [];
1064
1067
  }
1065
- function Qn(e) {
1066
- const t = typeof e.id == "string" ? e.id : re("block-"), n = String(e.component ?? ""), r = E(e.label) ?? E(e.text) ?? "", o = He(e.value), i = (l) => ({ id: t, type: l, label: r }), a = Dn(n);
1068
+ function nr(e) {
1069
+ const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = U(e.label) ?? U(e.text) ?? "", o = Qe(e.value), i = (s) => ({ id: t, type: s, label: r }), a = Gn(n);
1067
1070
  if (a)
1068
- return a.fromComponent(e, i, { asLiteral: E, nameFromValue: He });
1071
+ return a.fromComponent(e, i, { asLiteral: U, nameFromValue: Qe });
1069
1072
  switch (n) {
1070
1073
  case "Text": {
1071
- const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
1074
+ const s = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(s) || s === "title" || s === "subtitle";
1072
1075
  return { id: t, type: c ? "heading" : "paragraph", label: r };
1073
1076
  }
1074
1077
  case "TextField": {
1075
- const l = String(e.variant ?? "shortText");
1078
+ const s = String(e.variant ?? "shortText");
1076
1079
  let c = "text";
1077
- l === "longText" ? c = "textarea" : l === "number" ? c = "number" : E(e.validationRegexp) === dt && (c = "email");
1078
- const u = { ...i(c), name: o }, m = E(e.placeholder);
1079
- return m && (u.placeholder = m), u;
1080
+ s === "longText" ? c = "textarea" : s === "number" ? c = "number" : U(e.validationRegexp) === ht && (c = "email");
1081
+ const u = { ...i(c), name: o }, d = U(e.placeholder);
1082
+ return d && (u.placeholder = d), u;
1080
1083
  }
1081
1084
  case "CheckBox":
1082
1085
  return { ...i("toggle"), name: o };
@@ -1084,46 +1087,46 @@ function Qn(e) {
1084
1087
  const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
1085
1088
  ...i(c),
1086
1089
  name: o,
1087
- options: Me(e)
1088
- }, m = E(e.placeholder);
1089
- return m && (u.placeholder = m), u;
1090
+ options: ze(e)
1091
+ }, d = U(e.placeholder);
1092
+ return d && (u.placeholder = d), u;
1090
1093
  }
1091
1094
  case "ChoicePicker": {
1092
- const l = E(e.skoponPickerType);
1093
- if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
1094
- const m = {
1095
- ...i(l),
1095
+ const s = U(e.skoponPickerType);
1096
+ if (s === "select" || s === "multiselect" || s === "radio" || s === "checkbox") {
1097
+ const d = {
1098
+ ...i(s),
1096
1099
  name: o,
1097
- options: Me(e)
1098
- }, p = E(e.placeholder);
1099
- return p && (m.placeholder = p), m;
1100
+ options: ze(e)
1101
+ }, p = U(e.placeholder);
1102
+ return p && (d.placeholder = p), d;
1100
1103
  }
1101
1104
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1102
- return { ...i(u), name: o, options: Me(e) };
1105
+ return { ...i(u), name: o, options: ze(e) };
1103
1106
  }
1104
1107
  case "DateTimeInput": {
1105
- const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...i(!l && c ? "time" : "datetime"), name: o }, p = E(e.placeholder);
1106
- return p && (m.placeholder = p), m;
1108
+ const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, p = U(e.placeholder);
1109
+ return p && (d.placeholder = p), d;
1107
1110
  }
1108
1111
  case "SkoponMedia": {
1109
- const l = String(e.mediaType ?? "image");
1110
- return se(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1112
+ const s = String(e.mediaType ?? "image");
1113
+ return ue(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1111
1114
  }
1112
1115
  case "Image":
1113
- return se(e, "image", r);
1116
+ return ue(e, "image", r);
1114
1117
  case "Video":
1115
- return se(e, "video", r);
1118
+ return ue(e, "video", r);
1116
1119
  case "AudioPlayer":
1117
- return se(e, "audio", r);
1120
+ return ue(e, "audio", r);
1118
1121
  case "FileUpload": {
1119
- const l = E(e.accept) ?? "", c = { ...i("file"), name: o };
1120
- return l && (c.fileAcceptExtensions = l.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1122
+ const s = U(e.accept) ?? "", c = { ...i("file"), name: o };
1123
+ return s && (c.fileAcceptExtensions = s.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1121
1124
  }
1122
1125
  default:
1123
1126
  return null;
1124
1127
  }
1125
1128
  }
1126
- function ht(e, t, n, r) {
1129
+ function yt(e, t, n, r) {
1127
1130
  if (n.has(e)) return;
1128
1131
  n.add(e);
1129
1132
  const o = t.get(e);
@@ -1131,47 +1134,47 @@ function ht(e, t, n, r) {
1131
1134
  const i = String(o.component ?? "");
1132
1135
  if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1133
1136
  for (const a of o.children)
1134
- typeof a == "string" && ht(a, t, n, r);
1137
+ typeof a == "string" && yt(a, t, n, r);
1135
1138
  return;
1136
1139
  }
1137
1140
  r.push(o);
1138
1141
  }
1139
- function er(e, t) {
1142
+ function rr(e, t) {
1140
1143
  return t ? e.map((n) => {
1141
1144
  var i;
1142
1145
  const r = (i = n.name) == null ? void 0 : i.trim();
1143
1146
  if (!r || !(r in t)) return n;
1144
1147
  const o = t[r];
1145
- return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1148
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: ye(o) } : { ...n, defaultValue: o };
1146
1149
  }) : e;
1147
1150
  }
1148
- function tr(e) {
1151
+ function or(e) {
1149
1152
  if (!e || !Array.isArray(e.components))
1150
- return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
1151
- const t = Zn(e), n = [];
1152
- ht(e.root ?? de, t, /* @__PURE__ */ new Set(), n);
1153
+ return me({ title: "", description: "", blocks: [], jsonSchema: {} });
1154
+ const t = tr(e), n = [];
1155
+ yt(e.root ?? he, t, /* @__PURE__ */ new Set(), n);
1153
1156
  let r = "", o = "";
1154
1157
  const i = [];
1155
1158
  for (const a of n) {
1156
- if (a.id === Ue) {
1157
- r = E(a.text) ?? r;
1159
+ if (a.id === Oe) {
1160
+ r = U(a.text) ?? r;
1158
1161
  continue;
1159
1162
  }
1160
- if (a.id === _e) {
1161
- o = E(a.text) ?? o;
1163
+ if (a.id === Ve) {
1164
+ o = U(a.text) ?? o;
1162
1165
  continue;
1163
1166
  }
1164
- const l = Qn(a);
1165
- l && i.push(l);
1167
+ const s = nr(a);
1168
+ s && i.push(s);
1166
1169
  }
1167
- return pe({
1170
+ return me({
1168
1171
  title: r,
1169
1172
  description: o,
1170
- blocks: er(i, e.dataModel),
1173
+ blocks: rr(i, e.dataModel),
1171
1174
  jsonSchema: {}
1172
1175
  });
1173
1176
  }
1174
- function nr(e, t) {
1177
+ function ir(e, t) {
1175
1178
  const { surfaceId: n, catalogId: r } = t, o = [
1176
1179
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1177
1180
  {
@@ -1184,24 +1187,24 @@ function nr(e, t) {
1184
1187
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1185
1188
  }), o;
1186
1189
  }
1187
- function gt(e) {
1190
+ function vt(e) {
1188
1191
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1189
1192
  }
1190
- function rr(e, t) {
1193
+ function ar(e, t) {
1191
1194
  if (!e || typeof e != "object") return null;
1192
- const n = e, r = gt(n.a2ui) ? n.a2ui : void 0;
1193
- if (r && !Ee(r)) return r;
1195
+ const n = e, r = vt(n.a2ui) ? n.a2ui : void 0;
1196
+ if (r && !qe(r)) return r;
1194
1197
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1195
1198
  if (o.length === 0) return null;
1196
- const i = W({
1199
+ const i = Z({
1197
1200
  title: typeof n.title == "string" ? n.title : "",
1198
1201
  description: typeof n.description == "string" ? n.description : "",
1199
1202
  blocks: o
1200
- }), a = ft(i, t);
1201
- return Ee(a) ? null : a;
1203
+ }), a = gt(i, t);
1204
+ return qe(a) ? null : a;
1202
1205
  }
1203
- function or(e, t, n) {
1204
- return ft(
1206
+ function lr(e, t, n) {
1207
+ return gt(
1205
1208
  {
1206
1209
  title: e.title,
1207
1210
  description: e.description,
@@ -1210,17 +1213,17 @@ function or(e, t, n) {
1210
1213
  n
1211
1214
  );
1212
1215
  }
1213
- function ir(e) {
1216
+ function sr(e) {
1214
1217
  if (!e || typeof e != "object" || Array.isArray(e))
1215
1218
  return;
1216
1219
  const t = e;
1217
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gt(t.a2ui) ? tr(t.a2ui) : W({
1220
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && vt(t.a2ui) ? or(t.a2ui) : Z({
1218
1221
  title: typeof t.title == "string" ? t.title : "",
1219
1222
  description: typeof t.description == "string" ? t.description : "",
1220
1223
  blocks: Array.isArray(t.blocks) ? t.blocks : []
1221
1224
  });
1222
1225
  }
1223
- function ar(e, t, n) {
1226
+ function cr(e, t, n) {
1224
1227
  const r = e.model.surfacesMap.get(t);
1225
1228
  if (!r) return {};
1226
1229
  const o = {};
@@ -1230,68 +1233,68 @@ function ar(e, t, n) {
1230
1233
  }
1231
1234
  return o;
1232
1235
  }
1233
- function lr(e) {
1234
- return W({
1236
+ function ur(e) {
1237
+ return Z({
1235
1238
  title: "",
1236
1239
  description: "",
1237
1240
  blocks: [e]
1238
1241
  }).blocks[0];
1239
1242
  }
1240
- function sr(e, t) {
1243
+ function pr(e, t) {
1241
1244
  var o, i;
1242
1245
  const n = /* @__PURE__ */ new Map();
1243
1246
  for (const a of t) {
1244
- const l = (o = a.name) == null ? void 0 : o.trim();
1245
- l && n.set(l, a);
1247
+ const s = (o = a.name) == null ? void 0 : o.trim();
1248
+ s && n.set(s, a);
1246
1249
  }
1247
1250
  const r = [];
1248
1251
  for (const a of e.blocks) {
1249
- if (Be(a.type)) {
1250
- r.push(lr(a));
1252
+ if ($e(a.type)) {
1253
+ r.push(ur(a));
1251
1254
  continue;
1252
1255
  }
1253
- if (!X(a.type)) continue;
1254
- const l = (i = a.name) == null ? void 0 : i.trim();
1255
- if (!l) continue;
1256
- const c = n.get(l);
1256
+ if (!W(a.type)) continue;
1257
+ const s = (i = a.name) == null ? void 0 : i.trim();
1258
+ if (!s) continue;
1259
+ const c = n.get(s);
1257
1260
  c && r.push(c);
1258
1261
  }
1259
1262
  return r;
1260
1263
  }
1261
- function cr(e, t) {
1264
+ function dr(e, t) {
1262
1265
  var r;
1263
1266
  const n = {
1264
1267
  ...e,
1265
1268
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1266
1269
  };
1267
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), W({
1270
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), Z({
1268
1271
  title: "",
1269
1272
  description: "",
1270
1273
  blocks: [n]
1271
1274
  }).blocks[0];
1272
1275
  }
1273
- function yt(e) {
1276
+ function bt(e) {
1274
1277
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1275
1278
  const t = e;
1276
- return Array.isArray(t.blocks) ? W({
1279
+ return Array.isArray(t.blocks) ? Z({
1277
1280
  title: typeof t.title == "string" ? t.title : "",
1278
1281
  description: typeof t.description == "string" ? t.description : "",
1279
1282
  blocks: t.blocks
1280
1283
  }) : null;
1281
1284
  }
1282
- function ur(e, t) {
1283
- var i, a, l, c, u, m;
1285
+ function mr(e, t) {
1286
+ var i, a, s, c, u, d;
1284
1287
  const n = /* @__PURE__ */ new Map();
1285
1288
  for (const p of (t == null ? void 0 : t.blocks) ?? [])
1286
- X(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1289
+ W(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1287
1290
  const r = [], o = [];
1288
1291
  for (const p of e.blocks) {
1289
- if (!X(p.type)) continue;
1290
- const g = (a = p.name) == null ? void 0 : a.trim();
1291
- if (!g) continue;
1292
- const v = n.get(g);
1293
- v ? r.push(cr(v, p)) : o.push(
1294
- W({
1292
+ if (!W(p.type)) continue;
1293
+ const v = (a = p.name) == null ? void 0 : a.trim();
1294
+ if (!v) continue;
1295
+ const g = n.get(v);
1296
+ g ? r.push(dr(g, p)) : o.push(
1297
+ Z({
1295
1298
  title: "",
1296
1299
  description: "",
1297
1300
  blocks: [p]
@@ -1301,80 +1304,80 @@ function ur(e, t) {
1301
1304
  return {
1302
1305
  matchedBlocks: r,
1303
1306
  extraBlocks: o,
1304
- renderBlocks: sr(e, r),
1305
- title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1306
- description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
1307
+ renderBlocks: pr(e, r),
1308
+ title: ((s = e.title) == null ? void 0 : s.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1309
+ description: ((u = e.description) == null ? void 0 : u.trim()) || ((d = t == null ? void 0 : t.description) == null ? void 0 : d.trim()) || ""
1307
1310
  };
1308
1311
  }
1309
- function pr(e) {
1312
+ function fr(e) {
1310
1313
  const { type: t, defaultValue: n } = e;
1311
1314
  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 : "";
1312
1315
  }
1313
- function vt(e) {
1316
+ function St(e) {
1314
1317
  var n;
1315
1318
  const t = {};
1316
1319
  for (const r of e) {
1317
- if (!X(r.type)) continue;
1320
+ if (!W(r.type)) continue;
1318
1321
  const o = (n = r.name) == null ? void 0 : n.trim();
1319
- o && (t[o] = pr(r));
1322
+ o && (t[o] = fr(r));
1320
1323
  }
1321
1324
  return t;
1322
1325
  }
1323
- function mr(e) {
1326
+ function hr(e) {
1324
1327
  return e.blocks.some(
1325
1328
  (t) => {
1326
1329
  var n;
1327
- return X(t.type) && !!((n = t.name) != null && n.trim());
1330
+ return W(t.type) && !!((n = t.name) != null && n.trim());
1328
1331
  }
1329
1332
  );
1330
1333
  }
1331
- function dr(e) {
1334
+ function gr(e) {
1332
1335
  return e.blocks.filter((t) => {
1333
1336
  var n;
1334
- return Be(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
1337
+ return $e(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1335
1338
  });
1336
1339
  }
1337
- function fr(e) {
1340
+ function yr(e) {
1338
1341
  return e.blocks.filter((t) => {
1339
1342
  var n;
1340
- return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1343
+ return W(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1341
1344
  }).map((t) => t.name.trim());
1342
1345
  }
1343
- function bt(e) {
1346
+ function xt(e) {
1344
1347
  return e.replace(/'/g, "'\\''");
1345
1348
  }
1346
- function St(e, t) {
1349
+ function Ct(e, t) {
1347
1350
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1348
1351
  return [
1349
1352
  `curl -X POST '${n}' \\`,
1350
1353
  " -H 'Content-Type: application/json' \\",
1351
- ` -d '${bt(r)}'`
1354
+ ` -d '${xt(r)}'`
1352
1355
  ].join(`
1353
1356
  `);
1354
1357
  }
1355
- function hr(e, t) {
1358
+ function vr(e, t) {
1356
1359
  return JSON.stringify({ ...e, ...t }, null, 2);
1357
1360
  }
1358
- function xt({
1361
+ function kt({
1359
1362
  cardValues: e,
1360
1363
  extraValues: t = {},
1361
1364
  callbackUrl: n
1362
1365
  }) {
1363
- const r = (n ?? "").trim() || "<callback_url>", o = hr(e, t);
1366
+ const r = (n ?? "").trim() || "<callback_url>", o = vr(e, t);
1364
1367
  return [
1365
1368
  `curl -X POST '${r}' \\`,
1366
1369
  " -H 'Content-Type: application/json' \\",
1367
- ` -d '${bt(o)}'`
1370
+ ` -d '${xt(o)}'`
1368
1371
  ].join(`
1369
1372
  `);
1370
1373
  }
1371
- function gr(e, t) {
1372
- const n = yt(e);
1373
- if (!n) return St(e, t);
1374
- const r = vt(n.blocks);
1375
- return xt({ cardValues: r, callbackUrl: t });
1374
+ function br(e, t) {
1375
+ const n = bt(e);
1376
+ if (!n) return Ct(e, t);
1377
+ const r = St(n.blocks);
1378
+ return kt({ cardValues: r, callbackUrl: t });
1376
1379
  }
1377
- async function yr(e, t, n) {
1380
+ async function Sr(e, t, n) {
1378
1381
  const r = e.trim();
1379
1382
  if (!r)
1380
1383
  throw new Error("callback_url 为空");
@@ -1401,7 +1404,7 @@ async function yr(e, t, n) {
1401
1404
  }
1402
1405
  return { ok: i.ok, status: i.status, body: a };
1403
1406
  }
1404
- async function Ct(e) {
1407
+ async function At(e) {
1405
1408
  var n;
1406
1409
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1407
1410
  await navigator.clipboard.writeText(e);
@@ -1417,7 +1420,7 @@ async function Ct(e) {
1417
1420
  document.body.removeChild(t);
1418
1421
  }
1419
1422
  }
1420
- async function vr(e) {
1423
+ async function xr(e) {
1421
1424
  let t;
1422
1425
  try {
1423
1426
  t = await e.json();
@@ -1430,7 +1433,7 @@ async function vr(e) {
1430
1433
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1431
1434
  return t.data;
1432
1435
  }
1433
- function io(e = {}) {
1436
+ function co(e = {}) {
1434
1437
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1435
1438
  async function o(i) {
1436
1439
  var p;
@@ -1441,35 +1444,35 @@ function io(e = {}) {
1441
1444
  a.set("form_unique_id", i.formUniqueId);
1442
1445
  else
1443
1446
  throw new Error("form_id 或 form_unique_id 至少传一个");
1444
- const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1447
+ const s = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1445
1448
  method: "GET",
1446
- headers: l
1447
- }), u = await vr(c), m = ir(u.form_definition);
1449
+ headers: s
1450
+ }), u = await xr(c), d = sr(u.form_definition);
1448
1451
  return {
1449
1452
  formUniqueId: u.form_unique_id,
1450
1453
  formId: u.form_id,
1451
1454
  disabled: u.disabled === 1,
1452
- formDefinition: m,
1453
- a2ui: rr(u.form_definition) ?? void 0
1455
+ formDefinition: d,
1456
+ a2ui: ar(u.form_definition) ?? void 0
1454
1457
  };
1455
1458
  }
1456
1459
  return { fetchDetail: o };
1457
1460
  }
1458
- const br = {
1459
- video: jt,
1460
- audio: qt,
1461
- image: wt,
1462
- file: We,
1463
- spreadsheet: Vt,
1464
- document: Ge
1461
+ const Cr = {
1462
+ video: Dt,
1463
+ audio: $t,
1464
+ image: jt,
1465
+ file: tt,
1466
+ spreadsheet: Lt,
1467
+ document: et
1465
1468
  };
1466
- function Sr({
1469
+ function kr({
1467
1470
  type: e,
1468
1471
  size: t = 40,
1469
1472
  className: n
1470
1473
  }) {
1471
- const r = br[e] ?? We;
1472
- return /* @__PURE__ */ s(
1474
+ const r = Cr[e] ?? tt;
1475
+ return /* @__PURE__ */ l(
1473
1476
  r,
1474
1477
  {
1475
1478
  className: n ?? "skopon-form-file-placeholder-icon",
@@ -1478,7 +1481,7 @@ function Sr({
1478
1481
  }
1479
1482
  );
1480
1483
  }
1481
- const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
1484
+ const Tt = "skopon-form-v0_9", Ar = /* @__PURE__ */ new Set([
1482
1485
  "SkoponMedia",
1483
1486
  "SkoponSelect",
1484
1487
  "Image",
@@ -1490,24 +1493,24 @@ const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
1490
1493
  "FileUpload",
1491
1494
  "TextField",
1492
1495
  "Text",
1493
- ...Jn()
1494
- ]), Cr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1495
- function ae(e) {
1496
- const t = [...ue.components.values()].find((n) => n.name === e);
1496
+ ...Yn()
1497
+ ]), Tr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1498
+ function se(e) {
1499
+ const t = [...de.components.values()].find((n) => n.name === e);
1497
1500
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
1498
1501
  return t.schema;
1499
1502
  }
1500
- function A(e) {
1503
+ function k(e) {
1501
1504
  return typeof e == "string" ? e : "";
1502
1505
  }
1503
- function At(e) {
1506
+ function Mt(e) {
1504
1507
  return Array.isArray(e) ? e.map((t) => {
1505
1508
  if (!t || typeof t != "object") return null;
1506
1509
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
1507
1510
  return { value: r, label: o };
1508
1511
  }).filter((t) => !!t) : [];
1509
1512
  }
1510
- function ge({
1513
+ function be({
1511
1514
  mediaType: e,
1512
1515
  urls: t,
1513
1516
  mediaSize: n,
@@ -1515,86 +1518,89 @@ function ge({
1515
1518
  help: o,
1516
1519
  placeholder: i
1517
1520
  }) {
1518
- const a = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = pn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1521
+ const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = fn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1519
1522
  return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1520
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1521
- t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
1523
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
1524
+ t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ l(
1522
1525
  "img",
1523
1526
  {
1524
- src: m,
1527
+ src: d,
1525
1528
  alt: a || "图片",
1526
1529
  className: "form-media-item"
1527
1530
  },
1528
1531
  `media-${p}`
1529
- ) : e === "video" ? /* @__PURE__ */ s(
1532
+ ) : e === "video" ? /* @__PURE__ */ l(
1530
1533
  "video",
1531
1534
  {
1532
- src: m,
1535
+ src: d,
1533
1536
  controls: !0,
1534
1537
  className: "form-media-item"
1535
1538
  },
1536
1539
  `media-${p}`
1537
- ) : /* @__PURE__ */ s(
1540
+ ) : /* @__PURE__ */ l(
1538
1541
  "audio",
1539
1542
  {
1540
- src: m,
1543
+ src: d,
1541
1544
  controls: !0,
1542
1545
  className: "form-media-item form-media-item--audio"
1543
1546
  },
1544
1547
  `media-${p}`
1545
1548
  )) }),
1546
- l ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1549
+ s ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
1547
1550
  ] });
1548
1551
  }
1549
- function ye(e, t) {
1550
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
1552
+ function Se(e, t) {
1553
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : k(e.url).trim() ? [k(e.url).trim()] : [];
1551
1554
  return {
1552
1555
  mediaType: t,
1553
1556
  urls: n,
1554
- mediaSize: ie(e.mediaSize),
1555
- label: A(e.label) || A(e.description),
1556
- help: A(e.help),
1557
- placeholder: A(e.placeholder)
1557
+ mediaSize: le(e.mediaSize),
1558
+ label: k(e.label) || k(e.description),
1559
+ help: k(e.help),
1560
+ placeholder: k(e.placeholder)
1558
1561
  };
1559
1562
  }
1560
- const kr = {
1563
+ const Mr = {
1561
1564
  name: "SkoponMedia",
1562
- schema: d.object({
1563
- mediaType: d.any().optional(),
1564
- urls: d.any().optional(),
1565
- mediaSize: d.any().optional(),
1566
- label: d.any().optional(),
1567
- help: d.any().optional(),
1568
- placeholder: d.any().optional()
1565
+ schema: f.object({
1566
+ mediaType: f.any().optional(),
1567
+ urls: f.any().optional(),
1568
+ mediaSize: f.any().optional(),
1569
+ label: f.any().optional(),
1570
+ help: f.any().optional(),
1571
+ placeholder: f.any().optional()
1569
1572
  }).passthrough()
1570
- }, Ar = V(kr, ({ context: e }) => {
1571
- const t = e.componentModel.properties, n = A(t.mediaType);
1572
- return /* @__PURE__ */ s(ge, { ...ye(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1573
- }), Tr = V(
1574
- { name: "Image", schema: ae("Image") },
1575
- ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "image") })
1576
- ), Nr = V(
1577
- { name: "Video", schema: ae("Video") },
1578
- ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "video") })
1579
- ), Ir = V(
1580
- { name: "AudioPlayer", schema: ae("AudioPlayer") },
1581
- ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "audio") })
1582
- ), Mr = {
1573
+ }, Nr = q(Mr, ({ context: e }) => {
1574
+ const t = e.componentModel.properties, n = k(t.mediaType);
1575
+ return /* @__PURE__ */ l(be, { ...Se(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1576
+ }), Ir = q(
1577
+ { name: "Image", schema: se("Image") },
1578
+ ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "image") })
1579
+ ), Fr = q(
1580
+ { name: "Video", schema: se("Video") },
1581
+ ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "video") })
1582
+ ), Pr = q(
1583
+ { name: "AudioPlayer", schema: se("AudioPlayer") },
1584
+ ({ context: e }) => /* @__PURE__ */ l(be, { ...Se(e.componentModel.properties, "audio") })
1585
+ ), zr = {
1583
1586
  name: "SkoponSelect",
1584
- schema: d.object({
1585
- label: d.any().optional(),
1586
- mode: d.any().optional(),
1587
- placeholder: d.any().optional(),
1588
- options: d.any().optional(),
1589
- value: d.any().optional()
1587
+ schema: f.object({
1588
+ label: f.any().optional(),
1589
+ mode: f.any().optional(),
1590
+ placeholder: f.any().optional(),
1591
+ options: f.any().optional(),
1592
+ value: f.any().optional()
1590
1593
  }).passthrough()
1591
1594
  };
1592
- function Fr({ context: e }) {
1593
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = At(o.options), c = A(o.mode) === "multiple";
1594
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1595
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1596
- /* @__PURE__ */ s(
1597
- Fe,
1595
+ function Ur({ context: e }) {
1596
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = Mt(o.options), c = k(o.mode) === "multiple";
1597
+ return B(() => {
1598
+ const u = ct(n, c);
1599
+ u !== null && r(u);
1600
+ }, [c, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1601
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1602
+ /* @__PURE__ */ l(
1603
+ Ue,
1598
1604
  {
1599
1605
  mode: c ? "multiple" : void 0,
1600
1606
  disabled: !t,
@@ -1602,23 +1608,26 @@ function Fr({ context: e }) {
1602
1608
  className: "form-block-preview-control",
1603
1609
  style: { width: "100%" },
1604
1610
  placeholder: a || (c ? "请选择多项" : "请选择"),
1605
- options: l,
1606
- value: c ? L(n) : ne(n),
1611
+ options: s,
1612
+ value: c ? $(n) : oe(n),
1607
1613
  onChange: (u) => r(c ? u ?? [] : u ?? "")
1608
1614
  }
1609
1615
  )
1610
1616
  ] });
1611
1617
  }
1612
- const Pr = V(
1613
- Mr,
1614
- Fr
1618
+ const _r = q(
1619
+ zr,
1620
+ Ur
1615
1621
  );
1616
- function Ur({ context: e }) {
1617
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", l = A(o.skoponPickerType), c = A(o.placeholder), u = At(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
1618
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1619
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1620
- p === "select" ? /* @__PURE__ */ s(
1621
- Fe,
1622
+ function Er({ context: e }) {
1623
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.variant) || "mutuallyExclusive", s = k(o.skoponPickerType), c = k(o.placeholder), u = Mt(o.options), p = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio", v = p === "multiselect" || p === "checkbox";
1624
+ return B(() => {
1625
+ const g = ct(n, v);
1626
+ g !== null && r(g);
1627
+ }, [v, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1628
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1629
+ p === "select" ? /* @__PURE__ */ l(
1630
+ Ue,
1622
1631
  {
1623
1632
  disabled: !t,
1624
1633
  allowClear: !0,
@@ -1626,11 +1635,11 @@ function Ur({ context: e }) {
1626
1635
  style: { width: "100%" },
1627
1636
  placeholder: c || "请选择",
1628
1637
  options: u,
1629
- value: ne(n),
1638
+ value: oe(n),
1630
1639
  onChange: (g) => r(g ?? "")
1631
1640
  }
1632
- ) : p === "multiselect" ? /* @__PURE__ */ s(
1633
- Fe,
1641
+ ) : p === "multiselect" ? /* @__PURE__ */ l(
1642
+ Ue,
1634
1643
  {
1635
1644
  mode: "multiple",
1636
1645
  disabled: !t,
@@ -1639,284 +1648,389 @@ function Ur({ context: e }) {
1639
1648
  style: { width: "100%" },
1640
1649
  placeholder: c || "请选择多项",
1641
1650
  options: u,
1642
- value: L(n),
1651
+ value: $(n),
1643
1652
  onChange: (g) => r(g ?? [])
1644
1653
  }
1645
- ) : p === "checkbox" ? /* @__PURE__ */ s(
1646
- Pt.Group,
1654
+ ) : p === "checkbox" ? /* @__PURE__ */ l(
1655
+ Ut.Group,
1647
1656
  {
1648
1657
  disabled: !t,
1649
1658
  className: "form-block-preview-control",
1650
1659
  options: u,
1651
- value: L(n),
1660
+ value: $(n),
1652
1661
  onChange: (g) => r(g)
1653
1662
  }
1654
- ) : /* @__PURE__ */ s(
1655
- Ut.Group,
1663
+ ) : /* @__PURE__ */ l(
1664
+ _t.Group,
1656
1665
  {
1657
1666
  disabled: !t,
1658
1667
  className: "form-block-preview-control",
1659
1668
  options: u,
1660
- value: ne(n),
1669
+ value: oe(n),
1661
1670
  onChange: (g) => r(g.target.value)
1662
1671
  }
1663
1672
  )
1664
1673
  ] });
1665
1674
  }
1666
- const _r = V(
1675
+ const Rr = q(
1667
1676
  {
1668
1677
  name: "ChoicePicker",
1669
- schema: d.object({
1670
- label: d.any().optional(),
1671
- variant: d.any().optional(),
1672
- options: d.any().optional(),
1673
- value: d.any().optional(),
1674
- skoponPickerType: d.any().optional(),
1675
- placeholder: d.any().optional()
1678
+ schema: f.object({
1679
+ label: f.any().optional(),
1680
+ variant: f.any().optional(),
1681
+ options: f.any().optional(),
1682
+ value: f.any().optional(),
1683
+ skoponPickerType: f.any().optional(),
1684
+ placeholder: f.any().optional()
1676
1685
  }).passthrough()
1677
1686
  },
1678
- Ur
1687
+ Er
1679
1688
  );
1680
- function Er({ context: e }) {
1681
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label);
1689
+ function Br({ context: e }) {
1690
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label);
1682
1691
  return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1683
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1684
- /* @__PURE__ */ s(
1685
- _t,
1692
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1693
+ /* @__PURE__ */ l(
1694
+ Et,
1686
1695
  {
1687
1696
  disabled: !t,
1688
1697
  className: "form-block-preview-control",
1689
- checked: qe(n),
1698
+ checked: ye(n),
1690
1699
  onChange: (a) => r(a)
1691
1700
  }
1692
1701
  )
1693
1702
  ] });
1694
1703
  }
1695
- const zr = V(
1696
- { name: "CheckBox", schema: ae("CheckBox") },
1697
- Er
1704
+ const Or = q(
1705
+ { name: "CheckBox", schema: se("CheckBox") },
1706
+ Br
1698
1707
  );
1699
- function Rr(e, t, n) {
1700
- const r = ne(e);
1708
+ function Vr(e, t, n) {
1709
+ const r = oe(e);
1701
1710
  if (!r) return;
1702
1711
  if (!t && n) {
1703
- const i = $e(r, "HH:mm", !0);
1712
+ const i = Ge(r, "HH:mm", !0);
1704
1713
  return i.isValid() ? i : void 0;
1705
1714
  }
1706
- const o = $e(r);
1715
+ const o = Ge(r);
1707
1716
  return o.isValid() ? o : void 0;
1708
1717
  }
1709
- function Or({ context: e }) {
1710
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Rr(n, l, c), m = (p) => {
1718
+ function qr({ context: e }) {
1719
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = Vr(n, s, c), d = (p) => {
1711
1720
  if (!p) {
1712
1721
  r("");
1713
1722
  return;
1714
1723
  }
1715
- if (!l && c) {
1724
+ if (!s && c) {
1716
1725
  r(p.format("HH:mm"));
1717
1726
  return;
1718
1727
  }
1719
- if (l && c) {
1728
+ if (s && c) {
1720
1729
  r(p.format("YYYY-MM-DDTHH:mm"));
1721
1730
  return;
1722
1731
  }
1723
1732
  r(p.format("YYYY-MM-DD"));
1724
1733
  };
1725
1734
  return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1726
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1727
- !l && c ? /* @__PURE__ */ s(
1728
- Et,
1735
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1736
+ !s && c ? /* @__PURE__ */ l(
1737
+ Rt,
1729
1738
  {
1730
1739
  disabled: !t,
1731
1740
  className: "form-block-preview-control",
1732
1741
  style: { width: "100%" },
1733
1742
  placeholder: a || "选择时间",
1734
1743
  value: u,
1735
- onChange: m
1744
+ onChange: d
1736
1745
  }
1737
- ) : /* @__PURE__ */ s(
1738
- zt,
1746
+ ) : /* @__PURE__ */ l(
1747
+ Bt,
1739
1748
  {
1740
- showTime: l && c,
1749
+ showTime: s && c,
1741
1750
  disabled: !t,
1742
1751
  className: "form-block-preview-control",
1743
1752
  style: { width: "100%" },
1744
- placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
1753
+ placeholder: a || (s && c ? "选择日期时间" : "选择日期"),
1745
1754
  value: u,
1746
- onChange: m
1755
+ onChange: d
1747
1756
  }
1748
1757
  )
1749
1758
  ] });
1750
1759
  }
1751
- const Br = V(
1760
+ const wr = q(
1752
1761
  {
1753
1762
  name: "DateTimeInput",
1754
- schema: d.object({
1755
- label: d.any().optional(),
1756
- enableDate: d.any().optional(),
1757
- enableTime: d.any().optional(),
1758
- placeholder: d.any().optional(),
1759
- value: d.any().optional(),
1760
- min: d.any().optional(),
1761
- max: d.any().optional()
1763
+ schema: f.object({
1764
+ label: f.any().optional(),
1765
+ enableDate: f.any().optional(),
1766
+ enableTime: f.any().optional(),
1767
+ placeholder: f.any().optional(),
1768
+ value: f.any().optional(),
1769
+ min: f.any().optional(),
1770
+ max: f.any().optional()
1762
1771
  }).passthrough()
1763
1772
  },
1764
- Or
1765
- ), Vr = {
1773
+ qr
1774
+ ), Lr = {
1766
1775
  name: "FileUpload",
1767
- schema: d.object({
1768
- label: d.any().optional(),
1769
- accept: d.any().optional(),
1770
- fileAcceptTypes: d.any().optional(),
1771
- filePlaceholderIcon: d.any().optional(),
1772
- minCount: d.any().optional(),
1773
- maxCount: d.any().optional(),
1774
- value: d.any().optional()
1776
+ schema: f.object({
1777
+ label: f.any().optional(),
1778
+ accept: f.any().optional(),
1779
+ fileAcceptTypes: f.any().optional(),
1780
+ filePlaceholderIcon: f.any().optional(),
1781
+ minCount: f.any().optional(),
1782
+ maxCount: f.any().optional(),
1783
+ value: f.any().optional()
1775
1784
  }).passthrough()
1776
1785
  };
1777
- function wr({ context: e }) {
1778
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = rn(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1786
+ function jr({ context: e }) {
1787
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((m) => m.trim()).filter(Boolean) : void 0, u = ln(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1779
1788
  o.filePlaceholderIcon
1780
- ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, I = L(n), T = v && I.length >= g, k = I.length < p;
1789
+ ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, v = typeof o.maxCount == "number" ? o.maxCount : 1, g = v > 0, A = $(n), E = g && A.length >= v, T = A.length < p;
1781
1790
  return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1782
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1791
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1783
1792
  /* @__PURE__ */ C(
1784
- Se.Dragger,
1793
+ ke.Dragger,
1785
1794
  {
1786
- disabled: !t || T,
1787
- accept: nn(l, c),
1795
+ disabled: !t || E,
1796
+ accept: an(s, c),
1788
1797
  className: "form-file-upload-preview",
1789
- showUploadList: t && I.length > 0,
1790
- fileList: t ? I.map((f, h) => ({
1791
- uid: `${h}-${f}`,
1792
- name: f,
1798
+ showUploadList: t && A.length > 0,
1799
+ fileList: t ? A.map((m, h) => ({
1800
+ uid: `${h}-${m}`,
1801
+ name: m,
1793
1802
  status: "done"
1794
1803
  })) : [],
1795
- beforeUpload: (f) => {
1796
- if (!t) return Se.LIST_IGNORE;
1797
- const h = L(Ke(e));
1798
- if (v && h.length >= g) return Se.LIST_IGNORE;
1799
- const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
1804
+ beforeUpload: (m) => {
1805
+ if (!t) return ke.LIST_IGNORE;
1806
+ const h = $(Xe(e));
1807
+ if (g && h.length >= v) return ke.LIST_IGNORE;
1808
+ const x = g ? [...h, m.name].slice(0, v) : [...h, m.name];
1800
1809
  return r(x), !1;
1801
1810
  },
1802
- onRemove: (f) => {
1803
- const h = L(Ke(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((M, z) => z !== y) : h.filter((M) => M !== f.name);
1811
+ onRemove: (m) => {
1812
+ const h = $(Xe(e)), x = /^(\d+)-/.exec(m.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((N, _) => _ !== y) : h.filter((N) => N !== m.name);
1804
1813
  if (S.length < p) return !1;
1805
1814
  r(S);
1806
1815
  },
1807
1816
  children: [
1808
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(Sr, { type: m, size: 40 }) }),
1809
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1817
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(kr, { type: d, size: 40 }) }),
1818
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1810
1819
  ]
1811
1820
  }
1812
1821
  ),
1813
- /* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
1822
+ /* @__PURE__ */ C(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
1814
1823
  "允许:",
1815
1824
  u ?? "全部类型",
1816
1825
  p > 0 ? `;至少 ${p} 个文件` : "",
1817
- v ? `;最多 ${g} 个文件` : "",
1818
- k && t ? `(当前 ${I.length} 个,未达下限)` : ""
1826
+ g ? `;最多 ${v} 个文件` : "",
1827
+ ";当前仅收集文件名(不含文件内容,需宿主另行上传)",
1828
+ T && t ? `(当前 ${A.length} 个,未达下限)` : ""
1819
1829
  ] })
1820
1830
  ] });
1821
1831
  }
1822
- const qr = V(
1823
- Vr,
1824
- wr
1832
+ const $r = q(
1833
+ Lr,
1834
+ jr
1825
1835
  );
1826
- function jr({ context: e }) {
1827
- const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = A(o.variant) || "shortText", c = ne(n) ?? "", u = !t, m = "form-block-preview-control";
1836
+ function Dr({ context: e }) {
1837
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = k(o.label), a = k(o.placeholder), s = k(o.variant) || "shortText", c = oe(n) ?? "", u = !t, d = "form-block-preview-control";
1828
1838
  let p;
1829
- if (l === "longText")
1830
- p = /* @__PURE__ */ s(
1831
- xe.TextArea,
1839
+ if (s === "longText")
1840
+ p = /* @__PURE__ */ l(
1841
+ Ae.TextArea,
1832
1842
  {
1833
1843
  disabled: u,
1834
- className: m,
1844
+ className: d,
1835
1845
  placeholder: a || "长文本回答...",
1836
1846
  autoSize: { minRows: 2, maxRows: 6 },
1837
1847
  value: c,
1838
- onChange: (g) => r(g.target.value)
1848
+ onChange: (v) => r(v.target.value)
1839
1849
  }
1840
1850
  );
1841
- else if (l === "number") {
1842
- const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1843
- p = /* @__PURE__ */ s(
1844
- Rt,
1851
+ else if (s === "number") {
1852
+ const v = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1853
+ p = /* @__PURE__ */ l(
1854
+ Ot,
1845
1855
  {
1846
1856
  disabled: u,
1847
- className: m,
1857
+ className: d,
1848
1858
  style: { width: "100%" },
1849
1859
  placeholder: a || "数字",
1850
- value: g,
1851
- onChange: (v) => r(v == null ? "" : String(v))
1860
+ value: v,
1861
+ onChange: (g) => r(g == null ? "" : String(g))
1852
1862
  }
1853
1863
  );
1854
- } else l === "obscured" ? p = /* @__PURE__ */ s(
1855
- xe.Password,
1864
+ } else s === "obscured" ? p = /* @__PURE__ */ l(
1865
+ Ae.Password,
1856
1866
  {
1857
1867
  disabled: u,
1858
- className: m,
1868
+ className: d,
1859
1869
  placeholder: a,
1860
1870
  value: c,
1861
- onChange: (g) => r(g.target.value)
1871
+ onChange: (v) => r(v.target.value)
1862
1872
  }
1863
- ) : p = /* @__PURE__ */ s(
1864
- xe,
1873
+ ) : p = /* @__PURE__ */ l(
1874
+ Ae,
1865
1875
  {
1866
1876
  disabled: u,
1867
- className: m,
1877
+ className: d,
1868
1878
  placeholder: a,
1869
1879
  value: c,
1870
- onChange: (g) => r(g.target.value)
1880
+ onChange: (v) => r(v.target.value)
1871
1881
  }
1872
1882
  );
1873
1883
  return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1874
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1884
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1875
1885
  p
1876
1886
  ] });
1877
1887
  }
1878
- const $r = V(
1888
+ const Hr = q(
1879
1889
  {
1880
1890
  name: "TextField",
1881
- schema: d.object({
1882
- label: d.any().optional(),
1883
- variant: d.any().optional(),
1884
- placeholder: d.any().optional(),
1885
- validationRegexp: d.any().optional(),
1886
- value: d.any().optional()
1891
+ schema: f.object({
1892
+ label: f.any().optional(),
1893
+ variant: f.any().optional(),
1894
+ placeholder: f.any().optional(),
1895
+ validationRegexp: f.any().optional(),
1896
+ value: f.any().optional()
1887
1897
  }).passthrough()
1888
1898
  },
1889
- jr
1899
+ Dr
1890
1900
  );
1891
- function Lr({ context: e }) {
1892
- const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
1893
- return Cr.has(r) ? r === "caption" ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
1901
+ function Kr({ context: e }) {
1902
+ const t = e.componentModel.properties, n = k(t.text), r = k(t.variant) || "body";
1903
+ return Tr.has(r) ? r === "caption" ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
1894
1904
  }
1895
- const Dr = V(
1896
- { name: "Text", schema: ae("Text") },
1897
- Lr
1905
+ const Gr = q(
1906
+ { name: "Text", schema: se("Text") },
1907
+ Kr
1898
1908
  );
1899
- function Tt() {
1909
+ function Nt() {
1900
1910
  const t = [
1901
- ...[...ue.components.values()].filter(
1902
- (r) => !xr.has(r.name)
1911
+ ...[...de.components.values()].filter(
1912
+ (r) => !Ar.has(r.name)
1903
1913
  ),
1904
- Ar,
1905
- Pr,
1906
- Tr,
1907
1914
  Nr,
1908
- Ir,
1909
1915
  _r,
1910
- zr,
1911
- Br,
1912
- qr,
1916
+ Ir,
1917
+ Fr,
1918
+ Pr,
1919
+ Rr,
1920
+ Or,
1921
+ wr,
1913
1922
  $r,
1914
- Dr,
1915
- ...Kn()
1916
- ], n = [...ue.functions.values()];
1917
- return new $t(kt, t, n, ue.themeSchema);
1923
+ Hr,
1924
+ Gr,
1925
+ ...Jn()
1926
+ ], n = [...de.functions.values()];
1927
+ return new Ht(Tt, t, n, de.themeSchema);
1928
+ }
1929
+ const D = {
1930
+ jade9: "#29a383",
1931
+ jade10: "#26997b",
1932
+ jade11: "#208368",
1933
+ jade12: "#1d3b31",
1934
+ /** 链接、边框、Logo 图形、实心底(与 primarySolid 同色) */
1935
+ primary: "#208368",
1936
+ /** Primary 实心按钮、Sider 胶囊、发布等 type="primary" */
1937
+ primarySolid: "#208368",
1938
+ primaryHover: "#26997b",
1939
+ primaryActive: "#1d3b31",
1940
+ onPrimary: "#ffffff"
1941
+ }, Jr = {
1942
+ cssVar: { key: "vidtempl" },
1943
+ token: {
1944
+ colorPrimary: D.primarySolid,
1945
+ colorPrimaryHover: D.primaryHover,
1946
+ colorPrimaryActive: D.primaryActive,
1947
+ colorLink: D.primary,
1948
+ colorLinkHover: D.primaryHover,
1949
+ colorSuccess: D.jade9,
1950
+ colorWarning: "#f5a623",
1951
+ gold6: "#f5a623",
1952
+ gold7: "#e6951a",
1953
+ colorError: "#e5484d",
1954
+ colorInfo: D.primary,
1955
+ colorBgLayout: "#f9f9f9",
1956
+ colorBgContainer: "#ffffff",
1957
+ colorBgElevated: "#ffffff",
1958
+ colorBorder: "#d9d9d9",
1959
+ colorBorderSecondary: "#f0f0f0",
1960
+ colorText: "#202020",
1961
+ colorTextSecondary: "#646464",
1962
+ colorTextTertiary: "#8d8d8d",
1963
+ colorTextQuaternary: "#bbbbbb",
1964
+ borderRadius: 8,
1965
+ borderRadiusSM: 4,
1966
+ borderRadiusLG: 12,
1967
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif",
1968
+ fontSize: 14,
1969
+ fontSizeLG: 16,
1970
+ fontSizeSM: 13,
1971
+ fontWeightStrong: 600,
1972
+ lineHeight: 1.5715,
1973
+ lineHeightLG: 1.5,
1974
+ lineHeightSM: 1.5715,
1975
+ controlHeight: 36,
1976
+ controlHeightLG: 40,
1977
+ controlHeightSM: 28,
1978
+ paddingContentHorizontal: 16,
1979
+ paddingContentHorizontalLG: 20,
1980
+ paddingContentHorizontalSM: 12,
1981
+ marginLG: 24,
1982
+ marginMD: 16,
1983
+ marginSM: 12,
1984
+ marginXS: 8
1985
+ },
1986
+ components: {
1987
+ Button: {
1988
+ borderRadius: 9999,
1989
+ borderRadiusSM: 9999,
1990
+ borderRadiusLG: 9999,
1991
+ controlHeight: 36,
1992
+ controlHeightLG: 40,
1993
+ controlHeightSM: 28,
1994
+ paddingInline: 16,
1995
+ paddingInlineLG: 20,
1996
+ paddingInlineSM: 12,
1997
+ fontSize: 14,
1998
+ fontSizeLG: 16,
1999
+ fontSizeSM: 13,
2000
+ fontWeight: 600,
2001
+ primaryShadow: "none",
2002
+ defaultShadow: "none",
2003
+ dangerShadow: "none"
2004
+ },
2005
+ Card: {
2006
+ borderRadiusLG: 8
2007
+ },
2008
+ Layout: {
2009
+ headerBg: "#ffffff",
2010
+ bodyBg: "#f9f9f9"
2011
+ },
2012
+ Tag: {
2013
+ defaultBg: "#e6f7ed",
2014
+ defaultColor: D.primary,
2015
+ fontSizeSM: 13
2016
+ },
2017
+ Form: {
2018
+ itemMarginBottom: 24
2019
+ },
2020
+ Typography: {
2021
+ titleMarginBottom: 16,
2022
+ titleMarginTop: 0
2023
+ }
2024
+ }
2025
+ };
2026
+ function X({
2027
+ children: e,
2028
+ locale: t,
2029
+ theme: n
2030
+ }) {
2031
+ return /* @__PURE__ */ l(Vt, { theme: n ?? Jr, locale: t, children: e });
1918
2032
  }
1919
- const Kr = It(
2033
+ const Yr = Ft(
1920
2034
  function({
1921
2035
  doc: t,
1922
2036
  surfaceId: n = "skopon-form",
@@ -1924,54 +2038,60 @@ const Kr = It(
1924
2038
  interactive: o = !0,
1925
2039
  fieldNames: i = [],
1926
2040
  resumeSearch: a = null,
1927
- caseSearch: l = null
1928
- }, c) {
1929
- j(() => {
1930
- tt(), et();
2041
+ caseSearch: s = null,
2042
+ wrapProvider: c = !0
2043
+ }, u) {
2044
+ B(() => {
2045
+ it(), ot();
1931
2046
  }, []);
1932
- const u = q(null), m = q(i);
1933
- m.current = i;
1934
- const p = B(() => {
1935
- if (Ee(t)) return "";
2047
+ const d = L(null), p = L(i);
2048
+ p.current = i;
2049
+ const v = V(() => {
2050
+ if (qe(t)) return "";
1936
2051
  try {
1937
2052
  return JSON.stringify(t);
1938
2053
  } catch {
1939
2054
  return String(t);
1940
2055
  }
1941
- }, [t]), g = B(() => {
1942
- if (!p)
2056
+ }, [t]), g = V(() => {
2057
+ if (!v)
1943
2058
  return { surfaces: [], processor: null };
1944
2059
  try {
1945
- const T = JSON.parse(p), k = new Qe([Tt()]), f = nr(T, {
2060
+ const m = JSON.parse(v), h = new rt([Nt()]), x = ir(m, {
1946
2061
  surfaceId: n,
1947
- catalogId: kt
2062
+ catalogId: Tt
1948
2063
  });
1949
- return k.processMessages(f), {
1950
- surfaces: Array.from(k.model.surfacesMap.values()),
1951
- processor: k
2064
+ return h.processMessages(x), {
2065
+ surfaces: Array.from(h.model.surfacesMap.values()),
2066
+ processor: h
1952
2067
  };
1953
- } catch (T) {
1954
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
2068
+ } catch (m) {
2069
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", m), { surfaces: [], processor: null };
1955
2070
  }
1956
- }, [p, n]), { surfaces: v, processor: I } = g;
1957
- return u.current = I, Mt(
1958
- c,
2071
+ }, [v, n]), { surfaces: A, processor: E } = g;
2072
+ if (d.current = E, Pt(
2073
+ u,
1959
2074
  () => ({
1960
- getValues(T) {
1961
- const k = u.current;
1962
- if (!k) return {};
1963
- const f = (T ?? m.current).map((h) => h.trim()).filter(Boolean);
1964
- return ar(k, n, f);
2075
+ getValues(m) {
2076
+ const h = d.current;
2077
+ if (!h) return {};
2078
+ const x = (m ?? p.current).map((y) => y.trim()).filter(Boolean);
2079
+ return cr(h, n, x);
1965
2080
  }
1966
2081
  }),
1967
2082
  [n]
1968
- ), v.length === 0 ? /* @__PURE__ */ s(Ye, { children: r }) : /* @__PURE__ */ s(mt, { resumeSearch: a, children: /* @__PURE__ */ s(ut, { caseSearch: l, children: /* @__PURE__ */ s(ot, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ s(Ze, { surface: T }, T.id)) }) }) }) });
2083
+ ), A.length === 0) {
2084
+ const m = /* @__PURE__ */ l(Be, { resumeSearch: a, children: /* @__PURE__ */ l(Re, { caseSearch: s, children: /* @__PURE__ */ l(Ee, { interactive: o, children: r }) }) });
2085
+ return c ? /* @__PURE__ */ l(X, { children: m }) : m;
2086
+ }
2087
+ const T = /* @__PURE__ */ l(Be, { resumeSearch: a, children: /* @__PURE__ */ l(Re, { caseSearch: s, children: /* @__PURE__ */ l(Ee, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: A.map((m) => /* @__PURE__ */ l(nt, { surface: m }, m.id)) }) }) }) });
2088
+ return c ? /* @__PURE__ */ l(X, { children: T }) : T;
1969
2089
  }
1970
2090
  );
1971
- function ce() {
1972
- return new Qe([Tt()]);
2091
+ function pe() {
2092
+ return new rt([Nt()]);
1973
2093
  }
1974
- function ao({
2094
+ function uo({
1975
2095
  messages: e,
1976
2096
  surfaceId: t = "skopon-form-stream",
1977
2097
  emptyHint: n = null,
@@ -1979,18 +2099,18 @@ function ao({
1979
2099
  resumeSearch: o = null,
1980
2100
  caseSearch: i = null
1981
2101
  }) {
1982
- j(() => {
1983
- tt(), et();
2102
+ B(() => {
2103
+ it(), ot();
1984
2104
  }, []);
1985
- const a = q(null);
1986
- a.current === null && (a.current = ce());
1987
- const l = q(0), c = q(""), u = q(!0), m = q(t);
1988
- function p(f, h) {
1989
- a.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (I(f), k(Array.from(f.model.surfacesMap.values())));
2105
+ const a = L(null);
2106
+ a.current === null && (a.current = pe());
2107
+ const s = L(0), c = L(""), u = L(!0), d = L(t);
2108
+ function p(m, h) {
2109
+ a.current = m, s.current = h.length, c.current = JSON.stringify(h), u.current && (A(m), T(Array.from(m.model.surfacesMap.values())));
1990
2110
  }
1991
- function g(f, h) {
2111
+ function v(m, h) {
1992
2112
  if (h <= 0) return !1;
1993
- const x = JSON.stringify(f.slice(0, h)), y = c.current;
2113
+ const x = JSON.stringify(m.slice(0, h)), y = c.current;
1994
2114
  if (!y) return !0;
1995
2115
  try {
1996
2116
  const S = JSON.parse(y);
@@ -1999,58 +2119,58 @@ function ao({
1999
2119
  return !0;
2000
2120
  }
2001
2121
  }
2002
- const [v, I] = U(
2122
+ const [g, A] = P(
2003
2123
  () => a.current
2004
- ), [T, k] = U(
2124
+ ), [E, T] = P(
2005
2125
  () => Array.from(
2006
2126
  a.current.model.surfacesMap.values()
2007
2127
  )
2008
2128
  );
2009
- return j(() => (u.current = !0, () => {
2129
+ return B(() => (u.current = !0, () => {
2010
2130
  u.current = !1;
2011
- }), []), j(() => {
2012
- a.current = v;
2013
- }, [v]), j(() => {
2014
- const f = () => {
2015
- u.current && k(Array.from(v.model.surfacesMap.values()));
2016
- }, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
2131
+ }), []), B(() => {
2132
+ a.current = g;
2133
+ }, [g]), B(() => {
2134
+ const m = () => {
2135
+ u.current && T(Array.from(g.model.surfacesMap.values()));
2136
+ }, h = g.onSurfaceCreated(m), x = g.onSurfaceDeleted(m);
2017
2137
  return () => {
2018
2138
  h.unsubscribe(), x.unsubscribe();
2019
2139
  };
2020
- }, [v]), j(() => {
2021
- let f = !1;
2022
- const h = m.current !== t;
2023
- if (m.current = t, h) {
2024
- const M = ce();
2025
- return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), f || p(M, e)) : (a.current = M, l.current = 0, c.current = "", f || (I(M), k([]))), () => {
2026
- f = !0;
2140
+ }, [g]), B(() => {
2141
+ let m = !1;
2142
+ const h = d.current !== t;
2143
+ if (d.current = t, h) {
2144
+ const N = pe();
2145
+ return Array.isArray(e) && e.length > 0 ? (N.processMessages(e), m || p(N, e)) : (a.current = N, s.current = 0, c.current = "", m || (A(N), T([]))), () => {
2146
+ m = !0;
2027
2147
  };
2028
2148
  }
2029
2149
  if (!Array.isArray(e) || e.length === 0) {
2030
- if (l.current > 0) {
2031
- const M = ce();
2032
- a.current = M, l.current = 0, c.current = "", f || (I(M), k([]));
2150
+ if (s.current > 0) {
2151
+ const N = pe();
2152
+ a.current = N, s.current = 0, c.current = "", m || (A(N), T([]));
2033
2153
  }
2034
2154
  return () => {
2035
- f = !0;
2155
+ m = !0;
2036
2156
  };
2037
2157
  }
2038
- const x = a.current, y = l.current;
2039
- if (e.length < y || g(e, y)) {
2040
- const M = ce();
2041
- return M.processMessages(e), f || p(M, e), () => {
2042
- f = !0;
2158
+ const x = a.current, y = s.current;
2159
+ if (e.length < y || v(e, y)) {
2160
+ const N = pe();
2161
+ return N.processMessages(e), m || p(N, e), () => {
2162
+ m = !0;
2043
2163
  };
2044
2164
  }
2045
2165
  const S = e.slice(y);
2046
2166
  return S.length === 0 ? () => {
2047
- f = !0;
2048
- } : (x.processMessages(S), l.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
2049
- f = !0;
2167
+ m = !0;
2168
+ } : (x.processMessages(S), s.current = e.length, c.current = JSON.stringify(e), m || T(Array.from(x.model.surfacesMap.values())), () => {
2169
+ m = !0;
2050
2170
  });
2051
- }, [e, t]), T.length === 0 ? /* @__PURE__ */ s(Ye, { children: n }) : /* @__PURE__ */ s(mt, { resumeSearch: o, children: /* @__PURE__ */ s(ut, { caseSearch: i, children: /* @__PURE__ */ s(ot, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ s(Ze, { surface: f }, f.id)) }) }) }) });
2171
+ }, [e, t]), E.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(Be, { resumeSearch: o, children: /* @__PURE__ */ l(Re, { caseSearch: i, children: /* @__PURE__ */ l(Ee, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: E.map((m) => /* @__PURE__ */ l(nt, { surface: m }, m.id)) }) }) }) }) });
2052
2172
  }
2053
- function Jr({
2173
+ function Xr({
2054
2174
  payload: e,
2055
2175
  callbackUrl: t,
2056
2176
  title: n,
@@ -2059,31 +2179,31 @@ function Jr({
2059
2179
  copyMode: i = "display",
2060
2180
  onNotify: a
2061
2181
  }) {
2062
- const l = B(
2063
- () => St(e, t),
2182
+ const s = V(
2183
+ () => Ct(e, t),
2064
2184
  [e, t]
2065
- ), c = B(() => i === "submitFields" ? gr(e, t) : l, [i, e, t, l]);
2185
+ ), c = V(() => i === "submitFields" ? br(e, t) : s, [i, e, t, s]);
2066
2186
  async function u() {
2067
2187
  try {
2068
- await Ct(c), a == null || a("success", "已复制到剪贴板");
2188
+ await At(c), a == null || a("success", "已复制到剪贴板");
2069
2189
  } catch {
2070
2190
  a == null || a("error", "复制失败");
2071
2191
  }
2072
2192
  }
2073
- const m = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2193
+ const d = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2074
2194
  return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2075
2195
  /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2076
2196
  /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2077
- /* @__PURE__ */ s(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
2078
- r ? /* @__PURE__ */ s(ee, { title: r, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2079
- o ? /* @__PURE__ */ s(ee, { title: o, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2197
+ /* @__PURE__ */ l(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2198
+ r ? /* @__PURE__ */ l(ne, { title: r, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2199
+ o ? /* @__PURE__ */ l(ne, { title: o, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2080
2200
  ] }),
2081
- /* @__PURE__ */ s(ee, { title: m, children: /* @__PURE__ */ s(fe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2201
+ /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(ge, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2082
2202
  ] }),
2083
- /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
2203
+ /* @__PURE__ */ l("pre", { className: "skopon-form-curl-json", children: s })
2084
2204
  ] });
2085
2205
  }
2086
- function Hr(e, t) {
2206
+ function Wr(e, t) {
2087
2207
  if (t && typeof t == "object" && t !== null && "message" in t) {
2088
2208
  const n = t.message;
2089
2209
  if (typeof n == "string" && n.trim())
@@ -2091,7 +2211,7 @@ function Hr(e, t) {
2091
2211
  }
2092
2212
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2093
2213
  }
2094
- function lo({
2214
+ function po({
2095
2215
  payload: e,
2096
2216
  formUniqueId: t,
2097
2217
  callbackUrl: n,
@@ -2099,148 +2219,152 @@ function lo({
2099
2219
  fetchFormDetail: o,
2100
2220
  onNotify: i,
2101
2221
  resumeSearch: a = null,
2102
- caseSearch: l = null
2222
+ caseSearch: s = null
2103
2223
  }) {
2104
- const [c, u] = U(null), [m, p] = U(!1), [g, v] = U(!0), [I, T] = U(!1), k = q(null), f = q(!0), h = q(i);
2224
+ const [c, u] = P(null), [d, p] = P(!1), [v, g] = P(!0), [A, E] = P(!1), T = L(null), m = L(!0), h = L(i);
2105
2225
  h.current = i;
2106
2226
  const x = (t == null ? void 0 : t.trim()) ?? "";
2107
- j(() => (f.current = !0, () => {
2108
- f.current = !1;
2109
- }), []), j(() => {
2110
- let P = !1;
2111
- return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((_) => {
2112
- P || (p(!!_.disabled), u(_.formDefinition ?? null));
2113
- }).catch((_) => {
2227
+ B(() => (m.current = !0, () => {
2228
+ m.current = !1;
2229
+ }), []), B(() => {
2230
+ let F = !1;
2231
+ return x ? (g(!0), p(!1), o({ formUniqueId: x }).then((z) => {
2232
+ F || (p(!!z.disabled), u(z.formDefinition ?? null));
2233
+ }).catch((z) => {
2114
2234
  var b;
2115
- if (!P) {
2235
+ if (!F) {
2116
2236
  p(!1), u(null);
2117
- const F = _ instanceof Error ? _.message : "获取表单定义失败";
2118
- (b = h.current) == null || b.call(h, "error", F);
2237
+ const I = z instanceof Error ? z.message : "获取表单定义失败";
2238
+ (b = h.current) == null || b.call(h, "error", I);
2119
2239
  }
2120
2240
  }).finally(() => {
2121
- P || v(!1);
2241
+ F || g(!1);
2122
2242
  }), () => {
2123
- P = !0;
2124
- }) : (v(!1), p(!1), u(null), () => {
2125
- P = !0;
2243
+ F = !0;
2244
+ }) : (g(!1), p(!1), u(null), () => {
2245
+ F = !0;
2126
2246
  });
2127
2247
  }, [x, o]);
2128
- const y = B(() => yt(e), [e]), S = B(() => y ? ur(y, c ?? void 0) : null, [y, c]), M = (S == null ? void 0 : S.matchedBlocks) ?? [], z = !!(y && mr(y) && M.length === 0), $ = B(() => z && y ? dr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, z, y]), G = B(
2129
- () => z ? {} : vt((S == null ? void 0 : S.extraBlocks) ?? []),
2130
- [z, S]
2131
- ), w = B(() => z && y ? fr(y) : $.filter((P) => {
2132
- var _;
2133
- return (_ = P.name) == null ? void 0 : _.trim();
2134
- }).map((P) => P.name.trim()), [z, y, $]), O = B(() => {
2135
- if ($.length === 0) return null;
2136
- const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2137
- return or({ title: P, description: _ }, $);
2138
- }, [S, y, $]), H = x ? `ask-user-${x}` : "ask-user-payload";
2139
- if (g)
2140
- return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Oe, { size: "small" }) });
2141
- if (!y || $.length === 0)
2142
- return /* @__PURE__ */ s(
2143
- Jr,
2248
+ const y = V(() => bt(e), [e]), S = V(() => y ? mr(y, c ?? void 0) : null, [y, c]), N = (S == null ? void 0 : S.matchedBlocks) ?? [], _ = !!(y && hr(y) && N.length === 0), j = V(() => _ && y ? gr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, _, y]), Q = V(
2249
+ () => _ ? {} : St((S == null ? void 0 : S.extraBlocks) ?? []),
2250
+ [_, S]
2251
+ ), w = V(() => _ && y ? yr(y) : j.filter((F) => {
2252
+ var z;
2253
+ return (z = F.name) == null ? void 0 : z.trim();
2254
+ }).map((F) => F.name.trim()), [_, y, j]), O = V(() => {
2255
+ if (j.length === 0) return null;
2256
+ const F = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", z = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2257
+ return lr({ title: F, description: z }, j);
2258
+ }, [S, y, j]), J = x ? `ask-user-${x}` : "ask-user-payload";
2259
+ if (v)
2260
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(je, { size: "small" }) }) });
2261
+ if (!y || j.length === 0)
2262
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(
2263
+ Xr,
2144
2264
  {
2145
2265
  payload: e,
2146
2266
  callbackUrl: n,
2147
2267
  copyMode: "submitFields",
2148
- unpublishedFormId: m && x ? x : void 0,
2268
+ unpublishedFormId: d && x ? x : void 0,
2149
2269
  onNotify: i
2150
2270
  }
2151
- );
2271
+ ) });
2152
2272
  async function Y() {
2153
- var P, _, b, F, R, N;
2154
- if (!I) {
2155
- T(!0);
2273
+ var F, z, b, I, R, M;
2274
+ if (!A) {
2275
+ E(!0);
2156
2276
  try {
2157
- const Z = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, ve = { ...Z, ...G };
2277
+ const ee = ((F = T.current) == null ? void 0 : F.getValues(w)) ?? {}, xe = { ...ee, ...Q };
2158
2278
  if (r === "post") {
2159
- const je = (n ?? "").trim();
2160
- if (!je) {
2161
- (_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
2279
+ const Ke = (n ?? "").trim();
2280
+ if (!Ke) {
2281
+ (z = h.current) == null || z.call(h, "error", "callback_url 为空,无法提交");
2162
2282
  return;
2163
2283
  }
2164
- const be = await yr(je, ve);
2165
- if (!f.current) return;
2166
- be.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Hr(be.status, be.body));
2284
+ const Ce = await Sr(Ke, xe);
2285
+ if (!m.current) return;
2286
+ Ce.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", Wr(Ce.status, Ce.body));
2167
2287
  return;
2168
2288
  }
2169
- if (await Ct(
2170
- xt({ cardValues: Z, extraValues: G, callbackUrl: n })
2171
- ), !f.current) return;
2289
+ if (await At(
2290
+ kt({ cardValues: ee, extraValues: Q, callbackUrl: n })
2291
+ ), !m.current) return;
2172
2292
  (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2173
- } catch (Z) {
2174
- if (!f.current) return;
2175
- const ve = Z instanceof Error ? Z.message : "复制失败";
2176
- (N = h.current) == null || N.call(h, "error", ve);
2293
+ } catch (ee) {
2294
+ if (!m.current) return;
2295
+ const xe = ee instanceof Error ? ee.message : "复制失败";
2296
+ (M = h.current) == null || M.call(h, "error", xe);
2177
2297
  } finally {
2178
- f.current && T(!1);
2298
+ m.current && E(!1);
2179
2299
  }
2180
2300
  }
2181
2301
  }
2182
- return /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2183
- m && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ee, { title: x, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2184
- /* @__PURE__ */ s(
2185
- Kr,
2302
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2303
+ d && x ? /* @__PURE__ */ l("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ l(ne, { title: x, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2304
+ /* @__PURE__ */ l(
2305
+ Yr,
2186
2306
  {
2187
- ref: k,
2307
+ ref: T,
2188
2308
  doc: O,
2189
- surfaceId: H,
2309
+ surfaceId: J,
2190
2310
  fieldNames: w,
2191
2311
  interactive: !0,
2312
+ wrapProvider: !1,
2192
2313
  resumeSearch: a,
2193
- caseSearch: l
2314
+ caseSearch: s
2194
2315
  }
2195
2316
  ),
2196
- /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ee, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
2197
- fe,
2317
+ /* @__PURE__ */ l("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ l(ne, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ l(
2318
+ ge,
2198
2319
  {
2199
2320
  type: "primary",
2200
2321
  size: "small",
2201
- loading: I,
2202
- disabled: I,
2322
+ loading: A,
2323
+ disabled: A,
2203
2324
  onClick: () => void Y(),
2204
2325
  children: "提交"
2205
2326
  }
2206
2327
  ) }) })
2207
- ] });
2328
+ ] }) });
2208
2329
  }
2209
2330
  export {
2210
- oo as A2UI_PROTOCOL_VERSION,
2211
- lo as AskUserFormCard,
2212
- ut as CaseSearchProvider,
2213
- Jr as CurlSubmitBlock,
2214
- Lt as FORM_MEDIA_SIZES,
2215
- mt as ResumeSearchProvider,
2216
- ao as SkoponA2uiStreamRenderer,
2217
- Kr as SkoponFormRenderer,
2218
- tr as a2uiToBlocks,
2219
- ft as blocksToA2ui,
2220
- hr as buildAskUserCurlBodyJson,
2221
- xt as buildAskUserCurlStatement,
2222
- gr as buildAskUserSubmitCurlFromPayload,
2223
- or as buildAskUserSurface,
2224
- St as buildCurlStatement,
2225
- Ct as copyTextToClipboard,
2226
- io as createFormClient,
2227
- vt as extractExtraBlockValues,
2228
- ar as extractSurfaceValues,
2229
- fr as getPayloadInputFieldNames,
2230
- dr as getPayloadRenderableBlocks,
2231
- ur as intersectPayloadBlocksWithForm,
2232
- Ee as isA2uiSurfaceEmpty,
2233
- X as isInputBlockType,
2234
- Be as isLayoutBlockType,
2235
- Pe as isMediaBlockType,
2236
- ir as mapFormDefinitionFromDto,
2237
- W as normalizeFormDefinition,
2238
- yt as parsePayloadBlocksJson,
2239
- mr as payloadHasInputBlocks,
2240
- rr as resolveSurfaceFromFormDefinition,
2241
- yr as submitFormJson,
2242
- nr as surfaceDocToMessages,
2243
- pe as syncFormDefinition,
2244
- xn as useCaseSearch,
2245
- Pn as useResumeSearch
2331
+ so as A2UI_PROTOCOL_VERSION,
2332
+ po as AskUserFormCard,
2333
+ Re as CaseSearchProvider,
2334
+ Xr as CurlSubmitBlock,
2335
+ Kt as FORM_MEDIA_SIZES,
2336
+ Be as ResumeSearchProvider,
2337
+ uo as SkoponA2uiStreamRenderer,
2338
+ X as SkoponFormProvider,
2339
+ Yr as SkoponFormRenderer,
2340
+ or as a2uiToBlocks,
2341
+ gt as blocksToA2ui,
2342
+ vr as buildAskUserCurlBodyJson,
2343
+ kt as buildAskUserCurlStatement,
2344
+ br as buildAskUserSubmitCurlFromPayload,
2345
+ lr as buildAskUserSurface,
2346
+ Ct as buildCurlStatement,
2347
+ At as copyTextToClipboard,
2348
+ co as createFormClient,
2349
+ St as extractExtraBlockValues,
2350
+ cr as extractSurfaceValues,
2351
+ yr as getPayloadInputFieldNames,
2352
+ gr as getPayloadRenderableBlocks,
2353
+ mr as intersectPayloadBlocksWithForm,
2354
+ qe as isA2uiSurfaceEmpty,
2355
+ W as isInputBlockType,
2356
+ $e as isLayoutBlockType,
2357
+ _e as isMediaBlockType,
2358
+ sr as mapFormDefinitionFromDto,
2359
+ Z as normalizeFormDefinition,
2360
+ bt as parsePayloadBlocksJson,
2361
+ hr as payloadHasInputBlocks,
2362
+ ar as resolveSurfaceFromFormDefinition,
2363
+ Jr as skoponAntdTheme,
2364
+ D as skoponBrandColors,
2365
+ Sr as submitFormJson,
2366
+ ir as surfaceDocToMessages,
2367
+ me as syncFormDefinition,
2368
+ An as useCaseSearch,
2369
+ _n as useResumeSearch
2246
2370
  };