aibox-custom-component-packages 0.0.22 → 0.0.24

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.
@@ -0,0 +1,2310 @@
1
+ import { r as e, t } from "./chunk.EU29TkMc.js";
2
+ import { t as n } from "./withinstall.dLh4K-0g.js";
3
+ import { m as r } from "./i18n.CgtinrDD.js";
4
+ import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
5
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, guardReactiveProps as f, h as p, markRaw as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onMounted as b, onUnmounted as x, openBlock as S, popScopeId as C, pushScopeId as w, ref as T, renderList as E, renderSlot as D, resolveComponent as O, resolveDirective as k, resolveDynamicComponent as A, shallowReactive as j, toDisplayString as M, toHandlers as N, unref as P, useAttrs as F, watch as I, withCtx as L, withDirectives as ee, withModifiers as R, withScopeId as z } from "vue";
6
+ import { ElAutoResizer as te, ElCheckbox as B, ElIcon as V, ElInput as ne, ElSegmented as H, ElTreeV2 as re } from "element-plus";
7
+ import { CaretRight as ie, Empty as ae, FeishuLocalUploadDoc as oe, FeishuLocalUploadImg as se, FeishuLocalUploadPdf as ce, FeishuLocalUploadPpt as U, FeishuLocalUploadTxt as le, FeishuLocalUploadXlsx as W, IconDelete as ue, IconFeishuDoc as de, IconFeishuExcel as G, IconFeishuKnowledge as fe, IconFeishuMulitTable as pe, Seach as K } from "color-message-aibox-vue";
8
+ import { IconEmpty as q } from "color-star-custom-components";
9
+ import me from "mitt";
10
+ import '../assets/DocSyncSelect.css';//#region components/DocSyncSelect/config.js
11
+ var J = {
12
+ label: "name",
13
+ children: "children",
14
+ value: "id"
15
+ }, Y = {
16
+ FRONTEND: "frontend",
17
+ BACKEND: "backend"
18
+ }, he = [
19
+ "sheet",
20
+ "bitable",
21
+ "doc",
22
+ "docx",
23
+ "wiki",
24
+ "pdf",
25
+ "pptx",
26
+ "ppt",
27
+ "xlsx",
28
+ "xls",
29
+ "txt",
30
+ "png",
31
+ "jpg",
32
+ "jpeg"
33
+ ], X = {
34
+ MY_FILES: "myFiles",
35
+ FEISHU_KNOWLEDGE: "feishuKnowledge"
36
+ }, Z = /* @__PURE__ */ Object.assign({ name: "FileTypeIcon" }, {
37
+ __name: "FileTypeIcon",
38
+ props: {
39
+ fileType: {
40
+ type: String,
41
+ required: !1,
42
+ default: ""
43
+ },
44
+ isLocalFileType: {
45
+ type: Boolean,
46
+ required: !1,
47
+ default: !1
48
+ },
49
+ size: {
50
+ type: Number,
51
+ default: 32
52
+ }
53
+ },
54
+ setup(e) {
55
+ return (t, n) => e.fileType && P(he).includes(e.fileType) ? (S(), s(P(V), {
56
+ key: 0,
57
+ size: e.size
58
+ }, {
59
+ default: L(() => [e.isLocalFileType ? (S(), l(a, { key: 0 }, [["xlsx", "xls"].includes(e.fileType) ? (S(), s(P(W), { key: 0 })) : ["doc", "docx"].includes(e.fileType) ? (S(), s(P(oe), { key: 1 })) : ["pdf"].includes(e.fileType) ? (S(), s(P(ce), { key: 2 })) : ["pptx", "ppt"].includes(e.fileType) ? (S(), s(P(U), { key: 3 })) : ["txt"].includes(e.fileType) ? (S(), s(P(le), { key: 4 })) : [
60
+ "png",
61
+ "jpg",
62
+ "jpeg"
63
+ ].includes(e.fileType) ? (S(), s(P(se), { key: 5 })) : c("", !0)], 64)) : (S(), l(a, { key: 1 }, [["sheet"].includes(e.fileType) ? (S(), s(P(G), { key: 0 })) : ["bitable"].includes(e.fileType) ? (S(), s(P(pe), { key: 1 })) : ["doc", "docx"].includes(e.fileType) ? (S(), s(P(de), { key: 2 })) : ["wiki"].includes(e.fileType) ? (S(), s(P(fe), { key: 3 })) : c("", !0)], 64))]),
64
+ _: 1
65
+ }, 8, ["size"])) : c("", !0);
66
+ }
67
+ }), ge = { class: "right-wrap" }, _e = { class: "content" }, ve = {
68
+ key: 0,
69
+ class: "empty-state"
70
+ }, ye = {
71
+ key: 1,
72
+ class: "selected-list"
73
+ }, be = ["onClick"], xe = { class: "item-content" }, Se = { class: "item-main" }, Ce = { class: "doc-icon" }, we = { class: "doc-info" }, Te = { class: "doc-name" }, Ee = {
74
+ key: 0,
75
+ class: "doc-suffix"
76
+ }, De = ["onClick"], Oe = /* @__PURE__ */ i(/* @__PURE__ */ Object.assign({ name: "RightLayout" }, {
77
+ __name: "RightLayout",
78
+ props: {
79
+ selectedDocuments: {
80
+ type: Array,
81
+ default: () => []
82
+ },
83
+ treeProps: {
84
+ type: Object,
85
+ default: () => J
86
+ }
87
+ },
88
+ emits: ["delete-node"],
89
+ setup(e, { emit: t }) {
90
+ let n = e, r = t, i = T(-1), s = o(() => n.selectedDocuments.filter((e) => he.includes(e.type))), f = (e) => {
91
+ i.value = i.value === e ? -1 : e;
92
+ }, p = (e) => {
93
+ r("delete-node", e), i.value = -1;
94
+ };
95
+ return (t, n) => (S(), l("div", ge, [u("div", _e, [s.value.length === 0 ? (S(), l("div", ve, [d(P(q))])) : (S(), l("div", ye, [(S(!0), l(a, null, E(s.value, (t, n) => (S(), l("div", {
96
+ key: t[e.treeProps.value],
97
+ class: _(["selected-item", { "is-selected": i.value === n }]),
98
+ onClick: (e) => f(n)
99
+ }, [u("div", xe, [u("div", Se, [u("div", Ce, [d(Z, {
100
+ "file-type": t.type,
101
+ size: 26,
102
+ isLocalFileType: t?.isLocalFileType
103
+ }, null, 8, ["file-type", "isLocalFileType"])]), u("div", we, [u("div", Te, M(t[e.treeProps.label]), 1), t.suffix ? (S(), l("div", Ee, M(t.suffix), 1)) : c("", !0)])]), u("div", {
104
+ class: "flex items-center",
105
+ onClick: R((e) => p(t), ["stop"])
106
+ }, [d(P(V), {
107
+ size: 14,
108
+ color: "var(--neutral-color-5)"
109
+ }, {
110
+ default: L(() => [d(P(ue))]),
111
+ _: 1
112
+ })], 8, De)])], 10, be))), 128))]))])]));
113
+ }
114
+ }), [["__scopeId", "data-v-6736cdb6"]]);
115
+ //#endregion
116
+ //#region ../../../node_modules/.pnpm/element-tree-line@0.2.1_vue@3.5.27_typescript@5.9.3_/node_modules/element-tree-line/dist/index.es.js
117
+ function ke(e) {
118
+ return {
119
+ name: "element-tree-line",
120
+ props: {
121
+ node: {
122
+ type: Object,
123
+ required: !0
124
+ },
125
+ data: { type: Object },
126
+ treeData: { type: Array },
127
+ indent: {
128
+ type: Number,
129
+ default() {
130
+ return 16;
131
+ }
132
+ },
133
+ showLabelLine: {
134
+ type: Boolean,
135
+ default: !0
136
+ }
137
+ },
138
+ render(t) {
139
+ let n = e || t, r = this.getScopedSlot("default"), i = this.getScopedSlot("node-label"), a = this.getScopedSlot("after-node-label"), o = r ? this.getScopedSlotValue(r, {
140
+ node: this.node,
141
+ data: this.data
142
+ }) : [
143
+ i ? this.getScopedSlotValue(i, {
144
+ node: this.node,
145
+ data: this.data
146
+ }) : n("span", { class: "element-tree-node-label" }, this.node.label),
147
+ this.showLabelLine ? n("span", { class: "element-tree-node-label-line" }) : null,
148
+ this.getScopedSlotValue(a, {
149
+ node: this.node,
150
+ data: this.data
151
+ })
152
+ ], s = [], c = this.node;
153
+ for (; c;) {
154
+ let e = c.parent;
155
+ if (c.level === 1 && !c.parent) {
156
+ if (!this.treeData || !Array.isArray(this.treeData)) throw Error("if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data.");
157
+ e = {
158
+ children: Array.isArray(this.treeData) ? this.treeData.map((e) => ({
159
+ ...e,
160
+ key: e.id
161
+ })) : [],
162
+ level: 0,
163
+ key: "node-0",
164
+ parent: null
165
+ };
166
+ }
167
+ if (e) {
168
+ let t = (e.children || e.childNodes).findIndex((e) => (e.key || e.id) === (c.key || c.id));
169
+ s.unshift(t === (e.children || e.childNodes).length - 1);
170
+ }
171
+ c = e;
172
+ }
173
+ let l = [];
174
+ for (let e = 0; e < this.node.level; e++) s[e] && this.node.level - 1 !== e || l.push(n("span", {
175
+ class: {
176
+ "element-tree-node-line-ver": !0,
177
+ "last-node-isLeaf-line": s[e] && this.node.level - 1 === e
178
+ },
179
+ style: { left: this.indent * e + "px" }
180
+ }));
181
+ return n("span", { class: "element-tree-node-label-wrapper" }, [o].concat(l, [n("span", {
182
+ class: "element-tree-node-line-hor",
183
+ style: {
184
+ width: (this.node.isLeaf ? 24 : 8) + "px",
185
+ left: (this.node.level - 1) * this.indent + "px"
186
+ }
187
+ })]));
188
+ },
189
+ methods: {
190
+ getScopedSlot(e) {
191
+ if (!e) return null;
192
+ let t = e.split("||"), n = null;
193
+ for (let e = 0; e < t.length; e++) {
194
+ let r = t[e], i = (this.$slots || {})[r];
195
+ if (i) {
196
+ n = i;
197
+ break;
198
+ }
199
+ if (n = (this.$scopedSlots || {})[r], n) break;
200
+ }
201
+ return n;
202
+ },
203
+ getScopedSlotValue(e, t, n = null) {
204
+ return typeof e == "function" ? e(t) || n : e || n;
205
+ }
206
+ }
207
+ };
208
+ }
209
+ function Ae(e) {
210
+ let t = ke(e);
211
+ return e && (t.methods.getScopedSlot = function(e) {
212
+ if (!e) return null;
213
+ let t = e.split("||"), n = null;
214
+ for (let e = 0; e < t.length; e++) {
215
+ let r = t[e], i = (this.$slots || {})[r];
216
+ if (i) {
217
+ n = i;
218
+ break;
219
+ }
220
+ }
221
+ return n;
222
+ }), t;
223
+ }
224
+ Ae();
225
+ //#endregion
226
+ //#region components/DocSyncSelect/utils.js
227
+ var je = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
228
+ var n = "Expected a function", r = NaN, i = "[object Symbol]", a = /^\s+|\s+$/g, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt, u = typeof global == "object" && global && global.Object === Object && global, d = typeof self == "object" && self && self.Object === Object && self, f = u || d || Function("return this")(), p = Object.prototype.toString, m = Math.max, h = Math.min, g = function() {
229
+ return f.Date.now();
230
+ };
231
+ function _(e, t, r) {
232
+ var i, a, o, s, c, l, u = 0, d = !1, f = !1, p = !0;
233
+ if (typeof e != "function") throw TypeError(n);
234
+ t = x(t) || 0, v(r) && (d = !!r.leading, f = "maxWait" in r, o = f ? m(x(r.maxWait) || 0, t) : o, p = "trailing" in r ? !!r.trailing : p);
235
+ function _(t) {
236
+ var n = i, r = a;
237
+ return i = a = void 0, u = t, s = e.apply(r, n), s;
238
+ }
239
+ function y(e) {
240
+ return u = e, c = setTimeout(C, t), d ? _(e) : s;
241
+ }
242
+ function b(e) {
243
+ var n = e - l, r = e - u, i = t - n;
244
+ return f ? h(i, o - r) : i;
245
+ }
246
+ function S(e) {
247
+ var n = e - l, r = e - u;
248
+ return l === void 0 || n >= t || n < 0 || f && r >= o;
249
+ }
250
+ function C() {
251
+ var e = g();
252
+ if (S(e)) return w(e);
253
+ c = setTimeout(C, b(e));
254
+ }
255
+ function w(e) {
256
+ return c = void 0, p && i ? _(e) : (i = a = void 0, s);
257
+ }
258
+ function T() {
259
+ c !== void 0 && clearTimeout(c), u = 0, i = l = a = c = void 0;
260
+ }
261
+ function E() {
262
+ return c === void 0 ? s : w(g());
263
+ }
264
+ function D() {
265
+ var e = g(), n = S(e);
266
+ if (i = arguments, a = this, l = e, n) {
267
+ if (c === void 0) return y(l);
268
+ if (f) return c = setTimeout(C, t), _(l);
269
+ }
270
+ return c === void 0 && (c = setTimeout(C, t)), s;
271
+ }
272
+ return D.cancel = T, D.flush = E, D;
273
+ }
274
+ function v(e) {
275
+ var t = typeof e;
276
+ return !!e && (t == "object" || t == "function");
277
+ }
278
+ function y(e) {
279
+ return !!e && typeof e == "object";
280
+ }
281
+ function b(e) {
282
+ return typeof e == "symbol" || y(e) && p.call(e) == i;
283
+ }
284
+ function x(e) {
285
+ if (typeof e == "number") return e;
286
+ if (b(e)) return r;
287
+ if (v(e)) {
288
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
289
+ e = v(t) ? t + "" : t;
290
+ }
291
+ if (typeof e != "string") return e === 0 ? e : +e;
292
+ e = e.replace(a, "");
293
+ var n = s.test(e);
294
+ return n || c.test(e) ? l(e.slice(2), n ? 2 : 8) : o.test(e) ? r : +e;
295
+ }
296
+ t.exports = _;
297
+ })))()), Me = (e) => e && Array.isArray(e) && e.length === 1 && e[0] && typeof e[0] == "object" && e[0].falseChild === !0, Ne = (e) => !e || !e.children ? !0 : !Me(e.children), Pe = (e, t = 800) => (0, je.default)((t) => {
298
+ e("search", { keyword: t });
299
+ }, t), Fe = (e, t, n) => !e || !Array.isArray(e) ? [] : e.reduce((e, r) => {
300
+ let i = r[n.label]?.toLowerCase().includes(t.toLowerCase()), a = r.suffix?.toLowerCase().includes(t.toLowerCase());
301
+ if (i || a) e.push({ ...r });
302
+ else if (r[n.children]) {
303
+ let i = Fe(r[n.children], t, n);
304
+ i.length > 0 && e.push({
305
+ ...r,
306
+ [n.children]: i
307
+ });
308
+ }
309
+ return e;
310
+ }, []), Ie = (e, t) => {
311
+ let n = [];
312
+ if (!e) return n;
313
+ let r = e[t.children];
314
+ if (r && Array.isArray(r)) for (let e of r) n.push(e), n = n.concat(Ie(e, t));
315
+ return n;
316
+ }, Le = (e, t, n = !1) => {
317
+ let r = 0;
318
+ function i(e) {
319
+ for (let a of e) {
320
+ let e = a[t.children] && a[t.children].length > 0;
321
+ n ? r++ : e || r++, e && i(a[t.children]);
322
+ }
323
+ }
324
+ return i(e), r;
325
+ }, Re = (e, t, n) => {
326
+ let r = /* @__PURE__ */ new Map();
327
+ function i(e, a = []) {
328
+ for (let o of e) {
329
+ let e = [...a, o];
330
+ o.children && o.children.length > 0 ? i(o.children, e) : t.includes(o[n]) && a.forEach((e) => {
331
+ r.has(e[n]) || r.set(e[n], { ...e });
332
+ });
333
+ }
334
+ }
335
+ return i(e), Array.from(r.values());
336
+ }, ze = (e, t) => {
337
+ let n = t?.value || "id", r = t?.children || "children", i = /* @__PURE__ */ new Set(), a = (e) => {
338
+ if (Array.isArray(e)) for (let t of e) {
339
+ t && t[n] != null && i.add(t[n]);
340
+ let e = t?.[r];
341
+ e && Array.isArray(e) && e.length > 0 && a(e);
342
+ }
343
+ };
344
+ return a(e), i;
345
+ }, Be = ({ tabKey: e, currentSelectedDocs: t, hasSelectToRightDocList: n, treeData: r, treeProps: i }) => {
346
+ let a = Array.isArray(n) ? n : [], o = i?.value, s = ze((r && Array.isArray(r[e]) ? r[e] : []) || [], i), c = a.filter((e) => !s.has(e?.[o]));
347
+ return [...t, ...c];
348
+ }, Ve = (e, t, n) => {
349
+ if (!Array.isArray(e) || t == null) return null;
350
+ let r = n?.value || "id", i = n?.children || "children", a = (e) => {
351
+ for (let n of e) {
352
+ if (n && n[r] === t) return n;
353
+ let e = n?.[i];
354
+ if (Array.isArray(e) && e.length > 0) {
355
+ let t = a(e);
356
+ if (t) return t;
357
+ }
358
+ }
359
+ return null;
360
+ };
361
+ return a(e);
362
+ }, He = (e, t) => {
363
+ if (!e) return !1;
364
+ let n = t?.children || "children";
365
+ if (Me(e[n])) return !0;
366
+ let r = e[n];
367
+ if (r && Array.isArray(r)) {
368
+ for (let e of r) if (He(e, t)) return !0;
369
+ }
370
+ return !1;
371
+ }, Ue = (e, t) => e === X.MY_FILES ? t?.myFilesHasMore || !1 : e === X.FEISHU_KNOWLEDGE && t?.feishuKnowledgeHasMore || !1, We = { class: "w-full h-full flex flex-col overflow-hidden" }, Ge = /* @__PURE__ */ i(/* @__PURE__ */ Object.assign({ name: "TreeSelectLayout" }, {
372
+ __name: "TreeSelectLayout",
373
+ props: {
374
+ modelValue: {
375
+ type: Object,
376
+ default: () => []
377
+ },
378
+ treeProps: {
379
+ type: Object,
380
+ default: () => J
381
+ },
382
+ apiConfig: { type: Function },
383
+ loadNode: { type: Function },
384
+ reqParams: {
385
+ type: Object,
386
+ default: () => ({})
387
+ },
388
+ autoLoad: {
389
+ type: Boolean,
390
+ default: !0
391
+ },
392
+ isMultiple: {
393
+ type: Boolean,
394
+ default: !0
395
+ },
396
+ hasFilter: {
397
+ type: Boolean,
398
+ default: !1
399
+ },
400
+ treeList: {
401
+ type: Array,
402
+ default: () => []
403
+ },
404
+ hasTreeLine: {
405
+ type: Boolean,
406
+ default: !0
407
+ },
408
+ includeParentSelected: {
409
+ type: Boolean,
410
+ default: !1
411
+ },
412
+ textConfig: {
413
+ type: Object,
414
+ default: () => ({ searchPlaceholder: "" })
415
+ },
416
+ getTabSelectedDocuments: {
417
+ type: Function,
418
+ default: () => () => []
419
+ }
420
+ },
421
+ emits: [
422
+ "handleCheck",
423
+ "initFinish",
424
+ "node-expand"
425
+ ],
426
+ setup(e, { expose: t, emit: n }) {
427
+ let r = Ae(p), i = e, a = n, f = F(), m = () => p(ie, { style: {
428
+ color: "var(--text-color-2)",
429
+ fontSize: "16px"
430
+ } }), v = i.isMultiple ? 20 : 10, y = i.isMultiple ? 15 : 11, x = T([]), C = T(null), w = T(null), E = o(() => i.treeProps.value), O = o(() => i.treeProps.label), k = o(() => i.treeProps.children), A = T(!1), j = o(() => !i.isMultiple && A.value), N = T([]), ee = (e) => e?.[E.value] ?? e?.key ?? e?.data?.[E.value], R = (e, t) => {
431
+ let n = ee(e);
432
+ if (n != null) {
433
+ if (t) {
434
+ if (f.accordion) {
435
+ N.value = [n];
436
+ return;
437
+ }
438
+ N.value.includes(n) || (N.value = [...N.value, n]);
439
+ return;
440
+ }
441
+ N.value = N.value.filter((e) => e !== n);
442
+ }
443
+ }, z = () => {
444
+ g(() => {
445
+ C.value?.setExpandedKeys?.(N.value);
446
+ });
447
+ }, B = o(() => typeof i.apiConfig == "function"), V = () => {
448
+ let e = C.value?.getCheckedNodes(), t = e.map((e) => e[E.value]), n = [];
449
+ return i.includeParentSelected && (n = Re(x.value, t, E.value)), {
450
+ selectedNodeValues: t,
451
+ selectedNodes: e,
452
+ selectedParentNodes: n
453
+ };
454
+ }, ne = (e, t) => {
455
+ U(e, t);
456
+ }, H = (e) => {
457
+ R(e, !0), a("node-expand", e);
458
+ }, ae = (e) => {
459
+ R(e, !1);
460
+ }, oe = (e, t) => {
461
+ i.isMultiple || (A.value = !0, w.value = t.key, a("handleCheck", {
462
+ selectedValue: [w.value],
463
+ selectedNode: [t.data]
464
+ }));
465
+ };
466
+ T("");
467
+ let se = (e, t) => t[O.value].includes(e), ce = o(() => Le(x.value, i.treeProps, i.includeParentSelected));
468
+ function U(e = null, t = null) {
469
+ let { selectedNodeValues: n, selectedNodes: r, selectedParentNodes: i } = V(), o = null;
470
+ if (e && t) {
471
+ let n = e[E.value];
472
+ o = t.checkedKeys.includes(n);
473
+ }
474
+ a("handleCheck", {
475
+ selectedValue: n,
476
+ selectedNode: r,
477
+ selectedParentNodes: i,
478
+ checkedNode: e,
479
+ isChecked: o
480
+ });
481
+ }
482
+ let le = (e, t) => {
483
+ C.value?.setChecked(e, t), U();
484
+ }, W = () => {
485
+ f["default-checked-keys"] && g(() => {
486
+ U();
487
+ });
488
+ }, ue = (e) => {
489
+ C.value && (!e || e.length === 0 ? C.value?.setCheckedKeys([]) : C.value?.setCheckedKeys(e));
490
+ }, de = (e, t) => {
491
+ let n = (r) => {
492
+ for (let i = 0; i < r.length; i++) {
493
+ let a = r[i];
494
+ if (a[E.value] === e) {
495
+ let n = G(t);
496
+ return a[k.value] = n, a.isLeaf = !t || t.length === 0, console.log("节点更新后:", {
497
+ nodeKey: e,
498
+ childrenLength: n.length,
499
+ isLeaf: a.isLeaf
500
+ }), x.value = [...x.value], z(), !0;
501
+ }
502
+ if (a[k.value] && a[k.value].length > 0 && n(a[k.value])) return !0;
503
+ }
504
+ return !1;
505
+ };
506
+ n(x.value);
507
+ }, G = (e) => e?.map((e) => ({
508
+ ...e,
509
+ [k.value]: e[k.value]?.length ? G(e[k.value]) : void 0
510
+ })), fe = async () => {
511
+ B.value ? i.apiConfig(i.reqParams)?.then((e) => {
512
+ x.value = G(e?.data?.orgOptionSoList || e?.data || []), z(), W(), K(i.modelValue), a("initFinish", x.value);
513
+ }) : pe();
514
+ }, pe = () => {
515
+ x.value = G(i.treeList || []), z(), x.value.length && (W(), K(i.modelValue));
516
+ }, K = (e) => {
517
+ let t = e && e.length && e.map((e) => e[i.treeProps.value]);
518
+ g(() => {
519
+ C.value?.setCheckedKeys(t);
520
+ });
521
+ };
522
+ return I(() => i.treeList, () => {
523
+ pe();
524
+ }, { deep: !0 }), I(() => i.modelValue, (e) => {
525
+ g(() => {
526
+ K(e);
527
+ });
528
+ }, { deep: !0 }), b(() => {
529
+ fe();
530
+ }), t({
531
+ allNodeNumbers: ce,
532
+ loadData: fe,
533
+ setNodeCheckStatus: le,
534
+ updateNodeChildren: de,
535
+ syncSelectedNodes: ue
536
+ }), (t, n) => (S(), l("div", We, [u("div", { class: _([e.hasFilter ? "pd-l-8 pd-r-8" : "", "flex-1 overflow-hidden"]) }, [d(P(te), null, {
537
+ default: L(({ width: n, height: i }) => [d(P(re), h({
538
+ ref_key: "treeRef",
539
+ ref: C,
540
+ height: i,
541
+ width: n,
542
+ "check-strictly": !0,
543
+ data: x.value,
544
+ props: e.treeProps,
545
+ "node-key": E.value,
546
+ "show-checkbox": !0,
547
+ "item-size": P(34),
548
+ indent: P(v),
549
+ "highlight-current": j.value,
550
+ icon: m,
551
+ "filter-method": se,
552
+ lazy: "",
553
+ load: e.loadNode
554
+ }, P(f), {
555
+ onNodeClick: oe,
556
+ onCheck: ne,
557
+ onNodeExpand: H,
558
+ onNodeCollapse: ae,
559
+ class: ["hide-false-child-checkbox"]
560
+ }), {
561
+ default: L(({ node: n }) => [u("div", { class: _(["tree-node-content", { "false-child-node": n.data?.falseChild }]) }, [D(t.$slots, "node", {
562
+ node: n,
563
+ data: n.data
564
+ }, () => [e.hasTreeLine ? (S(), s(P(r), {
565
+ key: 0,
566
+ node: n,
567
+ treeData: x.value,
568
+ showLabelLine: !1,
569
+ indent: P(y)
570
+ }, null, 8, [
571
+ "node",
572
+ "treeData",
573
+ "indent"
574
+ ])) : c("", !0), u("span", null, M(n.data[O.value]), 1)], !0)], 2)]),
575
+ empty: L(() => [d(P(q))]),
576
+ _: 3
577
+ }, 16, [
578
+ "height",
579
+ "width",
580
+ "data",
581
+ "props",
582
+ "node-key",
583
+ "item-size",
584
+ "indent",
585
+ "highlight-current",
586
+ "load"
587
+ ])]),
588
+ _: 3
589
+ })], 2)]));
590
+ }
591
+ }), [["__scopeId", "data-v-9066789c"]]);
592
+ //#endregion
593
+ //#region ../../../node_modules/.pnpm/vue-resize@2.0.0-alpha.1_vue@3.5.27_typescript@5.9.3_/node_modules/vue-resize/dist/vue-resize.esm.js
594
+ function Ke() {
595
+ var e = window.navigator.userAgent, t = e.indexOf("MSIE ");
596
+ if (t > 0) return parseInt(e.substring(t + 5, e.indexOf(".", t)), 10);
597
+ if (e.indexOf("Trident/") > 0) {
598
+ var n = e.indexOf("rv:");
599
+ return parseInt(e.substring(n + 3, e.indexOf(".", n)), 10);
600
+ }
601
+ var r = e.indexOf("Edge/");
602
+ return r > 0 ? parseInt(e.substring(r + 5, e.indexOf(".", r)), 10) : -1;
603
+ }
604
+ var Q;
605
+ function qe() {
606
+ qe.init || (qe.init = !0, Q = Ke() !== -1);
607
+ }
608
+ var $ = {
609
+ name: "ResizeObserver",
610
+ props: {
611
+ emitOnMount: {
612
+ type: Boolean,
613
+ default: !1
614
+ },
615
+ ignoreWidth: {
616
+ type: Boolean,
617
+ default: !1
618
+ },
619
+ ignoreHeight: {
620
+ type: Boolean,
621
+ default: !1
622
+ }
623
+ },
624
+ emits: ["notify"],
625
+ mounted() {
626
+ qe(), g(() => {
627
+ this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize();
628
+ });
629
+ let e = document.createElement("object");
630
+ this._resizeObject = e, e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", -1), e.onload = this.addResizeHandlers, e.type = "text/html", Q && this.$el.appendChild(e), e.data = "about:blank", Q || this.$el.appendChild(e);
631
+ },
632
+ beforeUnmount() {
633
+ this.removeResizeHandlers();
634
+ },
635
+ methods: {
636
+ compareAndNotify() {
637
+ (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize());
638
+ },
639
+ emitSize() {
640
+ this.$emit("notify", {
641
+ width: this._w,
642
+ height: this._h
643
+ });
644
+ },
645
+ addResizeHandlers() {
646
+ this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify();
647
+ },
648
+ removeResizeHandlers() {
649
+ this._resizeObject && this._resizeObject.onload && (!Q && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null);
650
+ }
651
+ }
652
+ }, Je = /* @__PURE__ */ z("data-v-b329ee4c");
653
+ w("data-v-b329ee4c");
654
+ var Ye = {
655
+ class: "resize-observer",
656
+ tabindex: "-1"
657
+ };
658
+ C(), $.render = /* @__PURE__ */ Je((e, t, n, r, i, a) => (S(), s("div", Ye))), $.__scopeId = "data-v-b329ee4c", $.__file = "src/components/ResizeObserver.vue";
659
+ //#endregion
660
+ //#region ../../../node_modules/.pnpm/vue-observe-visibility@2.0.0-alpha.1_vue@3.5.27_typescript@5.9.3_/node_modules/vue-observe-visibility/dist/vue-observe-visibility.esm.js
661
+ function Xe(e) {
662
+ "@babel/helpers - typeof";
663
+ return Xe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
664
+ return typeof e;
665
+ } : function(e) {
666
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
667
+ }, Xe(e);
668
+ }
669
+ function Ze(e, t) {
670
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
671
+ }
672
+ function Qe(e, t) {
673
+ for (var n = 0; n < t.length; n++) {
674
+ var r = t[n];
675
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
676
+ }
677
+ }
678
+ function $e(e, t, n) {
679
+ return t && Qe(e.prototype, t), n && Qe(e, n), e;
680
+ }
681
+ function et(e) {
682
+ return tt(e) || nt(e) || rt(e) || at();
683
+ }
684
+ function tt(e) {
685
+ if (Array.isArray(e)) return it(e);
686
+ }
687
+ function nt(e) {
688
+ if (typeof Symbol < "u" && Symbol.iterator in Object(e)) return Array.from(e);
689
+ }
690
+ function rt(e, t) {
691
+ if (e) {
692
+ if (typeof e == "string") return it(e, t);
693
+ var n = Object.prototype.toString.call(e).slice(8, -1);
694
+ if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
695
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return it(e, t);
696
+ }
697
+ }
698
+ function it(e, t) {
699
+ (t == null || t > e.length) && (t = e.length);
700
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
701
+ return r;
702
+ }
703
+ function at() {
704
+ throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
705
+ }
706
+ function ot(e) {
707
+ return typeof e == "function" ? { callback: e } : e;
708
+ }
709
+ function st(e, t) {
710
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r, i, a, o = function(o) {
711
+ if (a = [...arguments].slice(1), !(r && o === i)) {
712
+ var s = n.leading;
713
+ typeof s == "function" && (s = s(o, i)), (!r || o !== i) && s && e.apply(void 0, [o].concat(et(a))), i = o, clearTimeout(r), r = setTimeout(function() {
714
+ e.apply(void 0, [o].concat(et(a))), r = 0;
715
+ }, t);
716
+ }
717
+ };
718
+ return o._clear = function() {
719
+ clearTimeout(r), r = null;
720
+ }, o;
721
+ }
722
+ function ct(e, t) {
723
+ if (e === t) return !0;
724
+ if (Xe(e) === "object") {
725
+ for (var n in e) if (!ct(e[n], t[n])) return !1;
726
+ return !0;
727
+ }
728
+ return !1;
729
+ }
730
+ var lt = /* @__PURE__ */ function() {
731
+ function e(t, n, r) {
732
+ Ze(this, e), this.el = t, this.observer = null, this.frozen = !1, this.createObserver(n, r);
733
+ }
734
+ return $e(e, [
735
+ {
736
+ key: "createObserver",
737
+ value: function(e, t) {
738
+ var n = this;
739
+ if (this.observer && this.destroyObserver(), !this.frozen) {
740
+ if (this.options = ot(e), this.callback = function(e, t) {
741
+ n.options.callback(e, t), e && n.options.once && (n.frozen = !0, n.destroyObserver());
742
+ }, this.callback && this.options.throttle) {
743
+ var r = (this.options.throttleOptions || {}).leading;
744
+ this.callback = st(this.callback, this.options.throttle, { leading: function(e) {
745
+ return r === "both" || r === "visible" && e || r === "hidden" && !e;
746
+ } });
747
+ }
748
+ this.oldResult = void 0, this.observer = new IntersectionObserver(function(e) {
749
+ var t = e[0];
750
+ if (e.length > 1) {
751
+ var r = e.find(function(e) {
752
+ return e.isIntersecting;
753
+ });
754
+ r && (t = r);
755
+ }
756
+ if (n.callback) {
757
+ var i = t.isIntersecting && t.intersectionRatio >= n.threshold;
758
+ if (i === n.oldResult) return;
759
+ n.oldResult = i, n.callback(i, t);
760
+ }
761
+ }, this.options.intersection), g(function() {
762
+ n.observer && n.observer.observe(n.el);
763
+ });
764
+ }
765
+ }
766
+ },
767
+ {
768
+ key: "destroyObserver",
769
+ value: function() {
770
+ this.observer &&= (this.observer.disconnect(), null), this.callback && this.callback._clear && (this.callback._clear(), this.callback = null);
771
+ }
772
+ },
773
+ {
774
+ key: "threshold",
775
+ get: function() {
776
+ return this.options.intersection && typeof this.options.intersection.threshold == "number" ? this.options.intersection.threshold : 0;
777
+ }
778
+ }
779
+ ]), e;
780
+ }();
781
+ function ut(e, t, n) {
782
+ var r = t.value;
783
+ r && (typeof IntersectionObserver > "u" ? console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill") : e._vue_visibilityState = new lt(e, r, n));
784
+ }
785
+ function dt(e, t, n) {
786
+ var r = t.value, i = t.oldValue;
787
+ if (!ct(r, i)) {
788
+ var a = e._vue_visibilityState;
789
+ if (!r) {
790
+ ft(e);
791
+ return;
792
+ }
793
+ a ? a.createObserver(r, n) : ut(e, { value: r }, n);
794
+ }
795
+ }
796
+ function ft(e) {
797
+ var t = e._vue_visibilityState;
798
+ t && (t.destroyObserver(), delete e._vue_visibilityState);
799
+ }
800
+ var pt = {
801
+ beforeMount: ut,
802
+ updated: dt,
803
+ unmounted: ft
804
+ }, mt = { itemsLimit: 1e3 }, ht = /(auto|scroll)/;
805
+ function gt(e, t) {
806
+ return e.parentNode === null ? t : gt(e.parentNode, t.concat([e]));
807
+ }
808
+ var _t = function(e, t) {
809
+ return getComputedStyle(e, null).getPropertyValue(t);
810
+ }, vt = function(e) {
811
+ return _t(e, "overflow") + _t(e, "overflow-y") + _t(e, "overflow-x");
812
+ }, yt = function(e) {
813
+ return ht.test(vt(e));
814
+ };
815
+ function bt(e) {
816
+ if (e instanceof HTMLElement || e instanceof SVGElement) {
817
+ for (var t = gt(e.parentNode, []), n = 0; n < t.length; n += 1) if (yt(t[n])) return t[n];
818
+ return document.scrollingElement || document.documentElement;
819
+ }
820
+ }
821
+ function xt(e) {
822
+ "@babel/helpers - typeof";
823
+ return xt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
824
+ return typeof e;
825
+ } : function(e) {
826
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
827
+ }, xt(e);
828
+ }
829
+ var St = {
830
+ items: {
831
+ type: Array,
832
+ required: !0
833
+ },
834
+ keyField: {
835
+ type: String,
836
+ default: "id"
837
+ },
838
+ direction: {
839
+ type: String,
840
+ default: "vertical",
841
+ validator: function(e) {
842
+ return ["vertical", "horizontal"].includes(e);
843
+ }
844
+ },
845
+ listTag: {
846
+ type: String,
847
+ default: "div"
848
+ },
849
+ itemTag: {
850
+ type: String,
851
+ default: "div"
852
+ }
853
+ };
854
+ function Ct() {
855
+ return this.items.length && xt(this.items[0]) !== "object";
856
+ }
857
+ var wt = !1;
858
+ if (typeof window < "u") {
859
+ wt = !1;
860
+ try {
861
+ var Tt = Object.defineProperty({}, "passive", { get: function() {
862
+ wt = !0;
863
+ } });
864
+ window.addEventListener("test", null, Tt);
865
+ } catch {}
866
+ }
867
+ var Et = 0, Dt = {
868
+ name: "RecycleScroller",
869
+ components: { ResizeObserver: $ },
870
+ directives: { ObserveVisibility: pt },
871
+ props: {
872
+ ...St,
873
+ itemSize: {
874
+ type: Number,
875
+ default: null
876
+ },
877
+ gridItems: {
878
+ type: Number,
879
+ default: void 0
880
+ },
881
+ itemSecondarySize: {
882
+ type: Number,
883
+ default: void 0
884
+ },
885
+ minItemSize: {
886
+ type: [Number, String],
887
+ default: null
888
+ },
889
+ sizeField: {
890
+ type: String,
891
+ default: "size"
892
+ },
893
+ typeField: {
894
+ type: String,
895
+ default: "type"
896
+ },
897
+ buffer: {
898
+ type: Number,
899
+ default: 200
900
+ },
901
+ pageMode: {
902
+ type: Boolean,
903
+ default: !1
904
+ },
905
+ prerender: {
906
+ type: Number,
907
+ default: 0
908
+ },
909
+ emitUpdate: {
910
+ type: Boolean,
911
+ default: !1
912
+ },
913
+ updateInterval: {
914
+ type: Number,
915
+ default: 0
916
+ },
917
+ skipHover: {
918
+ type: Boolean,
919
+ default: !1
920
+ },
921
+ listTag: {
922
+ type: String,
923
+ default: "div"
924
+ },
925
+ itemTag: {
926
+ type: String,
927
+ default: "div"
928
+ },
929
+ listClass: {
930
+ type: [
931
+ String,
932
+ Object,
933
+ Array
934
+ ],
935
+ default: ""
936
+ },
937
+ itemClass: {
938
+ type: [
939
+ String,
940
+ Object,
941
+ Array
942
+ ],
943
+ default: ""
944
+ }
945
+ },
946
+ emits: [
947
+ "resize",
948
+ "visible",
949
+ "hidden",
950
+ "update",
951
+ "scroll-start",
952
+ "scroll-end"
953
+ ],
954
+ data() {
955
+ return {
956
+ pool: [],
957
+ totalSize: 0,
958
+ ready: !1,
959
+ hoverKey: null
960
+ };
961
+ },
962
+ computed: {
963
+ sizes() {
964
+ if (this.itemSize === null) {
965
+ let e = { "-1": { accumulator: 0 } }, t = this.items, n = this.sizeField, r = this.minItemSize, i = 1e4, a = 0, o;
966
+ for (let s = 0, c = t.length; s < c; s++) o = t[s][n] || r, o < i && (i = o), a += o, e[s] = {
967
+ accumulator: a,
968
+ size: o
969
+ };
970
+ return this.$_computedMinItemSize = i, e;
971
+ }
972
+ return [];
973
+ },
974
+ simpleArray: Ct,
975
+ itemIndexByKey() {
976
+ let { keyField: e, items: t } = this, n = {};
977
+ for (let r = 0, i = t.length; r < i; r++) n[t[r][e]] = r;
978
+ return n;
979
+ }
980
+ },
981
+ watch: {
982
+ items() {
983
+ this.updateVisibleItems(!0);
984
+ },
985
+ pageMode() {
986
+ this.applyPageMode(), this.updateVisibleItems(!1);
987
+ },
988
+ sizes: {
989
+ handler() {
990
+ this.updateVisibleItems(!1);
991
+ },
992
+ deep: !0
993
+ },
994
+ gridItems() {
995
+ this.updateVisibleItems(!0);
996
+ },
997
+ itemSecondarySize() {
998
+ this.updateVisibleItems(!0);
999
+ }
1000
+ },
1001
+ created() {
1002
+ this.$_startIndex = 0, this.$_endIndex = 0, this.$_views = /* @__PURE__ */ new Map(), this.$_unusedViews = /* @__PURE__ */ new Map(), this.$_scrollDirty = !1, this.$_lastUpdateScrollPosition = 0, this.prerender && (this.$_prerender = !0, this.updateVisibleItems(!1)), this.gridItems && !this.itemSize && console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems");
1003
+ },
1004
+ mounted() {
1005
+ this.applyPageMode(), this.$nextTick(() => {
1006
+ this.$_prerender = !1, this.updateVisibleItems(!0), this.ready = !0;
1007
+ });
1008
+ },
1009
+ activated() {
1010
+ let e = this.$_lastUpdateScrollPosition;
1011
+ typeof e == "number" && this.$nextTick(() => {
1012
+ this.scrollToPosition(e);
1013
+ });
1014
+ },
1015
+ beforeUnmount() {
1016
+ this.removeListeners();
1017
+ },
1018
+ methods: {
1019
+ addView(e, t, n, r, i) {
1020
+ let a = j({
1021
+ item: n,
1022
+ position: 0,
1023
+ nr: m({
1024
+ id: Et++,
1025
+ index: t,
1026
+ used: !0,
1027
+ key: r,
1028
+ type: i
1029
+ })
1030
+ });
1031
+ return e.push(a), a;
1032
+ },
1033
+ unuseView(e, t = !1) {
1034
+ let n = this.$_unusedViews, r = e.nr.type, i = n.get(r);
1035
+ i || (i = [], n.set(r, i)), i.push(e), t || (e.nr.used = !1, e.position = -9999);
1036
+ },
1037
+ handleResize() {
1038
+ this.$emit("resize"), this.ready && this.updateVisibleItems(!1);
1039
+ },
1040
+ handleScroll(e) {
1041
+ if (!this.$_scrollDirty) {
1042
+ if (this.$_scrollDirty = !0, this.$_updateTimeout) return;
1043
+ let e = () => requestAnimationFrame(() => {
1044
+ this.$_scrollDirty = !1;
1045
+ let { continuous: e } = this.updateVisibleItems(!1, !0);
1046
+ e || (clearTimeout(this.$_refreshTimout), this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100));
1047
+ });
1048
+ e(), this.updateInterval && (this.$_updateTimeout = setTimeout(() => {
1049
+ this.$_updateTimeout = 0, this.$_scrollDirty && e();
1050
+ }, this.updateInterval));
1051
+ }
1052
+ },
1053
+ handleVisibilityChange(e, t) {
1054
+ this.ready && (e || t.boundingClientRect.width !== 0 || t.boundingClientRect.height !== 0 ? (this.$emit("visible"), requestAnimationFrame(() => {
1055
+ this.updateVisibleItems(!1);
1056
+ })) : this.$emit("hidden"));
1057
+ },
1058
+ updateVisibleItems(e, t = !1) {
1059
+ let n = this.itemSize, r = this.gridItems || 1, i = this.itemSecondarySize || n, a = this.$_computedMinItemSize, o = this.typeField, s = this.simpleArray ? null : this.keyField, c = this.items, l = c.length, u = this.sizes, d = this.$_views, f = this.$_unusedViews, p = this.pool, m = this.itemIndexByKey, h, g, _, v, y;
1060
+ if (!l) h = g = v = y = _ = 0;
1061
+ else if (this.$_prerender) h = v = 0, g = y = Math.min(this.prerender, c.length), _ = null;
1062
+ else {
1063
+ let e = this.getScroll();
1064
+ if (t) {
1065
+ let t = e.start - this.$_lastUpdateScrollPosition;
1066
+ if (t < 0 && (t = -t), n === null && t < a || t < n) return { continuous: !0 };
1067
+ }
1068
+ this.$_lastUpdateScrollPosition = e.start;
1069
+ let i = this.buffer;
1070
+ e.start -= i, e.end += i;
1071
+ let o = 0;
1072
+ if (this.$refs.before && (o = this.$refs.before.scrollHeight, e.start -= o), this.$refs.after) {
1073
+ let t = this.$refs.after.scrollHeight;
1074
+ e.end += t;
1075
+ }
1076
+ if (n === null) {
1077
+ let t, n = 0, r = l - 1, i = ~~(l / 2), a;
1078
+ do
1079
+ a = i, t = u[i].accumulator, t < e.start ? n = i : i < l - 1 && u[i + 1].accumulator > e.start && (r = i), i = ~~((n + r) / 2);
1080
+ while (i !== a);
1081
+ for (i < 0 && (i = 0), h = i, _ = u[l - 1].accumulator, g = i; g < l && u[g].accumulator < e.end; g++);
1082
+ for (g === -1 ? g = c.length - 1 : (g++, g > l && (g = l)), v = h; v < l && o + u[v].accumulator < e.start; v++);
1083
+ for (y = v; y < l && o + u[y].accumulator < e.end; y++);
1084
+ } else {
1085
+ h = ~~(e.start / n * r);
1086
+ let t = h % r;
1087
+ h -= t, g = Math.ceil(e.end / n * r), v = Math.max(0, Math.floor((e.start - o) / n * r)), y = Math.floor((e.end - o) / n * r), h < 0 && (h = 0), g > l && (g = l), v < 0 && (v = 0), y > l && (y = l), _ = Math.ceil(l / r) * n;
1088
+ }
1089
+ }
1090
+ g - h > mt.itemsLimit && this.itemsLimitError(), this.totalSize = _;
1091
+ let b, x = h <= this.$_endIndex && g >= this.$_startIndex;
1092
+ if (x) for (let t = 0, n = p.length; t < n; t++) b = p[t], b.nr.used && (e && (b.nr.index = m[b.item[s]]), (b.nr.index == null || b.nr.index < h || b.nr.index >= g) && this.unuseView(b));
1093
+ let S = x ? null : /* @__PURE__ */ new Map(), C, w, T;
1094
+ for (let e = h; e < g; e++) {
1095
+ C = c[e];
1096
+ let t = s ? C[s] : C;
1097
+ if (t == null) throw Error(`Key is ${t} on item (keyField is '${s}')`);
1098
+ if (b = d.get(t), !n && !u[e].size) {
1099
+ b && this.unuseView(b);
1100
+ continue;
1101
+ }
1102
+ w = C[o];
1103
+ let a = f.get(w), l = !1;
1104
+ if (!b) x ? b = a && a.length ? a.pop() : this.addView(p, e, C, t, w) : (T = S.get(w) || 0, (!a || T >= a.length) && (b = this.addView(p, e, C, t, w), this.unuseView(b, !0), a = f.get(w)), b = a[T], S.set(w, T + 1)), d.delete(b.nr.key), b.nr.used = !0, b.nr.index = e, b.nr.key = t, b.nr.type = w, d.set(t, b), l = !0;
1105
+ else if (!b.nr.used && (b.nr.used = !0, l = !0, a)) {
1106
+ let e = a.indexOf(b);
1107
+ e !== -1 && a.splice(e, 1);
1108
+ }
1109
+ b.item = C, l && (e === c.length - 1 && this.$emit("scroll-end"), e === 0 && this.$emit("scroll-start")), n === null ? (b.position = u[e - 1].accumulator, b.offset = 0) : (b.position = Math.floor(e / r) * n, b.offset = e % r * i);
1110
+ }
1111
+ return this.$_startIndex = h, this.$_endIndex = g, this.emitUpdate && this.$emit("update", h, g, v, y), clearTimeout(this.$_sortTimer), this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300), { continuous: x };
1112
+ },
1113
+ getListenerTarget() {
1114
+ let e = bt(this.$el);
1115
+ return window.document && (e === window.document.documentElement || e === window.document.body) && (e = window), e;
1116
+ },
1117
+ getScroll() {
1118
+ let { $el: e, direction: t } = this, n = t === "vertical", r;
1119
+ if (this.pageMode) {
1120
+ let t = e.getBoundingClientRect(), i = n ? t.height : t.width, a = -(n ? t.top : t.left), o = n ? window.innerHeight : window.innerWidth;
1121
+ a < 0 && (o += a, a = 0), a + o > i && (o = i - a), r = {
1122
+ start: a,
1123
+ end: a + o
1124
+ };
1125
+ } else r = n ? {
1126
+ start: e.scrollTop,
1127
+ end: e.scrollTop + e.clientHeight
1128
+ } : {
1129
+ start: e.scrollLeft,
1130
+ end: e.scrollLeft + e.clientWidth
1131
+ };
1132
+ return r;
1133
+ },
1134
+ applyPageMode() {
1135
+ this.pageMode ? this.addListeners() : this.removeListeners();
1136
+ },
1137
+ addListeners() {
1138
+ this.listenerTarget = this.getListenerTarget(), this.listenerTarget.addEventListener("scroll", this.handleScroll, wt ? { passive: !0 } : !1), this.listenerTarget.addEventListener("resize", this.handleResize);
1139
+ },
1140
+ removeListeners() {
1141
+ this.listenerTarget &&= (this.listenerTarget.removeEventListener("scroll", this.handleScroll), this.listenerTarget.removeEventListener("resize", this.handleResize), null);
1142
+ },
1143
+ scrollToItem(e) {
1144
+ let t, n = this.gridItems || 1;
1145
+ t = this.itemSize === null ? e > 0 ? this.sizes[e - 1].accumulator : 0 : Math.floor(e / n) * this.itemSize, this.scrollToPosition(t);
1146
+ },
1147
+ scrollToPosition(e) {
1148
+ let t = this.direction === "vertical" ? {
1149
+ scroll: "scrollTop",
1150
+ start: "top"
1151
+ } : {
1152
+ scroll: "scrollLeft",
1153
+ start: "left"
1154
+ }, n, r, i;
1155
+ if (this.pageMode) {
1156
+ let a = bt(this.$el), o = a.tagName === "HTML" ? 0 : a[t.scroll], s = a.getBoundingClientRect(), c = this.$el.getBoundingClientRect()[t.start] - s[t.start];
1157
+ n = a, r = t.scroll, i = e + o + c;
1158
+ } else n = this.$el, r = t.scroll, i = e;
1159
+ n[r] = i;
1160
+ },
1161
+ itemsLimitError() {
1162
+ throw setTimeout(() => {
1163
+ console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.", "Scroller:", this.$el), console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.");
1164
+ }), Error("Rendered items limit reached");
1165
+ },
1166
+ sortViews() {
1167
+ this.pool.sort((e, t) => e.nr.index - t.nr.index);
1168
+ }
1169
+ }
1170
+ }, Ot = {
1171
+ key: 0,
1172
+ ref: "before",
1173
+ class: "vue-recycle-scroller__slot"
1174
+ }, kt = {
1175
+ key: 1,
1176
+ ref: "after",
1177
+ class: "vue-recycle-scroller__slot"
1178
+ };
1179
+ function At(e, t, n, r, i, o) {
1180
+ let u = O("ResizeObserver"), f = k("observe-visibility");
1181
+ return ee((S(), l("div", {
1182
+ class: _(["vue-recycle-scroller", {
1183
+ ready: i.ready,
1184
+ "page-mode": n.pageMode,
1185
+ [`direction-${e.direction}`]: !0
1186
+ }]),
1187
+ onScrollPassive: t[0] ||= (...e) => o.handleScroll && o.handleScroll(...e)
1188
+ }, [
1189
+ e.$slots.before ? (S(), l("div", Ot, [D(e.$slots, "before")], 512)) : c("v-if", !0),
1190
+ (S(), s(A(n.listTag), {
1191
+ ref: "wrapper",
1192
+ style: y({ [e.direction === "vertical" ? "minHeight" : "minWidth"]: i.totalSize + "px" }),
1193
+ class: _(["vue-recycle-scroller__item-wrapper", n.listClass])
1194
+ }, {
1195
+ default: L(() => [(S(!0), l(a, null, E(i.pool, (t) => (S(), s(A(n.itemTag), h({
1196
+ key: t.nr.id,
1197
+ style: i.ready ? {
1198
+ transform: `translate${e.direction === "vertical" ? "Y" : "X"}(${t.position}px) translate${e.direction === "vertical" ? "X" : "Y"}(${t.offset}px)`,
1199
+ width: n.gridItems ? `${e.direction === "vertical" && n.itemSecondarySize || n.itemSize}px` : void 0,
1200
+ height: n.gridItems ? `${e.direction === "horizontal" && n.itemSecondarySize || n.itemSize}px` : void 0
1201
+ } : null,
1202
+ class: ["vue-recycle-scroller__item-view", [n.itemClass, { hover: !n.skipHover && i.hoverKey === t.nr.key }]]
1203
+ }, N(n.skipHover ? {} : {
1204
+ mouseenter: () => {
1205
+ i.hoverKey = t.nr.key;
1206
+ },
1207
+ mouseleave: () => {
1208
+ i.hoverKey = null;
1209
+ }
1210
+ })), {
1211
+ default: L(() => [D(e.$slots, "default", {
1212
+ item: t.item,
1213
+ index: t.nr.index,
1214
+ active: t.nr.used
1215
+ })]),
1216
+ _: 2
1217
+ }, 1040, ["style", "class"]))), 128)), D(e.$slots, "empty")]),
1218
+ _: 3
1219
+ }, 8, ["style", "class"])),
1220
+ e.$slots.after ? (S(), l("div", kt, [D(e.$slots, "after")], 512)) : c("v-if", !0),
1221
+ d(u, { onNotify: o.handleResize }, null, 8, ["onNotify"])
1222
+ ], 34)), [[f, o.handleVisibilityChange]]);
1223
+ }
1224
+ Dt.render = At, Dt.__file = "src/components/RecycleScroller.vue";
1225
+ var jt = {
1226
+ name: "DynamicScroller",
1227
+ components: { RecycleScroller: Dt },
1228
+ provide() {
1229
+ return typeof ResizeObserver < "u" && (this.$_resizeObserver = new ResizeObserver((e) => {
1230
+ requestAnimationFrame(() => {
1231
+ if (Array.isArray(e)) {
1232
+ for (let t of e) if (t.target && t.target.$_vs_onResize) {
1233
+ let e, n;
1234
+ if (t.borderBoxSize) {
1235
+ let r = t.borderBoxSize[0];
1236
+ e = r.inlineSize, n = r.blockSize;
1237
+ } else e = t.contentRect.width, n = t.contentRect.height;
1238
+ t.target.$_vs_onResize(t.target.$_vs_id, e, n);
1239
+ }
1240
+ }
1241
+ });
1242
+ })), {
1243
+ vscrollData: this.vscrollData,
1244
+ vscrollParent: this,
1245
+ vscrollResizeObserver: this.$_resizeObserver
1246
+ };
1247
+ },
1248
+ inheritAttrs: !1,
1249
+ props: {
1250
+ ...St,
1251
+ minItemSize: {
1252
+ type: [Number, String],
1253
+ required: !0
1254
+ }
1255
+ },
1256
+ emits: ["resize", "visible"],
1257
+ data() {
1258
+ return { vscrollData: {
1259
+ active: !0,
1260
+ sizes: {},
1261
+ keyField: this.keyField,
1262
+ simpleArray: !1
1263
+ } };
1264
+ },
1265
+ computed: {
1266
+ simpleArray: Ct,
1267
+ itemsWithSize() {
1268
+ let e = [], { items: t, keyField: n, simpleArray: r } = this, i = this.vscrollData.sizes, a = t.length;
1269
+ for (let o = 0; o < a; o++) {
1270
+ let a = t[o], s = r ? o : a[n], c = i[s];
1271
+ c === void 0 && !this.$_undefinedMap[s] && (c = 0), e.push({
1272
+ item: a,
1273
+ id: s,
1274
+ size: c
1275
+ });
1276
+ }
1277
+ return e;
1278
+ }
1279
+ },
1280
+ watch: {
1281
+ items() {
1282
+ this.forceUpdate();
1283
+ },
1284
+ simpleArray: {
1285
+ handler(e) {
1286
+ this.vscrollData.simpleArray = e;
1287
+ },
1288
+ immediate: !0
1289
+ },
1290
+ direction(e) {
1291
+ this.forceUpdate(!0);
1292
+ },
1293
+ itemsWithSize(e, t) {
1294
+ let n = this.$el.scrollTop, r = 0, i = 0, a = Math.min(e.length, t.length);
1295
+ for (let o = 0; o < a && !(r >= n); o++) r += t[o].size || this.minItemSize, i += e[o].size || this.minItemSize;
1296
+ let o = i - r;
1297
+ o !== 0 && (this.$el.scrollTop += o);
1298
+ }
1299
+ },
1300
+ beforeCreate() {
1301
+ this.$_updates = [], this.$_undefinedSizes = 0, this.$_undefinedMap = {}, this.$_events = me();
1302
+ },
1303
+ activated() {
1304
+ this.vscrollData.active = !0;
1305
+ },
1306
+ deactivated() {
1307
+ this.vscrollData.active = !1;
1308
+ },
1309
+ unmounted() {
1310
+ this.$_events.all.clear();
1311
+ },
1312
+ methods: {
1313
+ onScrollerResize() {
1314
+ this.$refs.scroller && this.forceUpdate(), this.$emit("resize");
1315
+ },
1316
+ onScrollerVisible() {
1317
+ this.$_events.emit("vscroll:update", { force: !1 }), this.$emit("visible");
1318
+ },
1319
+ forceUpdate(e = !1) {
1320
+ (e || this.simpleArray) && (this.vscrollData.sizes = {}), this.$_events.emit("vscroll:update", { force: !0 });
1321
+ },
1322
+ scrollToItem(e) {
1323
+ let t = this.$refs.scroller;
1324
+ t && t.scrollToItem(e);
1325
+ },
1326
+ getItemSize(e, t = void 0) {
1327
+ let n = this.simpleArray ? t ?? this.items.indexOf(e) : e[this.keyField];
1328
+ return this.vscrollData.sizes[n] || 0;
1329
+ },
1330
+ scrollToBottom() {
1331
+ if (this.$_scrollingToBottom) return;
1332
+ this.$_scrollingToBottom = !0;
1333
+ let e = this.$el;
1334
+ this.$nextTick(() => {
1335
+ e.scrollTop = e.scrollHeight + 5e3;
1336
+ let t = () => {
1337
+ e.scrollTop = e.scrollHeight + 5e3, requestAnimationFrame(() => {
1338
+ e.scrollTop = e.scrollHeight + 5e3, this.$_undefinedSizes === 0 ? this.$_scrollingToBottom = !1 : requestAnimationFrame(t);
1339
+ });
1340
+ };
1341
+ requestAnimationFrame(t);
1342
+ });
1343
+ }
1344
+ }
1345
+ };
1346
+ function Mt(e, t, n, r, i, a) {
1347
+ let o = O("RecycleScroller");
1348
+ return S(), s(o, h({
1349
+ ref: "scroller",
1350
+ items: a.itemsWithSize,
1351
+ "min-item-size": n.minItemSize,
1352
+ direction: e.direction,
1353
+ "key-field": "id",
1354
+ "list-tag": e.listTag,
1355
+ "item-tag": e.itemTag
1356
+ }, e.$attrs, {
1357
+ onResize: a.onScrollerResize,
1358
+ onVisible: a.onScrollerVisible
1359
+ }), {
1360
+ default: L(({ item: t, index: n, active: r }) => [D(e.$slots, "default", v(f({
1361
+ item: t.item,
1362
+ index: n,
1363
+ active: r,
1364
+ itemWithSize: t
1365
+ })))]),
1366
+ before: L(() => [D(e.$slots, "before")]),
1367
+ after: L(() => [D(e.$slots, "after")]),
1368
+ empty: L(() => [D(e.$slots, "empty")]),
1369
+ _: 3
1370
+ }, 16, [
1371
+ "items",
1372
+ "min-item-size",
1373
+ "direction",
1374
+ "list-tag",
1375
+ "item-tag",
1376
+ "onResize",
1377
+ "onVisible"
1378
+ ]);
1379
+ }
1380
+ jt.render = Mt, jt.__file = "src/components/DynamicScroller.vue";
1381
+ var Nt = {
1382
+ name: "DynamicScrollerItem",
1383
+ inject: [
1384
+ "vscrollData",
1385
+ "vscrollParent",
1386
+ "vscrollResizeObserver"
1387
+ ],
1388
+ props: {
1389
+ item: { required: !0 },
1390
+ watchData: {
1391
+ type: Boolean,
1392
+ default: !1
1393
+ },
1394
+ active: {
1395
+ type: Boolean,
1396
+ required: !0
1397
+ },
1398
+ index: {
1399
+ type: Number,
1400
+ default: void 0
1401
+ },
1402
+ sizeDependencies: {
1403
+ type: [Array, Object],
1404
+ default: null
1405
+ },
1406
+ emitResize: {
1407
+ type: Boolean,
1408
+ default: !1
1409
+ },
1410
+ tag: {
1411
+ type: String,
1412
+ default: "div"
1413
+ }
1414
+ },
1415
+ emits: ["resize"],
1416
+ computed: {
1417
+ id() {
1418
+ if (this.vscrollData.simpleArray) return this.index;
1419
+ if (this.vscrollData.keyField in this.item) return this.item[this.vscrollData.keyField];
1420
+ throw Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`);
1421
+ },
1422
+ size() {
1423
+ return this.vscrollData.sizes[this.id] || 0;
1424
+ },
1425
+ finalActive() {
1426
+ return this.active && this.vscrollData.active;
1427
+ }
1428
+ },
1429
+ watch: {
1430
+ watchData: "updateWatchData",
1431
+ id(e, t) {
1432
+ if (this.$el.$_vs_id = this.id, this.size || this.onDataUpdate(), this.$_sizeObserved) {
1433
+ let n = this.vscrollData.sizes[t], r = this.vscrollData.sizes[e];
1434
+ n != null && n !== r && this.applySize(n);
1435
+ }
1436
+ },
1437
+ finalActive(e) {
1438
+ this.size || (e ? this.vscrollParent.$_undefinedMap[this.id] || (this.vscrollParent.$_undefinedSizes++, this.vscrollParent.$_undefinedMap[this.id] = !0) : this.vscrollParent.$_undefinedMap[this.id] && (this.vscrollParent.$_undefinedSizes--, this.vscrollParent.$_undefinedMap[this.id] = !1)), this.vscrollResizeObserver ? e ? this.observeSize() : this.unobserveSize() : e && this.$_pendingVScrollUpdate === this.id && this.updateSize();
1439
+ }
1440
+ },
1441
+ created() {
1442
+ if (!this.$isServer && (this.$_forceNextVScrollUpdate = null, this.updateWatchData(), !this.vscrollResizeObserver)) {
1443
+ for (let e in this.sizeDependencies) this.$watch(() => this.sizeDependencies[e], this.onDataUpdate);
1444
+ this.vscrollParent.$_events.on("vscroll:update", this.onVscrollUpdate);
1445
+ }
1446
+ },
1447
+ mounted() {
1448
+ this.finalActive && (this.updateSize(), this.observeSize());
1449
+ },
1450
+ beforeUnmount() {
1451
+ this.vscrollParent.$_events.off("vscroll:update", this.onVscrollUpdate), this.unobserveSize();
1452
+ },
1453
+ methods: {
1454
+ updateSize() {
1455
+ this.finalActive ? this.$_pendingSizeUpdate !== this.id && (this.$_pendingSizeUpdate = this.id, this.$_forceNextVScrollUpdate = null, this.$_pendingVScrollUpdate = null, this.computeSize(this.id)) : this.$_forceNextVScrollUpdate = this.id;
1456
+ },
1457
+ updateWatchData() {
1458
+ this.watchData && !this.vscrollResizeObserver ? this.$_watchData = this.$watch("item", () => {
1459
+ this.onDataUpdate();
1460
+ }, { deep: !0 }) : this.$_watchData &&= (this.$_watchData(), null);
1461
+ },
1462
+ onVscrollUpdate({ force: e }) {
1463
+ !this.finalActive && e && (this.$_pendingVScrollUpdate = this.id), (this.$_forceNextVScrollUpdate === this.id || e || !this.size) && this.updateSize();
1464
+ },
1465
+ onDataUpdate() {
1466
+ this.updateSize();
1467
+ },
1468
+ computeSize(e) {
1469
+ this.$nextTick(() => {
1470
+ if (this.id === e) {
1471
+ let e = this.$el.offsetWidth, t = this.$el.offsetHeight;
1472
+ this.applyWidthHeight(e, t);
1473
+ }
1474
+ this.$_pendingSizeUpdate = null;
1475
+ });
1476
+ },
1477
+ applyWidthHeight(e, t) {
1478
+ let n = ~~(this.vscrollParent.direction === "vertical" ? t : e);
1479
+ n && this.size !== n && this.applySize(n);
1480
+ },
1481
+ applySize(e) {
1482
+ this.vscrollParent.$_undefinedMap[this.id] && (this.vscrollParent.$_undefinedSizes--, this.vscrollParent.$_undefinedMap[this.id] = void 0), this.vscrollData.sizes[this.id] = e, this.emitResize && this.$emit("resize", this.id);
1483
+ },
1484
+ observeSize() {
1485
+ this.vscrollResizeObserver && (this.$_sizeObserved ||= (this.vscrollResizeObserver.observe(this.$el), this.$el.$_vs_id = this.id, this.$el.$_vs_onResize = this.onResize, !0));
1486
+ },
1487
+ unobserveSize() {
1488
+ this.vscrollResizeObserver && (this.$_sizeObserved &&= (this.vscrollResizeObserver.unobserve(this.$el), this.$el.$_vs_onResize = void 0, !1));
1489
+ },
1490
+ onResize(e, t, n) {
1491
+ this.id === e && this.applyWidthHeight(t, n);
1492
+ }
1493
+ },
1494
+ render() {
1495
+ return p(this.tag, this.$slots.default());
1496
+ }
1497
+ };
1498
+ Nt.__file = "src/components/DynamicScrollerItem.vue";
1499
+ //#endregion
1500
+ //#region components/DocSyncSelect/SearchWrap/ScrollList.vue
1501
+ var Pt = {
1502
+ key: 0,
1503
+ class: "loading-indicator"
1504
+ }, Ft = { class: "loading-text" }, It = {
1505
+ key: 1,
1506
+ class: "no-more-tip"
1507
+ }, Lt = {
1508
+ key: 1,
1509
+ class: "empty-state"
1510
+ }, Rt = { class: "empty-text" }, zt = /* @__PURE__ */ i({
1511
+ __name: "ScrollList",
1512
+ props: {
1513
+ items: {
1514
+ type: Array,
1515
+ default: () => []
1516
+ },
1517
+ loading: {
1518
+ type: Boolean,
1519
+ default: !1
1520
+ },
1521
+ hasMore: {
1522
+ type: Boolean,
1523
+ default: !0
1524
+ },
1525
+ loadingText: {
1526
+ type: String,
1527
+ default: "加载中..."
1528
+ },
1529
+ noMoreText: {
1530
+ type: String,
1531
+ default: "没有更多了"
1532
+ },
1533
+ emptyText: {
1534
+ type: String,
1535
+ default: "暂无数据"
1536
+ },
1537
+ height: {
1538
+ type: String,
1539
+ default: "auto"
1540
+ },
1541
+ minItemSize: {
1542
+ type: Number,
1543
+ default: 60
1544
+ },
1545
+ buffer: {
1546
+ type: Number,
1547
+ default: 200
1548
+ },
1549
+ threshold: {
1550
+ type: Number,
1551
+ default: 100
1552
+ },
1553
+ keyField: {
1554
+ type: String,
1555
+ default: "id"
1556
+ }
1557
+ },
1558
+ emits: ["load-more", "scroll"],
1559
+ setup(e, { expose: t, emit: n }) {
1560
+ let r = e, i = n, a = T(null), f = T(null), p = T(!1), m = null, h = o(() => ({ height: r.height })), _ = () => {
1561
+ console.log("loadMore triggered----", p.value || !r.hasMore || r.loading), !(p.value || !r.hasMore || r.loading) && (p.value = !0, i("load-more"));
1562
+ }, v = () => {
1563
+ p.value = !1, C();
1564
+ }, C = () => {
1565
+ a.value && a.value.scrollToPosition(0);
1566
+ }, w = () => {
1567
+ if (a.value) {
1568
+ let e = a.value.$el;
1569
+ e && (e.scrollTop = e.scrollHeight);
1570
+ }
1571
+ }, E = (e) => {
1572
+ a.value && a.value.scrollToItem(e);
1573
+ }, k = () => {
1574
+ if (!f.value || !a.value) return;
1575
+ let e = a.value.$el;
1576
+ if (!e) return;
1577
+ let t = {
1578
+ root: e,
1579
+ rootMargin: `${r.threshold}px`,
1580
+ threshold: .1
1581
+ };
1582
+ m = new IntersectionObserver((e) => {
1583
+ e.forEach((e) => {
1584
+ console.log("Setting up Intersection Observer-----", e.isIntersecting, r.hasMore, !p.value, !r.loading), e.isIntersecting && r.hasMore && !p.value && !r.loading && _();
1585
+ });
1586
+ }, t), m.observe(f.value);
1587
+ }, A = () => {
1588
+ m &&= (m.disconnect(), null);
1589
+ }, j = (e) => {
1590
+ let t = e.target;
1591
+ i("scroll", {
1592
+ scrollTop: t.scrollTop,
1593
+ scrollHeight: t.scrollHeight,
1594
+ clientHeight: t.clientHeight
1595
+ });
1596
+ };
1597
+ return I(() => r.loading, (e) => {
1598
+ e || (p.value = !1);
1599
+ }), I(() => r.items.length, async () => {
1600
+ await g(), A(), r.hasMore && k();
1601
+ }), b(async () => {
1602
+ await g(), r.hasMore && k();
1603
+ }), x(() => {
1604
+ A();
1605
+ }), t({
1606
+ reset: v,
1607
+ scrollToTop: C,
1608
+ scrollToBottom: w,
1609
+ scrollToItem: E,
1610
+ loadMore: _
1611
+ }), (t, n) => {
1612
+ let r = O("Loading");
1613
+ return S(), l("div", {
1614
+ class: "scroll-list",
1615
+ style: y(h.value)
1616
+ }, [e.items.length > 0 ? (S(), s(P(jt), {
1617
+ key: 0,
1618
+ ref_key: "scrollerRef",
1619
+ ref: a,
1620
+ items: e.items,
1621
+ "min-item-size": e.minItemSize,
1622
+ buffer: e.buffer,
1623
+ "key-field": e.keyField,
1624
+ class: "scroller",
1625
+ onScroll: j
1626
+ }, {
1627
+ default: L(({ item: e, index: n, active: r }) => [d(P(Nt), {
1628
+ item: e,
1629
+ active: r,
1630
+ "data-index": n,
1631
+ "size-dependencies": [e]
1632
+ }, {
1633
+ default: L(() => [D(t.$slots, "default", {
1634
+ item: e,
1635
+ index: n,
1636
+ active: r
1637
+ }, void 0, !0)]),
1638
+ _: 2
1639
+ }, 1032, [
1640
+ "item",
1641
+ "active",
1642
+ "data-index",
1643
+ "size-dependencies"
1644
+ ])]),
1645
+ after: L(() => [e.hasMore ? (S(), l("div", {
1646
+ key: 0,
1647
+ ref_key: "loadMoreTriggerRef",
1648
+ ref: f,
1649
+ class: "load-more-trigger"
1650
+ }, [p.value ? (S(), l("div", Pt, [d(P(V), { class: "is-loading" }, {
1651
+ default: L(() => [d(r)]),
1652
+ _: 1
1653
+ }), u("span", Ft, M(e.loadingText), 1)])) : c("", !0)], 512)) : c("", !0), !e.hasMore && e.items.length > 0 ? (S(), l("div", It, M(e.noMoreText), 1)) : c("", !0)]),
1654
+ _: 3
1655
+ }, 8, [
1656
+ "items",
1657
+ "min-item-size",
1658
+ "buffer",
1659
+ "key-field"
1660
+ ])) : c("", !0), e.items.length === 0 && !p.value ? (S(), l("div", Lt, [D(t.$slots, "empty", {}, () => [d(P(V), {
1661
+ class: "empty-icon",
1662
+ size: 80
1663
+ }, {
1664
+ default: L(() => [d(P(ae))]),
1665
+ _: 1
1666
+ }), u("div", Rt, M(e.emptyText), 1)], !0)])) : c("", !0)], 4);
1667
+ };
1668
+ }
1669
+ }, [["__scopeId", "data-v-37e01654"]]), Bt = { class: "search-wrap" }, Vt = { class: "list-item" }, Ht = ["onClick"], Ut = { class: "node-info" }, Wt = { class: "node-label" }, Gt = {
1670
+ key: 0,
1671
+ class: "node-suffix"
1672
+ }, Kt = /* @__PURE__ */ i({
1673
+ __name: "index",
1674
+ props: {
1675
+ items: {
1676
+ type: Array,
1677
+ default: () => []
1678
+ },
1679
+ loading: {
1680
+ type: Boolean,
1681
+ default: !1
1682
+ },
1683
+ hasMore: {
1684
+ type: Boolean,
1685
+ default: !1
1686
+ },
1687
+ height: {
1688
+ type: String,
1689
+ default: "100%"
1690
+ },
1691
+ minItemSize: {
1692
+ type: Number,
1693
+ default: 50
1694
+ },
1695
+ buffer: {
1696
+ type: Number,
1697
+ default: 100
1698
+ },
1699
+ treeProps: {
1700
+ type: Object,
1701
+ default: () => ({
1702
+ label: "label",
1703
+ value: "value"
1704
+ })
1705
+ },
1706
+ selectedDocuments: {
1707
+ type: Array,
1708
+ default: () => []
1709
+ }
1710
+ },
1711
+ emits: ["load-more", "item-check"],
1712
+ setup(e, { emit: t }) {
1713
+ let { t: n } = r(), i = e, a = o(() => i.items.map((e) => {
1714
+ let t = (i.selectedDocuments || []).some((t) => t.id === e.id);
1715
+ return {
1716
+ ...e,
1717
+ isSelected: t
1718
+ };
1719
+ })), s = t, f = (e, t) => {
1720
+ s("item-check", e, t);
1721
+ }, p = () => {
1722
+ s("load-more");
1723
+ };
1724
+ return (t, r) => (S(), l("div", Bt, [d(zt, {
1725
+ items: a.value,
1726
+ loading: e.loading,
1727
+ "key-field": "id",
1728
+ "has-more": e.hasMore,
1729
+ "loading-text": P(n)("FEISHU_SEARCH_TEXT.LOADING_TEXT"),
1730
+ "no-more-text": P(n)("FEISHU_SEARCH_TEXT.NO_MORE_TEXT"),
1731
+ "empty-text": P(n)("FEISHU_SEARCH_TEXT.EMPTY_TEXT"),
1732
+ height: e.height,
1733
+ "min-item-size": e.minItemSize,
1734
+ buffer: e.buffer,
1735
+ onLoadMore: p
1736
+ }, {
1737
+ default: L(({ item: n }) => [u("div", Vt, [D(t.$slots, "default", { item: n }, () => [u("div", {
1738
+ class: "search-item",
1739
+ onClick: () => f(n, !n.isSelected)
1740
+ }, [
1741
+ d(P(B), { "model-value": n.isSelected }, null, 8, ["model-value"]),
1742
+ d(Z, {
1743
+ "file-type": n.type,
1744
+ size: 26,
1745
+ isLocalFileType: n?.isLocalFileType
1746
+ }, null, 8, ["file-type", "isLocalFileType"]),
1747
+ u("div", Ut, [u("span", Wt, M(n[e.treeProps.label]), 1), n.suffix ? (S(), l("span", Gt, M(n.suffix), 1)) : c("", !0)])
1748
+ ], 8, Ht)], !0)])]),
1749
+ _: 3
1750
+ }, 8, [
1751
+ "items",
1752
+ "loading",
1753
+ "has-more",
1754
+ "loading-text",
1755
+ "no-more-text",
1756
+ "empty-text",
1757
+ "height",
1758
+ "min-item-size",
1759
+ "buffer"
1760
+ ])]));
1761
+ }
1762
+ }, [["__scopeId", "data-v-a129f241"]]), qt = { class: "left-wrap" }, Jt = { class: "content" }, Yt = { class: "input-wrap" }, Xt = { class: "tree-container" }, Zt = { class: "tree-node-content" }, Qt = { class: "node-info" }, $t = { class: "node-label" }, en = {
1763
+ key: 0,
1764
+ class: "node-suffix"
1765
+ }, tn = 15, nn = /* @__PURE__ */ i(/* @__PURE__ */ Object.assign({ name: "LeftLayout" }, {
1766
+ __name: "LeftLayout",
1767
+ props: {
1768
+ tabs: {
1769
+ type: Array,
1770
+ default: () => []
1771
+ },
1772
+ treeData: {
1773
+ type: Object,
1774
+ default: () => ({})
1775
+ },
1776
+ treeProps: {
1777
+ type: Object,
1778
+ default: () => J
1779
+ },
1780
+ selectedDocuments: {
1781
+ type: Array,
1782
+ default: () => []
1783
+ },
1784
+ currentTab: {
1785
+ type: String,
1786
+ default: ""
1787
+ },
1788
+ searchType: {
1789
+ type: String,
1790
+ default: Y.FRONTEND,
1791
+ validator: (e) => Object.values(Y).includes(e)
1792
+ },
1793
+ textConfig: {
1794
+ type: Object,
1795
+ default: () => ({ searchPlaceholder: "" })
1796
+ },
1797
+ getTabSelectedDocuments: {
1798
+ type: Function,
1799
+ default: () => () => []
1800
+ },
1801
+ responseSearchHook: {
1802
+ type: Object,
1803
+ default: () => {}
1804
+ }
1805
+ },
1806
+ emits: [
1807
+ "node-check",
1808
+ "tab-change",
1809
+ "search",
1810
+ "node-expand",
1811
+ "load-more",
1812
+ "node-check-search"
1813
+ ],
1814
+ setup(e, { expose: t, emit: n }) {
1815
+ let r = e, i = n, f = Ae(p), m = T(), h = T(""), _ = T(r.currentTab || r.tabs[0]?.value || X.MY_FILES), v = T([]), y = T(!1), b = T(!1), x = o(() => r.tabs.map((e) => ({
1816
+ label: e.label,
1817
+ value: e.value
1818
+ }))), C = o(() => r.treeData[_.value] || []);
1819
+ I(() => r.responseSearchHook, (e, t) => {
1820
+ b.value = Ue(r.currentTab, e), y.value = !1;
1821
+ }, {
1822
+ deep: !0,
1823
+ immediate: !0
1824
+ });
1825
+ let w = Pe(i, 800), E = o(() => {
1826
+ if (r.searchType === Y.BACKEND) return C.value;
1827
+ let e = h.value?.trim();
1828
+ return e ? Fe(C.value, e, r.treeProps) : C.value;
1829
+ }), O = (e) => r.getTabSelectedDocuments(_.value).some((t) => t[r.treeProps.value] === e), k = o(() => {
1830
+ if (!h.value?.trim()) return [];
1831
+ let e = (t, n = 0) => {
1832
+ let i = [];
1833
+ return t.forEach((t) => {
1834
+ i.push({
1835
+ ...t,
1836
+ level: n,
1837
+ isSelected: O(t[r.treeProps.value])
1838
+ }), t[r.treeProps.children] && t[r.treeProps.children].length > 0 && (i = i.concat(e(t[r.treeProps.children], n + 1)));
1839
+ }), i;
1840
+ };
1841
+ return e(E.value);
1842
+ }), A = (e) => {
1843
+ i("node-check", e);
1844
+ }, j = (e, t) => {
1845
+ i("node-check-search", {
1846
+ selectedNode: r.getTabSelectedDocuments(_.value),
1847
+ checkedNode: e,
1848
+ isChecked: t
1849
+ });
1850
+ };
1851
+ I(_, (e) => {
1852
+ b.value = Ue(e, r.responseSearchHook), i("tab-change", e);
1853
+ }), I(() => r.treeData, () => {
1854
+ y.value = !1, m.value && m.value.syncSelectedNodes && g(() => {
1855
+ let e = (r.selectedDocuments || []).map((e) => e[r.treeProps.value]);
1856
+ m.value.syncSelectedNodes(e);
1857
+ });
1858
+ }, { deep: !0 });
1859
+ let N = (e) => {
1860
+ Ne(e) || i("node-expand", {
1861
+ node: e,
1862
+ tabKey: _.value
1863
+ });
1864
+ }, F = () => {
1865
+ y.value = !0, i("load-more");
1866
+ };
1867
+ return I(h, (e) => {
1868
+ r.searchType === Y.BACKEND ? (e && e.trim() && (y.value = !0), w(e || "")) : y.value = !1;
1869
+ }), I(() => r.currentTab, (e) => {
1870
+ e && e !== _.value && (_.value = e);
1871
+ }, { immediate: !0 }), I(() => r.selectedDocuments, (e) => {
1872
+ v.value = e || [];
1873
+ }, {
1874
+ immediate: !0,
1875
+ deep: !0
1876
+ }), t({
1877
+ setNodeCheckStatus: (e, t) => {
1878
+ m.value?.setNodeCheckStatus(e, t);
1879
+ },
1880
+ updateNodeChildren: (e, t) => {
1881
+ m.value && m.value?.updateNodeChildren && m.value.updateNodeChildren(e, t);
1882
+ },
1883
+ syncSelectedNodes: (e) => {
1884
+ m.value?.syncSelectedNodes(e);
1885
+ }
1886
+ }), (t, n) => (S(), l("div", qt, [u("div", Jt, [
1887
+ u("div", Yt, [d(P(ne), {
1888
+ modelValue: h.value,
1889
+ "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
1890
+ placeholder: r.textConfig.searchPlaceholder,
1891
+ "prefix-icon": P(K),
1892
+ clearable: ""
1893
+ }, null, 8, [
1894
+ "modelValue",
1895
+ "placeholder",
1896
+ "prefix-icon"
1897
+ ])]),
1898
+ d(P(H), {
1899
+ modelValue: _.value,
1900
+ "onUpdate:modelValue": n[1] ||= (e) => _.value = e,
1901
+ options: x.value
1902
+ }, null, 8, ["modelValue", "options"]),
1903
+ u("div", Xt, [!E.value || E.value.length === 0 ? (S(), s(P(q), { key: 0 })) : (S(), l(a, { key: 1 }, [h.value.trim() === "" ? (S(), s(Ge, {
1904
+ key: 1,
1905
+ modelValue: v.value,
1906
+ "onUpdate:modelValue": n[2] ||= (e) => v.value = e,
1907
+ ref_key: "treeSelectRef",
1908
+ ref: m,
1909
+ "tree-list": E.value,
1910
+ "tree-props": e.treeProps,
1911
+ "filter-keyword": h.value,
1912
+ itemSize: 50,
1913
+ hasTreeLine: !0,
1914
+ "text-config": e.textConfig,
1915
+ includeParentSelected: !0,
1916
+ onHandleCheck: A,
1917
+ onNodeExpand: N,
1918
+ getTabSelectedDocuments: e.getTabSelectedDocuments
1919
+ }, {
1920
+ node: L(({ node: n, data: r }) => [D(t.$slots, "node", {
1921
+ node: n,
1922
+ data: r
1923
+ }, () => [d(P(f), {
1924
+ node: n,
1925
+ treeData: E.value,
1926
+ showLabelLine: !0,
1927
+ indent: tn
1928
+ }, {
1929
+ default: L(() => [u("div", Zt, [d(Z, {
1930
+ "file-type": r.type,
1931
+ size: 26,
1932
+ isLocalFileType: r?.isLocalFileType
1933
+ }, null, 8, ["file-type", "isLocalFileType"]), u("div", Qt, [u("span", $t, M(r[e.treeProps.label]), 1), r.suffix ? (S(), l("span", en, M(r.suffix), 1)) : c("", !0)])])]),
1934
+ _: 2
1935
+ }, 1032, ["node", "treeData"])], !0)]),
1936
+ _: 3
1937
+ }, 8, [
1938
+ "modelValue",
1939
+ "tree-list",
1940
+ "tree-props",
1941
+ "filter-keyword",
1942
+ "text-config",
1943
+ "getTabSelectedDocuments"
1944
+ ])) : (S(), s(Kt, {
1945
+ key: 0,
1946
+ items: k.value,
1947
+ loading: y.value,
1948
+ "has-more": b.value,
1949
+ "min-item-size": 50,
1950
+ buffer: 100,
1951
+ "tree-props": e.treeProps,
1952
+ "selected-documents": e.selectedDocuments,
1953
+ onItemCheck: j,
1954
+ onLoadMore: F
1955
+ }, null, 8, [
1956
+ "items",
1957
+ "loading",
1958
+ "has-more",
1959
+ "tree-props",
1960
+ "selected-documents"
1961
+ ]))], 64))])
1962
+ ])]));
1963
+ }
1964
+ }), [["__scopeId", "data-v-6bf8c501"]]);
1965
+ //#endregion
1966
+ //#region components/DocSyncSelect/useDocumentSelection.js
1967
+ function rn(e = {}) {
1968
+ let { valueKey: t = "id" } = e, n = T(/* @__PURE__ */ new Map()), r = o(() => {
1969
+ let e = [], r = /* @__PURE__ */ new Set();
1970
+ return n.value.forEach((n) => {
1971
+ n.forEach((n) => {
1972
+ let i = n[t];
1973
+ r.has(i) || (e.push(n), r.add(i));
1974
+ });
1975
+ }), e;
1976
+ });
1977
+ return {
1978
+ allSelectedDocuments: r,
1979
+ selectionMap: n,
1980
+ getTabSelectedDocuments: (e) => {
1981
+ let t = n.value.get(e);
1982
+ return t ? Array.from(t.values()) : [];
1983
+ },
1984
+ updateTabSelection: (e, r = []) => {
1985
+ n.value.has(e) || n.value.set(e, /* @__PURE__ */ new Map());
1986
+ let i = /* @__PURE__ */ new Map();
1987
+ r.forEach((e) => {
1988
+ e && e[t] != null && i.set(e[t], e);
1989
+ }), n.value.set(e, i), n.value = new Map(n.value);
1990
+ },
1991
+ removeDocument: (e) => {
1992
+ let r = e[t], i = null;
1993
+ return n.value.forEach((e, t) => {
1994
+ e.has(r) && (e.delete(r), i = t);
1995
+ }), i && (n.value = new Map(n.value)), i;
1996
+ },
1997
+ toggleDocument: (e, r, i) => {
1998
+ n.value.has(e) || n.value.set(e, /* @__PURE__ */ new Map());
1999
+ let a = n.value.get(e), o = r[t];
2000
+ i ? a.set(o, r) : a.delete(o), n.value = new Map(n.value);
2001
+ },
2002
+ clearTabSelection: (e) => {
2003
+ n.value.has(e) && (n.value.get(e).clear(), n.value = new Map(n.value));
2004
+ },
2005
+ clearAllSelection: () => {
2006
+ n.value.clear(), n.value = new Map(n.value);
2007
+ },
2008
+ isDocumentSelected: (e, t) => {
2009
+ let r = n.value.get(e);
2010
+ return r ? r.has(t) : !1;
2011
+ },
2012
+ setAllDocuments: (e = [], r = "") => {
2013
+ n.value.clear(), e.forEach((e) => {
2014
+ let i = e.tabKey || r;
2015
+ i && (n.value.has(i) || n.value.set(i, /* @__PURE__ */ new Map()), n.value.get(i).set(e[t], e));
2016
+ }), n.value = new Map(n.value);
2017
+ },
2018
+ getStatistics: () => {
2019
+ let e = {
2020
+ total: r.value.length,
2021
+ byTab: {}
2022
+ };
2023
+ return n.value.forEach((t, n) => {
2024
+ e.byTab[n] = t.size;
2025
+ }), e;
2026
+ }
2027
+ };
2028
+ }
2029
+ //#endregion
2030
+ //#region components/DocSyncSelect/useAllTabDocList.js
2031
+ function an(e = {}) {
2032
+ let { valueKey: t = J.value, childrenKey: n = J.children } = e, r = T(/* @__PURE__ */ new Map()), i = T({});
2033
+ return {
2034
+ allTabDocList: r,
2035
+ allTabTreeDataObject: o(() => {
2036
+ let e = {};
2037
+ return r.value.forEach((t, n) => {
2038
+ e[n] = t;
2039
+ }), e;
2040
+ }),
2041
+ responseSearchHook: i,
2042
+ setAllTabsTreeData: (e = {}) => {
2043
+ let t = /* @__PURE__ */ new Map();
2044
+ e && typeof e == "object" && Object.keys(e).forEach((n) => {
2045
+ let r = Array.isArray(e[n]) ? e[n] : [];
2046
+ t.set(n, r);
2047
+ }), r.value = t;
2048
+ },
2049
+ getTabTreeData: (e) => r.value.get(e) || [],
2050
+ setTabTreeData: (e, t = []) => {
2051
+ let n = new Map(r.value);
2052
+ n.set(e, Array.isArray(t) ? t : []), r.value = n;
2053
+ },
2054
+ updateNodeChildren: (e, i, a = []) => {
2055
+ let o = r.value.get(e);
2056
+ if (!o || !Array.isArray(o)) return;
2057
+ let s = (e) => e.map((e) => {
2058
+ if (e[t] === i) return {
2059
+ ...e,
2060
+ [n]: a
2061
+ };
2062
+ let r = e[n];
2063
+ return Array.isArray(r) && r.length > 0 ? {
2064
+ ...e,
2065
+ [n]: s(r)
2066
+ } : e;
2067
+ }), c = s(o), l = new Map(r.value);
2068
+ l.set(e, c), r.value = l;
2069
+ },
2070
+ setResponseSearchHook: (e) => {
2071
+ i.value = e;
2072
+ }
2073
+ };
2074
+ }
2075
+ //#endregion
2076
+ //#region components/DocSyncSelect/layout.vue
2077
+ var on = { class: "doc-sync-select" }, sn = n(/* @__PURE__ */ i(/* @__PURE__ */ Object.assign({ name: "DocSyncSelect" }, {
2078
+ __name: "layout",
2079
+ props: {
2080
+ modelValue: {
2081
+ type: Array,
2082
+ default: () => []
2083
+ },
2084
+ treeData: {
2085
+ type: Object,
2086
+ default: () => ({})
2087
+ },
2088
+ updateMeta: {
2089
+ type: Object,
2090
+ default: () => ({
2091
+ updateId: "",
2092
+ operation: null,
2093
+ context: {}
2094
+ })
2095
+ },
2096
+ treeProps: {
2097
+ type: Object,
2098
+ default: () => J
2099
+ },
2100
+ tabs: {
2101
+ type: Array,
2102
+ default: () => []
2103
+ },
2104
+ searchType: {
2105
+ type: String,
2106
+ default: Y.FRONTEND,
2107
+ validator: (e) => Object.values(Y).includes(e)
2108
+ },
2109
+ textConfig: {
2110
+ type: Object,
2111
+ default: () => ({ searchPlaceholder: "" })
2112
+ }
2113
+ },
2114
+ emits: [
2115
+ "update:modelValue",
2116
+ "change",
2117
+ "search",
2118
+ "load-node",
2119
+ "recursive-load",
2120
+ "load-more"
2121
+ ],
2122
+ setup(e, { expose: t, emit: n }) {
2123
+ let r = e, i = n, a = o(() => ({
2124
+ ...J,
2125
+ ...r.treeProps
2126
+ })), s = o(() => a.value.value), c = o(() => a.value.children), u = T(), f = T(r.tabs[0]?.value || ""), { allSelectedDocuments: p, getTabSelectedDocuments: m, updateTabSelection: h, removeDocument: _, setAllDocuments: v, selectionMap: y, getAllSelectedIds: x } = rn({ valueKey: a.value.value }), C = (e = p.value) => {
2127
+ i("update:modelValue", e), i("change", e);
2128
+ }, { allTabTreeDataObject: w, setAllTabsTreeData: E, updateNodeChildren: D, responseSearchHook: O, setResponseSearchHook: k } = an({
2129
+ valueKey: s.value,
2130
+ childrenKey: c.value
2131
+ });
2132
+ I(() => r.treeData, (e) => {
2133
+ E(e || {});
2134
+ }, {
2135
+ deep: !0,
2136
+ immediate: !0
2137
+ }), I(() => r.updateMeta, (e, t) => {
2138
+ if (!e || !e.updateId || e.updateId === (t?.updateId || "")) return;
2139
+ let { operation: n, context: r } = e;
2140
+ switch (n) {
2141
+ case "node-children-update":
2142
+ te(r);
2143
+ break;
2144
+ case "recursive-load":
2145
+ B(r);
2146
+ break;
2147
+ case "search":
2148
+ case "load-more":
2149
+ V(r);
2150
+ break;
2151
+ default: break;
2152
+ }
2153
+ }, {
2154
+ deep: !0,
2155
+ immediate: !1
2156
+ });
2157
+ let A = o(() => m(f.value)), j = (e) => {
2158
+ f.value = e;
2159
+ let t = m(e);
2160
+ u.value && u.value.syncSelectedNodes && g(() => {
2161
+ let e = t.map((e) => e[a.value.value]);
2162
+ u.value.syncSelectedNodes(e);
2163
+ });
2164
+ }, M = (e, t, n) => {
2165
+ g(() => {
2166
+ let r = t || [];
2167
+ h(n, [
2168
+ ...Ie(e, a.value),
2169
+ e,
2170
+ ...r
2171
+ ]), C();
2172
+ });
2173
+ }, N = (e) => {
2174
+ let { selectedNode: t, checkedNode: n, isChecked: r } = e, i = m(f.value);
2175
+ if (t = Be({
2176
+ tabKey: f.value,
2177
+ currentSelectedDocs: [n],
2178
+ treeData: w.value,
2179
+ treeProps: a.value,
2180
+ hasSelectToRightDocList: i
2181
+ }), !r) {
2182
+ h(f.value, i.filter((e) => e.id !== n.id)), C();
2183
+ return;
2184
+ }
2185
+ h(f.value, [...i, ...t]), C();
2186
+ }, F = (e) => {
2187
+ let { selectedNode: t, checkedNode: n, isChecked: r } = e, i = m(f.value);
2188
+ if (t = Be({
2189
+ tabKey: f.value,
2190
+ currentSelectedDocs: t,
2191
+ treeData: w.value,
2192
+ treeProps: a.value,
2193
+ hasSelectToRightDocList: i
2194
+ }), !n?.hasChildren) {
2195
+ h(f.value, t), C();
2196
+ return;
2197
+ }
2198
+ if (!r) {
2199
+ let e = Ie(n, a.value), t = new Set([n[s.value], ...e.map((e) => e[s.value])]), r = m(f.value).filter((e) => !t.has(e[s.value]));
2200
+ h(f.value, r), t.forEach((e) => {
2201
+ u.value?.setNodeCheckStatus && u.value.setNodeCheckStatus(e, !1);
2202
+ }), C();
2203
+ return;
2204
+ }
2205
+ if (r && n && He(n, a.value)) {
2206
+ R(n);
2207
+ return;
2208
+ } else M(n, t || [], f.value);
2209
+ }, L = (e) => {
2210
+ let t = a.value.value;
2211
+ _(e) === f.value && u.value && u.value.setNodeCheckStatus && u.value.setNodeCheckStatus(e[t], !1), C();
2212
+ }, ee = ({ node: e, tabKey: t }) => {
2213
+ let n = {};
2214
+ t === X.FEISHU_KNOWLEDGE ? n = {
2215
+ spaceId: e?.spaceId,
2216
+ parentNodeToken: e?.nodeToken
2217
+ } : t === X.MY_FILES && (n = { folderToken: e?.folderToken }), i("load-node", {
2218
+ nodeKey: e[a.value?.value],
2219
+ nodeData: e,
2220
+ tabKey: t,
2221
+ requestParams: n
2222
+ });
2223
+ }, R = (e) => {
2224
+ let t = {};
2225
+ f.value === X.FEISHU_KNOWLEDGE ? t = {
2226
+ spaceId: e?.spaceId,
2227
+ parentNodeToken: e?.nodeToken,
2228
+ recursive: !0
2229
+ } : f.value === X.MY_FILES && (t = {
2230
+ folderToken: e?.folderToken,
2231
+ recursive: !0
2232
+ }), i("recursive-load", {
2233
+ nodeKey: e[a.value?.value],
2234
+ nodeData: e,
2235
+ tabKey: f.value,
2236
+ requestParams: t
2237
+ });
2238
+ }, z = (e, t) => {
2239
+ u.value && u.value.updateNodeChildren && u.value.updateNodeChildren(e, t), f.value && D(f.value, e, t);
2240
+ }, te = (e) => {
2241
+ let { nodeKey: t, newChildren: n } = e;
2242
+ u.value?.updateNodeChildren && u.value.updateNodeChildren(t, n);
2243
+ }, B = (e) => {
2244
+ let { nodeKey: t, tabKey: n, newChildren: i, originalNode: o, nodeData: s, error: c } = e;
2245
+ if (c) return;
2246
+ let l = Ve(r.treeData[n] || [], o?.id || t, a.value);
2247
+ l && M(l, m(n || f.value), n || f.value);
2248
+ }, V = (e) => {
2249
+ let { responseSearch: t } = e;
2250
+ k(t);
2251
+ }, ne = ({ keyword: e }) => {
2252
+ i("search", { keyword: e });
2253
+ }, H = () => {
2254
+ i("load-more", f.value);
2255
+ };
2256
+ return b(() => {
2257
+ r.modelValue && r.modelValue.length > 0 && v(r.modelValue, f.value);
2258
+ }), I(() => r.modelValue, (e, t) => {
2259
+ if (!e || e.length === 0) {
2260
+ t && t.length > 0 && v([]);
2261
+ return;
2262
+ }
2263
+ let n = p.value;
2264
+ n.length === e.length && e.every((e) => n.some((t) => t[a.value.value] === e[a.value.value])) || v(e, f.value);
2265
+ }, { deep: !0 }), t({
2266
+ clearSelection: () => {
2267
+ v([]), C([]);
2268
+ },
2269
+ getSelectedDocuments: () => p.value,
2270
+ setSelectedDocuments: (e) => {
2271
+ v(e, f.value), C();
2272
+ },
2273
+ updateNodeChildren: z
2274
+ }), (t, n) => (S(), l("div", on, [d(nn, {
2275
+ tabs: e.tabs,
2276
+ "tree-data": P(w),
2277
+ "tree-props": a.value,
2278
+ "selected-documents": A.value,
2279
+ "current-tab": f.value,
2280
+ "search-type": e.searchType,
2281
+ "text-config": e.textConfig,
2282
+ "response-search-hook": P(O),
2283
+ ref_key: "leftLayoutRef",
2284
+ ref: u,
2285
+ onNodeCheck: F,
2286
+ onNodeCheckSearch: N,
2287
+ onTabChange: j,
2288
+ onSearch: ne,
2289
+ onNodeExpand: ee,
2290
+ onLoadMore: H,
2291
+ getTabSelectedDocuments: P(m)
2292
+ }, null, 8, [
2293
+ "tabs",
2294
+ "tree-data",
2295
+ "tree-props",
2296
+ "selected-documents",
2297
+ "current-tab",
2298
+ "search-type",
2299
+ "text-config",
2300
+ "response-search-hook",
2301
+ "getTabSelectedDocuments"
2302
+ ]), d(Oe, {
2303
+ "selected-documents": P(p),
2304
+ "tree-props": a.value,
2305
+ onDeleteNode: L
2306
+ }, null, 8, ["selected-documents", "tree-props"])]));
2307
+ }
2308
+ }), [["__scopeId", "data-v-c45c2d8e"]])), cn = n(Z);
2309
+ //#endregion
2310
+ export { cn as n, sn as t };