@skopon-cool/form-sdk 0.3.2 → 0.4.0

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