yc-component 0.1.13 → 0.1.14

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.
Files changed (31) hide show
  1. package/dist/ai-task/style.css +1 -1
  2. package/dist/image-selector/components/YcImageSelectorDialog.d.ts +1 -0
  3. package/dist/image-selector/components/YcImageSelectorDialog.d.ts.map +1 -1
  4. package/dist/image-selector/components/YcImageSelectorProvider.d.ts +17 -2
  5. package/dist/image-selector/components/YcImageSelectorProvider.d.ts.map +1 -1
  6. package/dist/image-selector/composables/useImageSelector.d.ts +2 -1
  7. package/dist/image-selector/composables/useImageSelector.d.ts.map +1 -1
  8. package/dist/image-selector/context.d.ts +4 -2
  9. package/dist/image-selector/context.d.ts.map +1 -1
  10. package/dist/image-selector/dialog-state.d.ts +6 -2
  11. package/dist/image-selector/dialog-state.d.ts.map +1 -1
  12. package/dist/image-selector/errors.d.ts +5 -0
  13. package/dist/image-selector/errors.d.ts.map +1 -0
  14. package/dist/image-selector/index.d.ts +1 -0
  15. package/dist/image-selector/index.d.ts.map +1 -1
  16. package/dist/image-selector/inject.d.ts +3 -1
  17. package/dist/image-selector/inject.d.ts.map +1 -1
  18. package/dist/image-selector/style.css +1 -1
  19. package/dist/image-selector/types/index.d.ts +2 -1
  20. package/dist/image-selector/types/index.d.ts.map +1 -1
  21. package/dist/index.css +1 -1
  22. package/dist/page-window/style.css +1 -1
  23. package/dist/yc-component.cjs.full.js +22 -22
  24. package/dist/yc-component.cjs.js +2 -2
  25. package/dist/yc-component.esm.full.js +4599 -4551
  26. package/dist/yc-component.esm.js +899 -852
  27. package/dist/yc-component.umd.full.js +38 -38
  28. package/dist/yc-component.umd.full.min.js +1 -1
  29. package/dist/yc-component.umd.js +3 -3
  30. package/dist/yc-component.umd.min.js +1 -1
  31. package/package.json +1 -1
@@ -1,54 +1,54 @@
1
- import et from "axios";
2
- import { reactive as tt, defineComponent as ue, computed as B, ref as k, watch as te, onMounted as Ue, onUnmounted as Fe, resolveComponent as O, resolveDirective as nt, openBlock as d, createBlock as M, withCtx as p, createElementVNode as _, createVNode as f, withKeys as Lt, unref as h, createCommentVNode as P, createTextVNode as q, createElementBlock as A, normalizeClass as re, toDisplayString as V, Fragment as le, renderList as ge, withDirectives as ve, withModifiers as Dt, nextTick as He, render as Bt, onBeforeUnmount as Vt, Transition as ot, normalizeStyle as Je, renderSlot as Ee, vShow as Pe, inject as Re, Teleport as Ot, provide as $e, normalizeProps as Ut, mergeProps as at, isRef as Ft } from "vue";
1
+ import ot from "axios";
2
+ import { reactive as lt, defineComponent as ce, computed as D, ref as b, watch as ne, onMounted as Re, onUnmounted as Ke, resolveComponent as V, resolveDirective as at, openBlock as d, createBlock as E, withCtx as p, createElementVNode as h, createVNode as f, withKeys as Ot, unref as w, createCommentVNode as $, createTextVNode as W, createElementBlock as M, normalizeClass as ue, toDisplayString as B, Fragment as ie, renderList as ve, withDirectives as _e, withModifiers as Ut, nextTick as Xe, render as Ft, onBeforeUnmount as Rt, Transition as it, normalizeStyle as Qe, renderSlot as Ce, vShow as Le, inject as Ne, Teleport as Kt, provide as De, normalizeProps as Nt, mergeProps as st, isRef as zt } from "vue";
3
3
  import { ElMessage as Z } from "element-plus";
4
- import { Search as Rt, Upload as Kt, Check as lt, ArrowLeft as Nt, ArrowUpBold as zt, ArrowDownBold as Yt, Switch as Gt, Close as it, Refresh as Xe, ArrowDown as Wt, CircleCheck as jt, CircleClose as qt, Remove as Ht } from "@element-plus/icons-vue";
5
- import { storeToRefs as Jt, defineStore as Xt } from "pinia";
6
- const Ke = {
4
+ import { Search as Yt, Upload as jt, Check as rt, ArrowLeft as Gt, ArrowUpBold as Wt, ArrowDownBold as qt, Switch as Ht, Close as ut, Refresh as Ze, ArrowDown as Jt, CircleCheck as Xt, CircleClose as Qt, Remove as Zt } from "@element-plus/icons-vue";
5
+ import { storeToRefs as en, defineStore as tn } from "pinia";
6
+ const ze = {
7
7
  projectId: "default-project",
8
8
  storageKey: "yc-ai-task-queue-v1"
9
9
  };
10
- let _e = { ...Ke };
11
- function Qt(e) {
12
- _e = { ..._e, ...e };
10
+ let he = { ...ze };
11
+ function nn(e) {
12
+ he = { ...he, ...e };
13
13
  }
14
- function st() {
15
- return _e;
14
+ function ct() {
15
+ return he;
16
16
  }
17
- function Zt() {
18
- return _e.projectId ?? Ke.projectId;
17
+ function on() {
18
+ return he.projectId ?? ze.projectId;
19
19
  }
20
- function rt() {
21
- return _e.storageKey ?? Ke.storageKey;
20
+ function dt() {
21
+ return he.storageKey ?? ze.storageKey;
22
22
  }
23
- let ae = null;
24
- function en() {
25
- ae = null;
23
+ let re = null;
24
+ function ln() {
25
+ re = null;
26
26
  }
27
- function ce() {
28
- if (ae) return ae;
29
- const { baseURL: e, getToken: n, onUnauthorized: t } = st();
30
- return ae = et.create({
27
+ function de() {
28
+ if (re) return re;
29
+ const { baseURL: e, getToken: n, onUnauthorized: t } = ct();
30
+ return re = ot.create({
31
31
  baseURL: e ?? "",
32
32
  timeout: 6e4,
33
33
  headers: { "Content-Type": "application/json" }
34
- }), ae.interceptors.request.use((o) => {
34
+ }), re.interceptors.request.use((o) => {
35
35
  const l = n == null ? void 0 : n();
36
36
  return l && (o.headers.Authorization = `Bearer ${l}`), o;
37
- }), ae.interceptors.response.use(
37
+ }), re.interceptors.response.use(
38
38
  (o) => {
39
39
  const l = o.data;
40
40
  return (l == null ? void 0 : l.code) != null && l.code !== 200 ? Promise.reject(new Error(l.message || "请求失败")) : (o.data = (l == null ? void 0 : l.data) ?? l, o);
41
41
  },
42
42
  (o) => {
43
- var g, w, S;
44
- ((g = o.response) == null ? void 0 : g.status) === 401 && (t == null || t());
45
- const l = (S = (w = o.response) == null ? void 0 : w.data) == null ? void 0 : S.message;
43
+ var m, y, T;
44
+ ((m = o.response) == null ? void 0 : m.status) === 401 && (t == null || t());
45
+ const l = (T = (y = o.response) == null ? void 0 : y.data) == null ? void 0 : T.message;
46
46
  return Promise.reject(new Error(l || o.message || "请求失败"));
47
47
  }
48
- ), ae;
48
+ ), re;
49
49
  }
50
- async function tn(e, n) {
51
- const o = (await ce().get(
50
+ async function an(e, n) {
51
+ const o = (await de().get(
52
52
  `/yc-ai/workflows/runs/${e}/artifacts/${n}`,
53
53
  { transformResponse: [(l) => l] }
54
54
  )).data;
@@ -60,64 +60,82 @@ async function tn(e, n) {
60
60
  }
61
61
  return o;
62
62
  }
63
- let Le = {};
64
- function nn(e) {
65
- Le = { ...Le, ...e };
63
+ let Be = {};
64
+ function sn(e) {
65
+ Be = { ...Be, ...e };
66
66
  }
67
- function Ce() {
68
- return Le;
67
+ function ke() {
68
+ return Be;
69
69
  }
70
- const Ae = "__YC_COMPONENT_IMAGE_SELECTOR__", De = "yc-component:image-selector-open";
71
- function on() {
70
+ class Se extends Error {
71
+ constructor(n = "Image selector cancelled") {
72
+ super(n), this.name = "ImageSelectorCancelledError";
73
+ }
74
+ }
75
+ let ee = null;
76
+ function rn() {
77
+ return ee && (ee.reject(new Se()), ee = null), new Promise((e, n) => {
78
+ ee = { resolve: e, reject: n };
79
+ });
80
+ }
81
+ function un(e) {
82
+ ee == null || ee.resolve(e), ee = null;
83
+ }
84
+ function et() {
85
+ ee == null || ee.reject(new Se()), ee = null;
86
+ }
87
+ const Pe = "__YC_COMPONENT_IMAGE_SELECTOR__", Ve = "yc-component:image-selector-open";
88
+ function cn() {
72
89
  const e = globalThis;
73
- return e[Ae] || (e[Ae] = tt({
90
+ return e[Pe] || (e[Pe] = lt({
74
91
  visible: !1,
75
92
  options: {}
76
- })), e[Ae];
93
+ })), e[Pe];
77
94
  }
78
- const Y = on();
79
- function an(e = {}) {
80
- Y.options = { ...e }, Y.visible = !0, globalThis.dispatchEvent(
81
- new CustomEvent(De, { detail: { ...e } })
95
+ const H = cn();
96
+ function dn(e = {}) {
97
+ H.options = { ...e }, H.visible = !0, globalThis.dispatchEvent(
98
+ new CustomEvent(Ve, { detail: { ...e } })
82
99
  );
83
100
  }
84
- function ut() {
85
- Y.visible = !1;
101
+ function ft() {
102
+ H.visible = !1;
86
103
  }
87
- function ct() {
88
- ut();
104
+ function pt() {
105
+ ft();
89
106
  }
90
- function dt(e = {}) {
91
- an(e);
107
+ function mt(e = {}) {
108
+ const n = rn();
109
+ return dn(e), n;
92
110
  }
93
- const ln = { class: "yc-image-selector" }, sn = { class: "yc-image-selector__toolbar" }, rn = { class: "yc-image-selector__body" }, un = {
111
+ const fn = { class: "yc-image-selector" }, pn = { class: "yc-image-selector__toolbar" }, mn = { class: "yc-image-selector__body" }, gn = {
94
112
  key: 0,
95
113
  class: "yc-image-selector__aside"
96
- }, cn = ["onClick"], dn = {
114
+ }, vn = ["onClick"], _n = {
97
115
  key: 0,
98
116
  class: "yc-image-selector__category-count"
99
- }, fn = { class: "yc-image-selector__main" }, pn = {
117
+ }, hn = { class: "yc-image-selector__main" }, yn = {
100
118
  key: 1,
101
119
  class: "yc-image-selector__grid"
102
- }, mn = ["onClick"], gn = { class: "yc-image-selector__thumb" }, vn = ["src", "alt", "onLoad"], _n = {
120
+ }, wn = ["onClick"], Tn = { class: "yc-image-selector__thumb" }, In = ["src", "alt", "onLoad"], Cn = {
103
121
  key: 0,
104
122
  class: "yc-image-selector__order"
105
- }, hn = ["title"], yn = {
123
+ }, Sn = ["title"], kn = {
106
124
  key: 0,
107
125
  class: "yc-image-selector__selected-bar"
108
- }, wn = { class: "yc-image-selector__selected-bar-label" }, Tn = { class: "yc-image-selector__selected-bar-list" }, In = ["onClick"], Cn = ["src", "alt"], Sn = {
126
+ }, xn = { class: "yc-image-selector__selected-bar-label" }, bn = { class: "yc-image-selector__selected-bar-list" }, An = ["onClick"], Mn = ["src", "alt"], En = {
109
127
  key: 1,
110
128
  class: "yc-image-selector__pagination"
111
- }, kn = {
129
+ }, Pn = {
112
130
  key: 0,
113
131
  class: "yc-image-selector__footer"
114
- }, xn = { class: "yc-image-selector__selected-tip" }, bn = { class: "yc-image-selector__footer-actions" }, An = {
132
+ }, $n = { class: "yc-image-selector__selected-tip" }, Ln = { class: "yc-image-selector__footer-actions" }, Dn = {
115
133
  key: 1,
116
134
  class: "yc-image-selector__footer yc-image-selector__footer--quick"
117
- }, Mn = { class: "yc-image-selector__selected-tip" }, En = /* @__PURE__ */ ue({
135
+ }, Bn = { class: "yc-image-selector__selected-tip" }, Vn = /* @__PURE__ */ ce({
118
136
  __name: "YcImageSelectorDialog",
119
137
  props: {
120
- modelValue: { type: Boolean },
138
+ modelValue: { type: [Boolean, null], default: null },
121
139
  title: { default: "选择图片" },
122
140
  multiple: { type: Boolean, default: !1 },
123
141
  maxCount: { default: 9 },
@@ -140,188 +158,188 @@ const ln = { class: "yc-image-selector" }, sn = { class: "yc-image-selector__too
140
158
  },
141
159
  emits: ["update:modelValue", "confirm", "cancel"],
142
160
  setup(e, { emit: n }) {
143
- const t = e, o = n, l = B(() => t.modelValue !== void 0), g = k(!1);
144
- te(
161
+ const t = e, o = n, l = D(() => t.modelValue != null), m = b(!1);
162
+ ne(
145
163
  () => t.modelValue,
146
164
  (i) => {
147
- l.value && (g.value = !!i);
165
+ l.value && (m.value = !!i);
148
166
  },
149
167
  { immediate: !0 }
150
- ), te(g, (i) => {
168
+ ), ne(m, (i) => {
151
169
  if (l.value) {
152
170
  o("update:modelValue", i);
153
171
  return;
154
172
  }
155
- Y.visible = i, i || ut();
156
- }), te(
157
- () => Y.visible,
173
+ H.visible = i, i || ft();
174
+ }), ne(
175
+ () => H.visible,
158
176
  (i) => {
159
- l.value || (g.value = i);
177
+ l.value || (m.value = i);
160
178
  },
161
179
  { immediate: !0 }
162
180
  );
163
- const w = B(
164
- () => (l.value ? void 0 : Y.options.title) ?? t.title ?? "选择图片"
165
- ), S = B(
166
- () => (l.value ? void 0 : Y.options.multiple) ?? t.multiple
167
- ), m = B(
168
- () => (l.value ? void 0 : Y.options.maxCount) ?? t.maxCount
169
- ), r = B(
170
- () => (l.value ? void 0 : Y.options.showModeSwitch) ?? t.showModeSwitch
171
- ), $ = B(
172
- () => (l.value ? void 0 : Y.options.showCategories) ?? t.showCategories
173
- ), F = B(() => {
181
+ const y = D(
182
+ () => (l.value ? void 0 : H.options.title) ?? t.title ?? "选择图片"
183
+ ), T = D(
184
+ () => (l.value ? void 0 : H.options.multiple) ?? t.multiple
185
+ ), v = D(
186
+ () => (l.value ? void 0 : H.options.maxCount) ?? t.maxCount
187
+ ), r = D(
188
+ () => (l.value ? void 0 : H.options.showModeSwitch) ?? t.showModeSwitch
189
+ ), I = D(
190
+ () => (l.value ? void 0 : H.options.showCategories) ?? t.showCategories
191
+ ), U = D(() => {
174
192
  var i, s;
175
193
  if ((i = t.categories) != null && i.length) return t.categories;
176
- if (!l.value && ((s = Y.options.categories) != null && s.length))
177
- return Y.options.categories;
178
- }), L = B(() => $.value ? F.value ?? H.value : []), D = B(
179
- () => (l.value ? void 0 : Y.options.confirmOnSelect) ?? t.confirmOnSelect
180
- ), N = k("single"), y = [
194
+ if (!l.value && ((s = H.options.categories) != null && s.length))
195
+ return H.options.categories;
196
+ }), R = D(() => I.value ? U.value ?? q.value : []), Y = D(
197
+ () => (l.value ? void 0 : H.options.confirmOnSelect) ?? t.confirmOnSelect
198
+ ), L = b("single"), g = [
181
199
  { label: "单选", value: "single" },
182
200
  { label: "多选", value: "multiple" }
183
- ], E = B(
184
- () => r.value ? N.value === "multiple" : S.value
185
- ), z = k(""), C = k(""), U = k(1), G = k(0), v = k(!1), T = k(!1), W = k([]), H = k([]), x = k(/* @__PURE__ */ new Map()), J = k(/* @__PURE__ */ new Map()), X = k(), ne = k(), K = B(() => [...x.value.values()]), ie = B(() => {
186
- var s, b;
201
+ ], x = D(
202
+ () => r.value ? L.value === "multiple" : T.value
203
+ ), N = b(""), k = b(""), O = b(1), j = b(0), _ = b(!1), C = b(!1), G = b([]), q = b([]), A = b(/* @__PURE__ */ new Map()), J = b(/* @__PURE__ */ new Map()), X = b(), te = b(), Q = b(!1), K = D(() => [...A.value.values()]), z = D(() => {
204
+ var s, P;
187
205
  const i = K.value.length;
188
- return D.value ? i ? `已选:${((s = K.value[0]) == null ? void 0 : s.name) || "1 张图片"}` : "单击图片即可完成选择" : i ? E.value ? `已选 ${i} / ${m.value} 张` : `已选:${((b = K.value[0]) == null ? void 0 : b.name) || "1 张图片"}` : E.value ? `多选模式:最多 ${m.value} 张` : "单选模式:请选择一张图片";
206
+ return Y.value ? i ? `已选:${((s = K.value[0]) == null ? void 0 : s.name) || "1 张图片"}` : "单击图片即可完成选择" : i ? x.value ? `已选 ${i} / ${v.value} 张` : `已选:${((P = K.value[0]) == null ? void 0 : P.name) || "1 张图片"}` : x.value ? `多选模式:最多 ${v.value} 张` : "单选模式:请选择一张图片";
189
207
  });
190
- function j(i) {
191
- const s = K.value.findIndex((b) => a(b) === a(i));
208
+ function fe(i) {
209
+ const s = K.value.findIndex((P) => u(P) === u(i));
192
210
  return s >= 0 ? s + 1 : "";
193
211
  }
194
- function de(i) {
212
+ function be(i) {
195
213
  if (i === "single" && K.value.length > 1) {
196
214
  const s = K.value[0];
197
- x.value = /* @__PURE__ */ new Map([[a(s), s]]), Z.info("已切换为单选,仅保留第一张");
215
+ A.value = /* @__PURE__ */ new Map([[u(s), s]]), Z.info("已切换为单选,仅保留第一张");
198
216
  }
199
217
  }
200
- function he() {
201
- N.value = S.value ? "multiple" : "single";
218
+ function ye() {
219
+ L.value = T.value ? "multiple" : "single";
202
220
  }
203
- function ke() {
204
- x.value = /* @__PURE__ */ new Map();
221
+ function Ae() {
222
+ A.value = /* @__PURE__ */ new Map();
205
223
  }
206
- function ye(i) {
224
+ function a(i) {
207
225
  return i[t.urlField];
208
226
  }
209
- function a(i) {
227
+ function u(i) {
210
228
  return i.id ?? i.url;
211
229
  }
212
- function u(i) {
213
- return x.value.has(a(i));
230
+ function c(i) {
231
+ return A.value.has(u(i));
214
232
  }
215
- function c(i, s) {
233
+ function F(i, s) {
216
234
  return i < s ? "portrait" : i > s ? "landscape" : "square";
217
235
  }
218
- function R(i, s) {
219
- const b = a(i);
220
- J.value.get(b) !== s && (J.value.set(b, s), J.value = new Map(J.value));
236
+ function se(i, s) {
237
+ const P = u(i);
238
+ J.value.get(P) !== s && (J.value.set(P, s), J.value = new Map(J.value));
221
239
  }
222
- function se(i) {
223
- const s = J.value.get(a(i));
240
+ function pe(i) {
241
+ const s = J.value.get(u(i));
224
242
  return s ? `yc-image-selector__img--${s}` : "";
225
243
  }
226
- function fe(i, s) {
227
- const b = i.target;
228
- !(b != null && b.naturalWidth) || !(b != null && b.naturalHeight) || R(s, c(b.naturalWidth, b.naturalHeight));
244
+ function xt(i, s) {
245
+ const P = i.target;
246
+ !(P != null && P.naturalWidth) || !(P != null && P.naturalHeight) || se(s, F(P.naturalWidth, P.naturalHeight));
229
247
  }
230
- function Ct(i) {
231
- i.width && i.height && R(i, c(i.width, i.height));
248
+ function bt(i) {
249
+ i.width && i.height && se(i, F(i.width, i.height));
232
250
  }
233
- function Ye(i) {
251
+ function Ge(i) {
234
252
  const s = /* @__PURE__ */ new Map();
235
253
  if (!(i != null && i.length)) {
236
- x.value = s;
254
+ A.value = s;
237
255
  return;
238
256
  }
239
257
  if (typeof i[0] == "string")
240
- for (const Q of i)
241
- s.set(Q, { id: Q, url: Q, name: Q.split("/").pop() });
258
+ for (const le of i)
259
+ s.set(le, { id: le, url: le, name: le.split("/").pop() });
242
260
  else
243
- for (const Q of i)
244
- s.set(a(Q), Q);
245
- x.value = s;
261
+ for (const le of i)
262
+ s.set(u(le), le);
263
+ A.value = s;
246
264
  }
247
- function xe(i) {
248
- X.value = i.onConfirm, ne.value = i.onCancel, Ye(i.selected ?? t.selected);
265
+ function Me(i) {
266
+ X.value = i.onConfirm, te.value = i.onCancel, Ge(i.selected ?? t.selected);
249
267
  }
250
- function Ge(i) {
268
+ function We(i) {
251
269
  if (l.value) return;
252
270
  const s = i.detail ?? {};
253
- xe(s), g.value = !0;
271
+ Me(s), m.value = !0;
254
272
  }
255
- Ue(() => {
256
- globalThis.addEventListener(De, Ge), l.value || (g.value = Y.visible);
257
- }), Fe(() => {
258
- globalThis.removeEventListener(De, Ge);
273
+ Re(() => {
274
+ globalThis.addEventListener(Ve, We), l.value || (m.value = H.visible);
275
+ }), Ke(() => {
276
+ globalThis.removeEventListener(Ve, We);
259
277
  });
260
- async function be() {
278
+ async function Ee() {
261
279
  var i;
262
280
  if (!t.getImages) {
263
281
  Z.error("请通过 props.getImages 传入图片列表请求方法");
264
282
  return;
265
283
  }
266
- v.value = !0;
284
+ _.value = !0;
267
285
  try {
268
286
  const s = await t.getImages({
269
- keyword: z.value.trim() || void 0,
270
- category: $.value && C.value || void 0,
271
- page: U.value,
287
+ keyword: N.value.trim() || void 0,
288
+ category: I.value && k.value || void 0,
289
+ page: O.value,
272
290
  pageSize: t.pageSize
273
291
  });
274
- W.value = s.list, G.value = s.total;
275
- for (const b of s.list)
276
- Ct(b);
277
- $.value && !F.value && ((i = s.categories) != null && i.length) && (H.value = s.categories);
292
+ G.value = s.list, j.value = s.total;
293
+ for (const P of s.list)
294
+ bt(P);
295
+ I.value && !U.value && ((i = s.categories) != null && i.length) && (q.value = s.categories);
278
296
  } catch (s) {
279
297
  Z.error(s instanceof Error ? s.message : "加载图片失败");
280
298
  } finally {
281
- v.value = !1;
299
+ _.value = !1;
282
300
  }
283
301
  }
284
302
  function we() {
285
- U.value = 1, be();
303
+ O.value = 1, Ee();
286
304
  }
287
- function We(i) {
288
- C.value !== i && (C.value = i, we());
305
+ function qe(i) {
306
+ k.value !== i && (k.value = i, we());
289
307
  }
290
- function je(i) {
291
- const s = a(i);
292
- if (E.value) {
293
- if (x.value.has(s)) {
294
- x.value.delete(s), x.value = new Map(x.value);
308
+ function He(i) {
309
+ const s = u(i);
310
+ if (x.value) {
311
+ if (A.value.has(s)) {
312
+ A.value.delete(s), A.value = new Map(A.value);
295
313
  return;
296
314
  }
297
- if (K.value.length >= m.value) {
298
- Z.warning(`最多选择 ${m.value} 张图片`);
315
+ if (K.value.length >= v.value) {
316
+ Z.warning(`最多选择 ${v.value} 张图片`);
299
317
  return;
300
318
  }
301
- x.value.set(s, i), x.value = new Map(x.value);
319
+ A.value.set(s, i), A.value = new Map(A.value);
302
320
  return;
303
321
  }
304
- if (x.value.has(s)) {
305
- if (D.value) {
306
- He(() => Te());
322
+ if (A.value.has(s)) {
323
+ if (Y.value) {
324
+ Xe(() => Te());
307
325
  return;
308
326
  }
309
- x.value = /* @__PURE__ */ new Map();
327
+ A.value = /* @__PURE__ */ new Map();
310
328
  return;
311
329
  }
312
- x.value = /* @__PURE__ */ new Map([[s, i]]), D.value && He(() => Te());
330
+ A.value = /* @__PURE__ */ new Map([[s, i]]), Y.value && Xe(() => Te());
313
331
  }
314
- async function St(i) {
332
+ async function At(i) {
315
333
  if (!t.upload) {
316
334
  Z.error("请通过 props.upload 传入图片上传方法");
317
335
  return;
318
336
  }
319
- T.value = !0;
337
+ C.value = !0;
320
338
  try {
321
339
  const { resource: s } = await t.upload(i.file);
322
- if (Z.success("上传成功"), E.value)
323
- K.value.length < m.value && (x.value.set(a(s), s), x.value = new Map(x.value));
324
- else if (x.value = /* @__PURE__ */ new Map([[a(s), s]]), D.value) {
340
+ if (Z.success("上传成功"), x.value)
341
+ K.value.length < v.value && (A.value.set(u(s), s), A.value = new Map(A.value));
342
+ else if (A.value = /* @__PURE__ */ new Map([[u(s), s]]), Y.value) {
325
343
  Te();
326
344
  return;
327
345
  }
@@ -329,80 +347,85 @@ const ln = { class: "yc-image-selector" }, sn = { class: "yc-image-selector__too
329
347
  } catch (s) {
330
348
  Z.error(s instanceof Error ? s.message : "上传失败");
331
349
  } finally {
332
- T.value = !1;
350
+ C.value = !1;
333
351
  }
334
352
  }
335
- function kt() {
336
- z.value = "", C.value = "", U.value = 1, H.value = [], J.value = /* @__PURE__ */ new Map(), he(), l.value ? xe({}) : xe(Y.options), he(), be();
353
+ function Mt() {
354
+ Q.value = !1, N.value = "", k.value = "", O.value = 1, q.value = [], J.value = /* @__PURE__ */ new Map(), ye(), l.value ? Me({}) : Me(H.options), ye(), Ee();
337
355
  }
338
- function xt() {
339
- T.value = !1;
356
+ function Et() {
357
+ C.value = !1;
340
358
  }
341
- function qe() {
342
- var i, s, b;
343
- (i = ne.value) == null || i.call(ne), l.value || (b = (s = Y.options).onCancel) == null || b.call(s), o("cancel"), g.value = !1;
359
+ function Je() {
360
+ var i;
361
+ Q.value || (Q.value = !0, (i = te.value) == null || i.call(te), l.value || et(), o("cancel"), m.value = !1);
344
362
  }
345
363
  function Te() {
346
- var s, b, Q;
364
+ var s;
347
365
  if (!K.value.length) {
348
366
  Z.warning("请选择图片");
349
367
  return;
350
368
  }
369
+ if (Q.value) return;
370
+ Q.value = !0;
351
371
  const i = [...K.value];
352
372
  if (l.value) {
353
- o("confirm", i), g.value = !1;
373
+ o("confirm", i), m.value = !1;
354
374
  return;
355
375
  }
356
- (s = X.value) == null || s.call(X, i), (Q = (b = Y.options).onConfirm) == null || Q.call(b, i), o("confirm", i), g.value = !1;
376
+ (s = X.value) == null || s.call(X, i), l.value || un(i), o("confirm", i), m.value = !1;
357
377
  }
358
- return te(
378
+ return ne(m, (i, s) => {
379
+ var P;
380
+ s && !i && !Q.value && ((P = te.value) == null || P.call(te), l.value || et(), o("cancel"));
381
+ }), ne(
359
382
  () => t.selected,
360
383
  (i) => {
361
- g.value || Ye(i);
384
+ m.value || Ge(i);
362
385
  },
363
386
  { deep: !0 }
364
387
  ), (i, s) => {
365
- const b = O("el-icon"), Q = O("el-input"), bt = O("el-segmented"), pe = O("el-button"), At = O("el-upload"), Mt = O("el-empty"), Et = O("el-pagination"), Pt = O("el-dialog"), $t = nt("loading");
366
- return d(), M(Pt, {
367
- modelValue: g.value,
368
- "onUpdate:modelValue": s[4] || (s[4] = (I) => g.value = I),
369
- title: w.value,
388
+ const P = V("el-icon"), le = V("el-input"), Pt = V("el-segmented"), me = V("el-button"), $t = V("el-upload"), Lt = V("el-empty"), Dt = V("el-pagination"), Bt = V("el-dialog"), Vt = at("loading");
389
+ return d(), E(Bt, {
390
+ modelValue: m.value,
391
+ "onUpdate:modelValue": s[4] || (s[4] = (S) => m.value = S),
392
+ title: y.value,
370
393
  width: e.width,
371
394
  "append-to-body": "",
372
395
  "destroy-on-close": "",
373
396
  class: "yc-image-selector-dialog",
374
- onClosed: xt,
375
- onOpen: kt
397
+ onClosed: Et,
398
+ onOpen: Mt
376
399
  }, {
377
400
  footer: p(() => [
378
- D.value ? (d(), A("div", An, [
379
- _("span", Mn, V(ie.value), 1),
380
- f(pe, {
401
+ Y.value ? (d(), M("div", Dn, [
402
+ h("span", Bn, B(z.value), 1),
403
+ f(me, {
381
404
  link: "",
382
405
  type: "primary",
383
- onClick: qe
406
+ onClick: Je
384
407
  }, {
385
408
  default: p(() => [
386
- q(V(e.cancelText), 1)
409
+ W(B(e.cancelText), 1)
387
410
  ]),
388
411
  _: 1
389
412
  })
390
- ])) : (d(), A("div", kn, [
391
- _("span", xn, V(ie.value), 1),
392
- _("div", bn, [
393
- f(pe, { onClick: qe }, {
413
+ ])) : (d(), M("div", Pn, [
414
+ h("span", $n, B(z.value), 1),
415
+ h("div", Ln, [
416
+ f(me, { onClick: Je }, {
394
417
  default: p(() => [
395
- q(V(e.cancelText), 1)
418
+ W(B(e.cancelText), 1)
396
419
  ]),
397
420
  _: 1
398
421
  }),
399
- f(pe, {
422
+ f(me, {
400
423
  type: "primary",
401
424
  disabled: !K.value.length,
402
425
  onClick: Te
403
426
  }, {
404
427
  default: p(() => [
405
- q(V(e.confirmText), 1)
428
+ W(B(e.confirmText), 1)
406
429
  ]),
407
430
  _: 1
408
431
  }, 8, ["disabled"])
@@ -410,182 +433,182 @@ const ln = { class: "yc-image-selector" }, sn = { class: "yc-image-selector__too
410
433
  ]))
411
434
  ]),
412
435
  default: p(() => [
413
- _("div", ln, [
414
- _("div", sn, [
415
- f(Q, {
416
- modelValue: z.value,
417
- "onUpdate:modelValue": s[0] || (s[0] = (I) => z.value = I),
436
+ h("div", fn, [
437
+ h("div", pn, [
438
+ f(le, {
439
+ modelValue: N.value,
440
+ "onUpdate:modelValue": s[0] || (s[0] = (S) => N.value = S),
418
441
  clearable: "",
419
442
  placeholder: "搜索图片名称",
420
443
  class: "yc-image-selector__search",
421
- onKeyup: Lt(we, ["enter"]),
444
+ onKeyup: Ot(we, ["enter"]),
422
445
  onClear: we
423
446
  }, {
424
447
  prefix: p(() => [
425
- f(b, null, {
448
+ f(P, null, {
426
449
  default: p(() => [
427
- f(h(Rt))
450
+ f(w(Yt))
428
451
  ]),
429
452
  _: 1
430
453
  })
431
454
  ]),
432
455
  _: 1
433
456
  }, 8, ["modelValue"]),
434
- r.value ? (d(), M(bt, {
457
+ r.value ? (d(), E(Pt, {
435
458
  key: 0,
436
- modelValue: N.value,
437
- "onUpdate:modelValue": s[1] || (s[1] = (I) => N.value = I),
438
- options: y,
459
+ modelValue: L.value,
460
+ "onUpdate:modelValue": s[1] || (s[1] = (S) => L.value = S),
461
+ options: g,
439
462
  class: "yc-image-selector__mode",
440
- onChange: de
441
- }, null, 8, ["modelValue"])) : P("", !0),
442
- e.showUpload && e.upload ? (d(), M(At, {
463
+ onChange: be
464
+ }, null, 8, ["modelValue"])) : $("", !0),
465
+ e.showUpload && e.upload ? (d(), E($t, {
443
466
  key: 1,
444
467
  "show-file-list": !1,
445
468
  accept: e.accept,
446
- "http-request": St,
447
- disabled: T.value
469
+ "http-request": At,
470
+ disabled: C.value
448
471
  }, {
449
472
  default: p(() => [
450
- f(pe, {
473
+ f(me, {
451
474
  type: "primary",
452
475
  plain: "",
453
- loading: T.value
476
+ loading: C.value
454
477
  }, {
455
478
  default: p(() => [
456
- f(b, { class: "m-r-4" }, {
479
+ f(P, { class: "m-r-4" }, {
457
480
  default: p(() => [
458
- f(h(Kt))
481
+ f(w(jt))
459
482
  ]),
460
483
  _: 1
461
484
  }),
462
- s[5] || (s[5] = q(" 上传图片 ", -1))
485
+ s[5] || (s[5] = W(" 上传图片 ", -1))
463
486
  ]),
464
487
  _: 1
465
488
  }, 8, ["loading"])
466
489
  ]),
467
490
  _: 1
468
- }, 8, ["accept", "disabled"])) : P("", !0)
491
+ }, 8, ["accept", "disabled"])) : $("", !0)
469
492
  ]),
470
- _("div", rn, [
471
- $.value ? (d(), A("aside", un, [
472
- _("div", {
473
- class: re(["yc-image-selector__category", { "is-active": C.value === "" }]),
474
- onClick: s[2] || (s[2] = (I) => We(""))
475
- }, V(e.categoryAllLabel), 3),
476
- (d(!0), A(le, null, ge(L.value, (I) => (d(), A("div", {
477
- key: I.id,
478
- class: re(["yc-image-selector__category", { "is-active": C.value === I.id }]),
479
- onClick: (Ie) => We(I.id)
493
+ h("div", mn, [
494
+ I.value ? (d(), M("aside", gn, [
495
+ h("div", {
496
+ class: ue(["yc-image-selector__category", { "is-active": k.value === "" }]),
497
+ onClick: s[2] || (s[2] = (S) => qe(""))
498
+ }, B(e.categoryAllLabel), 3),
499
+ (d(!0), M(ie, null, ve(R.value, (S) => (d(), M("div", {
500
+ key: S.id,
501
+ class: ue(["yc-image-selector__category", { "is-active": k.value === S.id }]),
502
+ onClick: (Ie) => qe(S.id)
480
503
  }, [
481
- _("span", null, V(I.name), 1),
482
- I.count != null ? (d(), A("span", dn, V(I.count), 1)) : P("", !0)
483
- ], 10, cn))), 128))
484
- ])) : P("", !0),
485
- ve((d(), A("div", fn, [
486
- !v.value && !W.value.length ? (d(), M(Mt, {
504
+ h("span", null, B(S.name), 1),
505
+ S.count != null ? (d(), M("span", _n, B(S.count), 1)) : $("", !0)
506
+ ], 10, vn))), 128))
507
+ ])) : $("", !0),
508
+ _e((d(), M("div", hn, [
509
+ !_.value && !G.value.length ? (d(), E(Lt, {
487
510
  key: 0,
488
511
  description: e.emptyText
489
- }, null, 8, ["description"])) : (d(), A("div", pn, [
490
- (d(!0), A(le, null, ge(W.value, (I) => (d(), A("div", {
491
- key: String(I.id),
492
- class: re(["yc-image-selector__item", {
493
- "is-selected": u(I),
494
- "is-single-mode": !E.value,
495
- "is-multi-mode": E.value
512
+ }, null, 8, ["description"])) : (d(), M("div", yn, [
513
+ (d(!0), M(ie, null, ve(G.value, (S) => (d(), M("div", {
514
+ key: String(S.id),
515
+ class: ue(["yc-image-selector__item", {
516
+ "is-selected": c(S),
517
+ "is-single-mode": !x.value,
518
+ "is-multi-mode": x.value
496
519
  }]),
497
- onClick: (Ie) => je(I)
520
+ onClick: (Ie) => He(S)
498
521
  }, [
499
- _("div", gn, [
500
- _("img", {
501
- src: ye(I),
502
- alt: I.name || "image",
522
+ h("div", Tn, [
523
+ h("img", {
524
+ src: a(S),
525
+ alt: S.name || "image",
503
526
  loading: "lazy",
504
- class: re(se(I)),
505
- onLoad: (Ie) => fe(Ie, I)
506
- }, null, 42, vn),
507
- _("div", {
508
- class: re(["yc-image-selector__indicator", {
509
- "is-checked": u(I),
510
- "is-radio": !E.value,
511
- "is-checkbox": E.value
527
+ class: ue(pe(S)),
528
+ onLoad: (Ie) => xt(Ie, S)
529
+ }, null, 42, In),
530
+ h("div", {
531
+ class: ue(["yc-image-selector__indicator", {
532
+ "is-checked": c(S),
533
+ "is-radio": !x.value,
534
+ "is-checkbox": x.value
512
535
  }])
513
536
  }, [
514
- u(I) && E.value ? (d(), A("span", _n, V(j(I)), 1)) : u(I) ? (d(), M(b, { key: 1 }, {
537
+ c(S) && x.value ? (d(), M("span", Cn, B(fe(S)), 1)) : c(S) ? (d(), E(P, { key: 1 }, {
515
538
  default: p(() => [
516
- f(h(lt))
539
+ f(w(rt))
517
540
  ]),
518
541
  _: 1
519
- })) : P("", !0)
542
+ })) : $("", !0)
520
543
  ], 2)
521
544
  ]),
522
- _("div", {
545
+ h("div", {
523
546
  class: "yc-image-selector__meta",
524
- title: I.name
525
- }, V(I.name || "未命名"), 9, hn)
526
- ], 10, mn))), 128))
547
+ title: S.name
548
+ }, B(S.name || "未命名"), 9, Sn)
549
+ ], 10, wn))), 128))
527
550
  ]))
528
551
  ])), [
529
- [$t, v.value]
552
+ [Vt, _.value]
530
553
  ])
531
554
  ]),
532
- E.value && K.value.length ? (d(), A("div", yn, [
533
- _("span", wn, "已选 " + V(K.value.length) + " 张", 1),
534
- _("div", Tn, [
535
- (d(!0), A(le, null, ge(K.value, (I) => (d(), A("div", {
536
- key: String(I.id),
555
+ x.value && K.value.length ? (d(), M("div", kn, [
556
+ h("span", xn, "已选 " + B(K.value.length) + " 张", 1),
557
+ h("div", bn, [
558
+ (d(!0), M(ie, null, ve(K.value, (S) => (d(), M("div", {
559
+ key: String(S.id),
537
560
  class: "yc-image-selector__selected-chip",
538
- onClick: Dt((Ie) => je(I), ["stop"])
561
+ onClick: Ut((Ie) => He(S), ["stop"])
539
562
  }, [
540
- _("img", {
541
- src: ye(I),
542
- alt: I.name
543
- }, null, 8, Cn),
544
- s[6] || (s[6] = _("span", { class: "yc-image-selector__selected-chip-remove" }, "×", -1))
545
- ], 8, In))), 128))
563
+ h("img", {
564
+ src: a(S),
565
+ alt: S.name
566
+ }, null, 8, Mn),
567
+ s[6] || (s[6] = h("span", { class: "yc-image-selector__selected-chip-remove" }, "×", -1))
568
+ ], 8, An))), 128))
546
569
  ]),
547
- f(pe, {
570
+ f(me, {
548
571
  link: "",
549
572
  type: "primary",
550
- onClick: ke
573
+ onClick: Ae
551
574
  }, {
552
575
  default: p(() => [...s[7] || (s[7] = [
553
- q("清空", -1)
576
+ W("清空", -1)
554
577
  ])]),
555
578
  _: 1
556
579
  })
557
- ])) : P("", !0),
558
- G.value > 0 ? (d(), A("div", Sn, [
559
- f(Et, {
560
- "current-page": U.value,
561
- "onUpdate:currentPage": s[3] || (s[3] = (I) => U.value = I),
580
+ ])) : $("", !0),
581
+ j.value > 0 ? (d(), M("div", En, [
582
+ f(Dt, {
583
+ "current-page": O.value,
584
+ "onUpdate:currentPage": s[3] || (s[3] = (S) => O.value = S),
562
585
  background: "",
563
586
  layout: "total, prev, pager, next, jumper",
564
587
  "page-size": e.pageSize,
565
- total: G.value,
566
- onCurrentChange: be
588
+ total: j.value,
589
+ onCurrentChange: Ee
567
590
  }, null, 8, ["current-page", "page-size", "total"])
568
- ])) : P("", !0)
591
+ ])) : $("", !0)
569
592
  ])
570
593
  ]),
571
594
  _: 1
572
595
  }, 8, ["modelValue", "title", "width"]);
573
596
  };
574
597
  }
575
- }), Se = (e, n) => {
598
+ }), xe = (e, n) => {
576
599
  const t = e.__vccOpts || e;
577
600
  for (const [o, l] of n)
578
601
  t[o] = l;
579
602
  return t;
580
- }, ft = /* @__PURE__ */ Se(En, [["__scopeId", "data-v-8775c816"]]);
581
- function pt() {
582
- const { baseURL: e = "" } = Ce();
583
- return et.create({ baseURL: e, timeout: 3e4 });
603
+ }, gt = /* @__PURE__ */ xe(Vn, [["__scopeId", "data-v-88947fca"]]);
604
+ function vt() {
605
+ const { baseURL: e = "" } = ke();
606
+ return ot.create({ baseURL: e, timeout: 3e4 });
584
607
  }
585
- async function Pn(e) {
586
- const n = Ce().fetchImages;
608
+ async function On(e) {
609
+ const n = ke().fetchImages;
587
610
  if (n) return n(e);
588
- const t = pt(), { data: o } = await t.get(
611
+ const t = vt(), { data: o } = await t.get(
589
612
  "/yc-media/images",
590
613
  { params: e }
591
614
  );
@@ -593,10 +616,10 @@ async function Pn(e) {
593
616
  throw new Error("加载图片资源失败");
594
617
  return o.data;
595
618
  }
596
- async function $n(e) {
597
- const n = Ce().uploadImage;
619
+ async function Un(e) {
620
+ const n = ke().uploadImage;
598
621
  if (n) return n(e);
599
- const t = pt(), o = new FormData();
622
+ const t = vt(), o = new FormData();
600
623
  o.append("file", e);
601
624
  const { data: l } = await t.post(
602
625
  "/yc-media/images/upload",
@@ -607,30 +630,30 @@ async function $n(e) {
607
630
  throw new Error("上传图片失败");
608
631
  return l.data;
609
632
  }
610
- const Qe = "__YC_IMAGE_SELECTOR_MOUNT__";
611
- function Ln(e) {
633
+ const tt = "__YC_IMAGE_SELECTOR_MOUNT__";
634
+ function Fn(e) {
612
635
  const n = globalThis;
613
- if (n[Qe] || typeof document > "u") return;
636
+ if (n[tt] || typeof document > "u") return;
614
637
  const t = document.createElement("div");
615
638
  t.setAttribute("data-yc-image-selector-host", ""), document.body.appendChild(t);
616
- const o = Ce().dialog ?? {}, l = f(ft, {
617
- getImages: Pn,
618
- upload: $n,
639
+ const o = ke().dialog ?? {}, l = f(gt, {
640
+ getImages: On,
641
+ upload: Un,
619
642
  showUpload: o.showUpload ?? !0,
620
643
  ...o
621
644
  });
622
- l.appContext = e._context, Bt(l, t), n[Qe] = !0;
645
+ l.appContext = e._context, Ft(l, t), n[tt] = !0;
623
646
  }
624
- function Dn(e) {
625
- e.config.globalProperties.openImageSelector = dt, e.config.globalProperties.closeImageSelector = ct;
647
+ function Rn(e) {
648
+ e.config.globalProperties.openImageSelector = mt, e.config.globalProperties.closeImageSelector = pt;
626
649
  }
627
- function Bn(e) {
628
- Ln(e), Dn(e);
650
+ function Kn(e) {
651
+ Fn(e), Rn(e);
629
652
  }
630
- const Vn = { class: "yc-page-window__header" }, On = { class: "yc-page-window__title" }, Un = {
653
+ const Nn = { class: "yc-page-window__header" }, zn = { class: "yc-page-window__title" }, Yn = {
631
654
  key: 0,
632
655
  class: "yc-page-window__nav"
633
- }, Fn = { class: "yc-page-window__opera" }, Rn = { class: "yc-page-window__content" }, Kn = /* @__PURE__ */ ue({
656
+ }, jn = { class: "yc-page-window__opera" }, Gn = { class: "yc-page-window__content" }, Wn = /* @__PURE__ */ ce({
634
657
  __name: "YcPageWindow",
635
658
  props: {
636
659
  visible: { type: Boolean },
@@ -650,90 +673,90 @@ const Vn = { class: "yc-page-window__header" }, On = { class: "yc-page-window__t
650
673
  },
651
674
  emits: ["update:visible", "update:type", "confirm", "close", "opened", "changeType", "prev", "next", "checkRow"],
652
675
  setup(e, { expose: n, emit: t }) {
653
- const o = e, l = t, g = k(!1), w = B(() => o.loading || g.value), S = B(() => o.type === "detail" ? "详情" : o.type === "edit" ? "编辑" : o.type === "add" ? "新增" : ""), m = B(
676
+ const o = e, l = t, m = b(!1), y = D(() => o.loading || m.value), T = D(() => o.type === "detail" ? "详情" : o.type === "edit" ? "编辑" : o.type === "add" ? "新增" : ""), v = D(
654
677
  () => o.list.length > 0 && o.row != null
655
- ), r = B(
678
+ ), r = D(
656
679
  () => ["detail", "edit"].includes(o.type)
657
- ), $ = B(() => o.type !== "detail");
658
- function F() {
680
+ ), I = D(() => o.type !== "detail");
681
+ function U() {
659
682
  if (!o.row) return -1;
660
- const C = o.rowKey, U = o.row[C];
661
- return o.list.findIndex((G) => G[C] === U);
683
+ const k = o.rowKey, O = o.row[k];
684
+ return o.list.findIndex((j) => j[k] === O);
662
685
  }
663
- function L(C) {
664
- const U = F();
665
- return U < 0 ? !0 : C === "prev" ? U <= 0 : U >= o.list.length - 1;
686
+ function R(k) {
687
+ const O = U();
688
+ return O < 0 ? !0 : k === "prev" ? O <= 0 : O >= o.list.length - 1;
666
689
  }
667
- function D() {
668
- const C = F();
669
- if (C <= 0) return;
670
- const U = o.list[C - 1];
671
- l("checkRow", U), l("prev", U);
690
+ function Y() {
691
+ const k = U();
692
+ if (k <= 0) return;
693
+ const O = o.list[k - 1];
694
+ l("checkRow", O), l("prev", O);
672
695
  }
673
- function N() {
674
- const C = F();
675
- if (C < 0 || C >= o.list.length - 1) return;
676
- const U = o.list[C + 1];
677
- l("checkRow", U), l("next", U);
696
+ function L() {
697
+ const k = U();
698
+ if (k < 0 || k >= o.list.length - 1) return;
699
+ const O = o.list[k + 1];
700
+ l("checkRow", O), l("next", O);
678
701
  }
679
- function y() {
680
- const C = o.type === "detail" ? "edit" : "detail";
681
- l("update:type", C), l("changeType");
702
+ function g() {
703
+ const k = o.type === "detail" ? "edit" : "detail";
704
+ l("update:type", k), l("changeType");
682
705
  }
683
- function E() {
706
+ function x() {
684
707
  l("update:visible", !1), l("close");
685
708
  }
686
- function z() {
687
- g.value = !0, l("confirm", (C) => {
688
- g.value = !1, C && E();
709
+ function N() {
710
+ m.value = !0, l("confirm", (k) => {
711
+ m.value = !1, k && x();
689
712
  });
690
713
  }
691
- return te(
714
+ return ne(
692
715
  () => o.visible,
693
- (C) => {
694
- C && l("opened");
716
+ (k) => {
717
+ k && l("opened");
695
718
  }
696
- ), Vt(() => {
697
- o.visible && E();
698
- }), n({ closeWindow: E }), (C, U) => {
699
- const G = O("el-icon"), v = O("el-button"), T = O("el-tooltip"), W = O("el-scrollbar"), H = nt("loading");
700
- return d(), M(ot, {
719
+ ), Rt(() => {
720
+ o.visible && x();
721
+ }), n({ closeWindow: x }), (k, O) => {
722
+ const j = V("el-icon"), _ = V("el-button"), C = V("el-tooltip"), G = V("el-scrollbar"), q = at("loading");
723
+ return d(), E(it, {
701
724
  name: "yc-page-window-fade",
702
725
  mode: "out-in"
703
726
  }, {
704
727
  default: p(() => [
705
- ve(_("div", {
728
+ _e(h("div", {
706
729
  class: "yc-page-window",
707
- style: Je({ zIndex: e.zIndex })
730
+ style: Qe({ zIndex: e.zIndex })
708
731
  }, [
709
- _("div", Vn, [
710
- _("div", On, [
711
- f(G, {
732
+ h("div", Nn, [
733
+ h("div", zn, [
734
+ f(j, {
712
735
  class: "yc-page-window__back",
713
- onClick: E
736
+ onClick: x
714
737
  }, {
715
738
  default: p(() => [
716
- f(h(Nt))
739
+ f(w(Gt))
717
740
  ]),
718
741
  _: 1
719
742
  }),
720
- _("span", null, V(e.title) + V(S.value), 1),
721
- m.value ? (d(), A("div", Un, [
722
- f(T, {
743
+ h("span", null, B(e.title) + B(T.value), 1),
744
+ v.value ? (d(), M("div", Yn, [
745
+ f(C, {
723
746
  content: "上一条",
724
747
  placement: "top"
725
748
  }, {
726
749
  default: p(() => [
727
- f(v, {
750
+ f(_, {
728
751
  round: "",
729
752
  text: "",
730
- disabled: L("prev"),
731
- onClick: D
753
+ disabled: R("prev"),
754
+ onClick: Y
732
755
  }, {
733
756
  default: p(() => [
734
- f(G, null, {
757
+ f(j, null, {
735
758
  default: p(() => [
736
- f(h(zt))
759
+ f(w(Wt))
737
760
  ]),
738
761
  _: 1
739
762
  })
@@ -743,21 +766,21 @@ const Vn = { class: "yc-page-window__header" }, On = { class: "yc-page-window__t
743
766
  ]),
744
767
  _: 1
745
768
  }),
746
- f(T, {
769
+ f(C, {
747
770
  content: "下一条",
748
771
  placement: "top"
749
772
  }, {
750
773
  default: p(() => [
751
- f(v, {
774
+ f(_, {
752
775
  round: "",
753
776
  text: "",
754
- disabled: L("next"),
755
- onClick: N
777
+ disabled: R("next"),
778
+ onClick: L
756
779
  }, {
757
780
  default: p(() => [
758
- f(G, null, {
781
+ f(j, null, {
759
782
  default: p(() => [
760
- f(h(Yt))
783
+ f(w(qt))
761
784
  ]),
762
785
  _: 1
763
786
  })
@@ -767,146 +790,146 @@ const Vn = { class: "yc-page-window__header" }, On = { class: "yc-page-window__t
767
790
  ]),
768
791
  _: 1
769
792
  })
770
- ])) : P("", !0),
771
- r.value ? (d(), M(v, {
793
+ ])) : $("", !0),
794
+ r.value ? (d(), E(_, {
772
795
  key: 1,
773
796
  text: "",
774
797
  class: "yc-page-window__type-switch",
775
798
  type: e.type === "detail" ? "primary" : "success",
776
- onClick: y
799
+ onClick: g
777
800
  }, {
778
801
  default: p(() => [
779
- f(G, { class: "m-r-4" }, {
802
+ f(j, { class: "m-r-4" }, {
780
803
  default: p(() => [
781
- f(h(Gt))
804
+ f(w(Ht))
782
805
  ]),
783
806
  _: 1
784
807
  }),
785
- q(" " + V(e.type === "detail" ? "切换编辑" : "切换详情"), 1)
808
+ W(" " + B(e.type === "detail" ? "切换编辑" : "切换详情"), 1)
786
809
  ]),
787
810
  _: 1
788
- }, 8, ["type"])) : P("", !0)
811
+ }, 8, ["type"])) : $("", !0)
789
812
  ]),
790
- _("div", Fn, [
791
- Ee(C.$slots, "opera", {}, void 0, !0),
792
- e.showButtons && $.value ? (d(), A(le, { key: 0 }, [
793
- f(v, {
813
+ h("div", jn, [
814
+ Ce(k.$slots, "opera", {}, void 0, !0),
815
+ e.showButtons && I.value ? (d(), M(ie, { key: 0 }, [
816
+ f(_, {
794
817
  text: "",
795
- disabled: w.value,
796
- onClick: E
818
+ disabled: y.value,
819
+ onClick: x
797
820
  }, {
798
821
  default: p(() => [
799
- f(G, { class: "m-r-4" }, {
822
+ f(j, { class: "m-r-4" }, {
800
823
  default: p(() => [
801
- f(h(it))
824
+ f(w(ut))
802
825
  ]),
803
826
  _: 1
804
827
  }),
805
- q(" " + V(e.cancelText), 1)
828
+ W(" " + B(e.cancelText), 1)
806
829
  ]),
807
830
  _: 1
808
831
  }, 8, ["disabled"]),
809
- e.showConfirm ? (d(), M(v, {
832
+ e.showConfirm ? (d(), E(_, {
810
833
  key: 0,
811
834
  type: "primary",
812
- loading: w.value,
835
+ loading: y.value,
813
836
  disabled: e.disabled,
814
- onClick: z
837
+ onClick: N
815
838
  }, {
816
839
  default: p(() => [
817
- f(G, { class: "m-r-4" }, {
840
+ f(j, { class: "m-r-4" }, {
818
841
  default: p(() => [
819
- f(h(lt))
842
+ f(w(rt))
820
843
  ]),
821
844
  _: 1
822
845
  }),
823
- q(" " + V(e.confirmText), 1)
846
+ W(" " + B(e.confirmText), 1)
824
847
  ]),
825
848
  _: 1
826
- }, 8, ["loading", "disabled"])) : P("", !0)
827
- ], 64)) : P("", !0)
849
+ }, 8, ["loading", "disabled"])) : $("", !0)
850
+ ], 64)) : $("", !0)
828
851
  ])
829
852
  ]),
830
- ve((d(), A("div", Rn, [
831
- f(W, { class: "yc-page-window__scroll" }, {
853
+ _e((d(), M("div", Gn, [
854
+ f(G, { class: "yc-page-window__scroll" }, {
832
855
  default: p(() => [
833
- e.visible ? (d(), A("div", {
856
+ e.visible ? (d(), M("div", {
834
857
  key: 0,
835
858
  class: "yc-page-window__body",
836
- style: Je({ minHeight: e.contentMinHeight })
859
+ style: Qe({ minHeight: e.contentMinHeight })
837
860
  }, [
838
- Ee(C.$slots, "default", {}, void 0, !0)
839
- ], 4)) : P("", !0)
861
+ Ce(k.$slots, "default", {}, void 0, !0)
862
+ ], 4)) : $("", !0)
840
863
  ]),
841
864
  _: 3
842
865
  })
843
866
  ])), [
844
- [H, w.value]
867
+ [q, y.value]
845
868
  ])
846
869
  ], 4), [
847
- [Pe, e.visible]
870
+ [Le, e.visible]
848
871
  ])
849
872
  ]),
850
873
  _: 3
851
874
  });
852
875
  };
853
876
  }
854
- }), Ze = /* @__PURE__ */ Se(Kn, [["__scopeId", "data-v-b3e784c3"]]);
855
- function Nn(e) {
856
- e != null && e.aiTask && (Qt(e.aiTask), en()), e != null && e.imageSelector && nn(e.imageSelector);
877
+ }), nt = /* @__PURE__ */ xe(Wn, [["__scopeId", "data-v-b3e784c3"]]);
878
+ function qn(e) {
879
+ e != null && e.aiTask && (nn(e.aiTask), ln()), e != null && e.imageSelector && sn(e.imageSelector);
857
880
  }
858
- function zn(e, n) {
859
- (n == null ? void 0 : n.registerPageWindow) !== !1 && (e.component("YcPageWindow", Ze), e.component("SkyPageWindow", Ze));
881
+ function Hn(e, n) {
882
+ (n == null ? void 0 : n.registerPageWindow) !== !1 && (e.component("YcPageWindow", nt), e.component("SkyPageWindow", nt));
860
883
  }
861
- function Yn(e, n) {
862
- (n == null ? void 0 : n.registerImageSelector) !== !1 && Bn(e);
884
+ function Jn(e, n) {
885
+ (n == null ? void 0 : n.registerImageSelector) !== !1 && Kn(e);
863
886
  }
864
- const zo = {
887
+ const Ho = {
865
888
  install(e, n) {
866
- Nn(n), zn(e, n), Yn(e, n);
889
+ qn(n), Hn(e, n), Jn(e, n);
867
890
  }
868
- }, Me = "__YC_COMPONENT_AI_DIALOG__", Be = "yc-component:ai-dialog-open";
869
- function Gn() {
891
+ }, $e = "__YC_COMPONENT_AI_DIALOG__", Oe = "yc-component:ai-dialog-open";
892
+ function Xn() {
870
893
  const e = globalThis;
871
- return e[Me] || (e[Me] = tt({
894
+ return e[$e] || (e[$e] = lt({
872
895
  visible: !1,
873
896
  options: {}
874
- })), e[Me];
897
+ })), e[$e];
875
898
  }
876
- const ee = Gn();
877
- function Ne(e = {}) {
878
- ee.options = { ...e }, ee.visible = !0, globalThis.dispatchEvent(
879
- new CustomEvent(Be, { detail: { ...e } })
899
+ const oe = Xn();
900
+ function Ye(e = {}) {
901
+ oe.options = { ...e }, oe.visible = !0, globalThis.dispatchEvent(
902
+ new CustomEvent(Oe, { detail: { ...e } })
880
903
  );
881
904
  }
882
- function mt() {
883
- ee.visible = !1;
905
+ function _t() {
906
+ oe.visible = !1;
884
907
  }
885
- function Yo(e = {}) {
886
- Ne(e);
908
+ function Jo(e = {}) {
909
+ Ye(e);
887
910
  }
888
- function gt(e) {
911
+ function ht(e) {
889
912
  const {
890
913
  tasks: n,
891
914
  panelVisible: t,
892
915
  panelMinimized: o,
893
916
  dialogVisible: l,
894
- runningCount: g,
895
- activeCount: w,
896
- panelTitle: S,
897
- panelSubtitle: m
898
- } = Jt(e);
917
+ runningCount: m,
918
+ activeCount: y,
919
+ panelTitle: T,
920
+ panelSubtitle: v
921
+ } = en(e);
899
922
  return {
900
923
  tasks: n,
901
924
  panelVisible: t,
902
925
  panelMinimized: o,
903
926
  dialogVisible: l,
904
- runningCount: g,
905
- activeCount: w,
906
- panelTitle: S,
907
- panelSubtitle: m,
927
+ runningCount: m,
928
+ activeCount: y,
929
+ panelTitle: T,
930
+ panelSubtitle: v,
908
931
  openUseDialog: (r) => {
909
- Ne(r ?? {}), e.openDialog(r ?? {});
932
+ Ye(r ?? {}), e.openDialog(r ?? {});
910
933
  },
911
934
  closeUseDialog: () => e.closeDialog(),
912
935
  openTaskPanel: () => e.showPanel(),
@@ -922,19 +945,19 @@ function gt(e) {
922
945
  onTaskFinish: (r) => e.onTaskFinish(r)
923
946
  };
924
947
  }
925
- const Wn = "__YC_AI_TASK_CTX_KEY__", jn = "__YC_AI_TASK_STORE_KEY__";
926
- function vt(e) {
948
+ const Qn = "__YC_AI_TASK_CTX_KEY__", Zn = "__YC_AI_TASK_STORE_KEY__";
949
+ function yt(e) {
927
950
  const n = globalThis;
928
951
  return n[e] || (n[e] = Symbol(e)), n[e];
929
952
  }
930
- const _t = vt(Wn), ht = vt(jn), qn = async (e) => (await ce().post(
953
+ const wt = yt(Qn), Tt = yt(Zn), eo = async (e) => (await de().post(
931
954
  "/yc-ai/workflows/runs",
932
955
  e
933
- )).data, yt = async (e) => (await ce().get(`/yc-ai/workflows/runs/${e}`)).data, Hn = (e) => ce().post(`/yc-ai/workflows/runs/${e}/cancel`), Jn = (e, n) => ce().post(`/yc-ai/workflows/runs/${e}/client-continue`, n);
934
- async function Ve(e, n) {
935
- return tn(e, n);
956
+ )).data, It = async (e) => (await de().get(`/yc-ai/workflows/runs/${e}`)).data, to = (e) => de().post(`/yc-ai/workflows/runs/${e}/cancel`), no = (e, n) => de().post(`/yc-ai/workflows/runs/${e}/client-continue`, n);
957
+ async function Ue(e, n) {
958
+ return an(e, n);
936
959
  }
937
- function Xn(e, n) {
960
+ function oo(e, n) {
938
961
  const t = e.trim();
939
962
  if (!t)
940
963
  return n;
@@ -957,70 +980,70 @@ function Xn(e, n) {
957
980
  throw new Error(`自定义脚本执行失败: ${l instanceof Error ? l.message : String(l)}`);
958
981
  }
959
982
  }
960
- async function Qn(e) {
961
- return (await qn({
962
- projectId: Zt(),
983
+ async function lo(e) {
984
+ return (await eo({
985
+ projectId: on(),
963
986
  freeText: e.freeText,
964
987
  promptId: e.promptId,
965
988
  autoMatch: e.autoMatch
966
989
  })).runId;
967
990
  }
968
- async function Zn(e, n) {
969
- var o, l, g, w;
970
- const t = await yt(e);
991
+ async function ao(e, n) {
992
+ var o, l, m, y;
993
+ const t = await It(e);
971
994
  if (t.status === "WAITING_CLIENT" && t.waitingStepKey && t.waitingClientScript) {
972
995
  (o = n == null ? void 0 : n.onProgress) == null || o.call(n, 60, `执行脚本:${t.waitingStepKey}`);
973
- let S = {};
974
- t.waitingArtifactId && (S = await Ve(e, t.waitingArtifactId));
975
- const m = Xn(t.waitingClientScript, S);
976
- return await Jn(e, {
996
+ let T = {};
997
+ t.waitingArtifactId && (T = await Ue(e, t.waitingArtifactId));
998
+ const v = oo(t.waitingClientScript, T);
999
+ return await no(e, {
977
1000
  stepKey: t.waitingStepKey,
978
- output: m ?? {}
1001
+ output: v ?? {}
979
1002
  }), null;
980
1003
  }
981
1004
  if (t.status === "SUCCEEDED") {
982
1005
  if (t.finalArtifactId) {
983
1006
  (l = n == null ? void 0 : n.onProgress) == null || l.call(n, 95, "加载结果…");
984
- const S = await Ve(e, t.finalArtifactId);
985
- return (g = n == null ? void 0 : n.onProgress) == null || g.call(n, 100, "已完成"), { phase: "SUCCEEDED", runId: e, result: S };
1007
+ const T = await Ue(e, t.finalArtifactId);
1008
+ return (m = n == null ? void 0 : n.onProgress) == null || m.call(n, 100, "已完成"), { phase: "SUCCEEDED", runId: e, result: T };
986
1009
  }
987
1010
  return { phase: "SUCCEEDED", runId: e, result: {} };
988
1011
  }
989
- return t.status === "FAILED" ? { phase: "FAILED", runId: e, errorMessage: t.errorMessage || "工作流失败" } : t.status === "CANCELLED" ? { phase: "FAILED", runId: e, errorMessage: "已取消" } : ((w = n == null ? void 0 : n.onProgress) == null || w.call(n, no(t), oo(t)), null);
1012
+ return t.status === "FAILED" ? { phase: "FAILED", runId: e, errorMessage: t.errorMessage || "工作流失败" } : t.status === "CANCELLED" ? { phase: "FAILED", runId: e, errorMessage: "已取消" } : ((y = n == null ? void 0 : n.onProgress) == null || y.call(n, ro(t), uo(t)), null);
990
1013
  }
991
- async function eo(e) {
992
- const n = await yt(e);
993
- return n.status !== "SUCCEEDED" || !n.finalArtifactId ? null : await Ve(e, n.finalArtifactId);
1014
+ async function io(e) {
1015
+ const n = await It(e);
1016
+ return n.status !== "SUCCEEDED" || !n.finalArtifactId ? null : await Ue(e, n.finalArtifactId);
994
1017
  }
995
- async function to(e) {
996
- await Hn(e);
1018
+ async function so(e) {
1019
+ await to(e);
997
1020
  }
998
- function no(e) {
1021
+ function ro(e) {
999
1022
  if (e.status === "PENDING") return 8;
1000
1023
  const n = e.steps ?? [];
1001
1024
  if (!n.length) return 35;
1002
1025
  const t = n.filter((o) => o.status === "SUCCEEDED" || o.status === "SKIPPED").length;
1003
1026
  return Math.min(90, Math.round(20 + t / n.length * 70));
1004
1027
  }
1005
- function oo(e) {
1028
+ function uo(e) {
1006
1029
  var t;
1007
1030
  if (e.status === "PENDING") return "排队中…";
1008
1031
  const n = (t = e.steps) == null ? void 0 : t.find((o) => o.status === "RUNNING");
1009
1032
  return n ? `执行中:${n.stepKey}` : "后端处理中…";
1010
1033
  }
1011
- const wt = 80;
1012
- function ao() {
1034
+ const Ct = 80;
1035
+ function co() {
1013
1036
  try {
1014
- const e = localStorage.getItem(rt());
1037
+ const e = localStorage.getItem(dt());
1015
1038
  if (!e) return [];
1016
1039
  const n = JSON.parse(e);
1017
- return Array.isArray(n) ? n.filter((t) => t && t.id && t.createdAt).sort((t, o) => o.createdAt - t.createdAt).slice(0, wt) : [];
1040
+ return Array.isArray(n) ? n.filter((t) => t && t.id && t.createdAt).sort((t, o) => o.createdAt - t.createdAt).slice(0, Ct) : [];
1018
1041
  } catch {
1019
1042
  return [];
1020
1043
  }
1021
1044
  }
1022
- function lo(e) {
1023
- const n = e.slice(0, wt).map((t) => ({
1045
+ function fo(e) {
1046
+ const n = e.slice(0, Ct).map((t) => ({
1024
1047
  id: t.id,
1025
1048
  title: t.title,
1026
1049
  freeText: t.freeText,
@@ -1034,29 +1057,29 @@ function lo(e) {
1034
1057
  createdAt: t.createdAt,
1035
1058
  finishedAt: t.finishedAt
1036
1059
  }));
1037
- localStorage.setItem(rt(), JSON.stringify(n));
1060
+ localStorage.setItem(dt(), JSON.stringify(n));
1038
1061
  }
1039
- function io(e) {
1062
+ function po(e) {
1040
1063
  return {
1041
1064
  ...e,
1042
1065
  logs: e.runId ? [`ℹ 已从本地恢复,runId=${e.runId}`] : [],
1043
1066
  result: void 0
1044
1067
  };
1045
1068
  }
1046
- function oe(e) {
1069
+ function ae(e) {
1047
1070
  return e === "pending" || e === "running";
1048
1071
  }
1049
- let Oe = 0, me = null;
1050
- const so = 5e3;
1051
- function ro() {
1052
- return Oe += 1, `ai_task_${Date.now()}_${Oe}`;
1072
+ let Fe = 0, ge = null;
1073
+ const mo = 5e3;
1074
+ function go() {
1075
+ return Fe += 1, `ai_task_${Date.now()}_${Fe}`;
1053
1076
  }
1054
- function uo(e, n = 28) {
1077
+ function vo(e, n = 28) {
1055
1078
  const t = e.trim();
1056
1079
  return t.length <= n ? t : `${t.slice(0, n)}…`;
1057
1080
  }
1058
- const Tt = Xt("ycAiTask", () => {
1059
- const e = k([]), n = k(!1), t = k(!1), o = k(!1), l = k({}), g = k(!1), w = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set();
1081
+ const St = tn("ycAiTask", () => {
1082
+ const e = b([]), n = b(!1), t = b(!1), o = b(!1), l = b({}), m = b(!1), y = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set();
1060
1083
  function r(a, u) {
1061
1084
  return {
1062
1085
  taskId: a.id,
@@ -1068,86 +1091,86 @@ const Tt = Xt("ycAiTask", () => {
1068
1091
  finishedAt: a.finishedAt ?? Date.now()
1069
1092
  };
1070
1093
  }
1071
- function $(a, u) {
1094
+ function I(a, u) {
1072
1095
  var se;
1073
- const c = e.value.find((fe) => fe.id === a);
1096
+ const c = e.value.find((pe) => pe.id === a);
1074
1097
  if (!(c != null && c.runId)) return;
1075
- const R = r(c, u);
1076
- (se = S.get(a)) == null || se(R), S.delete(a), m.forEach((fe) => fe(R));
1098
+ const F = r(c, u);
1099
+ (se = T.get(a)) == null || se(F), T.delete(a), v.forEach((pe) => pe(F));
1077
1100
  }
1078
- function F(a) {
1079
- return m.add(a), () => m.delete(a);
1101
+ function U(a) {
1102
+ return v.add(a), () => v.delete(a);
1080
1103
  }
1081
- const L = B(
1082
- () => e.value.filter((a) => oe(a.status)).length
1083
- ), D = B(() => e.value.filter((a) => a.status === "running").length), N = B(() => L.value > 0 ? "AI 处理中" : e.value.some((a) => a.status === "failed") ? "部分任务失败" : "AI 任务"), y = B(() => {
1084
- const a = e.value.length, u = L.value;
1104
+ const R = D(
1105
+ () => e.value.filter((a) => ae(a.status)).length
1106
+ ), Y = D(() => e.value.filter((a) => a.status === "running").length), L = D(() => R.value > 0 ? "AI 处理中" : e.value.some((a) => a.status === "failed") ? "部分任务失败" : "AI 任务"), g = D(() => {
1107
+ const a = e.value.length, u = R.value;
1085
1108
  return a === 0 ? "暂无任务" : u > 0 ? `${u}/${a} 项任务进行中` : `${a} 项任务已完成`;
1086
1109
  });
1087
- function E() {
1088
- lo(e.value);
1110
+ function x() {
1111
+ fo(e.value);
1089
1112
  }
1090
- function z(a, u) {
1091
- const c = e.value.findIndex((R) => R.id === a);
1092
- c >= 0 && (e.value[c] = { ...e.value[c], ...u }, E());
1113
+ function N(a, u) {
1114
+ const c = e.value.findIndex((F) => F.id === a);
1115
+ c >= 0 && (e.value[c] = { ...e.value[c], ...u }, x());
1093
1116
  }
1094
- function C(a, u) {
1095
- const c = e.value.find((R) => R.id === a);
1117
+ function k(a, u) {
1118
+ const c = e.value.find((F) => F.id === a);
1096
1119
  c && (c.logs.unshift(u), c.logs.length > 20 && c.logs.pop());
1097
1120
  }
1098
- function U() {
1121
+ function O() {
1099
1122
  n.value = !0, t.value = !1;
1100
1123
  }
1101
- function G() {
1124
+ function j() {
1102
1125
  n.value = !1;
1103
1126
  }
1104
- function v() {
1127
+ function _() {
1105
1128
  t.value = !t.value;
1106
1129
  }
1107
- function T(a = {}) {
1108
- l.value = { ...a }, o.value = !0, Ne(a);
1130
+ function C(a = {}) {
1131
+ l.value = { ...a }, o.value = !0, Ye(a);
1109
1132
  }
1110
- function W() {
1111
- o.value = !1, mt();
1133
+ function G() {
1134
+ o.value = !1, _t();
1112
1135
  }
1113
- function H() {
1114
- me || (me = setInterval(() => {
1136
+ function q() {
1137
+ ge || (ge = setInterval(() => {
1115
1138
  J();
1116
- }, so));
1139
+ }, mo));
1117
1140
  }
1118
- function x() {
1119
- L.value > 0 || me && (clearInterval(me), me = null);
1141
+ function A() {
1142
+ R.value > 0 || ge && (clearInterval(ge), ge = null);
1120
1143
  }
1121
1144
  async function J() {
1122
- const a = e.value.filter((u) => u.runId && oe(u.status));
1145
+ const a = e.value.filter((u) => u.runId && ae(u.status));
1123
1146
  if (!a.length) {
1124
- x();
1147
+ A();
1125
1148
  return;
1126
1149
  }
1127
1150
  await Promise.all(a.map((u) => X(u.id)));
1128
1151
  }
1129
1152
  async function X(a) {
1130
- if (w.has(a)) return;
1153
+ if (y.has(a)) return;
1131
1154
  const u = e.value.find((c) => c.id === a);
1132
- if (!(!(u != null && u.runId) || !oe(u.status))) {
1133
- w.add(a);
1155
+ if (!(!(u != null && u.runId) || !ae(u.status))) {
1156
+ y.add(a);
1134
1157
  try {
1135
- const c = await Zn(u.runId, {
1136
- onProgress: (R, se) => z(a, { progress: R, summary: se, status: "running" })
1158
+ const c = await ao(u.runId, {
1159
+ onProgress: (F, se) => N(a, { progress: F, summary: se, status: "running" })
1137
1160
  });
1138
1161
  if (!c) return;
1139
1162
  if (c.phase === "SUCCEEDED") {
1140
- const R = c.result ?? {};
1141
- z(a, {
1163
+ const F = c.result ?? {};
1164
+ N(a, {
1142
1165
  status: "succeeded",
1143
1166
  progress: 100,
1144
1167
  summary: "已完成",
1145
- result: R,
1168
+ result: F,
1146
1169
  runId: c.runId,
1147
1170
  finishedAt: Date.now()
1148
- }), $(a, R);
1171
+ }), I(a, F);
1149
1172
  } else
1150
- z(a, {
1173
+ N(a, {
1151
1174
  status: c.errorMessage === "已取消" ? "cancelled" : "failed",
1152
1175
  progress: 100,
1153
1176
  summary: c.errorMessage || "失败",
@@ -1155,29 +1178,29 @@ const Tt = Xt("ycAiTask", () => {
1155
1178
  runId: c.runId,
1156
1179
  finishedAt: Date.now()
1157
1180
  });
1158
- x();
1181
+ A();
1159
1182
  } catch (c) {
1160
- const R = c instanceof Error ? c.message : "同步失败";
1161
- C(a, `✗ ${R}`);
1183
+ const F = c instanceof Error ? c.message : "同步失败";
1184
+ k(a, `✗ ${F}`);
1162
1185
  } finally {
1163
- w.delete(a);
1186
+ y.delete(a);
1164
1187
  }
1165
1188
  }
1166
1189
  }
1167
- async function ne() {
1168
- if (g.value) return;
1169
- g.value = !0;
1170
- const a = ao();
1171
- a.length && (e.value = a.map(io), Oe = a.length);
1172
- const u = e.value.filter((c) => c.runId && oe(c.status));
1173
- u.length && (await Promise.all(u.map((c) => X(c.id))), H());
1190
+ async function te() {
1191
+ if (m.value) return;
1192
+ m.value = !0;
1193
+ const a = co();
1194
+ a.length && (e.value = a.map(po), Fe = a.length);
1195
+ const u = e.value.filter((c) => c.runId && ae(c.status));
1196
+ u.length && (await Promise.all(u.map((c) => X(c.id))), q());
1174
1197
  for (const c of e.value)
1175
- c.status === "pending" && !c.runId && z(c.id, { status: "failed", summary: "页面刷新前未提交成功", finishedAt: Date.now() });
1198
+ c.status === "pending" && !c.runId && N(c.id, { status: "failed", summary: "页面刷新前未提交成功", finishedAt: Date.now() });
1176
1199
  }
1177
- function K(a) {
1178
- const u = ro(), c = {
1200
+ function Q(a) {
1201
+ const u = go(), c = {
1179
1202
  id: u,
1180
- title: a.title ?? uo(a.freeText),
1203
+ title: a.title ?? vo(a.freeText),
1181
1204
  freeText: a.freeText.trim(),
1182
1205
  promptId: a.promptId,
1183
1206
  autoMatch: a.autoMatch,
@@ -1187,59 +1210,59 @@ const Tt = Xt("ycAiTask", () => {
1187
1210
  createdAt: Date.now(),
1188
1211
  logs: []
1189
1212
  };
1190
- return e.value.unshift(c), E(), a.onFinish && S.set(u, a.onFinish), a.showPanel !== !1 && U(), ie(u), u;
1213
+ return e.value.unshift(c), x(), a.onFinish && T.set(u, a.onFinish), a.showPanel !== !1 && O(), K(u), u;
1191
1214
  }
1192
- async function ie(a) {
1215
+ async function K(a) {
1193
1216
  const u = e.value.find((c) => c.id === a);
1194
1217
  if (u)
1195
1218
  try {
1196
- const c = await Qn({
1219
+ const c = await lo({
1197
1220
  freeText: u.freeText,
1198
1221
  promptId: u.promptId,
1199
1222
  autoMatch: u.autoMatch
1200
1223
  });
1201
- z(a, {
1224
+ N(a, {
1202
1225
  runId: c,
1203
1226
  status: "running",
1204
1227
  progress: 10,
1205
1228
  summary: "后端异步处理中…"
1206
- }), C(a, `▶ 已提交 runId=${c}`), H(), X(a);
1229
+ }), k(a, `▶ 已提交 runId=${c}`), q(), X(a);
1207
1230
  } catch (c) {
1208
- const R = c instanceof Error ? c.message : "提交失败";
1209
- z(a, {
1231
+ const F = c instanceof Error ? c.message : "提交失败";
1232
+ N(a, {
1210
1233
  status: "failed",
1211
1234
  progress: 100,
1212
- summary: R,
1213
- errorMessage: R,
1235
+ summary: F,
1236
+ errorMessage: F,
1214
1237
  finishedAt: Date.now()
1215
1238
  });
1216
1239
  }
1217
1240
  }
1218
- async function j(a) {
1219
- const u = e.value.find((R) => R.id === a);
1241
+ async function z(a) {
1242
+ const u = e.value.find((F) => F.id === a);
1220
1243
  if (!(u != null && u.runId)) return null;
1221
1244
  if (u.result) return u.result;
1222
- const c = await eo(u.runId);
1223
- return c && z(a, { result: c }), c;
1245
+ const c = await io(u.runId);
1246
+ return c && N(a, { result: c }), c;
1224
1247
  }
1225
- async function de(a) {
1248
+ async function fe(a) {
1226
1249
  const u = e.value.find((c) => c.id === a);
1227
- if (u != null && u.runId && oe(u.status))
1250
+ if (u != null && u.runId && ae(u.status))
1228
1251
  try {
1229
- await to(u.runId);
1252
+ await so(u.runId);
1230
1253
  } catch {
1231
1254
  }
1232
- u && oe(u.status) && z(a, { status: "cancelled", summary: "已取消", finishedAt: Date.now() }), S.delete(a), x();
1255
+ u && ae(u.status) && N(a, { status: "cancelled", summary: "已取消", finishedAt: Date.now() }), T.delete(a), A();
1233
1256
  }
1234
- function he() {
1257
+ function be() {
1235
1258
  for (const a of e.value)
1236
- oe(a.status) && de(a.id);
1259
+ ae(a.status) && fe(a.id);
1237
1260
  }
1238
- function ke() {
1239
- e.value = e.value.filter((a) => oe(a.status)), E();
1261
+ function ye() {
1262
+ e.value = e.value.filter((a) => ae(a.status)), x();
1240
1263
  }
1241
- function ye(a) {
1242
- de(a), S.delete(a), e.value = e.value.filter((u) => u.id !== a), E();
1264
+ function Ae(a) {
1265
+ fe(a), T.delete(a), e.value = e.value.filter((u) => u.id !== a), x();
1243
1266
  }
1244
1267
  return {
1245
1268
  tasks: e,
@@ -1247,37 +1270,37 @@ const Tt = Xt("ycAiTask", () => {
1247
1270
  panelMinimized: t,
1248
1271
  dialogVisible: o,
1249
1272
  dialogOptions: l,
1250
- hydrated: g,
1251
- runningCount: L,
1252
- activeCount: D,
1253
- panelTitle: N,
1254
- panelSubtitle: y,
1255
- hydrate: ne,
1256
- showPanel: U,
1257
- hidePanel: G,
1258
- toggleMinimize: v,
1259
- openDialog: T,
1260
- closeDialog: W,
1261
- enqueue: K,
1262
- onTaskFinish: F,
1273
+ hydrated: m,
1274
+ runningCount: R,
1275
+ activeCount: Y,
1276
+ panelTitle: L,
1277
+ panelSubtitle: g,
1278
+ hydrate: te,
1279
+ showPanel: O,
1280
+ hidePanel: j,
1281
+ toggleMinimize: _,
1282
+ openDialog: C,
1283
+ closeDialog: G,
1284
+ enqueue: Q,
1285
+ onTaskFinish: U,
1263
1286
  refreshActiveTasks: J,
1264
- loadTaskResult: j,
1265
- cancelTask: de,
1266
- cancelAll: he,
1267
- clearFinished: ke,
1268
- removeTask: ye
1287
+ loadTaskResult: z,
1288
+ cancelTask: fe,
1289
+ cancelAll: be,
1290
+ clearFinished: ye,
1291
+ removeTask: Ae
1269
1292
  };
1270
1293
  });
1271
- async function co(e) {
1272
- return (await ce().get("/yc-ai/ai/prompts", {
1294
+ async function _o(e) {
1295
+ return (await de().get("/yc-ai/ai/prompts", {
1273
1296
  params: e ? { category: e } : {}
1274
1297
  })).data;
1275
1298
  }
1276
- function ze() {
1277
- const e = Re(ht, null);
1278
- return e || Tt();
1299
+ function je() {
1300
+ const e = Ne(Tt, null);
1301
+ return e || St();
1279
1302
  }
1280
- const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__footer-actions" }, mo = /* @__PURE__ */ ue({
1303
+ const ho = { class: "ai-use-dialog__footer" }, yo = { class: "ai-use-dialog__footer-actions" }, wo = /* @__PURE__ */ ce({
1281
1304
  __name: "AiUseDialog",
1282
1305
  props: {
1283
1306
  title: { default: "AI 生成" },
@@ -1300,147 +1323,147 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1300
1323
  },
1301
1324
  emits: ["update:modelValue", "submitted"],
1302
1325
  setup(e, { emit: n }) {
1303
- const t = e, o = n, l = ze(), g = B(() => t.modelValue !== void 0), w = k(!1);
1304
- te(
1326
+ const t = e, o = n, l = je(), m = D(() => t.modelValue !== void 0), y = b(!1);
1327
+ ne(
1305
1328
  () => t.modelValue,
1306
- (v) => {
1307
- g.value && (w.value = !!v);
1329
+ (_) => {
1330
+ m.value && (y.value = !!_);
1308
1331
  },
1309
1332
  { immediate: !0 }
1310
- ), te(w, (v) => {
1311
- if (g.value) {
1312
- o("update:modelValue", v);
1333
+ ), ne(y, (_) => {
1334
+ if (m.value) {
1335
+ o("update:modelValue", _);
1313
1336
  return;
1314
1337
  }
1315
- ee.visible = v, v || mt();
1316
- }), te(
1317
- () => ee.visible,
1318
- (v) => {
1319
- g.value || (w.value = v);
1338
+ oe.visible = _, _ || _t();
1339
+ }), ne(
1340
+ () => oe.visible,
1341
+ (_) => {
1342
+ m.value || (y.value = _);
1320
1343
  },
1321
1344
  { immediate: !0 }
1322
1345
  );
1323
- function S(v) {
1324
- if (g.value) return;
1325
- const T = v.detail ?? {};
1326
- N(T), w.value = !0;
1346
+ function T(_) {
1347
+ if (m.value) return;
1348
+ const C = _.detail ?? {};
1349
+ L(C), y.value = !0;
1327
1350
  }
1328
- Ue(() => {
1329
- globalThis.addEventListener(Be, S), g.value || (w.value = ee.visible);
1330
- }), Fe(() => {
1331
- globalThis.removeEventListener(Be, S);
1351
+ Re(() => {
1352
+ globalThis.addEventListener(Oe, T), m.value || (y.value = oe.visible);
1353
+ }), Ke(() => {
1354
+ globalThis.removeEventListener(Oe, T);
1332
1355
  });
1333
- const m = B(
1334
- () => (g.value ? void 0 : ee.options.title) ?? t.title ?? "AI 生成"
1335
- ), r = k({
1356
+ const v = D(
1357
+ () => (m.value ? void 0 : oe.options.title) ?? t.title ?? "AI 生成"
1358
+ ), r = b({
1336
1359
  freeText: t.freeText,
1337
1360
  promptId: t.promptId,
1338
1361
  autoMatch: t.autoMatch
1339
- }), $ = k(t.prompts ? [...t.prompts] : []), F = k(!1), L = k(!1), D = k();
1340
- function N(v) {
1341
- var T, W;
1342
- r.value.freeText = v.freeText ?? t.freeText ?? "", r.value.promptId = v.promptId ?? t.promptId, r.value.autoMatch = v.autoMatch ?? t.autoMatch ?? !1, D.value = v.onFinish, (T = v.prompts) != null && T.length ? $.value = [...v.prompts] : (W = t.prompts) != null && W.length && ($.value = [...t.prompts]);
1362
+ }), I = b(t.prompts ? [...t.prompts] : []), U = b(!1), R = b(!1), Y = b();
1363
+ function L(_) {
1364
+ var C, G;
1365
+ r.value.freeText = _.freeText ?? t.freeText ?? "", r.value.promptId = _.promptId ?? t.promptId, r.value.autoMatch = _.autoMatch ?? t.autoMatch ?? !1, Y.value = _.onFinish, (C = _.prompts) != null && C.length ? I.value = [..._.prompts] : (G = t.prompts) != null && G.length && (I.value = [...t.prompts]);
1343
1366
  }
1344
- async function y() {
1345
- if (!($.value.length > 0)) {
1346
- F.value = !0;
1367
+ async function g() {
1368
+ if (!(I.value.length > 0)) {
1369
+ U.value = !0;
1347
1370
  try {
1348
- const v = st().listPrompts;
1349
- $.value = v ? await v() : await co();
1371
+ const _ = ct().listPrompts;
1372
+ I.value = _ ? await _() : await _o();
1350
1373
  } catch {
1351
1374
  Z.warning("加载提示词失败");
1352
1375
  } finally {
1353
- F.value = !1;
1376
+ U.value = !1;
1354
1377
  }
1355
1378
  }
1356
1379
  }
1357
- function E() {
1358
- g.value ? N({}) : N(ee.options), t.showPromptSelect && y();
1380
+ function x() {
1381
+ m.value ? L({}) : L(oe.options), t.showPromptSelect && g();
1359
1382
  }
1360
- te(
1383
+ ne(
1361
1384
  () => t.prompts,
1362
- (v) => {
1363
- v != null && v.length && ($.value = [...v]);
1385
+ (_) => {
1386
+ _ != null && _.length && (I.value = [..._]);
1364
1387
  },
1365
1388
  { deep: !0 }
1366
- ), te(
1389
+ ), ne(
1367
1390
  () => [t.freeText, t.promptId, t.autoMatch],
1368
- ([v, T, W]) => {
1369
- w.value || (r.value.freeText = v ?? "", r.value.promptId = T, r.value.autoMatch = W ?? !1);
1391
+ ([_, C, G]) => {
1392
+ y.value || (r.value.freeText = _ ?? "", r.value.promptId = C, r.value.autoMatch = G ?? !1);
1370
1393
  }
1371
1394
  );
1372
- function z() {
1395
+ function N() {
1373
1396
  r.value.autoMatch && (r.value.promptId = void 0);
1374
1397
  }
1375
- function C() {
1376
- L.value = !1;
1398
+ function k() {
1399
+ R.value = !1;
1377
1400
  }
1378
- function U() {
1401
+ function O() {
1379
1402
  l.showPanel();
1380
1403
  }
1381
- async function G() {
1382
- var x, J;
1404
+ async function j() {
1405
+ var A, J;
1383
1406
  if (!r.value.freeText.trim()) {
1384
1407
  Z.warning("请填写需求描述");
1385
1408
  return;
1386
1409
  }
1387
- const v = r.value.autoMatch, T = v ? void 0 : r.value.promptId;
1388
- if (!v && T == null) {
1410
+ const _ = r.value.autoMatch, C = _ ? void 0 : r.value.promptId;
1411
+ if (!_ && C == null) {
1389
1412
  const X = t.showPromptSelect || t.showAutoMatch ? "请选择提示词或开启自动匹配" : "请通过 promptId 传入提示词,或设置 autoMatch 为 true";
1390
1413
  Z.warning(X);
1391
1414
  return;
1392
1415
  }
1393
- L.value = !0;
1394
- const W = g.value ? D.value : ee.options.onFinish, H = l.enqueue({
1416
+ R.value = !0;
1417
+ const G = m.value ? Y.value : oe.options.onFinish, q = l.enqueue({
1395
1418
  freeText: r.value.freeText.trim(),
1396
- promptId: T,
1397
- autoMatch: v && T == null ? !0 : void 0,
1419
+ promptId: C,
1420
+ autoMatch: _ && C == null ? !0 : void 0,
1398
1421
  showPanel: !0,
1399
- onFinish: W
1422
+ onFinish: G
1400
1423
  });
1401
- g.value ? o("submitted", H) : (J = (x = ee.options).onSubmitted) == null || J.call(x, H), w.value = !1, L.value = !1, Z.success("已加入任务队列,可在任务面板查看进度");
1424
+ m.value ? o("submitted", q) : (J = (A = oe.options).onSubmitted) == null || J.call(A, q), y.value = !1, R.value = !1, Z.success("已加入任务队列,可在任务面板查看进度");
1402
1425
  }
1403
- return (v, T) => {
1404
- const W = O("el-switch"), H = O("el-form-item"), x = O("el-option"), J = O("el-select"), X = O("el-input"), ne = O("el-form"), K = O("el-button"), ie = O("el-dialog");
1405
- return d(), M(ie, {
1406
- modelValue: w.value,
1407
- "onUpdate:modelValue": T[4] || (T[4] = (j) => w.value = j),
1408
- title: m.value,
1426
+ return (_, C) => {
1427
+ const G = V("el-switch"), q = V("el-form-item"), A = V("el-option"), J = V("el-select"), X = V("el-input"), te = V("el-form"), Q = V("el-button"), K = V("el-dialog");
1428
+ return d(), E(K, {
1429
+ modelValue: y.value,
1430
+ "onUpdate:modelValue": C[4] || (C[4] = (z) => y.value = z),
1431
+ title: v.value,
1409
1432
  width: e.width,
1410
1433
  "append-to-body": "",
1411
1434
  class: "ai-use-dialog",
1412
- onClosed: C,
1413
- onOpen: E
1435
+ onClosed: k,
1436
+ onOpen: x
1414
1437
  }, {
1415
1438
  footer: p(() => [
1416
- _("div", fo, [
1417
- e.showTaskListButton ? (d(), M(K, {
1439
+ h("div", ho, [
1440
+ e.showTaskListButton ? (d(), E(Q, {
1418
1441
  key: 0,
1419
1442
  link: "",
1420
1443
  type: "primary",
1421
- onClick: U
1444
+ onClick: O
1422
1445
  }, {
1423
1446
  default: p(() => [
1424
- q(V(e.taskListButtonText), 1)
1447
+ W(B(e.taskListButtonText), 1)
1425
1448
  ]),
1426
1449
  _: 1
1427
- })) : P("", !0),
1428
- _("div", po, [
1429
- f(K, {
1430
- onClick: T[3] || (T[3] = (j) => w.value = !1)
1450
+ })) : $("", !0),
1451
+ h("div", yo, [
1452
+ f(Q, {
1453
+ onClick: C[3] || (C[3] = (z) => y.value = !1)
1431
1454
  }, {
1432
- default: p(() => [...T[5] || (T[5] = [
1433
- q("取消", -1)
1455
+ default: p(() => [...C[5] || (C[5] = [
1456
+ W("取消", -1)
1434
1457
  ])]),
1435
1458
  _: 1
1436
1459
  }),
1437
- f(K, {
1460
+ f(Q, {
1438
1461
  type: "primary",
1439
- loading: L.value,
1440
- onClick: G
1462
+ loading: R.value,
1463
+ onClick: j
1441
1464
  }, {
1442
1465
  default: p(() => [
1443
- q(V(e.submitText), 1)
1466
+ W(B(e.submitText), 1)
1444
1467
  ]),
1445
1468
  _: 1
1446
1469
  }, 8, ["loading"])
@@ -1448,24 +1471,24 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1448
1471
  ])
1449
1472
  ]),
1450
1473
  default: p(() => [
1451
- f(ne, { "label-position": "top" }, {
1474
+ f(te, { "label-position": "top" }, {
1452
1475
  default: p(() => [
1453
- e.showAutoMatch ? (d(), M(H, {
1476
+ e.showAutoMatch ? (d(), E(q, {
1454
1477
  key: 0,
1455
1478
  label: e.autoMatchLabel
1456
1479
  }, {
1457
1480
  default: p(() => [
1458
- f(W, {
1481
+ f(G, {
1459
1482
  modelValue: r.value.autoMatch,
1460
- "onUpdate:modelValue": T[0] || (T[0] = (j) => r.value.autoMatch = j),
1483
+ "onUpdate:modelValue": C[0] || (C[0] = (z) => r.value.autoMatch = z),
1461
1484
  "active-text": "按需求自动选",
1462
1485
  "inactive-text": "手动指定",
1463
- onChange: z
1486
+ onChange: N
1464
1487
  }, null, 8, ["modelValue"])
1465
1488
  ]),
1466
1489
  _: 1
1467
- }, 8, ["label"])) : P("", !0),
1468
- e.showPromptSelect ? (d(), M(H, {
1490
+ }, 8, ["label"])) : $("", !0),
1491
+ e.showPromptSelect ? (d(), E(q, {
1469
1492
  key: 1,
1470
1493
  label: e.promptLabel,
1471
1494
  required: !r.value.autoMatch
@@ -1473,33 +1496,33 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1473
1496
  default: p(() => [
1474
1497
  f(J, {
1475
1498
  modelValue: r.value.promptId,
1476
- "onUpdate:modelValue": T[1] || (T[1] = (j) => r.value.promptId = j),
1499
+ "onUpdate:modelValue": C[1] || (C[1] = (z) => r.value.promptId = z),
1477
1500
  filterable: "",
1478
1501
  clearable: "",
1479
1502
  placeholder: r.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
1480
1503
  style: { width: "100%" },
1481
- loading: F.value
1504
+ loading: U.value
1482
1505
  }, {
1483
1506
  default: p(() => [
1484
- (d(!0), A(le, null, ge($.value, (j) => (d(), M(x, {
1485
- key: j.id,
1486
- label: j.name,
1487
- value: j.id
1507
+ (d(!0), M(ie, null, ve(I.value, (z) => (d(), E(A, {
1508
+ key: z.id,
1509
+ label: z.name,
1510
+ value: z.id
1488
1511
  }, null, 8, ["label", "value"]))), 128))
1489
1512
  ]),
1490
1513
  _: 1
1491
1514
  }, 8, ["modelValue", "placeholder", "loading"])
1492
1515
  ]),
1493
1516
  _: 1
1494
- }, 8, ["label", "required"])) : P("", !0),
1495
- f(H, {
1517
+ }, 8, ["label", "required"])) : $("", !0),
1518
+ f(q, {
1496
1519
  label: e.freeTextLabel,
1497
1520
  required: ""
1498
1521
  }, {
1499
1522
  default: p(() => [
1500
1523
  f(X, {
1501
1524
  modelValue: r.value.freeText,
1502
- "onUpdate:modelValue": T[2] || (T[2] = (j) => r.value.freeText = j),
1525
+ "onUpdate:modelValue": C[2] || (C[2] = (z) => r.value.freeText = z),
1503
1526
  type: "textarea",
1504
1527
  rows: 4,
1505
1528
  placeholder: e.freeTextPlaceholder
@@ -1515,104 +1538,104 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1515
1538
  }, 8, ["modelValue", "title", "width"]);
1516
1539
  };
1517
1540
  }
1518
- }), go = /* @__PURE__ */ Se(mo, [["__scopeId", "data-v-9aa82e83"]]), vo = { class: "ai-task-panel" }, _o = { class: "ai-task-panel__header" }, ho = { class: "ai-task-panel__header-left" }, yo = { class: "ai-task-panel__titles" }, wo = { class: "ai-task-panel__subtitle" }, To = { class: "ai-task-panel__title" }, Io = { class: "ai-task-panel__header-actions" }, Co = { class: "ai-task-panel__body" }, So = {
1541
+ }), To = /* @__PURE__ */ xe(wo, [["__scopeId", "data-v-9aa82e83"]]), Io = { class: "ai-task-panel" }, Co = { class: "ai-task-panel__header" }, So = { class: "ai-task-panel__header-left" }, ko = { class: "ai-task-panel__titles" }, xo = { class: "ai-task-panel__subtitle" }, bo = { class: "ai-task-panel__title" }, Ao = { class: "ai-task-panel__header-actions" }, Mo = { class: "ai-task-panel__body" }, Eo = {
1519
1542
  key: 1,
1520
1543
  class: "ai-task-list"
1521
- }, ko = { class: "ai-task-row__icon" }, xo = { class: "ai-task-row__main" }, bo = { class: "ai-task-row__title" }, Ao = { class: "ai-task-row__meta" }, Mo = { key: 0 }, Eo = {
1544
+ }, Po = { class: "ai-task-row__icon" }, $o = { class: "ai-task-row__main" }, Lo = { class: "ai-task-row__title" }, Do = { class: "ai-task-row__meta" }, Bo = { key: 0 }, Vo = {
1522
1545
  key: 0,
1523
1546
  class: "ai-task-row__summary"
1524
- }, Po = { class: "ai-task-row__ops" }, $o = {
1547
+ }, Oo = { class: "ai-task-row__ops" }, Uo = {
1525
1548
  key: 0,
1526
1549
  class: "ai-task-panel__footer"
1527
- }, Lo = /* @__PURE__ */ ue({
1550
+ }, Fo = /* @__PURE__ */ ce({
1528
1551
  __name: "AiTaskPanel",
1529
1552
  emits: ["use"],
1530
1553
  setup(e, { emit: n }) {
1531
- const t = n, o = ze(), l = k(null), g = {
1554
+ const t = n, o = je(), l = b(null), m = {
1532
1555
  pending: "等待中",
1533
1556
  running: "执行中",
1534
1557
  succeeded: "已完成",
1535
1558
  failed: "失败",
1536
1559
  cancelled: "已取消"
1537
1560
  };
1538
- function w(m) {
1539
- return g[m] ?? m;
1561
+ function y(v) {
1562
+ return m[v] ?? v;
1540
1563
  }
1541
- async function S(m) {
1542
- l.value = m.id;
1564
+ async function T(v) {
1565
+ l.value = v.id;
1543
1566
  try {
1544
- const r = m.result ?? await o.loadTaskResult(m.id);
1567
+ const r = v.result ?? await o.loadTaskResult(v.id);
1545
1568
  if (!r) return;
1546
1569
  t("use", {
1547
- taskId: m.id,
1548
- runId: m.runId,
1549
- title: m.title,
1550
- freeText: m.freeText,
1551
- promptId: m.promptId,
1570
+ taskId: v.id,
1571
+ runId: v.runId,
1572
+ title: v.title,
1573
+ freeText: v.freeText,
1574
+ promptId: v.promptId,
1552
1575
  result: r,
1553
- finishedAt: m.finishedAt ?? Date.now()
1576
+ finishedAt: v.finishedAt ?? Date.now()
1554
1577
  });
1555
1578
  } finally {
1556
1579
  l.value = null;
1557
1580
  }
1558
1581
  }
1559
- return (m, r) => {
1560
- const $ = O("el-icon"), F = O("el-button"), L = O("el-empty"), D = O("el-progress"), N = O("el-badge");
1561
- return d(), M(Ot, { to: "body" }, [
1562
- f(ot, { name: "ai-panel-slide" }, {
1582
+ return (v, r) => {
1583
+ const I = V("el-icon"), U = V("el-button"), R = V("el-empty"), Y = V("el-progress"), L = V("el-badge");
1584
+ return d(), E(Kt, { to: "body" }, [
1585
+ f(it, { name: "ai-panel-slide" }, {
1563
1586
  default: p(() => [
1564
- ve(_("div", vo, [
1565
- _("div", _o, [
1566
- _("div", ho, [
1567
- _("div", {
1568
- class: re(["ai-task-panel__icon", { spinning: h(o).activeCount > 0 }])
1587
+ _e(h("div", Io, [
1588
+ h("div", Co, [
1589
+ h("div", So, [
1590
+ h("div", {
1591
+ class: ue(["ai-task-panel__icon", { spinning: w(o).activeCount > 0 }])
1569
1592
  }, [
1570
- f($, null, {
1593
+ f(I, null, {
1571
1594
  default: p(() => [
1572
- f(h(Xe))
1595
+ f(w(Ze))
1573
1596
  ]),
1574
1597
  _: 1
1575
1598
  })
1576
1599
  ], 2),
1577
- _("div", yo, [
1578
- _("div", wo, V(h(o).panelSubtitle), 1),
1579
- _("div", To, V(h(o).panelTitle), 1)
1600
+ h("div", ko, [
1601
+ h("div", xo, B(w(o).panelSubtitle), 1),
1602
+ h("div", bo, B(w(o).panelTitle), 1)
1580
1603
  ])
1581
1604
  ]),
1582
- _("div", Io, [
1583
- h(o).runningCount > 0 ? (d(), M(F, {
1605
+ h("div", Ao, [
1606
+ w(o).runningCount > 0 ? (d(), E(U, {
1584
1607
  key: 0,
1585
1608
  link: "",
1586
1609
  type: "primary",
1587
- onClick: r[0] || (r[0] = (y) => h(o).cancelAll())
1610
+ onClick: r[0] || (r[0] = (g) => w(o).cancelAll())
1588
1611
  }, {
1589
1612
  default: p(() => [...r[5] || (r[5] = [
1590
- q(" 取消全部 ", -1)
1613
+ W(" 取消全部 ", -1)
1591
1614
  ])]),
1592
1615
  _: 1
1593
- })) : P("", !0),
1594
- f(F, {
1616
+ })) : $("", !0),
1617
+ f(U, {
1595
1618
  link: "",
1596
- onClick: r[1] || (r[1] = (y) => h(o).toggleMinimize())
1619
+ onClick: r[1] || (r[1] = (g) => w(o).toggleMinimize())
1597
1620
  }, {
1598
1621
  default: p(() => [
1599
- f($, null, {
1622
+ f(I, null, {
1600
1623
  default: p(() => [
1601
- f(h(Wt))
1624
+ f(w(Jt))
1602
1625
  ]),
1603
1626
  _: 1
1604
1627
  })
1605
1628
  ]),
1606
1629
  _: 1
1607
1630
  }),
1608
- f(F, {
1631
+ f(U, {
1609
1632
  link: "",
1610
- onClick: r[2] || (r[2] = (y) => h(o).hidePanel())
1633
+ onClick: r[2] || (r[2] = (g) => w(o).hidePanel())
1611
1634
  }, {
1612
1635
  default: p(() => [
1613
- f($, null, {
1636
+ f(I, null, {
1614
1637
  default: p(() => [
1615
- f(h(it))
1638
+ f(w(ut))
1616
1639
  ]),
1617
1640
  _: 1
1618
1641
  })
@@ -1621,142 +1644,142 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1621
1644
  })
1622
1645
  ])
1623
1646
  ]),
1624
- _("div", Co, [
1625
- h(o).tasks.length ? (d(), A("div", So, [
1626
- (d(!0), A(le, null, ge(h(o).tasks, (y) => (d(), A("div", {
1627
- key: y.id,
1647
+ h("div", Mo, [
1648
+ w(o).tasks.length ? (d(), M("div", Eo, [
1649
+ (d(!0), M(ie, null, ve(w(o).tasks, (g) => (d(), M("div", {
1650
+ key: g.id,
1628
1651
  class: "ai-task-row"
1629
1652
  }, [
1630
- _("div", ko, [
1631
- y.status === "succeeded" ? (d(), M($, {
1653
+ h("div", Po, [
1654
+ g.status === "succeeded" ? (d(), E(I, {
1632
1655
  key: 0,
1633
1656
  class: "ok"
1634
1657
  }, {
1635
1658
  default: p(() => [
1636
- f(h(jt))
1659
+ f(w(Xt))
1637
1660
  ]),
1638
1661
  _: 1
1639
- })) : y.status === "failed" ? (d(), M($, {
1662
+ })) : g.status === "failed" ? (d(), E(I, {
1640
1663
  key: 1,
1641
1664
  class: "err"
1642
1665
  }, {
1643
1666
  default: p(() => [
1644
- f(h(qt))
1667
+ f(w(Qt))
1645
1668
  ]),
1646
1669
  _: 1
1647
- })) : y.status === "running" || y.status === "pending" ? (d(), M(D, {
1670
+ })) : g.status === "running" || g.status === "pending" ? (d(), E(Y, {
1648
1671
  key: 2,
1649
1672
  type: "circle",
1650
- percentage: y.progress,
1673
+ percentage: g.progress,
1651
1674
  width: 36,
1652
1675
  "stroke-width": 3
1653
- }, null, 8, ["percentage"])) : (d(), M($, {
1676
+ }, null, 8, ["percentage"])) : (d(), E(I, {
1654
1677
  key: 3,
1655
1678
  class: "muted"
1656
1679
  }, {
1657
1680
  default: p(() => [
1658
- f(h(Ht))
1681
+ f(w(Zt))
1659
1682
  ]),
1660
1683
  _: 1
1661
1684
  }))
1662
1685
  ]),
1663
- _("div", xo, [
1664
- _("div", bo, V(y.title), 1),
1665
- _("div", Ao, [
1666
- _("span", null, V(w(y.status)), 1),
1667
- y.runId ? (d(), A("span", Mo, " · #" + V(y.runId), 1)) : P("", !0)
1686
+ h("div", $o, [
1687
+ h("div", Lo, B(g.title), 1),
1688
+ h("div", Do, [
1689
+ h("span", null, B(y(g.status)), 1),
1690
+ g.runId ? (d(), M("span", Bo, " · #" + B(g.runId), 1)) : $("", !0)
1668
1691
  ]),
1669
- y.summary ? (d(), A("div", Eo, V(y.summary), 1)) : P("", !0)
1692
+ g.summary ? (d(), M("div", Vo, B(g.summary), 1)) : $("", !0)
1670
1693
  ]),
1671
- _("div", Po, [
1672
- y.status === "running" || y.status === "pending" ? (d(), M(F, {
1694
+ h("div", Oo, [
1695
+ g.status === "running" || g.status === "pending" ? (d(), E(U, {
1673
1696
  key: 0,
1674
1697
  link: "",
1675
1698
  type: "danger",
1676
1699
  size: "small",
1677
- onClick: (E) => h(o).cancelTask(y.id)
1700
+ onClick: (x) => w(o).cancelTask(g.id)
1678
1701
  }, {
1679
1702
  default: p(() => [...r[6] || (r[6] = [
1680
- q(" 取消 ", -1)
1703
+ W(" 取消 ", -1)
1681
1704
  ])]),
1682
1705
  _: 1
1683
- }, 8, ["onClick"])) : P("", !0),
1684
- y.status === "succeeded" && y.runId ? (d(), M(F, {
1706
+ }, 8, ["onClick"])) : $("", !0),
1707
+ g.status === "succeeded" && g.runId ? (d(), E(U, {
1685
1708
  key: 1,
1686
1709
  link: "",
1687
1710
  type: "primary",
1688
1711
  size: "small",
1689
- loading: l.value === y.id,
1690
- onClick: (E) => S(y)
1712
+ loading: l.value === g.id,
1713
+ onClick: (x) => T(g)
1691
1714
  }, {
1692
1715
  default: p(() => [...r[7] || (r[7] = [
1693
- q(" 使用 ", -1)
1716
+ W(" 使用 ", -1)
1694
1717
  ])]),
1695
1718
  _: 1
1696
- }, 8, ["loading", "onClick"])) : P("", !0),
1697
- y.status !== "running" && y.status !== "pending" ? (d(), M(F, {
1719
+ }, 8, ["loading", "onClick"])) : $("", !0),
1720
+ g.status !== "running" && g.status !== "pending" ? (d(), E(U, {
1698
1721
  key: 2,
1699
1722
  link: "",
1700
1723
  size: "small",
1701
- onClick: (E) => h(o).removeTask(y.id)
1724
+ onClick: (x) => w(o).removeTask(g.id)
1702
1725
  }, {
1703
1726
  default: p(() => [...r[8] || (r[8] = [
1704
- q(" 移除 ", -1)
1727
+ W(" 移除 ", -1)
1705
1728
  ])]),
1706
1729
  _: 1
1707
- }, 8, ["onClick"])) : P("", !0)
1730
+ }, 8, ["onClick"])) : $("", !0)
1708
1731
  ])
1709
1732
  ]))), 128))
1710
- ])) : (d(), M(L, {
1733
+ ])) : (d(), E(R, {
1711
1734
  key: 0,
1712
1735
  description: "暂无 AI 任务",
1713
1736
  "image-size": 64
1714
1737
  }))
1715
1738
  ]),
1716
- h(o).tasks.some((y) => y.status !== "running" && y.status !== "pending") ? (d(), A("div", $o, [
1717
- f(F, {
1739
+ w(o).tasks.some((g) => g.status !== "running" && g.status !== "pending") ? (d(), M("div", Uo, [
1740
+ f(U, {
1718
1741
  link: "",
1719
1742
  type: "info",
1720
- onClick: r[3] || (r[3] = (y) => h(o).clearFinished())
1743
+ onClick: r[3] || (r[3] = (g) => w(o).clearFinished())
1721
1744
  }, {
1722
1745
  default: p(() => [...r[9] || (r[9] = [
1723
- q("清除已完成", -1)
1746
+ W("清除已完成", -1)
1724
1747
  ])]),
1725
1748
  _: 1
1726
1749
  })
1727
- ])) : P("", !0)
1750
+ ])) : $("", !0)
1728
1751
  ], 512), [
1729
- [Pe, h(o).panelVisible && !h(o).panelMinimized]
1752
+ [Le, w(o).panelVisible && !w(o).panelMinimized]
1730
1753
  ])
1731
1754
  ]),
1732
1755
  _: 1
1733
1756
  }),
1734
- ve(_("div", {
1757
+ _e(h("div", {
1735
1758
  class: "ai-task-panel-mini",
1736
- onClick: r[4] || (r[4] = (y) => h(o).toggleMinimize())
1759
+ onClick: r[4] || (r[4] = (g) => w(o).toggleMinimize())
1737
1760
  }, [
1738
- h(o).activeCount > 0 ? (d(), M($, {
1761
+ w(o).activeCount > 0 ? (d(), E(I, {
1739
1762
  key: 0,
1740
1763
  class: "spinning"
1741
1764
  }, {
1742
1765
  default: p(() => [
1743
- f(h(Xe))
1766
+ f(w(Ze))
1744
1767
  ]),
1745
1768
  _: 1
1746
- })) : P("", !0),
1747
- _("span", null, V(h(o).panelSubtitle), 1),
1748
- h(o).runningCount > 0 ? (d(), M(N, {
1769
+ })) : $("", !0),
1770
+ h("span", null, B(w(o).panelSubtitle), 1),
1771
+ w(o).runningCount > 0 ? (d(), E(L, {
1749
1772
  key: 1,
1750
- value: h(o).runningCount,
1773
+ value: w(o).runningCount,
1751
1774
  class: "m-l-8"
1752
- }, null, 8, ["value"])) : P("", !0)
1775
+ }, null, 8, ["value"])) : $("", !0)
1753
1776
  ], 512), [
1754
- [Pe, h(o).panelVisible && h(o).panelMinimized]
1777
+ [Le, w(o).panelVisible && w(o).panelMinimized]
1755
1778
  ])
1756
1779
  ]);
1757
1780
  };
1758
1781
  }
1759
- }), Do = /* @__PURE__ */ Se(Lo, [["__scopeId", "data-v-812b3127"]]), Go = /* @__PURE__ */ ue({
1782
+ }), Ro = /* @__PURE__ */ xe(Fo, [["__scopeId", "data-v-812b3127"]]), Xo = /* @__PURE__ */ ce({
1760
1783
  __name: "AiTaskProvider",
1761
1784
  props: {
1762
1785
  title: {},
@@ -1779,10 +1802,10 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1779
1802
  },
1780
1803
  emits: ["finish", "use"],
1781
1804
  setup(e, { emit: n }) {
1782
- const t = e, o = n, l = Tt();
1783
- $e(ht, l), $e(_t, gt(l));
1784
- const g = B(() => {
1785
- const m = {
1805
+ const t = e, o = n, l = St();
1806
+ De(Tt, l), De(wt, ht(l));
1807
+ const m = D(() => {
1808
+ const v = {
1786
1809
  title: t.title,
1787
1810
  freeText: t.freeText,
1788
1811
  promptId: t.promptId,
@@ -1799,51 +1822,64 @@ const fo = { class: "ai-use-dialog__footer" }, po = { class: "ai-use-dialog__foo
1799
1822
  taskListButtonText: t.taskListButtonText,
1800
1823
  width: t.width
1801
1824
  };
1802
- return t.modelValue !== void 0 && (m.modelValue = t.modelValue), m;
1825
+ return t.modelValue !== void 0 && (v.modelValue = t.modelValue), v;
1803
1826
  });
1804
- let w;
1805
- function S(m) {
1806
- o("use", m);
1827
+ let y;
1828
+ function T(v) {
1829
+ o("use", v);
1807
1830
  }
1808
- return Ue(() => {
1809
- l.hydrate(), w = l.onTaskFinish((m) => o("finish", m));
1810
- }), Fe(() => {
1811
- w == null || w();
1812
- }), (m, r) => (d(), A(le, null, [
1813
- e.showDialog !== !1 ? (d(), M(go, Ut(at({ key: 0 }, g.value)), null, 16)) : P("", !0),
1814
- f(Do, { onUse: S }),
1815
- Ee(m.$slots, "default")
1831
+ return Re(() => {
1832
+ l.hydrate(), y = l.onTaskFinish((v) => o("finish", v));
1833
+ }), Ke(() => {
1834
+ y == null || y();
1835
+ }), (v, r) => (d(), M(ie, null, [
1836
+ e.showDialog !== !1 ? (d(), E(To, Nt(st({ key: 0 }, m.value)), null, 16)) : $("", !0),
1837
+ f(Ro, { onUse: T }),
1838
+ Ce(v.$slots, "default")
1816
1839
  ], 64));
1817
1840
  }
1818
1841
  });
1819
- function Wo() {
1820
- const e = Re(_t, null);
1821
- return e || gt(ze());
1842
+ function Qo() {
1843
+ const e = Ne(wt, null);
1844
+ return e || ht(je());
1822
1845
  }
1823
- function Bo() {
1824
- const e = k(!1), n = k({});
1825
- function t(l = {}) {
1826
- n.value = { ...l }, e.value = !0;
1846
+ function Ko() {
1847
+ const e = b(!1), n = b({});
1848
+ let t = null;
1849
+ function o(T) {
1850
+ t == null || t.resolve(T), t = null;
1827
1851
  }
1828
- function o() {
1852
+ function l() {
1853
+ t == null || t.reject(new Se()), t = null;
1854
+ }
1855
+ function m(T = {}) {
1856
+ t && (t.reject(new Se()), t = null);
1857
+ const v = new Promise((r, I) => {
1858
+ t = { resolve: r, reject: I };
1859
+ });
1860
+ return n.value = { ...T }, e.value = !0, v;
1861
+ }
1862
+ function y() {
1829
1863
  e.value = !1;
1830
1864
  }
1831
1865
  return {
1832
1866
  dialogVisible: e,
1833
1867
  dialogOptions: n,
1834
- openImageSelector: t,
1835
- closeImageSelector: o
1868
+ openImageSelector: m,
1869
+ closeImageSelector: y,
1870
+ settlePendingConfirm: o,
1871
+ settlePendingCancel: l
1836
1872
  };
1837
1873
  }
1838
- const Vo = "__YC_IMAGE_SELECTOR_CTX_KEY__";
1839
- function Oo(e) {
1874
+ const No = "__YC_IMAGE_SELECTOR_CTX_KEY__";
1875
+ function zo(e) {
1840
1876
  const n = globalThis;
1841
1877
  return n[e] || (n[e] = Symbol(e)), n[e];
1842
1878
  }
1843
- const It = Oo(Vo), jo = /* @__PURE__ */ ue({
1879
+ const kt = zo(No), Zo = /* @__PURE__ */ ce({
1844
1880
  __name: "YcImageSelectorProvider",
1845
1881
  props: {
1846
- modelValue: { type: Boolean },
1882
+ modelValue: { type: [Boolean, null] },
1847
1883
  title: { default: "选择图片" },
1848
1884
  multiple: { type: Boolean, default: !1 },
1849
1885
  maxCount: { default: 9 },
@@ -1866,25 +1902,32 @@ const It = Oo(Vo), jo = /* @__PURE__ */ ue({
1866
1902
  showDialog: { type: Boolean, default: !0 }
1867
1903
  },
1868
1904
  setup(e, { expose: n }) {
1869
- const t = e, o = Bo(), { dialogVisible: l, dialogOptions: g, openImageSelector: w, closeImageSelector: S } = o;
1870
- $e(It, o);
1871
- function m(L, D) {
1872
- return L in g.value ? g.value[L] : D;
1905
+ const t = e, o = Ko(), {
1906
+ dialogVisible: l,
1907
+ dialogOptions: m,
1908
+ openImageSelector: y,
1909
+ closeImageSelector: T,
1910
+ settlePendingConfirm: v,
1911
+ settlePendingCancel: r
1912
+ } = o;
1913
+ De(kt, o);
1914
+ function I(L, g) {
1915
+ return L in m.value ? m.value[L] : g;
1873
1916
  }
1874
- const r = B(() => ({
1875
- title: m("title", t.title),
1876
- multiple: m("multiple", t.multiple),
1877
- maxCount: m("maxCount", t.maxCount),
1878
- selected: m("selected", t.selected),
1917
+ const U = D(() => ({
1918
+ title: I("title", t.title),
1919
+ multiple: I("multiple", t.multiple),
1920
+ maxCount: I("maxCount", t.maxCount),
1921
+ selected: I("selected", t.selected),
1879
1922
  width: t.width,
1880
1923
  pageSize: t.pageSize,
1881
1924
  showUpload: t.showUpload,
1882
1925
  accept: t.accept,
1883
- showCategories: m("showCategories", t.showCategories),
1884
- categories: m("categories", t.categories),
1885
- categoryAllLabel: m("categoryAllLabel", t.categoryAllLabel),
1886
- showModeSwitch: m("showModeSwitch", t.showModeSwitch),
1887
- confirmOnSelect: m("confirmOnSelect", t.confirmOnSelect),
1926
+ showCategories: I("showCategories", t.showCategories),
1927
+ categories: I("categories", t.categories),
1928
+ categoryAllLabel: I("categoryAllLabel", t.categoryAllLabel),
1929
+ showModeSwitch: I("showModeSwitch", t.showModeSwitch),
1930
+ confirmOnSelect: I("confirmOnSelect", t.confirmOnSelect),
1888
1931
  confirmText: t.confirmText,
1889
1932
  cancelText: t.cancelText,
1890
1933
  emptyText: t.emptyText,
@@ -1892,68 +1935,72 @@ const It = Oo(Vo), jo = /* @__PURE__ */ ue({
1892
1935
  upload: t.upload,
1893
1936
  urlField: t.urlField
1894
1937
  }));
1895
- function $(L) {
1896
- var D, N;
1897
- (N = (D = g.value).onConfirm) == null || N.call(D, L), S();
1938
+ function R(L) {
1939
+ var g, x;
1940
+ (x = (g = m.value).onConfirm) == null || x.call(g, L), v(L), T();
1898
1941
  }
1899
- function F() {
1900
- var L, D;
1901
- (D = (L = g.value).onCancel) == null || D.call(L), S();
1942
+ function Y() {
1943
+ var L, g;
1944
+ (g = (L = m.value).onCancel) == null || g.call(L), r(), T();
1902
1945
  }
1903
- return n({ openImageSelector: w, closeImageSelector: S }), (L, D) => e.showDialog !== !1 ? (d(), M(ft, at({
1904
- key: 0,
1905
- modelValue: h(l),
1906
- "onUpdate:modelValue": D[0] || (D[0] = (N) => Ft(l) ? l.value = N : null)
1907
- }, r.value, {
1908
- onConfirm: $,
1909
- onCancel: F
1910
- }), null, 16, ["modelValue"])) : P("", !0);
1946
+ return n({ openImageSelector: y, closeImageSelector: T }), (L, g) => (d(), M(ie, null, [
1947
+ e.showDialog !== !1 ? (d(), E(gt, st({
1948
+ key: 0,
1949
+ modelValue: w(l),
1950
+ "onUpdate:modelValue": g[0] || (g[0] = (x) => zt(l) ? l.value = x : null)
1951
+ }, U.value, {
1952
+ onConfirm: R,
1953
+ onCancel: Y
1954
+ }), null, 16, ["modelValue"])) : $("", !0),
1955
+ Ce(L.$slots, "default")
1956
+ ], 64));
1911
1957
  }
1912
1958
  });
1913
- function qo() {
1914
- const e = Re(It, null);
1959
+ function el() {
1960
+ const e = Ne(kt, null);
1915
1961
  return e ? {
1916
1962
  openImageSelector: (n = {}) => e.openImageSelector(n),
1917
1963
  closeImageSelector: () => e.closeImageSelector()
1918
1964
  } : {
1919
- openImageSelector: dt,
1920
- closeImageSelector: ct
1965
+ openImageSelector: mt,
1966
+ closeImageSelector: pt
1921
1967
  };
1922
1968
  }
1923
1969
  export {
1924
- Do as AiTaskPanel,
1925
- Go as AiTaskProvider,
1926
- go as AiUseDialog,
1927
- It as IMAGE_SELECTOR_INJECT_KEY,
1928
- ft as ImageSelectorDialog,
1929
- jo as ImageSelectorProvider,
1930
- Ze as SkyPageWindow,
1931
- Do as YcAiTaskPanel,
1932
- Go as YcAiTaskProvider,
1933
- go as YcAiUseDialog,
1934
- zo as YcComponent,
1935
- ft as YcImageSelectorDialog,
1936
- jo as YcImageSelectorProvider,
1937
- Ze as YcPageWindow,
1938
- ct as closeImageSelector,
1939
- Bo as createImageSelectorApi,
1940
- zo as default,
1941
- Pn as fetchImages,
1942
- st as getAiTaskConfig,
1943
- Ce as getImageSelectorConfig,
1944
- mt as hideAiDialog,
1945
- ut as hideImageSelectorDialog,
1946
- Bn as installImageSelector,
1947
- Nn as installYcComponent,
1948
- co as listPrompts,
1949
- Yo as openAiUseDialog,
1950
- dt as openImageSelector,
1951
- Qt as setAiTaskConfig,
1952
- nn as setImageSelectorConfig,
1953
- Ne as showAiDialog,
1954
- an as showImageSelectorDialog,
1955
- $n as uploadImage,
1956
- Wo as useAiTask,
1957
- Tt as useAiTaskStore,
1958
- qo as useImageSelector
1970
+ Ro as AiTaskPanel,
1971
+ Xo as AiTaskProvider,
1972
+ To as AiUseDialog,
1973
+ kt as IMAGE_SELECTOR_INJECT_KEY,
1974
+ Se as ImageSelectorCancelledError,
1975
+ gt as ImageSelectorDialog,
1976
+ Zo as ImageSelectorProvider,
1977
+ nt as SkyPageWindow,
1978
+ Ro as YcAiTaskPanel,
1979
+ Xo as YcAiTaskProvider,
1980
+ To as YcAiUseDialog,
1981
+ Ho as YcComponent,
1982
+ gt as YcImageSelectorDialog,
1983
+ Zo as YcImageSelectorProvider,
1984
+ nt as YcPageWindow,
1985
+ pt as closeImageSelector,
1986
+ Ko as createImageSelectorApi,
1987
+ Ho as default,
1988
+ On as fetchImages,
1989
+ ct as getAiTaskConfig,
1990
+ ke as getImageSelectorConfig,
1991
+ _t as hideAiDialog,
1992
+ ft as hideImageSelectorDialog,
1993
+ Kn as installImageSelector,
1994
+ qn as installYcComponent,
1995
+ _o as listPrompts,
1996
+ Jo as openAiUseDialog,
1997
+ mt as openImageSelector,
1998
+ nn as setAiTaskConfig,
1999
+ sn as setImageSelectorConfig,
2000
+ Ye as showAiDialog,
2001
+ dn as showImageSelectorDialog,
2002
+ Un as uploadImage,
2003
+ Qo as useAiTask,
2004
+ St as useAiTaskStore,
2005
+ el as useImageSelector
1959
2006
  };