@huyooo/ui 1.0.7 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/AuthkitAppSetting-DCQH9IpU.js +2678 -0
  2. package/dist/{Contact-BWuVR9ho.js → Contact-C7ROEqe-.js} +9 -9
  3. package/dist/{CustomTable-BzGfaAVH.js → CustomTable-GgvDEidl.js} +1 -1
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-C1hPqnNT.js +1531 -0
  5. package/dist/{LegalDocViewer-DM8FYBpf.js → LegalDocViewer-D_QUh0uf.js} +747 -748
  6. package/dist/MessageHandle-DKoySsCG.js +1233 -0
  7. package/dist/{MessageList-Ce-_LNTk.js → MessageList-HSiKkUoD.js} +4 -4
  8. package/dist/PaySubscriptions-NcATVJGm.js +1331 -0
  9. package/dist/{PricingPlans-CV97ck9p.js → PricingPlans-CZn6eJby.js} +99 -105
  10. package/dist/{ReferrerReferees-DgygiIiE.js → ReferrerReferees-BoOQIssE.js} +47 -46
  11. package/dist/Upload.vue_vue_type_script_setup_true_lang-CkS2S9Xc.js +83 -0
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-0Td42Nb3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BrNx6JWe.js} +64 -65
  13. package/dist/WidthContainer-BJLdZfzF.js +717 -0
  14. package/dist/api/billingSubscriptionApi.d.ts +4 -1
  15. package/dist/apiClients-CR-hEwog.js +245 -0
  16. package/dist/authkit.js +10 -10
  17. package/dist/common/globalConfig.d.ts +36 -18
  18. package/dist/common.js +2 -2
  19. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
  20. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +0 -5
  21. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +11 -0
  22. package/dist/components/Upload/Upload.vue.d.ts +7 -6
  23. package/dist/composables/Authkit/useAuthkitAuth.d.ts +3 -0
  24. package/dist/composables/Billing/usePaymentReturn.d.ts +1 -0
  25. package/dist/composables/uploadFeedbackAttachment.d.ts +8 -1
  26. package/dist/composables/useMessageList.d.ts +2 -1
  27. package/dist/composables.d.ts +2 -2
  28. package/dist/composables.js +46 -46
  29. package/dist/feedback.js +2 -2
  30. package/dist/{fetchAuthPageAboutUs-dzTSwRsB.js → fetchAuthPageAboutUs-BnKWq_TL.js} +4 -4
  31. package/dist/{index-BkLvw1PU.js → index-BhVwozr0.js} +1 -1
  32. package/dist/legalDocs/resolveAppId.d.ts +1 -1
  33. package/dist/main.d.ts +4 -3
  34. package/dist/main.js +464 -469
  35. package/dist/message.js +53 -52
  36. package/dist/pay.js +4 -4
  37. package/dist/privateCom.js +1 -1
  38. package/dist/referrer.js +1 -1
  39. package/dist/{useUploadCos-C8BqFPkx.js → runtime-DMCyhVcI.js} +2305 -2185
  40. package/dist/runtime.d.ts +22 -0
  41. package/dist/style.css +1 -1
  42. package/dist/types/api/auth.generated.d.ts +0 -10
  43. package/dist/upload/browserCosTransport.d.ts +22 -0
  44. package/dist/upload/browserUploadService.d.ts +21 -0
  45. package/dist/upload.d.ts +2 -1
  46. package/dist/upload.js +5 -4
  47. package/dist/{useAuthkitAppsAuthPageInfo-CNudJd04.js → useAuthkitAppsAuthPageInfo-Byu0yvrx.js} +18 -21
  48. package/dist/useAuthkitAuth-M2vTpEcb.js +272 -0
  49. package/dist/{useAuthkitCreateAndUpdate-BsINsI-E.js → useAuthkitCreateAndUpdate-D2_Bdazi.js} +1 -1
  50. package/dist/useAuthkitUsersProfile-DdUAENic.js +39 -0
  51. package/dist/useBillingStatusOptions-Jq6Wqfxb.js +61 -0
  52. package/dist/{useEnsureAuthenticated-DNkCCy_Y.js → useEnsureAuthenticated-Hel8hWLJ.js} +2 -2
  53. package/dist/{useLegalDocs-DQP_Yq6B.js → useLegalDocs-BOjqYRyQ.js} +25 -25
  54. package/dist/useMessageNotifications-AznFeFMD.js +80 -0
  55. package/dist/{useRoutePermission-CEiya9AM.js → useRoutePermission-BmUXTwQc.js} +2 -2
  56. package/dist/{useSEO-CDWxbk8B.js → useSEO-Chz4Zxuu.js} +89 -86
  57. package/dist/useSubscriptionCheckout-3ivcOcgC.js +353 -0
  58. package/dist/user.js +1 -1
  59. package/dist/utils/apiClients.d.ts +20 -12
  60. package/dist/utils/apiMiddlewares.d.ts +9 -23
  61. package/package.json +1 -1
  62. package/dist/AuthkitAppSetting-BN8-xgNq.js +0 -2674
  63. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DrL_XBqf.js +0 -1481
  64. package/dist/MessageHandle-mEkCsv9e.js +0 -1173
  65. package/dist/PaySubscriptions-CXkEjqr2.js +0 -1326
  66. package/dist/Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js +0 -76
  67. package/dist/WidthContainer-CFMQRsCy.js +0 -721
  68. package/dist/apiClients-BcXOLuYu.js +0 -272
  69. package/dist/composables/Upload/useUploadCos.d.ts +0 -12
  70. package/dist/useAuthkitAuth-3m0yW6uP.js +0 -267
  71. package/dist/useAuthkitUsersProfile-DJlMsftY.js +0 -40
  72. package/dist/useBillingStatusOptions-CfHQOFNw.js +0 -71
  73. package/dist/useMessageNotifications-CAphguOm.js +0 -75
  74. package/dist/useSubscriptionCheckout-d_M_rKRa.js +0 -368
  75. package/dist/utils/billingFetch.d.ts +0 -1
@@ -0,0 +1,1531 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ import { U as st } from "./userMenuModal-D-nDaYqM.js";
4
+ import { defineComponent as W, useModel as nt, openBlock as s, createBlock as T, Teleport as lt, createElementBlock as u, withKeys as rt, createElementVNode as k, toDisplayString as $, withModifiers as Q, createCommentVNode as P, mergeModels as it, ref as b, computed as I, Fragment as M, renderList as G, createVNode as f, unref as a, normalizeStyle as le, withCtx as v, createTextVNode as E, normalizeClass as fe, onBeforeUnmount as ot, onUnmounted as ut, watch as ke, readonly as ct, nextTick as ie } from "vue";
5
+ import { ImagePreviewGroup as we, Avatar as ve, Space as pe, Descriptions as dt, DescriptionsItem as oe, Tag as ae, Spin as ft, Empty as vt, Button as _e, Message as se, Form as pt, FormItem as ee, Input as mt, Select as Ae, Option as Re, Textarea as gt, Breadcrumb as bt, BreadcrumbItem as Pe, Modal as kt } from "@arco-design/web-vue";
6
+ import { M as yt } from "./Menu-uCexrsKP.js";
7
+ /* empty css */
8
+ import { C as me } from "./index-BhVwozr0.js";
9
+ /* empty css */
10
+ /* empty css */
11
+ import { g as H } from "./apiClients-CR-hEwog.js";
12
+ /* empty css */
13
+ import { h as _t, u as Me } from "./runtime-DMCyhVcI.js";
14
+ import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
+ import { r as ht, m as Be, a as wt, M as Ct } from "./MessageList-HSiKkUoD.js";
16
+ import { f as ne } from "./index-D56hUMeD.js";
17
+ import { Bubble as Le, Sender as St } from "ant-design-x-vue";
18
+ import { u as xt } from "./useAuthkitUsersProfile-DdUAENic.js";
19
+ import { u as Ut } from "./useUserMenu-ClPBlvaM.js";
20
+ /* empty css */
21
+ import { Icon as $t } from "@iconify/vue";
22
+ import { _ as It, g as Ft, i as At } from "./plugin-vue_export-helper-LjDO2Zua.js";
23
+ const Rt = {
24
+ class: "video-preview__header"
25
+ }, Pt = {
26
+ class: "video-preview__title"
27
+ }, Bt = {
28
+ class: "video-preview__stage"
29
+ }, Tt = ["src"], Mt = /* @__PURE__ */ W({
30
+ __name: "VideoPreview",
31
+ props: /* @__PURE__ */ it({
32
+ src: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ title: {
37
+ type: String,
38
+ default: ""
39
+ }
40
+ }, {
41
+ visible: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ visibleModifiers: {}
46
+ }),
47
+ emits: ["update:visible"],
48
+ setup(e) {
49
+ const t = nt(e, "visible"), r = e;
50
+ function o() {
51
+ t.value = !1;
52
+ }
53
+ return (d, p) => (s(), T(lt, {
54
+ to: "body"
55
+ }, [t.value ? (s(), u("div", {
56
+ key: 0,
57
+ class: "video-preview",
58
+ tabindex: "0",
59
+ onClick: o,
60
+ onKeydown: rt(o, ["esc"])
61
+ }, [k("div", Rt, [k("div", Pt, $(r.title), 1), k("button", {
62
+ type: "button",
63
+ class: "video-preview__close",
64
+ onClick: Q(o, ["stop"])
65
+ }, " × ")]), k("div", Bt, [r.src ? (s(), u("video", {
66
+ key: 0,
67
+ class: "video-preview__video",
68
+ src: r.src,
69
+ controls: "",
70
+ autoplay: "",
71
+ onClick: p[0] || (p[0] = Q(() => {
72
+ }, ["stop"]))
73
+ }, null, 8, Tt)) : P("", !0)])], 32)) : P("", !0)]));
74
+ }
75
+ }), Ce = /* @__PURE__ */ Y(Mt, [["__scopeId", "data-v-3f517bc8"]]), Lt = {
76
+ key: 0,
77
+ class: "message-attachments"
78
+ }, Vt = ["title", "onClick"], Et = ["src", "alt"], Dt = ["title", "onClick"], qt = ["src"], Ot = ["href", "title"], zt = {
79
+ class: "message-attachment-main"
80
+ }, Nt = {
81
+ class: "message-attachment-name"
82
+ }, jt = {
83
+ class: "message-attachment-meta"
84
+ }, Wt = /* @__PURE__ */ W({
85
+ __name: "FeedbackMessageAttachments",
86
+ props: {
87
+ attachments: {
88
+ type: Array,
89
+ default: () => []
90
+ }
91
+ },
92
+ setup(e) {
93
+ const t = e, r = b(!1), o = b(0), d = b(!1), p = b(""), y = b(""), w = I(() => t.attachments.filter((m) => m.kind === "image")), C = I(() => t.attachments.filter((m) => m.kind === "video")), x = I(() => t.attachments.filter((m) => m.kind === "file")), B = I(() => w.value.map((m) => m.url || ""));
94
+ function _(m) {
95
+ o.value = m, r.value = !0;
96
+ }
97
+ function A(m) {
98
+ p.value = m.url || "", y.value = m.name, d.value = !0;
99
+ }
100
+ function D(m) {
101
+ return m < 1024 ? `${m} B` : m < 1024 * 1024 ? `${(m / 1024).toFixed(1)} KB` : m < 1024 * 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${(m / 1024 / 1024 / 1024).toFixed(1)} GB`;
102
+ }
103
+ return (m, U) => (s(), u(M, null, [t.attachments.length > 0 ? (s(), u("div", Lt, [(s(!0), u(M, null, G(w.value, (l, F) => (s(), u("button", {
104
+ key: l.key,
105
+ type: "button",
106
+ class: "message-media message-media--image",
107
+ title: l.name,
108
+ onClick: (L) => _(F)
109
+ }, [k("img", {
110
+ src: l.url,
111
+ alt: l.name,
112
+ class: "message-media__content"
113
+ }, null, 8, Et)], 8, Vt))), 128)), (s(!0), u(M, null, G(C.value, (l) => (s(), u("button", {
114
+ key: l.key,
115
+ type: "button",
116
+ class: "message-media message-media--video",
117
+ title: l.name,
118
+ onClick: (F) => A(l)
119
+ }, [k("video", {
120
+ class: "message-media__content",
121
+ src: l.url,
122
+ muted: "",
123
+ preload: "metadata"
124
+ }, null, 8, qt), U[3] || (U[3] = k("span", {
125
+ class: "message-video-play"
126
+ }, "播放", -1))], 8, Dt))), 128)), (s(!0), u(M, null, G(x.value, (l) => (s(), u("a", {
127
+ key: l.key,
128
+ class: "message-file",
129
+ href: l.url,
130
+ target: "_blank",
131
+ rel: "noopener noreferrer",
132
+ title: l.name
133
+ }, [U[4] || (U[4] = k("span", {
134
+ class: "message-file-icon"
135
+ }, "FILE", -1)), k("span", zt, [k("span", Nt, $(l.name), 1), k("span", jt, $(D(l.size)), 1)])], 8, Ot))), 128))])) : P("", !0), f(a(we), {
136
+ "src-list": B.value,
137
+ visible: r.value,
138
+ "onUpdate:visible": U[0] || (U[0] = (l) => r.value = l),
139
+ current: o.value,
140
+ "onUpdate:current": U[1] || (U[1] = (l) => o.value = l)
141
+ }, null, 8, ["src-list", "visible", "current"]), f(Ce, {
142
+ visible: d.value,
143
+ "onUpdate:visible": U[2] || (U[2] = (l) => d.value = l),
144
+ title: y.value,
145
+ src: p.value
146
+ }, null, 8, ["visible", "title", "src"])], 64));
147
+ }
148
+ }), Ve = /* @__PURE__ */ Y(Wt, [["__scopeId", "data-v-49a094a3"]]), Kt = /* @__PURE__ */ W({
149
+ __name: "FeedbackRefresh",
150
+ setup(e) {
151
+ return (t, r) => (s(), T(a($t), {
152
+ class: "icon",
153
+ icon: "mingcute:refresh-2-line"
154
+ }));
155
+ }
156
+ }), Te = /* @__PURE__ */ Y(Kt, [["__scopeId", "data-v-64bb6fc2"]]), Ht = ["src"], Gt = {
157
+ key: 1
158
+ }, Xt = {
159
+ class: "feedback-message-body"
160
+ }, Yt = {
161
+ key: 0,
162
+ class: "feedback-text-bubble"
163
+ }, Jt = {
164
+ key: 1,
165
+ class: "feedback-bubble-stack feedback-bubble-stack--end"
166
+ }, Zt = ["src"], Qt = {
167
+ key: 1
168
+ }, ea = /* @__PURE__ */ W({
169
+ __name: "FeedbackBubbleEnd",
170
+ props: {
171
+ text: {
172
+ type: String,
173
+ default: ""
174
+ },
175
+ attachments: {
176
+ type: Array,
177
+ default: () => []
178
+ },
179
+ avatarUrl: {
180
+ type: String,
181
+ default: ""
182
+ },
183
+ avatarText: {
184
+ type: String,
185
+ default: "U"
186
+ },
187
+ bubbleStyle: {
188
+ type: Object,
189
+ default: () => ({
190
+ paddingLeft: "52px"
191
+ })
192
+ },
193
+ showRefresh: {
194
+ type: Boolean,
195
+ default: !1
196
+ },
197
+ showClipboard: {
198
+ type: Boolean,
199
+ default: !1
200
+ }
201
+ },
202
+ emits: ["refresh"],
203
+ setup(e, {
204
+ emit: t
205
+ }) {
206
+ const r = e, o = t;
207
+ function d(C) {
208
+ return C.startsWith("http://") || C.startsWith("https://") || C.startsWith("data:");
209
+ }
210
+ const p = I(() => {
211
+ const C = r.avatarUrl.trim();
212
+ return d(C) ? C : "";
213
+ }), y = I(() => r.attachments.length > 0);
214
+ function w() {
215
+ o("refresh");
216
+ }
217
+ return (C, x) => y.value ? (s(), u("div", {
218
+ key: 0,
219
+ class: "feedback-message-group feedback-message-group--end",
220
+ style: le(r.bubbleStyle)
221
+ }, [f(a(ve), {
222
+ class: "feedback-message-avatar"
223
+ }, {
224
+ default: v(() => [p.value ? (s(), u("img", {
225
+ key: 0,
226
+ alt: "avatar",
227
+ src: p.value
228
+ }, null, 8, Ht)) : (s(), u("span", Gt, $(r.avatarText), 1))]),
229
+ _: 1
230
+ }), k("div", Xt, [r.text ? (s(), u("div", Yt, $(r.text), 1)) : P("", !0), r.showClipboard || r.showRefresh ? (s(), T(a(pe), {
231
+ key: 1,
232
+ class: "feedback-message-footer"
233
+ }, {
234
+ default: v(() => [r.showClipboard ? (s(), T(me, {
235
+ key: 0,
236
+ value: r.text
237
+ }, null, 8, ["value"])) : P("", !0), r.showRefresh ? (s(), T(Te, {
238
+ key: 1,
239
+ onClick: w
240
+ })) : P("", !0)]),
241
+ _: 1
242
+ })) : P("", !0), f(Ve, {
243
+ attachments: r.attachments
244
+ }, null, 8, ["attachments"])])], 4)) : (s(), u("div", Jt, [f(a(Le), {
245
+ placement: "end",
246
+ style: le(r.bubbleStyle)
247
+ }, {
248
+ avatar: v(() => [f(a(ve), null, {
249
+ default: v(() => [p.value ? (s(), u("img", {
250
+ key: 0,
251
+ alt: "avatar",
252
+ src: p.value
253
+ }, null, 8, Zt)) : (s(), u("span", Qt, $(r.avatarText), 1))]),
254
+ _: 1
255
+ })]),
256
+ message: v(() => [r.text ? (s(), u(M, {
257
+ key: 0
258
+ }, [E($(r.text), 1)], 64)) : P("", !0)]),
259
+ footer: v(() => [f(a(pe), null, {
260
+ default: v(() => [r.showClipboard && r.text ? (s(), T(me, {
261
+ key: 0,
262
+ value: r.text
263
+ }, null, 8, ["value"])) : P("", !0), r.showRefresh ? (s(), T(Te, {
264
+ key: 1,
265
+ onClick: w
266
+ })) : P("", !0)]),
267
+ _: 1
268
+ })]),
269
+ _: 1
270
+ }, 8, ["style"])]));
271
+ }
272
+ }), ta = /* @__PURE__ */ Y(ea, [["__scopeId", "data-v-ed8f32cc"]]), aa = ["src"], sa = {
273
+ key: 1
274
+ }, na = {
275
+ class: "feedback-message-body"
276
+ }, la = {
277
+ key: 0,
278
+ class: "feedback-text-bubble"
279
+ }, ra = {
280
+ key: 1,
281
+ class: "feedback-bubble-stack feedback-bubble-stack--start"
282
+ }, ia = ["src"], oa = {
283
+ key: 1
284
+ }, ua = /* @__PURE__ */ W({
285
+ __name: "FeedbackBubbleStart",
286
+ props: {
287
+ text: {
288
+ type: String,
289
+ default: ""
290
+ },
291
+ attachments: {
292
+ type: Array,
293
+ default: () => []
294
+ },
295
+ avatarUrl: {
296
+ type: String,
297
+ default: ""
298
+ },
299
+ avatarText: {
300
+ type: String,
301
+ default: "U"
302
+ },
303
+ bubbleStyle: {
304
+ type: Object,
305
+ default: () => ({
306
+ paddingRight: "52px"
307
+ })
308
+ },
309
+ showClipboard: {
310
+ type: Boolean,
311
+ default: !1
312
+ }
313
+ },
314
+ setup(e) {
315
+ const t = e;
316
+ function r(p) {
317
+ return p.startsWith("http://") || p.startsWith("https://") || p.startsWith("data:");
318
+ }
319
+ const o = I(() => {
320
+ const p = t.avatarUrl.trim();
321
+ return r(p) ? p : "";
322
+ }), d = I(() => t.attachments.length > 0);
323
+ return (p, y) => d.value ? (s(), u("div", {
324
+ key: 0,
325
+ class: "feedback-message-group feedback-message-group--start",
326
+ style: le(t.bubbleStyle)
327
+ }, [f(a(ve), {
328
+ class: "feedback-message-avatar"
329
+ }, {
330
+ default: v(() => [o.value ? (s(), u("img", {
331
+ key: 0,
332
+ alt: "avatar",
333
+ src: o.value
334
+ }, null, 8, aa)) : (s(), u("span", sa, $(t.avatarText), 1))]),
335
+ _: 1
336
+ }), k("div", na, [t.text ? (s(), u("div", la, $(t.text), 1)) : P("", !0), t.showClipboard ? (s(), T(a(pe), {
337
+ key: 1,
338
+ class: "feedback-message-footer"
339
+ }, {
340
+ default: v(() => [f(me, {
341
+ value: t.text
342
+ }, null, 8, ["value"])]),
343
+ _: 1
344
+ })) : P("", !0), f(Ve, {
345
+ attachments: t.attachments
346
+ }, null, 8, ["attachments"])])], 4)) : (s(), u("div", ra, [f(a(Le), {
347
+ placement: "start",
348
+ style: le(t.bubbleStyle)
349
+ }, {
350
+ avatar: v(() => [f(a(ve), null, {
351
+ default: v(() => [o.value ? (s(), u("img", {
352
+ key: 0,
353
+ alt: "avatar",
354
+ src: o.value
355
+ }, null, 8, ia)) : (s(), u("span", oa, $(t.avatarText), 1))]),
356
+ _: 1
357
+ })]),
358
+ message: v(() => [t.text ? (s(), u(M, {
359
+ key: 0
360
+ }, [E($(t.text), 1)], 64)) : P("", !0)]),
361
+ footer: v(() => [f(a(pe), null, {
362
+ default: v(() => [t.showClipboard && t.text ? (s(), T(me, {
363
+ key: 0,
364
+ value: t.text
365
+ }, null, 8, ["value"])) : P("", !0)]),
366
+ _: 1
367
+ })]),
368
+ _: 1
369
+ }, 8, ["style"])]));
370
+ }
371
+ }), ca = /* @__PURE__ */ Y(ua, [["__scopeId", "data-v-a88b5650"]]), da = W({
372
+ name: "IconLink",
373
+ props: {
374
+ size: {
375
+ type: [Number, String]
376
+ },
377
+ strokeWidth: {
378
+ type: Number,
379
+ default: 4
380
+ },
381
+ strokeLinecap: {
382
+ type: String,
383
+ default: "butt",
384
+ validator: (e) => ["butt", "round", "square"].includes(e)
385
+ },
386
+ strokeLinejoin: {
387
+ type: String,
388
+ default: "miter",
389
+ validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
390
+ },
391
+ rotate: Number,
392
+ spin: Boolean
393
+ },
394
+ emits: {
395
+ click: (e) => !0
396
+ },
397
+ setup(e, {
398
+ emit: t
399
+ }) {
400
+ const r = Ft("icon"), o = I(() => [r, `${r}-link`, {
401
+ [`${r}-spin`]: e.spin
402
+ }]), d = I(() => {
403
+ const y = {};
404
+ return e.size && (y.fontSize = At(e.size) ? `${e.size}px` : e.size), e.rotate && (y.transform = `rotate(${e.rotate}deg)`), y;
405
+ });
406
+ return {
407
+ cls: o,
408
+ innerStyle: d,
409
+ onClick: (y) => {
410
+ t("click", y);
411
+ }
412
+ };
413
+ }
414
+ }), fa = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
415
+ function va(e, t, r, o, d, p) {
416
+ return s(), u("svg", {
417
+ viewBox: "0 0 48 48",
418
+ fill: "none",
419
+ xmlns: "http://www.w3.org/2000/svg",
420
+ stroke: "currentColor",
421
+ class: fe(e.cls),
422
+ style: le(e.innerStyle),
423
+ "stroke-width": e.strokeWidth,
424
+ "stroke-linecap": e.strokeLinecap,
425
+ "stroke-linejoin": e.strokeLinejoin,
426
+ onClick: t[0] || (t[0] = (...y) => e.onClick && e.onClick(...y))
427
+ }, t[1] || (t[1] = [k("path", {
428
+ d: "m14.1 25.414-4.95 4.95a6 6 0 0 0 8.486 8.485l8.485-8.485a6 6 0 0 0 0-8.485m7.779.707 4.95-4.95a6 6 0 1 0-8.486-8.485l-8.485 8.485a6 6 0 0 0 0 8.485"
429
+ }, null, -1)]), 14, fa);
430
+ }
431
+ var ye = /* @__PURE__ */ It(da, [["render", va]]);
432
+ const pa = Object.assign(ye, {
433
+ install: (e, t) => {
434
+ var r;
435
+ const o = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
436
+ e.component(o + ye.name, ye);
437
+ }
438
+ }), Ee = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".mp4", ".webm", ".mov", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt", ".md", ".csv", ".json", ".zip"], De = Ee.join(","), ma = /* @__PURE__ */ new Set(["image/jpeg", "image/png", "image/gif", "image/webp"]), ga = /* @__PURE__ */ new Set(["video/mp4", "video/webm", "video/quicktime"]);
439
+ function ba(e) {
440
+ const t = e.lastIndexOf(".");
441
+ return t < 0 ? "" : e.slice(t).toLowerCase();
442
+ }
443
+ function ka(e) {
444
+ return Ee.includes(ba(e.name));
445
+ }
446
+ function qe(e, t = e.type) {
447
+ return ma.has(t) ? "image" : ga.has(t) ? "video" : "file";
448
+ }
449
+ const ue = 9;
450
+ function ya(e) {
451
+ const t = qe(e);
452
+ return {
453
+ id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
454
+ file: e,
455
+ kind: t,
456
+ previewUrl: t === "image" || t === "video" ? URL.createObjectURL(e) : void 0
457
+ };
458
+ }
459
+ function Oe(e) {
460
+ const t = b([]), r = I(() => t.value.length > 0), o = I(() => t.value.filter((_) => _.kind === "image" && !!_.previewUrl)), d = I(() => t.value.filter((_) => _.kind === "video" && !!_.previewUrl)), p = I(() => t.value.filter((_) => _.kind === "file"));
461
+ function y(_) {
462
+ e == null || e(_);
463
+ }
464
+ function w(_) {
465
+ _.previewUrl && URL.revokeObjectURL(_.previewUrl);
466
+ }
467
+ function C(_) {
468
+ if (_.length === 0) return;
469
+ const A = _.filter(ka);
470
+ if (_.length - A.length > 0 && y("仅支持常见图片、浏览器可预览视频、文档、文本、CSV、JSON 和 ZIP 文件"), A.length === 0) return;
471
+ const m = ue - t.value.length;
472
+ if (m <= 0) {
473
+ y(`最多只能添加 ${ue} 个附件`);
474
+ return;
475
+ }
476
+ const U = A.slice(0, m);
477
+ A.length > m && y(`最多只能添加 ${ue} 个附件,已跳过多余文件`), t.value.push(...U.map(ya));
478
+ }
479
+ function x(_) {
480
+ const A = t.value[_];
481
+ A && (w(A), t.value.splice(_, 1));
482
+ }
483
+ function B() {
484
+ t.value.forEach(w), t.value = [];
485
+ }
486
+ return ot(() => {
487
+ B();
488
+ }), {
489
+ items: t,
490
+ imageItems: o,
491
+ videoItems: d,
492
+ fileItems: p,
493
+ hasAttachments: r,
494
+ addFiles: C,
495
+ removeAt: x,
496
+ clear: B,
497
+ maxAttachments: ue
498
+ };
499
+ }
500
+ async function _a(e, t, r) {
501
+ const {
502
+ data: o,
503
+ error: d
504
+ } = await e.upload({
505
+ file: t,
506
+ bucketId: r
507
+ });
508
+ return {
509
+ data: (o == null ? void 0 : o.key) ?? null,
510
+ error: d
511
+ };
512
+ }
513
+ async function ze(e, t, r) {
514
+ const o = [];
515
+ for (const d of t) {
516
+ const p = await _a(e, d, r);
517
+ if (p.error || !p.data)
518
+ return {
519
+ data: null,
520
+ error: p.error ?? new Error("上传反馈附件失败")
521
+ };
522
+ const y = _t(d);
523
+ o.push({
524
+ key: p.data,
525
+ name: d.name,
526
+ size: d.size,
527
+ mimeType: y,
528
+ kind: qe(d, y)
529
+ });
530
+ }
531
+ return {
532
+ data: o,
533
+ error: null
534
+ };
535
+ }
536
+ function ha(e, t = {}) {
537
+ const {
538
+ interval: r = 2e3,
539
+ immediate: o = !1,
540
+ autoStart: d = !1
541
+ } = t, p = b(!1);
542
+ let y = null;
543
+ async function w() {
544
+ try {
545
+ await e();
546
+ } catch (_) {
547
+ console.error("轮询回调执行失败:", _);
548
+ }
549
+ }
550
+ function C() {
551
+ if (p.value) {
552
+ console.warn("轮询已在运行中");
553
+ return;
554
+ }
555
+ p.value = !0, o && w(), y = setInterval(w, r);
556
+ }
557
+ function x() {
558
+ y && (clearInterval(y), y = null), p.value = !1;
559
+ }
560
+ function B() {
561
+ x(), C();
562
+ }
563
+ return d && C(), ut(() => {
564
+ x();
565
+ }), {
566
+ isPolling: p,
567
+ start: C,
568
+ stop: x,
569
+ restart: B
570
+ };
571
+ }
572
+ const ge = b(0);
573
+ let te = null, de = null, he = !1;
574
+ function wa() {
575
+ ge.value = 0;
576
+ }
577
+ async function Ca() {
578
+ const {
579
+ data: e,
580
+ error: t
581
+ } = await H().ones.feedbackCenter.unreadReplyCount.post({});
582
+ return t ? null : typeof (e == null ? void 0 : e.count) == "number" ? e.count : 0;
583
+ }
584
+ async function Z() {
585
+ return te || (te = (async () => {
586
+ await wt();
587
+ const e = await Ca();
588
+ e !== null && (ge.value = e);
589
+ })().finally(() => {
590
+ te = null;
591
+ }), te);
592
+ }
593
+ function Sa() {
594
+ he || (he = !0, de = setInterval(() => {
595
+ Z();
596
+ }, 6e4));
597
+ }
598
+ function xa() {
599
+ de && (clearInterval(de), de = null), he = !1;
600
+ }
601
+ function Is() {
602
+ const {
603
+ isLoggedIn: e
604
+ } = xt(), {
605
+ isOpen: t,
606
+ messagesTrigger: r,
607
+ feedbackTrigger: o
608
+ } = Ut();
609
+ return ke(e, (d) => {
610
+ if (d) {
611
+ Z(), Sa();
612
+ return;
613
+ }
614
+ ht(), wa(), xa();
615
+ }, {
616
+ immediate: !0
617
+ }), ke(t, (d) => {
618
+ d && e.value && Z();
619
+ }), ke([r, o], () => {
620
+ e.value && window.setTimeout(() => {
621
+ Z();
622
+ }, 1500);
623
+ }), {
624
+ messageUnreadCount: Be,
625
+ feedbackUnreadCount: ct(ge),
626
+ hasMessageBadge: I(() => Be.value > 0),
627
+ hasFeedbackBadge: I(() => ge.value > 0),
628
+ refreshUserMenuBadgeCounts: Z
629
+ };
630
+ }
631
+ const Se = [{
632
+ key: "bugReports",
633
+ label: "问题报告"
634
+ }, {
635
+ key: "featureSuggestions",
636
+ label: "功能建议"
637
+ }, {
638
+ key: "technicalSupportRequests",
639
+ label: "技术支持请求"
640
+ }, {
641
+ key: "generalOpinions",
642
+ label: "一般意见"
643
+ }], Ne = [{
644
+ key: "urgent",
645
+ label: "紧急"
646
+ }, {
647
+ key: "high",
648
+ label: "高"
649
+ }, {
650
+ key: "normal",
651
+ label: "普通"
652
+ }, {
653
+ key: "low",
654
+ label: "低"
655
+ }], je = [{
656
+ key: "newFeedback",
657
+ label: "新反馈"
658
+ }, {
659
+ key: "inProgress",
660
+ label: "处理中"
661
+ }, {
662
+ key: "pending",
663
+ label: "待处理"
664
+ }, {
665
+ key: "resolved",
666
+ label: "已解决"
667
+ }, {
668
+ key: "closed",
669
+ label: "已关闭"
670
+ }];
671
+ function Ua(e) {
672
+ return e ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("data:") : !1;
673
+ }
674
+ function ce(e) {
675
+ const t = (e.attachments ?? []).filter((r) => Ua(r.url));
676
+ return {
677
+ text: e.content ?? "",
678
+ attachments: t
679
+ };
680
+ }
681
+ const $a = {
682
+ class: "FeedBackDetails"
683
+ }, Ia = {
684
+ class: "scrollable-content__inner"
685
+ }, Fa = {
686
+ class: "content"
687
+ }, Aa = {
688
+ class: "empty-title"
689
+ }, Ra = {
690
+ class: "empty-tips"
691
+ }, Pa = {
692
+ key: 1,
693
+ class: "Bubbles"
694
+ }, Ba = {
695
+ class: "sender-container"
696
+ }, Ta = {
697
+ key: 0,
698
+ class: "attachments-preview"
699
+ }, Ma = ["onClick"], La = ["src"], Va = ["src"], Ea = {
700
+ class: "attachment-file-name"
701
+ }, Da = ["onClick"], qa = ["accept"], Oa = /* @__PURE__ */ W({
702
+ __name: "FeedbackDetails",
703
+ props: {
704
+ id: {
705
+ type: String,
706
+ required: !0,
707
+ default: () => ""
708
+ },
709
+ senderRole: {
710
+ type: String,
711
+ required: !0,
712
+ validator: (e) => ["user", "support"].includes(e)
713
+ },
714
+ appId: {
715
+ type: String,
716
+ required: !1,
717
+ default: ""
718
+ }
719
+ },
720
+ setup(e) {
721
+ const t = St;
722
+ function r(i) {
723
+ return i === "inProgress" ? "orangered" : i === "pending" ? "gold" : i === "resolved" ? "green" : i === "closed" ? "gray" : "arcoblue";
724
+ }
725
+ const o = b(""), d = b(!1), {
726
+ config: p,
727
+ upload: y
728
+ } = Me(), w = b(null), C = b(null), x = b(null), B = b(!1), _ = b(!1), A = b(0), D = b(!1), m = b(""), U = b(""), l = Oe((i) => {
729
+ se.warning(i);
730
+ }), F = I(() => l.imageItems.value.map((i) => i.previewUrl || "")), L = I(() => o.value.trim().length > 0 || l.hasAttachments.value), R = () => {
731
+ var i;
732
+ (i = w.value) == null || i.focus({
733
+ cursor: "end"
734
+ }), ie(() => {
735
+ C.value && (C.value.scrollTop = C.value.scrollHeight);
736
+ });
737
+ }, V = e;
738
+ function S() {
739
+ return V.appId ? {
740
+ headers: {
741
+ "app-id": V.appId
742
+ }
743
+ } : void 0;
744
+ }
745
+ const h = I(() => V.senderRole === "support" ? "暂无沟通记录" : "还没有消息"), g = I(() => V.senderRole === "support" ? ["可在下方输入框回复用户", "支持发送文字、图片和文件附件"] : ["请尽量详细描述问题或需求", "可上传多张图片或文件附件,支持与文字一起发送"]), j = I(() => V.senderRole === "support" ? "输入回复内容,Enter 发送" : "补充问题描述或追问,Enter 发送"), K = b(!1), N = b([]), re = b(void 0);
746
+ function We(i, c) {
747
+ const n = "seq" in i && typeof i.seq == "number" ? i.seq : c;
748
+ return `${i.senderRole}-${n}-${c}`;
749
+ }
750
+ function xe(i) {
751
+ var c;
752
+ return String(((c = i.senderInfo) == null ? void 0 : c.avatarUrl) || "");
753
+ }
754
+ function Ue(i) {
755
+ var n;
756
+ const c = String(((n = i.senderInfo) == null ? void 0 : n.nickname) || "").trim();
757
+ return c ? c.slice(0, 1).toUpperCase() : i.senderRole === "support" ? "S" : "U";
758
+ }
759
+ const X = b({
760
+ id: void 0,
761
+ title: "",
762
+ description: "",
763
+ type: "bugReports",
764
+ status: "newFeedback",
765
+ reply: "",
766
+ createAt: ""
767
+ });
768
+ function Ke() {
769
+ var i;
770
+ (i = x.value) == null || i.click();
771
+ }
772
+ function He(i) {
773
+ const c = i.target, n = c.files;
774
+ n != null && n.length && l.addFiles(Array.from(n)), c.value = "";
775
+ }
776
+ function Ge(i) {
777
+ if (i.kind === "image" && i.previewUrl) {
778
+ const c = l.imageItems.value.findIndex((n) => n.id === i.id);
779
+ if (c < 0) return;
780
+ A.value = c, _.value = !0;
781
+ return;
782
+ }
783
+ i.kind === "video" && i.previewUrl && (m.value = i.previewUrl, U.value = i.file.name, D.value = !0);
784
+ }
785
+ function Xe(i) {
786
+ var q;
787
+ const c = (q = i.clipboardData) == null ? void 0 : q.items;
788
+ if (!c) return;
789
+ const n = [];
790
+ for (const z of c)
791
+ if (z.type.startsWith("image/")) {
792
+ const O = z.getAsFile();
793
+ O && n.push(O);
794
+ }
795
+ n.length > 0 && (i.preventDefault(), l.addFiles(n));
796
+ }
797
+ function Ye(i) {
798
+ var c;
799
+ (c = i.dataTransfer) != null && c.types.includes("Files") && (B.value = !0);
800
+ }
801
+ function Je() {
802
+ B.value = !1;
803
+ }
804
+ function Ze(i) {
805
+ var n;
806
+ B.value = !1;
807
+ const c = (n = i.dataTransfer) == null ? void 0 : n.files;
808
+ c && l.addFiles(Array.from(c));
809
+ }
810
+ async function Qe() {
811
+ V.senderRole === "support" && X.value.status === "newFeedback" && await $e();
812
+ }
813
+ async function et() {
814
+ var Fe;
815
+ const i = o.value, c = l.items.value.map((J) => J.file);
816
+ if (!i.trim() && c.length === 0)
817
+ return;
818
+ d.value = !0;
819
+ let n = [];
820
+ if (c.length > 0) {
821
+ const J = await ze(y, c, p.feedbackBucketId);
822
+ if (J.error || !J.data) {
823
+ d.value = !1, se.error(((Fe = J.error) == null ? void 0 : Fe.message) || "上传反馈附件失败");
824
+ return;
825
+ }
826
+ n = J.data;
827
+ }
828
+ const q = i.trim(), {
829
+ data: z,
830
+ error: O
831
+ } = await H().ones.feedbackCenter.update.messages.post({
832
+ id: V.id,
833
+ message: {
834
+ type: "text",
835
+ content: q,
836
+ attachments: n,
837
+ senderRole: V.senderRole
838
+ }
839
+ }, S());
840
+ if (d.value = !1, O || !z)
841
+ return;
842
+ const be = z;
843
+ N.value.push(be.message), typeof be.message.seq == "number" && (re.value = be.message.seq), o.value = "", l.clear(), ie(() => {
844
+ R();
845
+ }), await Qe();
846
+ }
847
+ async function $e() {
848
+ K.value = !0;
849
+ const {
850
+ data: i,
851
+ error: c
852
+ } = await H().ones.feedbackCenter.findOne.post({
853
+ id: V.id
854
+ }, S());
855
+ if (K.value = !1, c || !i)
856
+ return;
857
+ const n = i;
858
+ X.value = n;
859
+ }
860
+ async function Ie() {
861
+ if (V.senderRole !== "user")
862
+ return;
863
+ const {
864
+ error: i
865
+ } = await H().ones.feedbackCenter.markRead.post({
866
+ id: V.id
867
+ }, S());
868
+ i || Z();
869
+ }
870
+ async function tt() {
871
+ var q;
872
+ const {
873
+ data: i,
874
+ error: c
875
+ } = await H().ones.messages.list.incremental.post({
876
+ id: V.id,
877
+ lastSeq: re.value
878
+ }, S());
879
+ if (c || !i)
880
+ return;
881
+ const n = i;
882
+ if ((q = n.messages) != null && q.length) {
883
+ const z = n.messages;
884
+ N.value.push(...z);
885
+ const O = z.at(-1);
886
+ O && "seq" in O && typeof O.seq == "number" && (re.value = O.seq), ie(() => {
887
+ R();
888
+ }), await Ie();
889
+ }
890
+ }
891
+ async function at() {
892
+ var q;
893
+ K.value = !0;
894
+ const {
895
+ data: i,
896
+ error: c
897
+ } = await H().ones.messages.list.post({
898
+ id: V.id
899
+ }, S());
900
+ if (K.value = !1, c || !i)
901
+ return;
902
+ const n = i;
903
+ if ((q = n.messages) != null && q.length) {
904
+ const z = n.messages;
905
+ N.value = z;
906
+ const O = z.at(-1);
907
+ O && "seq" in O && typeof O.seq == "number" && (re.value = O.seq), ie(() => {
908
+ R();
909
+ });
910
+ }
911
+ await Ie();
912
+ }
913
+ return ha(tt, {
914
+ interval: 2e3,
915
+ autoStart: !0
916
+ }), $e(), at(), (i, c) => (s(), u("div", $a, [k("div", {
917
+ ref_key: "scrollableContentRef",
918
+ ref: C,
919
+ class: "scrollable-content"
920
+ }, [k("div", Ia, [f(a(dt), {
921
+ title: "基本信息"
922
+ }, {
923
+ title: v(() => [...c[4] || (c[4] = [k("div", {
924
+ class: "title"
925
+ }, "基本信息", -1)])]),
926
+ default: v(() => [f(a(oe), {
927
+ label: "标题:",
928
+ span: 3
929
+ }, {
930
+ default: v(() => [E($(X.value.title), 1)]),
931
+ _: 1
932
+ }), f(a(oe), {
933
+ label: "问题描述:",
934
+ span: 3
935
+ }, {
936
+ default: v(() => [E($(X.value.description || "-"), 1)]),
937
+ _: 1
938
+ }), f(a(oe), {
939
+ label: "反馈类型:",
940
+ span: 1
941
+ }, {
942
+ default: v(() => [f(a(ae), {
943
+ color: "arcoblue"
944
+ }, {
945
+ default: v(() => {
946
+ var n;
947
+ return [E($((n = a(ne)(a(Se), X.value.type)) == null ? void 0 : n.label), 1)];
948
+ }),
949
+ _: 1
950
+ })]),
951
+ _: 1
952
+ }), f(a(oe), {
953
+ label: "状态:",
954
+ span: 1
955
+ }, {
956
+ default: v(() => [f(a(ae), {
957
+ color: r(X.value.status)
958
+ }, {
959
+ default: v(() => {
960
+ var n;
961
+ return [E($((n = a(ne)(a(je), X.value.status)) == null ? void 0 : n.label), 1)];
962
+ }),
963
+ _: 1
964
+ }, 8, ["color"])]),
965
+ _: 1
966
+ })]),
967
+ _: 1
968
+ }), k("div", Fa, [c[5] || (c[5] = k("div", {
969
+ class: "title"
970
+ }, "沟通记录", -1)), f(a(ft), {
971
+ class: "messageContent",
972
+ loading: K.value
973
+ }, {
974
+ default: v(() => [N.value.length === 0 ? (s(), T(a(vt), {
975
+ key: 0,
976
+ class: "message-empty"
977
+ }, {
978
+ description: v(() => [k("div", Aa, $(h.value), 1), k("ul", Ra, [(s(!0), u(M, null, G(g.value, (n) => (s(), u("li", {
979
+ key: n
980
+ }, $(n), 1))), 128))])]),
981
+ _: 1
982
+ })) : (s(), u("div", Pa, [(s(!0), u(M, null, G(N.value, (n, q) => (s(), u(M, {
983
+ key: We(n, q)
984
+ }, [n.senderRole !== V.senderRole ? (s(), T(ca, {
985
+ key: 0,
986
+ text: a(ce)(n).text,
987
+ attachments: a(ce)(n).attachments,
988
+ "avatar-url": xe(n),
989
+ "avatar-text": Ue(n)
990
+ }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"])) : (s(), T(ta, {
991
+ key: 1,
992
+ text: a(ce)(n).text,
993
+ attachments: a(ce)(n).attachments,
994
+ "avatar-url": xe(n),
995
+ "avatar-text": Ue(n)
996
+ }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"]))], 64))), 128))]))]),
997
+ _: 1
998
+ }, 8, ["loading"])])])], 512), k("div", Ba, [k("div", {
999
+ class: fe(["sender-panel", {
1000
+ "is-drag-over": B.value
1001
+ }]),
1002
+ onDragover: Q(Ye, ["prevent"]),
1003
+ onDragleave: Je,
1004
+ onDrop: Q(Ze, ["prevent"]),
1005
+ onPaste: Xe
1006
+ }, [a(l).hasAttachments.value ? (s(), u("div", Ta, [(s(!0), u(M, null, G(a(l).items.value, (n, q) => (s(), u("div", {
1007
+ key: n.id,
1008
+ class: fe(["attachment-preview-item", {
1009
+ "is-image": n.kind === "image",
1010
+ "is-video": n.kind === "video"
1011
+ }]),
1012
+ onClick: (z) => Ge(n)
1013
+ }, [n.kind === "image" && n.previewUrl ? (s(), u("img", {
1014
+ key: 0,
1015
+ src: n.previewUrl,
1016
+ alt: "预览",
1017
+ class: "attachment-thumbnail"
1018
+ }, null, 8, La)) : n.kind === "video" && n.previewUrl ? (s(), u(M, {
1019
+ key: 1
1020
+ }, [k("video", {
1021
+ class: "attachment-thumbnail",
1022
+ src: n.previewUrl,
1023
+ muted: "",
1024
+ preload: "metadata"
1025
+ }, null, 8, Va), c[6] || (c[6] = k("span", {
1026
+ class: "attachment-video-play"
1027
+ }, "播放", -1))], 64)) : (s(), u(M, {
1028
+ key: 2
1029
+ }, [c[7] || (c[7] = k("span", {
1030
+ class: "attachment-file-icon"
1031
+ }, "FILE", -1)), k("span", Ea, $(n.file.name), 1)], 64)), k("button", {
1032
+ type: "button",
1033
+ class: "attachment-remove-btn",
1034
+ title: "移除附件",
1035
+ onClick: Q((z) => a(l).removeAt(q), ["stop"])
1036
+ }, " × ", 8, Da)], 10, Ma))), 128))])) : P("", !0), f(a(we), {
1037
+ "src-list": F.value,
1038
+ visible: _.value,
1039
+ "onUpdate:visible": c[0] || (c[0] = (n) => _.value = n),
1040
+ current: A.value,
1041
+ "onUpdate:current": c[1] || (c[1] = (n) => A.value = n)
1042
+ }, null, 8, ["src-list", "visible", "current"]), f(Ce, {
1043
+ visible: D.value,
1044
+ "onUpdate:visible": c[2] || (c[2] = (n) => D.value = n),
1045
+ title: U.value,
1046
+ src: m.value
1047
+ }, null, 8, ["visible", "title", "src"]), f(a(t), {
1048
+ ref_key: "senderRef",
1049
+ ref: w,
1050
+ value: o.value,
1051
+ "onUpdate:value": c[3] || (c[3] = (n) => o.value = n),
1052
+ placeholder: j.value,
1053
+ loading: d.value,
1054
+ "allow-speech": !1,
1055
+ "read-only": d.value,
1056
+ "send-disabled": !L.value,
1057
+ onSubmit: et
1058
+ }, {
1059
+ prefix: v(() => [f(a(_e), {
1060
+ type: "text",
1061
+ class: "IconLink",
1062
+ disabled: d.value,
1063
+ onClick: Ke
1064
+ }, {
1065
+ icon: v(() => [f(a(pa))]),
1066
+ _: 1
1067
+ }, 8, ["disabled"])]),
1068
+ _: 1
1069
+ }, 8, ["value", "placeholder", "loading", "read-only", "send-disabled"]), k("input", {
1070
+ ref_key: "fileInputRef",
1071
+ ref: x,
1072
+ type: "file",
1073
+ accept: a(De),
1074
+ multiple: "",
1075
+ class: "hidden-file-input",
1076
+ onChange: He
1077
+ }, null, 40, qa)], 34)])]));
1078
+ }
1079
+ }), za = /* @__PURE__ */ Y(Oa, [["__scopeId", "data-v-b2018498"]]), Na = {
1080
+ class: "FeedBackFrom"
1081
+ }, ja = {
1082
+ class: "feedback-attachments-field"
1083
+ }, Wa = {
1084
+ key: 0,
1085
+ class: "attachments-preview"
1086
+ }, Ka = ["onClick"], Ha = ["src"], Ga = ["src"], Xa = {
1087
+ class: "attachment-file-name"
1088
+ }, Ya = ["onClick"], Ja = ["accept"], Za = /* @__PURE__ */ W({
1089
+ __name: "FeedbackForm",
1090
+ emits: ["confirm"],
1091
+ setup(e, {
1092
+ emit: t
1093
+ }) {
1094
+ const r = t, o = b(), d = b(!1), {
1095
+ config: p,
1096
+ upload: y
1097
+ } = Me(), w = b({
1098
+ id: void 0,
1099
+ title: "",
1100
+ type: "bugReports",
1101
+ priority: "normal",
1102
+ description: ""
1103
+ }), C = b(null), x = b(!1), B = b(0), _ = b(!1), A = b(""), D = b(""), m = Oe((S) => {
1104
+ se.warning(S);
1105
+ }), U = I(() => m.imageItems.value.map((S) => S.previewUrl || ""));
1106
+ function l() {
1107
+ var S;
1108
+ (S = C.value) == null || S.click();
1109
+ }
1110
+ function F(S) {
1111
+ const h = S.target, g = h.files;
1112
+ g != null && g.length && m.addFiles(Array.from(g)), h.value = "";
1113
+ }
1114
+ function L(S) {
1115
+ if (S.kind === "image" && S.previewUrl) {
1116
+ const h = m.imageItems.value.findIndex((g) => g.id === S.id);
1117
+ if (h < 0) return;
1118
+ B.value = h, x.value = !0;
1119
+ return;
1120
+ }
1121
+ S.kind === "video" && S.previewUrl && (A.value = S.previewUrl, D.value = S.file.name, _.value = !0);
1122
+ }
1123
+ function R() {
1124
+ var S, h;
1125
+ w.value = {
1126
+ id: void 0,
1127
+ title: "",
1128
+ type: "bugReports",
1129
+ priority: "normal",
1130
+ description: ""
1131
+ }, m.clear(), (h = (S = o.value) == null ? void 0 : S.resetFields) == null || h.call(S);
1132
+ }
1133
+ async function V() {
1134
+ var h;
1135
+ if (!await o.value.validate()) {
1136
+ d.value = !0;
1137
+ const g = m.items.value.map((N) => N.file);
1138
+ let j = [];
1139
+ if (g.length > 0) {
1140
+ const N = await ze(y, g, p.feedbackBucketId);
1141
+ if (N.error || !N.data) {
1142
+ d.value = !1, se.error(((h = N.error) == null ? void 0 : h.message) || "上传反馈附件失败");
1143
+ return;
1144
+ }
1145
+ j = N.data;
1146
+ }
1147
+ const {
1148
+ error: K
1149
+ } = await H().ones.feedbackCenter.create.post({
1150
+ title: w.value.title,
1151
+ type: w.value.type,
1152
+ priority: w.value.priority,
1153
+ description: w.value.description,
1154
+ attachments: j
1155
+ });
1156
+ d.value = !1, K || (se.success("新建反馈成功"), R(), r("confirm"));
1157
+ }
1158
+ }
1159
+ return (S, h) => (s(), u("div", Na, [f(a(pt), {
1160
+ ref_key: "formRef",
1161
+ ref: o,
1162
+ model: w.value,
1163
+ "auto-label-width": "",
1164
+ layout: "vertical"
1165
+ }, {
1166
+ default: v(() => [f(a(ee), {
1167
+ field: "title",
1168
+ label: "标题",
1169
+ rules: [{
1170
+ required: !0,
1171
+ message: "请输入标题"
1172
+ }]
1173
+ }, {
1174
+ default: v(() => [f(a(mt), {
1175
+ modelValue: w.value.title,
1176
+ "onUpdate:modelValue": h[0] || (h[0] = (g) => w.value.title = g),
1177
+ placeholder: "请输入标题"
1178
+ }, null, 8, ["modelValue"])]),
1179
+ _: 1
1180
+ }), f(a(ee), {
1181
+ field: "type",
1182
+ label: "反馈类型",
1183
+ rules: [{
1184
+ required: !0,
1185
+ message: "请选择反馈类型"
1186
+ }]
1187
+ }, {
1188
+ default: v(() => [f(a(Ae), {
1189
+ modelValue: w.value.type,
1190
+ "onUpdate:modelValue": h[1] || (h[1] = (g) => w.value.type = g),
1191
+ placeholder: "请选择反馈类型"
1192
+ }, {
1193
+ default: v(() => [(s(!0), u(M, null, G(a(Se), (g, j) => (s(), T(a(Re), {
1194
+ key: j,
1195
+ value: g.key
1196
+ }, {
1197
+ default: v(() => [E($(g.label), 1)]),
1198
+ _: 2
1199
+ }, 1032, ["value"]))), 128))]),
1200
+ _: 1
1201
+ }, 8, ["modelValue"])]),
1202
+ _: 1
1203
+ }), f(a(ee), {
1204
+ field: "priority",
1205
+ label: "优先级",
1206
+ rules: [{
1207
+ required: !0,
1208
+ message: "请选择优先级"
1209
+ }]
1210
+ }, {
1211
+ default: v(() => [f(a(Ae), {
1212
+ modelValue: w.value.priority,
1213
+ "onUpdate:modelValue": h[2] || (h[2] = (g) => w.value.priority = g),
1214
+ placeholder: "请选择优先级"
1215
+ }, {
1216
+ default: v(() => [(s(!0), u(M, null, G(a(Ne), (g, j) => (s(), T(a(Re), {
1217
+ key: j,
1218
+ value: g.key
1219
+ }, {
1220
+ default: v(() => [E($(g.label), 1)]),
1221
+ _: 2
1222
+ }, 1032, ["value"]))), 128))]),
1223
+ _: 1
1224
+ }, 8, ["modelValue"])]),
1225
+ _: 1
1226
+ }), f(a(ee), {
1227
+ field: "description",
1228
+ label: "问题描述",
1229
+ rules: [{
1230
+ required: !0,
1231
+ message: "请输入问题描述"
1232
+ }]
1233
+ }, {
1234
+ default: v(() => [f(a(gt), {
1235
+ modelValue: w.value.description,
1236
+ "onUpdate:modelValue": h[3] || (h[3] = (g) => w.value.description = g),
1237
+ placeholder: "请输入问题描述",
1238
+ "allow-clear": "",
1239
+ "auto-size": {
1240
+ minRows: 5
1241
+ }
1242
+ }, null, 8, ["modelValue"])]),
1243
+ _: 1
1244
+ }), f(a(ee), {
1245
+ field: "attachments",
1246
+ label: "附件"
1247
+ }, {
1248
+ default: v(() => [k("div", ja, [f(a(_e), {
1249
+ type: "outline",
1250
+ disabled: d.value,
1251
+ onClick: l
1252
+ }, {
1253
+ default: v(() => [...h[7] || (h[7] = [E(" 添加图片、视频或文件 ", -1)])]),
1254
+ _: 1
1255
+ }, 8, ["disabled"]), a(m).hasAttachments.value ? (s(), u("div", Wa, [(s(!0), u(M, null, G(a(m).items.value, (g, j) => (s(), u("div", {
1256
+ key: g.id,
1257
+ class: fe(["attachment-preview-item", {
1258
+ "is-image": g.kind === "image",
1259
+ "is-video": g.kind === "video"
1260
+ }]),
1261
+ onClick: (K) => L(g)
1262
+ }, [g.kind === "image" && g.previewUrl ? (s(), u("img", {
1263
+ key: 0,
1264
+ src: g.previewUrl,
1265
+ alt: "预览",
1266
+ class: "attachment-thumbnail"
1267
+ }, null, 8, Ha)) : g.kind === "video" && g.previewUrl ? (s(), u(M, {
1268
+ key: 1
1269
+ }, [k("video", {
1270
+ class: "attachment-thumbnail",
1271
+ src: g.previewUrl,
1272
+ muted: "",
1273
+ preload: "metadata"
1274
+ }, null, 8, Ga), h[8] || (h[8] = k("span", {
1275
+ class: "attachment-video-play"
1276
+ }, "播放", -1))], 64)) : (s(), u(M, {
1277
+ key: 2
1278
+ }, [h[9] || (h[9] = k("span", {
1279
+ class: "attachment-file-icon"
1280
+ }, "FILE", -1)), k("span", Xa, $(g.file.name), 1)], 64)), k("button", {
1281
+ type: "button",
1282
+ class: "attachment-remove-btn",
1283
+ title: "移除附件",
1284
+ onClick: Q((K) => a(m).removeAt(j), ["stop"])
1285
+ }, " × ", 8, Ya)], 10, Ka))), 128))])) : P("", !0), f(a(we), {
1286
+ "src-list": U.value,
1287
+ visible: x.value,
1288
+ "onUpdate:visible": h[4] || (h[4] = (g) => x.value = g),
1289
+ current: B.value,
1290
+ "onUpdate:current": h[5] || (h[5] = (g) => B.value = g)
1291
+ }, null, 8, ["src-list", "visible", "current"]), f(Ce, {
1292
+ visible: _.value,
1293
+ "onUpdate:visible": h[6] || (h[6] = (g) => _.value = g),
1294
+ title: D.value,
1295
+ src: A.value
1296
+ }, null, 8, ["visible", "title", "src"]), k("input", {
1297
+ ref_key: "fileInputRef",
1298
+ ref: C,
1299
+ type: "file",
1300
+ accept: a(De),
1301
+ multiple: "",
1302
+ class: "hidden-file-input",
1303
+ onChange: F
1304
+ }, null, 40, Ja)])]),
1305
+ _: 1
1306
+ }), f(a(_e), {
1307
+ loading: d.value,
1308
+ type: "primary",
1309
+ onClick: V
1310
+ }, {
1311
+ default: v(() => [...h[10] || (h[10] = [E(" 提交 ", -1)])]),
1312
+ _: 1
1313
+ }, 8, ["loading"])]),
1314
+ _: 1
1315
+ }, 8, ["model"])]));
1316
+ }
1317
+ }), Qa = /* @__PURE__ */ Y(Za, [["__scopeId", "data-v-3d6cfadb"]]), es = {
1318
+ class: "message-panel"
1319
+ }, ts = {
1320
+ key: 2,
1321
+ class: "message-panel__detail"
1322
+ }, as = /* @__PURE__ */ W({
1323
+ __name: "FeedbackList",
1324
+ emits: ["toDetail"],
1325
+ setup(e, {
1326
+ expose: t,
1327
+ emit: r
1328
+ }) {
1329
+ const o = b(!0), d = b([]), p = b(!1), y = b(!1), w = b(""), C = b({
1330
+ total: 0,
1331
+ current: 1,
1332
+ pageSize: 10
1333
+ });
1334
+ function x() {
1335
+ o.value = !0, C.value.current = 1, m();
1336
+ }
1337
+ function B(l) {
1338
+ w.value = l.id, o.value = !1;
1339
+ }
1340
+ function _(l) {
1341
+ return l === "inProgress" ? "orangered" : l === "pending" ? "gold" : l === "resolved" ? "green" : l === "closed" ? "gray" : "arcoblue";
1342
+ }
1343
+ function A(l) {
1344
+ return l === "urgent" ? "red" : l === "high" ? "orangered" : l === "low" ? "gray" : "blue";
1345
+ }
1346
+ function D(l) {
1347
+ return l.map((F) => ({
1348
+ ...F,
1349
+ read: F.read ?? !0
1350
+ }));
1351
+ }
1352
+ async function m() {
1353
+ p.value = !0;
1354
+ const {
1355
+ data: l,
1356
+ error: F
1357
+ } = await H().ones.feedbackCenter.own.post({
1358
+ current: C.value.current,
1359
+ pageSize: C.value.pageSize
1360
+ });
1361
+ if (p.value = !1, !F && l) {
1362
+ const L = l, R = D(L.items || []);
1363
+ d.value = R, C.value.total = L.count || 0, y.value = R.length < C.value.pageSize;
1364
+ }
1365
+ }
1366
+ async function U() {
1367
+ if (p.value || y.value) return;
1368
+ C.value.current += 1, p.value = !0;
1369
+ const {
1370
+ data: l,
1371
+ error: F
1372
+ } = await H().ones.feedbackCenter.own.post({
1373
+ current: C.value.current,
1374
+ pageSize: C.value.pageSize
1375
+ });
1376
+ if (p.value = !1, !F && l) {
1377
+ const R = D(l.items || []);
1378
+ d.value = [...d.value, ...R], y.value = R.length < C.value.pageSize;
1379
+ }
1380
+ }
1381
+ return m(), t({
1382
+ refresh: m
1383
+ }), (l, F) => (s(), u("div", es, [o.value ? P("", !0) : (s(), T(a(bt), {
1384
+ key: 0,
1385
+ class: "message-panel__breadcrumb"
1386
+ }, {
1387
+ default: v(() => [f(a(Pe), {
1388
+ onClick: x
1389
+ }, {
1390
+ default: v(() => [...F[0] || (F[0] = [E("我的反馈", -1)])]),
1391
+ _: 1
1392
+ }), f(a(Pe), null, {
1393
+ default: v(() => [...F[1] || (F[1] = [E("反馈详情", -1)])]),
1394
+ _: 1
1395
+ })]),
1396
+ _: 1
1397
+ })), o.value ? (s(), T(Ct, {
1398
+ key: 1,
1399
+ "message-list": d.value,
1400
+ loading: p.value,
1401
+ finished: y.value,
1402
+ "show-read-status": !0,
1403
+ "show-view-button": !1,
1404
+ "empty-description": "暂无反馈",
1405
+ onItemClick: B,
1406
+ onLoadMore: U
1407
+ }, {
1408
+ tags: v(({
1409
+ item: L
1410
+ }) => [f(a(ae), {
1411
+ color: "arcoblue",
1412
+ size: "small"
1413
+ }, {
1414
+ default: v(() => {
1415
+ var R;
1416
+ return [E($((R = a(ne)(a(Se), L.type)) == null ? void 0 : R.label), 1)];
1417
+ }),
1418
+ _: 2
1419
+ }, 1024), f(a(ae), {
1420
+ color: A(L.priority),
1421
+ size: "small"
1422
+ }, {
1423
+ default: v(() => {
1424
+ var R;
1425
+ return [E($(((R = a(ne)(a(Ne), L.priority)) == null ? void 0 : R.label) || "普通"), 1)];
1426
+ }),
1427
+ _: 2
1428
+ }, 1032, ["color"]), f(a(ae), {
1429
+ color: _(L.status),
1430
+ size: "small"
1431
+ }, {
1432
+ default: v(() => {
1433
+ var R;
1434
+ return [E($((R = a(ne)(a(je), L.status)) == null ? void 0 : R.label), 1)];
1435
+ }),
1436
+ _: 2
1437
+ }, 1032, ["color"])]),
1438
+ description: v(({
1439
+ item: L
1440
+ }) => [E($(L.description || "暂无描述"), 1)]),
1441
+ _: 1
1442
+ }, 8, ["message-list", "loading", "finished"])) : (s(), u("div", ts, [f(za, {
1443
+ id: w.value,
1444
+ "sender-role": "user",
1445
+ class: "feedback-details-panel"
1446
+ }, null, 8, ["id"])]))]));
1447
+ }
1448
+ }), ss = {
1449
+ key: 0,
1450
+ class: "user-menu-modal-content"
1451
+ }, ns = {
1452
+ class: "left"
1453
+ }, ls = {
1454
+ key: 1,
1455
+ class: "user-menu-modal-form"
1456
+ }, Fs = /* @__PURE__ */ W({
1457
+ __name: "FeedbackModal",
1458
+ emits: ["confirm", "cancel"],
1459
+ setup(e, {
1460
+ expose: t,
1461
+ emit: r
1462
+ }) {
1463
+ const o = b(!1), d = b(Symbol("feedback-list")), p = b(Symbol("feedback-form")), y = r;
1464
+ function w() {
1465
+ x.value = ["FeedbackList"], d.value = Symbol("feedback-list"), p.value = Symbol("feedback-form");
1466
+ }
1467
+ function C() {
1468
+ w(), y("cancel");
1469
+ }
1470
+ const x = b(["FeedbackList"]), B = b([{
1471
+ name: "我的反馈",
1472
+ path: "FeedbackList",
1473
+ meta: {
1474
+ icon: "mingcute:cube-3d-fill"
1475
+ }
1476
+ }, {
1477
+ name: "新建反馈",
1478
+ path: "CreateFeedback",
1479
+ meta: {
1480
+ icon: "mingcute:cube-3d-fill"
1481
+ }
1482
+ }]), _ = I(() => x.value.length !== 0 ? x.value[0] : "");
1483
+ function A() {
1484
+ x.value = ["FeedbackList"], d.value = Symbol("feedback-list");
1485
+ }
1486
+ function D(U) {
1487
+ x.value = [U.path];
1488
+ }
1489
+ function m(U) {
1490
+ o.value = U, U && w();
1491
+ }
1492
+ return t({
1493
+ setData: m
1494
+ }), (U, l) => (s(), T(a(kt), {
1495
+ visible: o.value,
1496
+ "onUpdate:visible": l[1] || (l[1] = (F) => o.value = F),
1497
+ loading: !1,
1498
+ "body-class": "AppMessagebodyClass",
1499
+ "mask-closable": !1,
1500
+ footer: !1,
1501
+ width: a(st),
1502
+ title: "系统反馈",
1503
+ "hide-title": !1,
1504
+ onCancel: C
1505
+ }, {
1506
+ default: v(() => [o.value ? (s(), u("div", ss, [k("div", ns, [f(yt, {
1507
+ "selected-keys": x.value,
1508
+ "onUpdate:selectedKeys": l[0] || (l[0] = (F) => x.value = F),
1509
+ menus: B.value,
1510
+ onChange: D
1511
+ }, null, 8, ["selected-keys", "menus"])]), _.value === "FeedbackList" ? (s(), T(as, {
1512
+ key: d.value
1513
+ })) : P("", !0), _.value === "CreateFeedback" ? (s(), u("div", ls, [(s(), T(Qa, {
1514
+ key: p.value,
1515
+ onConfirm: A
1516
+ }))])) : P("", !0)])) : P("", !0)]),
1517
+ _: 1
1518
+ }, 8, ["visible", "width"]));
1519
+ }
1520
+ });
1521
+ export {
1522
+ ta as B,
1523
+ za as F,
1524
+ Te as R,
1525
+ Ce as V,
1526
+ as as _,
1527
+ ca as a,
1528
+ Qa as b,
1529
+ Fs as c,
1530
+ Is as u
1531
+ };