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