@skopon-cool/form-sdk 0.1.4 → 0.1.5

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