@knitify/vue 0.0.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -0
- package/dist/index.es.js +4490 -221
- package/dist/index.umd.js +1 -1
- package/dist/types/components/Accordion/KAccordion.vue.d.ts +11 -0
- package/dist/types/components/Accordion/KAccordionItem.vue.d.ts +22 -0
- package/dist/types/components/Accordion/keys.d.ts +2 -0
- package/dist/types/components/Accordion/types.d.ts +37 -0
- package/dist/types/components/Alert/KAlert.vue.d.ts +11 -0
- package/dist/types/components/Alert/types.d.ts +18 -0
- package/dist/types/components/Avatar/KAvatar.vue.d.ts +15 -0
- package/dist/types/components/Avatar/KAvatarGroup.vue.d.ts +11 -0
- package/dist/types/components/Avatar/types.d.ts +130 -0
- package/dist/types/components/Badge/types.d.ts +2 -0
- package/dist/types/components/Breadcrumb/KBreadcrumb.vue.d.ts +11 -0
- package/dist/types/components/Breadcrumb/KBreadcrumbItem.vue.d.ts +11 -0
- package/dist/types/components/Breadcrumb/types.d.ts +23 -0
- package/dist/types/components/Button/types.d.ts +15 -4
- package/dist/types/components/Calendar/KCalendar.vue.d.ts +34 -0
- package/dist/types/components/Calendar/types.d.ts +26 -0
- package/dist/types/components/Card/KCard.vue.d.ts +11 -0
- package/dist/types/components/Card/types.d.ts +26 -0
- package/dist/types/components/Chat/KChat.vue.d.ts +14 -0
- package/dist/types/components/Chat/KChatDivider.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatMessage.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatMessageActions.vue.d.ts +18 -0
- package/dist/types/components/Chat/KChatMessages.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatNotice.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatPrompt.vue.d.ts +30 -0
- package/dist/types/components/Chat/KChatShimmer.vue.d.ts +11 -0
- package/dist/types/components/Chat/keys.d.ts +2 -0
- package/dist/types/components/Chat/types.d.ts +140 -0
- package/dist/types/components/ChatDock/KChatDock.vue.d.ts +45 -0
- package/dist/types/components/ChatDock/KChatDockItem.vue.d.ts +11 -0
- package/dist/types/components/ChatDock/KChatDockPanel.vue.d.ts +11 -0
- package/dist/types/components/ChatDock/KChatWindow.vue.d.ts +27 -0
- package/dist/types/components/ChatDock/KMessenger.vue.d.ts +23 -0
- package/dist/types/components/ChatDock/keys.d.ts +98 -0
- package/dist/types/components/ChatDock/messenger-types.d.ts +280 -0
- package/dist/types/components/ChatDock/store-keys.d.ts +7 -0
- package/dist/types/components/ChatDock/types.d.ts +134 -0
- package/dist/types/components/ChatDock/useChatDock.d.ts +11 -0
- package/dist/types/components/Checkbox/KCheckbox.vue.d.ts +20 -0
- package/dist/types/components/Checkbox/types.d.ts +23 -0
- package/dist/types/components/Collapse/KCollapse.vue.d.ts +32 -0
- package/dist/types/components/Collapse/types.d.ts +32 -0
- package/dist/types/components/Collapse/useCollapseSync.d.ts +31 -0
- package/dist/types/components/Drawer/KDrawer.vue.d.ts +34 -0
- package/dist/types/components/Drawer/types.d.ts +54 -0
- package/dist/types/components/Dropdown/KDropdown.vue.d.ts +28 -0
- package/dist/types/components/Dropdown/KDropdownItem.vue.d.ts +13 -0
- package/dist/types/components/Dropdown/KDropdownMenu.vue.d.ts +13 -0
- package/dist/types/components/Dropdown/types.d.ts +34 -0
- package/dist/types/components/FileTree/KFileTree.vue.d.ts +34 -0
- package/dist/types/components/FileTree/KFileTreeNode.vue.d.ts +20 -0
- package/dist/types/components/FileTree/types.d.ts +39 -0
- package/dist/types/components/Grid/KGrid.vue.d.ts +11 -0
- package/dist/types/components/Grid/KGridColumn.vue.d.ts +11 -0
- package/dist/types/components/Grid/KGridRow.vue.d.ts +19 -0
- package/dist/types/components/Grid/types.d.ts +41 -0
- package/dist/types/components/Grid/useGrid.d.ts +8 -0
- package/dist/types/components/Icon/types.d.ts +1 -1
- package/dist/types/components/Input/KInput.vue.d.ts +3 -1
- package/dist/types/components/Input/types.d.ts +8 -0
- package/dist/types/components/MenuList/KMenuList.vue.d.ts +11 -0
- package/dist/types/components/MenuList/KMenuListItem.vue.d.ts +11 -0
- package/dist/types/components/MenuList/types.d.ts +20 -0
- package/dist/types/components/Modal/KModal.vue.d.ts +36 -0
- package/dist/types/components/Modal/types.d.ts +57 -0
- package/dist/types/components/NotificationList/KNotificationList.vue.d.ts +11 -0
- package/dist/types/components/NotificationList/KNotificationListItem.vue.d.ts +11 -0
- package/dist/types/components/NotificationList/types.d.ts +36 -0
- package/dist/types/components/Popover/KPopover.vue.d.ts +28 -0
- package/dist/types/components/Popover/types.d.ts +24 -0
- package/dist/types/components/Popover/useOverlaySync.d.ts +49 -0
- package/dist/types/components/Progress/KProgress.vue.d.ts +11 -0
- package/dist/types/components/Progress/types.d.ts +19 -0
- package/dist/types/components/Radio/KRadio.vue.d.ts +20 -0
- package/dist/types/components/Radio/types.d.ts +20 -0
- package/dist/types/components/Select/KSelect.vue.d.ts +22 -0
- package/dist/types/components/Select/types.d.ts +30 -0
- package/dist/types/components/Spinner/KSpinner.vue.d.ts +6 -0
- package/dist/types/components/Spinner/types.d.ts +13 -0
- package/dist/types/components/Table/KTable.vue.d.ts +11 -0
- package/dist/types/components/Table/types.d.ts +16 -0
- package/dist/types/components/Tabs/KTab.vue.d.ts +13 -0
- package/dist/types/components/Tabs/KTabPanel.vue.d.ts +13 -0
- package/dist/types/components/Tabs/KTabs.vue.d.ts +25 -0
- package/dist/types/components/Tabs/types.d.ts +35 -0
- package/dist/types/components/Toast/types.d.ts +20 -0
- package/dist/types/components/Toast/useToast.d.ts +20 -0
- package/dist/types/components/Toggle/KToggle.vue.d.ts +20 -0
- package/dist/types/components/Toggle/types.d.ts +8 -0
- package/dist/types/components/Tooltip/KTooltip.vue.d.ts +45 -0
- package/dist/types/components/Tooltip/types.d.ts +18 -0
- package/dist/types/components/Workspace/KWorkspace.vue.d.ts +30 -0
- package/dist/types/components/Workspace/types.d.ts +29 -0
- package/dist/types/components/index.d.ts +56 -0
- package/dist/types/components/types.d.ts +31 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/utils/useDocumentEvent.d.ts +19 -0
- package/dist/types/utils/useExclusive.d.ts +13 -0
- package/dist/types/utils/useTopmost.d.ts +17 -0
- package/dist/web-types.json +5107 -0
- package/package.json +22 -6
- package/dist/types/stories/KBadge.stories.d.ts +0 -104
- package/dist/types/stories/KButton.stories.d.ts +0 -117
- package/dist/types/stories/KContainer.stories.d.ts +0 -84
- package/dist/types/stories/KInput.stories.d.ts +0 -172
- package/dist/types/stories/KNavbar.stories.d.ts +0 -67
- package/dist/types/stories/KNavbarMenu.stories.d.ts +0 -99
package/dist/index.es.js
CHANGED
|
@@ -1,219 +1,3682 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { provide as Ae, inject as he, reactive as Me, ref as ye, computed as g, defineComponent as P, useId as Te, openBlock as i, createElementBlock as u, normalizeClass as T, renderSlot as v, watch as j, onBeforeUnmount as le, useModel as te, useTemplateRef as _, createElementVNode as K, withKeys as Oe, withModifiers as ne, unref as z, createTextVNode as F, toDisplayString as W, mergeModels as q, useSlots as ee, createCommentVNode as D, normalizeStyle as ce, createBlock as J, resolveDynamicComponent as Ne, withCtx as N, toRef as At, onMounted as De, onUnmounted as _e, nextTick as ue, onUpdated as et, createVNode as Z, shallowRef as ke, Teleport as Be, useAttrs as Ie, mergeProps as re, withDirectives as Pe, vModelText as Tt, vModelDynamic as It, Transition as Et, cloneVNode as Lt, h as Dt, Fragment as ae, Comment as xt, Text as Mt, createSlots as ge, renderList as ie, resolveComponent as tt, vModelCheckbox as Ot } from "vue";
|
|
2
|
+
import oe, { avatarColor as Pt } from "@knitify/core";
|
|
3
|
+
import { useLink as je, RouterLink as Rt } from "vue-router";
|
|
4
|
+
const Ue = /* @__PURE__ */ Symbol("KAccordionGroup"), Ve = /* @__PURE__ */ Symbol("KChatBusy"), xe = /* @__PURE__ */ Symbol("KChatDock"), We = /* @__PURE__ */ Symbol("KChatDockStore");
|
|
5
|
+
function at(e) {
|
|
6
|
+
Ae(We, e);
|
|
7
|
+
}
|
|
8
|
+
function zt() {
|
|
9
|
+
return he(We, void 0);
|
|
10
|
+
}
|
|
11
|
+
let He = 0, Fe = 0;
|
|
12
|
+
function st(e, l = {}) {
|
|
13
|
+
const o = Me({}), t = Me({}), s = ye("idle"), r = ye(void 0), n = ye(""), d = {}, k = {}, h = /* @__PURE__ */ new Set();
|
|
14
|
+
function c(f) {
|
|
15
|
+
h.forEach((I) => I(f));
|
|
16
|
+
}
|
|
17
|
+
function m(f) {
|
|
18
|
+
return o[f] || (o[f] = {
|
|
19
|
+
conversation: { id: f, name: "Conversation" },
|
|
20
|
+
window: "closed",
|
|
21
|
+
messages: [],
|
|
22
|
+
cursor: void 0,
|
|
23
|
+
loading: "idle",
|
|
24
|
+
loadingOlder: !1,
|
|
25
|
+
error: void 0,
|
|
26
|
+
draft: ""
|
|
27
|
+
}), o[f];
|
|
28
|
+
}
|
|
29
|
+
function S(f) {
|
|
30
|
+
f.messages = [], f.cursor = void 0, f.loading = "idle", f.loadingOlder = !1, f.error = void 0;
|
|
31
|
+
}
|
|
32
|
+
const x = g(() => {
|
|
33
|
+
const f = Object.values(o).map((H) => H.conversation);
|
|
34
|
+
return f.every((H) => H.updatedAt) ? [...f].sort(
|
|
35
|
+
(H, V) => String(V.updatedAt).localeCompare(String(H.updatedAt))
|
|
36
|
+
) : f;
|
|
37
|
+
}), M = g(
|
|
38
|
+
() => Object.values(o).filter((f) => f.window !== "closed").map((f) => f.conversation.id).sort((f, I) => (t[I] ?? 0) - (t[f] ?? 0))
|
|
39
|
+
);
|
|
40
|
+
async function R() {
|
|
41
|
+
s.value = "loading", r.value = void 0;
|
|
42
|
+
try {
|
|
43
|
+
(await e.loadConversations()).forEach((I) => {
|
|
44
|
+
m(I.id).conversation = {
|
|
45
|
+
...o[I.id].conversation,
|
|
46
|
+
...I
|
|
47
|
+
};
|
|
48
|
+
}), s.value = "loaded";
|
|
49
|
+
} catch (f) {
|
|
50
|
+
s.value = "error", r.value = f, c({ type: "error", kind: "conversations", error: f });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function E(f) {
|
|
54
|
+
const I = m(f), H = k[f];
|
|
55
|
+
if (H)
|
|
56
|
+
return I.loading = "loading", H;
|
|
57
|
+
const V = (d[f] ?? 0) + 1;
|
|
58
|
+
d[f] = V, I.loading = "loading", I.error = void 0;
|
|
59
|
+
const Y = e.loadMessages(f).then((se) => {
|
|
60
|
+
d[f] === V && (I.messages = Nt(se.messages), I.cursor = se.nextCursor ?? null, I.loading = "loaded");
|
|
61
|
+
}).catch((se) => {
|
|
62
|
+
d[f] === V && (I.loading = "error", I.error = se, c({ type: "error", kind: "messages", id: f, error: se }));
|
|
63
|
+
}).finally(() => {
|
|
64
|
+
k[f] === Y && (k[f] = void 0);
|
|
65
|
+
});
|
|
66
|
+
return k[f] = Y, Y;
|
|
67
|
+
}
|
|
68
|
+
function B(f) {
|
|
69
|
+
const I = m(f);
|
|
70
|
+
return I.loading === "idle" || I.loading === "error" ? E(f) : k[f] ?? Promise.resolve();
|
|
71
|
+
}
|
|
72
|
+
async function C(f) {
|
|
73
|
+
const I = m(f);
|
|
74
|
+
I.window = "expanded", He += 1, t[f] = He, I.conversation.unread = 0, c({ type: "open", id: f });
|
|
75
|
+
const H = B(f);
|
|
76
|
+
e.markRead && e.markRead(f).catch(() => {
|
|
77
|
+
}), await H;
|
|
78
|
+
}
|
|
79
|
+
async function b(f) {
|
|
80
|
+
m(f).window = "expanded", await B(f);
|
|
81
|
+
}
|
|
82
|
+
function L(f) {
|
|
83
|
+
m(f).window = "railed";
|
|
84
|
+
}
|
|
85
|
+
function U(f) {
|
|
86
|
+
const I = m(f);
|
|
87
|
+
I.window = "closed", l.evictOnClose && (d[f] = (d[f] ?? 0) + 1, k[f] = void 0, S(I), I.draft = ""), c({ type: "close", id: f });
|
|
88
|
+
}
|
|
89
|
+
async function $(f) {
|
|
90
|
+
const I = m(f);
|
|
91
|
+
if (typeof I.cursor != "string" || I.loadingOlder)
|
|
92
|
+
return;
|
|
93
|
+
const H = d[f] ?? 0;
|
|
94
|
+
I.loadingOlder = !0;
|
|
95
|
+
try {
|
|
96
|
+
const V = await e.loadMessages(f, I.cursor);
|
|
97
|
+
if (d[f] !== H)
|
|
98
|
+
return;
|
|
99
|
+
const Y = new Set(I.messages.map((se) => se.id));
|
|
100
|
+
I.messages = [
|
|
101
|
+
...V.messages.filter((se) => !Y.has(se.id)),
|
|
102
|
+
...I.messages
|
|
103
|
+
], I.cursor = V.nextCursor ?? null;
|
|
104
|
+
} catch (V) {
|
|
105
|
+
d[f] === H && c({ type: "error", kind: "messages", id: f, error: V });
|
|
106
|
+
} finally {
|
|
107
|
+
I.loadingOlder = !1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function w(f, I) {
|
|
111
|
+
const H = m(f);
|
|
112
|
+
try {
|
|
113
|
+
const V = await e.sendMessage(f, I.text), Y = H.messages.findIndex(
|
|
114
|
+
($e) => $e.id === I.id
|
|
115
|
+
), se = H.messages.some(($e) => $e.id === V.id);
|
|
116
|
+
if (Y === -1)
|
|
117
|
+
return;
|
|
118
|
+
se ? H.messages.splice(Y, 1) : H.messages.splice(Y, 1, { ...V, pending: !1 }), H.conversation.preview = V.text, H.conversation.updatedAt = V.sentAt ?? H.conversation.updatedAt, c({ type: "send", message: V });
|
|
119
|
+
} catch (V) {
|
|
120
|
+
const Y = H.messages.find((se) => se.id === I.id);
|
|
121
|
+
Y && (Y.pending = !1, Y.failed = !0), c({ type: "error", kind: "send", id: f, error: V });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function G(f, I) {
|
|
125
|
+
const H = I.trim();
|
|
126
|
+
if (!e.sendMessage || !H)
|
|
127
|
+
return;
|
|
128
|
+
const V = m(f);
|
|
129
|
+
Fe += 1;
|
|
130
|
+
const Y = {
|
|
131
|
+
id: `local-${Fe}`,
|
|
132
|
+
conversationId: f,
|
|
133
|
+
text: H,
|
|
134
|
+
sender: !0,
|
|
135
|
+
pending: !0
|
|
136
|
+
};
|
|
137
|
+
V.messages.push(Y), V.draft = "", await w(f, Y);
|
|
138
|
+
}
|
|
139
|
+
async function Q(f, I) {
|
|
140
|
+
const V = m(f).messages.find((Y) => Y.id === I);
|
|
141
|
+
!V || !V.failed || !e.sendMessage || (V.failed = !1, V.pending = !0, await w(f, V));
|
|
142
|
+
}
|
|
143
|
+
async function p(f) {
|
|
144
|
+
const I = m(f);
|
|
145
|
+
d[f] = (d[f] ?? 0) + 1, k[f] = void 0, I.error = void 0, await E(f);
|
|
146
|
+
}
|
|
147
|
+
function a(f) {
|
|
148
|
+
const I = m(f.conversationId);
|
|
149
|
+
I.messages.some((H) => H.id === f.id) || (I.messages.push(f), I.conversation.preview = f.text, I.conversation.updatedAt = f.sentAt ?? I.conversation.updatedAt, I.window !== "expanded" && !f.sender && (I.conversation.unread = (I.conversation.unread ?? 0) + 1), c({ type: "receive", message: f }));
|
|
150
|
+
}
|
|
151
|
+
function A(f, I) {
|
|
152
|
+
m(f).draft = I;
|
|
153
|
+
}
|
|
154
|
+
function y(f) {
|
|
155
|
+
n.value = f;
|
|
156
|
+
}
|
|
157
|
+
function O(f) {
|
|
158
|
+
return h.add(f), () => {
|
|
159
|
+
h.delete(f);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return R(), {
|
|
163
|
+
conversations: x,
|
|
164
|
+
entries: o,
|
|
165
|
+
openIds: M,
|
|
166
|
+
listLoading: s,
|
|
167
|
+
listError: r,
|
|
168
|
+
query: n,
|
|
169
|
+
canSend: !!e.sendMessage,
|
|
170
|
+
refreshConversations: R,
|
|
171
|
+
open: C,
|
|
172
|
+
expand: b,
|
|
173
|
+
minimize: L,
|
|
174
|
+
close: U,
|
|
175
|
+
loadOlder: $,
|
|
176
|
+
send: G,
|
|
177
|
+
retry: Q,
|
|
178
|
+
retryLoad: p,
|
|
179
|
+
receive: a,
|
|
180
|
+
setDraft: A,
|
|
181
|
+
setQuery: y,
|
|
182
|
+
onEvent: O
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function Nt(e) {
|
|
186
|
+
const l = /* @__PURE__ */ new Set();
|
|
187
|
+
return e.filter((o) => l.has(o.id) ? !1 : (l.add(o.id), !0));
|
|
188
|
+
}
|
|
189
|
+
const jt = /* @__PURE__ */ P({
|
|
190
|
+
__name: "KAccordion",
|
|
191
|
+
props: {
|
|
192
|
+
exclusive: { type: Boolean, default: !1 },
|
|
193
|
+
group: {},
|
|
194
|
+
ghost: { type: Boolean, default: !1 }
|
|
195
|
+
},
|
|
196
|
+
setup(e) {
|
|
197
|
+
const l = Te(), o = g(() => e.group ? e.group : e.exclusive ? `accordion-${l}` : void 0);
|
|
198
|
+
Ae(Ue, o);
|
|
199
|
+
const t = g(() => [
|
|
200
|
+
"KAccordion",
|
|
201
|
+
e.ghost && "KAccordion--ghost"
|
|
202
|
+
]);
|
|
203
|
+
return (s, r) => (i(), u("div", {
|
|
204
|
+
class: T(t.value)
|
|
205
|
+
}, [
|
|
206
|
+
v(s.$slots, "default")
|
|
207
|
+
], 2));
|
|
208
|
+
}
|
|
209
|
+
}), Ut = ["collapse", "collapsed", "expand", "expanded"];
|
|
210
|
+
function ot({
|
|
211
|
+
direction: e,
|
|
212
|
+
element: l,
|
|
213
|
+
expanded: o,
|
|
214
|
+
horizontal: t,
|
|
215
|
+
onEvent: s
|
|
216
|
+
}) {
|
|
217
|
+
let r, n = !1;
|
|
218
|
+
function d() {
|
|
219
|
+
return !r && l.value && (r = new oe.modules.Collapse(l.value, {
|
|
220
|
+
horizontal: t?.() ?? !1,
|
|
221
|
+
direction: e?.() ?? "right"
|
|
222
|
+
})), r;
|
|
223
|
+
}
|
|
224
|
+
j(
|
|
225
|
+
() => [t?.(), e?.()],
|
|
226
|
+
() => {
|
|
227
|
+
r = void 0;
|
|
228
|
+
}
|
|
229
|
+
), j(
|
|
230
|
+
o,
|
|
231
|
+
(c) => {
|
|
232
|
+
if (c === n)
|
|
233
|
+
return;
|
|
234
|
+
const m = d();
|
|
235
|
+
m && (n = c, c ? m.expand() : m.collapse());
|
|
236
|
+
},
|
|
237
|
+
{ flush: "post" }
|
|
238
|
+
);
|
|
239
|
+
function k(c) {
|
|
240
|
+
const S = c.target?.closest("[data-kt-collapse-toggle]");
|
|
241
|
+
!S || S.closest("[data-kt-collapse]") !== l.value || (c.stopPropagation(), o.value = !o.value);
|
|
242
|
+
}
|
|
243
|
+
const h = Ut.map((c) => {
|
|
244
|
+
const m = (S) => {
|
|
245
|
+
S.target === l.value && (c === "expand" && (n = !0, o.value = !0), c === "collapse" && (n = !1, o.value = !1), s?.(c));
|
|
246
|
+
};
|
|
247
|
+
return [`kt.${c}`, m];
|
|
248
|
+
});
|
|
249
|
+
return j(
|
|
250
|
+
l,
|
|
251
|
+
(c, m, S) => {
|
|
252
|
+
if (r = void 0, !!c) {
|
|
253
|
+
for (const [x, M] of h)
|
|
254
|
+
c.addEventListener(x, M);
|
|
255
|
+
c.addEventListener("click", k), n = o.value, c.classList.remove("is-active", "is-expanded", "is-collapsed"), c.classList.add(
|
|
256
|
+
...o.value ? ["is-active", "is-expanded"] : ["is-collapsed"]
|
|
257
|
+
), S(() => {
|
|
258
|
+
for (const [x, M] of h)
|
|
259
|
+
c.removeEventListener(x, M);
|
|
260
|
+
c.removeEventListener("click", k);
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{ flush: "post", immediate: !0 }
|
|
265
|
+
), le(() => {
|
|
266
|
+
r = void 0;
|
|
267
|
+
}), {
|
|
268
|
+
collapse: () => {
|
|
269
|
+
o.value = !1;
|
|
270
|
+
},
|
|
271
|
+
expand: () => {
|
|
272
|
+
o.value = !0;
|
|
273
|
+
},
|
|
274
|
+
toggle: () => {
|
|
275
|
+
o.value = !o.value;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const Vt = ["data-kt-collapse-group"], Wt = {
|
|
280
|
+
class: "KCollapse-toggle",
|
|
281
|
+
"data-kt-collapse-toggle": ""
|
|
282
|
+
}, Gt = ["aria-expanded"], Ht = {
|
|
283
|
+
class: "KAccordion-title",
|
|
284
|
+
role: "heading",
|
|
285
|
+
"aria-level": "3"
|
|
286
|
+
}, Ft = { class: "KAccordion-icon" }, qt = {
|
|
287
|
+
class: "KIcon",
|
|
288
|
+
"aria-hidden": "true"
|
|
289
|
+
}, Qt = ["href"], Zt = {
|
|
290
|
+
class: "KAccordion-content KCollapse-content",
|
|
291
|
+
"data-kt-collapse-content": "",
|
|
292
|
+
role: "region"
|
|
293
|
+
}, Jt = { class: "KAccordion-body" }, Yt = /* @__PURE__ */ P({
|
|
294
|
+
__name: "KAccordionItem",
|
|
295
|
+
props: /* @__PURE__ */ q({
|
|
296
|
+
expanded: { type: Boolean },
|
|
297
|
+
icon: { default: "#arrowDropRight" },
|
|
298
|
+
title: {}
|
|
299
|
+
}, {
|
|
300
|
+
expanded: { type: Boolean, default: !1 },
|
|
301
|
+
expandedModifiers: {}
|
|
302
|
+
}),
|
|
303
|
+
emits: ["update:expanded"],
|
|
304
|
+
setup(e, { expose: l }) {
|
|
305
|
+
const o = te(e, "expanded"), t = he(Ue, void 0), s = _("root"), { toggle: r } = ot({ element: s, expanded: o }), n = g(() => t?.value);
|
|
306
|
+
return l({ toggle: r }), (d, k) => (i(), u("div", {
|
|
307
|
+
ref_key: "root",
|
|
308
|
+
ref: s,
|
|
309
|
+
class: "KAccordion-item KCollapse",
|
|
310
|
+
"data-kt-collapse": "",
|
|
311
|
+
"data-kt-collapse-group": n.value
|
|
312
|
+
}, [
|
|
313
|
+
K("div", Wt, [
|
|
314
|
+
K("div", {
|
|
315
|
+
class: "KAccordion-button",
|
|
316
|
+
role: "button",
|
|
317
|
+
tabindex: "0",
|
|
318
|
+
"aria-expanded": o.value,
|
|
319
|
+
onKeydown: [
|
|
320
|
+
k[0] || (k[0] = Oe(ne(
|
|
321
|
+
//@ts-ignore
|
|
322
|
+
(...h) => z(r) && z(r)(...h),
|
|
323
|
+
["prevent"]
|
|
324
|
+
), ["enter"])),
|
|
325
|
+
k[1] || (k[1] = Oe(ne(
|
|
326
|
+
//@ts-ignore
|
|
327
|
+
(...h) => z(r) && z(r)(...h),
|
|
328
|
+
["prevent"]
|
|
329
|
+
), ["space"]))
|
|
330
|
+
]
|
|
331
|
+
}, [
|
|
332
|
+
K("div", Ht, [
|
|
333
|
+
v(d.$slots, "title", {}, () => [
|
|
334
|
+
F(W(e.title), 1)
|
|
335
|
+
])
|
|
336
|
+
]),
|
|
337
|
+
K("div", Ft, [
|
|
338
|
+
(i(), u("svg", qt, [
|
|
339
|
+
K("use", { href: e.icon }, null, 8, Qt)
|
|
340
|
+
]))
|
|
341
|
+
])
|
|
342
|
+
], 40, Gt)
|
|
343
|
+
]),
|
|
344
|
+
K("div", Zt, [
|
|
345
|
+
K("div", Jt, [
|
|
346
|
+
v(d.$slots, "default")
|
|
347
|
+
])
|
|
348
|
+
])
|
|
349
|
+
], 8, Vt));
|
|
350
|
+
}
|
|
351
|
+
}), Xt = {
|
|
352
|
+
key: 0,
|
|
353
|
+
class: "KAlert-title"
|
|
354
|
+
}, _t = /* @__PURE__ */ P({
|
|
355
|
+
__name: "KAlert",
|
|
356
|
+
props: {
|
|
357
|
+
title: {},
|
|
358
|
+
variant: {}
|
|
359
|
+
},
|
|
360
|
+
setup(e) {
|
|
361
|
+
const l = ee(), o = g(() => ["KAlert", e.variant && `KAlert--${e.variant}`]), t = g(() => !!(l.title || e.title));
|
|
362
|
+
return (s, r) => (i(), u("div", {
|
|
363
|
+
class: T(o.value),
|
|
364
|
+
role: "alert"
|
|
365
|
+
}, [
|
|
366
|
+
t.value ? (i(), u("h4", Xt, [
|
|
367
|
+
v(s.$slots, "title", {}, () => [
|
|
368
|
+
F(W(e.title), 1)
|
|
369
|
+
])
|
|
370
|
+
])) : D("", !0),
|
|
371
|
+
v(s.$slots, "default")
|
|
372
|
+
], 2));
|
|
373
|
+
}
|
|
374
|
+
}), ea = { class: "KAvatar-initials" }, ta = ["src", "alt"], aa = {
|
|
375
|
+
key: 1,
|
|
376
|
+
class: "KIcon KAvatar-icon",
|
|
377
|
+
"aria-hidden": "true"
|
|
378
|
+
}, sa = ["href"], oa = ["aria-label", "role"], la = ["aria-label"], na = {
|
|
379
|
+
key: 5,
|
|
380
|
+
class: "KAvatar-badge"
|
|
381
|
+
}, ia = {
|
|
382
|
+
key: 0,
|
|
383
|
+
class: "KAvatar-body"
|
|
384
|
+
}, ra = {
|
|
385
|
+
key: 0,
|
|
386
|
+
class: "KAvatar-text"
|
|
387
|
+
}, da = {
|
|
388
|
+
key: 1,
|
|
389
|
+
class: "KAvatar-subtext"
|
|
390
|
+
}, ca = "#user", fe = /* @__PURE__ */ P({
|
|
391
|
+
__name: "KAvatar",
|
|
392
|
+
props: {
|
|
393
|
+
alt: { default: "" },
|
|
394
|
+
badge: {},
|
|
395
|
+
colorKey: {},
|
|
396
|
+
icon: { type: [Boolean, String], default: !1 },
|
|
397
|
+
overflow: { type: Boolean, default: !1 },
|
|
398
|
+
removable: { type: Boolean, default: !1 },
|
|
399
|
+
removeLabel: {},
|
|
400
|
+
size: {},
|
|
401
|
+
src: {},
|
|
402
|
+
status: { type: [Boolean, String] },
|
|
403
|
+
statusLabel: {},
|
|
404
|
+
subtext: {},
|
|
405
|
+
text: {},
|
|
406
|
+
textPosition: { default: "right" },
|
|
407
|
+
variant: {}
|
|
408
|
+
},
|
|
409
|
+
emits: ["remove"],
|
|
410
|
+
setup(e, { emit: l }) {
|
|
411
|
+
const o = l, t = ee(), s = {
|
|
412
|
+
left: "KAvatar--textLeft",
|
|
413
|
+
stacked: "KAvatar--stacked"
|
|
414
|
+
}, r = g(
|
|
415
|
+
() => e.variant ?? (e.colorKey !== void 0 ? Pt(e.colorKey) : void 0)
|
|
416
|
+
), n = g(() => [
|
|
417
|
+
"KAvatar",
|
|
418
|
+
r.value && `KAvatar--${r.value}`,
|
|
419
|
+
// `md` is the default and has no modifier of its own.
|
|
420
|
+
e.size && e.size !== "md" && `KAvatar--${e.size}`,
|
|
421
|
+
e.textPosition !== "right" && s[e.textPosition],
|
|
422
|
+
e.overflow && "KAvatar--overflow"
|
|
423
|
+
]), d = g(
|
|
424
|
+
() => typeof e.icon == "string" ? e.icon : e.icon ? ca : void 0
|
|
425
|
+
), k = g(() => !e.src && !!d.value), h = g(() => !e.src && !k.value), c = g(() => e.status === !0 || typeof e.status == "string"), m = g(() => [
|
|
426
|
+
"KAvatar-status",
|
|
427
|
+
typeof e.status == "string" && `is-${e.status}`
|
|
428
|
+
]), S = g(() => e.badge !== void 0 || !!t.badge), x = g(() => e.removable || !!t.action), M = g(() => !!e.text || !!t.text), R = g(() => !!e.subtext || !!t.subtext), E = g(() => M.value || R.value);
|
|
429
|
+
return (B, C) => (i(), u("span", {
|
|
430
|
+
class: T(n.value)
|
|
431
|
+
}, [
|
|
432
|
+
K("span", ea, [
|
|
433
|
+
e.src ? (i(), u("img", {
|
|
434
|
+
key: 0,
|
|
435
|
+
class: "KAvatar-image",
|
|
436
|
+
src: e.src,
|
|
437
|
+
alt: e.alt
|
|
438
|
+
}, null, 8, ta)) : k.value ? (i(), u("svg", aa, [
|
|
439
|
+
K("use", { href: d.value }, null, 8, sa)
|
|
440
|
+
])) : D("", !0),
|
|
441
|
+
h.value ? v(B.$slots, "default", { key: 2 }) : D("", !0),
|
|
442
|
+
c.value ? (i(), u("span", {
|
|
443
|
+
key: 3,
|
|
444
|
+
class: T(m.value),
|
|
445
|
+
"aria-label": e.statusLabel,
|
|
446
|
+
role: e.statusLabel ? "img" : void 0
|
|
447
|
+
}, null, 10, oa)) : D("", !0),
|
|
448
|
+
x.value ? v(B.$slots, "action", { key: 4 }, () => [
|
|
449
|
+
K("button", {
|
|
450
|
+
type: "button",
|
|
451
|
+
class: "KAvatar-action",
|
|
452
|
+
"aria-label": e.removeLabel,
|
|
453
|
+
onClick: C[0] || (C[0] = ne((b) => o("remove"), ["stop"]))
|
|
454
|
+
}, [...C[1] || (C[1] = [
|
|
455
|
+
K("svg", {
|
|
456
|
+
class: "KIcon",
|
|
457
|
+
"aria-hidden": "true"
|
|
458
|
+
}, [
|
|
459
|
+
K("use", { href: "#cross" })
|
|
460
|
+
], -1)
|
|
461
|
+
])], 8, la)
|
|
462
|
+
]) : S.value ? (i(), u("span", na, [
|
|
463
|
+
v(B.$slots, "badge", {}, () => [
|
|
464
|
+
F(W(e.badge), 1)
|
|
465
|
+
])
|
|
466
|
+
])) : D("", !0)
|
|
467
|
+
]),
|
|
468
|
+
E.value ? (i(), u("span", ia, [
|
|
469
|
+
M.value ? (i(), u("span", ra, [
|
|
470
|
+
v(B.$slots, "text", {}, () => [
|
|
471
|
+
F(W(e.text), 1)
|
|
472
|
+
])
|
|
473
|
+
])) : D("", !0),
|
|
474
|
+
R.value ? (i(), u("span", da, [
|
|
475
|
+
v(B.$slots, "subtext", {}, () => [
|
|
476
|
+
F(W(e.subtext), 1)
|
|
477
|
+
])
|
|
478
|
+
])) : D("", !0)
|
|
479
|
+
])) : D("", !0)
|
|
480
|
+
], 2));
|
|
481
|
+
}
|
|
482
|
+
}), ua = ["role", "aria-label"], fa = ["aria-label", "role"], lt = /* @__PURE__ */ P({
|
|
483
|
+
__name: "KAvatarGroup",
|
|
484
|
+
props: {
|
|
485
|
+
diagonal: { type: Boolean, default: !1 },
|
|
486
|
+
hoverable: { type: Boolean, default: !1 },
|
|
487
|
+
label: {},
|
|
488
|
+
pie: { type: Boolean, default: !1 },
|
|
489
|
+
size: {},
|
|
490
|
+
status: { type: [Boolean, String] },
|
|
491
|
+
statusLabel: {}
|
|
492
|
+
},
|
|
493
|
+
setup(e) {
|
|
494
|
+
const l = g(() => [
|
|
495
|
+
"KAvatarGroup",
|
|
496
|
+
e.diagonal && "KAvatarGroup--diagonal",
|
|
497
|
+
e.hoverable && "KAvatarGroup--hoverable",
|
|
498
|
+
e.pie && "KAvatarGroup--pie",
|
|
499
|
+
e.size && e.size !== "md" && `KAvatarGroup--${e.size}`
|
|
500
|
+
]), o = g(() => e.status === !0 || typeof e.status == "string"), t = g(() => [
|
|
501
|
+
"KAvatarGroup-status",
|
|
502
|
+
typeof e.status == "string" && `is-${e.status}`
|
|
503
|
+
]);
|
|
504
|
+
return (s, r) => (i(), u("span", {
|
|
505
|
+
class: T(l.value),
|
|
506
|
+
role: e.label ? "img" : void 0,
|
|
507
|
+
"aria-label": e.label
|
|
508
|
+
}, [
|
|
509
|
+
v(s.$slots, "default"),
|
|
510
|
+
o.value ? (i(), u("span", {
|
|
511
|
+
key: 0,
|
|
512
|
+
class: T(t.value),
|
|
513
|
+
"aria-label": e.statusLabel,
|
|
514
|
+
role: e.statusLabel ? "img" : void 0
|
|
515
|
+
}, null, 10, fa)) : D("", !0)
|
|
516
|
+
], 10, ua));
|
|
517
|
+
}
|
|
518
|
+
}), Se = /* @__PURE__ */ P({
|
|
519
|
+
__name: "KBadge",
|
|
520
|
+
props: {
|
|
521
|
+
compact: { type: Boolean },
|
|
522
|
+
pill: { type: Boolean },
|
|
523
|
+
size: {},
|
|
524
|
+
subtle: { type: Boolean },
|
|
525
|
+
variant: {}
|
|
526
|
+
},
|
|
527
|
+
setup(e) {
|
|
528
|
+
return (l, o) => (i(), u("div", {
|
|
529
|
+
class: T([
|
|
530
|
+
"KBadge",
|
|
531
|
+
e.compact && "KBadge--compact",
|
|
532
|
+
e.pill && "KBadge--pill",
|
|
533
|
+
e.size && `KBadge--${e.size}`,
|
|
534
|
+
e.subtle && "KBadge--subtle",
|
|
535
|
+
e.variant && `KBadge--${e.variant}`
|
|
536
|
+
])
|
|
537
|
+
}, [
|
|
538
|
+
v(l.$slots, "default")
|
|
539
|
+
], 2));
|
|
540
|
+
}
|
|
541
|
+
}), va = ["aria-label"], ha = /* @__PURE__ */ P({
|
|
542
|
+
__name: "KBreadcrumb",
|
|
543
|
+
props: {
|
|
544
|
+
ariaLabel: { default: "breadcrumb" },
|
|
545
|
+
divider: {}
|
|
546
|
+
},
|
|
547
|
+
setup(e) {
|
|
548
|
+
const l = g(
|
|
549
|
+
() => e.divider ? { "--kt-breadcrumb-divider": `"${e.divider}"` } : void 0
|
|
550
|
+
);
|
|
551
|
+
return (o, t) => (i(), u("nav", { "aria-label": e.ariaLabel }, [
|
|
552
|
+
K("ol", {
|
|
553
|
+
class: "KBreadcrumb",
|
|
554
|
+
style: ce(l.value)
|
|
555
|
+
}, [
|
|
556
|
+
v(o.$slots, "default")
|
|
557
|
+
], 4)
|
|
558
|
+
], 8, va));
|
|
559
|
+
}
|
|
560
|
+
}), ma = ["aria-current"], ba = ["href"], ga = /* @__PURE__ */ P({
|
|
561
|
+
__name: "KBreadcrumbItem",
|
|
562
|
+
props: {
|
|
563
|
+
active: { type: Boolean, default: () => {
|
|
564
|
+
} },
|
|
565
|
+
href: {},
|
|
566
|
+
to: {}
|
|
567
|
+
},
|
|
568
|
+
setup(e) {
|
|
569
|
+
const l = je({ to: g(() => e.to ?? "/") }), o = g(() => e.active ?? (e.to ? l.isActive.value : !1)), t = g(() => e.to ? l.href.value : e.href), s = g(() => [
|
|
570
|
+
"KBreadcrumb-item",
|
|
571
|
+
o.value && "KBreadcrumb-is-active"
|
|
572
|
+
]);
|
|
573
|
+
function r(n) {
|
|
574
|
+
e.to && (n.preventDefault(), l.navigate(n));
|
|
575
|
+
}
|
|
576
|
+
return (n, d) => (i(), u("li", {
|
|
577
|
+
class: T(s.value),
|
|
578
|
+
"aria-current": o.value ? "page" : void 0
|
|
579
|
+
}, [
|
|
580
|
+
!o.value && t.value ? (i(), u("a", {
|
|
581
|
+
key: 0,
|
|
582
|
+
href: t.value,
|
|
583
|
+
onClick: r
|
|
584
|
+
}, [
|
|
585
|
+
v(n.$slots, "default")
|
|
586
|
+
], 8, ba)) : v(n.$slots, "default", { key: 1 })
|
|
587
|
+
], 10, ma));
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
function qe(e) {
|
|
4
591
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
5
592
|
}
|
|
6
|
-
const
|
|
7
|
-
__name: "KButton",
|
|
593
|
+
const Ke = /* @__PURE__ */ P({
|
|
594
|
+
__name: "KButton",
|
|
595
|
+
props: {
|
|
596
|
+
disabled: { type: Boolean, default: !1 },
|
|
597
|
+
expanded: { type: Boolean, default: !1 },
|
|
598
|
+
href: {},
|
|
599
|
+
icon: { type: Boolean, default: !1 },
|
|
600
|
+
iconCircular: { type: Boolean, default: !1 },
|
|
601
|
+
minimal: { type: Boolean, default: !1 },
|
|
602
|
+
rounded: { type: Boolean, default: !1 },
|
|
603
|
+
secondary: { type: Boolean, default: !1 },
|
|
604
|
+
selected: { type: Boolean, default: !1 },
|
|
605
|
+
size: {},
|
|
606
|
+
to: {},
|
|
607
|
+
type: { default: "button" },
|
|
608
|
+
utility: { type: Boolean, default: !1 },
|
|
609
|
+
variant: {}
|
|
610
|
+
},
|
|
611
|
+
setup(e) {
|
|
612
|
+
const l = ["warning"], o = ["warning", "affirm"], { href: t, navigate: s } = je({
|
|
613
|
+
to: g(() => e.to ?? "/")
|
|
614
|
+
}), r = g(() => e.to || e.href ? "a" : "button"), n = g(() => {
|
|
615
|
+
if (e.to)
|
|
616
|
+
return t.value;
|
|
617
|
+
if (e.href)
|
|
618
|
+
return e.href;
|
|
619
|
+
}), d = g(() => e.variant ? e.utility && !l.includes(e.variant) ? `KButton--utility${qe(e.variant)}` : e.minimal && !o.includes(e.variant) ? `KButton--minimal${qe(e.variant)}` : `KButton--${e.variant}` : e.utility ? "KButton--utility" : e.minimal ? "KButton--minimal" : e.secondary ? "KButton--secondary" : null), k = g(() => [
|
|
620
|
+
"KButton",
|
|
621
|
+
d.value,
|
|
622
|
+
// `md` is the default declared in core and needs no modifier.
|
|
623
|
+
e.size && e.size !== "md" && `KButton--${e.size}`,
|
|
624
|
+
e.icon && "KButton--icon",
|
|
625
|
+
e.iconCircular && "KButton--iconCircular",
|
|
626
|
+
e.rounded && "KButton--rounded",
|
|
627
|
+
e.expanded && "KButton--expanded",
|
|
628
|
+
e.selected && "KButton--selected"
|
|
629
|
+
]);
|
|
630
|
+
function h(c) {
|
|
631
|
+
e.to && s(c);
|
|
632
|
+
}
|
|
633
|
+
return (c, m) => (i(), J(Ne(r.value), {
|
|
634
|
+
href: n.value,
|
|
635
|
+
type: r.value === "button" ? e.type : void 0,
|
|
636
|
+
disabled: r.value === "button" ? e.disabled : void 0,
|
|
637
|
+
class: T(k.value),
|
|
638
|
+
onClick: h
|
|
639
|
+
}, {
|
|
640
|
+
default: N(() => [
|
|
641
|
+
v(c.$slots, "default")
|
|
642
|
+
]),
|
|
643
|
+
_: 3
|
|
644
|
+
}, 8, ["href", "type", "disabled", "class"]));
|
|
645
|
+
}
|
|
646
|
+
}), ya = /* @__PURE__ */ P({
|
|
647
|
+
__name: "KCalendar",
|
|
648
|
+
props: /* @__PURE__ */ q({
|
|
649
|
+
disabledDates: {},
|
|
650
|
+
firstDay: { default: 0 },
|
|
651
|
+
locale: { default: "en-US" },
|
|
652
|
+
maxDate: {},
|
|
653
|
+
minDate: {},
|
|
654
|
+
mode: { default: "single" }
|
|
655
|
+
}, {
|
|
656
|
+
modelValue: { default: null },
|
|
657
|
+
modelModifiers: {},
|
|
658
|
+
range: { default: null },
|
|
659
|
+
rangeModifiers: {}
|
|
660
|
+
}),
|
|
661
|
+
emits: /* @__PURE__ */ q(["clear", "navigate", "rangestart"], ["update:modelValue", "update:range"]),
|
|
662
|
+
setup(e, { expose: l, emit: o }) {
|
|
663
|
+
const t = te(e, "modelValue"), s = te(e, "range"), r = o, n = _("root");
|
|
664
|
+
let d, k = null, h = null;
|
|
665
|
+
const c = (b) => b ? `${b.start.getTime()}-${b.end.getTime()}` : null, m = (b) => b.target === n.value;
|
|
666
|
+
function S(b) {
|
|
667
|
+
if (!m(b))
|
|
668
|
+
return;
|
|
669
|
+
const L = b.detail;
|
|
670
|
+
L && (k = L.date.getTime(), t.value = L.date);
|
|
671
|
+
}
|
|
672
|
+
function x(b) {
|
|
673
|
+
if (!m(b))
|
|
674
|
+
return;
|
|
675
|
+
const L = b.detail;
|
|
676
|
+
L && (h = c(L), s.value = { start: L.start, end: L.end });
|
|
677
|
+
}
|
|
678
|
+
function M(b) {
|
|
679
|
+
if (!m(b))
|
|
680
|
+
return;
|
|
681
|
+
const L = b.detail;
|
|
682
|
+
L && r("rangestart", L.date);
|
|
683
|
+
}
|
|
684
|
+
function R(b) {
|
|
685
|
+
if (!m(b))
|
|
686
|
+
return;
|
|
687
|
+
const L = b.detail;
|
|
688
|
+
L && r("navigate", L.year, L.month);
|
|
689
|
+
}
|
|
690
|
+
function E(b) {
|
|
691
|
+
m(b) && (k = null, h = null, t.value = null, s.value = null, r("clear"));
|
|
692
|
+
}
|
|
693
|
+
const B = [
|
|
694
|
+
["kt.calendar.select", S],
|
|
695
|
+
["kt.calendar.rangeselect", x],
|
|
696
|
+
["kt.calendar.rangestart", M],
|
|
697
|
+
["kt.calendar.navigate", R],
|
|
698
|
+
["kt.calendar.clear", E]
|
|
699
|
+
];
|
|
700
|
+
function C(b) {
|
|
701
|
+
d?.destroy(), d = new oe.modules.Calendar(b, {
|
|
702
|
+
disabledDates: e.disabledDates,
|
|
703
|
+
firstDay: e.firstDay,
|
|
704
|
+
locale: e.locale,
|
|
705
|
+
maxDate: e.maxDate,
|
|
706
|
+
minDate: e.minDate,
|
|
707
|
+
mode: e.mode
|
|
708
|
+
}), e.mode === "range" && s.value ? (h = c(s.value), d.setRange(s.value.start, s.value.end)) : e.mode === "single" && t.value && (k = t.value.getTime(), d.setDate(t.value));
|
|
709
|
+
}
|
|
710
|
+
return j(
|
|
711
|
+
n,
|
|
712
|
+
(b, L, U) => {
|
|
713
|
+
if (b) {
|
|
714
|
+
for (const [$, w] of B)
|
|
715
|
+
b.addEventListener($, w);
|
|
716
|
+
C(b), U(() => {
|
|
717
|
+
for (const [$, w] of B)
|
|
718
|
+
b.removeEventListener($, w);
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
{ flush: "post", immediate: !0 }
|
|
723
|
+
), j(
|
|
724
|
+
() => [e.mode, e.locale, e.firstDay, e.minDate, e.maxDate, e.disabledDates],
|
|
725
|
+
() => {
|
|
726
|
+
n.value && C(n.value);
|
|
727
|
+
},
|
|
728
|
+
{ deep: !0 }
|
|
729
|
+
), j(t, (b) => {
|
|
730
|
+
(b?.getTime() ?? null) !== k && (k = b?.getTime() ?? null, b ? d?.setDate(b) : d?.clearSelection());
|
|
731
|
+
}), j(s, (b) => {
|
|
732
|
+
c(b) !== h && (h = c(b), b ? d?.setRange(b.start, b.end) : d?.clearSelection());
|
|
733
|
+
}), le(() => {
|
|
734
|
+
d?.destroy(), d = void 0;
|
|
735
|
+
}), l({
|
|
736
|
+
clear: () => d?.clearSelection(),
|
|
737
|
+
navigateTo: (b, L) => d?.navigateTo(b, L),
|
|
738
|
+
next: () => d?.next(),
|
|
739
|
+
prev: () => d?.prev()
|
|
740
|
+
}), (b, L) => (i(), u("div", {
|
|
741
|
+
ref_key: "root",
|
|
742
|
+
ref: n,
|
|
743
|
+
class: "KCalendar",
|
|
744
|
+
"data-kt-calendar": ""
|
|
745
|
+
}, null, 512));
|
|
746
|
+
}
|
|
747
|
+
}), ka = {
|
|
748
|
+
key: 0,
|
|
749
|
+
class: "KCard-title"
|
|
750
|
+
}, Ka = /* @__PURE__ */ P({
|
|
751
|
+
__name: "KCard",
|
|
752
|
+
props: {
|
|
753
|
+
accented: { type: Boolean, default: !1 },
|
|
754
|
+
bodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
755
|
+
borderless: { type: Boolean, default: !1 },
|
|
756
|
+
footerClass: { type: [Boolean, null, String, Object, Array] },
|
|
757
|
+
flush: { type: Boolean, default: !1 },
|
|
758
|
+
headerClass: { type: [Boolean, null, String, Object, Array] },
|
|
759
|
+
hoverable: { type: Boolean, default: !1 },
|
|
760
|
+
lifted: { type: Boolean, default: !1 },
|
|
761
|
+
sunken: { type: Boolean, default: !1 },
|
|
762
|
+
title: {}
|
|
763
|
+
},
|
|
764
|
+
setup(e) {
|
|
765
|
+
const l = ee(), o = g(() => [
|
|
766
|
+
"KCard",
|
|
767
|
+
e.accented && "KCard--accented",
|
|
768
|
+
e.borderless && "KCard--borderless",
|
|
769
|
+
e.flush && "KCard--flush",
|
|
770
|
+
e.hoverable && "KCard--hoverable",
|
|
771
|
+
e.lifted && "KCard--lifted",
|
|
772
|
+
e.sunken && "KCard--sunken"
|
|
773
|
+
]), t = g(() => !!(l.title || e.title)), s = g(() => !!(l.header || t.value));
|
|
774
|
+
return (r, n) => (i(), u("div", {
|
|
775
|
+
class: T(o.value)
|
|
776
|
+
}, [
|
|
777
|
+
s.value ? (i(), u("div", {
|
|
778
|
+
key: 0,
|
|
779
|
+
class: T(["KCard-header", e.headerClass])
|
|
780
|
+
}, [
|
|
781
|
+
v(r.$slots, "header", {}, () => [
|
|
782
|
+
t.value ? (i(), u("h3", ka, [
|
|
783
|
+
v(r.$slots, "title", {}, () => [
|
|
784
|
+
F(W(e.title), 1)
|
|
785
|
+
])
|
|
786
|
+
])) : D("", !0)
|
|
787
|
+
])
|
|
788
|
+
], 2)) : D("", !0),
|
|
789
|
+
K("div", {
|
|
790
|
+
class: T(["KCard-body", e.bodyClass])
|
|
791
|
+
}, [
|
|
792
|
+
v(r.$slots, "default")
|
|
793
|
+
], 2),
|
|
794
|
+
l.footer ? (i(), u("div", {
|
|
795
|
+
key: 1,
|
|
796
|
+
class: T(["KCard-footer", e.footerClass])
|
|
797
|
+
}, [
|
|
798
|
+
v(r.$slots, "footer")
|
|
799
|
+
], 2)) : D("", !0)
|
|
800
|
+
], 2));
|
|
801
|
+
}
|
|
802
|
+
}), wa = {
|
|
803
|
+
key: 0,
|
|
804
|
+
class: "KChat-footer"
|
|
805
|
+
}, $a = 48, nt = /* @__PURE__ */ P({
|
|
806
|
+
__name: "KChat",
|
|
807
|
+
props: {
|
|
808
|
+
actionsBottom: { type: Boolean, default: !1 },
|
|
809
|
+
ai: { type: Boolean, default: !1 },
|
|
810
|
+
autoscroll: { type: Boolean, default: !0 },
|
|
811
|
+
busy: { type: Boolean, default: !1 },
|
|
812
|
+
height: {}
|
|
813
|
+
},
|
|
814
|
+
setup(e, { expose: l }) {
|
|
815
|
+
const o = ee();
|
|
816
|
+
Ae(
|
|
817
|
+
Ve,
|
|
818
|
+
At(() => e.busy)
|
|
819
|
+
);
|
|
820
|
+
const t = _("body");
|
|
821
|
+
let s, r = !0;
|
|
822
|
+
const n = g(
|
|
823
|
+
() => e.height ? { "--kt-chat-height": e.height } : void 0
|
|
824
|
+
);
|
|
825
|
+
function d() {
|
|
826
|
+
const h = t.value;
|
|
827
|
+
h && (h.scrollTop = h.scrollHeight);
|
|
828
|
+
}
|
|
829
|
+
function k() {
|
|
830
|
+
const h = t.value;
|
|
831
|
+
h && (r = h.scrollHeight - h.scrollTop - h.clientHeight <= $a);
|
|
832
|
+
}
|
|
833
|
+
return De(() => {
|
|
834
|
+
const h = t.value;
|
|
835
|
+
h && (d(), e.autoscroll && (h.addEventListener("scroll", k, { passive: !0 }), s = new MutationObserver(() => {
|
|
836
|
+
r && d();
|
|
837
|
+
}), s.observe(h, { childList: !0, subtree: !0 })));
|
|
838
|
+
}), _e(() => {
|
|
839
|
+
s?.disconnect();
|
|
840
|
+
}), l({ scrollToBottom: d }), (h, c) => (i(), u("div", {
|
|
841
|
+
class: T([
|
|
842
|
+
"KChat",
|
|
843
|
+
e.actionsBottom && "KChat--actionsBottom",
|
|
844
|
+
e.ai && "KChat--ai"
|
|
845
|
+
]),
|
|
846
|
+
style: ce(n.value)
|
|
847
|
+
}, [
|
|
848
|
+
K("div", {
|
|
849
|
+
ref_key: "body",
|
|
850
|
+
ref: t,
|
|
851
|
+
class: "KChat-body"
|
|
852
|
+
}, [
|
|
853
|
+
v(h.$slots, "default")
|
|
854
|
+
], 512),
|
|
855
|
+
o.footer ? (i(), u("div", wa, [
|
|
856
|
+
v(h.$slots, "footer")
|
|
857
|
+
])) : D("", !0)
|
|
858
|
+
], 6));
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
function ve(e, l, o, t = {}) {
|
|
862
|
+
let s = !1;
|
|
863
|
+
function r() {
|
|
864
|
+
s || (s = !0, document.addEventListener(l, o, t.capture));
|
|
865
|
+
}
|
|
866
|
+
function n() {
|
|
867
|
+
s && (s = !1, document.removeEventListener(l, o, t.capture));
|
|
868
|
+
}
|
|
869
|
+
j(
|
|
870
|
+
e,
|
|
871
|
+
(d) => {
|
|
872
|
+
if (!d) {
|
|
873
|
+
n();
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
requestAnimationFrame(() => {
|
|
877
|
+
e.value && r();
|
|
878
|
+
});
|
|
879
|
+
},
|
|
880
|
+
{ flush: "post", immediate: !0 }
|
|
881
|
+
), le(n);
|
|
882
|
+
}
|
|
883
|
+
const Ce = /* @__PURE__ */ new Map();
|
|
884
|
+
function it(e, l, o) {
|
|
885
|
+
let t = Ce.get(e);
|
|
886
|
+
t || (t = /* @__PURE__ */ new Set(), Ce.set(e, t)), t.add(o), j(
|
|
887
|
+
l,
|
|
888
|
+
(s) => {
|
|
889
|
+
if (s)
|
|
890
|
+
for (const r of Ce.get(e) ?? [])
|
|
891
|
+
r !== o && r();
|
|
892
|
+
},
|
|
893
|
+
{ flush: "post" }
|
|
894
|
+
), le(() => {
|
|
895
|
+
const s = Ce.get(e);
|
|
896
|
+
s?.delete(o), s && !s.size && Ce.delete(e);
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
function rt({
|
|
900
|
+
create: e,
|
|
901
|
+
element: l,
|
|
902
|
+
group: o,
|
|
903
|
+
onEvent: t,
|
|
904
|
+
open: s
|
|
905
|
+
}) {
|
|
906
|
+
let r, n = !1;
|
|
907
|
+
function d() {
|
|
908
|
+
return !r && l.value && (r = e(l.value)), r;
|
|
909
|
+
}
|
|
910
|
+
j(
|
|
911
|
+
s,
|
|
912
|
+
(c) => {
|
|
913
|
+
if (c === n)
|
|
914
|
+
return;
|
|
915
|
+
const m = d();
|
|
916
|
+
m && (n = c, c ? m.show() : m.hide());
|
|
917
|
+
},
|
|
918
|
+
{ flush: "post" }
|
|
919
|
+
);
|
|
920
|
+
function k(c) {
|
|
921
|
+
return (m) => {
|
|
922
|
+
m.target === l.value && (n = c === "shown", s.value = n, t?.(c));
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
const h = [
|
|
926
|
+
["kt.shown", k("shown")],
|
|
927
|
+
["kt.hidden", k("hidden")]
|
|
928
|
+
];
|
|
929
|
+
return j(
|
|
930
|
+
l,
|
|
931
|
+
(c, m, S) => {
|
|
932
|
+
if (r = void 0, !!c) {
|
|
933
|
+
for (const [x, M] of h)
|
|
934
|
+
c.addEventListener(x, M);
|
|
935
|
+
s.value && (d()?.show(), n = !0), S(() => {
|
|
936
|
+
for (const [x, M] of h)
|
|
937
|
+
c.removeEventListener(x, M);
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
{ flush: "post", immediate: !0 }
|
|
942
|
+
), le(() => {
|
|
943
|
+
n && r?.hide(), r = void 0;
|
|
944
|
+
}), ve(s, "click", (c) => {
|
|
945
|
+
const m = c.target;
|
|
946
|
+
m && (l.value?.contains(m) || r?.getContent?.()?.contains(m) || (s.value = !1));
|
|
947
|
+
}), o && it(o, s, () => {
|
|
948
|
+
s.value = !1;
|
|
949
|
+
}), {
|
|
950
|
+
/**
|
|
951
|
+
* The live core instance, for module-specific behaviour a wrapper binds
|
|
952
|
+
* itself — Dropdown's submenus, for instance. Undefined before the root
|
|
953
|
+
* element exists.
|
|
954
|
+
*/
|
|
955
|
+
getInstance: d,
|
|
956
|
+
hide: () => {
|
|
957
|
+
s.value = !1;
|
|
958
|
+
},
|
|
959
|
+
show: () => {
|
|
960
|
+
s.value = !0;
|
|
961
|
+
},
|
|
962
|
+
toggle: () => {
|
|
963
|
+
s.value = !s.value;
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
const Ca = ["data-kt-popover-placement"], dt = /* @__PURE__ */ P({
|
|
968
|
+
__name: "KPopover",
|
|
969
|
+
props: /* @__PURE__ */ q({
|
|
970
|
+
contentClass: { type: [Boolean, null, String, Object, Array] },
|
|
971
|
+
placement: { default: "bottom-start" },
|
|
972
|
+
toggleClass: { type: [Boolean, null, String, Object, Array] }
|
|
973
|
+
}, {
|
|
974
|
+
open: { type: Boolean, default: !1 },
|
|
975
|
+
openModifiers: {}
|
|
976
|
+
}),
|
|
977
|
+
emits: /* @__PURE__ */ q(["hidden", "shown"], ["update:open"]),
|
|
978
|
+
setup(e, { expose: l, emit: o }) {
|
|
979
|
+
const t = te(e, "open"), s = o, r = _("root"), { toggle: n } = rt({
|
|
980
|
+
create: (d) => new oe.modules.Popover(d, { placement: e.placement }),
|
|
981
|
+
element: r,
|
|
982
|
+
// Core's delegated toggle closed every other open popover on the page. The
|
|
983
|
+
// group reproduces that across mounted KPopovers.
|
|
984
|
+
group: "popover",
|
|
985
|
+
open: t,
|
|
986
|
+
// TypeScript cannot correlate a union event name against the overloaded emit
|
|
987
|
+
// signature. Neither event carries a payload, so this is accurate.
|
|
988
|
+
onEvent: (d) => s(d)
|
|
989
|
+
});
|
|
990
|
+
return l({
|
|
991
|
+
toggle: n,
|
|
992
|
+
show: () => t.value = !0,
|
|
993
|
+
hide: () => t.value = !1
|
|
994
|
+
}), (d, k) => (i(), u("div", {
|
|
995
|
+
ref_key: "root",
|
|
996
|
+
ref: r,
|
|
997
|
+
class: "KPopover",
|
|
998
|
+
"data-kt-popover": "",
|
|
999
|
+
"data-kt-popover-placement": e.placement
|
|
1000
|
+
}, [
|
|
1001
|
+
K("span", {
|
|
1002
|
+
class: T(["KPopover-toggle", e.toggleClass]),
|
|
1003
|
+
"data-kt-popover-toggle": "",
|
|
1004
|
+
onClick: k[0] || (k[0] = ne(
|
|
1005
|
+
//@ts-ignore
|
|
1006
|
+
(...h) => z(n) && z(n)(...h),
|
|
1007
|
+
["stop"]
|
|
1008
|
+
))
|
|
1009
|
+
}, [
|
|
1010
|
+
v(d.$slots, "toggle", {
|
|
1011
|
+
open: t.value,
|
|
1012
|
+
toggle: z(n)
|
|
1013
|
+
})
|
|
1014
|
+
], 2),
|
|
1015
|
+
K("div", {
|
|
1016
|
+
class: T(["KPopover-content", e.contentClass]),
|
|
1017
|
+
"data-kt-popover-content": ""
|
|
1018
|
+
}, [
|
|
1019
|
+
v(d.$slots, "default")
|
|
1020
|
+
], 2)
|
|
1021
|
+
], 8, Ca));
|
|
1022
|
+
}
|
|
1023
|
+
}), pa = ["data-kt-chat-dock-min-windows"], Ba = {
|
|
1024
|
+
type: "button",
|
|
1025
|
+
class: "KChatDock-launcher",
|
|
1026
|
+
"data-kt-chat-dock-launcher": "",
|
|
1027
|
+
"aria-label": "Conversations"
|
|
1028
|
+
}, Ee = "data-kt-chat-window", Sa = "data-kt-chat-window-toggle", Aa = "data-kt-chat-window-minimize", Ta = "data-kt-chat-window-close", Le = "data-kt-chat-window-head", Ia = "data-kt-chat-window-head-close", Qe = "data-kt-chat-window-row", Ea = "data-kt-chat-dock-launcher", La = "data-kt-chat-dock-panel", Ze = "data-kt-chat-dock-panel-open", Da = "data-kt-chat-dock-panel-close", Je = "data-kt-chat-dock-item", xa = "data-kt-popover-content", Ma = "is-railed", ct = /* @__PURE__ */ P({
|
|
1029
|
+
__name: "KChatDock",
|
|
1030
|
+
props: {
|
|
1031
|
+
minWindows: { default: 1 }
|
|
1032
|
+
},
|
|
1033
|
+
emits: ["reflow", "launcher", "panel", "search", "select", "activate"],
|
|
1034
|
+
setup(e, { expose: l, emit: o }) {
|
|
1035
|
+
const t = o, s = _("root"), r = _("rail"), n = _("list"), d = _("windows"), k = _("overflowPopover");
|
|
1036
|
+
let h;
|
|
1037
|
+
function c() {
|
|
1038
|
+
return !h && s.value && (h = new oe.modules.ChatDock(s.value, { minWindows: e.minWindows })), h;
|
|
1039
|
+
}
|
|
1040
|
+
const m = /* @__PURE__ */ new Set();
|
|
1041
|
+
function S(p, a) {
|
|
1042
|
+
a ? m.add(p) : m.delete(p);
|
|
1043
|
+
}
|
|
1044
|
+
function x() {
|
|
1045
|
+
m.forEach((p) => {
|
|
1046
|
+
p.isConnected || m.delete(p);
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
function M(p) {
|
|
1050
|
+
x(), m.forEach((a) => {
|
|
1051
|
+
p.rail(a, { animate: !1 });
|
|
1052
|
+
}), m.clear();
|
|
1053
|
+
}
|
|
1054
|
+
let R = !1;
|
|
1055
|
+
function E(p) {
|
|
1056
|
+
if (!R)
|
|
1057
|
+
return x(), "deferred";
|
|
1058
|
+
const a = c();
|
|
1059
|
+
return a ? (M(a), p(a), "called") : (x(), "unavailable");
|
|
1060
|
+
}
|
|
1061
|
+
function B() {
|
|
1062
|
+
const p = c();
|
|
1063
|
+
p ? (M(p), p.init()) : x(), R = !0;
|
|
1064
|
+
}
|
|
1065
|
+
j(
|
|
1066
|
+
() => e.minWindows,
|
|
1067
|
+
() => {
|
|
1068
|
+
h = void 0, E((p) => {
|
|
1069
|
+
p.reflow();
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
);
|
|
1073
|
+
function C(p) {
|
|
1074
|
+
const a = p.getAttribute(Ee);
|
|
1075
|
+
a && t("activate", a);
|
|
1076
|
+
}
|
|
1077
|
+
function b(p) {
|
|
1078
|
+
if (p)
|
|
1079
|
+
return Array.from(
|
|
1080
|
+
s.value?.querySelectorAll(`[${Ee}]`) ?? []
|
|
1081
|
+
).find((a) => a.getAttribute(Ee) === p);
|
|
1082
|
+
}
|
|
1083
|
+
function L(p) {
|
|
1084
|
+
const a = p.target;
|
|
1085
|
+
if (!a)
|
|
1086
|
+
return;
|
|
1087
|
+
const A = a.closest(`[${Ia}]`);
|
|
1088
|
+
if (A) {
|
|
1089
|
+
p.stopPropagation(), k.value?.hide();
|
|
1090
|
+
const X = A.closest(`[${Le}]`), de = b(X?.getAttribute(Le) ?? null);
|
|
1091
|
+
de && E((St) => {
|
|
1092
|
+
St.close(de);
|
|
1093
|
+
});
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
const y = a.closest(`[${Le}]`);
|
|
1097
|
+
if (y) {
|
|
1098
|
+
p.stopPropagation(), k.value?.hide();
|
|
1099
|
+
const X = b(y.getAttribute(Le));
|
|
1100
|
+
X && (E((de) => {
|
|
1101
|
+
de.expand(X);
|
|
1102
|
+
}), C(X));
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
const O = a.closest(`[${Qe}]`);
|
|
1106
|
+
if (O) {
|
|
1107
|
+
p.stopPropagation();
|
|
1108
|
+
const X = b(O.getAttribute(Qe));
|
|
1109
|
+
X && (E((de) => {
|
|
1110
|
+
de.expand(X);
|
|
1111
|
+
}), C(X), k.value?.hide());
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (a.closest(`[${Da}]`)) {
|
|
1115
|
+
p.stopPropagation(), E((X) => {
|
|
1116
|
+
X.closePanel();
|
|
1117
|
+
});
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
const I = a.closest(`[${Je}]`);
|
|
1121
|
+
if (I) {
|
|
1122
|
+
p.stopPropagation();
|
|
1123
|
+
const X = I.getAttribute(Je);
|
|
1124
|
+
X && E((de) => {
|
|
1125
|
+
de.select(X);
|
|
1126
|
+
});
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
if (a.closest(`[${Ea}]`)) {
|
|
1130
|
+
p.stopPropagation(), k.value?.hide(), t("launcher"), E((X) => {
|
|
1131
|
+
X.togglePanel();
|
|
1132
|
+
});
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
const V = a.closest(`[${Ee}]`);
|
|
1136
|
+
if (!V)
|
|
1137
|
+
return;
|
|
1138
|
+
const Y = a.closest(`[${Sa}]`), se = Y ? null : a.closest(`[${Aa}]`), $e = Y || se ? null : a.closest(`[${Ta}]`);
|
|
1139
|
+
!Y && !se && !$e || (p.stopPropagation(), k.value?.hide(), E((X) => {
|
|
1140
|
+
Y ? V.classList.contains(Ma) ? (X.expand(V), C(V)) : X.rail(V) : se ? X.rail(V) : X.close(V);
|
|
1141
|
+
}));
|
|
1142
|
+
}
|
|
1143
|
+
const U = {
|
|
1144
|
+
"kt.chatdock.reflow": (p) => {
|
|
1145
|
+
p.target === s.value && t("reflow");
|
|
1146
|
+
},
|
|
1147
|
+
"kt.chatdock.panel": (p) => {
|
|
1148
|
+
p.target === s.value && t("panel", p.detail.open);
|
|
1149
|
+
},
|
|
1150
|
+
"kt.chatdock.search": (p) => {
|
|
1151
|
+
p.target === s.value && t("search", p.detail.query);
|
|
1152
|
+
},
|
|
1153
|
+
"kt.chatdock.select": (p) => {
|
|
1154
|
+
if (p.target === s.value) {
|
|
1155
|
+
const { id: a, opened: A } = p.detail;
|
|
1156
|
+
t("select", a, A);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
j(
|
|
1161
|
+
s,
|
|
1162
|
+
(p, a, A) => {
|
|
1163
|
+
if (h = void 0, !p)
|
|
1164
|
+
return;
|
|
1165
|
+
Object.entries(U).forEach(([I, H]) => {
|
|
1166
|
+
p.addEventListener(I, H);
|
|
1167
|
+
});
|
|
1168
|
+
const y = () => {
|
|
1169
|
+
E((I) => {
|
|
1170
|
+
I.reflow();
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
window.addEventListener("resize", y);
|
|
1174
|
+
const O = (I) => {
|
|
1175
|
+
if (I.key !== "Escape" || !p.hasAttribute(Ze))
|
|
1176
|
+
return;
|
|
1177
|
+
p.querySelector(`[${La}]`)?.contains(document.activeElement) && E((V) => {
|
|
1178
|
+
V.closePanel();
|
|
1179
|
+
});
|
|
1180
|
+
}, f = (I) => {
|
|
1181
|
+
const H = I.target;
|
|
1182
|
+
!H || !p.hasAttribute(Ze) || p.contains(H) || H.closest(`[${xa}]`) || E((V) => {
|
|
1183
|
+
V.closePanel();
|
|
1184
|
+
});
|
|
1185
|
+
};
|
|
1186
|
+
document.addEventListener("keydown", O), document.addEventListener("pointerdown", f), A(() => {
|
|
1187
|
+
Object.entries(U).forEach(([I, H]) => {
|
|
1188
|
+
p.removeEventListener(I, H);
|
|
1189
|
+
}), window.removeEventListener("resize", y), document.removeEventListener("keydown", O), document.removeEventListener("pointerdown", f);
|
|
1190
|
+
});
|
|
1191
|
+
},
|
|
1192
|
+
{ immediate: !0 }
|
|
1193
|
+
), Ae(xe, { withModule: E, declare: S, rail: r, list: n, panel: d });
|
|
1194
|
+
function $() {
|
|
1195
|
+
E((p) => {
|
|
1196
|
+
p.openPanel();
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
function w() {
|
|
1200
|
+
E((p) => {
|
|
1201
|
+
p.closePanel();
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
function G() {
|
|
1205
|
+
E((p) => {
|
|
1206
|
+
p.togglePanel();
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
function Q() {
|
|
1210
|
+
E((p) => {
|
|
1211
|
+
const a = s.value?.querySelector(
|
|
1212
|
+
"[data-kt-chat-dock-search]"
|
|
1213
|
+
);
|
|
1214
|
+
p.filter(a?.value ?? "");
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
return l({ openPanel: $, closePanel: w, togglePanel: G, refilter: Q }), De(() => {
|
|
1218
|
+
ue(B);
|
|
1219
|
+
}), et(() => {
|
|
1220
|
+
ue(() => {
|
|
1221
|
+
E((p) => {
|
|
1222
|
+
p.reflow();
|
|
1223
|
+
});
|
|
1224
|
+
});
|
|
1225
|
+
}), (p, a) => (i(), u("div", {
|
|
1226
|
+
ref_key: "root",
|
|
1227
|
+
ref: s,
|
|
1228
|
+
class: "KChatDock",
|
|
1229
|
+
"data-kt-chat-dock": "",
|
|
1230
|
+
"data-kt-chat-dock-min-windows": e.minWindows,
|
|
1231
|
+
role: "region",
|
|
1232
|
+
"aria-label": "Conversations",
|
|
1233
|
+
onClick: L
|
|
1234
|
+
}, [
|
|
1235
|
+
K("div", {
|
|
1236
|
+
ref_key: "windows",
|
|
1237
|
+
ref: d,
|
|
1238
|
+
class: "KChatDock-windows",
|
|
1239
|
+
"data-kt-chat-dock-windows": ""
|
|
1240
|
+
}, [
|
|
1241
|
+
v(p.$slots, "default")
|
|
1242
|
+
], 512),
|
|
1243
|
+
K("div", {
|
|
1244
|
+
ref_key: "rail",
|
|
1245
|
+
ref: r,
|
|
1246
|
+
class: "KChatDock-rail",
|
|
1247
|
+
"data-kt-chat-dock-rail": ""
|
|
1248
|
+
}, [
|
|
1249
|
+
Z(dt, {
|
|
1250
|
+
ref_key: "overflowPopover",
|
|
1251
|
+
ref: k,
|
|
1252
|
+
class: "KChatDock-overflow is-hidden",
|
|
1253
|
+
"data-kt-chat-dock-overflow": "",
|
|
1254
|
+
placement: "left-start"
|
|
1255
|
+
}, {
|
|
1256
|
+
toggle: N(() => [...a[0] || (a[0] = [
|
|
1257
|
+
K("button", {
|
|
1258
|
+
type: "button",
|
|
1259
|
+
class: "KAvatar KAvatar--sm KAvatar--overflow",
|
|
1260
|
+
"aria-label": "More conversations"
|
|
1261
|
+
}, [
|
|
1262
|
+
K("span", {
|
|
1263
|
+
class: "KAvatar-initials",
|
|
1264
|
+
"data-kt-chat-dock-overflow-count": ""
|
|
1265
|
+
}),
|
|
1266
|
+
K("span", {
|
|
1267
|
+
class: "KChatDock-overflow-dot",
|
|
1268
|
+
"data-kt-chat-dock-overflow-dot": "",
|
|
1269
|
+
hidden: ""
|
|
1270
|
+
})
|
|
1271
|
+
], -1)
|
|
1272
|
+
])]),
|
|
1273
|
+
default: N(() => [
|
|
1274
|
+
K("div", {
|
|
1275
|
+
ref_key: "list",
|
|
1276
|
+
ref: n,
|
|
1277
|
+
class: "KChatDock-list",
|
|
1278
|
+
"data-kt-chat-dock-overflow-list": "",
|
|
1279
|
+
onClick: L
|
|
1280
|
+
}, null, 512)
|
|
1281
|
+
]),
|
|
1282
|
+
_: 1
|
|
1283
|
+
}, 512),
|
|
1284
|
+
K("button", Ba, [
|
|
1285
|
+
v(p.$slots, "launcher", {}, () => [
|
|
1286
|
+
a[1] || (a[1] = K("svg", {
|
|
1287
|
+
class: "KIcon",
|
|
1288
|
+
"aria-hidden": "true"
|
|
1289
|
+
}, [
|
|
1290
|
+
K("use", { href: "#chatCircle" })
|
|
1291
|
+
], -1))
|
|
1292
|
+
])
|
|
1293
|
+
])
|
|
1294
|
+
], 512)
|
|
1295
|
+
], 8, pa));
|
|
1296
|
+
}
|
|
1297
|
+
}), Oa = ["data-kt-chat-dock-item", "data-kt-chat-dock-item-name", "aria-label"], Pa = { class: "KChatDockItem-body" }, Ra = { class: "KChatDockItem-name" }, za = {
|
|
1298
|
+
key: 0,
|
|
1299
|
+
class: "KChatDockItem-preview"
|
|
1300
|
+
}, ut = /* @__PURE__ */ P({
|
|
1301
|
+
__name: "KChatDockItem",
|
|
1302
|
+
props: {
|
|
1303
|
+
id: {},
|
|
1304
|
+
name: {},
|
|
1305
|
+
preview: {},
|
|
1306
|
+
unread: { default: 0 }
|
|
1307
|
+
},
|
|
1308
|
+
setup(e) {
|
|
1309
|
+
const l = g(
|
|
1310
|
+
() => e.name.split(/\s+/).filter(Boolean).slice(0, 2).map((t) => t[0].toUpperCase()).join("")
|
|
1311
|
+
), o = g(() => e.unread > 0 ? `${e.name}, ${e.unread} unread` : e.name);
|
|
1312
|
+
return (t, s) => (i(), u("button", {
|
|
1313
|
+
type: "button",
|
|
1314
|
+
class: "KChatDockItem",
|
|
1315
|
+
"data-kt-chat-dock-item": e.id,
|
|
1316
|
+
"data-kt-chat-dock-item-name": e.name,
|
|
1317
|
+
"aria-label": o.value
|
|
1318
|
+
}, [
|
|
1319
|
+
v(t.$slots, "media", {}, () => [
|
|
1320
|
+
Z(fe, { size: "sm" }, {
|
|
1321
|
+
default: N(() => [
|
|
1322
|
+
v(t.$slots, "avatar", {}, () => [
|
|
1323
|
+
F(W(l.value), 1)
|
|
1324
|
+
])
|
|
1325
|
+
]),
|
|
1326
|
+
_: 3
|
|
1327
|
+
})
|
|
1328
|
+
]),
|
|
1329
|
+
K("span", Pa, [
|
|
1330
|
+
K("span", Ra, W(e.name), 1),
|
|
1331
|
+
e.preview ? (i(), u("span", za, W(e.preview), 1)) : D("", !0)
|
|
1332
|
+
]),
|
|
1333
|
+
v(t.$slots, "trailing", {}, () => [
|
|
1334
|
+
e.unread > 0 ? (i(), J(Se, {
|
|
1335
|
+
key: 0,
|
|
1336
|
+
compact: "",
|
|
1337
|
+
pill: "",
|
|
1338
|
+
class: "KChatDockItem-badge"
|
|
1339
|
+
}, {
|
|
1340
|
+
default: N(() => [
|
|
1341
|
+
F(W(e.unread), 1)
|
|
1342
|
+
]),
|
|
1343
|
+
_: 1
|
|
1344
|
+
})) : D("", !0)
|
|
1345
|
+
])
|
|
1346
|
+
], 8, Oa));
|
|
1347
|
+
}
|
|
1348
|
+
}), Na = ["aria-label"], ja = { class: "KChatDockPanel-header" }, Ua = { class: "KChatDockPanel-title" }, Va = {
|
|
1349
|
+
key: 0,
|
|
1350
|
+
class: "KChatDockPanel-actions"
|
|
1351
|
+
}, Wa = { class: "KChatDockPanel-search" }, Ga = { class: "KInput KInput--rounded KInput--sunken" }, Ha = ["placeholder"], Fa = { class: "KChatDockPanel-list" }, qa = { class: "KChatDockPanel-empty is-hidden" }, ft = /* @__PURE__ */ P({
|
|
1352
|
+
__name: "KChatDockPanel",
|
|
1353
|
+
props: {
|
|
1354
|
+
title: { default: "Chats" },
|
|
1355
|
+
placeholder: { default: "Search" }
|
|
1356
|
+
},
|
|
1357
|
+
setup(e) {
|
|
1358
|
+
const l = {
|
|
1359
|
+
withModule: () => "unavailable",
|
|
1360
|
+
declare: () => {
|
|
1361
|
+
},
|
|
1362
|
+
rail: ke(null),
|
|
1363
|
+
list: ke(null),
|
|
1364
|
+
panel: ke(null)
|
|
1365
|
+
}, o = he(xe, l), t = ee();
|
|
1366
|
+
function s(r) {
|
|
1367
|
+
const { value: n } = r.target;
|
|
1368
|
+
o.withModule((d) => {
|
|
1369
|
+
d.filter(n);
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
return (r, n) => z(o).panel.value ? (i(), J(Be, {
|
|
1373
|
+
key: 0,
|
|
1374
|
+
defer: "",
|
|
1375
|
+
to: z(o).panel.value
|
|
1376
|
+
}, [
|
|
1377
|
+
K("section", {
|
|
1378
|
+
class: "KChatDockPanel is-hidden",
|
|
1379
|
+
"data-kt-chat-dock-panel": "",
|
|
1380
|
+
"aria-label": e.title
|
|
1381
|
+
}, [
|
|
1382
|
+
K("header", ja, [
|
|
1383
|
+
K("h2", Ua, W(e.title), 1),
|
|
1384
|
+
z(t).actions ? (i(), u("div", Va, [
|
|
1385
|
+
v(r.$slots, "actions")
|
|
1386
|
+
])) : D("", !0),
|
|
1387
|
+
n[0] || (n[0] = K("button", {
|
|
1388
|
+
type: "button",
|
|
1389
|
+
class: "KChatDockPanel-close",
|
|
1390
|
+
"data-kt-chat-dock-panel-close": "",
|
|
1391
|
+
"aria-label": "Close"
|
|
1392
|
+
}, " ✕ ", -1))
|
|
1393
|
+
]),
|
|
1394
|
+
K("div", Wa, [
|
|
1395
|
+
K("div", Ga, [
|
|
1396
|
+
n[1] || (n[1] = K("div", { class: "KInput-addon" }, [
|
|
1397
|
+
K("svg", {
|
|
1398
|
+
class: "KIcon",
|
|
1399
|
+
"aria-hidden": "true"
|
|
1400
|
+
}, [
|
|
1401
|
+
K("use", { href: "#search" })
|
|
1402
|
+
])
|
|
1403
|
+
], -1)),
|
|
1404
|
+
K("input", {
|
|
1405
|
+
type: "search",
|
|
1406
|
+
placeholder: e.placeholder,
|
|
1407
|
+
"aria-label": "Search conversations",
|
|
1408
|
+
"data-kt-chat-dock-search": "",
|
|
1409
|
+
onInput: s
|
|
1410
|
+
}, null, 40, Ha)
|
|
1411
|
+
])
|
|
1412
|
+
]),
|
|
1413
|
+
K("div", Fa, [
|
|
1414
|
+
v(r.$slots, "default")
|
|
1415
|
+
]),
|
|
1416
|
+
K("p", qa, [
|
|
1417
|
+
v(r.$slots, "empty", {}, () => [
|
|
1418
|
+
n[2] || (n[2] = F("No conversations found", -1))
|
|
1419
|
+
])
|
|
1420
|
+
])
|
|
1421
|
+
], 8, Na)
|
|
1422
|
+
], 8, ["to"])) : D("", !0);
|
|
1423
|
+
}
|
|
1424
|
+
}), Qa = { class: "KChat-divider" }, Za = {
|
|
1425
|
+
key: 0,
|
|
1426
|
+
class: "KChat-dividerLabel"
|
|
1427
|
+
}, vt = /* @__PURE__ */ P({
|
|
1428
|
+
__name: "KChatDivider",
|
|
1429
|
+
props: {
|
|
1430
|
+
label: {}
|
|
1431
|
+
},
|
|
1432
|
+
setup(e) {
|
|
1433
|
+
const l = ee();
|
|
1434
|
+
return (o, t) => (i(), u("li", Qa, [
|
|
1435
|
+
e.label || z(l).default ? (i(), u("span", Za, [
|
|
1436
|
+
v(o.$slots, "default", {}, () => [
|
|
1437
|
+
F(W(e.label), 1)
|
|
1438
|
+
])
|
|
1439
|
+
])) : D("", !0)
|
|
1440
|
+
]));
|
|
1441
|
+
}
|
|
1442
|
+
}), Ja = {
|
|
1443
|
+
key: 0,
|
|
1444
|
+
class: "KChat-time"
|
|
1445
|
+
}, Ya = { class: "KChat-messageRow" }, Xa = { class: "KChat-bubble" }, ht = /* @__PURE__ */ P({
|
|
1446
|
+
__name: "KChatMessage",
|
|
1447
|
+
props: {
|
|
1448
|
+
sender: { type: Boolean, default: !1 },
|
|
1449
|
+
time: {}
|
|
1450
|
+
},
|
|
1451
|
+
setup(e) {
|
|
1452
|
+
const l = ee(), o = g(() => !!(e.time || l.time));
|
|
1453
|
+
return (t, s) => (i(), u("li", {
|
|
1454
|
+
class: T(["KChat-message", e.sender && "is-sender"])
|
|
1455
|
+
}, [
|
|
1456
|
+
o.value ? (i(), u("span", Ja, [
|
|
1457
|
+
v(t.$slots, "time", {}, () => [
|
|
1458
|
+
F(W(e.time), 1)
|
|
1459
|
+
])
|
|
1460
|
+
])) : D("", !0),
|
|
1461
|
+
K("div", Ya, [
|
|
1462
|
+
K("div", Xa, [
|
|
1463
|
+
v(t.$slots, "default")
|
|
1464
|
+
]),
|
|
1465
|
+
v(t.$slots, "actions")
|
|
1466
|
+
])
|
|
1467
|
+
], 2));
|
|
1468
|
+
}
|
|
1469
|
+
}), _a = { class: "KChat-messages" }, Re = /* @__PURE__ */ P({
|
|
1470
|
+
__name: "KChatMessages",
|
|
1471
|
+
setup(e) {
|
|
1472
|
+
return (l, o) => (i(), u("ul", _a, [
|
|
1473
|
+
v(l.$slots, "default")
|
|
1474
|
+
]));
|
|
1475
|
+
}
|
|
1476
|
+
}), es = { class: "KChat-notice" }, mt = /* @__PURE__ */ P({
|
|
1477
|
+
__name: "KChatNotice",
|
|
1478
|
+
props: {
|
|
1479
|
+
label: {}
|
|
1480
|
+
},
|
|
1481
|
+
setup(e) {
|
|
1482
|
+
return (l, o) => (i(), u("li", es, [
|
|
1483
|
+
v(l.$slots, "default", {}, () => [
|
|
1484
|
+
F(W(e.label), 1)
|
|
1485
|
+
])
|
|
1486
|
+
]));
|
|
1487
|
+
}
|
|
1488
|
+
}), ts = {
|
|
1489
|
+
key: 0,
|
|
1490
|
+
class: "KInput-addon"
|
|
1491
|
+
}, as = ["disabled", "placeholder", "readonly", "rows"], ss = ["disabled", "placeholder", "readonly", "type"], os = {
|
|
1492
|
+
key: 3,
|
|
1493
|
+
class: "KInput-addon"
|
|
1494
|
+
}, bt = /* @__PURE__ */ P({
|
|
1495
|
+
inheritAttrs: !1,
|
|
1496
|
+
__name: "KInput",
|
|
1497
|
+
props: /* @__PURE__ */ q({
|
|
1498
|
+
addonBordered: { type: Boolean, default: !1 },
|
|
1499
|
+
autosize: { type: Boolean, default: !1 },
|
|
1500
|
+
disabled: { type: Boolean, default: !1 },
|
|
1501
|
+
ghost: { type: Boolean, default: !1 },
|
|
1502
|
+
maxRows: { default: 5 },
|
|
1503
|
+
placeholder: {},
|
|
1504
|
+
readonly: { type: Boolean, default: !1 },
|
|
1505
|
+
rounded: { type: Boolean, default: !1 },
|
|
1506
|
+
rows: {},
|
|
1507
|
+
sunken: { type: Boolean, default: !1 },
|
|
1508
|
+
textarea: { type: Boolean, default: !1 },
|
|
1509
|
+
transparent: { type: Boolean, default: !1 },
|
|
1510
|
+
type: { default: "text" }
|
|
1511
|
+
}, {
|
|
1512
|
+
modelValue: {},
|
|
1513
|
+
modelModifiers: {}
|
|
1514
|
+
}),
|
|
1515
|
+
emits: ["update:modelValue"],
|
|
1516
|
+
setup(e, { expose: l }) {
|
|
1517
|
+
const o = te(e, "modelValue"), t = ee(), s = Ie(), r = g(() => e.textarea || e.autosize), n = _("field"), d = g(() => [
|
|
1518
|
+
"KInput",
|
|
1519
|
+
e.addonBordered && "KInput--addonBordered",
|
|
1520
|
+
e.autosize && "KInput--autosize",
|
|
1521
|
+
e.disabled && "KInput--disabled",
|
|
1522
|
+
e.ghost && "KInput--ghost",
|
|
1523
|
+
e.rounded && "KInput--rounded",
|
|
1524
|
+
e.sunken && "KInput--sunken",
|
|
1525
|
+
e.transparent && "KInput--transparent"
|
|
1526
|
+
]), k = g(() => {
|
|
1527
|
+
const { class: x, style: M, ...R } = s;
|
|
1528
|
+
return R;
|
|
1529
|
+
}), h = g(
|
|
1530
|
+
() => e.autosize ? { "data-kt-input-autosize": "", "data-kt-input-max-rows": e.maxRows } : {}
|
|
1531
|
+
);
|
|
1532
|
+
let c;
|
|
1533
|
+
j(
|
|
1534
|
+
() => e.maxRows,
|
|
1535
|
+
() => {
|
|
1536
|
+
c = void 0;
|
|
1537
|
+
}
|
|
1538
|
+
), j(n, () => {
|
|
1539
|
+
c = void 0;
|
|
1540
|
+
});
|
|
1541
|
+
function m() {
|
|
1542
|
+
e.autosize && (!c && n.value && (c = new oe.modules.Input(n.value, { maxRows: e.maxRows })), c?.resize());
|
|
1543
|
+
}
|
|
1544
|
+
async function S() {
|
|
1545
|
+
await ue(), m();
|
|
1546
|
+
}
|
|
1547
|
+
return j(
|
|
1548
|
+
() => o.value,
|
|
1549
|
+
() => {
|
|
1550
|
+
e.autosize && S();
|
|
1551
|
+
}
|
|
1552
|
+
), De(() => {
|
|
1553
|
+
e.autosize && o.value && S();
|
|
1554
|
+
}), l({ field: n }), (x, M) => (i(), u("div", re({
|
|
1555
|
+
class: [d.value, z(s).class],
|
|
1556
|
+
style: z(s).style
|
|
1557
|
+
}, h.value), [
|
|
1558
|
+
t.prefix ? (i(), u("div", ts, [
|
|
1559
|
+
v(x.$slots, "prefix")
|
|
1560
|
+
])) : D("", !0),
|
|
1561
|
+
r.value ? Pe((i(), u("textarea", re({
|
|
1562
|
+
key: 1,
|
|
1563
|
+
ref_key: "field",
|
|
1564
|
+
ref: n,
|
|
1565
|
+
"onUpdate:modelValue": M[0] || (M[0] = (R) => o.value = R)
|
|
1566
|
+
}, k.value, {
|
|
1567
|
+
disabled: e.disabled,
|
|
1568
|
+
placeholder: e.placeholder,
|
|
1569
|
+
readonly: e.readonly,
|
|
1570
|
+
rows: e.autosize ? 1 : e.rows,
|
|
1571
|
+
onFocusin: m,
|
|
1572
|
+
onInput: m
|
|
1573
|
+
}), null, 16, as)), [
|
|
1574
|
+
[Tt, o.value]
|
|
1575
|
+
]) : Pe((i(), u("input", re({
|
|
1576
|
+
key: 2,
|
|
1577
|
+
"onUpdate:modelValue": M[1] || (M[1] = (R) => o.value = R)
|
|
1578
|
+
}, k.value, {
|
|
1579
|
+
disabled: e.disabled,
|
|
1580
|
+
placeholder: e.placeholder,
|
|
1581
|
+
readonly: e.readonly,
|
|
1582
|
+
type: e.type
|
|
1583
|
+
}), null, 16, ss)), [
|
|
1584
|
+
[It, o.value]
|
|
1585
|
+
]),
|
|
1586
|
+
t.suffix ? (i(), u("div", os, [
|
|
1587
|
+
v(x.$slots, "suffix")
|
|
1588
|
+
])) : D("", !0)
|
|
1589
|
+
], 16));
|
|
1590
|
+
}
|
|
1591
|
+
}), ls = {
|
|
1592
|
+
key: 0,
|
|
1593
|
+
class: "KIcon",
|
|
1594
|
+
viewBox: "0 0 16 16",
|
|
1595
|
+
"aria-hidden": "true"
|
|
1596
|
+
}, ns = {
|
|
1597
|
+
key: 1,
|
|
1598
|
+
class: "KIcon",
|
|
1599
|
+
"aria-hidden": "true"
|
|
1600
|
+
}, gt = /* @__PURE__ */ P({
|
|
1601
|
+
__name: "KChatPrompt",
|
|
1602
|
+
props: /* @__PURE__ */ q({
|
|
1603
|
+
busy: { type: Boolean, default: void 0 },
|
|
1604
|
+
disabled: { type: Boolean, default: !1 },
|
|
1605
|
+
maxRows: { default: 5 },
|
|
1606
|
+
newlineOnEnter: { type: Boolean, default: !1 },
|
|
1607
|
+
placeholder: { default: "Write a message" }
|
|
1608
|
+
}, {
|
|
1609
|
+
modelValue: { default: "" },
|
|
1610
|
+
modelModifiers: {}
|
|
1611
|
+
}),
|
|
1612
|
+
emits: /* @__PURE__ */ q(["stop", "submit"], ["update:modelValue"]),
|
|
1613
|
+
setup(e, { emit: l }) {
|
|
1614
|
+
const o = te(e, "modelValue"), t = e, s = l, r = he(Ve, void 0), n = g(() => t.busy ?? r?.value ?? !1), d = g(() => !o.value.trim()), k = g(
|
|
1615
|
+
() => t.disabled || !n.value && d.value
|
|
1616
|
+
);
|
|
1617
|
+
function h() {
|
|
1618
|
+
if (n.value) {
|
|
1619
|
+
s("stop");
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
d.value || s("submit", o.value);
|
|
1623
|
+
}
|
|
1624
|
+
function c(m) {
|
|
1625
|
+
t.newlineOnEnter || m.isComposing || (m.preventDefault(), h());
|
|
1626
|
+
}
|
|
1627
|
+
return (m, S) => (i(), u("form", {
|
|
1628
|
+
class: "KChat-prompt",
|
|
1629
|
+
onSubmit: ne(h, ["prevent"])
|
|
1630
|
+
}, [
|
|
1631
|
+
Z(bt, {
|
|
1632
|
+
modelValue: o.value,
|
|
1633
|
+
"onUpdate:modelValue": S[0] || (S[0] = (x) => o.value = x),
|
|
1634
|
+
autosize: "",
|
|
1635
|
+
rounded: "",
|
|
1636
|
+
disabled: t.disabled || n.value,
|
|
1637
|
+
"max-rows": t.maxRows,
|
|
1638
|
+
placeholder: t.placeholder,
|
|
1639
|
+
onKeydown: Oe(ne(c, ["exact"]), ["enter"])
|
|
1640
|
+
}, null, 8, ["modelValue", "disabled", "max-rows", "placeholder", "onKeydown"]),
|
|
1641
|
+
v(m.$slots, "send", {
|
|
1642
|
+
busy: n.value,
|
|
1643
|
+
disabled: k.value
|
|
1644
|
+
}, () => [
|
|
1645
|
+
Z(Ke, {
|
|
1646
|
+
"icon-circular": "",
|
|
1647
|
+
type: "submit",
|
|
1648
|
+
disabled: k.value,
|
|
1649
|
+
"aria-label": n.value ? "Stop" : "Send"
|
|
1650
|
+
}, {
|
|
1651
|
+
default: N(() => [
|
|
1652
|
+
n.value ? (i(), u("svg", ls, [...S[1] || (S[1] = [
|
|
1653
|
+
K("rect", {
|
|
1654
|
+
x: "4",
|
|
1655
|
+
y: "4",
|
|
1656
|
+
width: "8",
|
|
1657
|
+
height: "8",
|
|
1658
|
+
rx: "1.5",
|
|
1659
|
+
fill: "currentColor"
|
|
1660
|
+
}, null, -1)
|
|
1661
|
+
])])) : (i(), u("svg", ns, [...S[2] || (S[2] = [
|
|
1662
|
+
K("use", { href: "#arrowRight" }, null, -1)
|
|
1663
|
+
])]))
|
|
1664
|
+
]),
|
|
1665
|
+
_: 1
|
|
1666
|
+
}, 8, ["disabled", "aria-label"])
|
|
1667
|
+
])
|
|
1668
|
+
], 32));
|
|
1669
|
+
}
|
|
1670
|
+
}), is = {
|
|
1671
|
+
class: "KChat-shimmer",
|
|
1672
|
+
role: "status"
|
|
1673
|
+
}, rs = { class: "KChat-shimmerStack" }, ze = /* @__PURE__ */ P({
|
|
1674
|
+
__name: "KChatShimmer",
|
|
1675
|
+
props: {
|
|
1676
|
+
interval: { default: 2e3 },
|
|
1677
|
+
text: { default: "Thinking…" },
|
|
1678
|
+
texts: {}
|
|
1679
|
+
},
|
|
1680
|
+
setup(e) {
|
|
1681
|
+
const l = ee(), o = ye(0);
|
|
1682
|
+
let t;
|
|
1683
|
+
const s = g(
|
|
1684
|
+
() => !!(e.texts && e.texts.length > 1) && !l.default
|
|
1685
|
+
), r = g(
|
|
1686
|
+
() => e.texts && e.texts.length ? e.texts[o.value % e.texts.length] : e.text
|
|
1687
|
+
);
|
|
1688
|
+
function n() {
|
|
1689
|
+
t && (clearInterval(t), t = void 0);
|
|
1690
|
+
}
|
|
1691
|
+
function d() {
|
|
1692
|
+
n(), s.value && (o.value = 0, t = setInterval(() => {
|
|
1693
|
+
o.value += 1;
|
|
1694
|
+
}, e.interval));
|
|
1695
|
+
}
|
|
1696
|
+
return j([() => e.texts?.join(" "), () => e.interval], d, {
|
|
1697
|
+
immediate: !0
|
|
1698
|
+
}), _e(n), (k, h) => (i(), u("li", is, [
|
|
1699
|
+
K("span", rs, [
|
|
1700
|
+
Z(Et, { name: "KChat-shimmerText" }, {
|
|
1701
|
+
default: N(() => [
|
|
1702
|
+
(i(), u("span", {
|
|
1703
|
+
key: o.value,
|
|
1704
|
+
class: "KChat-shimmerText"
|
|
1705
|
+
}, [
|
|
1706
|
+
v(k.$slots, "default", {}, () => [
|
|
1707
|
+
F(W(r.value), 1)
|
|
1708
|
+
])
|
|
1709
|
+
]))
|
|
1710
|
+
]),
|
|
1711
|
+
_: 3
|
|
1712
|
+
})
|
|
1713
|
+
])
|
|
1714
|
+
]));
|
|
1715
|
+
}
|
|
1716
|
+
}), yt = P({
|
|
1717
|
+
name: "KTooltip",
|
|
1718
|
+
props: {
|
|
1719
|
+
delay: { type: Number, required: !1 },
|
|
1720
|
+
label: { type: String, required: !0 },
|
|
1721
|
+
placement: { type: String, required: !1 }
|
|
1722
|
+
},
|
|
1723
|
+
setup(e, { slots: l }) {
|
|
1724
|
+
const { Tooltip: o } = oe.modules;
|
|
1725
|
+
function t(h) {
|
|
1726
|
+
return h.currentTarget ?? null;
|
|
1727
|
+
}
|
|
1728
|
+
function s(h) {
|
|
1729
|
+
const c = t(h), m = h.relatedTarget;
|
|
1730
|
+
!c || m && c.contains(m) || (h.stopPropagation(), o.scheduleShow(c));
|
|
1731
|
+
}
|
|
1732
|
+
function r(h) {
|
|
1733
|
+
const c = t(h), m = h.relatedTarget;
|
|
1734
|
+
!c || m && c.contains(m) || c.contains(document.activeElement) || (h.stopPropagation(), o.scheduleHide(c));
|
|
1735
|
+
}
|
|
1736
|
+
function n(h) {
|
|
1737
|
+
const c = t(h);
|
|
1738
|
+
c && (h.stopPropagation(), o.scheduleShow(c));
|
|
1739
|
+
}
|
|
1740
|
+
function d(h) {
|
|
1741
|
+
const c = t(h);
|
|
1742
|
+
!c || c.matches(":hover") || (h.stopPropagation(), o.scheduleHide(c));
|
|
1743
|
+
}
|
|
1744
|
+
function k(h) {
|
|
1745
|
+
h.key === "Escape" && o.hideAll();
|
|
1746
|
+
}
|
|
1747
|
+
return document.addEventListener("keydown", k), le(() => {
|
|
1748
|
+
document.removeEventListener("keydown", k), o.hideAll();
|
|
1749
|
+
}), () => {
|
|
1750
|
+
const h = l.default?.() ?? [], c = {
|
|
1751
|
+
"data-kt-tooltip": e.label,
|
|
1752
|
+
onFocusin: n,
|
|
1753
|
+
onFocusout: d,
|
|
1754
|
+
onMouseout: r,
|
|
1755
|
+
onMouseover: s
|
|
1756
|
+
};
|
|
1757
|
+
e.placement && (c["data-kt-tooltip-placement"] = e.placement), e.delay !== void 0 && (c["data-kt-tooltip-delay"] = String(e.delay));
|
|
1758
|
+
const m = h.filter(
|
|
1759
|
+
(S) => typeof S == "object" && S !== null && "type" in S
|
|
1760
|
+
);
|
|
1761
|
+
return m.length === 1 ? Lt(m[0], c) : Dt("span", { ...c, style: { display: "contents" } }, h);
|
|
1762
|
+
};
|
|
1763
|
+
}
|
|
1764
|
+
}), ds = ["data-kt-chat-window", "aria-labelledby"], cs = { class: "KChatWindow-header" }, us = ["aria-label", "aria-expanded"], fs = ["id"], vs = {
|
|
1765
|
+
key: 0,
|
|
1766
|
+
class: "KBadge KChatWindow-badge"
|
|
1767
|
+
}, hs = {
|
|
1768
|
+
key: 0,
|
|
1769
|
+
class: "KChatWindow-actions"
|
|
1770
|
+
}, ms = {
|
|
1771
|
+
key: 0,
|
|
1772
|
+
type: "button",
|
|
1773
|
+
class: "KChatWindow-action",
|
|
1774
|
+
"data-kt-chat-window-minimize": "",
|
|
1775
|
+
"aria-label": "Minimize"
|
|
1776
|
+
}, bs = {
|
|
1777
|
+
key: 1,
|
|
1778
|
+
type: "button",
|
|
1779
|
+
class: "KChatWindow-action",
|
|
1780
|
+
"data-kt-chat-window-close": "",
|
|
1781
|
+
"aria-label": "Close"
|
|
1782
|
+
}, gs = { class: "KChatWindow-body" }, ys = ["data-kt-chat-window-head"], ks = ["aria-label"], Ks = ["aria-label"], ws = ["data-kt-chat-window-row"], $s = { class: "KChatDockRow-name" }, kt = /* @__PURE__ */ P({
|
|
1783
|
+
inheritAttrs: !1,
|
|
1784
|
+
__name: "KChatWindow",
|
|
1785
|
+
props: /* @__PURE__ */ q({
|
|
1786
|
+
closable: { type: Boolean, default: !0 },
|
|
1787
|
+
minimizable: { type: Boolean, default: !0 },
|
|
1788
|
+
title: {},
|
|
1789
|
+
unread: { default: 0 },
|
|
1790
|
+
id: {}
|
|
1791
|
+
}, {
|
|
1792
|
+
state: { default: "expanded" },
|
|
1793
|
+
stateModifiers: {}
|
|
1794
|
+
}),
|
|
1795
|
+
emits: /* @__PURE__ */ q(["close"], ["update:state"]),
|
|
1796
|
+
setup(e, { expose: l, emit: o }) {
|
|
1797
|
+
const t = te(e, "state"), s = o, r = ee();
|
|
1798
|
+
function n(a = []) {
|
|
1799
|
+
return a.flatMap((A) => A.type === xt ? [] : A.type === Mt ? String(A.children).trim() ? [A] : [] : A.type === ae && Array.isArray(A.children) ? n(A.children) : [A]);
|
|
1800
|
+
}
|
|
1801
|
+
function d() {
|
|
1802
|
+
let a = n(r.head?.());
|
|
1803
|
+
return a.length || (a = n(r.avatar?.())), a.length === 1 && (a[0].type === fe || a[0].type === lt);
|
|
1804
|
+
}
|
|
1805
|
+
const k = Ie(), h = g(() => {
|
|
1806
|
+
const { class: a, style: A, ...y } = k;
|
|
1807
|
+
return y;
|
|
1808
|
+
}), c = _("root"), m = Te(), S = g(() => `${m}-title`), x = {
|
|
1809
|
+
withModule: () => "unavailable",
|
|
1810
|
+
declare: () => {
|
|
1811
|
+
},
|
|
1812
|
+
rail: ke(null),
|
|
1813
|
+
list: ke(null),
|
|
1814
|
+
panel: ke(null)
|
|
1815
|
+
}, M = he(xe, x);
|
|
1816
|
+
let R = t.value, E = t.value === "railed" ? "expanded" : t.value;
|
|
1817
|
+
const B = g(() => [
|
|
1818
|
+
"KChatWindow",
|
|
1819
|
+
t.value === "railed" && "is-railed"
|
|
1820
|
+
]), C = g(() => {
|
|
1821
|
+
const a = e.title ?? "Conversation";
|
|
1822
|
+
return e.unread > 0 ? `${a}, ${e.unread} unread` : a;
|
|
1823
|
+
}), b = g(() => ["KChatDockHead"]), L = g(() => C.value), U = g(
|
|
1824
|
+
() => `Close conversation with ${e.title ?? "Conversation"}`
|
|
1825
|
+
), $ = (a) => a.target === c.value;
|
|
1826
|
+
function w(a) {
|
|
1827
|
+
a === "railed" && R !== "railed" && (E = R), R = a, t.value = a;
|
|
1828
|
+
}
|
|
1829
|
+
const G = {
|
|
1830
|
+
"kt.chatdock.expand": (a) => {
|
|
1831
|
+
$(a) && w("expanded");
|
|
1832
|
+
},
|
|
1833
|
+
"kt.chatdock.rail": (a) => {
|
|
1834
|
+
$(a) && w("railed");
|
|
1835
|
+
},
|
|
1836
|
+
// Fires only when `reflow()` itself un-rails this window — capacity grew,
|
|
1837
|
+
// or another window was minimized and freed a slot. A head click that
|
|
1838
|
+
// reopens *this* window reports via `expand`, never `unrail`: `expand()`
|
|
1839
|
+
// strips `is-railed` before `reflow()` takes its before/after snapshot, so
|
|
1840
|
+
// the diff sees no change for this window and fires nothing for it. Verified
|
|
1841
|
+
// against the compiled module.
|
|
1842
|
+
"kt.chatdock.unrail": (a) => {
|
|
1843
|
+
$(a) && w(E);
|
|
1844
|
+
},
|
|
1845
|
+
"kt.chatdock.close": (a) => {
|
|
1846
|
+
$(a) && (a.preventDefault(), s("close"));
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
j(
|
|
1850
|
+
c,
|
|
1851
|
+
(a, A, y) => {
|
|
1852
|
+
a && (Object.entries(G).forEach(([O, f]) => {
|
|
1853
|
+
a.addEventListener(O, f);
|
|
1854
|
+
}), R === "railed" && M.declare(a, !0), y(() => {
|
|
1855
|
+
Object.entries(G).forEach(([O, f]) => {
|
|
1856
|
+
a.removeEventListener(O, f);
|
|
1857
|
+
});
|
|
1858
|
+
}));
|
|
1859
|
+
},
|
|
1860
|
+
{ immediate: !0 }
|
|
1861
|
+
), j(t, (a) => {
|
|
1862
|
+
const A = c.value;
|
|
1863
|
+
if (!A || a === R)
|
|
1864
|
+
return;
|
|
1865
|
+
const y = () => {
|
|
1866
|
+
a === "railed" && R !== "railed" && (E = R), R = a;
|
|
1867
|
+
};
|
|
1868
|
+
M.withModule((f) => {
|
|
1869
|
+
y(), a === "expanded" ? f.expand(A) : f.rail(A);
|
|
1870
|
+
}) === "deferred" && (y(), M.declare(A, a === "railed"));
|
|
1871
|
+
});
|
|
1872
|
+
function Q() {
|
|
1873
|
+
t.value = "expanded";
|
|
1874
|
+
}
|
|
1875
|
+
function p() {
|
|
1876
|
+
t.value = "railed";
|
|
1877
|
+
}
|
|
1878
|
+
return l({ expand: Q, rail: p }), (a, A) => (i(), u(ae, null, [
|
|
1879
|
+
K("div", re({
|
|
1880
|
+
ref_key: "root",
|
|
1881
|
+
ref: c
|
|
1882
|
+
}, h.value, {
|
|
1883
|
+
class: [B.value, z(k).class],
|
|
1884
|
+
style: z(k).style,
|
|
1885
|
+
"data-kt-chat-window": e.id ?? "",
|
|
1886
|
+
"aria-labelledby": S.value
|
|
1887
|
+
}), [
|
|
1888
|
+
K("header", cs, [
|
|
1889
|
+
K("button", {
|
|
1890
|
+
type: "button",
|
|
1891
|
+
class: "KChatWindow-toggle",
|
|
1892
|
+
"data-kt-chat-window-toggle": "",
|
|
1893
|
+
"aria-label": C.value,
|
|
1894
|
+
"aria-expanded": t.value === "expanded"
|
|
1895
|
+
}, [
|
|
1896
|
+
K("span", {
|
|
1897
|
+
id: S.value,
|
|
1898
|
+
class: "KChatWindow-title"
|
|
1899
|
+
}, [
|
|
1900
|
+
v(a.$slots, "title", {}, () => [
|
|
1901
|
+
F(W(e.title), 1)
|
|
1902
|
+
])
|
|
1903
|
+
], 8, fs),
|
|
1904
|
+
e.unread > 0 ? (i(), u("span", vs, W(e.unread), 1)) : D("", !0)
|
|
1905
|
+
], 8, us),
|
|
1906
|
+
e.minimizable || e.closable || r.actions ? (i(), u("span", hs, [
|
|
1907
|
+
v(a.$slots, "actions"),
|
|
1908
|
+
e.minimizable ? (i(), u("button", ms, " – ")) : D("", !0),
|
|
1909
|
+
e.closable ? (i(), u("button", bs, " ✕ ")) : D("", !0)
|
|
1910
|
+
])) : D("", !0)
|
|
1911
|
+
]),
|
|
1912
|
+
K("div", gs, [
|
|
1913
|
+
v(a.$slots, "default")
|
|
1914
|
+
])
|
|
1915
|
+
], 16, ds),
|
|
1916
|
+
e.id && z(M).rail.value ? (i(), J(Be, {
|
|
1917
|
+
key: 0,
|
|
1918
|
+
defer: "",
|
|
1919
|
+
to: z(M).rail.value
|
|
1920
|
+
}, [
|
|
1921
|
+
K("div", {
|
|
1922
|
+
class: T(b.value),
|
|
1923
|
+
"data-kt-chat-window-head": e.id
|
|
1924
|
+
}, [
|
|
1925
|
+
Z(yt, {
|
|
1926
|
+
label: e.title ?? "Conversation",
|
|
1927
|
+
placement: "left"
|
|
1928
|
+
}, {
|
|
1929
|
+
default: N(() => [
|
|
1930
|
+
K("button", {
|
|
1931
|
+
type: "button",
|
|
1932
|
+
class: "KChatDockHead-open",
|
|
1933
|
+
"aria-label": L.value
|
|
1934
|
+
}, [
|
|
1935
|
+
d() ? v(a.$slots, "head", { key: 0 }, () => [
|
|
1936
|
+
v(a.$slots, "avatar")
|
|
1937
|
+
]) : (i(), J(fe, {
|
|
1938
|
+
key: 1,
|
|
1939
|
+
size: "sm"
|
|
1940
|
+
}, {
|
|
1941
|
+
default: N(() => [
|
|
1942
|
+
v(a.$slots, "head", {}, () => [
|
|
1943
|
+
v(a.$slots, "avatar")
|
|
1944
|
+
])
|
|
1945
|
+
]),
|
|
1946
|
+
_: 3
|
|
1947
|
+
}))
|
|
1948
|
+
], 8, ks)
|
|
1949
|
+
]),
|
|
1950
|
+
_: 3
|
|
1951
|
+
}, 8, ["label"]),
|
|
1952
|
+
e.unread > 0 ? (i(), J(Se, {
|
|
1953
|
+
key: 0,
|
|
1954
|
+
compact: "",
|
|
1955
|
+
pill: "",
|
|
1956
|
+
class: "KChatDockHead-badge"
|
|
1957
|
+
}, {
|
|
1958
|
+
default: N(() => [
|
|
1959
|
+
F(W(e.unread), 1)
|
|
1960
|
+
]),
|
|
1961
|
+
_: 1
|
|
1962
|
+
})) : D("", !0),
|
|
1963
|
+
K("button", {
|
|
1964
|
+
type: "button",
|
|
1965
|
+
class: "KChatDockHead-close",
|
|
1966
|
+
"data-kt-chat-window-head-close": "",
|
|
1967
|
+
"aria-label": U.value
|
|
1968
|
+
}, " ✕ ", 8, Ks)
|
|
1969
|
+
], 10, ys)
|
|
1970
|
+
], 8, ["to"])) : D("", !0),
|
|
1971
|
+
e.id && z(M).list.value ? (i(), J(Be, {
|
|
1972
|
+
key: 1,
|
|
1973
|
+
defer: "",
|
|
1974
|
+
to: z(M).list.value
|
|
1975
|
+
}, [
|
|
1976
|
+
K("button", {
|
|
1977
|
+
type: "button",
|
|
1978
|
+
class: "KChatDockRow is-hidden",
|
|
1979
|
+
"data-kt-chat-window-row": e.id
|
|
1980
|
+
}, [
|
|
1981
|
+
v(a.$slots, "row", {}, () => [
|
|
1982
|
+
v(a.$slots, "avatar")
|
|
1983
|
+
]),
|
|
1984
|
+
K("span", $s, W(e.title), 1),
|
|
1985
|
+
e.unread > 0 ? (i(), J(Se, {
|
|
1986
|
+
key: 0,
|
|
1987
|
+
compact: "",
|
|
1988
|
+
pill: "",
|
|
1989
|
+
class: "KChatDockRow-badge"
|
|
1990
|
+
}, {
|
|
1991
|
+
default: N(() => [
|
|
1992
|
+
F(W(e.unread), 1)
|
|
1993
|
+
]),
|
|
1994
|
+
_: 1
|
|
1995
|
+
})) : D("", !0)
|
|
1996
|
+
], 8, ws)
|
|
1997
|
+
], 8, ["to"])) : D("", !0)
|
|
1998
|
+
], 64));
|
|
1999
|
+
}
|
|
2000
|
+
}), Cs = {
|
|
2001
|
+
key: 1,
|
|
2002
|
+
class: "KMessenger-listError"
|
|
2003
|
+
}, ps = { class: "KMessenger-error" }, Bs = {
|
|
2004
|
+
key: 0,
|
|
2005
|
+
"data-kt-messenger-top": "",
|
|
2006
|
+
class: "KMessenger-top",
|
|
2007
|
+
"aria-hidden": "true"
|
|
2008
|
+
}, Ss = ["onClick"], As = /* @__PURE__ */ P({
|
|
2009
|
+
__name: "KMessenger",
|
|
2010
|
+
props: {
|
|
2011
|
+
loaders: {},
|
|
2012
|
+
store: {},
|
|
2013
|
+
minWindows: { default: 1 },
|
|
2014
|
+
title: { default: "Chats" },
|
|
2015
|
+
placeholder: { default: "Search" },
|
|
2016
|
+
evictOnClose: { type: Boolean, default: !1 },
|
|
2017
|
+
actionsBottom: { type: Boolean, default: !0 },
|
|
2018
|
+
dateLabel: { type: Function },
|
|
2019
|
+
noticeLabel: { type: Function }
|
|
2020
|
+
},
|
|
2021
|
+
emits: ["open", "close", "send", "receive", "error"],
|
|
2022
|
+
setup(e, { expose: l, emit: o }) {
|
|
2023
|
+
const t = o, s = (() => {
|
|
2024
|
+
if (e.store)
|
|
2025
|
+
return e.store;
|
|
2026
|
+
if (!e.loaders)
|
|
2027
|
+
throw new Error("KMessenger needs either `loaders` or `store`.");
|
|
2028
|
+
return st(e.loaders, { evictOnClose: e.evictOnClose });
|
|
2029
|
+
})();
|
|
2030
|
+
at(s);
|
|
2031
|
+
const r = s.onEvent((a) => {
|
|
2032
|
+
switch (a.type) {
|
|
2033
|
+
case "open":
|
|
2034
|
+
t("open", a.id);
|
|
2035
|
+
break;
|
|
2036
|
+
case "close":
|
|
2037
|
+
t("close", a.id);
|
|
2038
|
+
break;
|
|
2039
|
+
case "send":
|
|
2040
|
+
t("send", a.message);
|
|
2041
|
+
break;
|
|
2042
|
+
case "receive":
|
|
2043
|
+
t("receive", a.message);
|
|
2044
|
+
break;
|
|
2045
|
+
case "error":
|
|
2046
|
+
t("error", a.kind, a.id, a.error);
|
|
2047
|
+
break;
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
2050
|
+
le(r);
|
|
2051
|
+
const n = g(
|
|
2052
|
+
() => s.openIds.value.map((a) => s.entries[a])
|
|
2053
|
+
);
|
|
2054
|
+
function d(a) {
|
|
2055
|
+
return a.window === "railed" ? "railed" : "expanded";
|
|
2056
|
+
}
|
|
2057
|
+
function k(a, A) {
|
|
2058
|
+
A === "railed" ? s.minimize(a.conversation.id) : a.window !== "expanded" && s.expand(a.conversation.id);
|
|
2059
|
+
}
|
|
2060
|
+
function h(a) {
|
|
2061
|
+
return a.name.split(/\s+/).filter(Boolean).slice(0, 2).map((A) => A[0].toUpperCase()).join("");
|
|
2062
|
+
}
|
|
2063
|
+
function c(a, A) {
|
|
2064
|
+
return a instanceof Error && a.message ? a.message : A;
|
|
2065
|
+
}
|
|
2066
|
+
const m = g(() => {
|
|
2067
|
+
const a = /* @__PURE__ */ new Map();
|
|
2068
|
+
return n.value.forEach((A) => {
|
|
2069
|
+
if (A.window === "railed")
|
|
2070
|
+
return;
|
|
2071
|
+
const y = A.messages;
|
|
2072
|
+
a.set(A.conversation.id, {
|
|
2073
|
+
dividers: y.map(
|
|
2074
|
+
(O, f) => e.dateLabel?.(O, y[f - 1])
|
|
2075
|
+
),
|
|
2076
|
+
notices: y.map((O) => e.noticeLabel?.(O))
|
|
2077
|
+
});
|
|
2078
|
+
}), a;
|
|
2079
|
+
});
|
|
2080
|
+
function S(a, A) {
|
|
2081
|
+
return m.value.get(a)?.dividers[A];
|
|
2082
|
+
}
|
|
2083
|
+
function x(a, A) {
|
|
2084
|
+
return m.value.get(a)?.notices[A];
|
|
2085
|
+
}
|
|
2086
|
+
const M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
|
|
2087
|
+
function C(a) {
|
|
2088
|
+
let A = B.get(a);
|
|
2089
|
+
return A || (A = (y) => $(a, y), B.set(a, A)), A;
|
|
2090
|
+
}
|
|
2091
|
+
function b(a) {
|
|
2092
|
+
const A = M.get(a);
|
|
2093
|
+
return A ? A.$el : void 0;
|
|
2094
|
+
}
|
|
2095
|
+
function L(a) {
|
|
2096
|
+
return b(a)?.querySelector(".KChat-body") ?? null;
|
|
2097
|
+
}
|
|
2098
|
+
function U(a, A) {
|
|
2099
|
+
const y = R.get(a);
|
|
2100
|
+
if (!y)
|
|
2101
|
+
return;
|
|
2102
|
+
const O = E.get(a);
|
|
2103
|
+
if (!A) {
|
|
2104
|
+
O && (y.unobserve(O), E.delete(a));
|
|
2105
|
+
return;
|
|
2106
|
+
}
|
|
2107
|
+
const f = b(a)?.querySelector("[data-kt-messenger-top]") ?? null;
|
|
2108
|
+
!f || f === O || (O && y.unobserve(O), y.observe(f), E.set(a, f));
|
|
2109
|
+
}
|
|
2110
|
+
function $(a, A) {
|
|
2111
|
+
if (!A) {
|
|
2112
|
+
R.get(a)?.disconnect(), R.delete(a), E.delete(a), M.delete(a);
|
|
2113
|
+
return;
|
|
2114
|
+
}
|
|
2115
|
+
if (M.get(a) === A && R.has(a))
|
|
2116
|
+
return;
|
|
2117
|
+
R.get(a)?.disconnect(), R.delete(a), E.delete(a), M.set(a, A);
|
|
2118
|
+
const y = L(a);
|
|
2119
|
+
y && (R.set(
|
|
2120
|
+
a,
|
|
2121
|
+
new IntersectionObserver(
|
|
2122
|
+
(O) => {
|
|
2123
|
+
O.some((f) => f.isIntersecting) && w(a);
|
|
2124
|
+
},
|
|
2125
|
+
{ root: y }
|
|
2126
|
+
)
|
|
2127
|
+
), U(a, typeof s.entries[a]?.cursor == "string"));
|
|
2128
|
+
}
|
|
2129
|
+
async function w(a) {
|
|
2130
|
+
const A = s.entries[a], y = L(a);
|
|
2131
|
+
if (!y || !A || A.loadingOlder || typeof A.cursor != "string")
|
|
2132
|
+
return;
|
|
2133
|
+
const O = y.scrollHeight, f = y.scrollTop;
|
|
2134
|
+
await s.loadOlder(a), await ue(), y.scrollTop = f + (y.scrollHeight - O);
|
|
2135
|
+
}
|
|
2136
|
+
le(() => {
|
|
2137
|
+
R.forEach((a) => a.disconnect()), R.clear(), E.clear(), M.clear(), B.clear();
|
|
2138
|
+
}), j(
|
|
2139
|
+
() => n.value.map(
|
|
2140
|
+
(a) => [a.conversation.id, typeof a.cursor == "string"]
|
|
2141
|
+
),
|
|
2142
|
+
async (a) => {
|
|
2143
|
+
await ue(), a.forEach(([A, y]) => U(A, y));
|
|
2144
|
+
}
|
|
2145
|
+
), j(
|
|
2146
|
+
() => s.openIds.value,
|
|
2147
|
+
(a) => {
|
|
2148
|
+
const A = new Set(a);
|
|
2149
|
+
B.forEach((y, O) => {
|
|
2150
|
+
A.has(O) || B.delete(O);
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
), j(
|
|
2154
|
+
() => n.value.map(
|
|
2155
|
+
(a) => [a.conversation.id, a.loading]
|
|
2156
|
+
),
|
|
2157
|
+
async (a, A) => {
|
|
2158
|
+
const y = new Map(A ?? []);
|
|
2159
|
+
await ue(), a.forEach(([O, f]) => {
|
|
2160
|
+
f === "loaded" && y.get(O) !== "loaded" && M.get(O)?.scrollToBottom();
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
);
|
|
2164
|
+
const G = _("dock");
|
|
2165
|
+
j(
|
|
2166
|
+
() => [s.listLoading.value, s.conversations.value.length],
|
|
2167
|
+
async () => {
|
|
2168
|
+
await ue(), G.value?.refilter();
|
|
2169
|
+
}
|
|
2170
|
+
);
|
|
2171
|
+
function Q(a) {
|
|
2172
|
+
s.open(a);
|
|
2173
|
+
}
|
|
2174
|
+
function p(a) {
|
|
2175
|
+
s.setQuery(a);
|
|
2176
|
+
}
|
|
2177
|
+
return l(s), (a, A) => (i(), J(ct, {
|
|
2178
|
+
ref_key: "dock",
|
|
2179
|
+
ref: G,
|
|
2180
|
+
"min-windows": e.minWindows,
|
|
2181
|
+
onSelect: Q,
|
|
2182
|
+
onActivate: A[1] || (A[1] = (y) => z(s).open(y)),
|
|
2183
|
+
onSearch: p
|
|
2184
|
+
}, {
|
|
2185
|
+
launcher: N(() => [
|
|
2186
|
+
v(a.$slots, "launcher")
|
|
2187
|
+
]),
|
|
2188
|
+
default: N(() => [
|
|
2189
|
+
Z(ft, {
|
|
2190
|
+
title: e.title,
|
|
2191
|
+
placeholder: e.placeholder
|
|
2192
|
+
}, ge({
|
|
2193
|
+
empty: N(() => [
|
|
2194
|
+
v(a.$slots, "empty", {}, () => [
|
|
2195
|
+
A[4] || (A[4] = F("No conversations found", -1))
|
|
2196
|
+
])
|
|
2197
|
+
]),
|
|
2198
|
+
default: N(() => [
|
|
2199
|
+
z(s).listLoading.value === "loading" && !z(s).conversations.value.length ? (i(), u(ae, { key: 0 }, ie(3, (y) => K("div", {
|
|
2200
|
+
key: y,
|
|
2201
|
+
class: "KChatDockItem",
|
|
2202
|
+
"aria-hidden": "true"
|
|
2203
|
+
}, [
|
|
2204
|
+
Z(fe, { size: "sm" }),
|
|
2205
|
+
A[2] || (A[2] = K("span", { class: "KChatDockItem-body" }, [
|
|
2206
|
+
K("span", { class: "KChatDockItem-name" }, " "),
|
|
2207
|
+
K("span", { class: "KChatDockItem-preview" }, " ")
|
|
2208
|
+
], -1))
|
|
2209
|
+
])), 64)) : z(s).listLoading.value === "error" ? (i(), u("div", Cs, [
|
|
2210
|
+
F(W(c(z(s).listError.value, "Could not load conversations")) + " ", 1),
|
|
2211
|
+
Z(Ke, {
|
|
2212
|
+
size: "xs",
|
|
2213
|
+
secondary: "",
|
|
2214
|
+
onClick: A[0] || (A[0] = (y) => z(s).refreshConversations())
|
|
2215
|
+
}, {
|
|
2216
|
+
default: N(() => [...A[3] || (A[3] = [
|
|
2217
|
+
F(" Retry ", -1)
|
|
2218
|
+
])]),
|
|
2219
|
+
_: 1
|
|
2220
|
+
})
|
|
2221
|
+
])) : D("", !0),
|
|
2222
|
+
(i(!0), u(ae, null, ie(z(s).conversations.value, (y) => v(a.$slots, "item", {
|
|
2223
|
+
key: y.id,
|
|
2224
|
+
conversation: y,
|
|
2225
|
+
entry: z(s).entries[y.id]
|
|
2226
|
+
}, () => [
|
|
2227
|
+
Z(ut, {
|
|
2228
|
+
id: y.id,
|
|
2229
|
+
name: y.name,
|
|
2230
|
+
preview: y.preview,
|
|
2231
|
+
unread: y.unread
|
|
2232
|
+
}, {
|
|
2233
|
+
avatar: N(() => [
|
|
2234
|
+
v(a.$slots, "avatar", { conversation: y }, () => [
|
|
2235
|
+
y.avatar ? (i(), J(fe, {
|
|
2236
|
+
key: 0,
|
|
2237
|
+
size: "sm",
|
|
2238
|
+
src: y.avatar,
|
|
2239
|
+
alt: y.name
|
|
2240
|
+
}, null, 8, ["src", "alt"])) : (i(), u(ae, { key: 1 }, [
|
|
2241
|
+
F(W(h(y)), 1)
|
|
2242
|
+
], 64))
|
|
2243
|
+
])
|
|
2244
|
+
]),
|
|
2245
|
+
_: 2
|
|
2246
|
+
}, 1032, ["id", "name", "preview", "unread"])
|
|
2247
|
+
])), 128))
|
|
2248
|
+
]),
|
|
2249
|
+
_: 2
|
|
2250
|
+
}, [
|
|
2251
|
+
a.$slots["panel-actions"] ? {
|
|
2252
|
+
name: "actions",
|
|
2253
|
+
fn: N(() => [
|
|
2254
|
+
v(a.$slots, "panel-actions")
|
|
2255
|
+
]),
|
|
2256
|
+
key: "0"
|
|
2257
|
+
} : void 0
|
|
2258
|
+
]), 1032, ["title", "placeholder"]),
|
|
2259
|
+
(i(!0), u(ae, null, ie(n.value, (y) => (i(), J(kt, {
|
|
2260
|
+
id: y.conversation.id,
|
|
2261
|
+
key: y.conversation.id,
|
|
2262
|
+
title: y.conversation.name,
|
|
2263
|
+
unread: y.conversation.unread,
|
|
2264
|
+
state: d(y),
|
|
2265
|
+
"onUpdate:state": (O) => k(y, O),
|
|
2266
|
+
onClose: (O) => z(s).close(y.conversation.id)
|
|
2267
|
+
}, ge({
|
|
2268
|
+
avatar: N(() => [
|
|
2269
|
+
v(a.$slots, "avatar", {
|
|
2270
|
+
conversation: y.conversation
|
|
2271
|
+
}, () => [
|
|
2272
|
+
y.conversation.avatar ? (i(), J(fe, {
|
|
2273
|
+
key: 0,
|
|
2274
|
+
size: "sm",
|
|
2275
|
+
src: y.conversation.avatar,
|
|
2276
|
+
alt: y.conversation.name
|
|
2277
|
+
}, null, 8, ["src", "alt"])) : (i(), u(ae, { key: 1 }, [
|
|
2278
|
+
F(W(h(y.conversation)), 1)
|
|
2279
|
+
], 64))
|
|
2280
|
+
])
|
|
2281
|
+
]),
|
|
2282
|
+
default: N(() => [
|
|
2283
|
+
y.window !== "railed" ? (i(), J(nt, {
|
|
2284
|
+
key: 0,
|
|
2285
|
+
ref_for: !0,
|
|
2286
|
+
ref: C(y.conversation.id),
|
|
2287
|
+
"actions-bottom": e.actionsBottom
|
|
2288
|
+
}, ge({
|
|
2289
|
+
default: N(() => [
|
|
2290
|
+
y.loading === "loading" && !y.messages.length ? v(a.$slots, "loading", {
|
|
2291
|
+
key: 0,
|
|
2292
|
+
conversation: y.conversation
|
|
2293
|
+
}, () => [
|
|
2294
|
+
Z(Re, null, {
|
|
2295
|
+
default: N(() => [
|
|
2296
|
+
Z(ze, { text: "Loading…" })
|
|
2297
|
+
]),
|
|
2298
|
+
_: 1
|
|
2299
|
+
})
|
|
2300
|
+
]) : y.loading === "error" && !y.messages.length ? v(a.$slots, "error", {
|
|
2301
|
+
key: 1,
|
|
2302
|
+
conversation: y.conversation,
|
|
2303
|
+
error: y.error,
|
|
2304
|
+
retry: () => z(s).retryLoad(y.conversation.id)
|
|
2305
|
+
}, () => [
|
|
2306
|
+
K("div", ps, [
|
|
2307
|
+
K("span", null, W(c(y.error, "Could not load messages")), 1),
|
|
2308
|
+
Z(Ke, {
|
|
2309
|
+
size: "xs",
|
|
2310
|
+
secondary: "",
|
|
2311
|
+
onClick: (O) => z(s).retryLoad(y.conversation.id)
|
|
2312
|
+
}, {
|
|
2313
|
+
default: N(() => [...A[5] || (A[5] = [
|
|
2314
|
+
F(" Retry ", -1)
|
|
2315
|
+
])]),
|
|
2316
|
+
_: 1
|
|
2317
|
+
}, 8, ["onClick"])
|
|
2318
|
+
])
|
|
2319
|
+
]) : (i(), J(Re, { key: 2 }, {
|
|
2320
|
+
default: N(() => [
|
|
2321
|
+
typeof y.cursor == "string" ? (i(), u("li", Bs)) : D("", !0),
|
|
2322
|
+
y.loadingOlder ? v(a.$slots, "loading-older", {
|
|
2323
|
+
key: 1,
|
|
2324
|
+
conversation: y.conversation
|
|
2325
|
+
}, () => [
|
|
2326
|
+
Z(ze, { text: "Loading older…" })
|
|
2327
|
+
]) : D("", !0),
|
|
2328
|
+
(i(!0), u(ae, null, ie(y.messages, (O, f) => (i(), u(ae, {
|
|
2329
|
+
key: O.id
|
|
2330
|
+
}, [
|
|
2331
|
+
S(y.conversation.id, f) ? v(a.$slots, "divider", {
|
|
2332
|
+
key: 0,
|
|
2333
|
+
label: S(y.conversation.id, f),
|
|
2334
|
+
message: O,
|
|
2335
|
+
previous: y.messages[f - 1]
|
|
2336
|
+
}, () => [
|
|
2337
|
+
Z(vt, {
|
|
2338
|
+
label: S(y.conversation.id, f)
|
|
2339
|
+
}, null, 8, ["label"])
|
|
2340
|
+
]) : D("", !0),
|
|
2341
|
+
x(y.conversation.id, f) ? v(a.$slots, "notice", {
|
|
2342
|
+
key: 1,
|
|
2343
|
+
label: x(y.conversation.id, f),
|
|
2344
|
+
message: O
|
|
2345
|
+
}, () => [
|
|
2346
|
+
Z(mt, {
|
|
2347
|
+
label: x(y.conversation.id, f)
|
|
2348
|
+
}, null, 8, ["label"])
|
|
2349
|
+
]) : (i(), J(ht, {
|
|
2350
|
+
key: 2,
|
|
2351
|
+
sender: O.sender,
|
|
2352
|
+
time: O.time,
|
|
2353
|
+
class: T({
|
|
2354
|
+
"is-pending": O.pending,
|
|
2355
|
+
"is-failed": O.failed
|
|
2356
|
+
})
|
|
2357
|
+
}, ge({
|
|
2358
|
+
default: N(() => [
|
|
2359
|
+
v(a.$slots, "message", {
|
|
2360
|
+
message: O,
|
|
2361
|
+
conversation: y.conversation
|
|
2362
|
+
}, () => [
|
|
2363
|
+
F(W(O.text), 1)
|
|
2364
|
+
]),
|
|
2365
|
+
O.failed ? (i(), u("button", {
|
|
2366
|
+
key: 0,
|
|
2367
|
+
type: "button",
|
|
2368
|
+
class: "KMessenger-retry",
|
|
2369
|
+
onClick: (I) => z(s).retry(y.conversation.id, O.id)
|
|
2370
|
+
}, " Failed · Retry ", 8, Ss)) : D("", !0)
|
|
2371
|
+
]),
|
|
2372
|
+
_: 2
|
|
2373
|
+
}, [
|
|
2374
|
+
a.$slots["message-actions"] ? {
|
|
2375
|
+
name: "actions",
|
|
2376
|
+
fn: N(() => [
|
|
2377
|
+
v(a.$slots, "message-actions", {
|
|
2378
|
+
message: O,
|
|
2379
|
+
conversation: y.conversation
|
|
2380
|
+
})
|
|
2381
|
+
]),
|
|
2382
|
+
key: "0"
|
|
2383
|
+
} : void 0
|
|
2384
|
+
]), 1032, ["sender", "time", "class"]))
|
|
2385
|
+
], 64))), 128))
|
|
2386
|
+
]),
|
|
2387
|
+
_: 2
|
|
2388
|
+
}, 1024))
|
|
2389
|
+
]),
|
|
2390
|
+
_: 2
|
|
2391
|
+
}, [
|
|
2392
|
+
z(s).canSend ? {
|
|
2393
|
+
name: "footer",
|
|
2394
|
+
fn: N(() => [
|
|
2395
|
+
v(a.$slots, "composer", {
|
|
2396
|
+
conversation: y.conversation,
|
|
2397
|
+
draft: y.draft,
|
|
2398
|
+
send: (O) => z(s).send(y.conversation.id, O),
|
|
2399
|
+
setDraft: (O) => z(s).setDraft(y.conversation.id, O)
|
|
2400
|
+
}, () => [
|
|
2401
|
+
Z(gt, {
|
|
2402
|
+
"model-value": y.draft,
|
|
2403
|
+
placeholder: "Write a message",
|
|
2404
|
+
"onUpdate:modelValue": (O) => z(s).setDraft(y.conversation.id, O),
|
|
2405
|
+
onSubmit: (O) => z(s).send(y.conversation.id, O)
|
|
2406
|
+
}, null, 8, ["model-value", "onUpdate:modelValue", "onSubmit"])
|
|
2407
|
+
])
|
|
2408
|
+
]),
|
|
2409
|
+
key: "0"
|
|
2410
|
+
} : void 0
|
|
2411
|
+
]), 1032, ["actions-bottom"])) : D("", !0)
|
|
2412
|
+
]),
|
|
2413
|
+
_: 2
|
|
2414
|
+
}, [
|
|
2415
|
+
a.$slots["window-title"] ? {
|
|
2416
|
+
name: "title",
|
|
2417
|
+
fn: N(() => [
|
|
2418
|
+
v(a.$slots, "window-title", {
|
|
2419
|
+
conversation: y.conversation,
|
|
2420
|
+
entry: y
|
|
2421
|
+
})
|
|
2422
|
+
]),
|
|
2423
|
+
key: "0"
|
|
2424
|
+
} : void 0,
|
|
2425
|
+
a.$slots["window-actions"] ? {
|
|
2426
|
+
name: "actions",
|
|
2427
|
+
fn: N(() => [
|
|
2428
|
+
v(a.$slots, "window-actions", {
|
|
2429
|
+
conversation: y.conversation,
|
|
2430
|
+
entry: y
|
|
2431
|
+
})
|
|
2432
|
+
]),
|
|
2433
|
+
key: "1"
|
|
2434
|
+
} : void 0,
|
|
2435
|
+
a.$slots.head ? {
|
|
2436
|
+
name: "head",
|
|
2437
|
+
fn: N(() => [
|
|
2438
|
+
v(a.$slots, "head", {
|
|
2439
|
+
conversation: y.conversation,
|
|
2440
|
+
entry: y
|
|
2441
|
+
})
|
|
2442
|
+
]),
|
|
2443
|
+
key: "2"
|
|
2444
|
+
} : void 0,
|
|
2445
|
+
a.$slots.row ? {
|
|
2446
|
+
name: "row",
|
|
2447
|
+
fn: N(() => [
|
|
2448
|
+
v(a.$slots, "row", {
|
|
2449
|
+
conversation: y.conversation,
|
|
2450
|
+
entry: y
|
|
2451
|
+
})
|
|
2452
|
+
]),
|
|
2453
|
+
key: "3"
|
|
2454
|
+
} : void 0
|
|
2455
|
+
]), 1032, ["id", "title", "unread", "state", "onUpdate:state", "onClose"]))), 128))
|
|
2456
|
+
]),
|
|
2457
|
+
_: 3
|
|
2458
|
+
}, 8, ["min-windows"]));
|
|
2459
|
+
}
|
|
2460
|
+
}), Ts = {
|
|
2461
|
+
class: "KIcon",
|
|
2462
|
+
title: "icon",
|
|
2463
|
+
role: "img"
|
|
2464
|
+
}, Is = ["href"], we = /* @__PURE__ */ P({
|
|
2465
|
+
__name: "KIcon",
|
|
2466
|
+
props: {
|
|
2467
|
+
href: { default: "" }
|
|
2468
|
+
},
|
|
2469
|
+
setup(e) {
|
|
2470
|
+
return (l, o) => (i(), u("svg", Ts, [
|
|
2471
|
+
K("use", {
|
|
2472
|
+
href: `#${e.href.replace(/^#/, "")}`
|
|
2473
|
+
}, null, 8, Is)
|
|
2474
|
+
]));
|
|
2475
|
+
}
|
|
2476
|
+
}), Es = ["data-kt-dropdown-placement"], Ls = "data-kt-dropdown-item", Ds = "is-parent", Kt = /* @__PURE__ */ P({
|
|
2477
|
+
__name: "KDropdown",
|
|
2478
|
+
props: /* @__PURE__ */ q({
|
|
2479
|
+
inline: { type: Boolean, default: !1 },
|
|
2480
|
+
menuClass: { type: [Boolean, null, String, Object, Array] },
|
|
2481
|
+
placement: { default: "bottom-start" },
|
|
2482
|
+
toggleClass: { type: [Boolean, null, String, Object, Array] }
|
|
2483
|
+
}, {
|
|
2484
|
+
open: { type: Boolean, default: !1 },
|
|
2485
|
+
openModifiers: {}
|
|
2486
|
+
}),
|
|
2487
|
+
emits: /* @__PURE__ */ q(["hidden", "shown"], ["update:open"]),
|
|
2488
|
+
setup(e, { expose: l, emit: o }) {
|
|
2489
|
+
const t = te(e, "open"), s = o, r = _("root"), { getInstance: n, toggle: d } = rt({
|
|
2490
|
+
create: (c) => new oe.modules.Dropdown(c, { placement: e.placement }),
|
|
2491
|
+
element: r,
|
|
2492
|
+
// Core's delegated toggle swept other open dropdowns closed via
|
|
2493
|
+
// `destroyAll`; the group does that across mounted KDropdowns instead.
|
|
2494
|
+
group: "dropdown",
|
|
2495
|
+
open: t,
|
|
2496
|
+
// TypeScript cannot correlate a union event name against the overloaded emit
|
|
2497
|
+
// signature. Neither event carries a payload, so this is accurate.
|
|
2498
|
+
onEvent: (c) => s(c)
|
|
2499
|
+
});
|
|
2500
|
+
function k(c) {
|
|
2501
|
+
const m = c?.closest(
|
|
2502
|
+
`[${Ls}]`
|
|
2503
|
+
);
|
|
2504
|
+
return m && n()?.getMenu()?.contains(m) ? m : null;
|
|
2505
|
+
}
|
|
2506
|
+
ve(t, "click", (c) => {
|
|
2507
|
+
k(c.target) && (t.value = !1);
|
|
2508
|
+
}), ve(t, "mouseover", (c) => {
|
|
2509
|
+
const m = k(c.target);
|
|
2510
|
+
if (!m || !m.classList.contains(Ds))
|
|
2511
|
+
return;
|
|
2512
|
+
const S = c.relatedTarget;
|
|
2513
|
+
S && m.contains(S) || n()?.showSubmenuOf(m);
|
|
2514
|
+
}), ve(t, "mouseout", (c) => {
|
|
2515
|
+
const m = k(c.target);
|
|
2516
|
+
if (!m)
|
|
2517
|
+
return;
|
|
2518
|
+
let S = c.relatedTarget;
|
|
2519
|
+
for (; S && S.parentNode && S.parentNode !== document; ) {
|
|
2520
|
+
if (S === m || S.parentNode === m)
|
|
2521
|
+
return;
|
|
2522
|
+
S = S.parentNode;
|
|
2523
|
+
}
|
|
2524
|
+
n()?.hideSubmenuOf(m);
|
|
2525
|
+
});
|
|
2526
|
+
const h = g(() => [
|
|
2527
|
+
"KDropdown",
|
|
2528
|
+
e.inline && "KDropdown--inline"
|
|
2529
|
+
]);
|
|
2530
|
+
return l({
|
|
2531
|
+
toggle: d,
|
|
2532
|
+
show: () => t.value = !0,
|
|
2533
|
+
hide: () => t.value = !1
|
|
2534
|
+
}), (c, m) => (i(), u("div", {
|
|
2535
|
+
ref_key: "root",
|
|
2536
|
+
ref: r,
|
|
2537
|
+
class: T(h.value),
|
|
2538
|
+
"data-kt-dropdown": "",
|
|
2539
|
+
"data-kt-dropdown-placement": e.placement
|
|
2540
|
+
}, [
|
|
2541
|
+
K("span", {
|
|
2542
|
+
class: T(["KDropdown-toggle", e.toggleClass]),
|
|
2543
|
+
"data-kt-dropdown-toggle": "",
|
|
2544
|
+
onClick: m[0] || (m[0] = ne(
|
|
2545
|
+
//@ts-ignore
|
|
2546
|
+
(...S) => z(d) && z(d)(...S),
|
|
2547
|
+
["stop"]
|
|
2548
|
+
))
|
|
2549
|
+
}, [
|
|
2550
|
+
v(c.$slots, "toggle", {
|
|
2551
|
+
open: t.value,
|
|
2552
|
+
toggle: z(d)
|
|
2553
|
+
})
|
|
2554
|
+
], 2),
|
|
2555
|
+
v(c.$slots, "default")
|
|
2556
|
+
], 10, Es));
|
|
2557
|
+
}
|
|
2558
|
+
}), xs = {
|
|
2559
|
+
key: 0,
|
|
2560
|
+
class: "KDropdown-text"
|
|
2561
|
+
}, wt = /* @__PURE__ */ P({
|
|
2562
|
+
__name: "KDropdownItem",
|
|
2563
|
+
props: {
|
|
2564
|
+
active: { type: Boolean, default: !1 },
|
|
2565
|
+
parent: { type: Boolean, default: !1 },
|
|
2566
|
+
text: { type: Boolean, default: !1 }
|
|
2567
|
+
},
|
|
2568
|
+
setup(e) {
|
|
2569
|
+
const l = g(() => [
|
|
2570
|
+
"KDropdown-item",
|
|
2571
|
+
e.active && "is-active",
|
|
2572
|
+
e.parent && "is-parent"
|
|
2573
|
+
]);
|
|
2574
|
+
return (o, t) => e.text ? (i(), u("div", xs, [
|
|
2575
|
+
v(o.$slots, "default")
|
|
2576
|
+
])) : (i(), u("div", {
|
|
2577
|
+
key: 1,
|
|
2578
|
+
class: T(l.value),
|
|
2579
|
+
"data-kt-dropdown-item": ""
|
|
2580
|
+
}, [
|
|
2581
|
+
v(o.$slots, "default")
|
|
2582
|
+
], 2));
|
|
2583
|
+
}
|
|
2584
|
+
}), Ms = {
|
|
2585
|
+
key: 0,
|
|
2586
|
+
class: "KDropdown-submenu",
|
|
2587
|
+
"data-kt-dropdown-submenu": ""
|
|
2588
|
+
}, Os = {
|
|
2589
|
+
key: 1,
|
|
2590
|
+
class: "KDropdown-menu",
|
|
2591
|
+
"data-kt-dropdown-menu": ""
|
|
2592
|
+
}, $t = /* @__PURE__ */ P({
|
|
2593
|
+
__name: "KDropdownMenu",
|
|
2594
|
+
props: {
|
|
2595
|
+
submenu: { type: Boolean, default: !1 }
|
|
2596
|
+
},
|
|
2597
|
+
setup(e) {
|
|
2598
|
+
return (l, o) => e.submenu ? (i(), u("div", Ms, [
|
|
2599
|
+
v(l.$slots, "default")
|
|
2600
|
+
])) : (i(), u("div", Os, [
|
|
2601
|
+
v(l.$slots, "default")
|
|
2602
|
+
]));
|
|
2603
|
+
}
|
|
2604
|
+
}), Ps = {
|
|
2605
|
+
key: 0,
|
|
2606
|
+
class: "KDropdown-divider"
|
|
2607
|
+
}, Rs = /* @__PURE__ */ P({
|
|
2608
|
+
__name: "KChatMessageActions",
|
|
2609
|
+
props: {
|
|
2610
|
+
actions: {}
|
|
2611
|
+
},
|
|
2612
|
+
emits: ["action"],
|
|
2613
|
+
setup(e, { expose: l, emit: o }) {
|
|
2614
|
+
const t = [
|
|
2615
|
+
{ key: "react", label: "React" },
|
|
2616
|
+
{ key: "reply", icon: "reply", label: "Reply" },
|
|
2617
|
+
{ key: "more", icon: "meatball", label: "More" }
|
|
2618
|
+
], s = o, r = ee(), n = ye(0), d = () => {
|
|
2619
|
+
n.value += 1;
|
|
2620
|
+
}, k = () => {
|
|
2621
|
+
n.value = Math.max(0, n.value - 1);
|
|
2622
|
+
}, h = Me(/* @__PURE__ */ new Set());
|
|
2623
|
+
le(() => {
|
|
2624
|
+
n.value = 0, h.clear();
|
|
2625
|
+
});
|
|
2626
|
+
const c = g(() => n.value > 0 || h.size > 0), m = g(() => e.actions ?? t), S = g(
|
|
2627
|
+
() => m.value.filter((B) => B.visible !== !1)
|
|
2628
|
+
), x = g(() => S.value), M = (B) => (B.items ?? []).filter((C) => C.visible !== !1), R = (B) => !!B.items?.length || B.key === "more" && !!r.more, E = (B, C) => {
|
|
2629
|
+
B.disabled || C?.disabled || s("action", B.key, C?.key);
|
|
2630
|
+
};
|
|
2631
|
+
return et(() => {
|
|
2632
|
+
if (!h.size)
|
|
2633
|
+
return;
|
|
2634
|
+
const B = new Set(
|
|
2635
|
+
r.default ? [] : x.value.filter(R).map(({ key: C }) => C)
|
|
2636
|
+
);
|
|
2637
|
+
for (const C of h)
|
|
2638
|
+
B.has(C) || h.delete(C);
|
|
2639
|
+
}), l({ hold: d, release: k }), (B, C) => (i(), u("div", {
|
|
2640
|
+
class: T(["KChat-messageActions", c.value && "is-held"])
|
|
2641
|
+
}, [
|
|
2642
|
+
v(B.$slots, "default", {
|
|
2643
|
+
hold: d,
|
|
2644
|
+
release: k
|
|
2645
|
+
}, () => [
|
|
2646
|
+
(i(!0), u(ae, null, ie(x.value, (b) => (i(), u(ae, {
|
|
2647
|
+
key: b.key
|
|
2648
|
+
}, [
|
|
2649
|
+
b.key !== "react" || B.$slots.react ? (i(), u(ae, { key: 0 }, [
|
|
2650
|
+
b.key === "react" ? v(B.$slots, "react", {
|
|
2651
|
+
key: 0,
|
|
2652
|
+
hold: d,
|
|
2653
|
+
release: k
|
|
2654
|
+
}) : R(b) ? (i(), J(Kt, {
|
|
2655
|
+
key: 1,
|
|
2656
|
+
onShown: (L) => h.add(b.key),
|
|
2657
|
+
onHidden: (L) => h.delete(b.key)
|
|
2658
|
+
}, {
|
|
2659
|
+
toggle: N(() => [
|
|
2660
|
+
Z(Ke, {
|
|
2661
|
+
"aria-label": b.label,
|
|
2662
|
+
disabled: b.disabled,
|
|
2663
|
+
title: b.label,
|
|
2664
|
+
variant: b.intent,
|
|
2665
|
+
icon: "",
|
|
2666
|
+
minimal: "",
|
|
2667
|
+
size: "sm"
|
|
2668
|
+
}, {
|
|
2669
|
+
default: N(() => [
|
|
2670
|
+
Z(we, {
|
|
2671
|
+
href: b.icon
|
|
2672
|
+
}, null, 8, ["href"])
|
|
2673
|
+
]),
|
|
2674
|
+
_: 2
|
|
2675
|
+
}, 1032, ["aria-label", "disabled", "title", "variant"])
|
|
2676
|
+
]),
|
|
2677
|
+
default: N(() => [
|
|
2678
|
+
Z($t, null, {
|
|
2679
|
+
default: N(() => [
|
|
2680
|
+
b.key === "more" && z(r).more ? v(B.$slots, "more", { key: 0 }) : (i(!0), u(ae, { key: 1 }, ie(M(b), (L, U) => (i(), u(ae, {
|
|
2681
|
+
key: L.divider ? `divider-${U}` : L.key
|
|
2682
|
+
}, [
|
|
2683
|
+
L.divider ? (i(), u("hr", Ps)) : (i(), J(wt, {
|
|
2684
|
+
key: 1,
|
|
2685
|
+
"aria-disabled": L.disabled || void 0,
|
|
2686
|
+
onClick: ($) => E(b, L)
|
|
2687
|
+
}, {
|
|
2688
|
+
default: N(() => [
|
|
2689
|
+
F(W(L.label), 1)
|
|
2690
|
+
]),
|
|
2691
|
+
_: 2
|
|
2692
|
+
}, 1032, ["aria-disabled", "onClick"]))
|
|
2693
|
+
], 64))), 128))
|
|
2694
|
+
]),
|
|
2695
|
+
_: 2
|
|
2696
|
+
}, 1024)
|
|
2697
|
+
]),
|
|
2698
|
+
_: 2
|
|
2699
|
+
}, 1032, ["onShown", "onHidden"])) : (i(), J(Ke, {
|
|
2700
|
+
key: 2,
|
|
2701
|
+
"aria-label": b.label,
|
|
2702
|
+
disabled: b.disabled,
|
|
2703
|
+
title: b.label,
|
|
2704
|
+
variant: b.intent,
|
|
2705
|
+
icon: "",
|
|
2706
|
+
minimal: "",
|
|
2707
|
+
size: "sm",
|
|
2708
|
+
onClick: (L) => E(b)
|
|
2709
|
+
}, {
|
|
2710
|
+
default: N(() => [
|
|
2711
|
+
Z(we, {
|
|
2712
|
+
href: b.icon
|
|
2713
|
+
}, null, 8, ["href"])
|
|
2714
|
+
]),
|
|
2715
|
+
_: 2
|
|
2716
|
+
}, 1032, ["aria-label", "disabled", "title", "variant", "onClick"]))
|
|
2717
|
+
], 64)) : D("", !0)
|
|
2718
|
+
], 64))), 128))
|
|
2719
|
+
])
|
|
2720
|
+
], 2));
|
|
2721
|
+
}
|
|
2722
|
+
}), zs = ["checked", "disabled", "value"], Ns = {
|
|
2723
|
+
key: 0,
|
|
2724
|
+
class: "KCheckbox-label"
|
|
2725
|
+
}, js = /* @__PURE__ */ P({
|
|
2726
|
+
inheritAttrs: !1,
|
|
2727
|
+
__name: "KCheckbox",
|
|
2728
|
+
props: /* @__PURE__ */ q({
|
|
2729
|
+
disabled: { type: Boolean, default: !1 },
|
|
2730
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
2731
|
+
label: {},
|
|
2732
|
+
value: {}
|
|
2733
|
+
}, {
|
|
2734
|
+
modelValue: { type: [Boolean, Array], default: !1 },
|
|
2735
|
+
modelModifiers: {}
|
|
2736
|
+
}),
|
|
2737
|
+
emits: ["update:modelValue"],
|
|
2738
|
+
setup(e) {
|
|
2739
|
+
const l = te(e, "modelValue"), o = ee(), t = Ie(), s = _("input"), r = g(() => Array.isArray(l.value)), n = g(
|
|
2740
|
+
() => r.value ? l.value.includes(e.value) : !!l.value
|
|
2741
|
+
), d = g(() => ["KCheckbox", e.disabled && "KCheckbox--disabled"]), k = g(() => {
|
|
2742
|
+
const { class: m, style: S, ...x } = t;
|
|
2743
|
+
return x;
|
|
2744
|
+
});
|
|
2745
|
+
function h(m) {
|
|
2746
|
+
const S = m.target.checked;
|
|
2747
|
+
if (!r.value) {
|
|
2748
|
+
l.value = S;
|
|
2749
|
+
return;
|
|
2750
|
+
}
|
|
2751
|
+
const x = l.value;
|
|
2752
|
+
l.value = S ? [...x, e.value] : x.filter((M) => M !== e.value);
|
|
2753
|
+
}
|
|
2754
|
+
function c() {
|
|
2755
|
+
s.value && (s.value.indeterminate = e.indeterminate);
|
|
2756
|
+
}
|
|
2757
|
+
return j(() => e.indeterminate, c), De(c), (m, S) => (i(), u("label", {
|
|
2758
|
+
class: T([d.value, z(t).class]),
|
|
2759
|
+
style: ce(z(t).style)
|
|
2760
|
+
}, [
|
|
2761
|
+
K("input", re({
|
|
2762
|
+
ref_key: "input",
|
|
2763
|
+
ref: s,
|
|
2764
|
+
class: "KCheckbox-input",
|
|
2765
|
+
type: "checkbox"
|
|
2766
|
+
}, k.value, {
|
|
2767
|
+
checked: n.value,
|
|
2768
|
+
disabled: e.disabled,
|
|
2769
|
+
value: e.value,
|
|
2770
|
+
onChange: h
|
|
2771
|
+
}), null, 16, zs),
|
|
2772
|
+
S[0] || (S[0] = K("span", { class: "KCheckbox-box" }, null, -1)),
|
|
2773
|
+
o.default || e.label ? (i(), u("span", Ns, [
|
|
2774
|
+
v(m.$slots, "default", {}, () => [
|
|
2775
|
+
F(W(e.label), 1)
|
|
2776
|
+
])
|
|
2777
|
+
])) : D("", !0)
|
|
2778
|
+
], 6));
|
|
2779
|
+
}
|
|
2780
|
+
}), Us = {
|
|
2781
|
+
class: "KCollapse-content",
|
|
2782
|
+
"data-kt-collapse-content": ""
|
|
2783
|
+
}, Vs = /* @__PURE__ */ P({
|
|
2784
|
+
__name: "KCollapse",
|
|
2785
|
+
props: /* @__PURE__ */ q({
|
|
2786
|
+
direction: { default: "right" },
|
|
2787
|
+
horizontal: { type: Boolean, default: !1 },
|
|
2788
|
+
tag: { default: "div" }
|
|
2789
|
+
}, {
|
|
2790
|
+
expanded: { type: Boolean, default: !1 },
|
|
2791
|
+
expandedModifiers: {}
|
|
2792
|
+
}),
|
|
2793
|
+
emits: /* @__PURE__ */ q(["collapse", "collapsed", "expand", "expanded"], ["update:expanded"]),
|
|
2794
|
+
setup(e, { expose: l, emit: o }) {
|
|
2795
|
+
const t = te(e, "expanded"), s = o, r = _("root"), { toggle: n } = ot({
|
|
2796
|
+
direction: () => e.direction,
|
|
2797
|
+
element: r,
|
|
2798
|
+
expanded: t,
|
|
2799
|
+
horizontal: () => e.horizontal,
|
|
2800
|
+
// TypeScript cannot correlate a union event name against the overloaded
|
|
2801
|
+
// emit signature. All four events take no payload, so narrowing to any one
|
|
2802
|
+
// of them is accurate about the call shape.
|
|
2803
|
+
onEvent: (d) => s(d)
|
|
2804
|
+
});
|
|
2805
|
+
return l({
|
|
2806
|
+
toggle: n,
|
|
2807
|
+
expand: () => t.value = !0,
|
|
2808
|
+
collapse: () => t.value = !1
|
|
2809
|
+
}), (d, k) => (i(), J(Ne(e.tag), {
|
|
2810
|
+
ref_key: "root",
|
|
2811
|
+
ref: r,
|
|
2812
|
+
class: "KCollapse",
|
|
2813
|
+
"data-kt-collapse": "",
|
|
2814
|
+
"data-kt-collapse-horizontal": e.horizontal ? e.direction === "left" ? "left" : "true" : void 0
|
|
2815
|
+
}, {
|
|
2816
|
+
default: N(() => [
|
|
2817
|
+
v(d.$slots, "toggle", {
|
|
2818
|
+
toggle: z(n),
|
|
2819
|
+
expanded: t.value
|
|
2820
|
+
}),
|
|
2821
|
+
K("div", Us, [
|
|
2822
|
+
v(d.$slots, "default")
|
|
2823
|
+
])
|
|
2824
|
+
]),
|
|
2825
|
+
_: 3
|
|
2826
|
+
}, 8, ["data-kt-collapse-horizontal"]));
|
|
2827
|
+
}
|
|
2828
|
+
}), Ws = /* @__PURE__ */ P({
|
|
2829
|
+
__name: "KContainer",
|
|
2830
|
+
props: {
|
|
2831
|
+
glassy: { type: Boolean }
|
|
2832
|
+
},
|
|
2833
|
+
setup(e) {
|
|
2834
|
+
return (l, o) => (i(), u("div", {
|
|
2835
|
+
class: T(["KContainer", e.glassy && "KContainer--glassy"])
|
|
2836
|
+
}, [
|
|
2837
|
+
v(l.$slots, "default")
|
|
2838
|
+
], 2));
|
|
2839
|
+
}
|
|
2840
|
+
}), pe = /* @__PURE__ */ new Map();
|
|
2841
|
+
function Ct(e, l, o = () => 0) {
|
|
2842
|
+
const t = /* @__PURE__ */ Symbol("overlay");
|
|
2843
|
+
function s() {
|
|
2844
|
+
let n = pe.get(e);
|
|
2845
|
+
return n || (n = [], pe.set(e, n)), n;
|
|
2846
|
+
}
|
|
2847
|
+
function r() {
|
|
2848
|
+
const n = pe.get(e);
|
|
2849
|
+
if (!n)
|
|
2850
|
+
return;
|
|
2851
|
+
const d = n.findIndex((k) => k.id === t);
|
|
2852
|
+
d !== -1 && n.splice(d, 1), n.length || pe.delete(e);
|
|
2853
|
+
}
|
|
2854
|
+
return j(
|
|
2855
|
+
l,
|
|
2856
|
+
(n) => {
|
|
2857
|
+
r(), n && s().push({ id: t, priority: o() });
|
|
2858
|
+
},
|
|
2859
|
+
{ flush: "post", immediate: !0 }
|
|
2860
|
+
), le(r), () => {
|
|
2861
|
+
const n = pe.get(e);
|
|
2862
|
+
return n?.length ? n.reduce(
|
|
2863
|
+
(k, h) => h.priority >= k.priority ? h : k
|
|
2864
|
+
).id === t : !1;
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
const Gs = ["data-kt-drawer-id", "data-kt-drawer-static-backdrop"], Hs = ["aria-labelledby"], Fs = ["id"], qs = "data-kt-drawer-dismiss", Qs = "data-kt-drawer-panel", Zs = "data-kt-drawer-toggle", Js = /* @__PURE__ */ P({
|
|
2868
|
+
__name: "KDrawer",
|
|
2869
|
+
props: /* @__PURE__ */ q({
|
|
2870
|
+
bodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
2871
|
+
closable: { type: Boolean, default: !0 },
|
|
2872
|
+
contained: { type: Boolean, default: !1 },
|
|
2873
|
+
edge: { default: "right" },
|
|
2874
|
+
focus: { type: Boolean, default: !0 },
|
|
2875
|
+
footerClass: { type: [Boolean, null, String, Object, Array] },
|
|
2876
|
+
headerClass: { type: [Boolean, null, String, Object, Array] },
|
|
2877
|
+
id: {},
|
|
2878
|
+
keyboard: { type: Boolean, default: !0 },
|
|
2879
|
+
noBackdrop: { type: Boolean, default: !1 },
|
|
2880
|
+
panelClass: { type: [Boolean, null, String, Object, Array] },
|
|
2881
|
+
size: {},
|
|
2882
|
+
staticBackdrop: { type: Boolean, default: !1 },
|
|
2883
|
+
teleport: { type: Boolean, default: () => {
|
|
2884
|
+
} },
|
|
2885
|
+
title: {}
|
|
2886
|
+
}, {
|
|
2887
|
+
open: { type: Boolean, default: !1 },
|
|
2888
|
+
openModifiers: {}
|
|
2889
|
+
}),
|
|
2890
|
+
emits: /* @__PURE__ */ q(["hide", "hidden", "show", "shown"], ["update:open"]),
|
|
2891
|
+
setup(e, { expose: l, emit: o }) {
|
|
2892
|
+
const t = te(e, "open"), s = o, r = ee(), n = _("root");
|
|
2893
|
+
let d, k = !1;
|
|
2894
|
+
const h = Te(), c = g(() => e.id ?? h), m = g(() => `${c.value}-title`), S = g(() => e.teleport ?? !e.contained), x = g(() => !!(e.title || r.title)), M = g(() => !!(r.header || x.value || e.closable)), R = g(() => [
|
|
2895
|
+
"KDrawer",
|
|
2896
|
+
e.edge === "left" && "KDrawer--left",
|
|
2897
|
+
// `md` is the default and has no modifier of its own.
|
|
2898
|
+
e.size && e.size !== "md" && `KDrawer--${e.size}`,
|
|
2899
|
+
e.contained && "KDrawer--contained",
|
|
2900
|
+
e.noBackdrop && "KDrawer--noBackdrop"
|
|
2901
|
+
]);
|
|
2902
|
+
function E() {
|
|
2903
|
+
return !d && n.value && (d = new oe.modules.Drawer(n.value, {
|
|
2904
|
+
focus: e.focus,
|
|
2905
|
+
keyboard: e.keyboard,
|
|
2906
|
+
staticBackdrop: e.staticBackdrop
|
|
2907
|
+
})), d;
|
|
2908
|
+
}
|
|
2909
|
+
j(
|
|
2910
|
+
() => [e.focus, e.keyboard, e.staticBackdrop],
|
|
2911
|
+
() => {
|
|
2912
|
+
d = void 0;
|
|
2913
|
+
}
|
|
2914
|
+
), j(
|
|
2915
|
+
t,
|
|
2916
|
+
($) => {
|
|
2917
|
+
if ($ === k)
|
|
2918
|
+
return;
|
|
2919
|
+
const w = E();
|
|
2920
|
+
w && (k = $, $ ? w.show() : w.hide());
|
|
2921
|
+
},
|
|
2922
|
+
{ flush: "post" }
|
|
2923
|
+
);
|
|
2924
|
+
const B = ($) => $.target === n.value, C = {
|
|
2925
|
+
"kt.drawer.show": ($) => {
|
|
2926
|
+
B($) && (k = !0, t.value = !0, s("show"));
|
|
2927
|
+
},
|
|
2928
|
+
"kt.drawer.shown": ($) => {
|
|
2929
|
+
B($) && s("shown");
|
|
2930
|
+
},
|
|
2931
|
+
"kt.drawer.hide": ($) => {
|
|
2932
|
+
B($) && (k = !1, t.value = !1, s("hide"));
|
|
2933
|
+
},
|
|
2934
|
+
"kt.drawer.hidden": ($) => {
|
|
2935
|
+
B($) && s("hidden");
|
|
2936
|
+
}
|
|
2937
|
+
};
|
|
2938
|
+
j(
|
|
2939
|
+
n,
|
|
2940
|
+
($, w, G) => {
|
|
2941
|
+
if (d = void 0, !!$) {
|
|
2942
|
+
for (const [Q, p] of Object.entries(C))
|
|
2943
|
+
$.addEventListener(Q, p);
|
|
2944
|
+
$.setAttribute("aria-hidden", "true"), t.value && E()?.show(), G(() => {
|
|
2945
|
+
for (const [Q, p] of Object.entries(C))
|
|
2946
|
+
$.removeEventListener(Q, p);
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
{ flush: "post", immediate: !0 }
|
|
2951
|
+
);
|
|
2952
|
+
const b = Ct("drawer", t, () => e.noBackdrop ? 0 : 1);
|
|
2953
|
+
ve(
|
|
2954
|
+
t,
|
|
2955
|
+
"keydown",
|
|
2956
|
+
($) => {
|
|
2957
|
+
$.key !== "Escape" || !b() || ($.stopPropagation(), e.keyboard && U());
|
|
2958
|
+
},
|
|
2959
|
+
{ capture: !0 }
|
|
2960
|
+
);
|
|
2961
|
+
function L($) {
|
|
2962
|
+
const w = $.target;
|
|
2963
|
+
if (!w)
|
|
2964
|
+
return;
|
|
2965
|
+
if (w.closest(`[${qs}]`)) {
|
|
2966
|
+
$.stopPropagation(), U();
|
|
2967
|
+
return;
|
|
2968
|
+
}
|
|
2969
|
+
if (e.staticBackdrop || w.closest(`[${Zs}]`))
|
|
2970
|
+
return;
|
|
2971
|
+
const G = n.value?.querySelector(`[${Qs}]`);
|
|
2972
|
+
G && !G.contains(w) && ($.stopPropagation(), U());
|
|
2973
|
+
}
|
|
2974
|
+
le(() => {
|
|
2975
|
+
n.value?.classList.contains("is-active") && document.body.classList.remove("is-drawer-active");
|
|
2976
|
+
});
|
|
2977
|
+
function U() {
|
|
2978
|
+
t.value = !1;
|
|
2979
|
+
}
|
|
2980
|
+
return l({
|
|
2981
|
+
show: () => t.value = !0,
|
|
2982
|
+
hide: U,
|
|
2983
|
+
toggle: () => t.value = !t.value
|
|
2984
|
+
}), ($, w) => (i(), J(Be, {
|
|
2985
|
+
to: "body",
|
|
2986
|
+
disabled: !S.value
|
|
2987
|
+
}, [
|
|
2988
|
+
K("div", {
|
|
2989
|
+
ref_key: "root",
|
|
2990
|
+
ref: n,
|
|
2991
|
+
class: T(R.value),
|
|
2992
|
+
"data-kt-drawer-id": c.value,
|
|
2993
|
+
"data-kt-drawer-static-backdrop": e.staticBackdrop ? "true" : "false",
|
|
2994
|
+
"data-kt-drawer": "",
|
|
2995
|
+
tabindex: "-1",
|
|
2996
|
+
onClick: L
|
|
2997
|
+
}, [
|
|
2998
|
+
K("div", {
|
|
2999
|
+
class: T(["KDrawer-panel", e.panelClass]),
|
|
3000
|
+
"aria-labelledby": x.value ? m.value : void 0,
|
|
3001
|
+
"data-kt-drawer-panel": "",
|
|
3002
|
+
role: "dialog"
|
|
3003
|
+
}, [
|
|
3004
|
+
M.value ? (i(), u("div", {
|
|
3005
|
+
key: 0,
|
|
3006
|
+
class: T(["KDrawer-header", e.headerClass])
|
|
3007
|
+
}, [
|
|
3008
|
+
v($.$slots, "header", {}, () => [
|
|
3009
|
+
x.value ? (i(), u("h5", {
|
|
3010
|
+
key: 0,
|
|
3011
|
+
id: m.value,
|
|
3012
|
+
class: "KDrawer-title"
|
|
3013
|
+
}, [
|
|
3014
|
+
v($.$slots, "title", {}, () => [
|
|
3015
|
+
F(W(e.title), 1)
|
|
3016
|
+
])
|
|
3017
|
+
], 8, Fs)) : D("", !0),
|
|
3018
|
+
e.closable ? (i(), u("button", {
|
|
3019
|
+
key: 1,
|
|
3020
|
+
class: "KDrawer-close",
|
|
3021
|
+
type: "button",
|
|
3022
|
+
"aria-label": "Close",
|
|
3023
|
+
onClick: ne(U, ["stop"])
|
|
3024
|
+
}, [
|
|
3025
|
+
v($.$slots, "close", {}, () => [
|
|
3026
|
+
w[0] || (w[0] = F("✕", -1))
|
|
3027
|
+
])
|
|
3028
|
+
])) : D("", !0)
|
|
3029
|
+
])
|
|
3030
|
+
], 2)) : D("", !0),
|
|
3031
|
+
K("div", {
|
|
3032
|
+
class: T(["KDrawer-body", e.bodyClass])
|
|
3033
|
+
}, [
|
|
3034
|
+
v($.$slots, "default")
|
|
3035
|
+
], 2),
|
|
3036
|
+
r.footer ? (i(), u("div", {
|
|
3037
|
+
key: 1,
|
|
3038
|
+
class: T(["KDrawer-footer", e.footerClass])
|
|
3039
|
+
}, [
|
|
3040
|
+
v($.$slots, "footer")
|
|
3041
|
+
], 2)) : D("", !0)
|
|
3042
|
+
], 10, Hs)
|
|
3043
|
+
], 10, Gs)
|
|
3044
|
+
], 8, ["disabled"]));
|
|
3045
|
+
}
|
|
3046
|
+
}), Ys = {
|
|
3047
|
+
class: "KFileTree-node",
|
|
3048
|
+
role: "none",
|
|
3049
|
+
"data-kt-file-tree-node": ""
|
|
3050
|
+
}, Xs = ["data-kftree-id", "tabindex", "aria-expanded", "data-kt-file-tree-lazy"], _s = {
|
|
3051
|
+
class: "KFileTree-caret",
|
|
3052
|
+
"data-kt-file-tree-caret": "",
|
|
3053
|
+
"aria-hidden": "true"
|
|
3054
|
+
}, eo = {
|
|
3055
|
+
key: 0,
|
|
3056
|
+
class: "KIcon",
|
|
3057
|
+
"aria-hidden": "true"
|
|
3058
|
+
}, to = ["href"], ao = {
|
|
3059
|
+
class: "KFileTree-icon",
|
|
3060
|
+
"aria-hidden": "true"
|
|
3061
|
+
}, so = {
|
|
3062
|
+
key: 0,
|
|
3063
|
+
class: "KIcon",
|
|
3064
|
+
"aria-hidden": "true"
|
|
3065
|
+
}, oo = ["href"], lo = { class: "KFileTree-label" }, no = {
|
|
3066
|
+
key: 0,
|
|
3067
|
+
class: "KFileTree-group",
|
|
3068
|
+
role: "group",
|
|
3069
|
+
"data-kt-file-tree-group": ""
|
|
3070
|
+
}, io = /* @__PURE__ */ P({
|
|
3071
|
+
__name: "KFileTreeNode",
|
|
3072
|
+
props: {
|
|
3073
|
+
caretIcon: { default: "#caretRight" },
|
|
3074
|
+
node: {},
|
|
3075
|
+
tabbable: { type: Boolean, default: !1 }
|
|
3076
|
+
},
|
|
3077
|
+
setup(e) {
|
|
3078
|
+
const l = ee(), o = g(() => e.node.id ?? e.node.label), t = g(() => Array.isArray(e.node.children) || !!e.node.lazy);
|
|
3079
|
+
return (s, r) => {
|
|
3080
|
+
const n = tt("KFileTreeNode", !0);
|
|
3081
|
+
return i(), u("li", Ys, [
|
|
3082
|
+
K("a", {
|
|
3083
|
+
class: "KFileTree-row",
|
|
3084
|
+
role: "treeitem",
|
|
3085
|
+
href: "#",
|
|
3086
|
+
"data-kftree-id": o.value,
|
|
3087
|
+
tabindex: e.tabbable ? 0 : -1,
|
|
3088
|
+
"aria-expanded": t.value ? e.node.expanded === !0 : void 0,
|
|
3089
|
+
"data-kt-file-tree-row": "",
|
|
3090
|
+
"data-kt-file-tree-lazy": e.node.lazy ? "" : void 0
|
|
3091
|
+
}, [
|
|
3092
|
+
K("span", _s, [
|
|
3093
|
+
t.value ? (i(), u("svg", eo, [
|
|
3094
|
+
K("use", { href: e.caretIcon }, null, 8, to)
|
|
3095
|
+
])) : D("", !0)
|
|
3096
|
+
]),
|
|
3097
|
+
v(s.$slots, "label", { node: e.node }, () => [
|
|
3098
|
+
K("span", ao, [
|
|
3099
|
+
e.node.icon ? (i(), u("svg", so, [
|
|
3100
|
+
K("use", {
|
|
3101
|
+
href: e.node.icon
|
|
3102
|
+
}, null, 8, oo)
|
|
3103
|
+
])) : D("", !0)
|
|
3104
|
+
]),
|
|
3105
|
+
K("span", lo, W(e.node.label), 1)
|
|
3106
|
+
])
|
|
3107
|
+
], 8, Xs),
|
|
3108
|
+
e.node.children ? (i(), u("ul", no, [
|
|
3109
|
+
(i(!0), u(ae, null, ie(e.node.children, (d, k) => (i(), J(n, {
|
|
3110
|
+
key: d.id ?? `${d.label}-${k}`,
|
|
3111
|
+
"caret-icon": e.caretIcon,
|
|
3112
|
+
node: d
|
|
3113
|
+
}, ge({ _: 2 }, [
|
|
3114
|
+
l.label ? {
|
|
3115
|
+
name: "label",
|
|
3116
|
+
fn: N((h) => [
|
|
3117
|
+
v(s.$slots, "label", re({ ref_for: !0 }, h))
|
|
3118
|
+
]),
|
|
3119
|
+
key: "0"
|
|
3120
|
+
} : void 0
|
|
3121
|
+
]), 1032, ["caret-icon", "node"]))), 128))
|
|
3122
|
+
])) : D("", !0)
|
|
3123
|
+
]);
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
}), ro = ["data-kt-file-tree-activation"], me = "data-kftree-id", co = "data-kt-file-tree-row", uo = /* @__PURE__ */ P({
|
|
3127
|
+
__name: "KFileTree",
|
|
3128
|
+
props: /* @__PURE__ */ q({
|
|
3129
|
+
activation: { default: "row" },
|
|
3130
|
+
caretIcon: { default: "#caretRight" },
|
|
3131
|
+
nodes: { default: () => [] }
|
|
3132
|
+
}, {
|
|
3133
|
+
selected: { default: null },
|
|
3134
|
+
selectedModifiers: {},
|
|
3135
|
+
expanded: { default: () => [] },
|
|
3136
|
+
expandedModifiers: {}
|
|
3137
|
+
}),
|
|
3138
|
+
emits: /* @__PURE__ */ q(["collapse", "expand", "load", "select"], ["update:selected", "update:expanded"]),
|
|
3139
|
+
setup(e, { expose: l, emit: o }) {
|
|
3140
|
+
const t = te(e, "selected"), s = te(e, "expanded"), r = o, n = ee(), d = _("root");
|
|
3141
|
+
let k, h = null, c = /* @__PURE__ */ new Set();
|
|
3142
|
+
function m() {
|
|
3143
|
+
return !k && d.value && (k = new oe.modules.FileTree(d.value, { activation: e.activation })), k;
|
|
3144
|
+
}
|
|
3145
|
+
function S($) {
|
|
3146
|
+
return !$ || $.closest("[data-kt-file-tree]") !== d.value ? null : $.getAttribute(me);
|
|
3147
|
+
}
|
|
3148
|
+
function x($) {
|
|
3149
|
+
return d.value?.querySelector(`[${me}="${CSS.escape($)}"]`) ?? null;
|
|
3150
|
+
}
|
|
3151
|
+
function M($) {
|
|
3152
|
+
const w = S($.target.closest(`[${me}]`));
|
|
3153
|
+
w && (h = w, t.value = w, r("select", w));
|
|
3154
|
+
}
|
|
3155
|
+
function R($) {
|
|
3156
|
+
const w = S($.target.closest(`[${me}]`));
|
|
3157
|
+
!w || c.has(w) || (c.add(w), s.value = [...s.value, w], r("expand", w));
|
|
3158
|
+
}
|
|
3159
|
+
function E($) {
|
|
3160
|
+
const w = S($.target.closest(`[${me}]`));
|
|
3161
|
+
!w || !c.has(w) || (c.delete(w), s.value = s.value.filter((G) => G !== w), r("collapse", w));
|
|
3162
|
+
}
|
|
3163
|
+
function B($) {
|
|
3164
|
+
const w = S($.target.closest(`[${me}]`));
|
|
3165
|
+
w && r("load", w);
|
|
3166
|
+
}
|
|
3167
|
+
function C($) {
|
|
3168
|
+
const w = $?.closest(`[${co}]`);
|
|
3169
|
+
return w && w.closest("[data-kt-file-tree]") === d.value ? w : null;
|
|
3170
|
+
}
|
|
3171
|
+
function b($) {
|
|
3172
|
+
const w = C($.target);
|
|
3173
|
+
w && ($.stopPropagation(), m()?.handleRowClick(w, $.target) && $.preventDefault());
|
|
3174
|
+
}
|
|
3175
|
+
function L($) {
|
|
3176
|
+
const w = C($.target);
|
|
3177
|
+
w && ($.stopPropagation(), m()?.handleRowKeydown(w, $) && $.preventDefault());
|
|
3178
|
+
}
|
|
3179
|
+
const U = [
|
|
3180
|
+
["kt.filetree.select", M],
|
|
3181
|
+
["kt.filetree.expand", R],
|
|
3182
|
+
["kt.filetree.collapse", E],
|
|
3183
|
+
["kt.filetree.load", B]
|
|
3184
|
+
];
|
|
3185
|
+
return j(
|
|
3186
|
+
d,
|
|
3187
|
+
($, w, G) => {
|
|
3188
|
+
if (k = void 0, !$)
|
|
3189
|
+
return;
|
|
3190
|
+
for (const [p, a] of U)
|
|
3191
|
+
$.addEventListener(p, a);
|
|
3192
|
+
const Q = m();
|
|
3193
|
+
c = new Set(s.value);
|
|
3194
|
+
for (const p of s.value) {
|
|
3195
|
+
const a = x(p);
|
|
3196
|
+
a && !Q?.isExpanded(a) && Q?.expand(a);
|
|
3197
|
+
}
|
|
3198
|
+
if (t.value) {
|
|
3199
|
+
const p = x(t.value);
|
|
3200
|
+
p && (h = t.value, Q?.select(p));
|
|
3201
|
+
}
|
|
3202
|
+
G(() => {
|
|
3203
|
+
for (const [p, a] of U)
|
|
3204
|
+
$.removeEventListener(p, a);
|
|
3205
|
+
});
|
|
3206
|
+
},
|
|
3207
|
+
{ flush: "post", immediate: !0 }
|
|
3208
|
+
), j(t, ($) => {
|
|
3209
|
+
if ($ !== h && (h = $, $)) {
|
|
3210
|
+
const w = x($);
|
|
3211
|
+
w && m()?.select(w);
|
|
3212
|
+
}
|
|
3213
|
+
}), j(
|
|
3214
|
+
s,
|
|
3215
|
+
($) => {
|
|
3216
|
+
const w = new Set($), G = m();
|
|
3217
|
+
if (G) {
|
|
3218
|
+
for (const Q of w)
|
|
3219
|
+
if (!c.has(Q)) {
|
|
3220
|
+
const p = x(Q);
|
|
3221
|
+
p && G.expand(p);
|
|
3222
|
+
}
|
|
3223
|
+
for (const Q of c)
|
|
3224
|
+
if (!w.has(Q)) {
|
|
3225
|
+
const p = x(Q);
|
|
3226
|
+
p && G.collapse(p);
|
|
3227
|
+
}
|
|
3228
|
+
c = w;
|
|
3229
|
+
}
|
|
3230
|
+
},
|
|
3231
|
+
{ deep: !0 }
|
|
3232
|
+
), le(() => {
|
|
3233
|
+
k = void 0;
|
|
3234
|
+
}), l({
|
|
3235
|
+
collapseAll: () => m()?.collapseAll(),
|
|
3236
|
+
expandAll: () => m()?.expandAll()
|
|
3237
|
+
}), ($, w) => (i(), u("ul", {
|
|
3238
|
+
ref_key: "root",
|
|
3239
|
+
ref: d,
|
|
3240
|
+
class: "KFileTree",
|
|
3241
|
+
role: "tree",
|
|
3242
|
+
"data-kt-file-tree": "",
|
|
3243
|
+
"data-kt-file-tree-activation": e.activation,
|
|
3244
|
+
onClick: b,
|
|
3245
|
+
onKeydown: L
|
|
3246
|
+
}, [
|
|
3247
|
+
(i(!0), u(ae, null, ie(e.nodes, (G, Q) => (i(), J(io, {
|
|
3248
|
+
key: G.id ?? `${G.label}-${Q}`,
|
|
3249
|
+
"caret-icon": e.caretIcon,
|
|
3250
|
+
node: G,
|
|
3251
|
+
tabbable: Q === 0
|
|
3252
|
+
}, ge({ _: 2 }, [
|
|
3253
|
+
n.label ? {
|
|
3254
|
+
name: "label",
|
|
3255
|
+
fn: N((p) => [
|
|
3256
|
+
v($.$slots, "label", re({ ref_for: !0 }, p))
|
|
3257
|
+
]),
|
|
3258
|
+
key: "0"
|
|
3259
|
+
} : void 0
|
|
3260
|
+
]), 1032, ["caret-icon", "node", "tabbable"]))), 128))
|
|
3261
|
+
], 40, ro));
|
|
3262
|
+
}
|
|
3263
|
+
});
|
|
3264
|
+
function Ye(e, l) {
|
|
3265
|
+
return l === void 0 ? [] : typeof l == "number" ? [`is-${e}-${l}`] : Object.entries(l).map(
|
|
3266
|
+
([o, t]) => o === "base" ? `is-${e}-${t}` : `is-${e}-${o}-${t}`
|
|
3267
|
+
);
|
|
3268
|
+
}
|
|
3269
|
+
function pt(e, l, o) {
|
|
3270
|
+
return [
|
|
3271
|
+
e !== void 0 && `is-gap-${e}`,
|
|
3272
|
+
l !== void 0 && `is-row-gap-${l}`,
|
|
3273
|
+
o !== void 0 && `is-col-gap-${o}`
|
|
3274
|
+
];
|
|
3275
|
+
}
|
|
3276
|
+
const fo = 12, vo = /* @__PURE__ */ P({
|
|
3277
|
+
__name: "KGrid",
|
|
8
3278
|
props: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: { default: "button" },
|
|
17
|
-
variant: {}
|
|
3279
|
+
gap: {},
|
|
3280
|
+
colGap: {},
|
|
3281
|
+
rowGap: {},
|
|
3282
|
+
align: {},
|
|
3283
|
+
cols: {},
|
|
3284
|
+
justify: {},
|
|
3285
|
+
rows: {}
|
|
18
3286
|
},
|
|
19
3287
|
setup(e) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3288
|
+
const l = g(
|
|
3289
|
+
() => e.cols !== void 0 && e.cols >= 1 && e.cols <= fo
|
|
3290
|
+
), o = g(() => [
|
|
3291
|
+
"KGrid",
|
|
3292
|
+
l.value && `is-cols-${e.cols}`,
|
|
3293
|
+
...pt(e.gap, e.rowGap, e.colGap),
|
|
3294
|
+
e.align && `is-align-${e.align}`,
|
|
3295
|
+
e.justify && `is-justify-${e.justify}`
|
|
3296
|
+
]), t = g(() => {
|
|
3297
|
+
const s = {};
|
|
3298
|
+
return e.cols !== void 0 && !l.value && (s["--kt-grid-columns"] = String(Math.max(1, Math.floor(e.cols)))), e.rows !== void 0 && (s["--kt-grid-rows"] = String(e.rows)), Object.keys(s).length ? s : void 0;
|
|
3299
|
+
});
|
|
3300
|
+
return (s, r) => (i(), u("div", {
|
|
3301
|
+
class: T(o.value),
|
|
3302
|
+
style: ce(t.value)
|
|
3303
|
+
}, [
|
|
3304
|
+
v(s.$slots, "default")
|
|
3305
|
+
], 6));
|
|
3306
|
+
}
|
|
3307
|
+
}), ho = /* @__PURE__ */ P({
|
|
3308
|
+
__name: "KGridColumn",
|
|
3309
|
+
props: {
|
|
3310
|
+
alignSelf: {},
|
|
3311
|
+
justifySelf: {},
|
|
3312
|
+
row: {},
|
|
3313
|
+
start: {},
|
|
3314
|
+
span: {}
|
|
3315
|
+
},
|
|
3316
|
+
setup(e) {
|
|
3317
|
+
const l = g(() => [
|
|
3318
|
+
"KGrid-column",
|
|
3319
|
+
...Ye("column", e.span),
|
|
3320
|
+
...Ye("start", e.start),
|
|
3321
|
+
e.row !== void 0 && `is-row-${e.row}`,
|
|
3322
|
+
e.alignSelf && `is-align-self-${e.alignSelf}`,
|
|
3323
|
+
e.justifySelf && `is-justify-self-${e.justifySelf}`
|
|
34
3324
|
]);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
type: d.value === "button" ? e.type : void 0,
|
|
41
|
-
disabled: d.value === "button" ? e.disabled : void 0,
|
|
42
|
-
class: l(i.value),
|
|
43
|
-
onClick: t
|
|
44
|
-
}, {
|
|
45
|
-
default: h(() => [
|
|
46
|
-
u(v.$slots, "default")
|
|
47
|
-
]),
|
|
48
|
-
_: 3
|
|
49
|
-
}, 8, ["href", "type", "disabled", "class"]));
|
|
3325
|
+
return (o, t) => (i(), u("div", {
|
|
3326
|
+
class: T(l.value)
|
|
3327
|
+
}, [
|
|
3328
|
+
v(o.$slots, "default")
|
|
3329
|
+
], 2));
|
|
50
3330
|
}
|
|
51
|
-
}),
|
|
52
|
-
__name: "
|
|
3331
|
+
}), mo = /* @__PURE__ */ P({
|
|
3332
|
+
__name: "KGridRow",
|
|
53
3333
|
props: {
|
|
54
|
-
|
|
3334
|
+
gap: {},
|
|
3335
|
+
colGap: {},
|
|
3336
|
+
rowGap: {}
|
|
55
3337
|
},
|
|
56
3338
|
setup(e) {
|
|
57
|
-
|
|
58
|
-
|
|
3339
|
+
const l = g(() => [
|
|
3340
|
+
"KGrid-row",
|
|
3341
|
+
...pt(e.gap, e.rowGap, e.colGap)
|
|
3342
|
+
]);
|
|
3343
|
+
return (o, t) => (i(), u("div", {
|
|
3344
|
+
class: T(l.value)
|
|
59
3345
|
}, [
|
|
60
|
-
|
|
3346
|
+
v(o.$slots, "default")
|
|
61
3347
|
], 2));
|
|
62
3348
|
}
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
__name: "KIcon",
|
|
3349
|
+
}), bo = ["aria-label"], go = { class: "KMenuList" }, yo = {
|
|
3350
|
+
key: 1,
|
|
3351
|
+
class: "KMenuList"
|
|
3352
|
+
}, ko = /* @__PURE__ */ P({
|
|
3353
|
+
__name: "KMenuList",
|
|
69
3354
|
props: {
|
|
70
|
-
|
|
3355
|
+
ariaLabel: {}
|
|
71
3356
|
},
|
|
72
3357
|
setup(e) {
|
|
73
|
-
return (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
3358
|
+
return (l, o) => e.ariaLabel ? (i(), u("nav", {
|
|
3359
|
+
key: 0,
|
|
3360
|
+
"aria-label": e.ariaLabel
|
|
3361
|
+
}, [
|
|
3362
|
+
K("ul", go, [
|
|
3363
|
+
v(l.$slots, "default")
|
|
3364
|
+
])
|
|
3365
|
+
], 8, bo)) : (i(), u("ul", yo, [
|
|
3366
|
+
v(l.$slots, "default")
|
|
77
3367
|
]));
|
|
78
3368
|
}
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class: "KInput-addon"
|
|
85
|
-
}, Q = /* @__PURE__ */ K({
|
|
86
|
-
__name: "KInput",
|
|
87
|
-
props: /* @__PURE__ */ B({
|
|
3369
|
+
}), Ko = { class: "KMenuList-item" }, wo = /* @__PURE__ */ P({
|
|
3370
|
+
__name: "KMenuListItem",
|
|
3371
|
+
props: {
|
|
3372
|
+
active: { type: Boolean, default: () => {
|
|
3373
|
+
} },
|
|
88
3374
|
disabled: { type: Boolean, default: !1 },
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
sunken: { type: Boolean, default: !1 },
|
|
93
|
-
transparent: { type: Boolean, default: !1 },
|
|
94
|
-
type: { default: "text" }
|
|
95
|
-
}, {
|
|
96
|
-
modelValue: {},
|
|
97
|
-
modelModifiers: {}
|
|
98
|
-
}),
|
|
99
|
-
emits: ["update:modelValue"],
|
|
3375
|
+
href: {},
|
|
3376
|
+
to: {}
|
|
3377
|
+
},
|
|
100
3378
|
setup(e) {
|
|
101
|
-
const
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
e.
|
|
106
|
-
e.sunken && "KInput--sunken",
|
|
107
|
-
e.transparent && "KInput--transparent"
|
|
3379
|
+
const l = je({ to: g(() => e.to ?? "/") }), o = g(() => e.to || e.href ? "a" : "button"), t = g(() => e.to ? l.href.value : e.href), s = g(() => e.active ?? (e.to ? l.isActive.value : !1)), r = g(() => [
|
|
3380
|
+
"KMenuList-link",
|
|
3381
|
+
s.value && "is-active",
|
|
3382
|
+
// A button carries the native attribute, which core styles on its own.
|
|
3383
|
+
e.disabled && o.value === "a" && "is-disabled"
|
|
108
3384
|
]);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
3385
|
+
function n(d) {
|
|
3386
|
+
if (e.disabled) {
|
|
3387
|
+
d.preventDefault();
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3390
|
+
e.to && (d.preventDefault(), l.navigate(d));
|
|
3391
|
+
}
|
|
3392
|
+
return (d, k) => (i(), u("li", Ko, [
|
|
3393
|
+
(i(), J(Ne(o.value), {
|
|
3394
|
+
class: T(r.value),
|
|
3395
|
+
href: o.value === "a" ? t.value : void 0,
|
|
3396
|
+
type: o.value === "button" ? "button" : void 0,
|
|
3397
|
+
disabled: o.value === "button" ? e.disabled : void 0,
|
|
3398
|
+
"aria-disabled": o.value === "a" && e.disabled ? "true" : void 0,
|
|
3399
|
+
"aria-current": s.value ? "page" : void 0,
|
|
3400
|
+
onClick: n
|
|
3401
|
+
}, {
|
|
3402
|
+
default: N(() => [
|
|
3403
|
+
v(d.$slots, "default")
|
|
3404
|
+
]),
|
|
3405
|
+
_: 3
|
|
3406
|
+
}, 8, ["class", "href", "type", "disabled", "aria-disabled", "aria-current"]))
|
|
3407
|
+
]));
|
|
127
3408
|
}
|
|
128
|
-
}),
|
|
129
|
-
__name: "
|
|
130
|
-
props: {
|
|
131
|
-
|
|
3409
|
+
}), $o = ["data-kt-modal-id", "data-kt-modal-static-backdrop"], Co = ["aria-label", "aria-labelledby"], po = ["id"], Bo = "data-kt-modal-dismiss", So = "data-kt-modal-dialog", Ao = /* @__PURE__ */ P({
|
|
3410
|
+
__name: "KModal",
|
|
3411
|
+
props: /* @__PURE__ */ q({
|
|
3412
|
+
bodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
3413
|
+
centered: { type: Boolean, default: !1 },
|
|
3414
|
+
closable: { type: Boolean, default: !0 },
|
|
3415
|
+
containerClass: { type: [Boolean, null, String, Object, Array] },
|
|
3416
|
+
dialogClass: { type: [Boolean, null, String, Object, Array] },
|
|
3417
|
+
dialogLabel: {},
|
|
3418
|
+
focus: { type: Boolean, default: !0 },
|
|
3419
|
+
footerClass: { type: [Boolean, null, String, Object, Array] },
|
|
3420
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
3421
|
+
headerClass: { type: [Boolean, null, String, Object, Array] },
|
|
3422
|
+
id: {},
|
|
3423
|
+
keyboard: { type: Boolean, default: !0 },
|
|
3424
|
+
mainClass: { type: [Boolean, null, String, Object, Array] },
|
|
3425
|
+
scrollable: { type: Boolean, default: !1 },
|
|
3426
|
+
sidebarClass: { type: [Boolean, null, String, Object, Array] },
|
|
132
3427
|
size: {},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
3428
|
+
staticBackdrop: { type: Boolean, default: !1 },
|
|
3429
|
+
title: {},
|
|
3430
|
+
teleport: { type: Boolean, default: !0 }
|
|
3431
|
+
}, {
|
|
3432
|
+
open: { type: Boolean, default: !1 },
|
|
3433
|
+
openModifiers: {}
|
|
3434
|
+
}),
|
|
3435
|
+
emits: /* @__PURE__ */ q(["hide", "hidden", "show", "shown"], ["update:open"]),
|
|
3436
|
+
setup(e, { expose: l, emit: o }) {
|
|
3437
|
+
const t = te(e, "open"), s = o, r = ee(), n = _("root");
|
|
3438
|
+
let d, k = !1;
|
|
3439
|
+
const h = Te(), c = g(() => e.id ?? h), m = g(() => `${c.value}-title`), S = g(() => !!(e.title || r.title)), x = g(() => !!(r.header || S.value || e.closable)), M = g(() => [
|
|
3440
|
+
"KModal",
|
|
3441
|
+
e.centered && "KModal--centered",
|
|
3442
|
+
e.scrollable && "KModal--scrollable",
|
|
3443
|
+
e.size && `KModal--${e.size}`,
|
|
3444
|
+
e.fullscreen && "KModal--fullscreen"
|
|
3445
|
+
]);
|
|
3446
|
+
function R() {
|
|
3447
|
+
return !d && n.value && (d = new oe.modules.Modal(n.value, {
|
|
3448
|
+
focus: e.focus,
|
|
3449
|
+
keyboard: e.keyboard,
|
|
3450
|
+
staticBackdrop: e.staticBackdrop
|
|
3451
|
+
})), d;
|
|
3452
|
+
}
|
|
3453
|
+
j(
|
|
3454
|
+
() => [e.focus, e.keyboard, e.staticBackdrop],
|
|
3455
|
+
() => {
|
|
3456
|
+
d = void 0;
|
|
3457
|
+
}
|
|
3458
|
+
), j(
|
|
3459
|
+
t,
|
|
3460
|
+
(w) => {
|
|
3461
|
+
if (w === k)
|
|
3462
|
+
return;
|
|
3463
|
+
const G = R();
|
|
3464
|
+
G && (k = w, w ? G.show() : G.hide());
|
|
3465
|
+
},
|
|
3466
|
+
{ flush: "post" }
|
|
3467
|
+
);
|
|
3468
|
+
const E = (w) => w.target === n.value, B = {
|
|
3469
|
+
"kt.modal.show": (w) => {
|
|
3470
|
+
E(w) && (k = !0, t.value = !0, s("show"));
|
|
3471
|
+
},
|
|
3472
|
+
"kt.modal.shown": (w) => {
|
|
3473
|
+
E(w) && s("shown");
|
|
3474
|
+
},
|
|
3475
|
+
"kt.modal.hide": (w) => {
|
|
3476
|
+
E(w) && (k = !1, t.value = !1, s("hide"));
|
|
3477
|
+
},
|
|
3478
|
+
"kt.modal.hidden": (w) => {
|
|
3479
|
+
E(w) && s("hidden");
|
|
3480
|
+
}
|
|
3481
|
+
};
|
|
3482
|
+
j(
|
|
3483
|
+
n,
|
|
3484
|
+
(w, G, Q) => {
|
|
3485
|
+
if (d = void 0, !!w) {
|
|
3486
|
+
for (const [p, a] of Object.entries(B))
|
|
3487
|
+
w.addEventListener(p, a);
|
|
3488
|
+
w.setAttribute("aria-hidden", "true"), t.value && R()?.show(), Q(() => {
|
|
3489
|
+
for (const [p, a] of Object.entries(B))
|
|
3490
|
+
w.removeEventListener(p, a);
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
},
|
|
3494
|
+
{ flush: "post", immediate: !0 }
|
|
3495
|
+
);
|
|
3496
|
+
const C = Ct("modal", t);
|
|
3497
|
+
ve(
|
|
3498
|
+
t,
|
|
3499
|
+
"keydown",
|
|
3500
|
+
(w) => {
|
|
3501
|
+
w.key !== "Escape" || !C() || (w.stopPropagation(), e.keyboard && U());
|
|
3502
|
+
},
|
|
3503
|
+
{ capture: !0 }
|
|
3504
|
+
);
|
|
3505
|
+
function b(w) {
|
|
3506
|
+
const G = w.target;
|
|
3507
|
+
if (!G)
|
|
3508
|
+
return;
|
|
3509
|
+
if (G.closest(`[${Bo}]`)) {
|
|
3510
|
+
w.stopPropagation(), U();
|
|
3511
|
+
return;
|
|
3512
|
+
}
|
|
3513
|
+
if (e.staticBackdrop)
|
|
3514
|
+
return;
|
|
3515
|
+
const Q = n.value?.querySelector(`[${So}]`);
|
|
3516
|
+
Q && !Q.contains(G) && (w.stopPropagation(), U());
|
|
3517
|
+
}
|
|
3518
|
+
le(() => {
|
|
3519
|
+
n.value?.classList.contains("is-active") && document.body.classList.remove("is-modal-active");
|
|
3520
|
+
});
|
|
3521
|
+
function L() {
|
|
3522
|
+
t.value = !0;
|
|
3523
|
+
}
|
|
3524
|
+
function U() {
|
|
3525
|
+
t.value = !1;
|
|
3526
|
+
}
|
|
3527
|
+
function $() {
|
|
3528
|
+
t.value = !t.value;
|
|
3529
|
+
}
|
|
3530
|
+
return l({ show: L, hide: U, toggle: $ }), (w, G) => (i(), J(Be, {
|
|
3531
|
+
to: "body",
|
|
3532
|
+
disabled: !e.teleport
|
|
145
3533
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
3534
|
+
K("div", {
|
|
3535
|
+
ref_key: "root",
|
|
3536
|
+
ref: n,
|
|
3537
|
+
class: T(M.value),
|
|
3538
|
+
"data-kt-modal-id": c.value,
|
|
3539
|
+
"data-kt-modal-static-backdrop": e.staticBackdrop ? "true" : "false",
|
|
3540
|
+
"data-kt-modal": "",
|
|
3541
|
+
tabindex: "-1",
|
|
3542
|
+
onClick: b
|
|
3543
|
+
}, [
|
|
3544
|
+
K("div", {
|
|
3545
|
+
class: T(["KModal-container", e.containerClass])
|
|
3546
|
+
}, [
|
|
3547
|
+
K("div", {
|
|
3548
|
+
class: T(["KModal-dialog", e.dialogClass]),
|
|
3549
|
+
"aria-label": e.dialogLabel,
|
|
3550
|
+
"aria-labelledby": !e.dialogLabel && S.value ? m.value : void 0,
|
|
3551
|
+
"data-kt-modal-dialog": "",
|
|
3552
|
+
role: "dialog"
|
|
3553
|
+
}, [
|
|
3554
|
+
x.value ? (i(), u("div", {
|
|
3555
|
+
key: 0,
|
|
3556
|
+
class: T(["KModal-header", e.headerClass])
|
|
3557
|
+
}, [
|
|
3558
|
+
v(w.$slots, "header", {}, () => [
|
|
3559
|
+
S.value ? (i(), u("h5", {
|
|
3560
|
+
key: 0,
|
|
3561
|
+
id: m.value,
|
|
3562
|
+
class: "KModal-title"
|
|
3563
|
+
}, [
|
|
3564
|
+
v(w.$slots, "title", {}, () => [
|
|
3565
|
+
F(W(e.title), 1)
|
|
3566
|
+
])
|
|
3567
|
+
], 8, po)) : D("", !0),
|
|
3568
|
+
e.closable ? (i(), u("button", {
|
|
3569
|
+
key: 1,
|
|
3570
|
+
class: "KModal-close",
|
|
3571
|
+
type: "button",
|
|
3572
|
+
"aria-label": "Close",
|
|
3573
|
+
onClick: ne(U, ["stop"])
|
|
3574
|
+
}, [
|
|
3575
|
+
v(w.$slots, "close", {}, () => [
|
|
3576
|
+
G[0] || (G[0] = F("✕", -1))
|
|
3577
|
+
])
|
|
3578
|
+
])) : D("", !0)
|
|
3579
|
+
])
|
|
3580
|
+
], 2)) : D("", !0),
|
|
3581
|
+
r.sidebar ? (i(), u("div", {
|
|
3582
|
+
key: 1,
|
|
3583
|
+
class: T(["KModal-main", e.mainClass])
|
|
3584
|
+
}, [
|
|
3585
|
+
K("aside", {
|
|
3586
|
+
class: T(["KModal-sidebar", e.sidebarClass])
|
|
3587
|
+
}, [
|
|
3588
|
+
v(w.$slots, "sidebar")
|
|
3589
|
+
], 2),
|
|
3590
|
+
K("div", {
|
|
3591
|
+
class: T(["KModal-body", e.bodyClass])
|
|
3592
|
+
}, [
|
|
3593
|
+
v(w.$slots, "default")
|
|
3594
|
+
], 2)
|
|
3595
|
+
], 2)) : (i(), u("div", {
|
|
3596
|
+
key: 2,
|
|
3597
|
+
class: T(["KModal-body", e.bodyClass])
|
|
3598
|
+
}, [
|
|
3599
|
+
v(w.$slots, "default")
|
|
3600
|
+
], 2)),
|
|
3601
|
+
r.footer ? (i(), u("div", {
|
|
3602
|
+
key: 3,
|
|
3603
|
+
class: T(["KModal-footer", e.footerClass])
|
|
3604
|
+
}, [
|
|
3605
|
+
v(w.$slots, "footer")
|
|
3606
|
+
], 2)) : D("", !0)
|
|
3607
|
+
], 10, Co)
|
|
3608
|
+
], 2)
|
|
3609
|
+
], 10, $o)
|
|
3610
|
+
], 8, ["disabled"]));
|
|
148
3611
|
}
|
|
149
|
-
}),
|
|
3612
|
+
}), To = { class: "KNavbar-menu" }, Io = ["href", "onClick"], Eo = {
|
|
150
3613
|
key: 0,
|
|
151
|
-
class: /* @__PURE__ */
|
|
3614
|
+
class: /* @__PURE__ */ T(["KNavbar-caret", "KCollapse-toggle"]),
|
|
152
3615
|
"data-kt-collapse-toggle": ""
|
|
153
|
-
},
|
|
3616
|
+
}, Bt = /* @__PURE__ */ P({
|
|
154
3617
|
__name: "KNavbarMenu",
|
|
155
3618
|
props: {
|
|
156
3619
|
items: { default: () => [] }
|
|
157
3620
|
},
|
|
158
3621
|
setup(e) {
|
|
159
|
-
const
|
|
160
|
-
return (
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
(
|
|
164
|
-
key: `navbar-menu-item-${
|
|
165
|
-
item:
|
|
3622
|
+
const l = g(() => e.items.filter(({ hidden: o }) => !o));
|
|
3623
|
+
return (o, t) => {
|
|
3624
|
+
const s = tt("KNavbarMenu", !0);
|
|
3625
|
+
return i(), u("ul", To, [
|
|
3626
|
+
(i(!0), u(ae, null, ie(l.value, (r, n) => v(o.$slots, "item", {
|
|
3627
|
+
key: `navbar-menu-item-${n}`,
|
|
3628
|
+
item: r
|
|
166
3629
|
}, () => [
|
|
167
|
-
|
|
168
|
-
to:
|
|
3630
|
+
Z(z(Rt), {
|
|
3631
|
+
to: r.route ?? "/",
|
|
169
3632
|
custom: ""
|
|
170
3633
|
}, {
|
|
171
|
-
default:
|
|
172
|
-
|
|
173
|
-
class:
|
|
3634
|
+
default: N(({ isActive: d, href: k, navigate: h }) => [
|
|
3635
|
+
K("li", {
|
|
3636
|
+
class: T([
|
|
174
3637
|
"KNavbar-item",
|
|
175
3638
|
"KCollapse is-collapsed",
|
|
176
|
-
|
|
3639
|
+
d && "KNavbar-item-is-active"
|
|
177
3640
|
]),
|
|
178
3641
|
"data-kt-collapse": ""
|
|
179
3642
|
}, [
|
|
180
|
-
|
|
181
|
-
class:
|
|
182
|
-
href:
|
|
183
|
-
onClick:
|
|
3643
|
+
K("a", {
|
|
3644
|
+
class: T(["KNavbar-link"]),
|
|
3645
|
+
href: r.route ? k : void 0,
|
|
3646
|
+
onClick: ne((c) => r.route ? h() : r.onClick?.(), ["prevent"])
|
|
184
3647
|
}, [
|
|
185
|
-
|
|
186
|
-
class:
|
|
3648
|
+
K("span", {
|
|
3649
|
+
class: T(["KNavbar-icon", r.iconClass])
|
|
187
3650
|
}, [
|
|
188
|
-
|
|
189
|
-
href:
|
|
3651
|
+
Z(we, {
|
|
3652
|
+
href: r.icon
|
|
190
3653
|
}, null, 8, ["href"])
|
|
191
3654
|
], 2),
|
|
192
|
-
|
|
3655
|
+
r.badge ? (i(), J(Se, {
|
|
193
3656
|
key: 0,
|
|
194
|
-
class:
|
|
3657
|
+
class: T(["KNavbar-badge", r.badgeClass]),
|
|
195
3658
|
pill: "",
|
|
196
3659
|
size: "sm",
|
|
197
3660
|
variant: "danger"
|
|
198
3661
|
}, {
|
|
199
|
-
default:
|
|
200
|
-
|
|
3662
|
+
default: N(() => [
|
|
3663
|
+
F(W(r.badge), 1)
|
|
201
3664
|
]),
|
|
202
3665
|
_: 2
|
|
203
|
-
}, 1032, ["class"])) :
|
|
204
|
-
|
|
205
|
-
class:
|
|
206
|
-
},
|
|
207
|
-
], 8,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
])) :
|
|
211
|
-
|
|
3666
|
+
}, 1032, ["class"])) : D("", !0),
|
|
3667
|
+
K("span", {
|
|
3668
|
+
class: T(["KNavbar-text", r.textClass])
|
|
3669
|
+
}, W(r.text), 3)
|
|
3670
|
+
], 8, Io),
|
|
3671
|
+
r.children ? (i(), u("span", Eo, [
|
|
3672
|
+
Z(we, { href: "#caretUp" })
|
|
3673
|
+
])) : D("", !0),
|
|
3674
|
+
r.children ? (i(), J(s, {
|
|
212
3675
|
key: 1,
|
|
213
|
-
items:
|
|
3676
|
+
items: r.children,
|
|
214
3677
|
class: "KCollapse-content",
|
|
215
3678
|
"data-kt-collapse-content": ""
|
|
216
|
-
}, null, 8, ["items"])) :
|
|
3679
|
+
}, null, 8, ["items"])) : D("", !0)
|
|
217
3680
|
], 2)
|
|
218
3681
|
]),
|
|
219
3682
|
_: 2
|
|
@@ -222,9 +3685,9 @@ const E = /* @__PURE__ */ K({
|
|
|
222
3685
|
]);
|
|
223
3686
|
};
|
|
224
3687
|
}
|
|
225
|
-
}),
|
|
3688
|
+
}), Lo = /* @__PURE__ */ P({
|
|
226
3689
|
__name: "KNavbar",
|
|
227
|
-
props: /* @__PURE__ */
|
|
3690
|
+
props: /* @__PURE__ */ q({
|
|
228
3691
|
items: {},
|
|
229
3692
|
bodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
230
3693
|
brandClass: { type: [Boolean, null, String, Object, Array] },
|
|
@@ -237,77 +3700,883 @@ const E = /* @__PURE__ */ K({
|
|
|
237
3700
|
expanded: { type: Boolean, default: !1 },
|
|
238
3701
|
expandedModifiers: {}
|
|
239
3702
|
}),
|
|
240
|
-
emits: /* @__PURE__ */
|
|
241
|
-
setup(e, { emit:
|
|
242
|
-
const
|
|
243
|
-
|
|
3703
|
+
emits: /* @__PURE__ */ q(["toggle"], ["update:expanded"]),
|
|
3704
|
+
setup(e, { emit: l }) {
|
|
3705
|
+
const o = te(e, "expanded"), t = l, s = ee(), r = () => {
|
|
3706
|
+
o.value = !o.value, t("toggle", o.value);
|
|
244
3707
|
};
|
|
245
|
-
return (
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
3708
|
+
return (n, d) => (i(), u("aside", {
|
|
3709
|
+
class: T([
|
|
3710
|
+
"KNavbar",
|
|
3711
|
+
o.value && "KNavbar-is-expanded",
|
|
3712
|
+
e.fixed && "KNavbar-is-fixed"
|
|
3713
|
+
])
|
|
3714
|
+
}, [
|
|
3715
|
+
K("div", {
|
|
3716
|
+
class: T(["KNavbar-inner", e.innerClass])
|
|
3717
|
+
}, [
|
|
3718
|
+
s.brand ? (i(), u("div", {
|
|
3719
|
+
key: 0,
|
|
3720
|
+
class: T(["KNavbar-brand", e.brandClass])
|
|
3721
|
+
}, [
|
|
3722
|
+
v(n.$slots, "brand")
|
|
3723
|
+
], 2)) : D("", !0),
|
|
3724
|
+
K("nav", {
|
|
3725
|
+
class: T(["KNavbar-body", e.bodyClass])
|
|
3726
|
+
}, [
|
|
3727
|
+
v(n.$slots, "default", {}, () => [
|
|
3728
|
+
Z(Bt, { items: e.items }, null, 8, ["items"])
|
|
3729
|
+
])
|
|
3730
|
+
], 2),
|
|
3731
|
+
s.footer ? (i(), u("div", {
|
|
3732
|
+
key: 1,
|
|
3733
|
+
class: T(["KNavbar-footer", e.footerClass])
|
|
3734
|
+
}, [
|
|
3735
|
+
v(n.$slots, "footer")
|
|
3736
|
+
], 2)) : D("", !0)
|
|
3737
|
+
], 2),
|
|
3738
|
+
e.hideToggle ? D("", !0) : (i(), u("button", {
|
|
3739
|
+
key: 0,
|
|
3740
|
+
type: "button",
|
|
3741
|
+
class: T(["KNavbar-toggle", e.toggleClass]),
|
|
3742
|
+
onClick: r
|
|
3743
|
+
}, [
|
|
3744
|
+
Z(we, { href: "#caretLeft" })
|
|
3745
|
+
], 2))
|
|
3746
|
+
], 2));
|
|
3747
|
+
}
|
|
3748
|
+
}), Do = ["aria-label"], xo = /* @__PURE__ */ P({
|
|
3749
|
+
__name: "KNotificationList",
|
|
3750
|
+
props: {
|
|
3751
|
+
ariaLabel: {}
|
|
3752
|
+
},
|
|
3753
|
+
setup(e) {
|
|
3754
|
+
return (l, o) => (i(), u("ul", {
|
|
3755
|
+
class: "KNotificationList",
|
|
3756
|
+
"aria-label": e.ariaLabel
|
|
3757
|
+
}, [
|
|
3758
|
+
v(l.$slots, "default")
|
|
3759
|
+
], 8, Do));
|
|
3760
|
+
}
|
|
3761
|
+
}), Mo = {
|
|
3762
|
+
key: 0,
|
|
3763
|
+
class: "KNotificationList-media"
|
|
3764
|
+
}, Oo = { class: "KNotificationList-content" }, Po = {
|
|
3765
|
+
key: 1,
|
|
3766
|
+
class: "KNotificationList-time"
|
|
3767
|
+
}, Ro = {
|
|
3768
|
+
key: 2,
|
|
3769
|
+
class: "KNotificationList-actions"
|
|
3770
|
+
}, zo = /* @__PURE__ */ P({
|
|
3771
|
+
__name: "KNotificationListItem",
|
|
3772
|
+
props: {
|
|
3773
|
+
hovered: { type: Boolean, default: !1 },
|
|
3774
|
+
time: {},
|
|
3775
|
+
unread: { type: Boolean, default: !1 },
|
|
3776
|
+
unreadLabel: {}
|
|
3777
|
+
},
|
|
3778
|
+
setup(e) {
|
|
3779
|
+
const l = ee(), o = g(() => [
|
|
3780
|
+
"KNotificationList-item",
|
|
3781
|
+
e.unread && "is-active",
|
|
3782
|
+
e.hovered && "is-hovered"
|
|
3783
|
+
]), t = {
|
|
3784
|
+
position: "absolute",
|
|
3785
|
+
width: "1px",
|
|
3786
|
+
height: "1px",
|
|
3787
|
+
overflow: "hidden",
|
|
3788
|
+
clip: "rect(0 0 0 0)",
|
|
3789
|
+
clipPath: "inset(50%)",
|
|
3790
|
+
whiteSpace: "nowrap"
|
|
3791
|
+
}, s = g(() => !!(l.time || e.time));
|
|
3792
|
+
return (r, n) => (i(), u("li", {
|
|
3793
|
+
class: T(o.value)
|
|
3794
|
+
}, [
|
|
3795
|
+
l.media ? (i(), u("div", Mo, [
|
|
3796
|
+
v(r.$slots, "media")
|
|
3797
|
+
])) : D("", !0),
|
|
3798
|
+
K("div", Oo, [
|
|
3799
|
+
e.unread && e.unreadLabel ? (i(), u("span", {
|
|
3800
|
+
key: 0,
|
|
3801
|
+
style: t
|
|
3802
|
+
}, W(e.unreadLabel), 1)) : D("", !0),
|
|
3803
|
+
v(r.$slots, "default")
|
|
3804
|
+
]),
|
|
3805
|
+
s.value ? (i(), u("div", Po, [
|
|
3806
|
+
v(r.$slots, "time", {}, () => [
|
|
3807
|
+
F(W(e.time), 1)
|
|
252
3808
|
])
|
|
3809
|
+
])) : D("", !0),
|
|
3810
|
+
l.actions ? (i(), u("div", Ro, [
|
|
3811
|
+
v(r.$slots, "actions")
|
|
3812
|
+
])) : D("", !0)
|
|
3813
|
+
], 2));
|
|
3814
|
+
}
|
|
3815
|
+
}), No = ["aria-valuenow", "aria-valuemax"], jo = ["viewBox"], Uo = {
|
|
3816
|
+
key: 1,
|
|
3817
|
+
class: "KProgress-fill"
|
|
3818
|
+
}, Vo = { class: "KProgress-label" }, Wo = /* @__PURE__ */ P({
|
|
3819
|
+
__name: "KProgress",
|
|
3820
|
+
props: {
|
|
3821
|
+
label: {},
|
|
3822
|
+
max: { default: 100 },
|
|
3823
|
+
rounded: { type: Boolean, default: !1 },
|
|
3824
|
+
shape: { default: "linear" },
|
|
3825
|
+
size: {},
|
|
3826
|
+
value: { default: 0 }
|
|
3827
|
+
},
|
|
3828
|
+
setup(e) {
|
|
3829
|
+
const l = g(() => e.shape === "circular" || e.shape === "semiCircular"), o = g(() => !Number.isFinite(e.max) || e.max <= 0 ? 0 : Math.min(100, Math.max(0, e.value / e.max * 100))), t = g(() => e.label ?? `${Math.round(o.value)}%`), s = g(() => [
|
|
3830
|
+
"KProgress",
|
|
3831
|
+
e.shape !== "linear" && `KProgress--${e.shape}`,
|
|
3832
|
+
e.rounded && "KProgress--rounded",
|
|
3833
|
+
// `md` is the default and has no modifier of its own.
|
|
3834
|
+
e.size && e.size !== "md" && `KProgress--${e.size}`
|
|
3835
|
+
]), r = g(
|
|
3836
|
+
() => e.shape === "semiCircular" ? "0 0 36 20" : "0 0 36 36"
|
|
3837
|
+
);
|
|
3838
|
+
return (n, d) => (i(), u("div", {
|
|
3839
|
+
class: T(s.value),
|
|
3840
|
+
style: ce({ "--kt-progress-value": o.value }),
|
|
3841
|
+
"aria-valuenow": e.value,
|
|
3842
|
+
"aria-valuemin": 0,
|
|
3843
|
+
"aria-valuemax": e.max,
|
|
3844
|
+
role: "progressbar"
|
|
3845
|
+
}, [
|
|
3846
|
+
l.value ? (i(), u("svg", {
|
|
3847
|
+
key: 0,
|
|
3848
|
+
class: "KProgress-svg",
|
|
3849
|
+
viewBox: r.value,
|
|
3850
|
+
fill: "none",
|
|
3851
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3852
|
+
}, [...d[0] || (d[0] = [
|
|
3853
|
+
K("circle", {
|
|
3854
|
+
class: "KProgress-track",
|
|
3855
|
+
cx: "18",
|
|
3856
|
+
cy: "18",
|
|
3857
|
+
r: "15.9"
|
|
3858
|
+
}, null, -1),
|
|
3859
|
+
K("circle", {
|
|
3860
|
+
class: "KProgress-fill",
|
|
3861
|
+
cx: "18",
|
|
3862
|
+
cy: "18",
|
|
3863
|
+
r: "15.9"
|
|
3864
|
+
}, null, -1)
|
|
3865
|
+
])], 8, jo)) : (i(), u("div", Uo)),
|
|
3866
|
+
K("span", Vo, [
|
|
3867
|
+
v(n.$slots, "label", {}, () => [
|
|
3868
|
+
F(W(t.value), 1)
|
|
3869
|
+
])
|
|
3870
|
+
])
|
|
3871
|
+
], 14, No));
|
|
3872
|
+
}
|
|
3873
|
+
}), Go = ["checked", "disabled", "name"], Ho = {
|
|
3874
|
+
key: 0,
|
|
3875
|
+
class: "KRadio-label"
|
|
3876
|
+
}, Fo = /* @__PURE__ */ P({
|
|
3877
|
+
inheritAttrs: !1,
|
|
3878
|
+
__name: "KRadio",
|
|
3879
|
+
props: /* @__PURE__ */ q({
|
|
3880
|
+
disabled: { type: Boolean, default: !1 },
|
|
3881
|
+
label: {},
|
|
3882
|
+
name: {},
|
|
3883
|
+
value: {}
|
|
3884
|
+
}, {
|
|
3885
|
+
modelValue: {},
|
|
3886
|
+
modelModifiers: {}
|
|
3887
|
+
}),
|
|
3888
|
+
emits: ["update:modelValue"],
|
|
3889
|
+
setup(e) {
|
|
3890
|
+
const l = te(e, "modelValue"), o = ee(), t = Ie(), s = g(() => l.value === e.value), r = g(() => ["KRadio", e.disabled && "KRadio--disabled"]), n = g(() => {
|
|
3891
|
+
const { class: k, style: h, ...c } = t;
|
|
3892
|
+
return c;
|
|
3893
|
+
});
|
|
3894
|
+
function d() {
|
|
3895
|
+
l.value = e.value;
|
|
3896
|
+
}
|
|
3897
|
+
return (k, h) => (i(), u("label", {
|
|
3898
|
+
class: T([r.value, z(t).class]),
|
|
3899
|
+
style: ce(z(t).style)
|
|
3900
|
+
}, [
|
|
3901
|
+
K("input", re({
|
|
3902
|
+
class: "KRadio-input",
|
|
3903
|
+
type: "radio"
|
|
3904
|
+
}, n.value, {
|
|
3905
|
+
checked: s.value,
|
|
3906
|
+
disabled: e.disabled,
|
|
3907
|
+
name: e.name,
|
|
3908
|
+
onChange: d
|
|
3909
|
+
}), null, 16, Go),
|
|
3910
|
+
h[0] || (h[0] = K("span", { class: "KRadio-box" }, null, -1)),
|
|
3911
|
+
o.default || e.label ? (i(), u("span", Ho, [
|
|
3912
|
+
v(k.$slots, "default", {}, () => [
|
|
3913
|
+
F(W(e.label), 1)
|
|
3914
|
+
])
|
|
3915
|
+
])) : D("", !0)
|
|
3916
|
+
], 6));
|
|
3917
|
+
}
|
|
3918
|
+
}), qo = ["disabled"], Qo = {
|
|
3919
|
+
class: "KSelect-caret KIcon",
|
|
3920
|
+
"aria-hidden": "true"
|
|
3921
|
+
}, Zo = ["href"], Jo = ["data-kt-select-value"], Yo = "data-kt-select-item", Xo = /* @__PURE__ */ P({
|
|
3922
|
+
__name: "KSelect",
|
|
3923
|
+
props: /* @__PURE__ */ q({
|
|
3924
|
+
disabled: { type: Boolean, default: !1 },
|
|
3925
|
+
icon: { default: "#caretDown" },
|
|
3926
|
+
inline: { type: Boolean, default: !1 },
|
|
3927
|
+
menuClass: { type: [Boolean, null, String, Object, Array] },
|
|
3928
|
+
options: { default: () => [] },
|
|
3929
|
+
placeholder: { default: "Select an option" },
|
|
3930
|
+
toggleClass: { type: [Boolean, null, String, Object, Array] }
|
|
3931
|
+
}, {
|
|
3932
|
+
modelValue: {},
|
|
3933
|
+
modelModifiers: {}
|
|
3934
|
+
}),
|
|
3935
|
+
emits: /* @__PURE__ */ q(["change"], ["update:modelValue"]),
|
|
3936
|
+
setup(e, { emit: l }) {
|
|
3937
|
+
const o = te(e, "modelValue"), t = l, s = _("root");
|
|
3938
|
+
let r, n;
|
|
3939
|
+
const d = g(
|
|
3940
|
+
() => e.options.map(
|
|
3941
|
+
(B) => typeof B == "string" ? { label: B, value: B } : B
|
|
3942
|
+
)
|
|
3943
|
+
), k = g(
|
|
3944
|
+
() => d.value.find((B) => B.value === o.value)?.label
|
|
3945
|
+
);
|
|
3946
|
+
function h() {
|
|
3947
|
+
return !r && s.value && (r = new oe.modules.Select(s.value)), r;
|
|
3948
|
+
}
|
|
3949
|
+
function c(B) {
|
|
3950
|
+
const C = s.value;
|
|
3951
|
+
if (!C || B === void 0)
|
|
3952
|
+
return;
|
|
3953
|
+
const b = C.querySelector(
|
|
3954
|
+
`[data-kt-select-item][data-kt-select-value="${CSS.escape(B)}"]`
|
|
3955
|
+
);
|
|
3956
|
+
b && (n = B, h()?.selectItem(b));
|
|
3957
|
+
}
|
|
3958
|
+
function m(B) {
|
|
3959
|
+
B.target === s.value && (M.value = !0);
|
|
3960
|
+
}
|
|
3961
|
+
function S(B) {
|
|
3962
|
+
B.target === s.value && (M.value = !1);
|
|
3963
|
+
}
|
|
3964
|
+
function x(B) {
|
|
3965
|
+
if (B.target !== s.value)
|
|
3966
|
+
return;
|
|
3967
|
+
const C = h()?.getValue() ?? void 0;
|
|
3968
|
+
C !== void 0 && (n = C, o.value = C, t("change", C));
|
|
3969
|
+
}
|
|
3970
|
+
const M = ye(!1);
|
|
3971
|
+
it("dropdown", M, () => h()?.hide());
|
|
3972
|
+
function R() {
|
|
3973
|
+
h()?.toggle();
|
|
3974
|
+
}
|
|
3975
|
+
ve(M, "click", (B) => {
|
|
3976
|
+
const C = B.target;
|
|
3977
|
+
if (!C)
|
|
3978
|
+
return;
|
|
3979
|
+
const b = h(), L = b?.getMenu(), U = C.closest(`[${Yo}]`);
|
|
3980
|
+
if (U && L?.contains(U)) {
|
|
3981
|
+
b?.selectItem(U), b?.hide();
|
|
3982
|
+
return;
|
|
3983
|
+
}
|
|
3984
|
+
s.value?.contains(C) || L?.contains(C) || b?.hide();
|
|
3985
|
+
}), j(
|
|
3986
|
+
o,
|
|
3987
|
+
(B) => {
|
|
3988
|
+
B !== n && c(B);
|
|
3989
|
+
},
|
|
3990
|
+
{ flush: "post" }
|
|
3991
|
+
), j(
|
|
3992
|
+
s,
|
|
3993
|
+
(B, C, b) => {
|
|
3994
|
+
r = void 0, B && (B.addEventListener("kt.select.change", x), B.addEventListener("kt.shown", m), B.addEventListener("kt.hidden", S), o.value !== void 0 && c(o.value), b(() => {
|
|
3995
|
+
B.removeEventListener("kt.select.change", x), B.removeEventListener("kt.shown", m), B.removeEventListener("kt.hidden", S);
|
|
3996
|
+
}));
|
|
3997
|
+
},
|
|
3998
|
+
{ flush: "post", immediate: !0 }
|
|
3999
|
+
);
|
|
4000
|
+
const E = g(() => [
|
|
4001
|
+
"KSelect",
|
|
4002
|
+
e.inline && "KSelect--inline",
|
|
4003
|
+
e.disabled && "KSelect--disabled",
|
|
4004
|
+
e.disabled && "is-disabled"
|
|
4005
|
+
]);
|
|
4006
|
+
return (B, C) => (i(), u("div", {
|
|
4007
|
+
ref_key: "root",
|
|
4008
|
+
ref: s,
|
|
4009
|
+
class: T(E.value),
|
|
4010
|
+
"data-kt-select": ""
|
|
4011
|
+
}, [
|
|
4012
|
+
K("button", {
|
|
4013
|
+
class: T(["KSelect-toggle", e.toggleClass]),
|
|
4014
|
+
type: "button",
|
|
4015
|
+
"data-kt-select-toggle": "",
|
|
4016
|
+
disabled: e.disabled,
|
|
4017
|
+
onClick: ne(R, ["stop"])
|
|
4018
|
+
}, [
|
|
4019
|
+
K("span", {
|
|
4020
|
+
class: T(["KSelect-label", !k.value && "is-placeholder"]),
|
|
4021
|
+
"data-kt-select-label": ""
|
|
4022
|
+
}, W(k.value ?? e.placeholder), 3),
|
|
4023
|
+
(i(), u("svg", Qo, [
|
|
4024
|
+
K("use", { href: e.icon }, null, 8, Zo)
|
|
4025
|
+
]))
|
|
4026
|
+
], 10, qo),
|
|
4027
|
+
K("div", {
|
|
4028
|
+
class: T(["KSelect-menu", e.menuClass]),
|
|
4029
|
+
"data-kt-select-menu": ""
|
|
4030
|
+
}, [
|
|
4031
|
+
v(B.$slots, "default", {}, () => [
|
|
4032
|
+
(i(!0), u(ae, null, ie(d.value, (b) => (i(), u("div", {
|
|
4033
|
+
key: b.value,
|
|
4034
|
+
class: "KSelect-item",
|
|
4035
|
+
"data-kt-select-item": "",
|
|
4036
|
+
"data-kt-select-value": b.value
|
|
4037
|
+
}, W(b.label), 9, Jo))), 128))
|
|
4038
|
+
])
|
|
4039
|
+
], 2)
|
|
4040
|
+
], 2));
|
|
4041
|
+
}
|
|
4042
|
+
}), _o = ["aria-hidden", "aria-label", "role"], el = /* @__PURE__ */ P({
|
|
4043
|
+
__name: "KSpinner",
|
|
4044
|
+
props: {
|
|
4045
|
+
decorative: { type: Boolean },
|
|
4046
|
+
label: { default: "Loading" },
|
|
4047
|
+
size: {},
|
|
4048
|
+
variant: {}
|
|
4049
|
+
},
|
|
4050
|
+
setup(e) {
|
|
4051
|
+
return (l, o) => (i(), u("span", {
|
|
4052
|
+
class: T([
|
|
4053
|
+
"KSpinner",
|
|
4054
|
+
e.size && e.size !== "md" && `KSpinner--${e.size}`,
|
|
4055
|
+
e.variant && `KSpinner--${e.variant}`
|
|
4056
|
+
]),
|
|
4057
|
+
"aria-hidden": e.decorative ? "true" : void 0,
|
|
4058
|
+
"aria-label": e.decorative ? void 0 : e.label,
|
|
4059
|
+
role: e.decorative ? void 0 : "status"
|
|
4060
|
+
}, null, 10, _o));
|
|
4061
|
+
}
|
|
4062
|
+
}), Ge = /* @__PURE__ */ Symbol("KTabs"), tl = ["data-ktab-name", "data-kt-tabs-tab", "data-kt-tabs-target", "aria-controls", "disabled"], al = /* @__PURE__ */ P({
|
|
4063
|
+
__name: "KTab",
|
|
4064
|
+
props: {
|
|
4065
|
+
disabled: { type: Boolean, default: !1 },
|
|
4066
|
+
name: {}
|
|
4067
|
+
},
|
|
4068
|
+
setup(e) {
|
|
4069
|
+
const l = he(Ge, void 0), o = g(() => l?.panelId(e.name));
|
|
4070
|
+
return (t, s) => (i(), u("button", {
|
|
4071
|
+
class: "KTabs-tab",
|
|
4072
|
+
type: "button",
|
|
4073
|
+
role: "tab",
|
|
4074
|
+
"data-ktab-name": e.name,
|
|
4075
|
+
"data-kt-tabs-tab": e.disabled ? void 0 : "",
|
|
4076
|
+
"data-kt-tabs-target": o.value,
|
|
4077
|
+
"aria-controls": o.value,
|
|
4078
|
+
disabled: e.disabled
|
|
4079
|
+
}, [
|
|
4080
|
+
v(t.$slots, "default")
|
|
4081
|
+
], 8, tl));
|
|
4082
|
+
}
|
|
4083
|
+
}), sl = /* @__PURE__ */ P({
|
|
4084
|
+
__name: "KTable",
|
|
4085
|
+
props: {
|
|
4086
|
+
borderless: { type: Boolean, default: !1 },
|
|
4087
|
+
hoverable: { type: Boolean, default: !1 },
|
|
4088
|
+
size: {},
|
|
4089
|
+
striped: { type: Boolean, default: !1 }
|
|
4090
|
+
},
|
|
4091
|
+
setup(e) {
|
|
4092
|
+
const l = g(() => [
|
|
4093
|
+
"KTable",
|
|
4094
|
+
e.borderless && "KTable--borderless",
|
|
4095
|
+
e.hoverable && "KTable--hoverable",
|
|
4096
|
+
e.striped && "KTable--striped",
|
|
4097
|
+
// `md` is the default and has no modifier of its own.
|
|
4098
|
+
e.size && e.size !== "md" && `KTable--${e.size}`
|
|
4099
|
+
]);
|
|
4100
|
+
return (o, t) => (i(), u("table", {
|
|
4101
|
+
class: T(l.value)
|
|
4102
|
+
}, [
|
|
4103
|
+
v(o.$slots, "default")
|
|
4104
|
+
], 2));
|
|
4105
|
+
}
|
|
4106
|
+
}), ol = ["id"], ll = /* @__PURE__ */ P({
|
|
4107
|
+
__name: "KTabPanel",
|
|
4108
|
+
props: {
|
|
4109
|
+
name: {}
|
|
4110
|
+
},
|
|
4111
|
+
setup(e) {
|
|
4112
|
+
const l = he(Ge, void 0), o = g(() => l?.panelId(e.name));
|
|
4113
|
+
return (t, s) => (i(), u("div", {
|
|
4114
|
+
id: o.value,
|
|
4115
|
+
class: "KTabs-panel",
|
|
4116
|
+
role: "tabpanel",
|
|
4117
|
+
"data-kt-tabs-panel": ""
|
|
4118
|
+
}, [
|
|
4119
|
+
v(t.$slots, "default")
|
|
4120
|
+
], 8, ol));
|
|
4121
|
+
}
|
|
4122
|
+
}), nl = ["aria-label"], il = { class: "KTabs-content" }, be = "data-ktab-name", rl = /* @__PURE__ */ P({
|
|
4123
|
+
__name: "KTabs",
|
|
4124
|
+
props: /* @__PURE__ */ q({
|
|
4125
|
+
ariaLabel: { default: "Tabs" },
|
|
4126
|
+
variant: {}
|
|
4127
|
+
}, {
|
|
4128
|
+
modelValue: {},
|
|
4129
|
+
modelModifiers: {}
|
|
4130
|
+
}),
|
|
4131
|
+
emits: /* @__PURE__ */ q(["shown"], ["update:modelValue"]),
|
|
4132
|
+
setup(e, { expose: l, emit: o }) {
|
|
4133
|
+
const t = te(e, "modelValue"), s = o, r = Te(), n = _("root");
|
|
4134
|
+
let d;
|
|
4135
|
+
const k = (C) => `${r}-${C.replace(
|
|
4136
|
+
/[^A-Za-z0-9_]/g,
|
|
4137
|
+
(b) => `-${b.charCodeAt(0).toString(16)}-`
|
|
4138
|
+
)}`;
|
|
4139
|
+
Ae(Ge, { active: g(() => t.value), panelId: k });
|
|
4140
|
+
const h = `[${be}][data-kt-tabs-tab]`;
|
|
4141
|
+
function c(C) {
|
|
4142
|
+
return n.value?.querySelector(
|
|
4143
|
+
`[${be}="${CSS.escape(C)}"][data-kt-tabs-tab]`
|
|
4144
|
+
) ?? null;
|
|
4145
|
+
}
|
|
4146
|
+
function m(C) {
|
|
4147
|
+
const b = c(C);
|
|
4148
|
+
b && (d = C, new oe.modules.Tabs(b).show(b));
|
|
4149
|
+
}
|
|
4150
|
+
function S(C) {
|
|
4151
|
+
if (C.target !== n.value)
|
|
4152
|
+
return;
|
|
4153
|
+
const L = n.value?.querySelector(
|
|
4154
|
+
`[${be}].is-active`
|
|
4155
|
+
)?.getAttribute(be) ?? void 0;
|
|
4156
|
+
L && (d = L, t.value = L, s("shown", L));
|
|
4157
|
+
}
|
|
4158
|
+
function x(C) {
|
|
4159
|
+
const b = C?.closest(
|
|
4160
|
+
"[data-kt-tabs-tab]"
|
|
4161
|
+
);
|
|
4162
|
+
return b && b.closest("[data-kt-tabs]") === n.value ? b : null;
|
|
4163
|
+
}
|
|
4164
|
+
function M() {
|
|
4165
|
+
const C = n.value?.querySelectorAll(h) ?? [];
|
|
4166
|
+
return Array.from(C).filter(
|
|
4167
|
+
(b) => b.closest("[data-kt-tabs]") === n.value
|
|
4168
|
+
);
|
|
4169
|
+
}
|
|
4170
|
+
function R(C) {
|
|
4171
|
+
const b = C.getAttribute(be);
|
|
4172
|
+
b && (t.value = b);
|
|
4173
|
+
}
|
|
4174
|
+
function E(C) {
|
|
4175
|
+
const b = x(C.target);
|
|
4176
|
+
b && (C.stopPropagation(), C.preventDefault(), R(b));
|
|
4177
|
+
}
|
|
4178
|
+
function B(C) {
|
|
4179
|
+
const b = x(C.target);
|
|
4180
|
+
if (!b)
|
|
4181
|
+
return;
|
|
4182
|
+
const L = M(), U = L.indexOf(b);
|
|
4183
|
+
let $;
|
|
4184
|
+
switch (C.key) {
|
|
4185
|
+
case "ArrowRight":
|
|
4186
|
+
$ = L[(U + 1) % L.length];
|
|
4187
|
+
break;
|
|
4188
|
+
case "ArrowLeft":
|
|
4189
|
+
$ = L[(U - 1 + L.length) % L.length];
|
|
4190
|
+
break;
|
|
4191
|
+
case "Home":
|
|
4192
|
+
$ = L[0];
|
|
4193
|
+
break;
|
|
4194
|
+
case "End":
|
|
4195
|
+
$ = L[L.length - 1];
|
|
4196
|
+
break;
|
|
4197
|
+
case "Enter":
|
|
4198
|
+
case " ":
|
|
4199
|
+
C.stopPropagation(), C.preventDefault(), R(b);
|
|
4200
|
+
return;
|
|
4201
|
+
default:
|
|
4202
|
+
return;
|
|
4203
|
+
}
|
|
4204
|
+
$?.focus(), C.stopPropagation(), C.preventDefault();
|
|
4205
|
+
}
|
|
4206
|
+
return j(
|
|
4207
|
+
t,
|
|
4208
|
+
(C) => {
|
|
4209
|
+
!C || C === d || m(C);
|
|
4210
|
+
},
|
|
4211
|
+
{ flush: "post" }
|
|
4212
|
+
), j(
|
|
4213
|
+
n,
|
|
4214
|
+
(C, b, L) => {
|
|
4215
|
+
if (!C)
|
|
4216
|
+
return;
|
|
4217
|
+
C.addEventListener("kt.tabs.shown", S);
|
|
4218
|
+
const U = t.value ?? C.querySelector(h)?.getAttribute(be) ?? void 0;
|
|
4219
|
+
U && (t.value = U, m(U)), L(() => C.removeEventListener("kt.tabs.shown", S));
|
|
4220
|
+
},
|
|
4221
|
+
{ flush: "post", immediate: !0 }
|
|
4222
|
+
), l({ show: (C) => t.value = C }), (C, b) => (i(), u("div", {
|
|
4223
|
+
ref_key: "root",
|
|
4224
|
+
ref: n,
|
|
4225
|
+
"data-kt-tabs": "",
|
|
4226
|
+
onClick: E,
|
|
4227
|
+
onKeydown: B
|
|
4228
|
+
}, [
|
|
4229
|
+
K("div", {
|
|
4230
|
+
class: T(["KTabs", e.variant && `KTabs--${e.variant}`]),
|
|
4231
|
+
role: "tablist",
|
|
4232
|
+
"aria-label": e.ariaLabel
|
|
4233
|
+
}, [
|
|
4234
|
+
v(C.$slots, "tabs")
|
|
4235
|
+
], 10, nl),
|
|
4236
|
+
K("div", il, [
|
|
4237
|
+
v(C.$slots, "default")
|
|
4238
|
+
])
|
|
4239
|
+
], 544));
|
|
4240
|
+
}
|
|
4241
|
+
}), dl = ["disabled"], cl = {
|
|
4242
|
+
key: 0,
|
|
4243
|
+
class: "KToggle-label"
|
|
4244
|
+
}, ul = /* @__PURE__ */ P({
|
|
4245
|
+
inheritAttrs: !1,
|
|
4246
|
+
__name: "KToggle",
|
|
4247
|
+
props: /* @__PURE__ */ q({
|
|
4248
|
+
disabled: { type: Boolean, default: !1 },
|
|
4249
|
+
label: {}
|
|
4250
|
+
}, {
|
|
4251
|
+
modelValue: { type: Boolean, default: !1 },
|
|
4252
|
+
modelModifiers: {}
|
|
4253
|
+
}),
|
|
4254
|
+
emits: ["update:modelValue"],
|
|
4255
|
+
setup(e) {
|
|
4256
|
+
const l = te(e, "modelValue"), o = ee(), t = Ie(), s = g(() => ["KToggle", e.disabled && "KToggle--disabled"]), r = g(() => {
|
|
4257
|
+
const { class: n, style: d, ...k } = t;
|
|
4258
|
+
return k;
|
|
4259
|
+
});
|
|
4260
|
+
return (n, d) => (i(), u("label", {
|
|
4261
|
+
class: T([s.value, z(t).class]),
|
|
4262
|
+
style: ce(z(t).style)
|
|
4263
|
+
}, [
|
|
4264
|
+
Pe(K("input", re({
|
|
4265
|
+
"onUpdate:modelValue": d[0] || (d[0] = (k) => l.value = k),
|
|
4266
|
+
class: "KToggle-input",
|
|
4267
|
+
type: "checkbox"
|
|
4268
|
+
}, r.value, { disabled: e.disabled }), null, 16, dl), [
|
|
4269
|
+
[Ot, l.value]
|
|
4270
|
+
]),
|
|
4271
|
+
d[1] || (d[1] = K("span", { class: "KToggle-track" }, [
|
|
4272
|
+
K("span", { class: "KToggle-thumb" })
|
|
4273
|
+
], -1)),
|
|
4274
|
+
o.default || e.label ? (i(), u("span", cl, [
|
|
4275
|
+
v(n.$slots, "default", {}, () => [
|
|
4276
|
+
F(W(e.label), 1)
|
|
4277
|
+
])
|
|
4278
|
+
])) : D("", !0)
|
|
4279
|
+
], 6));
|
|
4280
|
+
}
|
|
4281
|
+
}), fl = ["data-kt-collapse-horizontal"], vl = ["data-kt-collapse-content"], hl = /* @__PURE__ */ P({
|
|
4282
|
+
__name: "KWorkspace",
|
|
4283
|
+
props: /* @__PURE__ */ q({
|
|
4284
|
+
bodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
4285
|
+
bodyContentClass: { type: [Boolean, null, String, Object, Array] },
|
|
4286
|
+
bodySidebarClass: { type: [Boolean, null, String, Object, Array] },
|
|
4287
|
+
bodySidebarSide: { default: "left" },
|
|
4288
|
+
collapsible: { type: Boolean, default: !1 },
|
|
4289
|
+
footerClass: { type: [Boolean, null, String, Object, Array] },
|
|
4290
|
+
height: {},
|
|
4291
|
+
mainClass: { type: [Boolean, null, String, Object, Array] },
|
|
4292
|
+
side: { default: "left" },
|
|
4293
|
+
sidebarBodyClass: { type: [Boolean, null, String, Object, Array] },
|
|
4294
|
+
sidebarClass: { type: [Boolean, null, String, Object, Array] },
|
|
4295
|
+
sidebarInnerClass: { type: [Boolean, null, String, Object, Array] },
|
|
4296
|
+
topbarClass: { type: [Boolean, null, String, Object, Array] }
|
|
4297
|
+
}, {
|
|
4298
|
+
expanded: { type: Boolean, default: !0 },
|
|
4299
|
+
expandedModifiers: {}
|
|
4300
|
+
}),
|
|
4301
|
+
emits: /* @__PURE__ */ q(["toggle"], ["update:expanded"]),
|
|
4302
|
+
setup(e, { expose: l, emit: o }) {
|
|
4303
|
+
const t = te(e, "expanded"), s = o, r = ee(), n = _("sidebar");
|
|
4304
|
+
let d;
|
|
4305
|
+
const k = [
|
|
4306
|
+
"is-active",
|
|
4307
|
+
"is-collapsed",
|
|
4308
|
+
"is-collapsing",
|
|
4309
|
+
"is-expanded",
|
|
4310
|
+
"is-expanding"
|
|
4311
|
+
], h = g(
|
|
4312
|
+
() => !!(r.sidebar || r.sidebarHeader || r.sidebarFooter)
|
|
4313
|
+
), c = g(
|
|
4314
|
+
() => e.height ? { "--kt-workspace-height": e.height } : void 0
|
|
4315
|
+
);
|
|
4316
|
+
function m() {
|
|
4317
|
+
return !d && n.value && (d = new oe.modules.Collapse(n.value, {
|
|
4318
|
+
horizontal: !0,
|
|
4319
|
+
direction: e.side === "right" ? "left" : "right"
|
|
4320
|
+
})), d;
|
|
4321
|
+
}
|
|
4322
|
+
function S() {
|
|
4323
|
+
const E = n.value;
|
|
4324
|
+
E && (E.classList.remove(...k), t.value ? E.classList.add("is-active", "is-expanded") : E.classList.add("is-collapsed"));
|
|
4325
|
+
}
|
|
4326
|
+
j(
|
|
4327
|
+
n,
|
|
4328
|
+
() => {
|
|
4329
|
+
d = void 0, e.collapsible && S();
|
|
4330
|
+
},
|
|
4331
|
+
{ flush: "post", immediate: !0 }
|
|
4332
|
+
), j(
|
|
4333
|
+
() => e.collapsible,
|
|
4334
|
+
(E) => {
|
|
4335
|
+
d = void 0, E ? S() : n.value?.classList.remove(...k);
|
|
4336
|
+
},
|
|
4337
|
+
{ flush: "post" }
|
|
4338
|
+
), j(
|
|
4339
|
+
() => t.value,
|
|
4340
|
+
(E) => {
|
|
4341
|
+
if (!e.collapsible)
|
|
4342
|
+
return;
|
|
4343
|
+
const B = m();
|
|
4344
|
+
B && (E ? B.expand() : B.collapse());
|
|
4345
|
+
}
|
|
4346
|
+
);
|
|
4347
|
+
function x() {
|
|
4348
|
+
t.value = !t.value, s("toggle", t.value);
|
|
4349
|
+
}
|
|
4350
|
+
function M() {
|
|
4351
|
+
t.value || x();
|
|
4352
|
+
}
|
|
4353
|
+
function R() {
|
|
4354
|
+
t.value && x();
|
|
4355
|
+
}
|
|
4356
|
+
return l({ toggle: x, expand: M, collapse: R }), (E, B) => (i(), u("div", {
|
|
4357
|
+
class: T(["KWorkspace", e.side === "right" && "is-side-right"]),
|
|
4358
|
+
style: ce(c.value)
|
|
4359
|
+
}, [
|
|
4360
|
+
h.value ? (i(), u("aside", {
|
|
4361
|
+
key: 0,
|
|
4362
|
+
ref_key: "sidebar",
|
|
4363
|
+
ref: n,
|
|
4364
|
+
class: T([
|
|
4365
|
+
"KWorkspace-sidebar",
|
|
4366
|
+
e.collapsible && "KCollapse",
|
|
4367
|
+
e.sidebarClass
|
|
4368
|
+
]),
|
|
4369
|
+
"data-kt-collapse-horizontal": e.collapsible ? e.side === "right" ? "left" : "true" : void 0
|
|
253
4370
|
}, [
|
|
254
|
-
|
|
255
|
-
class:
|
|
4371
|
+
K("div", {
|
|
4372
|
+
class: T([
|
|
4373
|
+
"KWorkspace-sidebarInner",
|
|
4374
|
+
e.collapsible && "KCollapse-content",
|
|
4375
|
+
e.sidebarInnerClass
|
|
4376
|
+
]),
|
|
4377
|
+
"data-kt-collapse-content": e.collapsible ? "" : void 0
|
|
256
4378
|
}, [
|
|
257
|
-
|
|
4379
|
+
v(E.$slots, "sidebarHeader"),
|
|
4380
|
+
r.sidebar ? (i(), u("div", {
|
|
258
4381
|
key: 0,
|
|
259
|
-
class:
|
|
4382
|
+
class: T(["KWorkspace-sidebarBody", e.sidebarBodyClass])
|
|
260
4383
|
}, [
|
|
261
|
-
|
|
262
|
-
], 2)) :
|
|
263
|
-
|
|
264
|
-
|
|
4384
|
+
v(E.$slots, "sidebar")
|
|
4385
|
+
], 2)) : D("", !0),
|
|
4386
|
+
v(E.$slots, "sidebarFooter")
|
|
4387
|
+
], 10, vl)
|
|
4388
|
+
], 10, fl)) : D("", !0),
|
|
4389
|
+
K("div", {
|
|
4390
|
+
class: T(["KWorkspace-main", e.mainClass])
|
|
4391
|
+
}, [
|
|
4392
|
+
r.topbar ? (i(), u("header", {
|
|
4393
|
+
key: 0,
|
|
4394
|
+
class: T(["KWorkspace-topbar", e.topbarClass])
|
|
4395
|
+
}, [
|
|
4396
|
+
v(E.$slots, "topbar")
|
|
4397
|
+
], 2)) : D("", !0),
|
|
4398
|
+
K("div", {
|
|
4399
|
+
class: T([
|
|
4400
|
+
"KWorkspace-body",
|
|
4401
|
+
e.bodySidebarSide === "right" && "is-side-right",
|
|
4402
|
+
e.bodyClass
|
|
4403
|
+
])
|
|
4404
|
+
}, [
|
|
4405
|
+
r.bodySidebar ? (i(), u("aside", {
|
|
4406
|
+
key: 0,
|
|
4407
|
+
class: T(["KWorkspace-bodySidebar", e.bodySidebarClass])
|
|
265
4408
|
}, [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
r.footer ? (o(), s("div", {
|
|
271
|
-
key: 1,
|
|
272
|
-
class: l(["KNavbar-footer", e.footerClass])
|
|
4409
|
+
v(E.$slots, "bodySidebar")
|
|
4410
|
+
], 2)) : D("", !0),
|
|
4411
|
+
K("div", {
|
|
4412
|
+
class: T(["KWorkspace-bodyContent", e.bodyContentClass])
|
|
273
4413
|
}, [
|
|
274
|
-
|
|
275
|
-
], 2)
|
|
4414
|
+
v(E.$slots, "default")
|
|
4415
|
+
], 2)
|
|
276
4416
|
], 2),
|
|
277
|
-
|
|
278
|
-
key:
|
|
279
|
-
|
|
280
|
-
class: l(["KNavbar-toggle", e.toggleClass]),
|
|
281
|
-
onClick: i
|
|
4417
|
+
r.footer ? (i(), u("footer", {
|
|
4418
|
+
key: 1,
|
|
4419
|
+
class: T(["KWorkspace-footer", e.footerClass])
|
|
282
4420
|
}, [
|
|
283
|
-
|
|
284
|
-
], 2))
|
|
285
|
-
], 2)
|
|
286
|
-
|
|
4421
|
+
v(E.$slots, "footer")
|
|
4422
|
+
], 2)) : D("", !0)
|
|
4423
|
+
], 2)
|
|
4424
|
+
], 6));
|
|
287
4425
|
}
|
|
288
|
-
})
|
|
4426
|
+
});
|
|
4427
|
+
function ml(e = {}) {
|
|
4428
|
+
return {
|
|
4429
|
+
/** Dismisses every toast, or only those in one corner. */
|
|
4430
|
+
closeAll(l) {
|
|
4431
|
+
oe.modules.Toast.prototype.closeAll.call(oe.modules.Toast.prototype, l);
|
|
4432
|
+
},
|
|
4433
|
+
show(l) {
|
|
4434
|
+
const o = new oe.modules.Toast({ ...e, ...l });
|
|
4435
|
+
return {
|
|
4436
|
+
close: () => o.close(),
|
|
4437
|
+
pause: () => o.pauseTimer(),
|
|
4438
|
+
resume: () => o.resumeTimer()
|
|
4439
|
+
};
|
|
4440
|
+
}
|
|
4441
|
+
};
|
|
4442
|
+
}
|
|
4443
|
+
const Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
289
4444
|
__proto__: null,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
4445
|
+
KAccordion: jt,
|
|
4446
|
+
KAccordionItem: Yt,
|
|
4447
|
+
KAlert: _t,
|
|
4448
|
+
KAvatar: fe,
|
|
4449
|
+
KAvatarGroup: lt,
|
|
4450
|
+
KBadge: Se,
|
|
4451
|
+
KBreadcrumb: ha,
|
|
4452
|
+
KBreadcrumbItem: ga,
|
|
4453
|
+
KButton: Ke,
|
|
4454
|
+
KCalendar: ya,
|
|
4455
|
+
KCard: Ka,
|
|
4456
|
+
KChat: nt,
|
|
4457
|
+
KChatDivider: vt,
|
|
4458
|
+
KChatDock: ct,
|
|
4459
|
+
KChatDockItem: ut,
|
|
4460
|
+
KChatDockPanel: ft,
|
|
4461
|
+
KChatMessage: ht,
|
|
4462
|
+
KChatMessageActions: Rs,
|
|
4463
|
+
KChatMessages: Re,
|
|
4464
|
+
KChatNotice: mt,
|
|
4465
|
+
KChatPrompt: gt,
|
|
4466
|
+
KChatShimmer: ze,
|
|
4467
|
+
KChatWindow: kt,
|
|
4468
|
+
KCheckbox: js,
|
|
4469
|
+
KCollapse: Vs,
|
|
4470
|
+
KContainer: Ws,
|
|
4471
|
+
KDrawer: Js,
|
|
4472
|
+
KDropdown: Kt,
|
|
4473
|
+
KDropdownItem: wt,
|
|
4474
|
+
KDropdownMenu: $t,
|
|
4475
|
+
KFileTree: uo,
|
|
4476
|
+
KGrid: vo,
|
|
4477
|
+
KGridColumn: ho,
|
|
4478
|
+
KGridRow: mo,
|
|
4479
|
+
KIcon: we,
|
|
4480
|
+
KInput: bt,
|
|
4481
|
+
KMenuList: ko,
|
|
4482
|
+
KMenuListItem: wo,
|
|
4483
|
+
KMessenger: As,
|
|
4484
|
+
KModal: Ao,
|
|
4485
|
+
KNavbar: Lo,
|
|
4486
|
+
KNavbarMenu: Bt,
|
|
4487
|
+
KNotificationList: xo,
|
|
4488
|
+
KNotificationListItem: zo,
|
|
4489
|
+
KPopover: dt,
|
|
4490
|
+
KProgress: Wo,
|
|
4491
|
+
KRadio: Fo,
|
|
4492
|
+
KSelect: Xo,
|
|
4493
|
+
KSpinner: el,
|
|
4494
|
+
KTab: al,
|
|
4495
|
+
KTabPanel: ll,
|
|
4496
|
+
KTable: sl,
|
|
4497
|
+
KTabs: rl,
|
|
4498
|
+
KToggle: ul,
|
|
4499
|
+
KTooltip: yt,
|
|
4500
|
+
KWorkspace: hl,
|
|
4501
|
+
accordionGroupKey: Ue,
|
|
4502
|
+
chatBusyKey: Ve,
|
|
4503
|
+
chatDockKey: xe,
|
|
4504
|
+
chatDockStoreKey: We,
|
|
4505
|
+
injectChatDock: zt,
|
|
4506
|
+
provideChatDock: at,
|
|
4507
|
+
useChatDock: st,
|
|
4508
|
+
useToast: ml
|
|
4509
|
+
}, Symbol.toStringTag, { value: "Module" })), bl = (e) => /^K[A-Z]/.test(e), Kl = {
|
|
297
4510
|
install(e) {
|
|
298
|
-
for (const
|
|
299
|
-
e.component(
|
|
300
|
-
a,
|
|
301
|
-
$[a]
|
|
302
|
-
);
|
|
4511
|
+
for (const l in Xe)
|
|
4512
|
+
bl(l) && e.component(l, Xe[l]);
|
|
303
4513
|
}
|
|
304
4514
|
};
|
|
305
4515
|
export {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
4516
|
+
jt as KAccordion,
|
|
4517
|
+
Yt as KAccordionItem,
|
|
4518
|
+
_t as KAlert,
|
|
4519
|
+
fe as KAvatar,
|
|
4520
|
+
lt as KAvatarGroup,
|
|
4521
|
+
Se as KBadge,
|
|
4522
|
+
ha as KBreadcrumb,
|
|
4523
|
+
ga as KBreadcrumbItem,
|
|
4524
|
+
Ke as KButton,
|
|
4525
|
+
ya as KCalendar,
|
|
4526
|
+
Ka as KCard,
|
|
4527
|
+
nt as KChat,
|
|
4528
|
+
vt as KChatDivider,
|
|
4529
|
+
ct as KChatDock,
|
|
4530
|
+
ut as KChatDockItem,
|
|
4531
|
+
ft as KChatDockPanel,
|
|
4532
|
+
ht as KChatMessage,
|
|
4533
|
+
Rs as KChatMessageActions,
|
|
4534
|
+
Re as KChatMessages,
|
|
4535
|
+
mt as KChatNotice,
|
|
4536
|
+
gt as KChatPrompt,
|
|
4537
|
+
ze as KChatShimmer,
|
|
4538
|
+
kt as KChatWindow,
|
|
4539
|
+
js as KCheckbox,
|
|
4540
|
+
Vs as KCollapse,
|
|
4541
|
+
Ws as KContainer,
|
|
4542
|
+
Js as KDrawer,
|
|
4543
|
+
Kt as KDropdown,
|
|
4544
|
+
wt as KDropdownItem,
|
|
4545
|
+
$t as KDropdownMenu,
|
|
4546
|
+
uo as KFileTree,
|
|
4547
|
+
vo as KGrid,
|
|
4548
|
+
ho as KGridColumn,
|
|
4549
|
+
mo as KGridRow,
|
|
4550
|
+
we as KIcon,
|
|
4551
|
+
bt as KInput,
|
|
4552
|
+
ko as KMenuList,
|
|
4553
|
+
wo as KMenuListItem,
|
|
4554
|
+
As as KMessenger,
|
|
4555
|
+
Ao as KModal,
|
|
4556
|
+
Lo as KNavbar,
|
|
4557
|
+
Bt as KNavbarMenu,
|
|
4558
|
+
xo as KNotificationList,
|
|
4559
|
+
zo as KNotificationListItem,
|
|
4560
|
+
dt as KPopover,
|
|
4561
|
+
Wo as KProgress,
|
|
4562
|
+
Fo as KRadio,
|
|
4563
|
+
Xo as KSelect,
|
|
4564
|
+
el as KSpinner,
|
|
4565
|
+
al as KTab,
|
|
4566
|
+
ll as KTabPanel,
|
|
4567
|
+
sl as KTable,
|
|
4568
|
+
rl as KTabs,
|
|
4569
|
+
ul as KToggle,
|
|
4570
|
+
yt as KTooltip,
|
|
4571
|
+
hl as KWorkspace,
|
|
4572
|
+
Ue as accordionGroupKey,
|
|
4573
|
+
Ve as chatBusyKey,
|
|
4574
|
+
xe as chatDockKey,
|
|
4575
|
+
We as chatDockStoreKey,
|
|
4576
|
+
Kl as default,
|
|
4577
|
+
zt as injectChatDock,
|
|
4578
|
+
at as provideChatDock,
|
|
4579
|
+
Ge as tabsKey,
|
|
4580
|
+
st as useChatDock,
|
|
4581
|
+
ml as useToast
|
|
313
4582
|
};
|