@skopon-cool/form-sdk 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,28 +1,31 @@
1
- import { jsx as s, jsxs as k, Fragment as tt } from "react/jsx-runtime";
2
- import { createContext as Be, useContext as qe, useCallback as oe, useSyncExternalStore as Pt, useMemo as R, useState as F, useRef as B, useEffect as q, forwardRef as Et, useImperativeHandle as Ut } from "react";
3
- import { Spin as Le, Button as xe, Typography as H, Avatar as jt, Tag as ie, Select as Ue, Checkbox as Rt, Radio as Ot, Switch as Vt, TimePicker as Bt, DatePicker as qt, Upload as Te, Input as $e, InputNumber as Lt, Tooltip as ae } from "antd";
4
- import { ReloadOutlined as nt, FileTextOutlined as rt, UserOutlined as Dt, FileImageOutlined as Kt, FileExcelOutlined as Ht, FileOutlined as ot, PictureOutlined as Jt, SoundOutlined as Gt, VideoCameraOutlined as Yt } from "@ant-design/icons";
5
- import { createBinderlessComponentImplementation as O, basicCatalog as ge, A2uiSurface as at } from "@a2ui/react/v0_9";
6
- import { z as m } from "zod";
7
- import { Catalog as Wt, MessageProcessor as it } from "@a2ui/web_core/v0_9";
8
- import Ye from "dayjs";
9
- const Ao = "v0.9", Xt = [
1
+ import './form-sdk.css';
2
+ import { jsx as s, jsxs as C, Fragment as Ye } from "react/jsx-runtime";
3
+ import { createContext as ze, useContext as Re, useCallback as Q, useSyncExternalStore as Nt, useMemo as B, useState as U, useRef as q, useEffect as j, forwardRef as It, useImperativeHandle as Mt } from "react";
4
+ import { Spin as Oe, Button as fe, Typography as D, Avatar as Ft, Tag as te, Select as Fe, Checkbox as Pt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as zt, Upload as Se, Input as xe, InputNumber as Rt, Tooltip as ee } from "antd";
5
+ import { ReloadOutlined as Xe, FileTextOutlined as Ge, UserOutlined as Ot, FileImageOutlined as Bt, FileExcelOutlined as Vt, FileOutlined as We, PictureOutlined as wt, SoundOutlined as qt, VideoCameraOutlined as jt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as V, basicCatalog as ue, A2uiSurface as Ze } from "@a2ui/react/v0_9";
7
+ import { z as d } from "zod";
8
+ import { Catalog as $t, MessageProcessor as Qe } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as et } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as tt } from "@a2ui/react/styles";
11
+ import $e from "dayjs";
12
+ const oo = "v0.9", Lt = [
10
13
  "huge",
11
14
  "large",
12
15
  "medium",
13
16
  "small",
14
17
  "icon"
15
18
  ];
16
- function je(e) {
19
+ function Pe(e) {
17
20
  return e === "image" || e === "video" || e === "audio";
18
21
  }
19
- function De(e) {
22
+ function Be(e) {
20
23
  return e === "heading" || e === "paragraph";
21
24
  }
22
25
  function X(e) {
23
- return !De(e) && !je(e);
26
+ return !Be(e) && !Pe(e);
24
27
  }
25
- function Zt() {
28
+ function Dt() {
26
29
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
27
30
  return crypto.randomUUID();
28
31
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -36,11 +39,11 @@ function Zt() {
36
39
  return (e === "x" ? t : t & 3 | 8).toString(16);
37
40
  });
38
41
  }
39
- function se(e) {
40
- const t = Zt().replace(/-/g, "").slice(0, 8);
42
+ function re(e) {
43
+ const t = Dt().replace(/-/g, "").slice(0, 8);
41
44
  return `${e}${t}`;
42
45
  }
43
- const lt = [
46
+ const nt = [
44
47
  { value: "image/*", label: "图片" },
45
48
  { value: "video/*", label: "视频" },
46
49
  { value: "audio/*", label: "音频" },
@@ -51,7 +54,7 @@ const lt = [
51
54
  { value: "text/plain", label: "纯文本" },
52
55
  { value: "application/zip", label: "ZIP 压缩包" },
53
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
54
- ], Qt = {
57
+ ], Kt = {
55
58
  "image/*": ["image/*"],
56
59
  "video/*": ["video/*"],
57
60
  "audio/*": ["audio/*"],
@@ -71,7 +74,7 @@ const lt = [
71
74
  "text/plain": ["text/plain"],
72
75
  "application/zip": ["application/zip"],
73
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
74
- }, en = {
77
+ }, Jt = {
75
78
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
76
79
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
77
80
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -82,14 +85,14 @@ const lt = [
82
85
  "text/plain": [".txt"],
83
86
  "application/zip": [".zip", ".7z"],
84
87
  "application/x-rar-compressed": [".rar"]
85
- }, tn = {
88
+ }, Ht = {
86
89
  "application/msword": "office/word",
87
90
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
88
91
  "application/vnd.ms-excel": "office/excel",
89
92
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
90
93
  "application/vnd.ms-powerpoint": "office/ppt",
91
94
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
92
- }, Ke = [
95
+ }, Ve = [
93
96
  { value: ".jpg", label: ".jpg" },
94
97
  { value: ".jpeg", label: ".jpeg" },
95
98
  { value: ".png", label: ".png" },
@@ -115,121 +118,121 @@ const lt = [
115
118
  { value: ".zip", label: ".zip" },
116
119
  { value: ".rar", label: ".rar" },
117
120
  { value: ".7z", label: ".7z" }
118
- ], nn = Object.fromEntries(
119
- lt.map((e) => [e.value, e.label])
120
- ), rn = Object.fromEntries(
121
- Ke.map((e) => [e.value, e.label])
122
- ), on = new Set(lt.map((e) => e.value)), an = new Set(
123
- Ke.map((e) => e.value)
121
+ ], Yt = Object.fromEntries(
122
+ nt.map((e) => [e.value, e.label])
123
+ ), Xt = Object.fromEntries(
124
+ Ve.map((e) => [e.value, e.label])
125
+ ), Gt = new Set(nt.map((e) => e.value)), Wt = new Set(
126
+ Ve.map((e) => e.value)
124
127
  );
125
- function ln(e) {
128
+ function Zt(e) {
126
129
  const t = e.trim();
127
- return t ? on.has(t) ? t : tn[t] ?? null : null;
130
+ return t ? Gt.has(t) ? t : Ht[t] ?? null : null;
128
131
  }
129
- function sn(e) {
132
+ function Qt(e) {
130
133
  return Array.isArray(e) ? e.map((t) => {
131
134
  const n = t.trim().toLowerCase();
132
135
  return n ? n.startsWith(".") ? n : `.${n}` : "";
133
136
  }).filter(Boolean) : [];
134
137
  }
135
- function ce(e) {
138
+ function oe(e) {
136
139
  if (!Array.isArray(e)) return [];
137
140
  const t = [], n = /* @__PURE__ */ new Set();
138
141
  for (const r of e) {
139
- const o = ln(r);
142
+ const o = Zt(r);
140
143
  o && !n.has(o) && (n.add(o), t.push(o));
141
144
  }
142
145
  return t;
143
146
  }
144
- function cn(e) {
145
- const t = ce(e), n = [];
147
+ function en(e) {
148
+ const t = oe(e), n = [];
146
149
  for (const r of t)
147
- n.push(...Qt[r] ?? [r]);
150
+ n.push(...Kt[r] ?? [r]);
148
151
  return n;
149
152
  }
150
- function un(e) {
151
- const t = ce(e);
153
+ function tn(e) {
154
+ const t = oe(e);
152
155
  if (t.length === 0) return [];
153
156
  const n = /* @__PURE__ */ new Set();
154
157
  for (const r of t)
155
- for (const o of en[r] ?? [])
158
+ for (const o of Jt[r] ?? [])
156
159
  n.add(o);
157
- return Ke.filter((r) => n.has(r.value));
160
+ return Ve.filter((r) => n.has(r.value));
158
161
  }
159
- function He(e, t) {
160
- const n = sn(t), r = ce(e);
162
+ function we(e, t) {
163
+ const n = Qt(t), r = oe(e);
161
164
  if (r.length === 0)
162
- return n.filter((a) => an.has(a));
165
+ return n.filter((i) => Wt.has(i));
163
166
  const o = new Set(
164
- un(r).map((a) => a.value)
167
+ tn(r).map((i) => i.value)
165
168
  );
166
- return n.filter((a) => o.has(a));
169
+ return n.filter((i) => o.has(i));
167
170
  }
168
- function pn(e, t) {
169
- const n = cn(e), r = He(e, t), o = [...n, ...r];
171
+ function nn(e, t) {
172
+ const n = en(e), r = we(e, t), o = [...n, ...r];
170
173
  return o.length > 0 ? o.join(",") : void 0;
171
174
  }
172
- function dn(e, t) {
173
- const n = ce(e), r = He(
175
+ function rn(e, t) {
176
+ const n = oe(e), r = we(
174
177
  n,
175
178
  t
176
179
  ), o = [
177
- ...n.map((a) => nn[a] ?? a),
178
- ...r.map((a) => rn[a] ?? a)
180
+ ...n.map((i) => Yt[i] ?? i),
181
+ ...r.map((i) => Xt[i] ?? i)
179
182
  ];
180
183
  return o.length === 0 ? null : o.join("、");
181
184
  }
182
- const mn = [
185
+ const on = [
183
186
  "video",
184
187
  "audio",
185
188
  "image",
186
189
  "file",
187
190
  "spreadsheet",
188
191
  "document"
189
- ], fn = new Set(mn);
190
- function hn(e) {
191
- return e && fn.has(e) ? e : "file";
192
+ ], an = new Set(on);
193
+ function ln(e) {
194
+ return e && an.has(e) ? e : "file";
192
195
  }
193
- function ue(e) {
194
- return typeof e == "string" && Xt.includes(e) ? e : "medium";
196
+ function ie(e) {
197
+ return typeof e == "string" && Lt.includes(e) ? e : "medium";
195
198
  }
196
- function gn(e, t) {
199
+ function sn(e, t) {
197
200
  var o;
198
201
  const n = Math.max(1, t);
199
202
  let r = [];
200
- 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);
203
+ return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
201
204
  }
202
- function yn(e) {
205
+ function cn(e) {
203
206
  var t;
204
207
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
205
208
  }
206
- function vn(e) {
207
- return `form-media-size-${ue(e)}`;
209
+ function un(e) {
210
+ return `form-media-size-${ie(e)}`;
208
211
  }
209
- function bn(e) {
210
- return `form-media-preview form-media-list ${vn(e)}`;
212
+ function pn(e) {
213
+ return `form-media-preview form-media-list ${un(e)}`;
211
214
  }
212
- const xn = 10;
213
- function Je(e) {
215
+ const mn = 10;
216
+ function qe(e) {
214
217
  return e === !0 || e === "true";
215
218
  }
216
- function We(e, t = 1) {
219
+ function Le(e, t = 1) {
217
220
  const n = typeof e == "number" ? e : Number(e);
218
221
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
219
222
  }
220
- function de(e, t = 1) {
223
+ function le(e, t = 1) {
221
224
  const n = typeof e == "number" ? e : Number(e);
222
225
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
223
226
  }
224
- function Sn(e, t) {
227
+ function dn(e, t) {
225
228
  if (t !== void 0)
226
- return e === "toggle" ? Je(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
229
+ return e === "toggle" ? qe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
227
230
  }
228
- function kn(e) {
229
- 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, i = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
230
- return { agentKind: r, agentUniqueId: o, flowType: a, category: i, flowUniqueIds: l, pageSize: n };
231
+ function fn(e) {
232
+ const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
+ return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: l, pageSize: n };
231
234
  }
232
- function wn(e) {
235
+ function hn(e) {
233
236
  const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
234
237
  return {
235
238
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -238,51 +241,51 @@ function wn(e) {
238
241
  pageSize: n
239
242
  };
240
243
  }
241
- function Cn(e) {
244
+ function gn(e) {
242
245
  if (e.type !== "case_singleselect") return e;
243
246
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
244
247
  return { ...e, type: "case_multiselect", defaultValue: t };
245
248
  }
246
- function An(e) {
247
- var o, a;
248
- const t = Cn(e), n = ce(t.fileAcceptTypes), r = t.type;
249
+ function yn(e) {
250
+ var o, i;
251
+ const t = gn(e), n = oe(t.fileAcceptTypes), r = t.type;
249
252
  return {
250
- id: ((o = t.id) == null ? void 0 : o.trim()) || se("block-"),
253
+ id: ((o = t.id) == null ? void 0 : o.trim()) || re("block-"),
251
254
  type: r,
252
- name: ((a = t.name) == null ? void 0 : a.trim()) || void 0,
255
+ name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
253
256
  label: t.label ?? "",
254
257
  placeholder: t.placeholder ?? "",
255
258
  help: t.help ?? "",
256
259
  required: t.required === !0,
257
- mediaUrls: je(r) ? gn(t, xn) : void 0,
258
- mediaSize: je(r) ? ue(t.mediaSize) : void 0,
260
+ mediaUrls: Pe(r) ? sn(t, mn) : void 0,
261
+ mediaSize: Pe(r) ? ie(t.mediaSize) : void 0,
259
262
  fileAcceptTypes: n,
260
- fileAcceptExtensions: He(
263
+ fileAcceptExtensions: we(
261
264
  n,
262
265
  t.fileAcceptExtensions
263
266
  ),
264
- filePlaceholderIcon: hn(t.filePlaceholderIcon),
265
- fileMinCount: r === "file" ? We(t.fileMinCount, 1) : void 0,
266
- fileMaxCount: r === "file" ? We(t.fileMaxCount, 1) : void 0,
267
- defaultValue: Sn(r, t.defaultValue),
268
- options: Array.isArray(t.options) ? t.options.map((i, l) => {
267
+ filePlaceholderIcon: ln(t.filePlaceholderIcon),
268
+ fileMinCount: r === "file" ? Le(t.fileMinCount, 1) : void 0,
269
+ fileMaxCount: r === "file" ? Le(t.fileMaxCount, 1) : void 0,
270
+ defaultValue: dn(r, t.defaultValue),
271
+ options: Array.isArray(t.options) ? t.options.map((a, l) => {
269
272
  var c, u;
270
273
  return {
271
- value: ((c = i.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
272
- label: ((u = i.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
274
+ value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
275
+ label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
273
276
  };
274
277
  }) : void 0,
275
278
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
276
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? de(t.resumeMinCount, 1) : void 0,
277
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? de(t.resumeMaxCount, 1) : void 0,
278
- resumeFilter: r === "resume_multiselect" ? wn(t.resumeFilter) : void 0,
279
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? le(t.resumeMinCount, 1) : void 0,
280
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? le(t.resumeMaxCount, 1) : void 0,
281
+ resumeFilter: r === "resume_multiselect" ? hn(t.resumeFilter) : void 0,
279
282
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
280
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? de(t.caseMinCount, 1) : void 0,
281
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? de(t.caseMaxCount, 1) : void 0,
282
- caseFilter: r === "case_multiselect" ? kn(t.caseFilter) : void 0
283
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? le(t.caseMinCount, 1) : void 0,
284
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? le(t.caseMaxCount, 1) : void 0,
285
+ caseFilter: r === "case_multiselect" ? fn(t.caseFilter) : void 0
283
286
  };
284
287
  }
285
- function ye(e) {
288
+ function pe(e) {
286
289
  return {
287
290
  title: e.title ?? "",
288
291
  description: e.description ?? "",
@@ -290,38 +293,38 @@ function ye(e) {
290
293
  jsonSchema: e.jsonSchema ?? {}
291
294
  };
292
295
  }
293
- function ne(e) {
296
+ function W(e) {
294
297
  if (!e || !Array.isArray(e.blocks))
295
- return ye({ title: "", description: "", blocks: [], jsonSchema: {} });
296
- const t = e.blocks.map(An);
297
- return ye({
298
+ return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
299
+ const t = e.blocks.map(yn);
300
+ return pe({
298
301
  title: typeof e.title == "string" ? e.title : "",
299
302
  description: typeof e.description == "string" ? e.description : "",
300
303
  blocks: t,
301
304
  jsonSchema: {}
302
305
  });
303
306
  }
304
- function Tn(e) {
305
- 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, i = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
307
+ function vn(e) {
308
+ const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
306
309
  return {
307
310
  agentKind: n,
308
311
  agentUniqueId: r,
309
312
  flowType: o,
310
- category: a,
311
- flowUniqueIds: i,
313
+ category: i,
314
+ flowUniqueIds: a,
312
315
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
313
316
  };
314
317
  }
315
- function Xe(e) {
318
+ function De(e) {
316
319
  if (e == null) return;
317
320
  const t = typeof e == "number" ? e : Number(e);
318
321
  if (!(!Number.isFinite(t) || t < 1))
319
322
  return Math.floor(t);
320
323
  }
321
- function $n(e, t) {
322
- var i, l, c, u, d, p;
323
- const { id: n, label: r, path: o, withData: a } = t;
324
- return a({
324
+ function bn(e, t) {
325
+ var a, l, c, u, m, p;
326
+ const { id: n, label: r, path: o, withData: i } = t;
327
+ return i({
325
328
  id: n,
326
329
  component: "SkoponCaseSelect",
327
330
  label: r,
@@ -329,11 +332,11 @@ function $n(e, t) {
329
332
  help: e.help ?? "",
330
333
  enableRefresh: e.caseEnableRefresh !== !1,
331
334
  caseFilter: {
332
- agentKind: (i = e.caseFilter) == null ? void 0 : i.agentKind,
335
+ agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
333
336
  agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
334
337
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
335
338
  category: (u = e.caseFilter) == null ? void 0 : u.category,
336
- flowUniqueIds: ((d = e.caseFilter) == null ? void 0 : d.flowUniqueIds) ?? [],
339
+ flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
337
340
  pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
338
341
  },
339
342
  ...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
@@ -341,51 +344,51 @@ function $n(e, t) {
341
344
  value: { path: o }
342
345
  });
343
346
  }
344
- function Nn(e, t, n) {
347
+ function Sn(e, t, n) {
345
348
  const r = n.nameFromValue(e.value), o = {
346
349
  ...t("case_multiselect"),
347
350
  name: r,
348
351
  caseEnableRefresh: e.enableRefresh !== !1
349
- }, a = n.asLiteral(e.placeholder);
350
- a && (o.placeholder = a);
351
- const i = n.asLiteral(e.help);
352
- i && (o.help = i), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Tn(e.caseFilter));
353
- const l = Xe(e.minCount);
352
+ }, i = n.asLiteral(e.placeholder);
353
+ i && (o.placeholder = i);
354
+ const a = n.asLiteral(e.help);
355
+ a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = vn(e.caseFilter));
356
+ const l = De(e.minCount);
354
357
  l !== void 0 && (o.caseMinCount = l);
355
- const c = Xe(e.maxCount);
358
+ const c = De(e.maxCount);
356
359
  return c !== void 0 && (o.caseMaxCount = c), o;
357
360
  }
358
- const st = Be({ interactive: !0 });
359
- function ct({
361
+ const rt = ze({ interactive: !0 });
362
+ function ot({
360
363
  interactive: e,
361
364
  children: t
362
365
  }) {
363
- return /* @__PURE__ */ s(st.Provider, { value: { interactive: e }, children: t });
366
+ return /* @__PURE__ */ s(rt.Provider, { value: { interactive: e }, children: t });
364
367
  }
365
- function J() {
366
- return qe(st);
368
+ function K() {
369
+ return Re(rt);
367
370
  }
368
- function ut(e) {
371
+ function it(e) {
369
372
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
370
373
  }
371
- function Ze(e, t = "value") {
374
+ function Ke(e, t = "value") {
372
375
  const r = e.componentModel.properties[t];
373
- if (!(!ut(r) || r === void 0))
376
+ if (!(!it(r) || r === void 0))
374
377
  return e.dataContext.resolveDynamicValue(r);
375
378
  }
376
- function G(e, t = "value") {
377
- const r = e.componentModel.properties[t], o = ut(r), a = oe(
379
+ function J(e, t = "value") {
380
+ const r = e.componentModel.properties[t], o = it(r), i = Q(
378
381
  (u) => {
379
382
  if (!o || r === void 0) return () => {
380
383
  };
381
- const d = e.dataContext.subscribeDynamicValue(r, () => u());
382
- return () => d.unsubscribe();
384
+ const m = e.dataContext.subscribeDynamicValue(r, () => u());
385
+ return () => m.unsubscribe();
383
386
  },
384
387
  [e, r, o]
385
- ), i = oe(() => {
388
+ ), a = Q(() => {
386
389
  if (!(!o || r === void 0))
387
390
  return e.dataContext.resolveDynamicValue(r);
388
- }, [e, r, o]), l = Pt(a, i, i), c = oe(
391
+ }, [e, r, o]), l = Nt(i, a, a), c = Q(
389
392
  (u) => {
390
393
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
391
394
  },
@@ -393,81 +396,81 @@ function G(e, t = "value") {
393
396
  );
394
397
  return { value: l, setValue: c, hasBinding: !!o };
395
398
  }
396
- function le(e) {
399
+ function ne(e) {
397
400
  if (typeof e == "string") return e || void 0;
398
401
  if (typeof e == "number") return String(e);
399
402
  }
400
- function K(e) {
403
+ function L(e) {
401
404
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
402
405
  }
403
- function ve(e) {
406
+ function me(e) {
404
407
  if (e == null) return;
405
408
  const t = typeof e == "number" ? e : Number(e);
406
409
  if (!(!Number.isFinite(t) || t < 1))
407
410
  return Math.floor(t);
408
411
  }
409
- function pt(e, t, n, r) {
412
+ function at(e, t, n, r) {
410
413
  if (e.includes(t)) {
411
- const a = e.filter((i) => i !== t);
412
- return n !== void 0 && a.length < n ? null : a;
414
+ const i = e.filter((a) => a !== t);
415
+ return n !== void 0 && i.length < n ? null : i;
413
416
  }
414
417
  return r !== void 0 && e.length >= r ? null : [...e, t];
415
418
  }
416
- function dt(e, t, n, r, o) {
419
+ function lt(e, t, n, r, o) {
417
420
  if (!n) return !0;
418
- const a = e.includes(t);
419
- return !!(!a && o !== void 0 && e.length >= o || a && r !== void 0 && e.length <= r);
421
+ const i = e.includes(t);
422
+ return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
420
423
  }
421
- function mt(e, t) {
424
+ function st(e, t) {
422
425
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
423
426
  }
424
- const ft = Be(null);
425
- function ht({
427
+ const ct = ze(null);
428
+ function ut({
426
429
  caseSearch: e,
427
430
  children: t
428
431
  }) {
429
- return /* @__PURE__ */ s(ft.Provider, { value: e ?? null, children: t });
432
+ return /* @__PURE__ */ s(ct.Provider, { value: e ?? null, children: t });
430
433
  }
431
- function In() {
432
- return qe(ft);
434
+ function xn() {
435
+ return Re(ct);
433
436
  }
434
- function Ne(e) {
437
+ function Ce(e) {
435
438
  return typeof e == "string" ? e : "";
436
439
  }
437
- function Ie(e) {
440
+ function ke(e) {
438
441
  if (!e || typeof e != "object")
439
442
  return { flowUniqueIds: [], pageSize: 20 };
440
- 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, i = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
441
- return { agentKind: o, agentUniqueId: a, flowType: i, category: l, flowUniqueIds: c, pageSize: r };
443
+ const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
444
+ return { agentKind: o, agentUniqueId: i, flowType: a, category: l, flowUniqueIds: c, pageSize: r };
442
445
  }
443
- function ze(e) {
446
+ function Ae(e) {
444
447
  var r;
445
448
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
446
449
  return t || n;
447
450
  }
448
- function zn(e) {
451
+ function Cn(e) {
449
452
  return JSON.stringify(e);
450
453
  }
451
- const Mn = {
454
+ const kn = {
452
455
  name: "SkoponCaseSelect",
453
- schema: m.object({
454
- label: m.any().optional(),
455
- placeholder: m.any().optional(),
456
- help: m.any().optional(),
457
- enableRefresh: m.any().optional(),
458
- caseFilter: m.any().optional(),
459
- minCount: m.any().optional(),
460
- maxCount: m.any().optional(),
461
- value: m.any().optional()
456
+ schema: d.object({
457
+ label: d.any().optional(),
458
+ placeholder: d.any().optional(),
459
+ help: d.any().optional(),
460
+ enableRefresh: d.any().optional(),
461
+ caseFilter: d.any().optional(),
462
+ minCount: d.any().optional(),
463
+ maxCount: d.any().optional(),
464
+ value: d.any().optional()
462
465
  }).passthrough()
463
466
  };
464
- function Fn({
467
+ function An({
465
468
  item: e,
466
469
  selected: t,
467
470
  disabled: n,
468
471
  onToggle: r
469
472
  }) {
470
- return /* @__PURE__ */ k(
473
+ return /* @__PURE__ */ C(
471
474
  "button",
472
475
  {
473
476
  type: "button",
@@ -475,11 +478,11 @@ function Fn({
475
478
  disabled: n,
476
479
  onClick: r,
477
480
  children: [
478
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(rt, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
479
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
481
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Ge, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
482
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
480
483
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
481
484
  e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
482
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-meta", children: [
485
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
483
486
  e.caseUniqueId,
484
487
  e.platform ? ` · ${e.platform}` : "",
485
488
  e.link ? ` · ${e.link}` : ""
@@ -489,107 +492,107 @@ function Fn({
489
492
  }
490
493
  );
491
494
  }
492
- function _n({ context: e }) {
493
- const { interactive: t } = J(), n = In(), { value: r, setValue: o } = G(e), a = e.componentModel.properties, i = Ne(a.label), l = Ne(a.placeholder), c = Ne(a.help), u = a.enableRefresh !== !1, d = ve(a.minCount), p = ve(a.maxCount), g = R(() => Ie(a.caseFilter), [a.caseFilter]), v = zn(g), [$, A] = F(1), [w, f] = F(!1), [h, S] = F(""), [y, x] = F([]), [N, E] = F(0), [L, Z] = F(g.pageSize ?? 20), V = B(0), j = K(r);
494
- q(() => {
495
- const b = mt(j, p);
495
+ function Tn({ context: e }) {
496
+ const { interactive: t } = K(), n = xn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Ce(i.label), l = Ce(i.placeholder), c = Ce(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => ke(i.caseFilter), [i.caseFilter]), v = Cn(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
497
+ j(() => {
498
+ const b = st(O, p);
496
499
  b !== null && o(b);
497
- }, [p, j, o]);
498
- const Y = R(() => n ? ze(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), W = oe(
500
+ }, [p, O, o]);
501
+ const H = B(() => n ? Ae(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), Y = Q(
499
502
  async (b) => {
500
- const I = Ie(JSON.parse(v)), U = ++V.current;
501
- if (!n || !ze(I)) {
502
- x([]), E(0), S("");
503
+ const F = ke(JSON.parse(v)), R = ++w.current;
504
+ if (!n || !Ae(F)) {
505
+ S([]), z(0), x("");
503
506
  return;
504
507
  }
505
- f(!0), S("");
508
+ f(!0), x("");
506
509
  try {
507
- const T = await n({ filter: I, page: b });
508
- if (U !== V.current) return;
509
- x(T.list), E(T.total), A(T.page), Z(T.pageSize);
510
- } catch (T) {
511
- if (U !== V.current) return;
512
- x([]), E(0), S(T instanceof Error ? T.message : "加载案例列表失败");
510
+ const N = await n({ filter: F, page: b });
511
+ if (R !== w.current) return;
512
+ S(N.list), z(N.total), T(N.page), G(N.pageSize);
513
+ } catch (N) {
514
+ if (R !== w.current) return;
515
+ S([]), z(0), x(N instanceof Error ? N.message : "加载案例列表失败");
513
516
  } finally {
514
- U === V.current && f(!1);
517
+ R === w.current && f(!1);
515
518
  }
516
519
  },
517
520
  [n, v]
518
521
  );
519
- q(() => {
520
- A(1), W(1);
521
- }, [v, W]);
522
- const M = (b) => {
522
+ j(() => {
523
+ T(1), Y(1);
524
+ }, [v, Y]);
525
+ const P = (b) => {
523
526
  if (!t) return;
524
- const I = pt(
525
- j,
527
+ const F = at(
528
+ O,
526
529
  b,
527
- d,
530
+ m,
528
531
  p
529
532
  );
530
- I !== null && o(I);
533
+ F !== null && o(F);
531
534
  }, _ = () => {
532
- const b = Ie(JSON.parse(v)), I = L || b.pageSize || 20, U = Math.max(1, Math.ceil(N / I)), T = $ >= U ? 1 : $ + 1;
533
- W(T);
535
+ const b = ke(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
536
+ Y(N);
534
537
  };
535
- return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
536
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
537
- w && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
538
- /* @__PURE__ */ s(Le, { size: "small" }),
538
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
539
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
540
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
541
+ /* @__PURE__ */ s(Oe, { size: "small" }),
539
542
  " 加载案例…"
540
543
  ] }) : null,
541
- !w && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: Y }) : null,
544
+ !k && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: H }) : null,
542
545
  y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
543
- Fn,
546
+ An,
544
547
  {
545
548
  item: b,
546
- selected: j.includes(b.caseUniqueId),
547
- disabled: dt(
548
- j,
549
+ selected: O.includes(b.caseUniqueId),
550
+ disabled: lt(
551
+ O,
549
552
  b.caseUniqueId,
550
553
  t,
551
- d,
554
+ m,
552
555
  p
553
556
  ),
554
- onToggle: () => M(b.caseUniqueId)
557
+ onToggle: () => P(b.caseUniqueId)
555
558
  },
556
559
  b.caseUniqueId
557
560
  )) }) : null,
558
- u && n && ze(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
559
- xe,
561
+ u && n && Ae(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
562
+ fe,
560
563
  {
561
564
  type: "default",
562
565
  size: "small",
563
- icon: /* @__PURE__ */ s(nt, {}),
564
- loading: w,
566
+ icon: /* @__PURE__ */ s(Xe, {}),
567
+ loading: k,
565
568
  disabled: !t,
566
569
  onClick: _,
567
570
  children: "换一批"
568
571
  }
569
572
  ) }) : null,
570
- c ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
573
+ c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
571
574
  ] });
572
575
  }
573
- const Pn = O(
574
- Mn,
575
- _n
576
- ), En = {
576
+ const Nn = V(
577
+ kn,
578
+ Tn
579
+ ), In = {
577
580
  type: "case_multiselect",
578
581
  componentName: "SkoponCaseSelect",
579
- toComponent: $n,
580
- fromComponent: Nn,
581
- catalogComponents: [Pn]
582
+ toComponent: bn,
583
+ fromComponent: Sn,
584
+ catalogComponents: [Nn]
582
585
  };
583
- function Qe(e) {
586
+ function Je(e) {
584
587
  if (e == null) return;
585
588
  const t = typeof e == "number" ? e : Number(e);
586
589
  if (!(!Number.isFinite(t) || t < 1))
587
590
  return Math.floor(t);
588
591
  }
589
- function Un(e, t) {
590
- var i, l, c, u;
591
- const { id: n, label: r, path: o, withData: a } = t;
592
- return a({
592
+ function Mn(e, t) {
593
+ var a, l, c, u;
594
+ const { id: n, label: r, path: o, withData: i } = t;
595
+ return i({
593
596
  id: n,
594
597
  component: "SkoponResumeSelect",
595
598
  label: r,
@@ -597,7 +600,7 @@ function Un(e, t) {
597
600
  help: e.help ?? "",
598
601
  enableRefresh: e.resumeEnableRefresh !== !1,
599
602
  resumeFilter: {
600
- names: ((i = e.resumeFilter) == null ? void 0 : i.names) ?? [],
603
+ names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
601
604
  agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
602
605
  resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
603
606
  pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
@@ -607,15 +610,15 @@ function Un(e, t) {
607
610
  value: { path: o }
608
611
  });
609
612
  }
610
- function jn(e, t, n) {
613
+ function Fn(e, t, n) {
611
614
  const r = n.nameFromValue(e.value), o = {
612
615
  ...t("resume_multiselect"),
613
616
  name: r,
614
617
  resumeEnableRefresh: e.enableRefresh !== !1
615
- }, a = n.asLiteral(e.placeholder);
616
- a && (o.placeholder = a);
617
- const i = n.asLiteral(e.help);
618
- if (i && (o.help = i), e.resumeFilter && typeof e.resumeFilter == "object") {
618
+ }, i = n.asLiteral(e.placeholder);
619
+ i && (o.placeholder = i);
620
+ const a = n.asLiteral(e.help);
621
+ if (a && (o.help = a), e.resumeFilter && typeof e.resumeFilter == "object") {
619
622
  const u = e.resumeFilter;
620
623
  o.resumeFilter = {
621
624
  names: Array.isArray(u.names) ? u.names.map(String) : [],
@@ -624,79 +627,79 @@ function jn(e, t, n) {
624
627
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
625
628
  };
626
629
  }
627
- const l = Qe(e.minCount);
630
+ const l = Je(e.minCount);
628
631
  l !== void 0 && (o.resumeMinCount = l);
629
- const c = Qe(e.maxCount);
632
+ const c = Je(e.maxCount);
630
633
  return c !== void 0 && (o.resumeMaxCount = c), o;
631
634
  }
632
- const gt = Be(null);
633
- function yt({
635
+ const pt = ze(null);
636
+ function mt({
634
637
  resumeSearch: e,
635
638
  children: t
636
639
  }) {
637
- return /* @__PURE__ */ s(gt.Provider, { value: e ?? null, children: t });
640
+ return /* @__PURE__ */ s(pt.Provider, { value: e ?? null, children: t });
638
641
  }
639
- function Rn() {
640
- return qe(gt);
642
+ function Pn() {
643
+ return Re(pt);
641
644
  }
642
- function Me(e) {
645
+ function Te(e) {
643
646
  return typeof e == "string" ? e : "";
644
647
  }
645
- function Fe(e) {
648
+ function Ne(e) {
646
649
  if (!e || typeof e != "object")
647
650
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
648
- 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;
649
- return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: i };
651
+ const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
652
+ return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
650
653
  }
651
- function On(e) {
654
+ function Un(e) {
652
655
  return JSON.stringify(e);
653
656
  }
654
- const Vn = {
657
+ const _n = {
655
658
  name: "SkoponResumeSelect",
656
- schema: m.object({
657
- label: m.any().optional(),
658
- placeholder: m.any().optional(),
659
- help: m.any().optional(),
660
- enableRefresh: m.any().optional(),
661
- resumeFilter: m.any().optional(),
662
- minCount: m.any().optional(),
663
- maxCount: m.any().optional(),
664
- value: m.any().optional()
659
+ schema: d.object({
660
+ label: d.any().optional(),
661
+ placeholder: d.any().optional(),
662
+ help: d.any().optional(),
663
+ enableRefresh: d.any().optional(),
664
+ resumeFilter: d.any().optional(),
665
+ minCount: d.any().optional(),
666
+ maxCount: d.any().optional(),
667
+ value: d.any().optional()
665
668
  }).passthrough()
666
- }, Bn = 3, qn = 2;
667
- function _e(e, t) {
668
- const n = (t ?? []).filter(Boolean), r = n.slice(0, Bn), o = n.length - r.length;
669
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags", children: [
669
+ }, En = 3, zn = 2;
670
+ function Ie(e, t) {
671
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, En), o = n.length - r.length;
672
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
670
673
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
671
- n.length > 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags-list", children: [
672
- r.map((a) => /* @__PURE__ */ s(ie, { className: "skopon-resume-select-card-tag", children: a }, a)),
673
- o > 0 ? /* @__PURE__ */ k(ie, { className: "skopon-resume-select-card-tag", children: [
674
+ n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
675
+ r.map((i) => /* @__PURE__ */ s(te, { className: "skopon-resume-select-card-tag", children: i }, i)),
676
+ o > 0 ? /* @__PURE__ */ C(te, { className: "skopon-resume-select-card-tag", children: [
674
677
  "+",
675
678
  o
676
679
  ] }) : null
677
680
  ] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
678
681
  ] });
679
682
  }
680
- function Ln(e) {
681
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-field", children: [
683
+ function Rn(e) {
684
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
682
685
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
683
686
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
684
687
  ] });
685
688
  }
686
- function Dn({ work: e }) {
687
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-work", children: [
688
- /* @__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(Kt, { className: "skopon-resume-select-card-work-placeholder" }) }),
689
+ function On({ work: e }) {
690
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
691
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Bt, { className: "skopon-resume-select-card-work-placeholder" }) }),
689
692
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
690
693
  ] });
691
694
  }
692
- function Kn({
695
+ function Bn({
693
696
  item: e,
694
697
  selected: t,
695
698
  disabled: n,
696
699
  onToggle: r
697
700
  }) {
698
- const o = (e.works ?? []).slice(0, qn);
699
- return /* @__PURE__ */ k(
701
+ const o = (e.works ?? []).slice(0, zn);
702
+ return /* @__PURE__ */ C(
700
703
  "button",
701
704
  {
702
705
  type: "button",
@@ -705,182 +708,182 @@ function Kn({
705
708
  onClick: r,
706
709
  children: [
707
710
  /* @__PURE__ */ s(
708
- jt,
711
+ Ft,
709
712
  {
710
713
  size: 48,
711
714
  src: e.avatarUrl || void 0,
712
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Dt, {}),
715
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ot, {}),
713
716
  className: "skopon-resume-select-card-avatar"
714
717
  }
715
718
  ),
716
719
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
717
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
718
- Ln(e.satisfaction),
719
- _e("性格", e.personality),
720
- _e("专长", e.specialties),
721
- _e("擅长领域", e.traits),
722
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-works", children: [
720
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
721
+ Rn(e.satisfaction),
722
+ Ie("性格", e.personality),
723
+ Ie("专长", e.specialties),
724
+ Ie("擅长领域", e.traits),
725
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
723
726
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
724
- o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((a, i) => /* @__PURE__ */ s(Dn, { work: a }, `${a.title}-${i}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
727
+ o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ s(On, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
725
728
  ] })
726
729
  ] })
727
730
  ]
728
731
  }
729
732
  );
730
733
  }
731
- function Hn({ context: e }) {
732
- const { interactive: t } = J(), n = Rn(), { value: r, setValue: o } = G(e), a = e.componentModel.properties, i = Me(a.label), l = Me(a.placeholder), c = Me(a.help), u = a.enableRefresh !== !1, d = ve(a.minCount), p = ve(a.maxCount), g = R(() => Fe(a.resumeFilter), [a.resumeFilter]), v = On(g), [$, A] = F(1), [w, f] = F(!1), [h, S] = F(""), [y, x] = F([]), [N, E] = F(0), [L, Z] = F(g.pageSize ?? 20), V = B(0), j = K(r);
733
- q(() => {
734
- const b = mt(j, p);
734
+ function Vn({ context: e }) {
735
+ const { interactive: t } = K(), n = Pn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Te(i.label), l = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => Ne(i.resumeFilter), [i.resumeFilter]), v = Un(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
736
+ j(() => {
737
+ const b = st(O, p);
735
738
  b !== null && o(b);
736
- }, [p, j, o]);
737
- const Y = oe(
739
+ }, [p, O, o]);
740
+ const H = Q(
738
741
  async (b) => {
739
- const I = Fe(JSON.parse(v)), U = ++V.current;
742
+ const F = Ne(JSON.parse(v)), R = ++w.current;
740
743
  if (!n) {
741
- x([]), E(0), S("未配置简历搜索服务");
744
+ S([]), z(0), x("未配置简历搜索服务");
742
745
  return;
743
746
  }
744
- f(!0), S("");
747
+ f(!0), x("");
745
748
  try {
746
- const T = await n({ filter: I, page: b });
747
- if (U !== V.current) return;
748
- x(T.list), E(T.total), A(T.page), Z(T.pageSize);
749
- } catch (T) {
750
- if (U !== V.current) return;
751
- x([]), E(0), S(T instanceof Error ? T.message : "加载简历列表失败");
749
+ const N = await n({ filter: F, page: b });
750
+ if (R !== w.current) return;
751
+ S(N.list), z(N.total), T(N.page), G(N.pageSize);
752
+ } catch (N) {
753
+ if (R !== w.current) return;
754
+ S([]), z(0), x(N instanceof Error ? N.message : "加载简历列表失败");
752
755
  } finally {
753
- U === V.current && f(!1);
756
+ R === w.current && f(!1);
754
757
  }
755
758
  },
756
759
  [n, v]
757
760
  );
758
- q(() => {
759
- A(1), Y(1);
760
- }, [v, Y]);
761
- const W = (b) => {
761
+ j(() => {
762
+ T(1), H(1);
763
+ }, [v, H]);
764
+ const Y = (b) => {
762
765
  if (!t) return;
763
- const I = pt(
764
- j,
766
+ const F = at(
767
+ O,
765
768
  b,
766
- d,
769
+ m,
767
770
  p
768
771
  );
769
- I !== null && o(I);
770
- }, M = () => {
771
- const b = Fe(JSON.parse(v)), I = L || b.pageSize || 20, U = Math.max(1, Math.ceil(N / I)), T = $ >= U ? 1 : $ + 1;
772
- Y(T);
772
+ F !== null && o(F);
773
+ }, P = () => {
774
+ const b = Ne(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
775
+ H(N);
773
776
  }, _ = l || "暂无匹配的简历";
774
- return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
775
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
776
- w && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
777
- /* @__PURE__ */ s(Le, { size: "small" }),
777
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
778
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
779
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
780
+ /* @__PURE__ */ s(Oe, { size: "small" }),
778
781
  " 加载简历…"
779
782
  ] }) : null,
780
- !w && h ? /* @__PURE__ */ s(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
781
- !w && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
783
+ !k && h ? /* @__PURE__ */ s(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
784
+ !k && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
782
785
  y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
783
- Kn,
786
+ Bn,
784
787
  {
785
788
  item: b,
786
- selected: j.includes(b.resumeUniqueId),
787
- disabled: dt(
788
- j,
789
+ selected: O.includes(b.resumeUniqueId),
790
+ disabled: lt(
791
+ O,
789
792
  b.resumeUniqueId,
790
793
  t,
791
- d,
794
+ m,
792
795
  p
793
796
  ),
794
- onToggle: () => W(b.resumeUniqueId)
797
+ onToggle: () => Y(b.resumeUniqueId)
795
798
  },
796
799
  b.resumeUniqueId
797
800
  )) }) : null,
798
801
  u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
799
- xe,
802
+ fe,
800
803
  {
801
804
  type: "default",
802
805
  size: "small",
803
- icon: /* @__PURE__ */ s(nt, {}),
804
- loading: w,
806
+ icon: /* @__PURE__ */ s(Xe, {}),
807
+ loading: k,
805
808
  disabled: !t,
806
- onClick: M,
809
+ onClick: P,
807
810
  children: "换一批"
808
811
  }
809
812
  ) }) : null,
810
- c ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
813
+ c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
811
814
  ] });
812
815
  }
813
- const Jn = O(
814
- Vn,
815
- Hn
816
- ), Gn = {
816
+ const wn = V(
817
+ _n,
818
+ Vn
819
+ ), qn = {
817
820
  type: "resume_multiselect",
818
821
  componentName: "SkoponResumeSelect",
819
- toComponent: Un,
820
- fromComponent: jn,
821
- catalogComponents: [Jn]
822
- }, Se = [Gn, En], Yn = new Map(
823
- Se.map((e) => [e.type, e])
824
- ), Wn = new Map(
825
- Se.map((e) => [e.componentName, e])
822
+ toComponent: Mn,
823
+ fromComponent: Fn,
824
+ catalogComponents: [wn]
825
+ }, he = [qn, In], jn = new Map(
826
+ he.map((e) => [e.type, e])
827
+ ), $n = new Map(
828
+ he.map((e) => [e.componentName, e])
826
829
  );
827
- function Xn(e) {
828
- return Yn.get(e);
830
+ function Ln(e) {
831
+ return jn.get(e);
829
832
  }
830
- function Zn(e) {
831
- return Wn.get(e);
833
+ function Dn(e) {
834
+ return $n.get(e);
832
835
  }
833
- function Qn() {
834
- return Se.flatMap((e) => e.catalogComponents);
836
+ function Kn() {
837
+ return he.flatMap((e) => e.catalogComponents);
835
838
  }
836
- function er() {
837
- return Se.map((e) => e.componentName);
839
+ function Jn() {
840
+ return he.map((e) => e.componentName);
838
841
  }
839
- const be = "root", Re = "__title__", Oe = "__desc__", vt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
840
- function tr(e) {
842
+ const de = "root", Ue = "__title__", _e = "__desc__", dt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
843
+ function Hn(e) {
841
844
  return `/${e}`;
842
845
  }
843
- function et(e) {
846
+ function He(e) {
844
847
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
845
848
  }
846
- function P(e) {
849
+ function E(e) {
847
850
  if (typeof e == "string") return e;
848
851
  }
849
- function nr(e) {
850
- const t = e.id || se("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
852
+ function Yn(e) {
853
+ const t = e.id || re("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
851
854
  return {
852
855
  id: t,
853
856
  component: "SkoponMedia",
854
857
  mediaType: n,
855
- urls: yn(e),
856
- mediaSize: ue(e.mediaSize),
858
+ urls: cn(e),
859
+ mediaSize: ie(e.mediaSize),
857
860
  label: e.label ?? "",
858
861
  help: e.help ?? "",
859
862
  placeholder: e.placeholder ?? ""
860
863
  };
861
864
  }
862
- function rr(e) {
865
+ function Xn(e) {
863
866
  if (Array.isArray(e.urls))
864
867
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
865
- const t = P(e.url);
868
+ const t = E(e.url);
866
869
  return t != null && t.trim() ? [t.trim()] : [];
867
870
  }
868
- function me(e, t, n) {
869
- const r = typeof e.id == "string" ? e.id : se("block-"), o = rr(e), a = P(e.label) ?? P(e.description) ?? n, i = P(e.help), l = P(e.placeholder), c = ue(e.mediaSize);
871
+ function se(e, t, n) {
872
+ const r = typeof e.id == "string" ? e.id : re("block-"), o = Xn(e), i = E(e.label) ?? E(e.description) ?? n, a = E(e.help), l = E(e.placeholder), c = ie(e.mediaSize);
870
873
  return {
871
874
  id: r,
872
875
  type: t,
873
- label: a,
874
- ...i ? { help: i } : {},
876
+ label: i,
877
+ ...a ? { help: a } : {},
875
878
  ...l ? { placeholder: l } : {},
876
879
  mediaSize: c,
877
880
  mediaUrls: o.length > 0 ? o : [""]
878
881
  };
879
882
  }
880
- function or(e) {
883
+ function Gn(e) {
881
884
  switch (e.type) {
882
885
  case "toggle":
883
- return Je(e.defaultValue);
886
+ return qe(e.defaultValue);
884
887
  case "multiselect":
885
888
  case "checkbox":
886
889
  case "resume_multiselect":
@@ -894,9 +897,9 @@ function or(e) {
894
897
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
895
898
  }
896
899
  }
897
- function ar(e) {
900
+ function Wn(e) {
898
901
  var u;
899
- const t = e.id || se("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? tr(r) : void 0, a = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), i = (d) => r ? { node: d, dataKey: r, dataValue: or(e) } : { node: d }, l = { id: t, label: n, name: r, path: o, withData: i }, c = Xn(e.type);
902
+ const t = e.id || re("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Hn(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: Gn(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: a }, c = Ln(e.type);
900
903
  if (c)
901
904
  return c.toComponent(e, l);
902
905
  switch (e.type) {
@@ -907,7 +910,7 @@ function ar(e) {
907
910
  case "text":
908
911
  case "tel":
909
912
  case "url":
910
- return i({
913
+ return a({
911
914
  id: t,
912
915
  component: "TextField",
913
916
  label: n,
@@ -916,17 +919,17 @@ function ar(e) {
916
919
  value: { path: o }
917
920
  });
918
921
  case "email":
919
- return i({
922
+ return a({
920
923
  id: t,
921
924
  component: "TextField",
922
925
  label: n,
923
926
  variant: "shortText",
924
- validationRegexp: vt,
927
+ validationRegexp: dt,
925
928
  ...e.placeholder ? { placeholder: e.placeholder } : {},
926
929
  value: { path: o }
927
930
  });
928
931
  case "textarea":
929
- return i({
932
+ return a({
930
933
  id: t,
931
934
  component: "TextField",
932
935
  label: n,
@@ -935,7 +938,7 @@ function ar(e) {
935
938
  value: { path: o }
936
939
  });
937
940
  case "number":
938
- return i({
941
+ return a({
939
942
  id: t,
940
943
  component: "TextField",
941
944
  label: n,
@@ -944,49 +947,49 @@ function ar(e) {
944
947
  value: { path: o }
945
948
  });
946
949
  case "select":
947
- return i({
950
+ return a({
948
951
  id: t,
949
952
  component: "SkoponSelect",
950
953
  label: n,
951
954
  mode: "single",
952
955
  placeholder: e.placeholder ?? "",
953
- options: a,
956
+ options: i,
954
957
  value: { path: o }
955
958
  });
956
959
  case "radio":
957
- return i({
960
+ return a({
958
961
  id: t,
959
962
  component: "ChoicePicker",
960
963
  label: n,
961
964
  variant: "mutuallyExclusive",
962
965
  skoponPickerType: "radio",
963
- options: a,
966
+ options: i,
964
967
  value: { path: o }
965
968
  });
966
969
  case "multiselect":
967
- return i({
970
+ return a({
968
971
  id: t,
969
972
  component: "SkoponSelect",
970
973
  label: n,
971
974
  mode: "multiple",
972
975
  placeholder: e.placeholder ?? "",
973
- options: a,
976
+ options: i,
974
977
  value: { path: o }
975
978
  });
976
979
  case "checkbox":
977
- return i({
980
+ return a({
978
981
  id: t,
979
982
  component: "ChoicePicker",
980
983
  label: n,
981
984
  variant: "multipleSelection",
982
985
  skoponPickerType: "checkbox",
983
- options: a,
986
+ options: i,
984
987
  value: { path: o }
985
988
  });
986
989
  case "toggle":
987
- return i({ id: t, component: "CheckBox", label: n, value: { path: o } });
990
+ return a({ id: t, component: "CheckBox", label: n, value: { path: o } });
988
991
  case "datetime":
989
- return i({
992
+ return a({
990
993
  id: t,
991
994
  component: "DateTimeInput",
992
995
  label: n,
@@ -996,7 +999,7 @@ function ar(e) {
996
999
  value: { path: o }
997
1000
  });
998
1001
  case "time":
999
- return i({
1002
+ return a({
1000
1003
  id: t,
1001
1004
  component: "DateTimeInput",
1002
1005
  label: n,
@@ -1007,9 +1010,9 @@ function ar(e) {
1007
1010
  case "image":
1008
1011
  case "video":
1009
1012
  case "audio":
1010
- return { node: nr(e) };
1013
+ return { node: Yn(e) };
1011
1014
  case "file":
1012
- return i({
1015
+ return a({
1013
1016
  id: t,
1014
1017
  component: "FileUpload",
1015
1018
  label: n,
@@ -1024,31 +1027,31 @@ function ar(e) {
1024
1027
  return { node: null };
1025
1028
  }
1026
1029
  }
1027
- function Ve(e) {
1030
+ function Ee(e) {
1028
1031
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1029
- const t = e.components.find((r) => r.id === be);
1032
+ const t = e.components.find((r) => r.id === de);
1030
1033
  if (!t) return e.components.length === 0;
1031
1034
  const n = t.children;
1032
1035
  return !Array.isArray(n) || n.length === 0;
1033
1036
  }
1034
- function bt(e, t) {
1035
- const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1, i = (e.title ?? "").trim(), l = (e.description ?? "").trim();
1036
- a && i && (n.push({ id: Re, component: "Text", text: i, variant: "h2" }), r.push(Re)), a && l && (n.push({ id: Oe, component: "Text", text: l, variant: "body" }), r.push(Oe));
1037
- for (const d of e.blocks ?? []) {
1038
- const { node: p, dataKey: g, dataValue: v } = ar(d);
1037
+ function ft(e, t) {
1038
+ const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
1039
+ i && a && (n.push({ id: Ue, component: "Text", text: a, variant: "h2" }), r.push(Ue)), i && l && (n.push({ id: _e, component: "Text", text: l, variant: "body" }), r.push(_e));
1040
+ for (const m of e.blocks ?? []) {
1041
+ const { node: p, dataKey: g, dataValue: v } = Wn(m);
1039
1042
  p && (n.push(p), r.push(p.id), g && (o[g] = v));
1040
1043
  }
1041
- n.unshift({ id: be, component: "Column", children: r });
1042
- const c = { root: be, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1044
+ n.unshift({ id: de, component: "Column", children: r });
1045
+ const c = { root: de, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1043
1046
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
1044
1047
  }
1045
- function ir(e) {
1048
+ function Zn(e) {
1046
1049
  const t = /* @__PURE__ */ new Map();
1047
1050
  for (const n of e.components ?? [])
1048
1051
  n && typeof n.id == "string" && t.set(n.id, n);
1049
1052
  return t;
1050
1053
  }
1051
- function Pe(e) {
1054
+ function Me(e) {
1052
1055
  const t = e.options;
1053
1056
  return Array.isArray(t) ? t.map((n) => {
1054
1057
  if (!n || typeof n != "object") return null;
@@ -1059,10 +1062,10 @@ function Pe(e) {
1059
1062
  };
1060
1063
  }).filter((n) => !!n) : [];
1061
1064
  }
1062
- function lr(e) {
1063
- const t = typeof e.id == "string" ? e.id : se("block-"), n = String(e.component ?? ""), r = P(e.label) ?? P(e.text) ?? "", o = et(e.value), a = (l) => ({ id: t, type: l, label: r }), i = Zn(n);
1064
- if (i)
1065
- return i.fromComponent(e, a, { asLiteral: P, nameFromValue: et });
1065
+ function Qn(e) {
1066
+ const t = typeof e.id == "string" ? e.id : re("block-"), n = String(e.component ?? ""), r = E(e.label) ?? E(e.text) ?? "", o = He(e.value), i = (l) => ({ id: t, type: l, label: r }), a = Dn(n);
1067
+ if (a)
1068
+ return a.fromComponent(e, i, { asLiteral: E, nameFromValue: He });
1066
1069
  switch (n) {
1067
1070
  case "Text": {
1068
1071
  const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
@@ -1071,104 +1074,104 @@ function lr(e) {
1071
1074
  case "TextField": {
1072
1075
  const l = String(e.variant ?? "shortText");
1073
1076
  let c = "text";
1074
- l === "longText" ? c = "textarea" : l === "number" ? c = "number" : P(e.validationRegexp) === vt && (c = "email");
1075
- const u = { ...a(c), name: o }, d = P(e.placeholder);
1076
- return d && (u.placeholder = d), u;
1077
+ l === "longText" ? c = "textarea" : l === "number" ? c = "number" : E(e.validationRegexp) === dt && (c = "email");
1078
+ const u = { ...i(c), name: o }, m = E(e.placeholder);
1079
+ return m && (u.placeholder = m), u;
1077
1080
  }
1078
1081
  case "CheckBox":
1079
- return { ...a("toggle"), name: o };
1082
+ return { ...i("toggle"), name: o };
1080
1083
  case "SkoponSelect": {
1081
1084
  const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
1082
- ...a(c),
1085
+ ...i(c),
1083
1086
  name: o,
1084
- options: Pe(e)
1085
- }, d = P(e.placeholder);
1086
- return d && (u.placeholder = d), u;
1087
+ options: Me(e)
1088
+ }, m = E(e.placeholder);
1089
+ return m && (u.placeholder = m), u;
1087
1090
  }
1088
1091
  case "ChoicePicker": {
1089
- const l = P(e.skoponPickerType);
1092
+ const l = E(e.skoponPickerType);
1090
1093
  if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
1091
- const d = {
1092
- ...a(l),
1094
+ const m = {
1095
+ ...i(l),
1093
1096
  name: o,
1094
- options: Pe(e)
1095
- }, p = P(e.placeholder);
1096
- return p && (d.placeholder = p), d;
1097
+ options: Me(e)
1098
+ }, p = E(e.placeholder);
1099
+ return p && (m.placeholder = p), m;
1097
1100
  }
1098
1101
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1099
- return { ...a(u), name: o, options: Pe(e) };
1102
+ return { ...i(u), name: o, options: Me(e) };
1100
1103
  }
1101
1104
  case "DateTimeInput": {
1102
- const l = e.enableDate === !0, c = e.enableTime === !0, d = { ...a(!l && c ? "time" : "datetime"), name: o }, p = P(e.placeholder);
1103
- return p && (d.placeholder = p), d;
1105
+ const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...i(!l && c ? "time" : "datetime"), name: o }, p = E(e.placeholder);
1106
+ return p && (m.placeholder = p), m;
1104
1107
  }
1105
1108
  case "SkoponMedia": {
1106
1109
  const l = String(e.mediaType ?? "image");
1107
- return me(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1110
+ return se(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1108
1111
  }
1109
1112
  case "Image":
1110
- return me(e, "image", r);
1113
+ return se(e, "image", r);
1111
1114
  case "Video":
1112
- return me(e, "video", r);
1115
+ return se(e, "video", r);
1113
1116
  case "AudioPlayer":
1114
- return me(e, "audio", r);
1117
+ return se(e, "audio", r);
1115
1118
  case "FileUpload": {
1116
- const l = P(e.accept) ?? "", c = { ...a("file"), name: o };
1119
+ const l = E(e.accept) ?? "", c = { ...i("file"), name: o };
1117
1120
  return l && (c.fileAcceptExtensions = l.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1118
1121
  }
1119
1122
  default:
1120
1123
  return null;
1121
1124
  }
1122
1125
  }
1123
- function xt(e, t, n, r) {
1126
+ function ht(e, t, n, r) {
1124
1127
  if (n.has(e)) return;
1125
1128
  n.add(e);
1126
1129
  const o = t.get(e);
1127
1130
  if (!o) return;
1128
- const a = String(o.component ?? "");
1129
- if ((a === "Column" || a === "Row") && Array.isArray(o.children)) {
1130
- for (const i of o.children)
1131
- typeof i == "string" && xt(i, t, n, r);
1131
+ const i = String(o.component ?? "");
1132
+ if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1133
+ for (const a of o.children)
1134
+ typeof a == "string" && ht(a, t, n, r);
1132
1135
  return;
1133
1136
  }
1134
1137
  r.push(o);
1135
1138
  }
1136
- function sr(e, t) {
1139
+ function er(e, t) {
1137
1140
  return t ? e.map((n) => {
1138
- var a;
1139
- const r = (a = n.name) == null ? void 0 : a.trim();
1141
+ var i;
1142
+ const r = (i = n.name) == null ? void 0 : i.trim();
1140
1143
  if (!r || !(r in t)) return n;
1141
1144
  const o = t[r];
1142
1145
  return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1143
1146
  }) : e;
1144
1147
  }
1145
- function cr(e) {
1148
+ function tr(e) {
1146
1149
  if (!e || !Array.isArray(e.components))
1147
- return ye({ title: "", description: "", blocks: [], jsonSchema: {} });
1148
- const t = ir(e), n = [];
1149
- xt(e.root ?? be, t, /* @__PURE__ */ new Set(), n);
1150
+ return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
1151
+ const t = Zn(e), n = [];
1152
+ ht(e.root ?? de, t, /* @__PURE__ */ new Set(), n);
1150
1153
  let r = "", o = "";
1151
- const a = [];
1152
- for (const i of n) {
1153
- if (i.id === Re) {
1154
- r = P(i.text) ?? r;
1154
+ const i = [];
1155
+ for (const a of n) {
1156
+ if (a.id === Ue) {
1157
+ r = E(a.text) ?? r;
1155
1158
  continue;
1156
1159
  }
1157
- if (i.id === Oe) {
1158
- o = P(i.text) ?? o;
1160
+ if (a.id === _e) {
1161
+ o = E(a.text) ?? o;
1159
1162
  continue;
1160
1163
  }
1161
- const l = lr(i);
1162
- l && a.push(l);
1164
+ const l = Qn(a);
1165
+ l && i.push(l);
1163
1166
  }
1164
- return ye({
1167
+ return pe({
1165
1168
  title: r,
1166
1169
  description: o,
1167
- blocks: sr(a, e.dataModel),
1170
+ blocks: er(i, e.dataModel),
1168
1171
  jsonSchema: {}
1169
1172
  });
1170
1173
  }
1171
- function ur(e, t) {
1174
+ function nr(e, t) {
1172
1175
  const { surfaceId: n, catalogId: r } = t, o = [
1173
1176
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1174
1177
  {
@@ -1181,24 +1184,24 @@ function ur(e, t) {
1181
1184
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1182
1185
  }), o;
1183
1186
  }
1184
- function St(e) {
1187
+ function gt(e) {
1185
1188
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1186
1189
  }
1187
- function pr(e, t) {
1190
+ function rr(e, t) {
1188
1191
  if (!e || typeof e != "object") return null;
1189
- const n = e, r = St(n.a2ui) ? n.a2ui : void 0;
1190
- if (r && !Ve(r)) return r;
1192
+ const n = e, r = gt(n.a2ui) ? n.a2ui : void 0;
1193
+ if (r && !Ee(r)) return r;
1191
1194
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1192
1195
  if (o.length === 0) return null;
1193
- const a = ne({
1196
+ const i = W({
1194
1197
  title: typeof n.title == "string" ? n.title : "",
1195
1198
  description: typeof n.description == "string" ? n.description : "",
1196
1199
  blocks: o
1197
- }), i = bt(a, t);
1198
- return Ve(i) ? null : i;
1200
+ }), a = ft(i, t);
1201
+ return Ee(a) ? null : a;
1199
1202
  }
1200
- function dr(e, t, n) {
1201
- return bt(
1203
+ function or(e, t, n) {
1204
+ return ft(
1202
1205
  {
1203
1206
  title: e.title,
1204
1207
  description: e.description,
@@ -1207,88 +1210,88 @@ function dr(e, t, n) {
1207
1210
  n
1208
1211
  );
1209
1212
  }
1210
- function mr(e) {
1213
+ function ir(e) {
1211
1214
  if (!e || typeof e != "object" || Array.isArray(e))
1212
1215
  return;
1213
1216
  const t = e;
1214
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && St(t.a2ui) ? cr(t.a2ui) : ne({
1217
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gt(t.a2ui) ? tr(t.a2ui) : W({
1215
1218
  title: typeof t.title == "string" ? t.title : "",
1216
1219
  description: typeof t.description == "string" ? t.description : "",
1217
1220
  blocks: Array.isArray(t.blocks) ? t.blocks : []
1218
1221
  });
1219
1222
  }
1220
- function fr(e, t, n) {
1223
+ function ar(e, t, n) {
1221
1224
  const r = e.model.surfacesMap.get(t);
1222
1225
  if (!r) return {};
1223
1226
  const o = {};
1224
- for (const a of n) {
1225
- const i = a.trim();
1226
- i && (o[i] = r.dataModel.get(`/${i}`));
1227
+ for (const i of n) {
1228
+ const a = i.trim();
1229
+ a && (o[a] = r.dataModel.get(`/${a}`));
1227
1230
  }
1228
1231
  return o;
1229
1232
  }
1230
- function hr(e) {
1231
- return ne({
1233
+ function lr(e) {
1234
+ return W({
1232
1235
  title: "",
1233
1236
  description: "",
1234
1237
  blocks: [e]
1235
1238
  }).blocks[0];
1236
1239
  }
1237
- function gr(e, t) {
1238
- var o, a;
1240
+ function sr(e, t) {
1241
+ var o, i;
1239
1242
  const n = /* @__PURE__ */ new Map();
1240
- for (const i of t) {
1241
- const l = (o = i.name) == null ? void 0 : o.trim();
1242
- l && n.set(l, i);
1243
+ for (const a of t) {
1244
+ const l = (o = a.name) == null ? void 0 : o.trim();
1245
+ l && n.set(l, a);
1243
1246
  }
1244
1247
  const r = [];
1245
- for (const i of e.blocks) {
1246
- if (De(i.type)) {
1247
- r.push(hr(i));
1248
+ for (const a of e.blocks) {
1249
+ if (Be(a.type)) {
1250
+ r.push(lr(a));
1248
1251
  continue;
1249
1252
  }
1250
- if (!X(i.type)) continue;
1251
- const l = (a = i.name) == null ? void 0 : a.trim();
1253
+ if (!X(a.type)) continue;
1254
+ const l = (i = a.name) == null ? void 0 : i.trim();
1252
1255
  if (!l) continue;
1253
1256
  const c = n.get(l);
1254
1257
  c && r.push(c);
1255
1258
  }
1256
1259
  return r;
1257
1260
  }
1258
- function yr(e, t) {
1261
+ function cr(e, t) {
1259
1262
  var r;
1260
1263
  const n = {
1261
1264
  ...e,
1262
1265
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1263
1266
  };
1264
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ne({
1267
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), W({
1265
1268
  title: "",
1266
1269
  description: "",
1267
1270
  blocks: [n]
1268
1271
  }).blocks[0];
1269
1272
  }
1270
- function kt(e) {
1273
+ function yt(e) {
1271
1274
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1272
1275
  const t = e;
1273
- return Array.isArray(t.blocks) ? ne({
1276
+ return Array.isArray(t.blocks) ? W({
1274
1277
  title: typeof t.title == "string" ? t.title : "",
1275
1278
  description: typeof t.description == "string" ? t.description : "",
1276
1279
  blocks: t.blocks
1277
1280
  }) : null;
1278
1281
  }
1279
- function vr(e, t) {
1280
- var a, i, l, c, u, d;
1282
+ function ur(e, t) {
1283
+ var i, a, l, c, u, m;
1281
1284
  const n = /* @__PURE__ */ new Map();
1282
1285
  for (const p of (t == null ? void 0 : t.blocks) ?? [])
1283
- X(p.type) && ((a = p.name) != null && a.trim()) && n.set(p.name.trim(), p);
1286
+ X(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1284
1287
  const r = [], o = [];
1285
1288
  for (const p of e.blocks) {
1286
1289
  if (!X(p.type)) continue;
1287
- const g = (i = p.name) == null ? void 0 : i.trim();
1290
+ const g = (a = p.name) == null ? void 0 : a.trim();
1288
1291
  if (!g) continue;
1289
1292
  const v = n.get(g);
1290
- v ? r.push(yr(v, p)) : o.push(
1291
- ne({
1293
+ v ? r.push(cr(v, p)) : o.push(
1294
+ W({
1292
1295
  title: "",
1293
1296
  description: "",
1294
1297
  blocks: [p]
@@ -1298,26 +1301,26 @@ function vr(e, t) {
1298
1301
  return {
1299
1302
  matchedBlocks: r,
1300
1303
  extraBlocks: o,
1301
- renderBlocks: gr(e, r),
1304
+ renderBlocks: sr(e, r),
1302
1305
  title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1303
- description: ((u = e.description) == null ? void 0 : u.trim()) || ((d = t == null ? void 0 : t.description) == null ? void 0 : d.trim()) || ""
1306
+ description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
1304
1307
  };
1305
1308
  }
1306
- function br(e) {
1309
+ function pr(e) {
1307
1310
  const { type: t, defaultValue: n } = e;
1308
1311
  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 : "";
1309
1312
  }
1310
- function wt(e) {
1313
+ function vt(e) {
1311
1314
  var n;
1312
1315
  const t = {};
1313
1316
  for (const r of e) {
1314
1317
  if (!X(r.type)) continue;
1315
1318
  const o = (n = r.name) == null ? void 0 : n.trim();
1316
- o && (t[o] = br(r));
1319
+ o && (t[o] = pr(r));
1317
1320
  }
1318
1321
  return t;
1319
1322
  }
1320
- function xr(e) {
1323
+ function mr(e) {
1321
1324
  return e.blocks.some(
1322
1325
  (t) => {
1323
1326
  var n;
@@ -1325,57 +1328,57 @@ function xr(e) {
1325
1328
  }
1326
1329
  );
1327
1330
  }
1328
- function Sr(e) {
1331
+ function dr(e) {
1329
1332
  return e.blocks.filter((t) => {
1330
1333
  var n;
1331
- return De(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
1334
+ return Be(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
1332
1335
  });
1333
1336
  }
1334
- function kr(e) {
1337
+ function fr(e) {
1335
1338
  return e.blocks.filter((t) => {
1336
1339
  var n;
1337
1340
  return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1338
1341
  }).map((t) => t.name.trim());
1339
1342
  }
1340
- function Ct(e) {
1343
+ function bt(e) {
1341
1344
  return e.replace(/'/g, "'\\''");
1342
1345
  }
1343
- function At(e, t) {
1346
+ function St(e, t) {
1344
1347
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1345
1348
  return [
1346
1349
  `curl -X POST '${n}' \\`,
1347
1350
  " -H 'Content-Type: application/json' \\",
1348
- ` -d '${Ct(r)}'`
1351
+ ` -d '${bt(r)}'`
1349
1352
  ].join(`
1350
1353
  `);
1351
1354
  }
1352
- function wr(e, t) {
1355
+ function hr(e, t) {
1353
1356
  return JSON.stringify({ ...e, ...t }, null, 2);
1354
1357
  }
1355
- function Tt({
1358
+ function xt({
1356
1359
  cardValues: e,
1357
1360
  extraValues: t = {},
1358
1361
  callbackUrl: n
1359
1362
  }) {
1360
- const r = (n ?? "").trim() || "<callback_url>", o = wr(e, t);
1363
+ const r = (n ?? "").trim() || "<callback_url>", o = hr(e, t);
1361
1364
  return [
1362
1365
  `curl -X POST '${r}' \\`,
1363
1366
  " -H 'Content-Type: application/json' \\",
1364
- ` -d '${Ct(o)}'`
1367
+ ` -d '${bt(o)}'`
1365
1368
  ].join(`
1366
1369
  `);
1367
1370
  }
1368
- function Cr(e, t) {
1369
- const n = kt(e);
1370
- if (!n) return At(e, t);
1371
- const r = wt(n.blocks);
1372
- return Tt({ cardValues: r, callbackUrl: t });
1371
+ function gr(e, t) {
1372
+ const n = yt(e);
1373
+ if (!n) return St(e, t);
1374
+ const r = vt(n.blocks);
1375
+ return xt({ cardValues: r, callbackUrl: t });
1373
1376
  }
1374
- async function Ar(e, t, n) {
1377
+ async function yr(e, t, n) {
1375
1378
  const r = e.trim();
1376
1379
  if (!r)
1377
1380
  throw new Error("callback_url 为空");
1378
- const a = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1381
+ const i = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1379
1382
  method: "POST",
1380
1383
  headers: {
1381
1384
  "Content-Type": "application/json",
@@ -1383,22 +1386,22 @@ async function Ar(e, t, n) {
1383
1386
  },
1384
1387
  body: JSON.stringify(t ?? {})
1385
1388
  });
1386
- let i;
1387
- if ((a.headers.get("content-type") ?? "").includes("application/json"))
1389
+ let a;
1390
+ if ((i.headers.get("content-type") ?? "").includes("application/json"))
1388
1391
  try {
1389
- i = await a.json();
1392
+ a = await i.json();
1390
1393
  } catch {
1391
- i = void 0;
1394
+ a = void 0;
1392
1395
  }
1393
1396
  else
1394
1397
  try {
1395
- i = await a.text();
1398
+ a = await i.text();
1396
1399
  } catch {
1397
- i = void 0;
1400
+ a = void 0;
1398
1401
  }
1399
- return { ok: a.ok, status: a.status, body: i };
1402
+ return { ok: i.ok, status: i.status, body: a };
1400
1403
  }
1401
- async function $t(e) {
1404
+ async function Ct(e) {
1402
1405
  var n;
1403
1406
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1404
1407
  await navigator.clipboard.writeText(e);
@@ -1414,7 +1417,7 @@ async function $t(e) {
1414
1417
  document.body.removeChild(t);
1415
1418
  }
1416
1419
  }
1417
- async function Tr(e) {
1420
+ async function vr(e) {
1418
1421
  let t;
1419
1422
  try {
1420
1423
  t = await e.json();
@@ -1427,901 +1430,45 @@ async function Tr(e) {
1427
1430
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1428
1431
  return t.data;
1429
1432
  }
1430
- function To(e = {}) {
1433
+ function io(e = {}) {
1431
1434
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1432
- async function o(a) {
1435
+ async function o(i) {
1433
1436
  var p;
1434
- const i = new URLSearchParams();
1435
- if (a.formId !== void 0)
1436
- i.set("form_id", String(a.formId));
1437
- else if (a.formUniqueId)
1438
- i.set("form_unique_id", a.formUniqueId);
1437
+ const a = new URLSearchParams();
1438
+ if (i.formId !== void 0)
1439
+ a.set("form_id", String(i.formId));
1440
+ else if (i.formUniqueId)
1441
+ a.set("form_unique_id", i.formUniqueId);
1439
1442
  else
1440
1443
  throw new Error("form_id 或 form_unique_id 至少传一个");
1441
- const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${i.toString()}`, {
1444
+ const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1442
1445
  method: "GET",
1443
1446
  headers: l
1444
- }), u = await Tr(c), d = mr(u.form_definition);
1447
+ }), u = await vr(c), m = ir(u.form_definition);
1445
1448
  return {
1446
1449
  formUniqueId: u.form_unique_id,
1447
1450
  formId: u.form_id,
1448
1451
  disabled: u.disabled === 1,
1449
- formDefinition: d,
1450
- a2ui: pr(u.form_definition) ?? void 0
1452
+ formDefinition: m,
1453
+ a2ui: rr(u.form_definition) ?? void 0
1451
1454
  };
1452
1455
  }
1453
1456
  return { fetchDetail: o };
1454
1457
  }
1455
- const $r = `
1456
- :where(:root) {
1457
- color-scheme: light dark;
1458
- }
1459
-
1460
- :where(.a2ui-dark) {
1461
- color-scheme: dark;
1462
- }
1463
-
1464
- :where(.a2ui-light) {
1465
- color-scheme: light;
1466
- }
1467
-
1468
- :where(:root), :where(.a2ui-dark), :where(.a2ui-light) {
1469
- --a2ui-color-background: light-dark(#eee, #111);
1470
- --a2ui-color-on-background: light-dark(#333, #eee);
1471
-
1472
- --a2ui-color-surface: light-dark(
1473
- color-mix(in oklab, var(--a2ui-color-background) 85%, white),
1474
- color-mix(in oklab, var(--a2ui-color-background) 95%, white)
1475
- );
1476
- --a2ui-color-on-surface: light-dark(#333, #eee);
1477
-
1478
- --a2ui-color-primary: #17e;
1479
- --a2ui-color-primary-light: ${Q("light", { colorVar: "--a2ui-color-primary" })};
1480
- --a2ui-color-primary-dark: ${Q("dark", { colorVar: "--a2ui-color-primary" })};
1481
- --a2ui-color-primary-hover: ${Q("hover", { darkVar: "--a2ui-color-primary-dark", lightVar: "--a2ui-color-primary-light" })};
1482
- --a2ui-color-on-primary: #fff;
1483
-
1484
- --a2ui-color-secondary: light-dark(#ddd, #333);
1485
- --a2ui-color-secondary-light: ${Q("light", { colorVar: "--a2ui-color-secondary" })};
1486
- --a2ui-color-secondary-dark: ${Q("dark", { colorVar: "--a2ui-color-secondary", percentage: 95 })};
1487
- --a2ui-color-secondary-hover: ${Q("hover", { darkVar: "--a2ui-color-secondary-dark", lightVar: "--a2ui-color-secondary-light" })};
1488
- --a2ui-color-on-secondary: light-dark(#333, #eee);
1489
-
1490
- --a2ui-border-radius: 0.25rem;
1491
- --a2ui-color-border: light-dark(#ccc, #444);
1492
- --a2ui-border-width: 1px;
1493
- --a2ui-border: 1px solid var(--a2ui-color-border, #ccc);
1494
-
1495
- --a2ui-font-family-title: inherit;
1496
- --a2ui-font-family-monospace: monospace;
1497
- --a2ui-color-input: light-dark(#fff, #2a2a2a);
1498
- --a2ui-color-on-input: light-dark(#333, #eee);
1499
-
1500
- --a2ui-grid-base: 0.5rem;
1501
- --a2ui-spacing-xs: calc(var(--a2ui-spacing-s) / 2);
1502
- --a2ui-spacing-s: calc(var(--a2ui-spacing-m) / 2);
1503
- --a2ui-spacing-m: var(--a2ui-grid-base);
1504
- --a2ui-spacing-l: calc(var(--a2ui-spacing-m) * 2);
1505
- --a2ui-spacing-xl: calc(var(--a2ui-spacing-l) * 2);
1506
-
1507
- --a2ui-font-size: 1rem;
1508
- --a2ui-font-scale: 1.2;
1509
- --a2ui-font-size-xs: calc(var(--a2ui-font-size-s) / var(--a2ui-font-scale));
1510
- --a2ui-font-size-s: calc(var(--a2ui-font-size-m) / var(--a2ui-font-scale));
1511
- --a2ui-font-size-m: var(--a2ui-font-size);
1512
- --a2ui-font-size-l: calc(var(--a2ui-font-size-m) * var(--a2ui-font-scale));
1513
- --a2ui-font-size-xl: calc(var(--a2ui-font-size-l) * var(--a2ui-font-scale));
1514
- --a2ui-font-size-2xl: calc(var(--a2ui-font-size-xl) * var(--a2ui-font-scale));
1515
-
1516
- --a2ui-line-height-headings: 1.2;
1517
- --a2ui-line-height-body: 1.5;
1518
- }
1519
- `;
1520
- let fe;
1521
- function Nr() {
1522
- return fe || (fe = new CSSStyleSheet(), fe.replaceSync($r)), fe;
1523
- }
1524
- function Nt() {
1525
- if (typeof document > "u")
1526
- return;
1527
- const e = Nr();
1528
- document.adoptedStyleSheets.includes(e) || (document.adoptedStyleSheets = [...document.adoptedStyleSheets, e]);
1529
- }
1530
- function Q(e, t) {
1531
- switch (e) {
1532
- case "light": {
1533
- const n = t;
1534
- return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "white"})`;
1535
- }
1536
- case "dark": {
1537
- const n = t;
1538
- return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "black"})`;
1539
- }
1540
- case "hover": {
1541
- const n = t;
1542
- return `light-dark(var(${n.darkVar}), var(${n.lightVar}))`;
1543
- }
1544
- }
1545
- }
1546
- const Ir = `
1547
- &:not([disabled]) {
1548
- cursor: pointer;
1549
- opacity: var(--opacity, 0);
1550
- transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1);
1551
-
1552
- &:hover,
1553
- &:focus {
1554
- opacity: 1;
1555
- }
1556
- }`, zr = `
1557
- ${new Array(21).fill(0).map((e, t) => `.behavior-ho-${t * 5} {
1558
- --opacity: ${t / 20};
1559
- ${Ir}
1560
- }`).join(`
1561
- `)}
1562
-
1563
- .behavior-o-s {
1564
- overflow: scroll;
1565
- }
1566
-
1567
- .behavior-o-a {
1568
- overflow: auto;
1569
- }
1570
-
1571
- .behavior-o-h {
1572
- overflow: hidden;
1573
- }
1574
-
1575
- .behavior-sw-n {
1576
- scrollbar-width: none;
1577
- }
1578
- `, z = 4, Mr = `
1579
- ${new Array(25).fill(0).map((e, t) => `
1580
- .border-bw-${t} { border-width: ${t}px; }
1581
- .border-btw-${t} { border-top-width: ${t}px; }
1582
- .border-bbw-${t} { border-bottom-width: ${t}px; }
1583
- .border-blw-${t} { border-left-width: ${t}px; }
1584
- .border-brw-${t} { border-right-width: ${t}px; }
1585
-
1586
- .border-ow-${t} { outline-width: ${t}px; }
1587
- .border-br-${t} { border-radius: ${t * z}px; overflow: hidden;}`).join(`
1588
- `)}
1589
-
1590
- .border-br-50pc {
1591
- border-radius: 50%;
1592
- }
1593
-
1594
- .border-bs-s {
1595
- border-style: solid;
1596
- }
1597
- `, It = [
1598
- 0,
1599
- 5,
1600
- 10,
1601
- 15,
1602
- 20,
1603
- 25,
1604
- 30,
1605
- 35,
1606
- 40,
1607
- 50,
1608
- 60,
1609
- 70,
1610
- 80,
1611
- 90,
1612
- 95,
1613
- 98,
1614
- 99,
1615
- 100
1616
- ];
1617
- function D(e) {
1618
- return e.startsWith("nv") ? `--nv-${e.slice(2)}` : `--${e[0]}-${e.slice(1)}`;
1619
- }
1620
- const ee = (e) => `
1621
- ${e.map((t) => {
1622
- const n = Ee(t);
1623
- return `.color-bc-${t} { border-color: light-dark(var(${D(t)}), var(${D(n)})); }`;
1624
- }).join(`
1625
- `)}
1626
-
1627
- ${e.map((t) => {
1628
- const n = Ee(t), r = [
1629
- `.color-bgc-${t} { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`,
1630
- `.color-bbgc-${t}::backdrop { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`
1631
- ];
1632
- for (let o = 0.1; o < 1; o += 0.1)
1633
- r.push(`.color-bbgc-${t}_${(o * 100).toFixed(0)}::backdrop {
1634
- background-color: light-dark(oklch(from var(${D(t)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${D(n)}) l c h / calc(alpha * ${o.toFixed(1)})) );
1635
- }
1636
- `);
1637
- return r.join(`
1638
- `);
1639
- }).join(`
1640
- `)}
1641
-
1642
- ${e.map((t) => {
1643
- const n = Ee(t);
1644
- return `.color-c-${t} { color: light-dark(var(${D(t)}), var(${D(n)})); }`;
1645
- }).join(`
1646
- `)}
1647
- `, Ee = (e) => {
1648
- const t = e.match(/^([a-z]+)(\d+)$/);
1649
- if (!t)
1650
- return e;
1651
- const [, n, r] = t, a = 100 - parseInt(r, 10), i = It.reduce((l, c) => Math.abs(c - a) < Math.abs(l - a) ? c : l);
1652
- return `${n}${i}`;
1653
- }, te = (e) => It.map((t) => `${e}${t}`), Fr = [
1654
- ee(te("p")),
1655
- ee(te("s")),
1656
- ee(te("t")),
1657
- ee(te("n")),
1658
- ee(te("nv")),
1659
- ee(te("e")),
1660
- `
1661
- .color-bgc-transparent {
1662
- background-color: transparent;
1663
- }
1664
-
1665
- :host {
1666
- color-scheme: var(--color-scheme);
1667
- }
1668
- `
1669
- ], _r = `
1670
- .g-icon {
1671
- font-family: "Material Symbols Outlined", "Google Symbols";
1672
- font-weight: normal;
1673
- font-style: normal;
1674
- font-display: optional;
1675
- font-size: 24px;
1676
- width: 1em;
1677
- height: 1em;
1678
- user-select: none;
1679
- line-height: 1;
1680
- letter-spacing: normal;
1681
- text-transform: none;
1682
- display: inline-block;
1683
- white-space: nowrap;
1684
- word-wrap: normal;
1685
- direction: ltr;
1686
- font-feature-settings: "liga";
1687
- -webkit-font-feature-settings: "liga";
1688
- -webkit-font-smoothing: antialiased;
1689
- text-rendering: optimizeLegibility;
1690
- -moz-osx-font-smoothing: grayscale;
1691
- overflow: hidden;
1692
-
1693
- font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48,
1694
- "ROND" 100;
1695
-
1696
- &.filled {
1697
- font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 48,
1698
- "ROND" 100;
1699
- }
1700
-
1701
- &.filled-heavy {
1702
- font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 48,
1703
- "ROND" 100;
1704
- }
1705
- }
1706
- `, Pr = `
1707
- :host {
1708
- ${new Array(16).fill(0).map((e, t) => `--g-${t + 1}: ${(t + 1) * z}px;`).join(`
1709
- `)}
1710
- }
1711
-
1712
- ${new Array(49).fill(0).map((e, t) => {
1713
- const n = t - 24, r = n < 0 ? `n${Math.abs(n)}` : n.toString();
1714
- return `
1715
- .layout-p-${r} { --padding: ${n * z}px; padding: var(--padding); }
1716
- .layout-pt-${r} { padding-top: ${n * z}px; }
1717
- .layout-pr-${r} { padding-right: ${n * z}px; }
1718
- .layout-pb-${r} { padding-bottom: ${n * z}px; }
1719
- .layout-pl-${r} { padding-left: ${n * z}px; }
1720
-
1721
- .layout-m-${r} { --margin: ${n * z}px; margin: var(--margin); }
1722
- .layout-mt-${r} { margin-top: ${n * z}px; }
1723
- .layout-mr-${r} { margin-right: ${n * z}px; }
1724
- .layout-mb-${r} { margin-bottom: ${n * z}px; }
1725
- .layout-ml-${r} { margin-left: ${n * z}px; }
1726
-
1727
- .layout-t-${r} { top: ${n * z}px; }
1728
- .layout-r-${r} { right: ${n * z}px; }
1729
- .layout-b-${r} { bottom: ${n * z}px; }
1730
- .layout-l-${r} { left: ${n * z}px; }`;
1731
- }).join(`
1732
- `)}
1733
-
1734
- ${new Array(25).fill(0).map((e, t) => `
1735
- .layout-g-${t} { gap: ${t * z}px; }`).join(`
1736
- `)}
1737
-
1738
- ${new Array(8).fill(0).map((e, t) => `
1739
- .layout-grd-col${t + 1} { grid-template-columns: ${"1fr ".repeat(t + 1).trim()}; }`).join(`
1740
- `)}
1741
-
1742
- .layout-pos-a {
1743
- position: absolute;
1744
- }
1745
-
1746
- .layout-pos-rel {
1747
- position: relative;
1748
- }
1749
-
1750
- .layout-dsp-none {
1751
- display: none;
1752
- }
1753
-
1754
- .layout-dsp-block {
1755
- display: block;
1756
- }
1757
-
1758
- .layout-dsp-grid {
1759
- display: grid;
1760
- }
1761
-
1762
- .layout-dsp-iflex {
1763
- display: inline-flex;
1764
- }
1765
-
1766
- .layout-dsp-flexvert {
1767
- display: flex;
1768
- flex-direction: column;
1769
- }
1770
-
1771
- .layout-dsp-flexhor {
1772
- display: flex;
1773
- flex-direction: row;
1774
- }
1775
-
1776
- .layout-fw-w {
1777
- flex-wrap: wrap;
1778
- }
1779
-
1780
- .layout-al-fs {
1781
- align-items: start;
1782
- }
1783
-
1784
- .layout-al-fe {
1785
- align-items: end;
1786
- }
1787
-
1788
- .layout-al-c {
1789
- align-items: center;
1790
- }
1791
-
1792
- .layout-as-n {
1793
- align-self: normal;
1794
- }
1795
-
1796
- .layout-js-c {
1797
- justify-self: center;
1798
- }
1799
-
1800
- .layout-sp-c {
1801
- justify-content: center;
1802
- }
1803
-
1804
- .layout-sp-ev {
1805
- justify-content: space-evenly;
1806
- }
1807
-
1808
- .layout-sp-bt {
1809
- justify-content: space-between;
1810
- }
1811
-
1812
- .layout-sp-s {
1813
- justify-content: start;
1814
- }
1815
-
1816
- .layout-sp-e {
1817
- justify-content: end;
1818
- }
1819
-
1820
- .layout-ji-e {
1821
- justify-items: end;
1822
- }
1823
-
1824
- .layout-r-none {
1825
- resize: none;
1826
- }
1827
-
1828
- .layout-fs-c {
1829
- field-sizing: content;
1830
- }
1831
-
1832
- .layout-fs-n {
1833
- field-sizing: none;
1834
- }
1835
-
1836
- .layout-flx-0 {
1837
- flex: 0 0 auto;
1838
- }
1839
-
1840
- .layout-flx-1 {
1841
- flex: 1 0 auto;
1842
- }
1843
-
1844
- .layout-c-s {
1845
- contain: strict;
1846
- }
1847
-
1848
- /** Widths **/
1849
-
1850
- ${new Array(10).fill(0).map((e, t) => {
1851
- const n = (t + 1) * 10;
1852
- return `.layout-w-${n} { width: ${n}%; max-width: ${n}%; }`;
1853
- }).join(`
1854
- `)}
1855
-
1856
- ${new Array(16).fill(0).map((e, t) => {
1857
- const n = t * z;
1858
- return `.layout-wp-${t} { width: ${n}px; }`;
1859
- }).join(`
1860
- `)}
1861
-
1862
- /** Heights **/
1863
-
1864
- ${new Array(10).fill(0).map((e, t) => {
1865
- const n = (t + 1) * 10;
1866
- return `.layout-h-${n} { height: ${n}%; }`;
1867
- }).join(`
1868
- `)}
1869
-
1870
- ${new Array(16).fill(0).map((e, t) => {
1871
- const n = t * z;
1872
- return `.layout-hp-${t} { height: ${n}px; }`;
1873
- }).join(`
1874
- `)}
1875
-
1876
- .layout-el-cv {
1877
- & img,
1878
- & video {
1879
- width: 100%;
1880
- height: 100%;
1881
- object-fit: cover;
1882
- margin: 0;
1883
- }
1884
- }
1885
-
1886
- .layout-ar-sq {
1887
- aspect-ratio: 1 / 1;
1888
- }
1889
-
1890
- .layout-ex-fb {
1891
- margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1);
1892
- width: calc(100% + var(--padding) * 2);
1893
- height: calc(100% + var(--padding) * 2);
1894
- }
1895
- `, Er = `
1896
- ${new Array(21).fill(0).map((e, t) => `.opacity-el-${t * 5} { opacity: ${t / 20}; }`).join(`
1897
- `)}
1898
- `, Ur = `
1899
- :host {
1900
- --default-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
1901
- --default-font-family-mono: "Courier New", Courier, monospace;
1902
- }
1903
-
1904
- .typography-f-s {
1905
- font-family: var(--font-family, var(--default-font-family));
1906
- font-optical-sizing: auto;
1907
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
1908
- }
1909
-
1910
- .typography-f-sf {
1911
- font-family: var(--font-family-flex, var(--default-font-family));
1912
- font-optical-sizing: auto;
1913
- }
1914
-
1915
- .typography-f-c {
1916
- font-family: var(--font-family-mono, var(--default-font-family));
1917
- font-optical-sizing: auto;
1918
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
1919
- }
1920
-
1921
- .typography-v-r {
1922
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 100;
1923
- }
1924
-
1925
- .typography-ta-s {
1926
- text-align: start;
1927
- }
1928
-
1929
- .typography-ta-c {
1930
- text-align: center;
1931
- }
1932
-
1933
- .typography-fs-n {
1934
- font-style: normal;
1935
- }
1936
-
1937
- .typography-fs-i {
1938
- font-style: italic;
1939
- }
1940
-
1941
- .typography-sz-ls {
1942
- font-size: 11px;
1943
- line-height: 16px;
1944
- }
1945
-
1946
- .typography-sz-lm {
1947
- font-size: 12px;
1948
- line-height: 16px;
1949
- }
1950
-
1951
- .typography-sz-ll {
1952
- font-size: 14px;
1953
- line-height: 20px;
1954
- }
1955
-
1956
- .typography-sz-bs {
1957
- font-size: 12px;
1958
- line-height: 16px;
1959
- }
1960
-
1961
- .typography-sz-bm {
1962
- font-size: 14px;
1963
- line-height: 20px;
1964
- }
1965
-
1966
- .typography-sz-bl {
1967
- font-size: 16px;
1968
- line-height: 24px;
1969
- }
1970
-
1971
- .typography-sz-ts {
1972
- font-size: 14px;
1973
- line-height: 20px;
1974
- }
1975
-
1976
- .typography-sz-tm {
1977
- font-size: 16px;
1978
- line-height: 24px;
1979
- }
1980
-
1981
- .typography-sz-tl {
1982
- font-size: 22px;
1983
- line-height: 28px;
1984
- }
1985
-
1986
- .typography-sz-hs {
1987
- font-size: 24px;
1988
- line-height: 32px;
1989
- }
1990
-
1991
- .typography-sz-hm {
1992
- font-size: 28px;
1993
- line-height: 36px;
1994
- }
1995
-
1996
- .typography-sz-hl {
1997
- font-size: 32px;
1998
- line-height: 40px;
1999
- }
2000
-
2001
- .typography-sz-ds {
2002
- font-size: 36px;
2003
- line-height: 44px;
2004
- }
2005
-
2006
- .typography-sz-dm {
2007
- font-size: 45px;
2008
- line-height: 52px;
2009
- }
2010
-
2011
- .typography-sz-dl {
2012
- font-size: 57px;
2013
- line-height: 64px;
2014
- }
2015
-
2016
- .typography-ws-p {
2017
- white-space: pre-line;
2018
- }
2019
-
2020
- .typography-ws-nw {
2021
- white-space: nowrap;
2022
- }
2023
-
2024
- .typography-td-none {
2025
- text-decoration: none;
2026
- }
2027
-
2028
- /** Weights **/
2029
-
2030
- ${new Array(9).fill(0).map((e, t) => {
2031
- const n = (t + 1) * 100;
2032
- return `.typography-w-${n} { font-weight: ${n}; }`;
2033
- }).join(`
2034
- `)}
2035
- `, jr = [zr, Mr, Fr, _r, Pr, Er, Ur].flat(1 / 0).join(`
2036
- `);
2037
- var Rr = `
2038
- @layer a2ui-reset {
2039
- :where(.a2ui-surface) :where(*:not(svg, svg *:not(foreignObject *))) {
2040
- all: revert;
2041
- }
2042
- }
2043
- `, Or = jr.replace(
2044
- /:host\s*\{/g,
2045
- ".a2ui-surface {"
2046
- ), Vr = `
2047
- .a2ui-surface .a2ui-card {
2048
- display: block;
2049
- flex: var(--weight);
2050
- min-height: 0;
2051
- overflow: auto;
2052
- }
2053
- .a2ui-surface .a2ui-card > section {
2054
- height: 100%;
2055
- width: 100%;
2056
- min-height: 0;
2057
- overflow: auto;
2058
- }
2059
- .a2ui-surface .a2ui-card > section > * {
2060
- height: 100%;
2061
- width: 100%;
2062
- }
2063
-
2064
- .a2ui-surface .a2ui-divider {
2065
- display: block;
2066
- min-height: 0;
2067
- overflow: auto;
2068
- }
2069
- :where(.a2ui-surface .a2ui-divider) hr {
2070
- height: 1px;
2071
- background: #ccc;
2072
- border: none;
2073
- }
2074
-
2075
- .a2ui-surface .a2ui-text {
2076
- display: block;
2077
- flex: var(--weight);
2078
- }
2079
- :where(.a2ui-surface .a2ui-text) h1,
2080
- :where(.a2ui-surface .a2ui-text) h2,
2081
- :where(.a2ui-surface .a2ui-text) h3,
2082
- :where(.a2ui-surface .a2ui-text) h4,
2083
- :where(.a2ui-surface .a2ui-text) h5 {
2084
- line-height: inherit;
2085
- font: inherit;
2086
- }
2087
- .a2ui-surface .a2ui-text p {
2088
- margin: 0;
2089
- }
2090
-
2091
- .a2ui-surface .a2ui-textfield {
2092
- display: flex;
2093
- flex: var(--weight);
2094
- }
2095
- :where(.a2ui-surface .a2ui-textfield) input {
2096
- display: block;
2097
- width: 100%;
2098
- }
2099
- :where(.a2ui-surface .a2ui-textfield) label {
2100
- display: block;
2101
- margin-bottom: 4px;
2102
- }
2103
- :where(.a2ui-surface .a2ui-textfield) textarea {
2104
- display: block;
2105
- width: 100%;
2106
- }
2107
-
2108
- .a2ui-surface .a2ui-checkbox {
2109
- display: block;
2110
- flex: var(--weight);
2111
- min-height: 0;
2112
- overflow: auto;
2113
- }
2114
- :where(.a2ui-surface .a2ui-checkbox) input {
2115
- display: block;
2116
- width: 100%;
2117
- }
2118
-
2119
- .a2ui-surface .a2ui-slider {
2120
- display: block;
2121
- flex: var(--weight);
2122
- }
2123
- :where(.a2ui-surface .a2ui-slider) input {
2124
- display: block;
2125
- width: 100%;
2126
- }
2127
-
2128
- .a2ui-surface .a2ui-button {
2129
- display: block;
2130
- flex: var(--weight);
2131
- min-height: 0;
2132
- }
2133
-
2134
- .a2ui-surface .a2ui-icon {
2135
- display: block;
2136
- flex: var(--weight);
2137
- min-height: 0;
2138
- overflow: auto;
2139
- }
2140
- :where(.a2ui-surface .a2ui-icon) .g-icon {
2141
- font-size: 24px;
2142
- }
2143
-
2144
- .a2ui-surface .a2ui-tabs {
2145
- display: block;
2146
- flex: var(--weight);
2147
- }
2148
-
2149
- .a2ui-surface .a2ui-modal {
2150
- display: block;
2151
- flex: var(--weight);
2152
- }
2153
- :where(.a2ui-surface .a2ui-modal) dialog {
2154
- padding: 0;
2155
- border: none;
2156
- background: none;
2157
- }
2158
- .a2ui-surface .a2ui-modal dialog section #controls {
2159
- display: flex;
2160
- justify-content: end;
2161
- margin-bottom: 4px;
2162
- }
2163
- .a2ui-surface .a2ui-modal dialog section #controls button {
2164
- padding: 0;
2165
- background: none;
2166
- width: 20px;
2167
- height: 20px;
2168
- cursor: pointer;
2169
- border: none;
2170
- }
2171
-
2172
- .a2ui-surface .a2ui-image {
2173
- display: block;
2174
- flex: var(--weight);
2175
- min-height: 0;
2176
- overflow: auto;
2177
- }
2178
- :where(.a2ui-surface .a2ui-image) img {
2179
- display: block;
2180
- width: 100%;
2181
- height: 100%;
2182
- object-fit: var(--object-fit, fill);
2183
- }
2184
-
2185
- .a2ui-surface .a2ui-video {
2186
- display: block;
2187
- flex: var(--weight);
2188
- min-height: 0;
2189
- overflow: auto;
2190
- }
2191
- :where(.a2ui-surface .a2ui-video) video {
2192
- display: block;
2193
- width: 100%;
2194
- }
2195
-
2196
- .a2ui-surface .a2ui-audio {
2197
- display: block;
2198
- flex: var(--weight);
2199
- min-height: 0;
2200
- overflow: auto;
2201
- }
2202
- :where(.a2ui-surface .a2ui-audio) audio {
2203
- display: block;
2204
- width: 100%;
2205
- }
2206
-
2207
- .a2ui-surface .a2ui-multiplechoice {
2208
- display: block;
2209
- flex: var(--weight);
2210
- min-height: 0;
2211
- overflow: auto;
2212
- }
2213
- :where(.a2ui-surface .a2ui-multiplechoice) select {
2214
- width: 100%;
2215
- }
2216
-
2217
- .a2ui-surface .a2ui-column {
2218
- display: flex;
2219
- flex: var(--weight);
2220
- }
2221
- .a2ui-surface .a2ui-column > section {
2222
- display: flex;
2223
- flex-direction: column;
2224
- min-width: 100%;
2225
- height: 100%;
2226
- }
2227
- .a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }
2228
- .a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }
2229
- .a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }
2230
- .a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }
2231
- .a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }
2232
- .a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }
2233
- .a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }
2234
- .a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2235
- .a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }
2236
- .a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2237
-
2238
- .a2ui-surface .a2ui-row {
2239
- display: flex;
2240
- flex: var(--weight);
2241
- }
2242
- .a2ui-surface .a2ui-row > section {
2243
- display: flex;
2244
- flex-direction: row;
2245
- width: 100%;
2246
- min-height: 100%;
2247
- }
2248
- .a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }
2249
- .a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }
2250
- .a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }
2251
- .a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }
2252
- .a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }
2253
- .a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }
2254
- .a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }
2255
- .a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2256
- .a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }
2257
- .a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2258
-
2259
- .a2ui-surface .a2ui-list {
2260
- display: block;
2261
- flex: var(--weight);
2262
- min-height: 0;
2263
- overflow: auto;
2264
- }
2265
- .a2ui-surface .a2ui-list[data-direction="vertical"] > section {
2266
- display: grid;
2267
- }
2268
- .a2ui-surface .a2ui-list[data-direction="horizontal"] > section {
2269
- display: flex;
2270
- max-width: 100%;
2271
- overflow-x: scroll;
2272
- overflow-y: hidden;
2273
- scrollbar-width: none;
2274
- }
2275
- .a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {
2276
- flex: 1 0 fit-content;
2277
- max-width: min(80%, 400px);
2278
- }
2279
-
2280
- .a2ui-surface .a2ui-datetime-input {
2281
- display: block;
2282
- flex: var(--weight);
2283
- min-height: 0;
2284
- overflow: auto;
2285
- }
2286
- :where(.a2ui-surface .a2ui-datetime-input) input {
2287
- display: block;
2288
- border-radius: 8px;
2289
- padding: 8px;
2290
- border: 1px solid #ccc;
2291
- width: 100%;
2292
- }
2293
-
2294
- .a2ui-surface *,
2295
- .a2ui-surface *::before,
2296
- .a2ui-surface *::after {
2297
- box-sizing: border-box;
2298
- }
2299
- `;
2300
- function zt() {
2301
- if (typeof document > "u")
2302
- return;
2303
- const e = "a2ui-structural-styles";
2304
- if (document.getElementById(e))
2305
- return;
2306
- const t = document.createElement("style");
2307
- t.id = e, t.textContent = Rr + `
2308
- ` + Or + `
2309
- ` + Vr, document.head.appendChild(t);
2310
- }
2311
- const Br = {
2312
- video: Yt,
2313
- audio: Gt,
2314
- image: Jt,
2315
- file: ot,
2316
- spreadsheet: Ht,
2317
- document: rt
1458
+ const br = {
1459
+ video: jt,
1460
+ audio: qt,
1461
+ image: wt,
1462
+ file: We,
1463
+ spreadsheet: Vt,
1464
+ document: Ge
2318
1465
  };
2319
- function qr({
1466
+ function Sr({
2320
1467
  type: e,
2321
1468
  size: t = 40,
2322
1469
  className: n
2323
1470
  }) {
2324
- const r = Br[e] ?? ot;
1471
+ const r = br[e] ?? We;
2325
1472
  return /* @__PURE__ */ s(
2326
1473
  r,
2327
1474
  {
@@ -2331,7 +1478,7 @@ function qr({
2331
1478
  }
2332
1479
  );
2333
1480
  }
2334
- const Mt = "skopon-form-v0_9", Lr = /* @__PURE__ */ new Set([
1481
+ const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
2335
1482
  "SkoponMedia",
2336
1483
  "SkoponSelect",
2337
1484
  "Image",
@@ -2343,46 +1490,46 @@ const Mt = "skopon-form-v0_9", Lr = /* @__PURE__ */ new Set([
2343
1490
  "FileUpload",
2344
1491
  "TextField",
2345
1492
  "Text",
2346
- ...er()
2347
- ]), Dr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2348
- function pe(e) {
2349
- const t = [...ge.components.values()].find((n) => n.name === e);
1493
+ ...Jn()
1494
+ ]), Cr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1495
+ function ae(e) {
1496
+ const t = [...ue.components.values()].find((n) => n.name === e);
2350
1497
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
2351
1498
  return t.schema;
2352
1499
  }
2353
- function C(e) {
1500
+ function A(e) {
2354
1501
  return typeof e == "string" ? e : "";
2355
1502
  }
2356
- function Ft(e) {
1503
+ function At(e) {
2357
1504
  return Array.isArray(e) ? e.map((t) => {
2358
1505
  if (!t || typeof t != "object") return null;
2359
1506
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
2360
1507
  return { value: r, label: o };
2361
1508
  }).filter((t) => !!t) : [];
2362
1509
  }
2363
- function ke({
1510
+ function ge({
2364
1511
  mediaType: e,
2365
1512
  urls: t,
2366
1513
  mediaSize: n,
2367
1514
  label: r,
2368
1515
  help: o,
2369
- placeholder: a
1516
+ placeholder: i
2370
1517
  }) {
2371
- const i = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = bn(n), u = (a == null ? void 0 : a.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2372
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2373
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2374
- t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ s(
1518
+ const a = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = pn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1519
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1520
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1521
+ t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
2375
1522
  "img",
2376
1523
  {
2377
- src: d,
2378
- alt: i || "图片",
1524
+ src: m,
1525
+ alt: a || "图片",
2379
1526
  className: "form-media-item"
2380
1527
  },
2381
1528
  `media-${p}`
2382
1529
  ) : e === "video" ? /* @__PURE__ */ s(
2383
1530
  "video",
2384
1531
  {
2385
- src: d,
1532
+ src: m,
2386
1533
  controls: !0,
2387
1534
  className: "form-media-item"
2388
1535
  },
@@ -2390,88 +1537,88 @@ function ke({
2390
1537
  ) : /* @__PURE__ */ s(
2391
1538
  "audio",
2392
1539
  {
2393
- src: d,
1540
+ src: m,
2394
1541
  controls: !0,
2395
1542
  className: "form-media-item form-media-item--audio"
2396
1543
  },
2397
1544
  `media-${p}`
2398
1545
  )) }),
2399
- l ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1546
+ l ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
2400
1547
  ] });
2401
1548
  }
2402
- function we(e, t) {
2403
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : C(e.url).trim() ? [C(e.url).trim()] : [];
1549
+ function ye(e, t) {
1550
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
2404
1551
  return {
2405
1552
  mediaType: t,
2406
1553
  urls: n,
2407
- mediaSize: ue(e.mediaSize),
2408
- label: C(e.label) || C(e.description),
2409
- help: C(e.help),
2410
- placeholder: C(e.placeholder)
1554
+ mediaSize: ie(e.mediaSize),
1555
+ label: A(e.label) || A(e.description),
1556
+ help: A(e.help),
1557
+ placeholder: A(e.placeholder)
2411
1558
  };
2412
1559
  }
2413
- const Kr = {
1560
+ const kr = {
2414
1561
  name: "SkoponMedia",
2415
- schema: m.object({
2416
- mediaType: m.any().optional(),
2417
- urls: m.any().optional(),
2418
- mediaSize: m.any().optional(),
2419
- label: m.any().optional(),
2420
- help: m.any().optional(),
2421
- placeholder: m.any().optional()
1562
+ schema: d.object({
1563
+ mediaType: d.any().optional(),
1564
+ urls: d.any().optional(),
1565
+ mediaSize: d.any().optional(),
1566
+ label: d.any().optional(),
1567
+ help: d.any().optional(),
1568
+ placeholder: d.any().optional()
2422
1569
  }).passthrough()
2423
- }, Hr = O(Kr, ({ context: e }) => {
2424
- const t = e.componentModel.properties, n = C(t.mediaType);
2425
- return /* @__PURE__ */ s(ke, { ...we(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
2426
- }), Jr = O(
2427
- { name: "Image", schema: pe("Image") },
2428
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "image") })
2429
- ), Gr = O(
2430
- { name: "Video", schema: pe("Video") },
2431
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "video") })
2432
- ), Yr = O(
2433
- { name: "AudioPlayer", schema: pe("AudioPlayer") },
2434
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "audio") })
2435
- ), Wr = {
1570
+ }, Ar = V(kr, ({ context: e }) => {
1571
+ const t = e.componentModel.properties, n = A(t.mediaType);
1572
+ return /* @__PURE__ */ s(ge, { ...ye(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1573
+ }), Tr = V(
1574
+ { name: "Image", schema: ae("Image") },
1575
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "image") })
1576
+ ), Nr = V(
1577
+ { name: "Video", schema: ae("Video") },
1578
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "video") })
1579
+ ), Ir = V(
1580
+ { name: "AudioPlayer", schema: ae("AudioPlayer") },
1581
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "audio") })
1582
+ ), Mr = {
2436
1583
  name: "SkoponSelect",
2437
- schema: m.object({
2438
- label: m.any().optional(),
2439
- mode: m.any().optional(),
2440
- placeholder: m.any().optional(),
2441
- options: m.any().optional(),
2442
- value: m.any().optional()
1584
+ schema: d.object({
1585
+ label: d.any().optional(),
1586
+ mode: d.any().optional(),
1587
+ placeholder: d.any().optional(),
1588
+ options: d.any().optional(),
1589
+ value: d.any().optional()
2443
1590
  }).passthrough()
2444
1591
  };
2445
- function Xr({ context: e }) {
2446
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = Ft(o.options), c = C(o.mode) === "multiple";
2447
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2448
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1592
+ function Fr({ context: e }) {
1593
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = At(o.options), c = A(o.mode) === "multiple";
1594
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1595
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2449
1596
  /* @__PURE__ */ s(
2450
- Ue,
1597
+ Fe,
2451
1598
  {
2452
1599
  mode: c ? "multiple" : void 0,
2453
1600
  disabled: !t,
2454
1601
  allowClear: !0,
2455
1602
  className: "form-block-preview-control",
2456
1603
  style: { width: "100%" },
2457
- placeholder: i || (c ? "请选择多项" : "请选择"),
1604
+ placeholder: a || (c ? "请选择多项" : "请选择"),
2458
1605
  options: l,
2459
- value: c ? K(n) : le(n),
1606
+ value: c ? L(n) : ne(n),
2460
1607
  onChange: (u) => r(c ? u ?? [] : u ?? "")
2461
1608
  }
2462
1609
  )
2463
1610
  ] });
2464
1611
  }
2465
- const Zr = O(
2466
- Wr,
2467
- Xr
1612
+ const Pr = V(
1613
+ Mr,
1614
+ Fr
2468
1615
  );
2469
- function Qr({ context: e }) {
2470
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.variant) || "mutuallyExclusive", l = C(o.skoponPickerType), c = C(o.placeholder), u = Ft(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : i === "multipleSelection" ? "checkbox" : "radio";
2471
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2472
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1616
+ function Ur({ context: e }) {
1617
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", l = A(o.skoponPickerType), c = A(o.placeholder), u = At(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
1618
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1619
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2473
1620
  p === "select" ? /* @__PURE__ */ s(
2474
- Ue,
1621
+ Fe,
2475
1622
  {
2476
1623
  disabled: !t,
2477
1624
  allowClear: !0,
@@ -2479,11 +1626,11 @@ function Qr({ context: e }) {
2479
1626
  style: { width: "100%" },
2480
1627
  placeholder: c || "请选择",
2481
1628
  options: u,
2482
- value: le(n),
1629
+ value: ne(n),
2483
1630
  onChange: (g) => r(g ?? "")
2484
1631
  }
2485
1632
  ) : p === "multiselect" ? /* @__PURE__ */ s(
2486
- Ue,
1633
+ Fe,
2487
1634
  {
2488
1635
  mode: "multiple",
2489
1636
  disabled: !t,
@@ -2492,75 +1639,75 @@ function Qr({ context: e }) {
2492
1639
  style: { width: "100%" },
2493
1640
  placeholder: c || "请选择多项",
2494
1641
  options: u,
2495
- value: K(n),
1642
+ value: L(n),
2496
1643
  onChange: (g) => r(g ?? [])
2497
1644
  }
2498
1645
  ) : p === "checkbox" ? /* @__PURE__ */ s(
2499
- Rt.Group,
1646
+ Pt.Group,
2500
1647
  {
2501
1648
  disabled: !t,
2502
1649
  className: "form-block-preview-control",
2503
1650
  options: u,
2504
- value: K(n),
1651
+ value: L(n),
2505
1652
  onChange: (g) => r(g)
2506
1653
  }
2507
1654
  ) : /* @__PURE__ */ s(
2508
- Ot.Group,
1655
+ Ut.Group,
2509
1656
  {
2510
1657
  disabled: !t,
2511
1658
  className: "form-block-preview-control",
2512
1659
  options: u,
2513
- value: le(n),
1660
+ value: ne(n),
2514
1661
  onChange: (g) => r(g.target.value)
2515
1662
  }
2516
1663
  )
2517
1664
  ] });
2518
1665
  }
2519
- const eo = O(
1666
+ const _r = V(
2520
1667
  {
2521
1668
  name: "ChoicePicker",
2522
- schema: m.object({
2523
- label: m.any().optional(),
2524
- variant: m.any().optional(),
2525
- options: m.any().optional(),
2526
- value: m.any().optional(),
2527
- skoponPickerType: m.any().optional(),
2528
- placeholder: m.any().optional()
1669
+ schema: d.object({
1670
+ label: d.any().optional(),
1671
+ variant: d.any().optional(),
1672
+ options: d.any().optional(),
1673
+ value: d.any().optional(),
1674
+ skoponPickerType: d.any().optional(),
1675
+ placeholder: d.any().optional()
2529
1676
  }).passthrough()
2530
1677
  },
2531
- Qr
1678
+ Ur
2532
1679
  );
2533
- function to({ context: e }) {
2534
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label);
2535
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2536
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1680
+ function Er({ context: e }) {
1681
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label);
1682
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1683
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2537
1684
  /* @__PURE__ */ s(
2538
- Vt,
1685
+ _t,
2539
1686
  {
2540
1687
  disabled: !t,
2541
1688
  className: "form-block-preview-control",
2542
- checked: Je(n),
2543
- onChange: (i) => r(i)
1689
+ checked: qe(n),
1690
+ onChange: (a) => r(a)
2544
1691
  }
2545
1692
  )
2546
1693
  ] });
2547
1694
  }
2548
- const no = O(
2549
- { name: "CheckBox", schema: pe("CheckBox") },
2550
- to
1695
+ const zr = V(
1696
+ { name: "CheckBox", schema: ae("CheckBox") },
1697
+ Er
2551
1698
  );
2552
- function ro(e, t, n) {
2553
- const r = le(e);
1699
+ function Rr(e, t, n) {
1700
+ const r = ne(e);
2554
1701
  if (!r) return;
2555
1702
  if (!t && n) {
2556
- const a = Ye(r, "HH:mm", !0);
2557
- return a.isValid() ? a : void 0;
1703
+ const i = $e(r, "HH:mm", !0);
1704
+ return i.isValid() ? i : void 0;
2558
1705
  }
2559
- const o = Ye(r);
1706
+ const o = $e(r);
2560
1707
  return o.isValid() ? o : void 0;
2561
1708
  }
2562
- function oo({ context: e }) {
2563
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = ro(n, l, c), d = (p) => {
1709
+ function Or({ context: e }) {
1710
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Rr(n, l, c), m = (p) => {
2564
1711
  if (!p) {
2565
1712
  r("");
2566
1713
  return;
@@ -2575,117 +1722,117 @@ function oo({ context: e }) {
2575
1722
  }
2576
1723
  r(p.format("YYYY-MM-DD"));
2577
1724
  };
2578
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2579
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1725
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1726
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2580
1727
  !l && c ? /* @__PURE__ */ s(
2581
- Bt,
1728
+ Et,
2582
1729
  {
2583
1730
  disabled: !t,
2584
1731
  className: "form-block-preview-control",
2585
1732
  style: { width: "100%" },
2586
- placeholder: i || "选择时间",
1733
+ placeholder: a || "选择时间",
2587
1734
  value: u,
2588
- onChange: d
1735
+ onChange: m
2589
1736
  }
2590
1737
  ) : /* @__PURE__ */ s(
2591
- qt,
1738
+ zt,
2592
1739
  {
2593
1740
  showTime: l && c,
2594
1741
  disabled: !t,
2595
1742
  className: "form-block-preview-control",
2596
1743
  style: { width: "100%" },
2597
- placeholder: i || (l && c ? "选择日期时间" : "选择日期"),
1744
+ placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
2598
1745
  value: u,
2599
- onChange: d
1746
+ onChange: m
2600
1747
  }
2601
1748
  )
2602
1749
  ] });
2603
1750
  }
2604
- const ao = O(
1751
+ const Br = V(
2605
1752
  {
2606
1753
  name: "DateTimeInput",
2607
- schema: m.object({
2608
- label: m.any().optional(),
2609
- enableDate: m.any().optional(),
2610
- enableTime: m.any().optional(),
2611
- placeholder: m.any().optional(),
2612
- value: m.any().optional(),
2613
- min: m.any().optional(),
2614
- max: m.any().optional()
1754
+ schema: d.object({
1755
+ label: d.any().optional(),
1756
+ enableDate: d.any().optional(),
1757
+ enableTime: d.any().optional(),
1758
+ placeholder: d.any().optional(),
1759
+ value: d.any().optional(),
1760
+ min: d.any().optional(),
1761
+ max: d.any().optional()
2615
1762
  }).passthrough()
2616
1763
  },
2617
- oo
2618
- ), io = {
1764
+ Or
1765
+ ), Vr = {
2619
1766
  name: "FileUpload",
2620
- schema: m.object({
2621
- label: m.any().optional(),
2622
- accept: m.any().optional(),
2623
- fileAcceptTypes: m.any().optional(),
2624
- filePlaceholderIcon: m.any().optional(),
2625
- minCount: m.any().optional(),
2626
- maxCount: m.any().optional(),
2627
- value: m.any().optional()
1767
+ schema: d.object({
1768
+ label: d.any().optional(),
1769
+ accept: d.any().optional(),
1770
+ fileAcceptTypes: d.any().optional(),
1771
+ filePlaceholderIcon: d.any().optional(),
1772
+ minCount: d.any().optional(),
1773
+ maxCount: d.any().optional(),
1774
+ value: d.any().optional()
2628
1775
  }).passthrough()
2629
1776
  };
2630
- function lo({ context: e }) {
2631
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = i ? i.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = dn(l, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1777
+ function wr({ context: e }) {
1778
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = rn(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2632
1779
  o.filePlaceholderIcon
2633
- ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, $ = K(n), A = v && $.length >= g, w = $.length < p;
2634
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2635
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2636
- /* @__PURE__ */ k(
2637
- Te.Dragger,
1780
+ ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, I = L(n), T = v && I.length >= g, k = I.length < p;
1781
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1782
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1783
+ /* @__PURE__ */ C(
1784
+ Se.Dragger,
2638
1785
  {
2639
- disabled: !t || A,
2640
- accept: pn(l, c),
1786
+ disabled: !t || T,
1787
+ accept: nn(l, c),
2641
1788
  className: "form-file-upload-preview",
2642
- showUploadList: t && $.length > 0,
2643
- fileList: t ? $.map((f, h) => ({
1789
+ showUploadList: t && I.length > 0,
1790
+ fileList: t ? I.map((f, h) => ({
2644
1791
  uid: `${h}-${f}`,
2645
1792
  name: f,
2646
1793
  status: "done"
2647
1794
  })) : [],
2648
1795
  beforeUpload: (f) => {
2649
- if (!t) return Te.LIST_IGNORE;
2650
- const h = K(Ze(e));
2651
- if (v && h.length >= g) return Te.LIST_IGNORE;
2652
- const S = v ? [...h, f.name].slice(0, g) : [...h, f.name];
2653
- return r(S), !1;
1796
+ if (!t) return Se.LIST_IGNORE;
1797
+ const h = L(Ke(e));
1798
+ if (v && h.length >= g) return Se.LIST_IGNORE;
1799
+ const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
1800
+ return r(x), !1;
2654
1801
  },
2655
1802
  onRemove: (f) => {
2656
- const h = K(Ze(e)), S = /^(\d+)-/.exec(f.uid ?? ""), y = S ? Number(S[1]) : -1, x = y >= 0 && y < h.length ? h.filter((N, E) => E !== y) : h.filter((N) => N !== f.name);
2657
- if (x.length < p) return !1;
2658
- r(x);
1803
+ const h = L(Ke(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((M, z) => z !== y) : h.filter((M) => M !== f.name);
1804
+ if (S.length < p) return !1;
1805
+ r(S);
2659
1806
  },
2660
1807
  children: [
2661
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(qr, { type: d, size: 40 }) }),
1808
+ /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(Sr, { type: m, size: 40 }) }),
2662
1809
  /* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
2663
1810
  ]
2664
1811
  }
2665
1812
  ),
2666
- /* @__PURE__ */ k(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
1813
+ /* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
2667
1814
  "允许:",
2668
1815
  u ?? "全部类型",
2669
1816
  p > 0 ? `;至少 ${p} 个文件` : "",
2670
1817
  v ? `;最多 ${g} 个文件` : "",
2671
- w && t ? `(当前 ${$.length} 个,未达下限)` : ""
1818
+ k && t ? `(当前 ${I.length} 个,未达下限)` : ""
2672
1819
  ] })
2673
1820
  ] });
2674
1821
  }
2675
- const so = O(
2676
- io,
2677
- lo
1822
+ const qr = V(
1823
+ Vr,
1824
+ wr
2678
1825
  );
2679
- function co({ context: e }) {
2680
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = C(o.variant) || "shortText", c = le(n) ?? "", u = !t, d = "form-block-preview-control";
1826
+ function jr({ context: e }) {
1827
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = A(o.variant) || "shortText", c = ne(n) ?? "", u = !t, m = "form-block-preview-control";
2681
1828
  let p;
2682
1829
  if (l === "longText")
2683
1830
  p = /* @__PURE__ */ s(
2684
- $e.TextArea,
1831
+ xe.TextArea,
2685
1832
  {
2686
1833
  disabled: u,
2687
- className: d,
2688
- placeholder: i || "长文本回答...",
1834
+ className: m,
1835
+ placeholder: a || "长文本回答...",
2689
1836
  autoSize: { minRows: 2, maxRows: 6 },
2690
1837
  value: c,
2691
1838
  onChange: (g) => r(g.target.value)
@@ -2694,249 +1841,249 @@ function co({ context: e }) {
2694
1841
  else if (l === "number") {
2695
1842
  const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
2696
1843
  p = /* @__PURE__ */ s(
2697
- Lt,
1844
+ Rt,
2698
1845
  {
2699
1846
  disabled: u,
2700
- className: d,
1847
+ className: m,
2701
1848
  style: { width: "100%" },
2702
- placeholder: i || "数字",
1849
+ placeholder: a || "数字",
2703
1850
  value: g,
2704
1851
  onChange: (v) => r(v == null ? "" : String(v))
2705
1852
  }
2706
1853
  );
2707
1854
  } else l === "obscured" ? p = /* @__PURE__ */ s(
2708
- $e.Password,
1855
+ xe.Password,
2709
1856
  {
2710
1857
  disabled: u,
2711
- className: d,
2712
- placeholder: i,
1858
+ className: m,
1859
+ placeholder: a,
2713
1860
  value: c,
2714
1861
  onChange: (g) => r(g.target.value)
2715
1862
  }
2716
1863
  ) : p = /* @__PURE__ */ s(
2717
- $e,
1864
+ xe,
2718
1865
  {
2719
1866
  disabled: u,
2720
- className: d,
2721
- placeholder: i,
1867
+ className: m,
1868
+ placeholder: a,
2722
1869
  value: c,
2723
1870
  onChange: (g) => r(g.target.value)
2724
1871
  }
2725
1872
  );
2726
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2727
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1873
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1874
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2728
1875
  p
2729
1876
  ] });
2730
1877
  }
2731
- const uo = O(
1878
+ const $r = V(
2732
1879
  {
2733
1880
  name: "TextField",
2734
- schema: m.object({
2735
- label: m.any().optional(),
2736
- variant: m.any().optional(),
2737
- placeholder: m.any().optional(),
2738
- validationRegexp: m.any().optional(),
2739
- value: m.any().optional()
1881
+ schema: d.object({
1882
+ label: d.any().optional(),
1883
+ variant: d.any().optional(),
1884
+ placeholder: d.any().optional(),
1885
+ validationRegexp: d.any().optional(),
1886
+ value: d.any().optional()
2740
1887
  }).passthrough()
2741
1888
  },
2742
- co
1889
+ jr
2743
1890
  );
2744
- function po({ context: e }) {
2745
- const t = e.componentModel.properties, n = C(t.text), r = C(t.variant) || "body";
2746
- return Dr.has(r) ? r === "caption" ? /* @__PURE__ */ s(H.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(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
1891
+ function Lr({ context: e }) {
1892
+ const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
1893
+ return Cr.has(r) ? r === "caption" ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
2747
1894
  }
2748
- const mo = O(
2749
- { name: "Text", schema: pe("Text") },
2750
- po
1895
+ const Dr = V(
1896
+ { name: "Text", schema: ae("Text") },
1897
+ Lr
2751
1898
  );
2752
- function _t() {
1899
+ function Tt() {
2753
1900
  const t = [
2754
- ...[...ge.components.values()].filter(
2755
- (r) => !Lr.has(r.name)
1901
+ ...[...ue.components.values()].filter(
1902
+ (r) => !xr.has(r.name)
2756
1903
  ),
2757
- Hr,
2758
- Zr,
2759
- Jr,
2760
- Gr,
2761
- Yr,
2762
- eo,
2763
- no,
2764
- ao,
2765
- so,
2766
- uo,
2767
- mo,
2768
- ...Qn()
2769
- ], n = [...ge.functions.values()];
2770
- return new Wt(Mt, t, n, ge.themeSchema);
2771
- }
2772
- const fo = Et(
1904
+ Ar,
1905
+ Pr,
1906
+ Tr,
1907
+ Nr,
1908
+ Ir,
1909
+ _r,
1910
+ zr,
1911
+ Br,
1912
+ qr,
1913
+ $r,
1914
+ Dr,
1915
+ ...Kn()
1916
+ ], n = [...ue.functions.values()];
1917
+ return new $t(kt, t, n, ue.themeSchema);
1918
+ }
1919
+ const Kr = It(
2773
1920
  function({
2774
1921
  doc: t,
2775
1922
  surfaceId: n = "skopon-form",
2776
1923
  emptyHint: r = null,
2777
1924
  interactive: o = !0,
2778
- fieldNames: a = [],
2779
- resumeSearch: i = null,
1925
+ fieldNames: i = [],
1926
+ resumeSearch: a = null,
2780
1927
  caseSearch: l = null
2781
1928
  }, c) {
2782
- q(() => {
2783
- zt(), Nt();
1929
+ j(() => {
1930
+ tt(), et();
2784
1931
  }, []);
2785
- const u = B(null), d = B(a);
2786
- d.current = a;
2787
- const p = R(() => {
2788
- if (Ve(t)) return "";
1932
+ const u = q(null), m = q(i);
1933
+ m.current = i;
1934
+ const p = B(() => {
1935
+ if (Ee(t)) return "";
2789
1936
  try {
2790
1937
  return JSON.stringify(t);
2791
1938
  } catch {
2792
1939
  return String(t);
2793
1940
  }
2794
- }, [t]), g = R(() => {
1941
+ }, [t]), g = B(() => {
2795
1942
  if (!p)
2796
1943
  return { surfaces: [], processor: null };
2797
1944
  try {
2798
- const A = JSON.parse(p), w = new it([_t()]), f = ur(A, {
1945
+ const T = JSON.parse(p), k = new Qe([Tt()]), f = nr(T, {
2799
1946
  surfaceId: n,
2800
- catalogId: Mt
1947
+ catalogId: kt
2801
1948
  });
2802
- return w.processMessages(f), {
2803
- surfaces: Array.from(w.model.surfacesMap.values()),
2804
- processor: w
1949
+ return k.processMessages(f), {
1950
+ surfaces: Array.from(k.model.surfacesMap.values()),
1951
+ processor: k
2805
1952
  };
2806
- } catch (A) {
2807
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", A), { surfaces: [], processor: null };
1953
+ } catch (T) {
1954
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
2808
1955
  }
2809
- }, [p, n]), { surfaces: v, processor: $ } = g;
2810
- return u.current = $, Ut(
1956
+ }, [p, n]), { surfaces: v, processor: I } = g;
1957
+ return u.current = I, Mt(
2811
1958
  c,
2812
1959
  () => ({
2813
- getValues(A) {
2814
- const w = u.current;
2815
- if (!w) return {};
2816
- const f = (A ?? d.current).map((h) => h.trim()).filter(Boolean);
2817
- return fr(w, n, f);
1960
+ getValues(T) {
1961
+ const k = u.current;
1962
+ if (!k) return {};
1963
+ const f = (T ?? m.current).map((h) => h.trim()).filter(Boolean);
1964
+ return ar(k, n, f);
2818
1965
  }
2819
1966
  }),
2820
1967
  [n]
2821
- ), v.length === 0 ? /* @__PURE__ */ s(tt, { children: r }) : /* @__PURE__ */ s(yt, { resumeSearch: i, children: /* @__PURE__ */ s(ht, { caseSearch: l, children: /* @__PURE__ */ s(ct, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((A) => /* @__PURE__ */ s(at, { surface: A }, A.id)) }) }) }) });
1968
+ ), v.length === 0 ? /* @__PURE__ */ s(Ye, { children: r }) : /* @__PURE__ */ s(mt, { resumeSearch: a, children: /* @__PURE__ */ s(ut, { caseSearch: l, children: /* @__PURE__ */ s(ot, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ s(Ze, { surface: T }, T.id)) }) }) }) });
2822
1969
  }
2823
1970
  );
2824
- function he() {
2825
- return new it([_t()]);
1971
+ function ce() {
1972
+ return new Qe([Tt()]);
2826
1973
  }
2827
- function $o({
1974
+ function ao({
2828
1975
  messages: e,
2829
1976
  surfaceId: t = "skopon-form-stream",
2830
1977
  emptyHint: n = null,
2831
1978
  interactive: r = !0,
2832
1979
  resumeSearch: o = null,
2833
- caseSearch: a = null
1980
+ caseSearch: i = null
2834
1981
  }) {
2835
- q(() => {
2836
- zt(), Nt();
1982
+ j(() => {
1983
+ tt(), et();
2837
1984
  }, []);
2838
- const i = B(null);
2839
- i.current === null && (i.current = he());
2840
- const l = B(0), c = B(""), u = B(!0), d = B(t);
1985
+ const a = q(null);
1986
+ a.current === null && (a.current = ce());
1987
+ const l = q(0), c = q(""), u = q(!0), m = q(t);
2841
1988
  function p(f, h) {
2842
- i.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && ($(f), w(Array.from(f.model.surfacesMap.values())));
1989
+ a.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (I(f), k(Array.from(f.model.surfacesMap.values())));
2843
1990
  }
2844
1991
  function g(f, h) {
2845
1992
  if (h <= 0) return !1;
2846
- const S = JSON.stringify(f.slice(0, h)), y = c.current;
1993
+ const x = JSON.stringify(f.slice(0, h)), y = c.current;
2847
1994
  if (!y) return !0;
2848
1995
  try {
2849
- const x = JSON.parse(y);
2850
- return JSON.stringify(x.slice(0, h)) !== S;
1996
+ const S = JSON.parse(y);
1997
+ return JSON.stringify(S.slice(0, h)) !== x;
2851
1998
  } catch {
2852
1999
  return !0;
2853
2000
  }
2854
2001
  }
2855
- const [v, $] = F(
2856
- () => i.current
2857
- ), [A, w] = F(
2002
+ const [v, I] = U(
2003
+ () => a.current
2004
+ ), [T, k] = U(
2858
2005
  () => Array.from(
2859
- i.current.model.surfacesMap.values()
2006
+ a.current.model.surfacesMap.values()
2860
2007
  )
2861
2008
  );
2862
- return q(() => (u.current = !0, () => {
2009
+ return j(() => (u.current = !0, () => {
2863
2010
  u.current = !1;
2864
- }), []), q(() => {
2865
- i.current = v;
2866
- }, [v]), q(() => {
2011
+ }), []), j(() => {
2012
+ a.current = v;
2013
+ }, [v]), j(() => {
2867
2014
  const f = () => {
2868
- u.current && w(Array.from(v.model.surfacesMap.values()));
2869
- }, h = v.onSurfaceCreated(f), S = v.onSurfaceDeleted(f);
2015
+ u.current && k(Array.from(v.model.surfacesMap.values()));
2016
+ }, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
2870
2017
  return () => {
2871
- h.unsubscribe(), S.unsubscribe();
2018
+ h.unsubscribe(), x.unsubscribe();
2872
2019
  };
2873
- }, [v]), q(() => {
2020
+ }, [v]), j(() => {
2874
2021
  let f = !1;
2875
- const h = d.current !== t;
2876
- if (d.current = t, h) {
2877
- const N = he();
2878
- return Array.isArray(e) && e.length > 0 ? (N.processMessages(e), f || p(N, e)) : (i.current = N, l.current = 0, c.current = "", f || ($(N), w([]))), () => {
2022
+ const h = m.current !== t;
2023
+ if (m.current = t, h) {
2024
+ const M = ce();
2025
+ return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), f || p(M, e)) : (a.current = M, l.current = 0, c.current = "", f || (I(M), k([]))), () => {
2879
2026
  f = !0;
2880
2027
  };
2881
2028
  }
2882
2029
  if (!Array.isArray(e) || e.length === 0) {
2883
2030
  if (l.current > 0) {
2884
- const N = he();
2885
- i.current = N, l.current = 0, c.current = "", f || ($(N), w([]));
2031
+ const M = ce();
2032
+ a.current = M, l.current = 0, c.current = "", f || (I(M), k([]));
2886
2033
  }
2887
2034
  return () => {
2888
2035
  f = !0;
2889
2036
  };
2890
2037
  }
2891
- const S = i.current, y = l.current;
2038
+ const x = a.current, y = l.current;
2892
2039
  if (e.length < y || g(e, y)) {
2893
- const N = he();
2894
- return N.processMessages(e), f || p(N, e), () => {
2040
+ const M = ce();
2041
+ return M.processMessages(e), f || p(M, e), () => {
2895
2042
  f = !0;
2896
2043
  };
2897
2044
  }
2898
- const x = e.slice(y);
2899
- return x.length === 0 ? () => {
2045
+ const S = e.slice(y);
2046
+ return S.length === 0 ? () => {
2900
2047
  f = !0;
2901
- } : (S.processMessages(x), l.current = e.length, c.current = JSON.stringify(e), f || w(Array.from(S.model.surfacesMap.values())), () => {
2048
+ } : (x.processMessages(S), l.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
2902
2049
  f = !0;
2903
2050
  });
2904
- }, [e, t]), A.length === 0 ? /* @__PURE__ */ s(tt, { children: n }) : /* @__PURE__ */ s(yt, { resumeSearch: o, children: /* @__PURE__ */ s(ht, { caseSearch: a, children: /* @__PURE__ */ s(ct, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: A.map((f) => /* @__PURE__ */ s(at, { surface: f }, f.id)) }) }) }) });
2051
+ }, [e, t]), T.length === 0 ? /* @__PURE__ */ s(Ye, { children: n }) : /* @__PURE__ */ s(mt, { resumeSearch: o, children: /* @__PURE__ */ s(ut, { caseSearch: i, children: /* @__PURE__ */ s(ot, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ s(Ze, { surface: f }, f.id)) }) }) }) });
2905
2052
  }
2906
- function ho({
2053
+ function Jr({
2907
2054
  payload: e,
2908
2055
  callbackUrl: t,
2909
2056
  title: n,
2910
2057
  unpublishedFormId: r,
2911
2058
  incompleteFormId: o,
2912
- copyMode: a = "display",
2913
- onNotify: i
2059
+ copyMode: i = "display",
2060
+ onNotify: a
2914
2061
  }) {
2915
- const l = R(
2916
- () => At(e, t),
2062
+ const l = B(
2063
+ () => St(e, t),
2917
2064
  [e, t]
2918
- ), c = R(() => a === "submitFields" ? Cr(e, t) : l, [a, e, t, l]);
2065
+ ), c = B(() => i === "submitFields" ? gr(e, t) : l, [i, e, t, l]);
2919
2066
  async function u() {
2920
2067
  try {
2921
- await $t(c), i == null || i("success", "已复制到剪贴板");
2068
+ await Ct(c), a == null || a("success", "已复制到剪贴板");
2922
2069
  } catch {
2923
- i == null || i("error", "复制失败");
2070
+ a == null || a("error", "复制失败");
2924
2071
  }
2925
2072
  }
2926
- const d = a === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2927
- return /* @__PURE__ */ k("div", { className: "ask-user-curl-card", children: [
2928
- /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header", children: [
2929
- /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header-title", children: [
2930
- /* @__PURE__ */ s(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2931
- r ? /* @__PURE__ */ s(ae, { title: r, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2932
- o ? /* @__PURE__ */ s(ae, { title: o, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2073
+ const m = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2074
+ return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2075
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2076
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2077
+ /* @__PURE__ */ s(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
2078
+ r ? /* @__PURE__ */ s(ee, { title: r, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2079
+ o ? /* @__PURE__ */ s(ee, { title: o, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2933
2080
  ] }),
2934
- /* @__PURE__ */ s(ae, { title: d, children: /* @__PURE__ */ s(xe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2081
+ /* @__PURE__ */ s(ee, { title: m, children: /* @__PURE__ */ s(fe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2935
2082
  ] }),
2936
2083
  /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
2937
2084
  ] });
2938
2085
  }
2939
- function go(e, t) {
2086
+ function Hr(e, t) {
2940
2087
  if (t && typeof t == "object" && t !== null && "message" in t) {
2941
2088
  const n = t.message;
2942
2089
  if (typeof n == "string" && n.trim())
@@ -2944,156 +2091,156 @@ function go(e, t) {
2944
2091
  }
2945
2092
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2946
2093
  }
2947
- function No({
2094
+ function lo({
2948
2095
  payload: e,
2949
2096
  formUniqueId: t,
2950
2097
  callbackUrl: n,
2951
2098
  submitMode: r = "curl",
2952
2099
  fetchFormDetail: o,
2953
- onNotify: a,
2954
- resumeSearch: i = null,
2100
+ onNotify: i,
2101
+ resumeSearch: a = null,
2955
2102
  caseSearch: l = null
2956
2103
  }) {
2957
- const [c, u] = F(null), [d, p] = F(!1), [g, v] = F(!0), [$, A] = F(!1), w = B(null), f = B(!0), h = B(a);
2958
- h.current = a;
2959
- const S = (t == null ? void 0 : t.trim()) ?? "";
2960
- q(() => (f.current = !0, () => {
2104
+ const [c, u] = U(null), [m, p] = U(!1), [g, v] = U(!0), [I, T] = U(!1), k = q(null), f = q(!0), h = q(i);
2105
+ h.current = i;
2106
+ const x = (t == null ? void 0 : t.trim()) ?? "";
2107
+ j(() => (f.current = !0, () => {
2961
2108
  f.current = !1;
2962
- }), []), q(() => {
2963
- let M = !1;
2964
- return S ? (v(!0), p(!1), o({ formUniqueId: S }).then((_) => {
2965
- M || (p(!!_.disabled), u(_.formDefinition ?? null));
2109
+ }), []), j(() => {
2110
+ let P = !1;
2111
+ return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((_) => {
2112
+ P || (p(!!_.disabled), u(_.formDefinition ?? null));
2966
2113
  }).catch((_) => {
2967
2114
  var b;
2968
- if (!M) {
2115
+ if (!P) {
2969
2116
  p(!1), u(null);
2970
- const I = _ instanceof Error ? _.message : "获取表单定义失败";
2971
- (b = h.current) == null || b.call(h, "error", I);
2117
+ const F = _ instanceof Error ? _.message : "获取表单定义失败";
2118
+ (b = h.current) == null || b.call(h, "error", F);
2972
2119
  }
2973
2120
  }).finally(() => {
2974
- M || v(!1);
2121
+ P || v(!1);
2975
2122
  }), () => {
2976
- M = !0;
2123
+ P = !0;
2977
2124
  }) : (v(!1), p(!1), u(null), () => {
2978
- M = !0;
2125
+ P = !0;
2979
2126
  });
2980
- }, [S, o]);
2981
- const y = R(() => kt(e), [e]), x = R(() => y ? vr(y, c ?? void 0) : null, [y, c]), N = (x == null ? void 0 : x.matchedBlocks) ?? [], E = !!(y && xr(y) && N.length === 0), L = R(() => E && y ? Sr(y) : x && x.renderBlocks.length > 0 ? x.renderBlocks : [], [x, E, y]), Z = R(
2982
- () => E ? {} : wt((x == null ? void 0 : x.extraBlocks) ?? []),
2983
- [E, x]
2984
- ), V = R(() => E && y ? kr(y) : L.filter((M) => {
2127
+ }, [x, o]);
2128
+ const y = B(() => yt(e), [e]), S = B(() => y ? ur(y, c ?? void 0) : null, [y, c]), M = (S == null ? void 0 : S.matchedBlocks) ?? [], z = !!(y && mr(y) && M.length === 0), $ = B(() => z && y ? dr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, z, y]), G = B(
2129
+ () => z ? {} : vt((S == null ? void 0 : S.extraBlocks) ?? []),
2130
+ [z, S]
2131
+ ), w = B(() => z && y ? fr(y) : $.filter((P) => {
2985
2132
  var _;
2986
- return (_ = M.name) == null ? void 0 : _.trim();
2987
- }).map((M) => M.name.trim()), [E, y, L]), j = R(() => {
2988
- if (L.length === 0) return null;
2989
- const M = (x == null ? void 0 : x.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (x == null ? void 0 : x.description) ?? (y == null ? void 0 : y.description) ?? "";
2990
- return dr({ title: M, description: _ }, L);
2991
- }, [x, y, L]), Y = S ? `ask-user-${S}` : "ask-user-payload";
2133
+ return (_ = P.name) == null ? void 0 : _.trim();
2134
+ }).map((P) => P.name.trim()), [z, y, $]), O = B(() => {
2135
+ if ($.length === 0) return null;
2136
+ const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2137
+ return or({ title: P, description: _ }, $);
2138
+ }, [S, y, $]), H = x ? `ask-user-${x}` : "ask-user-payload";
2992
2139
  if (g)
2993
- return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Le, { size: "small" }) });
2994
- if (!y || L.length === 0)
2140
+ return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Oe, { size: "small" }) });
2141
+ if (!y || $.length === 0)
2995
2142
  return /* @__PURE__ */ s(
2996
- ho,
2143
+ Jr,
2997
2144
  {
2998
2145
  payload: e,
2999
2146
  callbackUrl: n,
3000
2147
  copyMode: "submitFields",
3001
- unpublishedFormId: d && S ? S : void 0,
3002
- onNotify: a
2148
+ unpublishedFormId: m && x ? x : void 0,
2149
+ onNotify: i
3003
2150
  }
3004
2151
  );
3005
- async function W() {
3006
- var M, _, b, I, U, T;
3007
- if (!$) {
3008
- A(!0);
2152
+ async function Y() {
2153
+ var P, _, b, F, R, N;
2154
+ if (!I) {
2155
+ T(!0);
3009
2156
  try {
3010
- const re = ((M = w.current) == null ? void 0 : M.getValues(V)) ?? {}, Ce = { ...re, ...Z };
2157
+ const Z = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, ve = { ...Z, ...G };
3011
2158
  if (r === "post") {
3012
- const Ge = (n ?? "").trim();
3013
- if (!Ge) {
2159
+ const je = (n ?? "").trim();
2160
+ if (!je) {
3014
2161
  (_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
3015
2162
  return;
3016
2163
  }
3017
- const Ae = await Ar(Ge, Ce);
2164
+ const be = await yr(je, ve);
3018
2165
  if (!f.current) return;
3019
- Ae.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", go(Ae.status, Ae.body));
2166
+ be.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Hr(be.status, be.body));
3020
2167
  return;
3021
2168
  }
3022
- if (await $t(
3023
- Tt({ cardValues: re, extraValues: Z, callbackUrl: n })
2169
+ if (await Ct(
2170
+ xt({ cardValues: Z, extraValues: G, callbackUrl: n })
3024
2171
  ), !f.current) return;
3025
- (U = h.current) == null || U.call(h, "success", "已复制 curl 到剪贴板");
3026
- } catch (re) {
2172
+ (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2173
+ } catch (Z) {
3027
2174
  if (!f.current) return;
3028
- const Ce = re instanceof Error ? re.message : "复制失败";
3029
- (T = h.current) == null || T.call(h, "error", Ce);
2175
+ const ve = Z instanceof Error ? Z.message : "复制失败";
2176
+ (N = h.current) == null || N.call(h, "error", ve);
3030
2177
  } finally {
3031
- f.current && A(!1);
2178
+ f.current && T(!1);
3032
2179
  }
3033
2180
  }
3034
2181
  }
3035
- return /* @__PURE__ */ k("div", { className: "ask-user-form-card", children: [
3036
- d && S ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ae, { title: S, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2182
+ return /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2183
+ m && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ee, { title: x, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3037
2184
  /* @__PURE__ */ s(
3038
- fo,
2185
+ Kr,
3039
2186
  {
3040
- ref: w,
3041
- doc: j,
3042
- surfaceId: Y,
3043
- fieldNames: V,
2187
+ ref: k,
2188
+ doc: O,
2189
+ surfaceId: H,
2190
+ fieldNames: w,
3044
2191
  interactive: !0,
3045
- resumeSearch: i,
2192
+ resumeSearch: a,
3046
2193
  caseSearch: l
3047
2194
  }
3048
2195
  ),
3049
- /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ae, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
3050
- xe,
2196
+ /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ee, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
2197
+ fe,
3051
2198
  {
3052
2199
  type: "primary",
3053
2200
  size: "small",
3054
- loading: $,
3055
- disabled: $,
3056
- onClick: () => void W(),
2201
+ loading: I,
2202
+ disabled: I,
2203
+ onClick: () => void Y(),
3057
2204
  children: "提交"
3058
2205
  }
3059
2206
  ) }) })
3060
2207
  ] });
3061
2208
  }
3062
2209
  export {
3063
- Ao as A2UI_PROTOCOL_VERSION,
3064
- No as AskUserFormCard,
3065
- ht as CaseSearchProvider,
3066
- ho as CurlSubmitBlock,
3067
- Xt as FORM_MEDIA_SIZES,
3068
- yt as ResumeSearchProvider,
3069
- $o as SkoponA2uiStreamRenderer,
3070
- fo as SkoponFormRenderer,
3071
- cr as a2uiToBlocks,
3072
- bt as blocksToA2ui,
3073
- wr as buildAskUserCurlBodyJson,
3074
- Tt as buildAskUserCurlStatement,
3075
- Cr as buildAskUserSubmitCurlFromPayload,
3076
- dr as buildAskUserSurface,
3077
- At as buildCurlStatement,
3078
- $t as copyTextToClipboard,
3079
- To as createFormClient,
3080
- wt as extractExtraBlockValues,
3081
- fr as extractSurfaceValues,
3082
- kr as getPayloadInputFieldNames,
3083
- Sr as getPayloadRenderableBlocks,
3084
- vr as intersectPayloadBlocksWithForm,
3085
- Ve as isA2uiSurfaceEmpty,
2210
+ oo as A2UI_PROTOCOL_VERSION,
2211
+ lo as AskUserFormCard,
2212
+ ut as CaseSearchProvider,
2213
+ Jr as CurlSubmitBlock,
2214
+ Lt as FORM_MEDIA_SIZES,
2215
+ mt as ResumeSearchProvider,
2216
+ ao as SkoponA2uiStreamRenderer,
2217
+ Kr as SkoponFormRenderer,
2218
+ tr as a2uiToBlocks,
2219
+ ft as blocksToA2ui,
2220
+ hr as buildAskUserCurlBodyJson,
2221
+ xt as buildAskUserCurlStatement,
2222
+ gr as buildAskUserSubmitCurlFromPayload,
2223
+ or as buildAskUserSurface,
2224
+ St as buildCurlStatement,
2225
+ Ct as copyTextToClipboard,
2226
+ io as createFormClient,
2227
+ vt as extractExtraBlockValues,
2228
+ ar as extractSurfaceValues,
2229
+ fr as getPayloadInputFieldNames,
2230
+ dr as getPayloadRenderableBlocks,
2231
+ ur as intersectPayloadBlocksWithForm,
2232
+ Ee as isA2uiSurfaceEmpty,
3086
2233
  X as isInputBlockType,
3087
- De as isLayoutBlockType,
3088
- je as isMediaBlockType,
3089
- mr as mapFormDefinitionFromDto,
3090
- ne as normalizeFormDefinition,
3091
- kt as parsePayloadBlocksJson,
3092
- xr as payloadHasInputBlocks,
3093
- pr as resolveSurfaceFromFormDefinition,
3094
- Ar as submitFormJson,
3095
- ur as surfaceDocToMessages,
3096
- ye as syncFormDefinition,
3097
- In as useCaseSearch,
3098
- Rn as useResumeSearch
2234
+ Be as isLayoutBlockType,
2235
+ Pe as isMediaBlockType,
2236
+ ir as mapFormDefinitionFromDto,
2237
+ W as normalizeFormDefinition,
2238
+ yt as parsePayloadBlocksJson,
2239
+ mr as payloadHasInputBlocks,
2240
+ rr as resolveSurfaceFromFormDefinition,
2241
+ yr as submitFormJson,
2242
+ nr as surfaceDocToMessages,
2243
+ pe as syncFormDefinition,
2244
+ xn as useCaseSearch,
2245
+ Pn as useResumeSearch
3099
2246
  };