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