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