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