@skopon-cool/form-sdk 0.5.2 → 0.6.1
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 +34 -3
- 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/authStorage.d.ts +9 -0
- package/dist/client/authStorage.d.ts.map +1 -1
- 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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1565 -1376
- package/package.json +1 -1
- package/src/adapter/a2uiAdapter.test.ts +19 -0
- package/src/adapter/a2uiAdapter.ts +1 -0
- package/src/adapter/formSchema.test.ts +34 -0
- package/src/adapter/formSchema.ts +12 -9
- 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/authStorage.test.ts +67 -1
- package/src/client/authStorage.ts +67 -0
- package/src/client/uploadClient.test.ts +143 -0
- package/src/client/uploadClient.ts +72 -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/index.ts +3 -0
- 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
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
2
|
+
var er = Object.defineProperty;
|
|
3
|
+
var tr = (e, t, n) => t in e ? er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var X = (e, t, n) => tr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as u, jsxs as U } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as x, useState as w, useCallback as q, useMemo as j, createContext as be, useContext as Se, useEffect as z, useSyncExternalStore as nr, forwardRef as rr, useImperativeHandle as or } from "react";
|
|
7
|
+
import { Spin as xt, Button as Ie, Typography as re, Avatar as ir, Tag as Ae, Tooltip as ve, Modal as sr, Select as yt, Checkbox as ar, Radio as lr, Switch as cr, TimePicker as ur, DatePicker as mr, Upload as st, Input as at, InputNumber as dr, ConfigProvider as fr } from "antd";
|
|
8
|
+
import { ReloadOutlined as mn, FileTextOutlined as dn, UserOutlined as pr, FileImageOutlined as hr, FullscreenOutlined as gr, FileExcelOutlined as yr, FileOutlined as fn, PictureOutlined as vr, SoundOutlined as br, VideoCameraOutlined as Sr } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as Z, basicCatalog as Le, A2uiSurface as pn } 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 kr, MessageProcessor as hn } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as gn } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as yn } from "@a2ui/react/styles";
|
|
14
|
+
import Zt from "dayjs";
|
|
15
|
+
const Ys = "v0.9", Cr = [
|
|
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 vn(e) {
|
|
29
29
|
return e === "heading" || e === "paragraph";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return !
|
|
31
|
+
function ee(e) {
|
|
32
|
+
return !vn(e) && !_e(e) && !Te(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function bn(e) {
|
|
35
|
+
return vn(e) || _e(e) || Te(e);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Sn(e) {
|
|
38
38
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function Qs(e) {
|
|
41
|
+
return ee(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const vt = 360, Ar = 200, _r = 1200;
|
|
44
44
|
function Ne(e) {
|
|
45
45
|
if (e == null || e === "")
|
|
46
|
-
return
|
|
46
|
+
return vt;
|
|
47
47
|
const t = typeof e == "number" ? e : Number(e);
|
|
48
48
|
return Number.isFinite(t) ? Math.min(
|
|
49
|
-
|
|
50
|
-
Math.max(
|
|
51
|
-
) :
|
|
49
|
+
_r,
|
|
50
|
+
Math.max(Ar, Math.floor(t))
|
|
51
|
+
) : vt;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Tr(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 xr() {
|
|
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 = xr().replace(/-/g, "").slice(0, 8);
|
|
83
83
|
return `${e}${t}`;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
85
|
+
const kn = [
|
|
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
|
+
], Fr = {
|
|
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
|
+
}, Mr = {
|
|
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
|
+
}, Ir = {
|
|
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
|
+
}, Ft = [
|
|
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
|
+
], Nr = Object.fromEntries(
|
|
161
|
+
kn.map((e) => [e.value, e.label])
|
|
162
|
+
), Er = Object.fromEntries(
|
|
163
|
+
Ft.map((e) => [e.value, e.label])
|
|
164
|
+
), Ur = new Set(kn.map((e) => e.value)), wr = new Set(
|
|
165
|
+
Ft.map((e) => e.value)
|
|
166
166
|
);
|
|
167
|
-
function
|
|
167
|
+
function Rr(e) {
|
|
168
168
|
const t = e.trim();
|
|
169
|
-
return t ?
|
|
169
|
+
return t ? Ur.has(t) ? t : Ir[t] ?? null : null;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Pr(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 = Rr(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 zr(e) {
|
|
187
|
+
const t = Ee(e), n = [];
|
|
188
188
|
for (const r of t)
|
|
189
|
-
n.push(...
|
|
189
|
+
n.push(...Fr[r] ?? [r]);
|
|
190
190
|
return n;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const t =
|
|
192
|
+
function Or(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 Mr[r] ?? [])
|
|
198
198
|
n.add(o);
|
|
199
|
-
return
|
|
199
|
+
return Ft.filter((r) => n.has(r.value));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const n =
|
|
201
|
+
function Mt(e, t) {
|
|
202
|
+
const n = Pr(t), r = Ee(e);
|
|
203
203
|
if (r.length === 0)
|
|
204
|
-
return n.filter((i) =>
|
|
204
|
+
return n.filter((i) => wr.has(i));
|
|
205
205
|
const o = new Set(
|
|
206
|
-
|
|
206
|
+
Or(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 Br(e, t) {
|
|
211
|
+
const n = zr(e), r = Mt(e, t), o = [...n, ...r];
|
|
212
212
|
return o.length > 0 ? o.join(",") : void 0;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
const n =
|
|
214
|
+
function Lr(e, t) {
|
|
215
|
+
const n = Ee(e), r = Mt(
|
|
216
216
|
n,
|
|
217
217
|
t
|
|
218
218
|
), o = [
|
|
219
|
-
...n.map((i) =>
|
|
220
|
-
...r.map((i) =>
|
|
219
|
+
...n.map((i) => Nr[i] ?? i),
|
|
220
|
+
...r.map((i) => Er[i] ?? i)
|
|
221
221
|
];
|
|
222
222
|
return o.length === 0 ? null : o.join("、");
|
|
223
223
|
}
|
|
224
|
-
const
|
|
224
|
+
const qr = [
|
|
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
|
+
], Vr = new Set(qr);
|
|
232
|
+
function $r(e) {
|
|
233
|
+
return e && Vr.has(e) ? e : "file";
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return typeof e == "string" &&
|
|
235
|
+
function Ue(e) {
|
|
236
|
+
return typeof e == "string" && Cr.includes(e) ? e : "medium";
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function jr(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 Dr(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 Hr(e) {
|
|
249
|
+
return `form-media-size-${Ue(e)}`;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
return `form-media-preview form-media-list ${
|
|
251
|
+
function Kr(e) {
|
|
252
|
+
return `form-media-preview form-media-list ${Hr(e)}`;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function en(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 = en(r.value), i = en(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 !Sn(e.type) || ce(e.options).length > 0;
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
function
|
|
275
|
+
const Wr = 10;
|
|
276
|
+
function Cn(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 An(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 Gr(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 Jr(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 = Gr(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 Yr(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 Qr(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 Xr(e) {
|
|
323
323
|
var o, i, s, a, l;
|
|
324
|
-
const t =
|
|
324
|
+
const t = Qr(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) ? jr(t, Wr) : 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) ? Ne(t.webHeight) : void 0,
|
|
337
337
|
fileAcceptTypes: n,
|
|
338
|
-
fileAcceptExtensions:
|
|
338
|
+
fileAcceptExtensions: Mt(
|
|
339
339
|
n,
|
|
340
340
|
t.fileAcceptExtensions
|
|
341
341
|
),
|
|
342
|
-
filePlaceholderIcon:
|
|
343
|
-
fileMinCount: r === "file" ?
|
|
344
|
-
fileMaxCount: r === "file" ?
|
|
345
|
-
defaultValue:
|
|
342
|
+
filePlaceholderIcon: $r(t.filePlaceholderIcon),
|
|
343
|
+
fileMinCount: r === "file" ? qe(t.fileMinCount, 1) : void 0,
|
|
344
|
+
fileMaxCount: r === "file" ? qe(t.fileMaxCount, 1) : void 0,
|
|
345
|
+
defaultValue: An(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" ? Yr(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" ? Jr(t.caseFilter) : void 0
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
return new Set(
|
|
365
|
+
function Zr(e) {
|
|
366
|
+
return new Set(ce(e.options).map((t) => t.value));
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function tn(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 eo(e) {
|
|
376
|
+
const t = An(e.type, e.defaultValue);
|
|
377
377
|
if (t === void 0) return;
|
|
378
|
-
const n =
|
|
378
|
+
const n = Zr(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 to(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 =
|
|
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 =
|
|
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 = tn(e.resumeMinCount, e.resumeMaxCount);
|
|
444
448
|
break;
|
|
445
449
|
case "case_multiselect":
|
|
446
|
-
n =
|
|
450
|
+
n = tn(e.caseMinCount, e.caseMaxCount);
|
|
447
451
|
break;
|
|
448
452
|
case "text":
|
|
449
453
|
n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
|
|
@@ -454,17 +458,17 @@ 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 = eo(e);
|
|
458
462
|
return o !== void 0 && (n.default = o), n;
|
|
459
463
|
}
|
|
460
|
-
function
|
|
464
|
+
function no(e, t, n) {
|
|
461
465
|
var l;
|
|
462
466
|
const r = {}, o = [];
|
|
463
|
-
for (const
|
|
464
|
-
const m = (l =
|
|
465
|
-
if (!m || !
|
|
466
|
-
const d =
|
|
467
|
-
d && (r[m] = d,
|
|
467
|
+
for (const c of e) {
|
|
468
|
+
const m = (l = c.name) == null ? void 0 : l.trim();
|
|
469
|
+
if (!m || !ee(c.type) || !fe(c)) continue;
|
|
470
|
+
const d = to(c);
|
|
471
|
+
d && (r[m] = d, c.required && o.push(m));
|
|
468
472
|
}
|
|
469
473
|
const i = {
|
|
470
474
|
type: "object",
|
|
@@ -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: no(e.blocks, t, n)
|
|
484
488
|
};
|
|
485
489
|
}
|
|
486
|
-
function
|
|
490
|
+
function De(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(Xr);
|
|
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 Xs() {
|
|
501
|
+
return xe({ title: "", description: "", blocks: [] });
|
|
498
502
|
}
|
|
499
|
-
function
|
|
503
|
+
function Zs(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 = vt), Sn(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 ro(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,14 +527,14 @@ 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 nn(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
|
|
533
|
-
var s, a, l,
|
|
536
|
+
function oo(e, t) {
|
|
537
|
+
var s, a, l, c, m, d;
|
|
534
538
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
535
539
|
return i({
|
|
536
540
|
id: n,
|
|
@@ -543,7 +547,7 @@ function Yr(e, t) {
|
|
|
543
547
|
agentKind: (s = e.caseFilter) == null ? void 0 : s.agentKind,
|
|
544
548
|
agentUniqueId: (a = e.caseFilter) == null ? void 0 : a.agentUniqueId,
|
|
545
549
|
flowType: (l = e.caseFilter) == null ? void 0 : l.flowType,
|
|
546
|
-
category: (
|
|
550
|
+
category: (c = e.caseFilter) == null ? void 0 : c.category,
|
|
547
551
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
548
552
|
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
549
553
|
},
|
|
@@ -552,7 +556,7 @@ function Yr(e, t) {
|
|
|
552
556
|
value: { path: o }
|
|
553
557
|
});
|
|
554
558
|
}
|
|
555
|
-
function
|
|
559
|
+
function io(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 = ro(e.caseFilter));
|
|
568
|
+
const a = nn(e.minCount);
|
|
565
569
|
a !== void 0 && (o.caseMinCount = a);
|
|
566
|
-
const l =
|
|
570
|
+
const l = nn(e.maxCount);
|
|
567
571
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
568
572
|
}
|
|
569
|
-
const
|
|
573
|
+
const _n = be(
|
|
570
574
|
null
|
|
571
575
|
);
|
|
572
|
-
function
|
|
576
|
+
function so(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 ao = {
|
|
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 lo({ 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, c] = w(
|
|
590
594
|
[]
|
|
591
|
-
), m =
|
|
592
|
-
(y,
|
|
595
|
+
), m = q(
|
|
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 = so(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)), c(r.current), i((p) => p + 1));
|
|
600
604
|
},
|
|
601
605
|
[]
|
|
602
|
-
), d =
|
|
603
|
-
r.current = [],
|
|
604
|
-
}, []),
|
|
606
|
+
), d = q(() => {
|
|
607
|
+
r.current = [], c([]);
|
|
608
|
+
}, []), S = j(
|
|
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__ */
|
|
624
|
+
return /* @__PURE__ */ u(_n.Provider, { value: S, children: e });
|
|
621
625
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
626
|
+
function It() {
|
|
627
|
+
return Se(_n) ?? ao;
|
|
624
628
|
}
|
|
625
|
-
const
|
|
626
|
-
function
|
|
629
|
+
const Tn = be({ interactive: !0 });
|
|
630
|
+
function bt({
|
|
627
631
|
interactive: e,
|
|
628
632
|
children: t
|
|
629
633
|
}) {
|
|
630
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ u(Tn.Provider, { value: { interactive: e }, children: t });
|
|
631
635
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
636
|
+
function ue() {
|
|
637
|
+
return Se(Tn);
|
|
634
638
|
}
|
|
635
|
-
const
|
|
636
|
-
function
|
|
639
|
+
const xn = be(null);
|
|
640
|
+
function co(e) {
|
|
637
641
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
638
642
|
}
|
|
639
|
-
const
|
|
643
|
+
const uo = {
|
|
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 mo(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,40 +658,40 @@ function ro(e) {
|
|
|
654
658
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
655
659
|
};
|
|
656
660
|
}
|
|
657
|
-
function
|
|
661
|
+
function fo({
|
|
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 = q((c) => {
|
|
664
668
|
const m = r.current;
|
|
665
669
|
if (!m) return;
|
|
666
670
|
const d = {
|
|
667
|
-
action:
|
|
668
|
-
component:
|
|
671
|
+
action: c.action,
|
|
672
|
+
component: c.component
|
|
669
673
|
};
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
m.send(
|
|
673
|
-
}, []), i =
|
|
674
|
+
c.field !== void 0 && (d.field = c.field), c.value !== void 0 && (d.value = c.value);
|
|
675
|
+
const S = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
676
|
+
m.send(S, d);
|
|
677
|
+
}, []), i = q((c) => {
|
|
674
678
|
const m = r.current;
|
|
675
|
-
m && m.send("form_runtime_data",
|
|
676
|
-
}, []), s =
|
|
679
|
+
m && m.send("form_runtime_data", mo(c));
|
|
680
|
+
}, []), s = q((c) => {
|
|
677
681
|
n.current += 1;
|
|
678
682
|
let m;
|
|
679
683
|
try {
|
|
680
|
-
m =
|
|
684
|
+
m = c();
|
|
681
685
|
} catch (d) {
|
|
682
686
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
683
687
|
}
|
|
684
|
-
return
|
|
688
|
+
return co(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 = q(
|
|
688
692
|
() => n.current > 0,
|
|
689
693
|
[]
|
|
690
|
-
), l =
|
|
694
|
+
), l = j(
|
|
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__ */
|
|
703
|
+
return /* @__PURE__ */ u(xn.Provider, { value: l, children: t });
|
|
700
704
|
}
|
|
701
|
-
function
|
|
702
|
-
return
|
|
705
|
+
function Fn() {
|
|
706
|
+
return Se(xn) ?? uo;
|
|
703
707
|
}
|
|
704
|
-
const
|
|
705
|
-
function
|
|
708
|
+
const po = 300;
|
|
709
|
+
function ho(e) {
|
|
706
710
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
707
711
|
}
|
|
708
|
-
function
|
|
712
|
+
function go(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 le(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 = ho(o), s = go(i), a = Fn(), {
|
|
721
720
|
component: l = "Unknown",
|
|
722
|
-
changeAction:
|
|
721
|
+
changeAction: c = "change",
|
|
723
722
|
debounceChange: m = !1
|
|
724
|
-
} = n, d =
|
|
725
|
-
|
|
726
|
-
const g =
|
|
727
|
-
g.current =
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
d.current != null && (clearTimeout(d.current), d.current = null), y.current &&
|
|
723
|
+
} = n, d = x(null), S = x(void 0), y = x(!1), T = x(a);
|
|
724
|
+
T.current = a;
|
|
725
|
+
const g = x(c);
|
|
726
|
+
g.current = c;
|
|
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: S.current
|
|
737
736
|
}));
|
|
738
737
|
}, []);
|
|
739
|
-
const p =
|
|
740
|
-
(
|
|
738
|
+
const p = q(
|
|
739
|
+
(N) => {
|
|
741
740
|
if (!i || o === void 0) return () => {
|
|
742
741
|
};
|
|
743
|
-
const
|
|
744
|
-
return () =>
|
|
742
|
+
const A = e.dataContext.subscribeDynamicValue(o, () => N());
|
|
743
|
+
return () => A.unsubscribe();
|
|
745
744
|
},
|
|
746
745
|
[e, o, i]
|
|
747
|
-
),
|
|
746
|
+
), k = q(() => {
|
|
748
747
|
if (!(!i || o === void 0))
|
|
749
748
|
return e.dataContext.resolveDynamicValue(o);
|
|
750
|
-
}, [e, o, i]),
|
|
751
|
-
(
|
|
749
|
+
}, [e, o, i]), I = nr(p, k, k), O = q(
|
|
750
|
+
(N) => {
|
|
752
751
|
if (!s) return;
|
|
753
|
-
const
|
|
754
|
-
y.current = !1,
|
|
755
|
-
action:
|
|
752
|
+
const A = () => {
|
|
753
|
+
y.current = !1, T.current.reportEvent({
|
|
754
|
+
action: c,
|
|
756
755
|
component: l,
|
|
757
756
|
field: s,
|
|
758
|
-
value:
|
|
757
|
+
value: N
|
|
759
758
|
});
|
|
760
759
|
};
|
|
761
760
|
if (!m) {
|
|
762
|
-
|
|
761
|
+
A();
|
|
763
762
|
return;
|
|
764
763
|
}
|
|
765
|
-
|
|
766
|
-
d.current = null,
|
|
767
|
-
},
|
|
764
|
+
S.current = N, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
765
|
+
d.current = null, A();
|
|
766
|
+
}, po);
|
|
768
767
|
},
|
|
769
|
-
[s,
|
|
770
|
-
),
|
|
771
|
-
(
|
|
772
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
768
|
+
[s, c, l, m]
|
|
769
|
+
), M = q(
|
|
770
|
+
(N) => {
|
|
771
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), N);
|
|
773
772
|
},
|
|
774
773
|
[e, o, i]
|
|
775
|
-
),
|
|
776
|
-
(
|
|
777
|
-
|
|
774
|
+
), $ = q(
|
|
775
|
+
(N) => {
|
|
776
|
+
M(N), O(N);
|
|
778
777
|
},
|
|
779
|
-
[
|
|
780
|
-
),
|
|
781
|
-
s &&
|
|
778
|
+
[M, O]
|
|
779
|
+
), H = q(() => {
|
|
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: I,
|
|
788
|
+
setValue: $,
|
|
790
789
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
791
|
-
setValueSilent:
|
|
790
|
+
setValueSilent: M,
|
|
792
791
|
hasBinding: !!i,
|
|
793
792
|
fieldName: s,
|
|
794
|
-
reportFocus:
|
|
793
|
+
reportFocus: H
|
|
795
794
|
};
|
|
796
795
|
}
|
|
797
|
-
function
|
|
796
|
+
function Fe(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 Mn(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 Ve(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 In(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 Nn(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 En(e, t) {
|
|
820
819
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
821
820
|
}
|
|
822
|
-
const
|
|
823
|
-
function
|
|
821
|
+
const Un = be(null);
|
|
822
|
+
function St({
|
|
824
823
|
caseSearch: e,
|
|
825
824
|
children: t
|
|
826
825
|
}) {
|
|
827
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ u(Un.Provider, { value: e ?? null, children: t });
|
|
828
827
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
828
|
+
function yo() {
|
|
829
|
+
return Se(Un);
|
|
831
830
|
}
|
|
832
|
-
function
|
|
831
|
+
function lt(e) {
|
|
833
832
|
return typeof e == "string" ? e : "";
|
|
834
833
|
}
|
|
835
|
-
function
|
|
834
|
+
function vo(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 ct(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 = vo(t.flowUniqueIds);
|
|
849
848
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
850
849
|
}
|
|
851
|
-
function
|
|
850
|
+
function ut(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 bo(e) {
|
|
857
856
|
return JSON.stringify(e);
|
|
858
857
|
}
|
|
859
|
-
const
|
|
858
|
+
const So = {
|
|
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 ko({
|
|
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__ */
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
e.description ? /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ u(dn, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
886
|
+
/* @__PURE__ */ U("div", { className: "skopon-resume-select-card-body", children: [
|
|
887
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
888
|
+
e.description ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
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,121 +896,121 @@ function mo({
|
|
|
897
896
|
}
|
|
898
897
|
);
|
|
899
898
|
}
|
|
900
|
-
function
|
|
901
|
-
const { interactive: t } =
|
|
899
|
+
function Co({ context: e }) {
|
|
900
|
+
const { interactive: t } = ue(), n = yo(), { publishLiveOptions: r } = It(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = me(e, "value", {
|
|
902
901
|
component: "SkoponCaseSelect",
|
|
903
902
|
changeAction: "click"
|
|
904
|
-
}), l = e.componentModel.properties,
|
|
905
|
-
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
}, [
|
|
909
|
-
const
|
|
910
|
-
async (
|
|
911
|
-
const
|
|
912
|
-
if (!n || !
|
|
913
|
-
|
|
903
|
+
}), l = e.componentModel.properties, c = lt(l.label), m = lt(l.placeholder), d = lt(l.help), S = l.enableRefresh !== !1, y = Ve(l.minCount), T = Ve(l.maxCount), g = j(() => ct(l.caseFilter), [l.caseFilter]), C = bo(g), [v, p] = w(1), [k, I] = w(!1), [O, M] = w(""), [$, H] = w([]), [N, A] = w(0), [Y, G] = w(g.pageSize ?? 20), W = x(0), L = ne(o);
|
|
904
|
+
z(() => {
|
|
905
|
+
const h = En(L, T);
|
|
906
|
+
h !== null && s(h);
|
|
907
|
+
}, [T, L, s]);
|
|
908
|
+
const D = j(() => n ? ut(g) ? O || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, O, m]), ie = q(
|
|
909
|
+
async (h) => {
|
|
910
|
+
const b = ct(JSON.parse(C)), R = ++W.current;
|
|
911
|
+
if (!n || !ut(b)) {
|
|
912
|
+
H([]), A(0), M(""), I(!1);
|
|
914
913
|
return;
|
|
915
914
|
}
|
|
916
|
-
|
|
915
|
+
I(!0), M("");
|
|
917
916
|
try {
|
|
918
|
-
const
|
|
919
|
-
if (R !==
|
|
920
|
-
|
|
917
|
+
const F = await n({ filter: b, page: h });
|
|
918
|
+
if (R !== W.current) return;
|
|
919
|
+
H(F.list), A(F.total), p(F.page), G(F.pageSize), a && r(
|
|
921
920
|
a,
|
|
922
|
-
|
|
923
|
-
value:
|
|
924
|
-
label:
|
|
921
|
+
F.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 (F) {
|
|
927
|
+
if (R !== W.current) return;
|
|
928
|
+
H([]), A(0), M(F instanceof Error ? F.message : "加载案例列表失败");
|
|
930
929
|
} finally {
|
|
931
|
-
R ===
|
|
930
|
+
R === W.current && I(!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 = In(
|
|
941
|
+
L,
|
|
942
|
+
h,
|
|
944
943
|
y,
|
|
945
|
-
|
|
944
|
+
T
|
|
946
945
|
);
|
|
947
|
-
|
|
948
|
-
},
|
|
949
|
-
const
|
|
950
|
-
|
|
946
|
+
b !== null && i(b);
|
|
947
|
+
}, _ = () => {
|
|
948
|
+
const h = ct(JSON.parse(C)), b = Y || h.pageSize || 20, R = Math.max(1, Math.ceil(N / b)), F = v >= R ? 1 : v + 1;
|
|
949
|
+
ie(F);
|
|
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
|
-
|
|
959
|
-
|
|
960
|
-
/* @__PURE__ */
|
|
957
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
958
|
+
k && $.length === 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-status", children: [
|
|
959
|
+
/* @__PURE__ */ u(xt, { size: "small" }),
|
|
961
960
|
" 加载案例…"
|
|
962
961
|
] }) : null,
|
|
963
|
-
!
|
|
964
|
-
|
|
965
|
-
|
|
962
|
+
!k && $.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: D }) : null,
|
|
963
|
+
$.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: $.map((h) => /* @__PURE__ */ u(
|
|
964
|
+
ko,
|
|
966
965
|
{
|
|
967
|
-
item:
|
|
968
|
-
selected:
|
|
969
|
-
disabled:
|
|
970
|
-
|
|
971
|
-
|
|
966
|
+
item: h,
|
|
967
|
+
selected: L.includes(h.caseUniqueId),
|
|
968
|
+
disabled: Nn(
|
|
969
|
+
L,
|
|
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
|
+
S && n && ut(g) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
980
|
+
Ie,
|
|
982
981
|
{
|
|
983
982
|
type: "default",
|
|
984
983
|
size: "small",
|
|
985
|
-
icon: /* @__PURE__ */
|
|
986
|
-
loading:
|
|
984
|
+
icon: /* @__PURE__ */ u(mn, {}),
|
|
985
|
+
loading: k,
|
|
987
986
|
disabled: !t,
|
|
988
|
-
onClick:
|
|
987
|
+
onClick: _,
|
|
989
988
|
children: "换一批"
|
|
990
989
|
}
|
|
991
990
|
) }) : null,
|
|
992
|
-
d ? /* @__PURE__ */
|
|
991
|
+
d ? /* @__PURE__ */ u(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 Ao = Z(
|
|
997
|
+
So,
|
|
998
|
+
Co
|
|
999
|
+
), _o = {
|
|
1001
1000
|
type: "case_multiselect",
|
|
1002
1001
|
componentName: "SkoponCaseSelect",
|
|
1003
|
-
toComponent:
|
|
1004
|
-
fromComponent:
|
|
1005
|
-
catalogComponents: [
|
|
1002
|
+
toComponent: oo,
|
|
1003
|
+
fromComponent: io,
|
|
1004
|
+
catalogComponents: [Ao]
|
|
1006
1005
|
};
|
|
1007
|
-
function
|
|
1006
|
+
function rn(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
|
|
1014
|
-
var s, a, l,
|
|
1012
|
+
function To(e, t) {
|
|
1013
|
+
var s, a, l, c;
|
|
1015
1014
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
1016
1015
|
return i({
|
|
1017
1016
|
id: n,
|
|
@@ -1024,14 +1023,14 @@ function go(e, t) {
|
|
|
1024
1023
|
names: ((s = e.resumeFilter) == null ? void 0 : s.names) ?? [],
|
|
1025
1024
|
agentUniqueIds: ((a = e.resumeFilter) == null ? void 0 : a.agentUniqueIds) ?? [],
|
|
1026
1025
|
resumeUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.resumeUniqueIds) ?? [],
|
|
1027
|
-
pageSize: ((
|
|
1026
|
+
pageSize: ((c = e.resumeFilter) == null ? void 0 : c.pageSize) ?? 20
|
|
1028
1027
|
},
|
|
1029
1028
|
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
1030
1029
|
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
1031
1030
|
value: { path: o }
|
|
1032
1031
|
});
|
|
1033
1032
|
}
|
|
1034
|
-
function
|
|
1033
|
+
function xo(e, t, n) {
|
|
1035
1034
|
const r = n.nameFromValue(e.value), o = {
|
|
1036
1035
|
...t("resume_multiselect"),
|
|
1037
1036
|
name: r,
|
|
@@ -1040,42 +1039,42 @@ function yo(e, t, n) {
|
|
|
1040
1039
|
i && (o.placeholder = i);
|
|
1041
1040
|
const s = n.asLiteral(e.help);
|
|
1042
1041
|
if (s && (o.help = s), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
1043
|
-
const
|
|
1042
|
+
const c = e.resumeFilter;
|
|
1044
1043
|
o.resumeFilter = {
|
|
1045
|
-
names: Array.isArray(
|
|
1046
|
-
agentUniqueIds: Array.isArray(
|
|
1047
|
-
resumeUniqueIds: Array.isArray(
|
|
1048
|
-
pageSize: typeof
|
|
1044
|
+
names: Array.isArray(c.names) ? c.names.map(String) : [],
|
|
1045
|
+
agentUniqueIds: Array.isArray(c.agentUniqueIds) ? c.agentUniqueIds.map(String) : [],
|
|
1046
|
+
resumeUniqueIds: Array.isArray(c.resumeUniqueIds) ? c.resumeUniqueIds.map(String) : [],
|
|
1047
|
+
pageSize: typeof c.pageSize == "number" ? c.pageSize : 20
|
|
1049
1048
|
};
|
|
1050
1049
|
}
|
|
1051
|
-
const a =
|
|
1050
|
+
const a = rn(e.minCount);
|
|
1052
1051
|
a !== void 0 && (o.resumeMinCount = a);
|
|
1053
|
-
const l =
|
|
1052
|
+
const l = rn(e.maxCount);
|
|
1054
1053
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1055
1054
|
}
|
|
1056
|
-
const
|
|
1057
|
-
function
|
|
1055
|
+
const wn = be(null);
|
|
1056
|
+
function kt({
|
|
1058
1057
|
resumeSearch: e,
|
|
1059
1058
|
children: t
|
|
1060
1059
|
}) {
|
|
1061
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ u(wn.Provider, { value: e ?? null, children: t });
|
|
1062
1061
|
}
|
|
1063
|
-
function
|
|
1064
|
-
return
|
|
1062
|
+
function Fo() {
|
|
1063
|
+
return Se(wn);
|
|
1065
1064
|
}
|
|
1066
|
-
function
|
|
1065
|
+
function mt(e) {
|
|
1067
1066
|
return typeof e == "string" ? e : "";
|
|
1068
1067
|
}
|
|
1069
|
-
function
|
|
1068
|
+
function dt(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 Mo(e) {
|
|
1076
1075
|
return JSON.stringify(e);
|
|
1077
1076
|
}
|
|
1078
|
-
const
|
|
1077
|
+
const Io = {
|
|
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__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
n.length > 0 ? /* @__PURE__ */
|
|
1096
|
-
r.map((i) => /* @__PURE__ */
|
|
1097
|
-
o > 0 ? /* @__PURE__ */
|
|
1089
|
+
}, No = 3, Eo = 2;
|
|
1090
|
+
function ft(e, t) {
|
|
1091
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, No), o = n.length - r.length;
|
|
1092
|
+
return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1093
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1094
|
+
n.length > 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
1095
|
+
r.map((i) => /* @__PURE__ */ u(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
|
-
] }) : /* @__PURE__ */
|
|
1100
|
+
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1102
1101
|
] });
|
|
1103
1102
|
}
|
|
1104
|
-
function
|
|
1105
|
-
return /* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1103
|
+
function Uo(e) {
|
|
1104
|
+
return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-field", children: [
|
|
1105
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1106
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1108
1107
|
] });
|
|
1109
1108
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1109
|
+
function wo({ work: e }) {
|
|
1110
|
+
return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-work", children: [
|
|
1111
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ u("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ u(hr, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1112
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1114
1113
|
] });
|
|
1115
1114
|
}
|
|
1116
|
-
function
|
|
1115
|
+
function Ro({
|
|
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, Eo);
|
|
1122
|
+
return /* @__PURE__ */ U(
|
|
1124
1123
|
"button",
|
|
1125
1124
|
{
|
|
1126
1125
|
type: "button",
|
|
@@ -1128,139 +1127,139 @@ function To({
|
|
|
1128
1127
|
disabled: n,
|
|
1129
1128
|
onClick: r,
|
|
1130
1129
|
children: [
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
|
|
1130
|
+
/* @__PURE__ */ u(
|
|
1131
|
+
ir,
|
|
1133
1132
|
{
|
|
1134
1133
|
size: 48,
|
|
1135
1134
|
src: e.avatarUrl || void 0,
|
|
1136
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */
|
|
1135
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(pr, {}),
|
|
1137
1136
|
className: "skopon-resume-select-card-avatar"
|
|
1138
1137
|
}
|
|
1139
1138
|
),
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
o.length > 0 ? /* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1140
|
+
/* @__PURE__ */ U("div", { className: "skopon-resume-select-card-body", children: [
|
|
1141
|
+
Uo(e.satisfaction),
|
|
1142
|
+
ft("性格", e.personality),
|
|
1143
|
+
ft("专长", e.specialties),
|
|
1144
|
+
ft("擅长领域", e.traits),
|
|
1145
|
+
/* @__PURE__ */ U("div", { className: "skopon-resume-select-card-works", children: [
|
|
1146
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1147
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(wo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("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 Po({ context: e }) {
|
|
1155
|
+
const { interactive: t } = ue(), n = Fo(), { publishLiveOptions: r } = It(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = me(e, "value", {
|
|
1157
1156
|
component: "SkoponResumeSelect",
|
|
1158
1157
|
changeAction: "click"
|
|
1159
|
-
}), l = e.componentModel.properties,
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
}, [
|
|
1164
|
-
const
|
|
1165
|
-
async (
|
|
1166
|
-
const
|
|
1158
|
+
}), l = e.componentModel.properties, c = mt(l.label), m = mt(l.placeholder), d = mt(l.help), S = l.enableRefresh !== !1, y = Ve(l.minCount), T = Ve(l.maxCount), g = j(() => dt(l.resumeFilter), [l.resumeFilter]), C = Mo(g), [v, p] = w(1), [k, I] = w(!1), [O, M] = w(""), [$, H] = w([]), [N, A] = w(0), [Y, G] = w(g.pageSize ?? 20), W = x(0), L = ne(o);
|
|
1159
|
+
z(() => {
|
|
1160
|
+
const h = En(L, T);
|
|
1161
|
+
h !== null && s(h);
|
|
1162
|
+
}, [T, L, s]);
|
|
1163
|
+
const D = q(
|
|
1164
|
+
async (h) => {
|
|
1165
|
+
const b = dt(JSON.parse(C)), R = ++W.current;
|
|
1167
1166
|
if (!n) {
|
|
1168
|
-
|
|
1167
|
+
H([]), A(0), M("未配置简历搜索服务"), I(!1);
|
|
1169
1168
|
return;
|
|
1170
1169
|
}
|
|
1171
|
-
|
|
1170
|
+
I(!0), M("");
|
|
1172
1171
|
try {
|
|
1173
|
-
const
|
|
1174
|
-
if (R !==
|
|
1175
|
-
|
|
1172
|
+
const F = await n({ filter: b, page: h });
|
|
1173
|
+
if (R !== W.current) return;
|
|
1174
|
+
H(F.list), A(F.total), p(F.page), G(F.pageSize), a && r(
|
|
1176
1175
|
a,
|
|
1177
|
-
|
|
1178
|
-
value:
|
|
1179
|
-
label:
|
|
1176
|
+
F.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 (F) {
|
|
1182
|
+
if (R !== W.current) return;
|
|
1183
|
+
H([]), A(0), M(F instanceof Error ? F.message : "加载简历列表失败");
|
|
1185
1184
|
} finally {
|
|
1186
|
-
R ===
|
|
1185
|
+
R === W.current && I(!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 = In(
|
|
1196
|
+
L,
|
|
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 = dt(JSON.parse(C)), b = Y || h.pageSize || 20, R = Math.max(1, Math.ceil(N / b)), F = v >= R ? 1 : v + 1;
|
|
1204
|
+
D(F);
|
|
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
|
-
|
|
1214
|
-
|
|
1215
|
-
/* @__PURE__ */
|
|
1212
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1213
|
+
k && $.length === 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-status", children: [
|
|
1214
|
+
/* @__PURE__ */ u(xt, { size: "small" }),
|
|
1216
1215
|
" 加载简历…"
|
|
1217
1216
|
] }) : null,
|
|
1218
|
-
!
|
|
1219
|
-
!
|
|
1220
|
-
|
|
1221
|
-
|
|
1217
|
+
!k && O ? /* @__PURE__ */ u(re.Text, { type: "danger", className: "skopon-resume-select-status", children: O }) : null,
|
|
1218
|
+
!k && !O && $.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: _ }) : null,
|
|
1219
|
+
$.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: $.map((h) => /* @__PURE__ */ u(
|
|
1220
|
+
Ro,
|
|
1222
1221
|
{
|
|
1223
|
-
item:
|
|
1224
|
-
selected:
|
|
1225
|
-
disabled:
|
|
1226
|
-
|
|
1227
|
-
|
|
1222
|
+
item: h,
|
|
1223
|
+
selected: L.includes(h.resumeUniqueId),
|
|
1224
|
+
disabled: Nn(
|
|
1225
|
+
L,
|
|
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
|
+
S && n ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
1236
|
+
Ie,
|
|
1238
1237
|
{
|
|
1239
1238
|
type: "default",
|
|
1240
1239
|
size: "small",
|
|
1241
|
-
icon: /* @__PURE__ */
|
|
1242
|
-
loading:
|
|
1240
|
+
icon: /* @__PURE__ */ u(mn, {}),
|
|
1241
|
+
loading: k,
|
|
1243
1242
|
disabled: !t,
|
|
1244
|
-
onClick:
|
|
1243
|
+
onClick: oe,
|
|
1245
1244
|
children: "换一批"
|
|
1246
1245
|
}
|
|
1247
1246
|
) }) : null,
|
|
1248
|
-
d ? /* @__PURE__ */
|
|
1247
|
+
d ? /* @__PURE__ */ u(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 zo = Z(
|
|
1253
|
+
Io,
|
|
1254
|
+
Po
|
|
1255
|
+
), Oo = {
|
|
1257
1256
|
type: "resume_multiselect",
|
|
1258
1257
|
componentName: "SkoponResumeSelect",
|
|
1259
|
-
toComponent:
|
|
1260
|
-
fromComponent:
|
|
1261
|
-
catalogComponents: [
|
|
1258
|
+
toComponent: To,
|
|
1259
|
+
fromComponent: xo,
|
|
1260
|
+
catalogComponents: [zo]
|
|
1262
1261
|
};
|
|
1263
|
-
function
|
|
1262
|
+
function Bo(e, t) {
|
|
1264
1263
|
var n;
|
|
1265
1264
|
return {
|
|
1266
1265
|
node: {
|
|
@@ -1273,7 +1272,7 @@ function Fo(e, t) {
|
|
|
1273
1272
|
}
|
|
1274
1273
|
};
|
|
1275
1274
|
}
|
|
1276
|
-
function
|
|
1275
|
+
function Lo(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 {
|
|
@@ -1283,14 +1282,14 @@ function Io(e, t, n) {
|
|
|
1283
1282
|
...r ? { help: r } : {}
|
|
1284
1283
|
};
|
|
1285
1284
|
}
|
|
1286
|
-
function
|
|
1285
|
+
function on({
|
|
1287
1286
|
url: e,
|
|
1288
1287
|
title: t,
|
|
1289
1288
|
className: n,
|
|
1290
1289
|
height: r,
|
|
1291
1290
|
frameRef: o
|
|
1292
1291
|
}) {
|
|
1293
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ u(
|
|
1294
1293
|
"iframe",
|
|
1295
1294
|
{
|
|
1296
1295
|
ref: o,
|
|
@@ -1304,38 +1303,38 @@ function Qt({
|
|
|
1304
1303
|
}
|
|
1305
1304
|
);
|
|
1306
1305
|
}
|
|
1307
|
-
function
|
|
1306
|
+
function qo({
|
|
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__ */
|
|
1315
|
-
n != null && n.trim() ? /* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1312
|
+
const [o, i] = w(!1), [s, a] = w(!0), l = x(null), c = e.trim(), m = Tr(c) ? c : null, d = Ne(t), S = (n == null ? void 0 : n.trim()) || "网页展示", y = r == null ? void 0 : r.trim(), T = c ? "网页 URL 无效" : "未设置网页 URL";
|
|
1313
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview skopon-web-preview", children: [
|
|
1314
|
+
n != null && n.trim() ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: n.trim() }) : null,
|
|
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
|
-
m && s ? /* @__PURE__ */
|
|
1323
|
-
|
|
1321
|
+
m && s ? /* @__PURE__ */ u(
|
|
1322
|
+
on,
|
|
1324
1323
|
{
|
|
1325
1324
|
url: m,
|
|
1326
|
-
title:
|
|
1325
|
+
title: S,
|
|
1327
1326
|
className: "skopon-web-frame skopon-web-frame--inline",
|
|
1328
1327
|
height: d
|
|
1329
1328
|
}
|
|
1330
1329
|
) : null,
|
|
1331
|
-
m ? null : /* @__PURE__ */
|
|
1332
|
-
m ? /* @__PURE__ */
|
|
1333
|
-
|
|
1330
|
+
m ? null : /* @__PURE__ */ u("div", { className: "skopon-web-empty", role: "status", children: T }),
|
|
1331
|
+
m ? /* @__PURE__ */ u(ve, { title: "扩展显示", children: /* @__PURE__ */ u(
|
|
1332
|
+
Ie,
|
|
1334
1333
|
{
|
|
1335
1334
|
type: "default",
|
|
1336
1335
|
shape: "circle",
|
|
1337
1336
|
className: "skopon-web-expand-button",
|
|
1338
|
-
icon: /* @__PURE__ */
|
|
1337
|
+
icon: /* @__PURE__ */ u(gr, {}),
|
|
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__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
|
|
1347
|
+
y ? /* @__PURE__ */ u(re.Text, { type: "secondary", className: "form-block-preview-help", children: y }) : null,
|
|
1348
|
+
/* @__PURE__ */ u(
|
|
1349
|
+
sr,
|
|
1351
1350
|
{
|
|
1352
1351
|
open: o,
|
|
1353
|
-
title:
|
|
1352
|
+
title: S,
|
|
1354
1353
|
footer: null,
|
|
1355
1354
|
width: "min(1200px, calc(100vw - 32px))",
|
|
1356
1355
|
className: "skopon-web-modal",
|
|
@@ -1360,11 +1359,11 @@ function Eo({
|
|
|
1360
1359
|
var g;
|
|
1361
1360
|
(g = l.current) == null || g.removeAttribute("src"), i(!1), a(!0);
|
|
1362
1361
|
},
|
|
1363
|
-
children: m && !s ? /* @__PURE__ */
|
|
1364
|
-
|
|
1362
|
+
children: m && !s ? /* @__PURE__ */ u(
|
|
1363
|
+
on,
|
|
1365
1364
|
{
|
|
1366
1365
|
url: m,
|
|
1367
|
-
title: `${
|
|
1366
|
+
title: `${S}(扩展显示)`,
|
|
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 Vo = {
|
|
1377
1376
|
name: "SkoponWeb",
|
|
1378
1377
|
schema: f.object({
|
|
1379
1378
|
url: f.any().optional(),
|
|
@@ -1381,12 +1380,12 @@ const Uo = {
|
|
|
1381
1380
|
label: f.any().optional(),
|
|
1382
1381
|
help: f.any().optional()
|
|
1383
1382
|
}).passthrough()
|
|
1384
|
-
},
|
|
1385
|
-
|
|
1383
|
+
}, $o = Z(
|
|
1384
|
+
Vo,
|
|
1386
1385
|
({ context: e }) => {
|
|
1387
1386
|
const t = e.componentModel.properties;
|
|
1388
|
-
return /* @__PURE__ */
|
|
1389
|
-
|
|
1387
|
+
return /* @__PURE__ */ u(
|
|
1388
|
+
qo,
|
|
1390
1389
|
{
|
|
1391
1390
|
url: typeof t.url == "string" ? t.url : "",
|
|
1392
1391
|
height: Ne(t.height),
|
|
@@ -1395,64 +1394,64 @@ const Uo = {
|
|
|
1395
1394
|
}
|
|
1396
1395
|
);
|
|
1397
1396
|
}
|
|
1398
|
-
),
|
|
1397
|
+
), jo = {
|
|
1399
1398
|
type: "web",
|
|
1400
1399
|
componentName: "SkoponWeb",
|
|
1401
|
-
toComponent:
|
|
1402
|
-
fromComponent:
|
|
1403
|
-
catalogComponents: [
|
|
1404
|
-
},
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
],
|
|
1409
|
-
|
|
1410
|
-
),
|
|
1411
|
-
|
|
1400
|
+
toComponent: Bo,
|
|
1401
|
+
fromComponent: Lo,
|
|
1402
|
+
catalogComponents: [$o]
|
|
1403
|
+
}, He = [
|
|
1404
|
+
Oo,
|
|
1405
|
+
_o,
|
|
1406
|
+
jo
|
|
1407
|
+
], Do = new Map(
|
|
1408
|
+
He.map((e) => [e.type, e])
|
|
1409
|
+
), Ho = new Map(
|
|
1410
|
+
He.map((e) => [e.componentName, e])
|
|
1412
1411
|
);
|
|
1413
|
-
function
|
|
1414
|
-
return
|
|
1412
|
+
function Ko(e) {
|
|
1413
|
+
return Do.get(e);
|
|
1415
1414
|
}
|
|
1416
|
-
function
|
|
1417
|
-
return
|
|
1415
|
+
function Wo(e) {
|
|
1416
|
+
return Ho.get(e);
|
|
1418
1417
|
}
|
|
1419
|
-
function
|
|
1420
|
-
return
|
|
1418
|
+
function Go() {
|
|
1419
|
+
return He.flatMap((e) => e.catalogComponents);
|
|
1421
1420
|
}
|
|
1422
|
-
function
|
|
1423
|
-
return
|
|
1421
|
+
function Jo() {
|
|
1422
|
+
return He.map((e) => e.componentName);
|
|
1424
1423
|
}
|
|
1425
|
-
const
|
|
1426
|
-
function
|
|
1424
|
+
const $e = "root", Ct = "__title__", At = "__desc__", Nt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1425
|
+
function Yo(e) {
|
|
1427
1426
|
return `/${e}`;
|
|
1428
1427
|
}
|
|
1429
|
-
function
|
|
1428
|
+
function sn(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 Qo(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: Dr(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 Xo(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 = Xo(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 we(e, t, n) {
|
|
|
1463
1462
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1464
1463
|
};
|
|
1465
1464
|
}
|
|
1466
|
-
function
|
|
1465
|
+
function an(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
|
|
1484
|
-
var
|
|
1485
|
-
const t = e.id ||
|
|
1483
|
+
function Zo(e) {
|
|
1484
|
+
var c;
|
|
1485
|
+
const t = e.id || de("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? Yo(r) : void 0, i = ce(e.options), s = (m) => r ? { node: m, dataKey: r, dataValue: an(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = Ko(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: an(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: Nt,
|
|
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: Qo(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 _t(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 === $e);
|
|
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 Rn(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: Ct, component: "Text", text: s, variant: "h2" }), r.push(Ct)), i && a && (n.push({ id: At, component: "Text", text: a, variant: "body" }), r.push(At));
|
|
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: S, dataValue: y } = Zo(m);
|
|
1634
|
+
S && (o[S] = y), d && (n.push(d), r.push(d.id));
|
|
1635
1635
|
}
|
|
1636
|
-
n.unshift({ id:
|
|
1637
|
-
const l = { root:
|
|
1638
|
-
return
|
|
1636
|
+
n.unshift({ id: $e, component: "Column", children: r });
|
|
1637
|
+
const l = { root: $e, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1638
|
+
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1639
1639
|
}
|
|
1640
|
-
function
|
|
1640
|
+
function ei(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 pt(e) {
|
|
1647
|
+
return ce(e.options);
|
|
1648
1648
|
}
|
|
1649
|
-
function
|
|
1650
|
-
const t = typeof e.id == "string" ? e.id :
|
|
1649
|
+
function ti(e) {
|
|
1650
|
+
const t = typeof e.id == "string" ? e.id : de("block-"), n = String(e.component ?? ""), r = K(e.label) ?? K(e.text) ?? "", o = sn(e.value), i = (a) => ({ id: t, type: a, label: r }), s = Wo(n);
|
|
1651
1651
|
if (s)
|
|
1652
|
-
return s.fromComponent(e, i, { asLiteral:
|
|
1652
|
+
return s.fromComponent(e, i, { asLiteral: K, nameFromValue: sn });
|
|
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,56 +1658,56 @@ 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
|
|
1663
|
-
return m && (
|
|
1661
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : K(e.validationRegexp) === Nt && (l = "email");
|
|
1662
|
+
const c = { ...i(l), name: o }, m = K(e.placeholder);
|
|
1663
|
+
return m && (c.placeholder = m), c;
|
|
1664
1664
|
}
|
|
1665
1665
|
case "CheckBox":
|
|
1666
1666
|
return { ...i("toggle"), name: o };
|
|
1667
1667
|
case "SkoponSelect": {
|
|
1668
|
-
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select",
|
|
1668
|
+
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
1669
1669
|
...i(l),
|
|
1670
1670
|
name: o,
|
|
1671
|
-
options:
|
|
1672
|
-
}, m =
|
|
1673
|
-
return m && (
|
|
1671
|
+
options: pt(e)
|
|
1672
|
+
}, m = K(e.placeholder);
|
|
1673
|
+
return m && (c.placeholder = m), c;
|
|
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: pt(e)
|
|
1682
|
+
}, d = K(e.placeholder);
|
|
1683
1683
|
return d && (m.placeholder = d), m;
|
|
1684
1684
|
}
|
|
1685
|
-
const
|
|
1686
|
-
return { ...i(
|
|
1685
|
+
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1686
|
+
return { ...i(c), name: o, options: pt(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 =
|
|
1704
|
-
return a && (l.fileAcceptExtensions = a.split(",").map((
|
|
1703
|
+
const a = K(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1704
|
+
return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
1705
1705
|
}
|
|
1706
1706
|
default:
|
|
1707
1707
|
return null;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function Pn(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" && Pn(s, t, n, r);
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
1721
1721
|
r.push(o);
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function ni(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 ri(e) {
|
|
1733
1733
|
if (!e || !Array.isArray(e.components))
|
|
1734
|
-
return
|
|
1735
|
-
const t =
|
|
1736
|
-
|
|
1734
|
+
return xe({ title: "", description: "", blocks: [] });
|
|
1735
|
+
const t = ei(e), n = [];
|
|
1736
|
+
Pn(e.root ?? $e, 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 === Ct) {
|
|
1741
|
+
r = K(s.text) ?? r;
|
|
1742
1742
|
continue;
|
|
1743
1743
|
}
|
|
1744
|
-
if (s.id ===
|
|
1745
|
-
o =
|
|
1744
|
+
if (s.id === At) {
|
|
1745
|
+
o = K(s.text) ?? o;
|
|
1746
1746
|
continue;
|
|
1747
1747
|
}
|
|
1748
|
-
const a =
|
|
1748
|
+
const a = ti(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: ni(i, e.dataModel)
|
|
1755
1755
|
});
|
|
1756
1756
|
}
|
|
1757
|
-
function
|
|
1757
|
+
function oi(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 zn(e) {
|
|
1771
1771
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1773
|
+
function ii(e, t) {
|
|
1774
1774
|
if (!e || typeof e != "object") return null;
|
|
1775
|
-
const n = e, r =
|
|
1776
|
-
if (r && !
|
|
1775
|
+
const n = e, r = zn(n.a2ui) ? n.a2ui : void 0;
|
|
1776
|
+
if (r && !_t(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 = De({
|
|
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: Cn(n.jsonSchema ?? n.json_schema)
|
|
1784
|
+
}), s = Rn(i, t);
|
|
1785
|
+
return _t(s) ? null : s;
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1787
|
+
function si(e, t, n) {
|
|
1788
|
+
return Rn(
|
|
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 ai(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) && zn(t.a2ui) ? ri(t.a2ui) : De({
|
|
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: Cn(t.jsonSchema ?? t.json_schema)
|
|
1806
1806
|
});
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function li(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 ci = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1819
|
+
function Et(e) {
|
|
1820
1820
|
return e.type === "text" && e.hidden === !0;
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return
|
|
1822
|
+
function Ut(e) {
|
|
1823
|
+
return De({
|
|
1824
1824
|
title: "",
|
|
1825
1825
|
description: "",
|
|
1826
1826
|
blocks: [e]
|
|
1827
1827
|
}).blocks[0];
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
function ui(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 (bn(s.type)) {
|
|
1839
|
+
r.push(Ut(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 && (Et(l) || fe(l) && r.push(l));
|
|
1847
1847
|
}
|
|
1848
1848
|
return r;
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function mi(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 di(e, t) {
|
|
1860
1860
|
var r;
|
|
1861
1861
|
const n = { ...e };
|
|
1862
1862
|
for (const o of Object.keys(t)) {
|
|
1863
|
-
if (
|
|
1863
|
+
if (ci.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, Ut(n);
|
|
1868
1868
|
}
|
|
1869
|
-
function
|
|
1869
|
+
function Ke(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 = De({
|
|
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
|
|
1888
|
-
var i, s, a, l,
|
|
1887
|
+
function fi(e, t) {
|
|
1888
|
+
var i, s, a, l, c, 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 S = (s = d.name) == null ? void 0 : s.trim();
|
|
1896
|
+
if (!S) continue;
|
|
1897
|
+
const y = n.get(S);
|
|
1898
1898
|
if (y) {
|
|
1899
|
-
const
|
|
1900
|
-
r.push(
|
|
1899
|
+
const T = mi(e, S, d);
|
|
1900
|
+
r.push(di(y, T));
|
|
1901
1901
|
} else
|
|
1902
|
-
o.push(
|
|
1902
|
+
o.push(Ut(d));
|
|
1903
1903
|
}
|
|
1904
1904
|
return {
|
|
1905
1905
|
matchedBlocks: r,
|
|
1906
1906
|
extraBlocks: o,
|
|
1907
|
-
renderBlocks:
|
|
1907
|
+
renderBlocks: ui(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
|
-
description: ((
|
|
1909
|
+
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1910
1910
|
};
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1912
|
+
function On(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] = On(r));
|
|
1923
1923
|
}
|
|
1924
1924
|
return t;
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function pi(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 hi(e) {
|
|
1935
1935
|
return e.blocks.filter((t) => {
|
|
1936
1936
|
var n;
|
|
1937
|
-
return
|
|
1937
|
+
return bn(t.type) ? !0 : !ee(t.type) || !((n = t.name) != null && n.trim()) || !fe(t) ? !1 : !Et(t);
|
|
1938
1938
|
});
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function ea(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 gi(e) {
|
|
1949
1949
|
var n;
|
|
1950
1950
|
const t = {};
|
|
1951
1951
|
for (const r of e.blocks) {
|
|
1952
|
-
if (!
|
|
1952
|
+
if (!Et(r)) continue;
|
|
1953
1953
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1954
|
-
o && (t[o] =
|
|
1954
|
+
o && (t[o] = On(r));
|
|
1955
1955
|
}
|
|
1956
1956
|
return t;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function wt(e) {
|
|
1959
1959
|
return e.replace(/'/g, "'\\''");
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1961
|
+
function Bn(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: ${wt(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function Ln(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
|
+
Bn(n),
|
|
1972
|
+
` -d '${wt(o)}'`
|
|
1973
1973
|
].join(`
|
|
1974
1974
|
`);
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1976
|
+
function yi(e, t) {
|
|
1977
1977
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function vi({
|
|
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 = yi(e, t);
|
|
1986
1986
|
return [
|
|
1987
1987
|
`curl -X POST '${o}' \\`,
|
|
1988
1988
|
" -H 'Content-Type: application/json' \\",
|
|
1989
|
-
|
|
1990
|
-
` -d '${
|
|
1989
|
+
Bn(r),
|
|
1990
|
+
` -d '${wt(i)}'`
|
|
1991
1991
|
].join(`
|
|
1992
1992
|
`);
|
|
1993
1993
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const r =
|
|
1996
|
-
if (!r) return
|
|
1997
|
-
const o =
|
|
1998
|
-
return
|
|
1994
|
+
function ta(e, t, n) {
|
|
1995
|
+
const r = Ke(e);
|
|
1996
|
+
if (!r) return Ln(e, t, n);
|
|
1997
|
+
const o = je(r.blocks);
|
|
1998
|
+
return vi({ cardValues: o, callbackUrl: t, headers: n });
|
|
1999
1999
|
}
|
|
2000
|
-
async function
|
|
2000
|
+
async function qn(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 na(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 We(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 Ge = "auth_user", bi = "token", Si = "answer_agent_callback_url", ki = "realtime_ws_url", Ci = "skopon_api_base_url", Ai = "/api/v1/mock/ask_user_answer_mock", Oe = "/api/v1";
|
|
2057
|
+
function Je(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 Ye(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,84 @@ function Nt(e) {
|
|
|
2070
2070
|
return null;
|
|
2071
2071
|
}
|
|
2072
2072
|
}
|
|
2073
|
-
function
|
|
2074
|
-
|
|
2073
|
+
function ht() {
|
|
2074
|
+
if (typeof window > "u") return Oe;
|
|
2075
|
+
try {
|
|
2076
|
+
const e = window.location.origin, t = new URL(e);
|
|
2077
|
+
return t.protocol !== "http:" && t.protocol !== "https:" ? Oe : `${t.origin}${Oe}`;
|
|
2078
|
+
} catch {
|
|
2079
|
+
return Oe;
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
function _i(e = {}) {
|
|
2083
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ge, r = e.skoponApiBaseUrlField ?? Ci, o = Je(t);
|
|
2084
|
+
let i = null;
|
|
2085
|
+
try {
|
|
2086
|
+
i = (o == null ? void 0 : o.getItem(n)) ?? null;
|
|
2087
|
+
} catch {
|
|
2088
|
+
return ht();
|
|
2089
|
+
}
|
|
2090
|
+
const s = i ? Ye(i) : null, a = s == null ? void 0 : s[r];
|
|
2091
|
+
if (a == null)
|
|
2092
|
+
return ht();
|
|
2093
|
+
if (typeof a != "string")
|
|
2094
|
+
throw new Error("skopon_api_base_url 格式无效,无法上传文件");
|
|
2095
|
+
const l = a.trim();
|
|
2096
|
+
if (!l) return ht();
|
|
2097
|
+
try {
|
|
2098
|
+
const c = new URL(l);
|
|
2099
|
+
if (c.protocol !== "http:" && c.protocol !== "https:" || c.username || c.password || c.search || c.hash)
|
|
2100
|
+
throw new Error("invalid Skopon API base URL");
|
|
2101
|
+
const m = c.pathname.replace(/\/+$/, "");
|
|
2102
|
+
return `${c.origin}${m}`;
|
|
2103
|
+
} catch {
|
|
2104
|
+
throw new Error("skopon_api_base_url 格式无效,无法上传文件");
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
function Ti(e, t) {
|
|
2108
|
+
const n = Ye(e);
|
|
2075
2109
|
if (!n) return "";
|
|
2076
2110
|
const r = n[t];
|
|
2077
2111
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
2078
2112
|
}
|
|
2079
|
-
function
|
|
2080
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2113
|
+
function xi(e = {}) {
|
|
2114
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ge, r = e.answerAgentCallbackUrlField ?? Si, o = Je(t);
|
|
2081
2115
|
if (!o) return "";
|
|
2082
2116
|
const i = o.getItem(n);
|
|
2083
2117
|
if (!i) return "";
|
|
2084
|
-
const s =
|
|
2118
|
+
const s = Ye(i);
|
|
2085
2119
|
if (!s) return "";
|
|
2086
2120
|
const a = s[r];
|
|
2087
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
2121
|
+
return (typeof a == "string" ? a.trim() : "") || Ai;
|
|
2088
2122
|
}
|
|
2089
|
-
function
|
|
2090
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2123
|
+
function Fi(e = {}) {
|
|
2124
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ge, r = e.realtimeWsUrlField ?? ki, o = Je(t);
|
|
2091
2125
|
if (!o) return "";
|
|
2092
2126
|
const i = o.getItem(n);
|
|
2093
2127
|
if (!i) return "";
|
|
2094
|
-
const s =
|
|
2128
|
+
const s = Ye(i);
|
|
2095
2129
|
if (!s) return "";
|
|
2096
2130
|
const a = s[r];
|
|
2097
2131
|
return typeof a == "string" ? a.trim() : "";
|
|
2098
2132
|
}
|
|
2099
|
-
function
|
|
2133
|
+
function Rt(e, t) {
|
|
2100
2134
|
return {
|
|
2101
|
-
...
|
|
2135
|
+
...Pt(t),
|
|
2102
2136
|
...e ?? {}
|
|
2103
2137
|
};
|
|
2104
2138
|
}
|
|
2105
|
-
function
|
|
2106
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2139
|
+
function Pt(e = {}) {
|
|
2140
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ge, r = e.tokenField ?? bi, o = Je(t);
|
|
2107
2141
|
if (!o) return {};
|
|
2108
2142
|
const i = o.getItem(n);
|
|
2109
2143
|
if (!i) return {};
|
|
2110
|
-
const s =
|
|
2144
|
+
const s = Ti(i, r);
|
|
2111
2145
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
2112
2146
|
}
|
|
2113
|
-
async function
|
|
2114
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
2147
|
+
async function zt(e = {}) {
|
|
2148
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : Pt(e.authStorage);
|
|
2115
2149
|
}
|
|
2116
|
-
function
|
|
2150
|
+
function Mi(e = {}) {
|
|
2117
2151
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
2118
2152
|
async function o(i) {
|
|
2119
2153
|
const s = new URLSearchParams();
|
|
@@ -2123,21 +2157,21 @@ function yi(e = {}) {
|
|
|
2123
2157
|
s.set("form_unique_id", i.formUniqueId);
|
|
2124
2158
|
else
|
|
2125
2159
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
2126
|
-
const a = await
|
|
2160
|
+
const a = await zt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
2127
2161
|
method: "GET",
|
|
2128
2162
|
headers: a
|
|
2129
|
-
}),
|
|
2163
|
+
}), c = await We(l), m = ai(c.form_definition);
|
|
2130
2164
|
return {
|
|
2131
|
-
formUniqueId:
|
|
2132
|
-
formId:
|
|
2133
|
-
disabled:
|
|
2165
|
+
formUniqueId: c.form_unique_id,
|
|
2166
|
+
formId: c.form_id,
|
|
2167
|
+
disabled: c.disabled === 1,
|
|
2134
2168
|
formDefinition: m,
|
|
2135
|
-
a2ui:
|
|
2169
|
+
a2ui: ii(c.form_definition) ?? void 0
|
|
2136
2170
|
};
|
|
2137
2171
|
}
|
|
2138
2172
|
return { fetchDetail: o };
|
|
2139
2173
|
}
|
|
2140
|
-
function
|
|
2174
|
+
function Ii(e) {
|
|
2141
2175
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2142
2176
|
return e ?? null;
|
|
2143
2177
|
const t = e;
|
|
@@ -2147,13 +2181,13 @@ function vi(e) {
|
|
|
2147
2181
|
blocks: t.blocks
|
|
2148
2182
|
} : e;
|
|
2149
2183
|
}
|
|
2150
|
-
function
|
|
2184
|
+
function Ot({
|
|
2151
2185
|
context: e,
|
|
2152
2186
|
payload: t,
|
|
2153
2187
|
form: n,
|
|
2154
2188
|
answer: r
|
|
2155
2189
|
}) {
|
|
2156
|
-
const o =
|
|
2190
|
+
const o = Ke(t) ?? t, i = n ? Ii(n) : o;
|
|
2157
2191
|
return {
|
|
2158
2192
|
mission_id: e.missionId ?? null,
|
|
2159
2193
|
tenant_id: e.tenantId ?? null,
|
|
@@ -2166,7 +2200,7 @@ function Et({
|
|
|
2166
2200
|
answer: r
|
|
2167
2201
|
};
|
|
2168
2202
|
}
|
|
2169
|
-
function
|
|
2203
|
+
function Bt(e) {
|
|
2170
2204
|
const t = e.callback_url;
|
|
2171
2205
|
if (typeof t != "string" || !t.trim())
|
|
2172
2206
|
return "callback_url 为空,无法提交";
|
|
@@ -2181,34 +2215,34 @@ function Ut(e) {
|
|
|
2181
2215
|
const o = e.mission_id;
|
|
2182
2216
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
2183
2217
|
}
|
|
2184
|
-
function
|
|
2185
|
-
return
|
|
2186
|
-
|
|
2218
|
+
function ra(e) {
|
|
2219
|
+
return Bt(
|
|
2220
|
+
Ot({
|
|
2187
2221
|
context: e,
|
|
2188
2222
|
payload: {},
|
|
2189
2223
|
answer: {}
|
|
2190
2224
|
})
|
|
2191
2225
|
);
|
|
2192
2226
|
}
|
|
2193
|
-
const
|
|
2194
|
-
function
|
|
2227
|
+
const ln = "answer_agent_callback_url 未配置,无法提交";
|
|
2228
|
+
function Ni(e) {
|
|
2195
2229
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
2196
2230
|
const n = e.answerAgentCallbackUrl.trim();
|
|
2197
2231
|
if (!n)
|
|
2198
|
-
throw new Error(
|
|
2232
|
+
throw new Error(ln);
|
|
2199
2233
|
return n;
|
|
2200
2234
|
}
|
|
2201
|
-
const t =
|
|
2235
|
+
const t = xi(e == null ? void 0 : e.authStorage).trim();
|
|
2202
2236
|
if (!t)
|
|
2203
|
-
throw new Error(
|
|
2237
|
+
throw new Error(ln);
|
|
2204
2238
|
return t;
|
|
2205
2239
|
}
|
|
2206
|
-
function
|
|
2240
|
+
function Vn(e) {
|
|
2207
2241
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
2208
2242
|
const n = e.data;
|
|
2209
2243
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
2210
2244
|
}
|
|
2211
|
-
function
|
|
2245
|
+
function Ei(e, t) {
|
|
2212
2246
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2213
2247
|
const n = t.message;
|
|
2214
2248
|
if (typeof n == "string" && n.trim())
|
|
@@ -2216,27 +2250,27 @@ function Si(e, t) {
|
|
|
2216
2250
|
}
|
|
2217
2251
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2218
2252
|
}
|
|
2219
|
-
function
|
|
2253
|
+
function Ui(e) {
|
|
2220
2254
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2221
2255
|
}
|
|
2222
|
-
function
|
|
2223
|
-
const t =
|
|
2224
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2256
|
+
function $n(e) {
|
|
2257
|
+
const t = Vn(e.body);
|
|
2258
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: Ui(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2225
2259
|
type: "error",
|
|
2226
|
-
message:
|
|
2260
|
+
message: Ei(e.status, e.body)
|
|
2227
2261
|
};
|
|
2228
2262
|
}
|
|
2229
|
-
async function
|
|
2230
|
-
const n =
|
|
2263
|
+
async function jn(e, t) {
|
|
2264
|
+
const n = Bt(e);
|
|
2231
2265
|
if (n)
|
|
2232
2266
|
throw new Error(n);
|
|
2233
|
-
const r =
|
|
2267
|
+
const r = Ni(t), o = await qn(r, e, {
|
|
2234
2268
|
...t,
|
|
2235
|
-
headers:
|
|
2236
|
-
}), i =
|
|
2269
|
+
headers: Rt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2270
|
+
}), i = Vn(o.body);
|
|
2237
2271
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2238
2272
|
}
|
|
2239
|
-
function
|
|
2273
|
+
function wi(e) {
|
|
2240
2274
|
return {
|
|
2241
2275
|
resumeUniqueId: e.resume_unique_id,
|
|
2242
2276
|
resumeId: e.resume_id,
|
|
@@ -2257,7 +2291,7 @@ function Ci(e) {
|
|
|
2257
2291
|
}))
|
|
2258
2292
|
};
|
|
2259
2293
|
}
|
|
2260
|
-
function
|
|
2294
|
+
function Ri(e, t, n) {
|
|
2261
2295
|
const r = new URLSearchParams();
|
|
2262
2296
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2263
2297
|
for (const o of e.names ?? [])
|
|
@@ -2270,27 +2304,27 @@ function Ai(e, t, n) {
|
|
|
2270
2304
|
r.append("published", String(o));
|
|
2271
2305
|
return r;
|
|
2272
2306
|
}
|
|
2273
|
-
function
|
|
2307
|
+
function Pi(e = {}) {
|
|
2274
2308
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2275
2309
|
return async ({ filter: i, page: s }) => {
|
|
2276
|
-
const a = await
|
|
2310
|
+
const a = await zt(e), l = Ri(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2277
2311
|
method: "GET",
|
|
2278
2312
|
headers: a
|
|
2279
|
-
}), m = await
|
|
2313
|
+
}), m = await We(c);
|
|
2280
2314
|
return {
|
|
2281
|
-
list: (m.list ?? []).map(
|
|
2315
|
+
list: (m.list ?? []).map(wi),
|
|
2282
2316
|
total: m.total ?? 0,
|
|
2283
2317
|
page: m.page ?? s,
|
|
2284
2318
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2285
2319
|
};
|
|
2286
2320
|
};
|
|
2287
2321
|
}
|
|
2288
|
-
function
|
|
2322
|
+
function zi(e) {
|
|
2289
2323
|
var r, o, i, s;
|
|
2290
2324
|
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
2325
|
return t || n;
|
|
2292
2326
|
}
|
|
2293
|
-
function
|
|
2327
|
+
function Oi(e) {
|
|
2294
2328
|
return {
|
|
2295
2329
|
caseUniqueId: e.case_unique_id,
|
|
2296
2330
|
caseId: e.case_id,
|
|
@@ -2301,7 +2335,7 @@ function xi(e) {
|
|
|
2301
2335
|
description: e.description ?? void 0
|
|
2302
2336
|
};
|
|
2303
2337
|
}
|
|
2304
|
-
function
|
|
2338
|
+
function Bi(e, t, n) {
|
|
2305
2339
|
var o, i, s;
|
|
2306
2340
|
const r = new URLSearchParams();
|
|
2307
2341
|
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 +2343,24 @@ function Mi(e, t, n) {
|
|
|
2309
2343
|
a && r.append("flow_unique_ids", a);
|
|
2310
2344
|
return r;
|
|
2311
2345
|
}
|
|
2312
|
-
function
|
|
2346
|
+
function Li(e = {}) {
|
|
2313
2347
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2314
2348
|
return async ({ filter: i, page: s }) => {
|
|
2315
|
-
if (!
|
|
2349
|
+
if (!zi(i))
|
|
2316
2350
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2317
|
-
const a = await
|
|
2351
|
+
const a = await zt(e), l = Bi(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2318
2352
|
method: "GET",
|
|
2319
2353
|
headers: a
|
|
2320
|
-
}), m = await
|
|
2354
|
+
}), m = await We(c);
|
|
2321
2355
|
return {
|
|
2322
|
-
list: (m.list ?? []).map(
|
|
2356
|
+
list: (m.list ?? []).map(Oi),
|
|
2323
2357
|
total: m.total ?? 0,
|
|
2324
2358
|
page: m.page ?? s,
|
|
2325
2359
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2326
2360
|
};
|
|
2327
2361
|
};
|
|
2328
2362
|
}
|
|
2329
|
-
function
|
|
2363
|
+
function oa(e = {}) {
|
|
2330
2364
|
var r, o, i, s, a;
|
|
2331
2365
|
const t = {
|
|
2332
2366
|
baseUrl: e.baseUrl,
|
|
@@ -2335,23 +2369,23 @@ function Vs(e = {}) {
|
|
|
2335
2369
|
authStorage: e.authStorage
|
|
2336
2370
|
};
|
|
2337
2371
|
return {
|
|
2338
|
-
fetchDetail:
|
|
2372
|
+
fetchDetail: Mi({
|
|
2339
2373
|
...t,
|
|
2340
2374
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2341
2375
|
}).fetchDetail,
|
|
2342
|
-
resumeSearch:
|
|
2376
|
+
resumeSearch: Pi({
|
|
2343
2377
|
...t,
|
|
2344
2378
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2345
2379
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2346
2380
|
}),
|
|
2347
|
-
caseSearch:
|
|
2381
|
+
caseSearch: Li({
|
|
2348
2382
|
...t,
|
|
2349
2383
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2350
2384
|
published: (a = e.case) == null ? void 0 : a.published
|
|
2351
2385
|
})
|
|
2352
2386
|
};
|
|
2353
2387
|
}
|
|
2354
|
-
function
|
|
2388
|
+
function Dn(e, t) {
|
|
2355
2389
|
if (!t.trim()) return !0;
|
|
2356
2390
|
try {
|
|
2357
2391
|
return new RegExp(t).test(e);
|
|
@@ -2359,45 +2393,45 @@ function Bn(e, t) {
|
|
|
2359
2393
|
return !0;
|
|
2360
2394
|
}
|
|
2361
2395
|
}
|
|
2362
|
-
function
|
|
2396
|
+
function Hn(e) {
|
|
2363
2397
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2364
2398
|
}
|
|
2365
|
-
function
|
|
2399
|
+
function qi(e, t) {
|
|
2366
2400
|
switch (e.type) {
|
|
2367
2401
|
case "multiselect":
|
|
2368
2402
|
case "checkbox":
|
|
2369
2403
|
case "file":
|
|
2370
2404
|
case "resume_multiselect":
|
|
2371
2405
|
case "case_multiselect":
|
|
2372
|
-
return
|
|
2406
|
+
return ne(t).length === 0;
|
|
2373
2407
|
case "toggle":
|
|
2374
|
-
return !
|
|
2408
|
+
return !we(t);
|
|
2375
2409
|
case "number":
|
|
2376
2410
|
return t == null || t === "";
|
|
2377
2411
|
default:
|
|
2378
|
-
return
|
|
2412
|
+
return Hn(t);
|
|
2379
2413
|
}
|
|
2380
2414
|
}
|
|
2381
|
-
function
|
|
2415
|
+
function gt(e, t) {
|
|
2382
2416
|
return e.required === !0 || t > 0;
|
|
2383
2417
|
}
|
|
2384
|
-
function
|
|
2418
|
+
function Vi(e, t) {
|
|
2385
2419
|
var n, r;
|
|
2386
2420
|
for (const o of e) {
|
|
2387
|
-
if (!
|
|
2421
|
+
if (!ee(o.type)) continue;
|
|
2388
2422
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2389
2423
|
if (!i) continue;
|
|
2390
2424
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2391
|
-
if (o.required &&
|
|
2425
|
+
if (o.required && qi(o, s))
|
|
2392
2426
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2393
|
-
if (o.type === "email" && !
|
|
2427
|
+
if (o.type === "email" && !Hn(s)) {
|
|
2394
2428
|
const l = String(s).trim();
|
|
2395
|
-
if (!
|
|
2429
|
+
if (!Dn(l, Nt))
|
|
2396
2430
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2397
2431
|
}
|
|
2398
2432
|
if (o.type === "file") {
|
|
2399
|
-
const l = o.fileMinCount ?? 0,
|
|
2400
|
-
if (l > 0 &&
|
|
2433
|
+
const l = o.fileMinCount ?? 0, c = ne(s).length;
|
|
2434
|
+
if (l > 0 && c < l && gt(o, c))
|
|
2401
2435
|
return {
|
|
2402
2436
|
fieldName: i,
|
|
2403
2437
|
label: a,
|
|
@@ -2405,8 +2439,8 @@ function Ii(e, t) {
|
|
|
2405
2439
|
};
|
|
2406
2440
|
}
|
|
2407
2441
|
if (o.type === "resume_multiselect") {
|
|
2408
|
-
const l = o.resumeMinCount,
|
|
2409
|
-
if (l !== void 0 &&
|
|
2442
|
+
const l = o.resumeMinCount, c = ne(s).length;
|
|
2443
|
+
if (l !== void 0 && c < l && gt(o, c))
|
|
2410
2444
|
return {
|
|
2411
2445
|
fieldName: i,
|
|
2412
2446
|
label: a,
|
|
@@ -2414,8 +2448,8 @@ function Ii(e, t) {
|
|
|
2414
2448
|
};
|
|
2415
2449
|
}
|
|
2416
2450
|
if (o.type === "case_multiselect") {
|
|
2417
|
-
const l = o.caseMinCount,
|
|
2418
|
-
if (l !== void 0 &&
|
|
2451
|
+
const l = o.caseMinCount, c = ne(s).length;
|
|
2452
|
+
if (l !== void 0 && c < l && gt(o, c))
|
|
2419
2453
|
return {
|
|
2420
2454
|
fieldName: i,
|
|
2421
2455
|
label: a,
|
|
@@ -2425,21 +2459,21 @@ function Ii(e, t) {
|
|
|
2425
2459
|
}
|
|
2426
2460
|
return null;
|
|
2427
2461
|
}
|
|
2428
|
-
const
|
|
2429
|
-
video:
|
|
2430
|
-
audio:
|
|
2431
|
-
image:
|
|
2432
|
-
file:
|
|
2433
|
-
spreadsheet:
|
|
2434
|
-
document:
|
|
2462
|
+
const $i = {
|
|
2463
|
+
video: Sr,
|
|
2464
|
+
audio: br,
|
|
2465
|
+
image: vr,
|
|
2466
|
+
file: fn,
|
|
2467
|
+
spreadsheet: yr,
|
|
2468
|
+
document: dn
|
|
2435
2469
|
};
|
|
2436
|
-
function
|
|
2470
|
+
function ji({
|
|
2437
2471
|
type: e,
|
|
2438
2472
|
size: t = 40,
|
|
2439
2473
|
className: n
|
|
2440
2474
|
}) {
|
|
2441
|
-
const r =
|
|
2442
|
-
return /* @__PURE__ */
|
|
2475
|
+
const r = $i[e] ?? fn;
|
|
2476
|
+
return /* @__PURE__ */ u(
|
|
2443
2477
|
r,
|
|
2444
2478
|
{
|
|
2445
2479
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -2448,7 +2482,69 @@ function Ui({
|
|
|
2448
2482
|
}
|
|
2449
2483
|
);
|
|
2450
2484
|
}
|
|
2451
|
-
const
|
|
2485
|
+
const Di = "/univ/upload/cdn", Hi = 12e4;
|
|
2486
|
+
class Kn extends Error {
|
|
2487
|
+
constructor(t = "上传已取消") {
|
|
2488
|
+
super(t), this.name = "UploadCancelledError";
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
function Ki(e) {
|
|
2492
|
+
return e instanceof Kn;
|
|
2493
|
+
}
|
|
2494
|
+
async function Wi(e, t = {}) {
|
|
2495
|
+
var a, l, c;
|
|
2496
|
+
const n = `${_i()}${Di}`, r = new AbortController();
|
|
2497
|
+
let o = !1;
|
|
2498
|
+
const i = () => r.abort();
|
|
2499
|
+
(a = t.signal) != null && a.aborted ? r.abort() : (l = t.signal) == null || l.addEventListener("abort", i, { once: !0 });
|
|
2500
|
+
const s = setTimeout(() => {
|
|
2501
|
+
o = !0, r.abort();
|
|
2502
|
+
}, Hi);
|
|
2503
|
+
try {
|
|
2504
|
+
const m = new FormData();
|
|
2505
|
+
m.append("file", e);
|
|
2506
|
+
const d = await fetch(n, {
|
|
2507
|
+
method: "POST",
|
|
2508
|
+
headers: Pt(),
|
|
2509
|
+
body: m,
|
|
2510
|
+
signal: r.signal
|
|
2511
|
+
}), S = await We(d), y = typeof S.url == "string" ? S.url.trim() : "";
|
|
2512
|
+
if (!y) throw new Error("上传成功但响应缺少文件地址");
|
|
2513
|
+
return { ...S, url: y };
|
|
2514
|
+
} catch (m) {
|
|
2515
|
+
throw r.signal.aborted ? o ? new Error("上传超时,请稍后重试") : new Kn() : m;
|
|
2516
|
+
} finally {
|
|
2517
|
+
clearTimeout(s), (c = t.signal) == null || c.removeEventListener("abort", i);
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
const Wn = be({
|
|
2521
|
+
beginUpload: () => () => {
|
|
2522
|
+
}
|
|
2523
|
+
});
|
|
2524
|
+
function Tt({
|
|
2525
|
+
children: e,
|
|
2526
|
+
onUploadingChange: t
|
|
2527
|
+
}) {
|
|
2528
|
+
const [n, r] = w(0), o = x(!0), i = x(t);
|
|
2529
|
+
i.current = t, z(() => (o.current = !0, () => {
|
|
2530
|
+
var a;
|
|
2531
|
+
o.current = !1, (a = i.current) == null || a.call(i, !1);
|
|
2532
|
+
}), []), z(() => {
|
|
2533
|
+
t == null || t(n > 0);
|
|
2534
|
+
}, [n, t]);
|
|
2535
|
+
const s = q(() => {
|
|
2536
|
+
o.current && r((l) => l + 1);
|
|
2537
|
+
let a = !1;
|
|
2538
|
+
return () => {
|
|
2539
|
+
a || (a = !0, o.current && r((l) => Math.max(0, l - 1)));
|
|
2540
|
+
};
|
|
2541
|
+
}, []);
|
|
2542
|
+
return /* @__PURE__ */ u(Wn.Provider, { value: { beginUpload: s }, children: e });
|
|
2543
|
+
}
|
|
2544
|
+
function Gi() {
|
|
2545
|
+
return Se(Wn);
|
|
2546
|
+
}
|
|
2547
|
+
const Gn = "skopon-form-v0_9", Ji = /* @__PURE__ */ new Set([
|
|
2452
2548
|
"SkoponMedia",
|
|
2453
2549
|
"SkoponSelect",
|
|
2454
2550
|
"Image",
|
|
@@ -2460,20 +2556,20 @@ const Ln = "skopon-form-v0_9", Ri = /* @__PURE__ */ new Set([
|
|
|
2460
2556
|
"FileUpload",
|
|
2461
2557
|
"TextField",
|
|
2462
2558
|
"Text",
|
|
2463
|
-
...
|
|
2464
|
-
]),
|
|
2465
|
-
function
|
|
2466
|
-
const t = [...
|
|
2559
|
+
...Jo()
|
|
2560
|
+
]), Yi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2561
|
+
function Re(e) {
|
|
2562
|
+
const t = [...Le.components.values()].find((n) => n.name === e);
|
|
2467
2563
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2468
2564
|
return t.schema;
|
|
2469
2565
|
}
|
|
2470
|
-
function
|
|
2566
|
+
function B(e) {
|
|
2471
2567
|
return typeof e == "string" ? e : "";
|
|
2472
2568
|
}
|
|
2473
|
-
function
|
|
2474
|
-
return
|
|
2569
|
+
function Jn(e) {
|
|
2570
|
+
return ce(e);
|
|
2475
2571
|
}
|
|
2476
|
-
function
|
|
2572
|
+
function Qe({
|
|
2477
2573
|
mediaType: e,
|
|
2478
2574
|
urls: t,
|
|
2479
2575
|
mediaSize: n,
|
|
@@ -2481,10 +2577,10 @@ function De({
|
|
|
2481
2577
|
help: o,
|
|
2482
2578
|
placeholder: i
|
|
2483
2579
|
}) {
|
|
2484
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2485
|
-
return /* @__PURE__ */
|
|
2486
|
-
s ? /* @__PURE__ */
|
|
2487
|
-
t.length === 0 ? /* @__PURE__ */
|
|
2580
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Kr(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2581
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview", children: [
|
|
2582
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2583
|
+
t.length === 0 ? /* @__PURE__ */ u("div", { className: "form-media-preview form-media-preview--empty", children: c }) : /* @__PURE__ */ u("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ u(
|
|
2488
2584
|
"img",
|
|
2489
2585
|
{
|
|
2490
2586
|
src: m,
|
|
@@ -2492,7 +2588,7 @@ function De({
|
|
|
2492
2588
|
className: "form-media-item"
|
|
2493
2589
|
},
|
|
2494
2590
|
`media-${d}`
|
|
2495
|
-
) : e === "video" ? /* @__PURE__ */
|
|
2591
|
+
) : e === "video" ? /* @__PURE__ */ u(
|
|
2496
2592
|
"video",
|
|
2497
2593
|
{
|
|
2498
2594
|
src: m,
|
|
@@ -2500,7 +2596,7 @@ function De({
|
|
|
2500
2596
|
className: "form-media-item"
|
|
2501
2597
|
},
|
|
2502
2598
|
`media-${d}`
|
|
2503
|
-
) : /* @__PURE__ */
|
|
2599
|
+
) : /* @__PURE__ */ u(
|
|
2504
2600
|
"audio",
|
|
2505
2601
|
{
|
|
2506
2602
|
src: m,
|
|
@@ -2509,21 +2605,21 @@ function De({
|
|
|
2509
2605
|
},
|
|
2510
2606
|
`media-${d}`
|
|
2511
2607
|
)) }),
|
|
2512
|
-
a ? /* @__PURE__ */
|
|
2608
|
+
a ? /* @__PURE__ */ u(re.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2513
2609
|
] });
|
|
2514
2610
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2611
|
+
function Xe(e, t) {
|
|
2612
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : B(e.url).trim() ? [B(e.url).trim()] : [];
|
|
2517
2613
|
return {
|
|
2518
2614
|
mediaType: t,
|
|
2519
2615
|
urls: n,
|
|
2520
|
-
mediaSize:
|
|
2521
|
-
label:
|
|
2522
|
-
help:
|
|
2523
|
-
placeholder:
|
|
2616
|
+
mediaSize: Ue(e.mediaSize),
|
|
2617
|
+
label: B(e.label) || B(e.description),
|
|
2618
|
+
help: B(e.help),
|
|
2619
|
+
placeholder: B(e.placeholder)
|
|
2524
2620
|
};
|
|
2525
2621
|
}
|
|
2526
|
-
const
|
|
2622
|
+
const Qi = {
|
|
2527
2623
|
name: "SkoponMedia",
|
|
2528
2624
|
schema: f.object({
|
|
2529
2625
|
mediaType: f.any().optional(),
|
|
@@ -2533,19 +2629,19 @@ const Pi = {
|
|
|
2533
2629
|
help: f.any().optional(),
|
|
2534
2630
|
placeholder: f.any().optional()
|
|
2535
2631
|
}).passthrough()
|
|
2536
|
-
},
|
|
2537
|
-
const t = e.componentModel.properties, n =
|
|
2538
|
-
return /* @__PURE__ */
|
|
2539
|
-
}),
|
|
2540
|
-
{ name: "Image", schema:
|
|
2541
|
-
({ context: e }) => /* @__PURE__ */
|
|
2542
|
-
),
|
|
2543
|
-
{ name: "Video", schema:
|
|
2544
|
-
({ context: e }) => /* @__PURE__ */
|
|
2545
|
-
),
|
|
2546
|
-
{ name: "AudioPlayer", schema:
|
|
2547
|
-
({ context: e }) => /* @__PURE__ */
|
|
2548
|
-
),
|
|
2632
|
+
}, Xi = Z(Qi, ({ context: e }) => {
|
|
2633
|
+
const t = e.componentModel.properties, n = B(t.mediaType);
|
|
2634
|
+
return /* @__PURE__ */ u(Qe, { ...Xe(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2635
|
+
}), Zi = Z(
|
|
2636
|
+
{ name: "Image", schema: Re("Image") },
|
|
2637
|
+
({ context: e }) => /* @__PURE__ */ u(Qe, { ...Xe(e.componentModel.properties, "image") })
|
|
2638
|
+
), es = Z(
|
|
2639
|
+
{ name: "Video", schema: Re("Video") },
|
|
2640
|
+
({ context: e }) => /* @__PURE__ */ u(Qe, { ...Xe(e.componentModel.properties, "video") })
|
|
2641
|
+
), ts = Z(
|
|
2642
|
+
{ name: "AudioPlayer", schema: Re("AudioPlayer") },
|
|
2643
|
+
({ context: e }) => /* @__PURE__ */ u(Qe, { ...Xe(e.componentModel.properties, "audio") })
|
|
2644
|
+
), ns = {
|
|
2549
2645
|
name: "SkoponSelect",
|
|
2550
2646
|
schema: f.object({
|
|
2551
2647
|
label: f.any().optional(),
|
|
@@ -2555,18 +2651,18 @@ const Pi = {
|
|
|
2555
2651
|
value: f.any().optional()
|
|
2556
2652
|
}).passthrough()
|
|
2557
2653
|
};
|
|
2558
|
-
function
|
|
2559
|
-
const { interactive: t } =
|
|
2654
|
+
function rs({ context: e }) {
|
|
2655
|
+
const { interactive: t } = ue(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = me(e, "value", {
|
|
2560
2656
|
component: "SkoponSelect",
|
|
2561
2657
|
changeAction: "select"
|
|
2562
|
-
}), s = e.componentModel.properties, a =
|
|
2563
|
-
return
|
|
2564
|
-
const d =
|
|
2658
|
+
}), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), c = Jn(s.options), m = B(s.mode) === "multiple";
|
|
2659
|
+
return z(() => {
|
|
2660
|
+
const d = Mn(n, m);
|
|
2565
2661
|
d !== null && o(d);
|
|
2566
|
-
}, [m, n, o]),
|
|
2567
|
-
a ? /* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2569
|
-
|
|
2662
|
+
}, [m, n, o]), c.length === 0 ? null : /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2663
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2664
|
+
/* @__PURE__ */ u(
|
|
2665
|
+
yt,
|
|
2570
2666
|
{
|
|
2571
2667
|
mode: m ? "multiple" : void 0,
|
|
2572
2668
|
disabled: !t,
|
|
@@ -2574,29 +2670,29 @@ function Vi({ context: e }) {
|
|
|
2574
2670
|
className: "form-block-preview-control",
|
|
2575
2671
|
style: { width: "100%" },
|
|
2576
2672
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2577
|
-
options:
|
|
2578
|
-
value: m ?
|
|
2673
|
+
options: c,
|
|
2674
|
+
value: m ? ne(n) : Fe(n),
|
|
2579
2675
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2580
2676
|
}
|
|
2581
2677
|
)
|
|
2582
2678
|
] });
|
|
2583
2679
|
}
|
|
2584
|
-
const
|
|
2585
|
-
|
|
2586
|
-
|
|
2680
|
+
const os = Z(
|
|
2681
|
+
ns,
|
|
2682
|
+
rs
|
|
2587
2683
|
);
|
|
2588
|
-
function
|
|
2589
|
-
const { interactive: t } =
|
|
2684
|
+
function is({ context: e }) {
|
|
2685
|
+
const { interactive: t } = ue(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = me(e, "value", {
|
|
2590
2686
|
component: "ChoicePicker",
|
|
2591
2687
|
changeAction: "select"
|
|
2592
|
-
}), s = e.componentModel.properties, a =
|
|
2593
|
-
return
|
|
2594
|
-
const g =
|
|
2688
|
+
}), s = e.componentModel.properties, a = B(s.label), l = B(s.variant) || "mutuallyExclusive", c = B(s.skoponPickerType), m = B(s.placeholder), d = Jn(s.options), y = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", T = y === "multiselect" || y === "checkbox";
|
|
2689
|
+
return z(() => {
|
|
2690
|
+
const g = Mn(n, T);
|
|
2595
2691
|
g !== null && o(g);
|
|
2596
|
-
}, [
|
|
2597
|
-
a ? /* @__PURE__ */
|
|
2598
|
-
y === "select" ? /* @__PURE__ */
|
|
2599
|
-
|
|
2692
|
+
}, [T, n, o]), d.length === 0 ? null : /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2693
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2694
|
+
y === "select" ? /* @__PURE__ */ u(
|
|
2695
|
+
yt,
|
|
2600
2696
|
{
|
|
2601
2697
|
disabled: !t,
|
|
2602
2698
|
allowClear: !0,
|
|
@@ -2604,11 +2700,11 @@ function $i({ context: e }) {
|
|
|
2604
2700
|
style: { width: "100%" },
|
|
2605
2701
|
placeholder: m || "请选择",
|
|
2606
2702
|
options: d,
|
|
2607
|
-
value:
|
|
2703
|
+
value: Fe(n),
|
|
2608
2704
|
onChange: (g) => r(g ?? "")
|
|
2609
2705
|
}
|
|
2610
|
-
) : y === "multiselect" ? /* @__PURE__ */
|
|
2611
|
-
|
|
2706
|
+
) : y === "multiselect" ? /* @__PURE__ */ u(
|
|
2707
|
+
yt,
|
|
2612
2708
|
{
|
|
2613
2709
|
mode: "multiple",
|
|
2614
2710
|
disabled: !t,
|
|
@@ -2617,31 +2713,31 @@ function $i({ context: e }) {
|
|
|
2617
2713
|
style: { width: "100%" },
|
|
2618
2714
|
placeholder: m || "请选择多项",
|
|
2619
2715
|
options: d,
|
|
2620
|
-
value:
|
|
2716
|
+
value: ne(n),
|
|
2621
2717
|
onChange: (g) => r(g ?? [])
|
|
2622
2718
|
}
|
|
2623
|
-
) : y === "checkbox" ? /* @__PURE__ */
|
|
2624
|
-
|
|
2719
|
+
) : y === "checkbox" ? /* @__PURE__ */ u(
|
|
2720
|
+
ar.Group,
|
|
2625
2721
|
{
|
|
2626
2722
|
disabled: !t,
|
|
2627
2723
|
className: "form-block-preview-control",
|
|
2628
2724
|
options: d,
|
|
2629
|
-
value:
|
|
2725
|
+
value: ne(n),
|
|
2630
2726
|
onChange: (g) => r(g)
|
|
2631
2727
|
}
|
|
2632
|
-
) : /* @__PURE__ */
|
|
2633
|
-
|
|
2728
|
+
) : /* @__PURE__ */ u(
|
|
2729
|
+
lr.Group,
|
|
2634
2730
|
{
|
|
2635
2731
|
disabled: !t,
|
|
2636
2732
|
className: "form-block-preview-control",
|
|
2637
2733
|
options: d,
|
|
2638
|
-
value:
|
|
2734
|
+
value: Fe(n),
|
|
2639
2735
|
onChange: (g) => r(g.target.value)
|
|
2640
2736
|
}
|
|
2641
2737
|
)
|
|
2642
2738
|
] });
|
|
2643
2739
|
}
|
|
2644
|
-
const
|
|
2740
|
+
const ss = Z(
|
|
2645
2741
|
{
|
|
2646
2742
|
name: "ChoicePicker",
|
|
2647
2743
|
schema: f.object({
|
|
@@ -2653,88 +2749,88 @@ const Di = J(
|
|
|
2653
2749
|
placeholder: f.any().optional()
|
|
2654
2750
|
}).passthrough()
|
|
2655
2751
|
},
|
|
2656
|
-
|
|
2752
|
+
is
|
|
2657
2753
|
);
|
|
2658
|
-
function
|
|
2659
|
-
const { interactive: t } =
|
|
2754
|
+
function as({ context: e }) {
|
|
2755
|
+
const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o } = me(e, "value", {
|
|
2660
2756
|
component: "CheckBox",
|
|
2661
2757
|
changeAction: "change"
|
|
2662
|
-
}), i = e.componentModel.properties, s =
|
|
2663
|
-
return /* @__PURE__ */
|
|
2664
|
-
s ? /* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
|
|
2758
|
+
}), i = e.componentModel.properties, s = B(i.label);
|
|
2759
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2760
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2761
|
+
/* @__PURE__ */ u(
|
|
2762
|
+
cr,
|
|
2667
2763
|
{
|
|
2668
2764
|
disabled: !t,
|
|
2669
2765
|
className: "form-block-preview-control",
|
|
2670
|
-
checked:
|
|
2766
|
+
checked: we(n),
|
|
2671
2767
|
onChange: (a) => r(a)
|
|
2672
2768
|
}
|
|
2673
2769
|
)
|
|
2674
2770
|
] });
|
|
2675
2771
|
}
|
|
2676
|
-
const
|
|
2677
|
-
{ name: "CheckBox", schema:
|
|
2678
|
-
|
|
2772
|
+
const ls = Z(
|
|
2773
|
+
{ name: "CheckBox", schema: Re("CheckBox") },
|
|
2774
|
+
as
|
|
2679
2775
|
);
|
|
2680
|
-
function
|
|
2681
|
-
const r =
|
|
2776
|
+
function cs(e, t, n) {
|
|
2777
|
+
const r = Fe(e);
|
|
2682
2778
|
if (!r) return;
|
|
2683
2779
|
if (!t && n) {
|
|
2684
|
-
const i =
|
|
2780
|
+
const i = Zt(r, "HH:mm", !0);
|
|
2685
2781
|
return i.isValid() ? i : void 0;
|
|
2686
2782
|
}
|
|
2687
|
-
const o =
|
|
2783
|
+
const o = Zt(r);
|
|
2688
2784
|
return o.isValid() ? o : void 0;
|
|
2689
2785
|
}
|
|
2690
|
-
function
|
|
2691
|
-
const { interactive: t } =
|
|
2786
|
+
function us({ context: e }) {
|
|
2787
|
+
const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o, reportFocus: i } = me(e, "value", {
|
|
2692
2788
|
component: "DateTimeInput",
|
|
2693
2789
|
changeAction: "change"
|
|
2694
|
-
}), s = e.componentModel.properties, a =
|
|
2790
|
+
}), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = cs(n, c, m), S = (y) => {
|
|
2695
2791
|
if (!y) {
|
|
2696
2792
|
r("");
|
|
2697
2793
|
return;
|
|
2698
2794
|
}
|
|
2699
|
-
if (!
|
|
2795
|
+
if (!c && m) {
|
|
2700
2796
|
r(y.format("HH:mm"));
|
|
2701
2797
|
return;
|
|
2702
2798
|
}
|
|
2703
|
-
if (
|
|
2799
|
+
if (c && m) {
|
|
2704
2800
|
r(y.format("YYYY-MM-DDTHH:mm"));
|
|
2705
2801
|
return;
|
|
2706
2802
|
}
|
|
2707
2803
|
r(y.format("YYYY-MM-DD"));
|
|
2708
2804
|
};
|
|
2709
|
-
return /* @__PURE__ */
|
|
2710
|
-
a ? /* @__PURE__ */
|
|
2711
|
-
!
|
|
2712
|
-
|
|
2805
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2806
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2807
|
+
!c && m ? /* @__PURE__ */ u(
|
|
2808
|
+
ur,
|
|
2713
2809
|
{
|
|
2714
2810
|
disabled: !t,
|
|
2715
2811
|
className: "form-block-preview-control",
|
|
2716
2812
|
style: { width: "100%" },
|
|
2717
2813
|
placeholder: l || "选择时间",
|
|
2718
2814
|
value: d,
|
|
2719
|
-
onChange:
|
|
2815
|
+
onChange: S,
|
|
2720
2816
|
onFocus: i
|
|
2721
2817
|
}
|
|
2722
|
-
) : /* @__PURE__ */
|
|
2723
|
-
|
|
2818
|
+
) : /* @__PURE__ */ u(
|
|
2819
|
+
mr,
|
|
2724
2820
|
{
|
|
2725
|
-
showTime:
|
|
2821
|
+
showTime: c && m,
|
|
2726
2822
|
disabled: !t,
|
|
2727
2823
|
className: "form-block-preview-control",
|
|
2728
2824
|
style: { width: "100%" },
|
|
2729
|
-
placeholder: l || (
|
|
2825
|
+
placeholder: l || (c && m ? "选择日期时间" : "选择日期"),
|
|
2730
2826
|
value: d,
|
|
2731
|
-
onChange:
|
|
2827
|
+
onChange: S,
|
|
2732
2828
|
onFocus: i
|
|
2733
2829
|
}
|
|
2734
2830
|
)
|
|
2735
2831
|
] });
|
|
2736
2832
|
}
|
|
2737
|
-
const
|
|
2833
|
+
const ms = Z(
|
|
2738
2834
|
{
|
|
2739
2835
|
name: "DateTimeInput",
|
|
2740
2836
|
schema: f.object({
|
|
@@ -2747,8 +2843,8 @@ const Ji = J(
|
|
|
2747
2843
|
max: f.any().optional()
|
|
2748
2844
|
}).passthrough()
|
|
2749
2845
|
},
|
|
2750
|
-
|
|
2751
|
-
),
|
|
2846
|
+
us
|
|
2847
|
+
), ds = {
|
|
2752
2848
|
name: "FileUpload",
|
|
2753
2849
|
schema: f.object({
|
|
2754
2850
|
label: f.any().optional(),
|
|
@@ -2760,141 +2856,224 @@ const Ji = J(
|
|
|
2760
2856
|
value: f.any().optional()
|
|
2761
2857
|
}).passthrough()
|
|
2762
2858
|
};
|
|
2763
|
-
function
|
|
2764
|
-
|
|
2859
|
+
function cn(e) {
|
|
2860
|
+
return ne(e).map((t) => t.trim()).filter(Boolean);
|
|
2861
|
+
}
|
|
2862
|
+
function fs(e) {
|
|
2863
|
+
const n = e.split(/[?#]/, 1)[0].split("/").filter(Boolean).pop() || e;
|
|
2864
|
+
try {
|
|
2865
|
+
return decodeURIComponent(n);
|
|
2866
|
+
} catch {
|
|
2867
|
+
return n;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
function un(e, t) {
|
|
2871
|
+
return { uid: t, name: fs(e), status: "done", url: e };
|
|
2872
|
+
}
|
|
2873
|
+
function ps({ context: e }) {
|
|
2874
|
+
var oe;
|
|
2875
|
+
const { interactive: t } = ue(), { beginUpload: n } = Gi(), { value: r, setValue: o, setValueSilent: i, fieldName: s } = me(e, "value", {
|
|
2765
2876
|
component: "FileUpload",
|
|
2766
2877
|
changeAction: "change"
|
|
2767
|
-
}),
|
|
2768
|
-
|
|
2769
|
-
) ?
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2878
|
+
}), a = e.componentModel.properties, l = B(a.label), c = B(a.accept), m = Array.isArray(a.fileAcceptTypes) ? a.fileAcceptTypes.map(String) : void 0, d = c ? c.split(",").map((_) => _.trim()).filter(Boolean) : void 0, S = Lr(m, d), y = typeof a.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2879
|
+
a.filePlaceholderIcon
|
|
2880
|
+
) ? 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 = cn(r), p = x(0), k = x(!0), I = x(/* @__PURE__ */ new Map()), O = x(o);
|
|
2881
|
+
O.current = o;
|
|
2882
|
+
const [M, $] = w(
|
|
2883
|
+
() => v.map((_) => un(_, `external-${p.current++}`))
|
|
2884
|
+
), H = x(M);
|
|
2885
|
+
H.current = M;
|
|
2886
|
+
const N = q(
|
|
2887
|
+
(_, h) => {
|
|
2888
|
+
const b = _(H.current);
|
|
2889
|
+
return H.current = b, k.current && $(b), h && O.current(
|
|
2890
|
+
b.filter((R) => R.status === "done" && R.url).map((R) => R.url)
|
|
2891
|
+
), b;
|
|
2892
|
+
},
|
|
2893
|
+
[]
|
|
2894
|
+
);
|
|
2895
|
+
z(() => (k.current = !0, () => {
|
|
2896
|
+
k.current = !1;
|
|
2897
|
+
for (const _ of I.current.values()) _.abort();
|
|
2898
|
+
I.current.clear();
|
|
2899
|
+
}), []), z(() => {
|
|
2900
|
+
const _ = cn(r);
|
|
2901
|
+
Array.isArray(r) && r.length === _.length && r.every((R, F) => typeof R == "string" && R === _[F]) || i(_);
|
|
2902
|
+
const b = /* @__PURE__ */ new Set();
|
|
2903
|
+
N(
|
|
2904
|
+
(R) => {
|
|
2905
|
+
const F = R.filter((E) => {
|
|
2906
|
+
if (E.status !== "done" || !E.url) return !0;
|
|
2907
|
+
const J = _.findIndex((te, se) => !b.has(se) && te === E.url);
|
|
2908
|
+
return J < 0 ? !1 : (b.add(J), !0);
|
|
2909
|
+
});
|
|
2910
|
+
return _.forEach((E, J) => {
|
|
2911
|
+
b.has(J) || F.push(un(E, `external-${p.current++}`));
|
|
2912
|
+
}), F;
|
|
2913
|
+
},
|
|
2914
|
+
!1
|
|
2915
|
+
);
|
|
2916
|
+
}, [r, i, N]);
|
|
2917
|
+
const A = q(
|
|
2918
|
+
(_) => {
|
|
2919
|
+
if (!t || C && H.current.length >= g) return;
|
|
2920
|
+
const h = `${_.uid ?? "file"}-${p.current++}`, b = new AbortController();
|
|
2921
|
+
I.current.set(h, b), N(
|
|
2922
|
+
(F) => [...F, { uid: h, name: _.name, status: "uploading" }],
|
|
2923
|
+
!1
|
|
2924
|
+
);
|
|
2925
|
+
const R = n();
|
|
2926
|
+
Wi(_, { signal: b.signal }).then((F) => {
|
|
2927
|
+
!k.current || b.signal.aborted || N(
|
|
2928
|
+
(E) => E.map(
|
|
2929
|
+
(J) => J.uid === h ? { ...J, status: "done", url: F.url, error: void 0 } : J
|
|
2930
|
+
),
|
|
2931
|
+
!0
|
|
2932
|
+
);
|
|
2933
|
+
}).catch((F) => {
|
|
2934
|
+
if (!k.current || Ki(F)) return;
|
|
2935
|
+
const E = F instanceof Error ? F.message : "上传失败";
|
|
2936
|
+
N(
|
|
2937
|
+
(J) => J.map(
|
|
2938
|
+
(te) => te.uid === h ? { ...te, status: "error", error: E } : te
|
|
2939
|
+
),
|
|
2940
|
+
!1
|
|
2941
|
+
);
|
|
2942
|
+
}).finally(() => {
|
|
2943
|
+
I.current.delete(h), R();
|
|
2944
|
+
});
|
|
2945
|
+
},
|
|
2946
|
+
[n, N, C, t, g]
|
|
2947
|
+
), Y = q(
|
|
2948
|
+
(_) => {
|
|
2949
|
+
var h;
|
|
2950
|
+
(h = I.current.get(_)) == null || h.abort(), I.current.delete(_), N((b) => b.filter((R) => R.uid !== _), !0);
|
|
2951
|
+
},
|
|
2952
|
+
[N]
|
|
2953
|
+
), G = M.filter((_) => _.status === "done").length, W = C && M.length >= g, L = G < T, D = (oe = [...M].reverse().find((_) => _.error)) == null ? void 0 : oe.error, ie = M.map((_) => ({
|
|
2954
|
+
uid: _.uid,
|
|
2955
|
+
name: _.name,
|
|
2956
|
+
status: _.status,
|
|
2957
|
+
url: _.url,
|
|
2958
|
+
response: _.error
|
|
2959
|
+
}));
|
|
2960
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": s || void 0, children: [
|
|
2961
|
+
l ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: l }) : null,
|
|
2962
|
+
/* @__PURE__ */ U(
|
|
2963
|
+
st.Dragger,
|
|
2774
2964
|
{
|
|
2775
|
-
disabled: !t
|
|
2776
|
-
|
|
2965
|
+
disabled: !t,
|
|
2966
|
+
openFileDialogOnClick: !W,
|
|
2967
|
+
accept: Br(m, d),
|
|
2777
2968
|
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
|
-
},
|
|
2969
|
+
multiple: !C || g > 1,
|
|
2970
|
+
showUploadList: t && M.length > 0,
|
|
2971
|
+
fileList: t ? ie : [],
|
|
2972
|
+
beforeUpload: (_) => t ? (A(_), st.LIST_IGNORE) : st.LIST_IGNORE,
|
|
2973
|
+
onRemove: (_) => (Y(_.uid), !0),
|
|
2796
2974
|
children: [
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(ji, { type: y, size: 40 }) }),
|
|
2976
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2799
2977
|
]
|
|
2800
2978
|
}
|
|
2801
2979
|
),
|
|
2802
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ U(re.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2803
2981
|
"允许:",
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
"
|
|
2808
|
-
|
|
2809
|
-
] })
|
|
2982
|
+
S ?? "全部类型",
|
|
2983
|
+
T > 0 ? `;至少 ${T} 个文件` : "",
|
|
2984
|
+
C ? `;最多 ${g} 个文件` : "",
|
|
2985
|
+
";选择后自动上传至 CDN",
|
|
2986
|
+
L && t ? `(当前 ${G} 个,未达下限)` : ""
|
|
2987
|
+
] }),
|
|
2988
|
+
D ? /* @__PURE__ */ u(re.Text, { type: "danger", className: "form-block-preview-help", children: D }) : null
|
|
2810
2989
|
] });
|
|
2811
2990
|
}
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
|
|
2991
|
+
const hs = Z(
|
|
2992
|
+
ds,
|
|
2993
|
+
ps
|
|
2815
2994
|
);
|
|
2816
|
-
function
|
|
2817
|
-
const { interactive: t } =
|
|
2995
|
+
function gs({ context: e }) {
|
|
2996
|
+
const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o, reportFocus: i } = me(e, "value", {
|
|
2818
2997
|
component: "TextField",
|
|
2819
2998
|
changeAction: "change",
|
|
2820
2999
|
debounceChange: !0
|
|
2821
|
-
}), s = e.componentModel.properties, a =
|
|
3000
|
+
}), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), c = B(s.variant) || "shortText", m = B(s.validationRegexp), d = Fe(n) ?? "", S = !t, [y, T] = w(""), g = (p) => {
|
|
2822
3001
|
if (!m || !p.trim()) {
|
|
2823
|
-
|
|
3002
|
+
T("");
|
|
2824
3003
|
return;
|
|
2825
3004
|
}
|
|
2826
|
-
|
|
3005
|
+
T(Dn(p, m) ? "" : "格式不正确");
|
|
2827
3006
|
};
|
|
2828
|
-
|
|
3007
|
+
z(() => {
|
|
2829
3008
|
g(d);
|
|
2830
3009
|
}, [m, d]);
|
|
2831
|
-
const
|
|
2832
|
-
let
|
|
2833
|
-
if (
|
|
2834
|
-
|
|
2835
|
-
|
|
3010
|
+
const C = "form-block-preview-control";
|
|
3011
|
+
let v;
|
|
3012
|
+
if (c === "longText")
|
|
3013
|
+
v = /* @__PURE__ */ u(
|
|
3014
|
+
at.TextArea,
|
|
2836
3015
|
{
|
|
2837
|
-
disabled:
|
|
2838
|
-
className:
|
|
3016
|
+
disabled: S,
|
|
3017
|
+
className: C,
|
|
2839
3018
|
placeholder: l || "长文本回答...",
|
|
2840
3019
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2841
3020
|
value: d,
|
|
2842
3021
|
status: y ? "error" : void 0,
|
|
2843
3022
|
onChange: (p) => {
|
|
2844
|
-
const
|
|
2845
|
-
r(
|
|
3023
|
+
const k = p.target.value;
|
|
3024
|
+
r(k), g(k);
|
|
2846
3025
|
},
|
|
2847
3026
|
onFocus: i,
|
|
2848
3027
|
onBlur: (p) => g(p.target.value)
|
|
2849
3028
|
}
|
|
2850
3029
|
);
|
|
2851
|
-
else if (
|
|
3030
|
+
else if (c === "number") {
|
|
2852
3031
|
const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2853
|
-
|
|
2854
|
-
|
|
3032
|
+
v = /* @__PURE__ */ u(
|
|
3033
|
+
dr,
|
|
2855
3034
|
{
|
|
2856
|
-
disabled:
|
|
2857
|
-
className:
|
|
3035
|
+
disabled: S,
|
|
3036
|
+
className: C,
|
|
2858
3037
|
style: { width: "100%" },
|
|
2859
3038
|
placeholder: l || "数字",
|
|
2860
3039
|
value: p,
|
|
2861
|
-
onChange: (
|
|
3040
|
+
onChange: (k) => r(k == null ? "" : String(k)),
|
|
2862
3041
|
onFocus: i
|
|
2863
3042
|
}
|
|
2864
3043
|
);
|
|
2865
|
-
} else
|
|
2866
|
-
|
|
3044
|
+
} else c === "obscured" ? v = /* @__PURE__ */ u(
|
|
3045
|
+
at.Password,
|
|
2867
3046
|
{
|
|
2868
|
-
disabled:
|
|
2869
|
-
className:
|
|
3047
|
+
disabled: S,
|
|
3048
|
+
className: C,
|
|
2870
3049
|
placeholder: l,
|
|
2871
3050
|
value: d,
|
|
2872
3051
|
onChange: (p) => r(p.target.value),
|
|
2873
3052
|
onFocus: i
|
|
2874
3053
|
}
|
|
2875
|
-
) :
|
|
2876
|
-
|
|
3054
|
+
) : v = /* @__PURE__ */ u(
|
|
3055
|
+
at,
|
|
2877
3056
|
{
|
|
2878
|
-
disabled:
|
|
2879
|
-
className:
|
|
3057
|
+
disabled: S,
|
|
3058
|
+
className: C,
|
|
2880
3059
|
placeholder: l,
|
|
2881
3060
|
value: d,
|
|
2882
3061
|
status: y ? "error" : void 0,
|
|
2883
3062
|
onChange: (p) => {
|
|
2884
|
-
const
|
|
2885
|
-
r(
|
|
3063
|
+
const k = p.target.value;
|
|
3064
|
+
r(k), g(k);
|
|
2886
3065
|
},
|
|
2887
3066
|
onFocus: i,
|
|
2888
3067
|
onBlur: (p) => g(p.target.value)
|
|
2889
3068
|
}
|
|
2890
3069
|
);
|
|
2891
|
-
return /* @__PURE__ */
|
|
2892
|
-
a ? /* @__PURE__ */
|
|
2893
|
-
|
|
2894
|
-
y ? /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
3071
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
3072
|
+
v,
|
|
3073
|
+
y ? /* @__PURE__ */ u(re.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
|
|
2895
3074
|
] });
|
|
2896
3075
|
}
|
|
2897
|
-
const
|
|
3076
|
+
const ys = Z(
|
|
2898
3077
|
{
|
|
2899
3078
|
name: "TextField",
|
|
2900
3079
|
schema: f.object({
|
|
@@ -2905,37 +3084,37 @@ const es = J(
|
|
|
2905
3084
|
value: f.any().optional()
|
|
2906
3085
|
}).passthrough()
|
|
2907
3086
|
},
|
|
2908
|
-
|
|
3087
|
+
gs
|
|
2909
3088
|
);
|
|
2910
|
-
function
|
|
2911
|
-
const t = e.componentModel.properties, n =
|
|
2912
|
-
return
|
|
3089
|
+
function vs({ context: e }) {
|
|
3090
|
+
const t = e.componentModel.properties, n = B(t.text), r = B(t.variant) || "body";
|
|
3091
|
+
return Yi.has(r) ? r === "caption" ? /* @__PURE__ */ u(re.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ u("em", { children: n }) }) : /* @__PURE__ */ u(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ u(re.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2913
3092
|
}
|
|
2914
|
-
const
|
|
2915
|
-
{ name: "Text", schema:
|
|
2916
|
-
|
|
3093
|
+
const bs = Z(
|
|
3094
|
+
{ name: "Text", schema: Re("Text") },
|
|
3095
|
+
vs
|
|
2917
3096
|
);
|
|
2918
|
-
function
|
|
3097
|
+
function Yn() {
|
|
2919
3098
|
const t = [
|
|
2920
|
-
...[...
|
|
2921
|
-
(r) => !
|
|
3099
|
+
...[...Le.components.values()].filter(
|
|
3100
|
+
(r) => !Ji.has(r.name)
|
|
2922
3101
|
),
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
Bi,
|
|
2927
|
-
qi,
|
|
2928
|
-
Di,
|
|
2929
|
-
Ki,
|
|
2930
|
-
Ji,
|
|
2931
|
-
Qi,
|
|
3102
|
+
Xi,
|
|
3103
|
+
os,
|
|
3104
|
+
Zi,
|
|
2932
3105
|
es,
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
3106
|
+
ts,
|
|
3107
|
+
ss,
|
|
3108
|
+
ls,
|
|
3109
|
+
ms,
|
|
3110
|
+
hs,
|
|
3111
|
+
ys,
|
|
3112
|
+
bs,
|
|
3113
|
+
...Go()
|
|
3114
|
+
], n = [...Le.functions.values()];
|
|
3115
|
+
return new kr(Gn, t, n, Le.themeSchema);
|
|
3116
|
+
}
|
|
3117
|
+
const le = {
|
|
2939
3118
|
jade9: "#29a383",
|
|
2940
3119
|
jade10: "#26997b",
|
|
2941
3120
|
jade11: "#208368",
|
|
@@ -2947,20 +3126,20 @@ const ie = {
|
|
|
2947
3126
|
primaryHover: "#26997b",
|
|
2948
3127
|
primaryActive: "#1d3b31",
|
|
2949
3128
|
onPrimary: "#ffffff"
|
|
2950
|
-
},
|
|
3129
|
+
}, Ss = {
|
|
2951
3130
|
cssVar: { key: "vidtempl" },
|
|
2952
3131
|
token: {
|
|
2953
|
-
colorPrimary:
|
|
2954
|
-
colorPrimaryHover:
|
|
2955
|
-
colorPrimaryActive:
|
|
2956
|
-
colorLink:
|
|
2957
|
-
colorLinkHover:
|
|
2958
|
-
colorSuccess:
|
|
3132
|
+
colorPrimary: le.primarySolid,
|
|
3133
|
+
colorPrimaryHover: le.primaryHover,
|
|
3134
|
+
colorPrimaryActive: le.primaryActive,
|
|
3135
|
+
colorLink: le.primary,
|
|
3136
|
+
colorLinkHover: le.primaryHover,
|
|
3137
|
+
colorSuccess: le.jade9,
|
|
2959
3138
|
colorWarning: "#f5a623",
|
|
2960
3139
|
gold6: "#f5a623",
|
|
2961
3140
|
gold7: "#e6951a",
|
|
2962
3141
|
colorError: "#e5484d",
|
|
2963
|
-
colorInfo:
|
|
3142
|
+
colorInfo: le.primary,
|
|
2964
3143
|
colorBgLayout: "#f9f9f9",
|
|
2965
3144
|
colorBgContainer: "#ffffff",
|
|
2966
3145
|
colorBgElevated: "#ffffff",
|
|
@@ -3020,7 +3199,7 @@ const ie = {
|
|
|
3020
3199
|
},
|
|
3021
3200
|
Tag: {
|
|
3022
3201
|
defaultBg: "#e6f7ed",
|
|
3023
|
-
defaultColor:
|
|
3202
|
+
defaultColor: le.primary,
|
|
3024
3203
|
fontSizeSM: 13
|
|
3025
3204
|
},
|
|
3026
3205
|
Form: {
|
|
@@ -3032,14 +3211,14 @@ const ie = {
|
|
|
3032
3211
|
}
|
|
3033
3212
|
}
|
|
3034
3213
|
};
|
|
3035
|
-
function
|
|
3214
|
+
function Me({
|
|
3036
3215
|
children: e,
|
|
3037
3216
|
locale: t,
|
|
3038
3217
|
theme: n
|
|
3039
3218
|
}) {
|
|
3040
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ u(fr, { theme: n ?? Ss, locale: t, children: e });
|
|
3041
3220
|
}
|
|
3042
|
-
const
|
|
3221
|
+
const ks = rr(
|
|
3043
3222
|
function({
|
|
3044
3223
|
doc: t,
|
|
3045
3224
|
surfaceId: n = "skopon-form",
|
|
@@ -3048,69 +3227,70 @@ const os = Jn(
|
|
|
3048
3227
|
fieldNames: i = [],
|
|
3049
3228
|
resumeSearch: s = null,
|
|
3050
3229
|
caseSearch: a = null,
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3230
|
+
onUploadingChange: l,
|
|
3231
|
+
wrapProvider: c = !0
|
|
3232
|
+
}, m) {
|
|
3233
|
+
z(() => {
|
|
3234
|
+
yn(), gn();
|
|
3055
3235
|
}, []);
|
|
3056
|
-
const
|
|
3057
|
-
|
|
3058
|
-
const
|
|
3059
|
-
if (
|
|
3236
|
+
const d = x(null), S = x(i);
|
|
3237
|
+
S.current = i;
|
|
3238
|
+
const y = j(() => {
|
|
3239
|
+
if (_t(t)) return "";
|
|
3060
3240
|
try {
|
|
3061
3241
|
return JSON.stringify(t);
|
|
3062
3242
|
} catch {
|
|
3063
3243
|
return String(t);
|
|
3064
3244
|
}
|
|
3065
|
-
}, [t]),
|
|
3066
|
-
if (!
|
|
3245
|
+
}, [t]), T = j(() => {
|
|
3246
|
+
if (!y)
|
|
3067
3247
|
return { surfaces: [], processor: null };
|
|
3068
3248
|
try {
|
|
3069
|
-
const
|
|
3249
|
+
const p = JSON.parse(y), k = new hn([Yn()]), I = oi(p, {
|
|
3070
3250
|
surfaceId: n,
|
|
3071
|
-
catalogId:
|
|
3251
|
+
catalogId: Gn
|
|
3072
3252
|
});
|
|
3073
|
-
return
|
|
3074
|
-
surfaces: Array.from(
|
|
3075
|
-
processor:
|
|
3253
|
+
return k.processMessages(I), {
|
|
3254
|
+
surfaces: Array.from(k.model.surfacesMap.values()),
|
|
3255
|
+
processor: k
|
|
3076
3256
|
};
|
|
3077
|
-
} catch (
|
|
3078
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
3257
|
+
} catch (p) {
|
|
3258
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
3079
3259
|
}
|
|
3080
|
-
}, [
|
|
3081
|
-
if (
|
|
3082
|
-
|
|
3260
|
+
}, [y, n]), { surfaces: g, processor: C } = T;
|
|
3261
|
+
if (d.current = C, or(
|
|
3262
|
+
m,
|
|
3083
3263
|
() => ({
|
|
3084
|
-
getValues(
|
|
3085
|
-
const
|
|
3086
|
-
if (!
|
|
3087
|
-
const
|
|
3088
|
-
return
|
|
3264
|
+
getValues(p) {
|
|
3265
|
+
const k = d.current;
|
|
3266
|
+
if (!k) return {};
|
|
3267
|
+
const I = (p ?? S.current).map((O) => O.trim()).filter(Boolean);
|
|
3268
|
+
return li(k, n, I);
|
|
3089
3269
|
},
|
|
3090
|
-
setValues(
|
|
3091
|
-
const
|
|
3092
|
-
if (!
|
|
3093
|
-
const
|
|
3094
|
-
if (
|
|
3095
|
-
for (const [
|
|
3096
|
-
const
|
|
3097
|
-
|
|
3270
|
+
setValues(p) {
|
|
3271
|
+
const k = d.current;
|
|
3272
|
+
if (!k) return;
|
|
3273
|
+
const I = k.model.surfacesMap.get(n);
|
|
3274
|
+
if (I)
|
|
3275
|
+
for (const [O, M] of Object.entries(p)) {
|
|
3276
|
+
const $ = O.trim();
|
|
3277
|
+
$ && I.dataModel.set(`/${$}`, M);
|
|
3098
3278
|
}
|
|
3099
3279
|
}
|
|
3100
3280
|
}),
|
|
3101
3281
|
[n]
|
|
3102
|
-
),
|
|
3103
|
-
const
|
|
3104
|
-
return
|
|
3282
|
+
), g.length === 0) {
|
|
3283
|
+
const p = /* @__PURE__ */ u(Tt, { onUploadingChange: l, children: /* @__PURE__ */ u(kt, { resumeSearch: s, children: /* @__PURE__ */ u(St, { caseSearch: a, children: /* @__PURE__ */ u(bt, { interactive: o, children: r }) }) }) });
|
|
3284
|
+
return c ? /* @__PURE__ */ u(Me, { children: p }) : p;
|
|
3105
3285
|
}
|
|
3106
|
-
const
|
|
3107
|
-
return
|
|
3286
|
+
const v = /* @__PURE__ */ u(Tt, { onUploadingChange: l, children: /* @__PURE__ */ u(kt, { resumeSearch: s, children: /* @__PURE__ */ u(St, { caseSearch: a, children: /* @__PURE__ */ u(bt, { interactive: o, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: g.map((p) => /* @__PURE__ */ u(pn, { surface: p }, p.id)) }) }) }) }) });
|
|
3287
|
+
return c ? /* @__PURE__ */ u(Me, { children: v }) : v;
|
|
3108
3288
|
}
|
|
3109
3289
|
);
|
|
3110
|
-
function
|
|
3111
|
-
return new
|
|
3290
|
+
function Be() {
|
|
3291
|
+
return new hn([Yn()]);
|
|
3112
3292
|
}
|
|
3113
|
-
function
|
|
3293
|
+
function ia({
|
|
3114
3294
|
messages: e,
|
|
3115
3295
|
surfaceId: t = "skopon-form-stream",
|
|
3116
3296
|
emptyHint: n = null,
|
|
@@ -3118,94 +3298,94 @@ function js({
|
|
|
3118
3298
|
resumeSearch: o = null,
|
|
3119
3299
|
caseSearch: i = null
|
|
3120
3300
|
}) {
|
|
3121
|
-
|
|
3122
|
-
|
|
3301
|
+
z(() => {
|
|
3302
|
+
yn(), gn();
|
|
3123
3303
|
}, []);
|
|
3124
|
-
const s =
|
|
3125
|
-
s.current === null && (s.current =
|
|
3126
|
-
const a =
|
|
3127
|
-
function d(
|
|
3128
|
-
s.current =
|
|
3304
|
+
const s = x(null);
|
|
3305
|
+
s.current === null && (s.current = Be());
|
|
3306
|
+
const a = x(0), l = x(""), c = x(!0), m = x(t);
|
|
3307
|
+
function d(v, p) {
|
|
3308
|
+
s.current = v, a.current = p.length, l.current = JSON.stringify(p), c.current && (T(v), C(Array.from(v.model.surfacesMap.values())));
|
|
3129
3309
|
}
|
|
3130
|
-
function
|
|
3310
|
+
function S(v, p) {
|
|
3131
3311
|
if (p <= 0) return !1;
|
|
3132
|
-
const
|
|
3133
|
-
if (!
|
|
3312
|
+
const k = JSON.stringify(v.slice(0, p)), I = l.current;
|
|
3313
|
+
if (!I) return !0;
|
|
3134
3314
|
try {
|
|
3135
|
-
const
|
|
3136
|
-
return JSON.stringify(
|
|
3315
|
+
const O = JSON.parse(I);
|
|
3316
|
+
return JSON.stringify(O.slice(0, p)) !== k;
|
|
3137
3317
|
} catch {
|
|
3138
3318
|
return !0;
|
|
3139
3319
|
}
|
|
3140
3320
|
}
|
|
3141
|
-
const [y,
|
|
3321
|
+
const [y, T] = w(
|
|
3142
3322
|
() => s.current
|
|
3143
|
-
), [g,
|
|
3323
|
+
), [g, C] = w(
|
|
3144
3324
|
() => Array.from(
|
|
3145
3325
|
s.current.model.surfacesMap.values()
|
|
3146
3326
|
)
|
|
3147
3327
|
);
|
|
3148
|
-
return
|
|
3149
|
-
|
|
3150
|
-
}), []),
|
|
3328
|
+
return z(() => (c.current = !0, () => {
|
|
3329
|
+
c.current = !1;
|
|
3330
|
+
}), []), z(() => {
|
|
3151
3331
|
s.current = y;
|
|
3152
|
-
}, [y]),
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3155
|
-
}, p = y.onSurfaceCreated(
|
|
3332
|
+
}, [y]), z(() => {
|
|
3333
|
+
const v = () => {
|
|
3334
|
+
c.current && C(Array.from(y.model.surfacesMap.values()));
|
|
3335
|
+
}, p = y.onSurfaceCreated(v), k = y.onSurfaceDeleted(v);
|
|
3156
3336
|
return () => {
|
|
3157
|
-
p.unsubscribe(),
|
|
3337
|
+
p.unsubscribe(), k.unsubscribe();
|
|
3158
3338
|
};
|
|
3159
|
-
}, [y]),
|
|
3160
|
-
let
|
|
3339
|
+
}, [y]), z(() => {
|
|
3340
|
+
let v = !1;
|
|
3161
3341
|
const p = m.current !== t;
|
|
3162
3342
|
if (m.current = t, p) {
|
|
3163
|
-
const
|
|
3164
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
3165
|
-
|
|
3343
|
+
const M = Be();
|
|
3344
|
+
return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), v || d(M, e)) : (s.current = M, a.current = 0, l.current = "", v || (T(M), C([]))), () => {
|
|
3345
|
+
v = !0;
|
|
3166
3346
|
};
|
|
3167
3347
|
}
|
|
3168
3348
|
if (!Array.isArray(e) || e.length === 0) {
|
|
3169
3349
|
if (a.current > 0) {
|
|
3170
|
-
const
|
|
3171
|
-
s.current =
|
|
3350
|
+
const M = Be();
|
|
3351
|
+
s.current = M, a.current = 0, l.current = "", v || (T(M), C([]));
|
|
3172
3352
|
}
|
|
3173
3353
|
return () => {
|
|
3174
|
-
|
|
3354
|
+
v = !0;
|
|
3175
3355
|
};
|
|
3176
3356
|
}
|
|
3177
|
-
const
|
|
3178
|
-
if (e.length <
|
|
3179
|
-
const
|
|
3180
|
-
return
|
|
3181
|
-
|
|
3357
|
+
const k = s.current, I = a.current;
|
|
3358
|
+
if (e.length < I || S(e, I)) {
|
|
3359
|
+
const M = Be();
|
|
3360
|
+
return M.processMessages(e), v || d(M, e), () => {
|
|
3361
|
+
v = !0;
|
|
3182
3362
|
};
|
|
3183
3363
|
}
|
|
3184
|
-
const
|
|
3185
|
-
return
|
|
3186
|
-
|
|
3187
|
-
} : (
|
|
3188
|
-
|
|
3364
|
+
const O = e.slice(I);
|
|
3365
|
+
return O.length === 0 ? () => {
|
|
3366
|
+
v = !0;
|
|
3367
|
+
} : (k.processMessages(O), a.current = e.length, l.current = JSON.stringify(e), v || C(Array.from(k.model.surfacesMap.values())), () => {
|
|
3368
|
+
v = !0;
|
|
3189
3369
|
});
|
|
3190
|
-
}, [e, t]), g.length === 0 ? /* @__PURE__ */
|
|
3370
|
+
}, [e, t]), g.length === 0 ? /* @__PURE__ */ u(Me, { children: n }) : /* @__PURE__ */ u(Me, { children: /* @__PURE__ */ u(Tt, { children: /* @__PURE__ */ u(kt, { resumeSearch: o, children: /* @__PURE__ */ u(St, { caseSearch: i, children: /* @__PURE__ */ u(bt, { interactive: r, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: g.map((v) => /* @__PURE__ */ u(pn, { surface: v }, v.id)) }) }) }) }) }) });
|
|
3191
3371
|
}
|
|
3192
|
-
const
|
|
3193
|
-
function
|
|
3372
|
+
const Cs = 100, As = 3e4, _s = 1500, ye = /* @__PURE__ */ new Map();
|
|
3373
|
+
function Ts(e) {
|
|
3194
3374
|
const t = e.trim();
|
|
3195
|
-
let n =
|
|
3196
|
-
return n || (n = new
|
|
3375
|
+
let n = ye.get(t);
|
|
3376
|
+
return n || (n = new xs(t), ye.set(t, n)), n.acquire(), n;
|
|
3197
3377
|
}
|
|
3198
|
-
class
|
|
3378
|
+
class xs {
|
|
3199
3379
|
constructor(t) {
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3380
|
+
X(this, "url");
|
|
3381
|
+
X(this, "ws", null);
|
|
3382
|
+
X(this, "refCount", 0);
|
|
3383
|
+
X(this, "connectRequested", !1);
|
|
3384
|
+
X(this, "reconnectAttempt", 0);
|
|
3385
|
+
X(this, "reconnectTimer", null);
|
|
3386
|
+
X(this, "releaseTimer", null);
|
|
3387
|
+
X(this, "sendQueue", []);
|
|
3388
|
+
X(this, "handlers", /* @__PURE__ */ new Map());
|
|
3209
3389
|
this.url = t;
|
|
3210
3390
|
}
|
|
3211
3391
|
acquire() {
|
|
@@ -3213,12 +3393,12 @@ class cs {
|
|
|
3213
3393
|
}
|
|
3214
3394
|
release() {
|
|
3215
3395
|
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
|
-
},
|
|
3396
|
+
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), ye.get(this.url) === this && ye.delete(this.url));
|
|
3397
|
+
}, _s));
|
|
3218
3398
|
}
|
|
3219
3399
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3220
3400
|
forceClose() {
|
|
3221
|
-
this.refCount = 0, this.teardown(),
|
|
3401
|
+
this.refCount = 0, this.teardown(), ye.get(this.url) === this && ye.delete(this.url);
|
|
3222
3402
|
}
|
|
3223
3403
|
subscribe(t, n) {
|
|
3224
3404
|
const r = t.trim();
|
|
@@ -3287,7 +3467,7 @@ class cs {
|
|
|
3287
3467
|
}
|
|
3288
3468
|
}
|
|
3289
3469
|
enqueue(t) {
|
|
3290
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3470
|
+
for (this.sendQueue.push(t); this.sendQueue.length > Cs; )
|
|
3291
3471
|
this.sendQueue.shift();
|
|
3292
3472
|
}
|
|
3293
3473
|
flushQueue() {
|
|
@@ -3301,7 +3481,7 @@ class cs {
|
|
|
3301
3481
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3302
3482
|
this.clearReconnectTimer();
|
|
3303
3483
|
const t = Math.min(
|
|
3304
|
-
|
|
3484
|
+
As,
|
|
3305
3485
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3306
3486
|
);
|
|
3307
3487
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3339,13 +3519,13 @@ class cs {
|
|
|
3339
3519
|
}
|
|
3340
3520
|
}
|
|
3341
3521
|
}
|
|
3342
|
-
class
|
|
3522
|
+
class Fs {
|
|
3343
3523
|
constructor(t) {
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3524
|
+
X(this, "askUserMessageId");
|
|
3525
|
+
X(this, "connection");
|
|
3526
|
+
X(this, "unsubscribe");
|
|
3527
|
+
X(this, "closed", !1);
|
|
3528
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Ts(t.url);
|
|
3349
3529
|
const n = t.onAutoControl;
|
|
3350
3530
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
3351
3531
|
};
|
|
@@ -3360,24 +3540,24 @@ class us {
|
|
|
3360
3540
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3361
3541
|
}
|
|
3362
3542
|
}
|
|
3363
|
-
function
|
|
3543
|
+
function Qn(e) {
|
|
3364
3544
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3365
3545
|
}
|
|
3366
|
-
function
|
|
3546
|
+
function Ms(e, t) {
|
|
3367
3547
|
if (!e) return !1;
|
|
3368
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3548
|
+
const n = e.querySelector(`[data-skopon-field="${Qn(t)}"]`);
|
|
3369
3549
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3370
3550
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3371
3551
|
) ?? n).focus(), !0) : !1;
|
|
3372
3552
|
}
|
|
3373
|
-
function
|
|
3553
|
+
function Is(e, t) {
|
|
3374
3554
|
if (!e) return !1;
|
|
3375
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3555
|
+
const n = e.querySelector(`[data-skopon-field="${Qn(t)}"]`);
|
|
3376
3556
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3377
3557
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3378
3558
|
) ?? n).click(), !0) : !1;
|
|
3379
3559
|
}
|
|
3380
|
-
function
|
|
3560
|
+
function Ns(e, t, n) {
|
|
3381
3561
|
const r = e.action;
|
|
3382
3562
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3383
3563
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3407,47 +3587,47 @@ function ps(e, t, n) {
|
|
|
3407
3587
|
return;
|
|
3408
3588
|
}
|
|
3409
3589
|
if (r === "focus") {
|
|
3410
|
-
|
|
3590
|
+
Ms(t.rootElement, o), n.reportEvent({
|
|
3411
3591
|
action: "focus",
|
|
3412
3592
|
component: i,
|
|
3413
3593
|
field: o
|
|
3414
3594
|
});
|
|
3415
3595
|
return;
|
|
3416
3596
|
}
|
|
3417
|
-
|
|
3597
|
+
Is(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3418
3598
|
});
|
|
3419
3599
|
}
|
|
3420
|
-
function
|
|
3600
|
+
function Es(e) {
|
|
3421
3601
|
const t = {};
|
|
3422
3602
|
for (const [n, r] of Object.entries(e))
|
|
3423
3603
|
r !== void 0 && (t[n] = r);
|
|
3424
3604
|
return t;
|
|
3425
3605
|
}
|
|
3426
|
-
function
|
|
3606
|
+
function Us(e, t) {
|
|
3427
3607
|
var o;
|
|
3428
3608
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3429
3609
|
if (!n || !t) return { ...e };
|
|
3430
3610
|
const r = t.get(n);
|
|
3431
3611
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3432
3612
|
}
|
|
3433
|
-
function
|
|
3613
|
+
function ws(e) {
|
|
3434
3614
|
var i, s;
|
|
3435
3615
|
const n = {
|
|
3436
3616
|
blocks: (e.blocks ?? []).map(
|
|
3437
|
-
(a) =>
|
|
3617
|
+
(a) => Us(a, e.liveOptions)
|
|
3438
3618
|
)
|
|
3439
3619
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3440
3620
|
return r && (n.title = r), o && (n.description = o), {
|
|
3441
3621
|
form_schema: n,
|
|
3442
|
-
form_values:
|
|
3622
|
+
form_values: Es(e.values ?? {}),
|
|
3443
3623
|
form_change: [...e.formChange ?? []]
|
|
3444
3624
|
};
|
|
3445
3625
|
}
|
|
3446
|
-
function
|
|
3447
|
-
const t =
|
|
3448
|
-
return t ?
|
|
3626
|
+
function Rs(e) {
|
|
3627
|
+
const t = Ke(e);
|
|
3628
|
+
return t ? je(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3449
3629
|
}
|
|
3450
|
-
function
|
|
3630
|
+
function Ps({
|
|
3451
3631
|
payload: e,
|
|
3452
3632
|
callbackUrl: t,
|
|
3453
3633
|
title: n,
|
|
@@ -3457,70 +3637,70 @@ function vs({
|
|
|
3457
3637
|
submitHeaders: s,
|
|
3458
3638
|
onNotify: a
|
|
3459
3639
|
}) {
|
|
3460
|
-
const [l,
|
|
3461
|
-
|
|
3640
|
+
const [l, c] = w(!1), m = x(!0);
|
|
3641
|
+
z(() => (m.current = !0, () => {
|
|
3462
3642
|
m.current = !1;
|
|
3463
3643
|
}), []);
|
|
3464
|
-
const d =
|
|
3465
|
-
() =>
|
|
3644
|
+
const d = j(
|
|
3645
|
+
() => Rt(s),
|
|
3466
3646
|
[s]
|
|
3467
|
-
),
|
|
3468
|
-
() =>
|
|
3647
|
+
), S = j(
|
|
3648
|
+
() => Ln(e, t, d),
|
|
3469
3649
|
[e, t, d]
|
|
3470
|
-
), y =
|
|
3650
|
+
), y = j(
|
|
3471
3651
|
() => ({
|
|
3472
3652
|
...i,
|
|
3473
3653
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
3474
3654
|
}),
|
|
3475
3655
|
[i, t]
|
|
3476
3656
|
);
|
|
3477
|
-
async function
|
|
3657
|
+
async function T() {
|
|
3478
3658
|
if (!l) {
|
|
3479
|
-
|
|
3659
|
+
c(!0);
|
|
3480
3660
|
try {
|
|
3481
|
-
const g =
|
|
3661
|
+
const g = Rs(e), C = Ot({
|
|
3482
3662
|
context: y,
|
|
3483
3663
|
payload: e,
|
|
3484
3664
|
answer: g
|
|
3485
|
-
}),
|
|
3665
|
+
}), v = await jn(C, {
|
|
3486
3666
|
headers: d
|
|
3487
3667
|
});
|
|
3488
3668
|
if (!m.current) return;
|
|
3489
|
-
const p =
|
|
3669
|
+
const p = $n(v);
|
|
3490
3670
|
a == null || a(p.type, p.message);
|
|
3491
3671
|
} catch (g) {
|
|
3492
3672
|
if (!m.current) return;
|
|
3493
|
-
const
|
|
3494
|
-
a == null || a("error",
|
|
3673
|
+
const C = g instanceof Error ? g.message : "提交失败";
|
|
3674
|
+
a == null || a("error", C);
|
|
3495
3675
|
} finally {
|
|
3496
|
-
m.current &&
|
|
3676
|
+
m.current && c(!1);
|
|
3497
3677
|
}
|
|
3498
3678
|
}
|
|
3499
3679
|
}
|
|
3500
|
-
return /* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3504
|
-
r ? /* @__PURE__ */
|
|
3505
|
-
o ? /* @__PURE__ */
|
|
3680
|
+
return /* @__PURE__ */ U("div", { className: "ask-user-curl-card", children: [
|
|
3681
|
+
/* @__PURE__ */ U("div", { className: "ask-user-curl-card-header", children: [
|
|
3682
|
+
/* @__PURE__ */ U("div", { className: "ask-user-curl-card-header-title", children: [
|
|
3683
|
+
/* @__PURE__ */ u(re.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3684
|
+
r ? /* @__PURE__ */ u(ve, { title: r, children: /* @__PURE__ */ u(Ae, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3685
|
+
o ? /* @__PURE__ */ u(ve, { title: o, children: /* @__PURE__ */ u(Ae, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3506
3686
|
] }),
|
|
3507
|
-
/* @__PURE__ */
|
|
3508
|
-
|
|
3687
|
+
/* @__PURE__ */ u(ve, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ u(
|
|
3688
|
+
Ie,
|
|
3509
3689
|
{
|
|
3510
3690
|
size: "small",
|
|
3511
3691
|
type: "text",
|
|
3512
3692
|
loading: l,
|
|
3513
3693
|
disabled: l,
|
|
3514
|
-
onClick: () => void
|
|
3694
|
+
onClick: () => void T(),
|
|
3515
3695
|
children: "提交"
|
|
3516
3696
|
}
|
|
3517
3697
|
) })
|
|
3518
3698
|
] }),
|
|
3519
|
-
/* @__PURE__ */
|
|
3699
|
+
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: S })
|
|
3520
3700
|
] });
|
|
3521
3701
|
}
|
|
3522
|
-
const
|
|
3523
|
-
function
|
|
3702
|
+
const zs = 80;
|
|
3703
|
+
function Os(e, t) {
|
|
3524
3704
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3525
3705
|
const n = t.message;
|
|
3526
3706
|
if (typeof n == "string" && n.trim())
|
|
@@ -3528,7 +3708,7 @@ function Ss(e, t) {
|
|
|
3528
3708
|
}
|
|
3529
3709
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3530
3710
|
}
|
|
3531
|
-
function
|
|
3711
|
+
function Bs({
|
|
3532
3712
|
payload: e,
|
|
3533
3713
|
formUniqueId: t,
|
|
3534
3714
|
askUserMessageId: n,
|
|
@@ -3538,263 +3718,269 @@ function ks({
|
|
|
3538
3718
|
submitHeaders: s,
|
|
3539
3719
|
fetchFormDetail: a,
|
|
3540
3720
|
onNotify: l,
|
|
3541
|
-
resumeSearch:
|
|
3721
|
+
resumeSearch: c = null,
|
|
3542
3722
|
caseSearch: m = null,
|
|
3543
3723
|
onSurfaceReadyChange: d,
|
|
3544
|
-
onAutoControlReady:
|
|
3724
|
+
onAutoControlReady: S
|
|
3545
3725
|
}) {
|
|
3546
|
-
const [y,
|
|
3547
|
-
|
|
3548
|
-
const
|
|
3549
|
-
() =>
|
|
3726
|
+
const [y, T] = w(null), [g, C] = w(!1), [v, p] = w(!0), [k, I] = w(!1), [O, M] = w(!1), $ = x(null), H = x(null), N = x(!0), A = x(l);
|
|
3727
|
+
A.current = l;
|
|
3728
|
+
const Y = Fn(), G = It(), W = x(""), L = x(null), D = (t == null ? void 0 : t.trim()) ?? "", ie = (n == null ? void 0 : n.trim()) ?? "", oe = j(
|
|
3729
|
+
() => Rt(s),
|
|
3550
3730
|
[s]
|
|
3551
|
-
),
|
|
3731
|
+
), _ = j(
|
|
3552
3732
|
() => ({
|
|
3553
3733
|
...i,
|
|
3554
3734
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3555
3735
|
}),
|
|
3556
3736
|
[i, r]
|
|
3557
3737
|
);
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
}), []),
|
|
3561
|
-
let
|
|
3562
|
-
return
|
|
3563
|
-
|
|
3564
|
-
}).catch((
|
|
3565
|
-
var
|
|
3566
|
-
if (!
|
|
3567
|
-
|
|
3568
|
-
const
|
|
3569
|
-
(
|
|
3738
|
+
z(() => (N.current = !0, () => {
|
|
3739
|
+
N.current = !1, L.current != null && (clearTimeout(L.current), L.current = null);
|
|
3740
|
+
}), []), z(() => {
|
|
3741
|
+
let P = !1;
|
|
3742
|
+
return D ? (p(!0), C(!1), a({ formUniqueId: D }).then((V) => {
|
|
3743
|
+
P || (C(!!V.disabled), T(V.formDefinition ?? null));
|
|
3744
|
+
}).catch((V) => {
|
|
3745
|
+
var Q;
|
|
3746
|
+
if (!P) {
|
|
3747
|
+
C(!1), T(null);
|
|
3748
|
+
const Pe = V instanceof Error ? V.message : "获取表单定义失败";
|
|
3749
|
+
(Q = A.current) == null || Q.call(A, "error", Pe);
|
|
3570
3750
|
}
|
|
3571
3751
|
}).finally(() => {
|
|
3572
|
-
|
|
3752
|
+
P || p(!1);
|
|
3573
3753
|
}), () => {
|
|
3574
|
-
|
|
3575
|
-
}) : (p(!1),
|
|
3576
|
-
|
|
3754
|
+
P = !0;
|
|
3755
|
+
}) : (p(!1), C(!1), T(null), () => {
|
|
3756
|
+
P = !0;
|
|
3577
3757
|
});
|
|
3578
|
-
}, [
|
|
3579
|
-
const
|
|
3580
|
-
if (
|
|
3581
|
-
return
|
|
3582
|
-
const
|
|
3583
|
-
return { ...
|
|
3584
|
-
((
|
|
3585
|
-
(
|
|
3758
|
+
}, [D, a]);
|
|
3759
|
+
const h = j(() => Ke(e), [e]), b = j(() => h ? fi(h, y ?? void 0) : null, [h, y]), R = (b == null ? void 0 : b.matchedBlocks) ?? [], F = !!(h && pi(h) && R.length === 0), E = j(() => F && h ? hi(h) : b && b.renderBlocks.length > 0 ? b.renderBlocks : [], [b, F, h]), J = j(() => {
|
|
3760
|
+
if (F && h)
|
|
3761
|
+
return gi(h);
|
|
3762
|
+
const P = je((b == null ? void 0 : b.extraBlocks) ?? []);
|
|
3763
|
+
return { ...je(
|
|
3764
|
+
((b == null ? void 0 : b.matchedBlocks) ?? []).filter(
|
|
3765
|
+
(Q) => Q.type === "text" && Q.hidden === !0
|
|
3586
3766
|
)
|
|
3587
|
-
), ...
|
|
3588
|
-
}, [
|
|
3589
|
-
() =>
|
|
3590
|
-
var
|
|
3591
|
-
return
|
|
3592
|
-
}).map((
|
|
3593
|
-
[
|
|
3594
|
-
),
|
|
3595
|
-
{ title:
|
|
3596
|
-
|
|
3597
|
-
), [
|
|
3598
|
-
if (!
|
|
3767
|
+
), ...P };
|
|
3768
|
+
}, [F, h, b]), te = j(
|
|
3769
|
+
() => E.filter((P) => {
|
|
3770
|
+
var V;
|
|
3771
|
+
return ee(P.type) && ((V = P.name) == null ? void 0 : V.trim());
|
|
3772
|
+
}).map((P) => P.name.trim()),
|
|
3773
|
+
[E]
|
|
3774
|
+
), 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 = j(() => E.length === 0 ? null : si(
|
|
3775
|
+
{ title: se, description: pe },
|
|
3776
|
+
E
|
|
3777
|
+
), [se, pe, E]), Ze = j(() => {
|
|
3778
|
+
if (!he) return "";
|
|
3599
3779
|
try {
|
|
3600
|
-
return JSON.stringify(
|
|
3780
|
+
return JSON.stringify(he);
|
|
3601
3781
|
} 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:
|
|
3782
|
+
return String(he);
|
|
3783
|
+
}
|
|
3784
|
+
}, [he]), et = D ? `ask-user-${D}` : "ask-user-payload", ae = !!(!v && h && E.length > 0 && he);
|
|
3785
|
+
z(() => (d(ae), () => d(!1)), [ae, d]);
|
|
3786
|
+
const Lt = q(() => {
|
|
3787
|
+
var V;
|
|
3788
|
+
return { ...((V = $.current) == null ? void 0 : V.getValues(te)) ?? {}, ...J };
|
|
3789
|
+
}, [te, J]), qt = x(G.liveOptions);
|
|
3790
|
+
qt.current = G.liveOptions;
|
|
3791
|
+
const tt = x(G.pendingChangeFields);
|
|
3792
|
+
tt.current = G.pendingChangeFields;
|
|
3793
|
+
const ke = q(
|
|
3794
|
+
(P) => {
|
|
3795
|
+
const V = ws({
|
|
3796
|
+
title: se,
|
|
3797
|
+
description: pe,
|
|
3798
|
+
blocks: E,
|
|
3799
|
+
values: Lt(),
|
|
3800
|
+
liveOptions: qt.current,
|
|
3801
|
+
formChange: P
|
|
3622
3802
|
});
|
|
3623
|
-
|
|
3803
|
+
Y.reportData(V);
|
|
3624
3804
|
},
|
|
3625
|
-
[
|
|
3626
|
-
),
|
|
3627
|
-
|
|
3628
|
-
if (!
|
|
3629
|
-
|
|
3805
|
+
[se, pe, E, Lt, Y]
|
|
3806
|
+
), nt = x(ke);
|
|
3807
|
+
nt.current = ke, z(() => {
|
|
3808
|
+
if (!ae) {
|
|
3809
|
+
W.current = "";
|
|
3630
3810
|
return;
|
|
3631
3811
|
}
|
|
3632
|
-
if (!
|
|
3633
|
-
const
|
|
3634
|
-
if (
|
|
3635
|
-
const
|
|
3636
|
-
|
|
3812
|
+
if (!Ze) return;
|
|
3813
|
+
const P = `${et}::${Ze}`;
|
|
3814
|
+
if (W.current === P) return;
|
|
3815
|
+
const V = setTimeout(() => {
|
|
3816
|
+
N.current && W.current !== P && (W.current = P, nt.current([]));
|
|
3637
3817
|
}, 0);
|
|
3638
|
-
return () => clearTimeout(
|
|
3639
|
-
}, [
|
|
3640
|
-
if (!(!
|
|
3641
|
-
return
|
|
3642
|
-
if (
|
|
3643
|
-
const
|
|
3644
|
-
|
|
3645
|
-
},
|
|
3646
|
-
|
|
3818
|
+
return () => clearTimeout(V);
|
|
3819
|
+
}, [ae, et, Ze]), z(() => {
|
|
3820
|
+
if (!(!ae || G.version === 0) && tt.current.length !== 0)
|
|
3821
|
+
return L.current != null && clearTimeout(L.current), L.current = setTimeout(() => {
|
|
3822
|
+
if (L.current = null, !N.current) return;
|
|
3823
|
+
const P = [...tt.current];
|
|
3824
|
+
G.clearPendingChangeFields(), P.length !== 0 && nt.current(P);
|
|
3825
|
+
}, zs), () => {
|
|
3826
|
+
L.current != null && (clearTimeout(L.current), L.current = null);
|
|
3647
3827
|
};
|
|
3648
|
-
}, [
|
|
3649
|
-
const
|
|
3650
|
-
var
|
|
3651
|
-
if (!
|
|
3652
|
-
|
|
3828
|
+
}, [ae, G.version, G.clearPendingChangeFields]);
|
|
3829
|
+
const rt = q(async () => {
|
|
3830
|
+
var P, V, Q, Pe, jt, Dt, Ht, Kt, Wt;
|
|
3831
|
+
if (!k) {
|
|
3832
|
+
if (O) {
|
|
3833
|
+
(P = A.current) == null || P.call(A, "error", "文件正在上传,请稍候");
|
|
3834
|
+
return;
|
|
3835
|
+
}
|
|
3836
|
+
I(!0);
|
|
3653
3837
|
try {
|
|
3654
|
-
const
|
|
3655
|
-
if (
|
|
3656
|
-
(
|
|
3838
|
+
const Ce = { ...((V = $.current) == null ? void 0 : V.getValues(te)) ?? {}, ...J }, Gt = Vi(E, Ce);
|
|
3839
|
+
if (Gt) {
|
|
3840
|
+
(Q = A.current) == null || Q.call(A, "error", Gt.message);
|
|
3657
3841
|
return;
|
|
3658
3842
|
}
|
|
3659
3843
|
if (o === "post") {
|
|
3660
|
-
const
|
|
3661
|
-
if (!
|
|
3662
|
-
(
|
|
3844
|
+
const Xt = (r ?? "").trim();
|
|
3845
|
+
if (!Xt) {
|
|
3846
|
+
(Pe = A.current) == null || Pe.call(A, "error", "callback_url 为空,无法提交");
|
|
3663
3847
|
return;
|
|
3664
3848
|
}
|
|
3665
|
-
|
|
3849
|
+
ke([]), Y.reportEvent({
|
|
3666
3850
|
action: "submit",
|
|
3667
3851
|
component: "SubmitButton"
|
|
3668
3852
|
});
|
|
3669
|
-
const
|
|
3670
|
-
headers:
|
|
3853
|
+
const it = await qn(Xt, Ce, {
|
|
3854
|
+
headers: oe
|
|
3671
3855
|
});
|
|
3672
|
-
if (!
|
|
3673
|
-
|
|
3856
|
+
if (!N.current) return;
|
|
3857
|
+
it.ok ? (jt = A.current) == null || jt.call(A, "success", "提交成功") : (Dt = A.current) == null || Dt.call(A, "error", Os(it.status, it.body));
|
|
3674
3858
|
return;
|
|
3675
3859
|
}
|
|
3676
|
-
const
|
|
3677
|
-
title:
|
|
3678
|
-
description:
|
|
3679
|
-
blocks:
|
|
3680
|
-
} :
|
|
3681
|
-
context:
|
|
3860
|
+
const Xn = E.length > 0 ? {
|
|
3861
|
+
title: se,
|
|
3862
|
+
description: pe,
|
|
3863
|
+
blocks: E
|
|
3864
|
+
} : h ?? void 0, Jt = Ot({
|
|
3865
|
+
context: _,
|
|
3682
3866
|
payload: e,
|
|
3683
|
-
form:
|
|
3684
|
-
answer:
|
|
3685
|
-
}),
|
|
3686
|
-
if (
|
|
3687
|
-
(
|
|
3867
|
+
form: Xn,
|
|
3868
|
+
answer: Ce
|
|
3869
|
+
}), Yt = Bt(Jt);
|
|
3870
|
+
if (Yt) {
|
|
3871
|
+
(Ht = A.current) == null || Ht.call(A, "error", Yt);
|
|
3688
3872
|
return;
|
|
3689
3873
|
}
|
|
3690
|
-
|
|
3874
|
+
ke([]), Y.reportEvent({
|
|
3691
3875
|
action: "submit",
|
|
3692
3876
|
component: "SubmitButton"
|
|
3693
3877
|
});
|
|
3694
|
-
const
|
|
3695
|
-
headers:
|
|
3878
|
+
const Zn = await jn(Jt, {
|
|
3879
|
+
headers: oe
|
|
3696
3880
|
});
|
|
3697
|
-
if (!
|
|
3698
|
-
const
|
|
3699
|
-
(
|
|
3700
|
-
} catch (
|
|
3701
|
-
if (!
|
|
3702
|
-
const
|
|
3703
|
-
(
|
|
3881
|
+
if (!N.current) return;
|
|
3882
|
+
const Qt = $n(Zn);
|
|
3883
|
+
(Kt = A.current) == null || Kt.call(A, Qt.type, Qt.message);
|
|
3884
|
+
} catch (ot) {
|
|
3885
|
+
if (!N.current) return;
|
|
3886
|
+
const Ce = ot instanceof Error ? ot.message : "提交失败";
|
|
3887
|
+
(Wt = A.current) == null || Wt.call(A, "error", Ce);
|
|
3704
3888
|
} finally {
|
|
3705
|
-
|
|
3889
|
+
N.current && I(!1);
|
|
3706
3890
|
}
|
|
3707
3891
|
}
|
|
3708
3892
|
}, [
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3893
|
+
k,
|
|
3894
|
+
O,
|
|
3895
|
+
te,
|
|
3896
|
+
E,
|
|
3897
|
+
se,
|
|
3898
|
+
pe,
|
|
3899
|
+
J,
|
|
3900
|
+
ke,
|
|
3901
|
+
Y,
|
|
3717
3902
|
o,
|
|
3718
3903
|
r,
|
|
3719
|
-
|
|
3720
|
-
|
|
3904
|
+
oe,
|
|
3905
|
+
_,
|
|
3721
3906
|
e,
|
|
3722
|
-
|
|
3723
|
-
]),
|
|
3724
|
-
|
|
3725
|
-
const
|
|
3726
|
-
(
|
|
3727
|
-
|
|
3728
|
-
|
|
3907
|
+
h
|
|
3908
|
+
]), Vt = x(rt);
|
|
3909
|
+
Vt.current = rt;
|
|
3910
|
+
const $t = q(
|
|
3911
|
+
(P) => {
|
|
3912
|
+
Ns(
|
|
3913
|
+
P,
|
|
3729
3914
|
{
|
|
3730
|
-
setValues: (
|
|
3731
|
-
var
|
|
3732
|
-
return (
|
|
3915
|
+
setValues: (V) => {
|
|
3916
|
+
var Q;
|
|
3917
|
+
return (Q = $.current) == null ? void 0 : Q.setValues(V);
|
|
3733
3918
|
},
|
|
3734
|
-
getValues: (
|
|
3735
|
-
var
|
|
3736
|
-
return ((
|
|
3919
|
+
getValues: (V) => {
|
|
3920
|
+
var Q;
|
|
3921
|
+
return ((Q = $.current) == null ? void 0 : Q.getValues(V)) ?? {};
|
|
3737
3922
|
},
|
|
3738
|
-
submit: () =>
|
|
3739
|
-
rootElement:
|
|
3923
|
+
submit: () => Vt.current(),
|
|
3924
|
+
rootElement: H.current
|
|
3740
3925
|
},
|
|
3741
3926
|
{
|
|
3742
|
-
reportEvent:
|
|
3743
|
-
runAutoControl:
|
|
3927
|
+
reportEvent: Y.reportEvent,
|
|
3928
|
+
runAutoControl: Y.runAutoControl
|
|
3744
3929
|
}
|
|
3745
3930
|
);
|
|
3746
3931
|
},
|
|
3747
|
-
[
|
|
3932
|
+
[Y]
|
|
3748
3933
|
);
|
|
3749
|
-
return
|
|
3750
|
-
if (!
|
|
3751
|
-
|
|
3934
|
+
return z(() => {
|
|
3935
|
+
if (!ae) {
|
|
3936
|
+
S(null);
|
|
3752
3937
|
return;
|
|
3753
3938
|
}
|
|
3754
|
-
return
|
|
3755
|
-
}, [
|
|
3756
|
-
|
|
3939
|
+
return S($t), () => S(null);
|
|
3940
|
+
}, [ae, $t, S]), v ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(xt, { size: "small" }) }) : !h || E.length === 0 ? /* @__PURE__ */ u(
|
|
3941
|
+
Ps,
|
|
3757
3942
|
{
|
|
3758
3943
|
payload: e,
|
|
3759
3944
|
callbackUrl: r,
|
|
3760
|
-
answerAgentContext:
|
|
3945
|
+
answerAgentContext: _,
|
|
3761
3946
|
submitHeaders: s,
|
|
3762
|
-
unpublishedFormId: g &&
|
|
3947
|
+
unpublishedFormId: g && D ? D : void 0,
|
|
3763
3948
|
onNotify: l
|
|
3764
3949
|
}
|
|
3765
|
-
) : /* @__PURE__ */
|
|
3950
|
+
) : /* @__PURE__ */ U(
|
|
3766
3951
|
"div",
|
|
3767
3952
|
{
|
|
3768
3953
|
className: "ask-user-form-card",
|
|
3769
|
-
ref:
|
|
3770
|
-
"data-ask-user-message-id":
|
|
3954
|
+
ref: H,
|
|
3955
|
+
"data-ask-user-message-id": ie || void 0,
|
|
3771
3956
|
children: [
|
|
3772
|
-
g &&
|
|
3773
|
-
/* @__PURE__ */
|
|
3774
|
-
|
|
3957
|
+
g && D ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(ve, { title: D, children: /* @__PURE__ */ u(Ae, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3958
|
+
/* @__PURE__ */ u(
|
|
3959
|
+
ks,
|
|
3775
3960
|
{
|
|
3776
|
-
ref:
|
|
3777
|
-
doc:
|
|
3778
|
-
surfaceId:
|
|
3779
|
-
fieldNames:
|
|
3961
|
+
ref: $,
|
|
3962
|
+
doc: he,
|
|
3963
|
+
surfaceId: et,
|
|
3964
|
+
fieldNames: te,
|
|
3780
3965
|
interactive: !0,
|
|
3781
3966
|
wrapProvider: !1,
|
|
3782
|
-
resumeSearch:
|
|
3783
|
-
caseSearch: m
|
|
3967
|
+
resumeSearch: c,
|
|
3968
|
+
caseSearch: m,
|
|
3969
|
+
onUploadingChange: M
|
|
3784
3970
|
}
|
|
3785
3971
|
),
|
|
3786
|
-
/* @__PURE__ */
|
|
3787
|
-
|
|
3972
|
+
/* @__PURE__ */ u("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ u(
|
|
3973
|
+
ve,
|
|
3788
3974
|
{
|
|
3789
3975
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3790
|
-
children: /* @__PURE__ */
|
|
3791
|
-
|
|
3976
|
+
children: /* @__PURE__ */ u(
|
|
3977
|
+
Ie,
|
|
3792
3978
|
{
|
|
3793
3979
|
type: "primary",
|
|
3794
3980
|
size: "small",
|
|
3795
|
-
loading:
|
|
3796
|
-
disabled:
|
|
3797
|
-
onClick: () => void
|
|
3981
|
+
loading: k,
|
|
3982
|
+
disabled: k || O,
|
|
3983
|
+
onClick: () => void rt(),
|
|
3798
3984
|
children: "提交"
|
|
3799
3985
|
}
|
|
3800
3986
|
)
|
|
@@ -3804,16 +3990,16 @@ function ks({
|
|
|
3804
3990
|
}
|
|
3805
3991
|
);
|
|
3806
3992
|
}
|
|
3807
|
-
function
|
|
3808
|
-
var
|
|
3809
|
-
const t = ((
|
|
3993
|
+
function sa(e) {
|
|
3994
|
+
var c;
|
|
3995
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = j(() => Fi(), []), [r, o] = w(!1), i = x(null), s = q((m) => {
|
|
3810
3996
|
o(m);
|
|
3811
|
-
}, []), a =
|
|
3997
|
+
}, []), a = q(
|
|
3812
3998
|
(m) => {
|
|
3813
3999
|
i.current = m;
|
|
3814
4000
|
},
|
|
3815
4001
|
[]
|
|
3816
|
-
), l =
|
|
4002
|
+
), l = j(() => !n || !t ? null : new Fs({
|
|
3817
4003
|
url: n,
|
|
3818
4004
|
askUserMessageId: t,
|
|
3819
4005
|
onAutoControl: (m) => {
|
|
@@ -3821,15 +4007,15 @@ function $s(e) {
|
|
|
3821
4007
|
(d = i.current) == null || d.call(i, m);
|
|
3822
4008
|
}
|
|
3823
4009
|
}), [n, t]);
|
|
3824
|
-
return
|
|
4010
|
+
return z(() => {
|
|
3825
4011
|
if (l)
|
|
3826
4012
|
return () => {
|
|
3827
4013
|
l.close();
|
|
3828
4014
|
};
|
|
3829
|
-
}, [l]),
|
|
4015
|
+
}, [l]), z(() => {
|
|
3830
4016
|
!l || !r || l.connect();
|
|
3831
|
-
}, [l, r]), /* @__PURE__ */
|
|
3832
|
-
|
|
4017
|
+
}, [l, r]), /* @__PURE__ */ u(Me, { children: /* @__PURE__ */ u(fo, { client: l, children: /* @__PURE__ */ u(lo, { children: /* @__PURE__ */ u(
|
|
4018
|
+
Bs,
|
|
3833
4019
|
{
|
|
3834
4020
|
...e,
|
|
3835
4021
|
onSurfaceReadyChange: s,
|
|
@@ -3838,77 +4024,80 @@ function $s(e) {
|
|
|
3838
4024
|
) }) }) });
|
|
3839
4025
|
}
|
|
3840
4026
|
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
|
-
|
|
4027
|
+
Ys as A2UI_PROTOCOL_VERSION,
|
|
4028
|
+
sa as AskUserFormCard,
|
|
4029
|
+
St as CaseSearchProvider,
|
|
4030
|
+
Ps as CurlSubmitBlock,
|
|
4031
|
+
Ai as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
4032
|
+
Si as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
4033
|
+
ki as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
4034
|
+
Ci as DEFAULT_AUTH_SKOPON_API_BASE_URL_FIELD,
|
|
4035
|
+
Ge as DEFAULT_AUTH_STORAGE_KEY,
|
|
4036
|
+
bi as DEFAULT_AUTH_TOKEN_FIELD,
|
|
4037
|
+
Oe as DEFAULT_SKOPON_API_BASE_PATH,
|
|
4038
|
+
Cr as FORM_MEDIA_SIZES,
|
|
4039
|
+
vt as FORM_WEB_DEFAULT_HEIGHT,
|
|
4040
|
+
_r as FORM_WEB_MAX_HEIGHT,
|
|
4041
|
+
Ar as FORM_WEB_MIN_HEIGHT,
|
|
4042
|
+
kt as ResumeSearchProvider,
|
|
4043
|
+
ia as SkoponA2uiStreamRenderer,
|
|
4044
|
+
Me as SkoponFormProvider,
|
|
4045
|
+
ks as SkoponFormRenderer,
|
|
4046
|
+
ri as a2uiToBlocks,
|
|
4047
|
+
Rn as blocksToA2ui,
|
|
4048
|
+
no as blocksToJsonSchema,
|
|
4049
|
+
Ot as buildAnswerAgentBody,
|
|
4050
|
+
yi as buildAskUserCurlBodyJson,
|
|
4051
|
+
vi as buildAskUserCurlStatement,
|
|
4052
|
+
ta as buildAskUserSubmitCurlFromPayload,
|
|
4053
|
+
si as buildAskUserSurface,
|
|
4054
|
+
Ln as buildCurlStatement,
|
|
4055
|
+
we as coerceToggleValue,
|
|
4056
|
+
na as copyTextToClipboard,
|
|
4057
|
+
Li as createCaseSearchClient,
|
|
4058
|
+
Zs as createEmptyBlock,
|
|
4059
|
+
Xs as createEmptyFormDefinition,
|
|
4060
|
+
Mi as createFormClient,
|
|
4061
|
+
Pi as createResumeSearchClient,
|
|
4062
|
+
oa as createSkoponSdkClients,
|
|
4063
|
+
je as extractExtraBlockValues,
|
|
4064
|
+
li as extractSurfaceValues,
|
|
4065
|
+
$n as formatAnswerAgentSubmitMessage,
|
|
4066
|
+
gi as getPayloadHiddenBlockValues,
|
|
4067
|
+
ea as getPayloadInputFieldNames,
|
|
4068
|
+
hi as getPayloadRenderableBlocks,
|
|
4069
|
+
fi as intersectPayloadBlocksWithForm,
|
|
4070
|
+
_t as isA2uiSurfaceEmpty,
|
|
4071
|
+
bn as isDisplayBlockType,
|
|
4072
|
+
ee as isInputBlockType,
|
|
4073
|
+
vn as isLayoutBlockType,
|
|
4074
|
+
_e as isMediaBlockType,
|
|
4075
|
+
Sn as isOptionsBlockType,
|
|
4076
|
+
Tr as isSupportedWebUrl,
|
|
4077
|
+
Te as isWebBlockType,
|
|
4078
|
+
ai as mapFormDefinitionFromDto,
|
|
4079
|
+
De as normalizeFormDefinition,
|
|
4080
|
+
ge as normalizeMultiselectCount,
|
|
3893
4081
|
Ne as normalizeWebHeight,
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
4082
|
+
Ke as parsePayloadBlocksJson,
|
|
4083
|
+
pi as payloadHasInputBlocks,
|
|
4084
|
+
xi as resolveAnswerAgentCallbackUrl,
|
|
4085
|
+
zt as resolveClientHeaders,
|
|
4086
|
+
Fi as resolveRealtimeWsUrl,
|
|
4087
|
+
eo as resolveSchemaDefaultValue,
|
|
4088
|
+
_i as resolveSkoponApiBaseUrl,
|
|
4089
|
+
Pt as resolveSkoponAuthHeaders,
|
|
4090
|
+
Rt as resolveSubmitAuthHeaders,
|
|
4091
|
+
ii as resolveSurfaceFromFormDefinition,
|
|
4092
|
+
Ss as skoponAntdTheme,
|
|
4093
|
+
le as skoponBrandColors,
|
|
4094
|
+
jn as submitAnswerAgent,
|
|
4095
|
+
qn as submitFormJson,
|
|
4096
|
+
Qs as supportsDefaultValue,
|
|
4097
|
+
oi as surfaceDocToMessages,
|
|
4098
|
+
xe as syncFormDefinition,
|
|
4099
|
+
yo as useCaseSearch,
|
|
4100
|
+
Fo as useResumeSearch,
|
|
4101
|
+
Bt as validateAnswerAgentBody,
|
|
4102
|
+
ra as validateAnswerAgentContext
|
|
3914
4103
|
};
|