@vc-shell/framework 2.4.0-pr282.ab01220 → 2.4.0-pr284.ad0152c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-BRlCCxIa.js → VcScheduler.vue_vue_type_script_setup_true_lang-CCMK7yMK.js} +5139 -5089
  2. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-CCMK7yMK.js.map +1 -0
  3. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-C9fu-sdk.js +719 -0
  4. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-C9fu-sdk.js.map +1 -0
  5. package/dist/core/composables/usePopup/index.d.ts.map +1 -1
  6. package/dist/core/composables/usePopup/keys.d.ts +3 -1
  7. package/dist/core/composables/usePopup/keys.d.ts.map +1 -1
  8. package/dist/core/composables/usePopup/types.d.ts +32 -1
  9. package/dist/core/composables/usePopup/types.d.ts.map +1 -1
  10. package/dist/dashboard/index.js +1 -1
  11. package/dist/framework.js +6 -6
  12. package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -1
  13. package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts +5 -0
  14. package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts.map +1 -1
  15. package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts +30 -0
  16. package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts.map +1 -0
  17. package/dist/shell/_internal/popup/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
  18. package/dist/shell/dashboard/draggable-dashboard/GridstackDashboard.vue.d.ts.map +1 -1
  19. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts +5 -8
  20. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts.map +1 -1
  21. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts +6 -6
  22. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts.map +1 -1
  23. package/dist/shell/dashboard/draggable-dashboard/types.d.ts +11 -0
  24. package/dist/shell/dashboard/draggable-dashboard/types.d.ts.map +1 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts +8 -0
  27. package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts.map +1 -1
  28. package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts +5 -0
  29. package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts.map +1 -1
  30. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  31. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  32. package/dist/ui/index.js +1 -1
  33. package/package.json +4 -4
  34. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BRlCCxIa.js.map +0 -1
  35. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js +0 -679
  36. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js.map +0 -1
@@ -0,0 +1,719 @@
1
+ import { shallowRef as he, ref as D, watch as le, nextTick as de, onUnmounted as pe, openBlock as v, createElementBlock as _, createStaticVNode as me, defineComponent as B, inject as fe, computed as se, onMounted as ve, createBlock as V, withCtx as ge, unref as X, Fragment as re, renderList as ie, normalizeStyle as ye, normalizeClass as ce, createElementVNode as b, createCommentVNode as N, resolveDynamicComponent as _e, mergeProps as be, toDisplayString as Y, renderSlot as M, createVNode as we, withDirectives as ke } from "vue";
2
+ import { q as $e, r as xe, s as Se, l as Le } from "./VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js";
3
+ import { G as ze } from "./vendor-gridstack-Beau2jQ7.js";
4
+ import { M as We, _ as De } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js";
5
+ import "vee-validate";
6
+ import "./vendor-tiptap-starter-kit-ny-AoaO_.js";
7
+ import "./vendor-tiptap-extension-underline-Bo1pXXDN.js";
8
+ import "./vendor-tiptap-extension-table-QVjcLO_H.js";
9
+ import "./vendor-tiptap-extension-link-CETrc0Mo.js";
10
+ import "./vendor-tiptap-extension-image-BpqLcXdw.js";
11
+ import "./vendor-tiptap-extensions-D7eaegpB.js";
12
+ import "./vendor-tiptap-extension-text-style-Bc6nvmn0.js";
13
+ import "./vendor-js-beautify-D-6mWVv0.js";
14
+ import "./vendor-dompurify-DpIUMBYC.js";
15
+ import "./vendor-vuepic-vue-datepicker-D0bvbIbh.js";
16
+ import "./vendor-swiper-BgqGfw3Y.js";
17
+ import "vue-router";
18
+ import "../assets/d5f9664ebbfb104b.svg";
19
+ import "../assets/4e43c74354534fb3.svg";
20
+ import "../assets/e98196a9f8dcb2f0.svg";
21
+ import "../assets/74ed5f8a78e71106.svg";
22
+ import "../assets/1ea01de36eb5491b.svg";
23
+ import "../assets/d5a5b8630120073d.svg";
24
+ import "../assets/6798e4dd4add9b48.svg";
25
+ import "../assets/2d4e6190eec72737.svg";
26
+ import "../assets/9392bf1d591e1abb.svg";
27
+ import "../assets/204eaf512fde2023.svg";
28
+ import "../assets/0ba156439a339f2a.svg";
29
+ import "../assets/2857c513073467da.svg";
30
+ import "../assets/b645a4a2181b9dc1.svg";
31
+ import "../assets/b94421fadd23b0f2.svg";
32
+ import "../assets/6a3e73faf406cf33.svg";
33
+ import "../assets/e38acaa1757232e0.svg";
34
+ import "../assets/ca791c5ca5848a03.svg";
35
+ import "../assets/10768e2cc79fc60b.svg";
36
+ import "../assets/67230f05dc94a265.svg";
37
+ import "../assets/4d7a77b0e5373992.svg";
38
+ import "../assets/f7fc8bf46089d8b2.svg";
39
+ import "../assets/92508f8707159b51.svg";
40
+ import "../assets/b6499ddce0a4ef7d.svg";
41
+ import "../assets/fed13b0d59903483.svg";
42
+ import "../assets/34ff7dd0c2285956.svg";
43
+ import "../assets/bb28fb0f27f1c11b.svg";
44
+ import "../assets/21220a9d10e6c558.svg";
45
+ import "../assets/b372390551ca2fa1.svg";
46
+ import "../assets/262f46a0b6d94bb6.svg";
47
+ import "../assets/042c75b764bc78a7.svg";
48
+ import "../assets/b1a596e31ad1185a.svg";
49
+ import "../assets/15e91cdd649cde9a.svg";
50
+ import "../assets/e72bb11356af94c7.svg";
51
+ import "../assets/4fe75f5117100705.svg";
52
+ import "../assets/dd05d43ff0df2fc7.svg";
53
+ import "../assets/b325adcae33bbe7a.svg";
54
+ import "../assets/f09d89268e4c0317.svg";
55
+ import "../assets/9cb83236f6bb7ab1.svg";
56
+ import "../assets/d084bda16abe8a56.svg";
57
+ import "../assets/7eda727273fd98d3.svg";
58
+ import "../assets/572bb1bb4156a9c1.svg";
59
+ import "../assets/41275bcb979cb650.svg";
60
+ import "../assets/1de63eb118636cce.svg";
61
+ import "../assets/e5adb5ae3a3698f6.svg";
62
+ import "../assets/b5bb1e8fc975decd.svg";
63
+ import "../assets/157b8721e0600ea8.svg";
64
+ import "../assets/a18404194e3f9047.svg";
65
+ import "../assets/a2017fe7f0a26510.svg";
66
+ import "../assets/0f590f8a94577092.svg";
67
+ import "../assets/259e6ad461a52ad7.svg";
68
+ import "../assets/7d55399c2a7bc985.svg";
69
+ import "../assets/910b0d99b9e26568.svg";
70
+ import "../assets/e4a8550f1c7ffe36.svg";
71
+ import "../assets/2088983edf42e153.svg";
72
+ import "../assets/225da11d23968333.svg";
73
+ import "../assets/d32b129cae2fffd6.svg";
74
+ import "../assets/abf88f301a0730f4.svg";
75
+ import "../assets/0fc5820f8be53a1b.svg";
76
+ import "../assets/d3f792f54ae4c307.svg";
77
+ import "../assets/208f810a9321a327.svg";
78
+ import "../assets/72de3a63bc0b70dd.svg";
79
+ import "./vendor-iso-639-1-BEjYyfKo.js";
80
+ import "./vendor-cypress-signalr-mock-itnm2wpA.js";
81
+ import "./ExtensionPoint.vue_vue_type_style_index_0_lang-B1R06zHa.js";
82
+ import "./vendor-truncate-html-ChA1T5zy.js";
83
+ import "./vendor-sortablejs-Bsvu-FKn.js";
84
+ const j = "vc-dashboard-layout";
85
+ function Z(t, s) {
86
+ const a = s ?? t.position;
87
+ return {
88
+ id: t.id,
89
+ x: a?.x ?? 0,
90
+ y: a?.y ?? 0,
91
+ // A placement size wins over the declared one, so a saved or live resize is
92
+ // restored instead of snapping back to the widget's default.
93
+ w: s?.width ?? t.size.width,
94
+ h: s?.height ?? t.size.height,
95
+ minW: 2,
96
+ minH: 2
97
+ };
98
+ }
99
+ function ee(t) {
100
+ return {
101
+ id: t.id ?? "",
102
+ position: {
103
+ x: t.x ?? 0,
104
+ y: t.y ?? 0
105
+ },
106
+ size: {
107
+ width: t.w ?? 1,
108
+ height: t.h ?? 1
109
+ }
110
+ };
111
+ }
112
+ function Ae(t) {
113
+ const s = /* @__PURE__ */ new Map();
114
+ for (const a of t)
115
+ a.id && s.set(a.id, {
116
+ x: a.x ?? 0,
117
+ y: a.y ?? 0,
118
+ // Size is carried through as well; dropping it here is what used to make
119
+ // every resize — mouse or keyboard — invisible to state and to storage.
120
+ ...typeof a.w == "number" ? { width: a.w } : {},
121
+ ...typeof a.h == "number" ? { height: a.h } : {}
122
+ });
123
+ return s;
124
+ }
125
+ function te() {
126
+ try {
127
+ const t = localStorage.getItem(j);
128
+ if (!t) return null;
129
+ const s = JSON.parse(t);
130
+ if (Array.isArray(s))
131
+ return Ae(s);
132
+ if (typeof s == "object" && s !== null) {
133
+ const a = /* @__PURE__ */ new Map();
134
+ for (const [h, p] of Object.entries(s))
135
+ p && typeof p.x == "number" && typeof p.y == "number" && a.set(h, { x: p.x, y: p.y });
136
+ return a;
137
+ }
138
+ return null;
139
+ } catch (t) {
140
+ return console.warn("[GridstackAdapter] Failed to load layout from storage:", t), null;
141
+ }
142
+ }
143
+ function ue(t, s) {
144
+ try {
145
+ const a = t.map((h) => {
146
+ const p = s.get(h.id);
147
+ return {
148
+ id: h.id,
149
+ x: p?.x ?? h.position?.x ?? 0,
150
+ y: p?.y ?? h.position?.y ?? 0,
151
+ // Prefer the live size. Reading `widget.size` unconditionally is what used
152
+ // to discard every resize on reload, since that prop is never written back.
153
+ w: p?.width ?? h.size.width,
154
+ h: p?.height ?? h.size.height
155
+ };
156
+ });
157
+ localStorage.setItem(j, JSON.stringify(a));
158
+ } catch (a) {
159
+ console.warn("[GridstackAdapter] Failed to save layout to storage:", a);
160
+ }
161
+ }
162
+ function Ge() {
163
+ try {
164
+ localStorage.removeItem(j);
165
+ } catch (t) {
166
+ console.warn("[GridstackAdapter] Failed to clear layout storage:", t);
167
+ }
168
+ }
169
+ function Pe(t, s = 12) {
170
+ const a = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), p = (o, y, f, k) => {
171
+ for (let w = y; w < y + k; w++) {
172
+ const W = h.get(w) || [];
173
+ for (let S = o; S < o + f; S++)
174
+ if (W.includes(S)) return !1;
175
+ }
176
+ return !0;
177
+ }, z = (o, y, f, k) => {
178
+ for (let w = y; w < y + k; w++) {
179
+ const W = h.get(w) || [];
180
+ for (let S = o; S < o + f; S++)
181
+ W.push(S);
182
+ h.set(w, W);
183
+ }
184
+ }, i = (o, y) => {
185
+ let f = 0;
186
+ for (; ; ) {
187
+ for (let k = 0; k <= s - o; k++)
188
+ if (p(k, f, o, y))
189
+ return { x: k, y: f };
190
+ if (f++, f > 100) break;
191
+ }
192
+ return { x: 0, y: f };
193
+ };
194
+ for (const o of t) {
195
+ const y = i(o.size.width, o.size.height);
196
+ a.set(o.id, y), z(y.x, y.y, o.size.width, o.size.height);
197
+ }
198
+ return a;
199
+ }
200
+ function oe(t, s) {
201
+ if (s && s.size > 0) {
202
+ const h = /* @__PURE__ */ new Map();
203
+ for (const p of t) {
204
+ const z = s.get(p.id), i = p.position, o = z ?? i ?? { x: 0, y: 0 };
205
+ h.set(p.id, o);
206
+ }
207
+ return h;
208
+ }
209
+ if (t.every((h) => h.position !== void 0)) {
210
+ const h = /* @__PURE__ */ new Map();
211
+ for (const p of t)
212
+ h.set(p.id, p.position);
213
+ return h;
214
+ }
215
+ return Pe(t);
216
+ }
217
+ const Me = {
218
+ column: 12,
219
+ cellHeight: 80,
220
+ margin: "10px",
221
+ float: !1,
222
+ animate: !0,
223
+ // Disable responsive column changes - always use 12 columns
224
+ columnOpts: {
225
+ breakpoints: [{ w: 0, c: 12 }]
226
+ // Always 12 columns regardless of width
227
+ },
228
+ draggable: {
229
+ handle: ".grid-stack-item-content"
230
+ },
231
+ resizable: {
232
+ handles: "se"
233
+ // Only bottom-right corner
234
+ }
235
+ };
236
+ function Oe(t, s = {}) {
237
+ const { gridOptions: a = {}, resizable: h = !1, autoSave: p = !0, onLayoutChange: z } = s, i = he(null), o = D(/* @__PURE__ */ new Map()), y = D(!1), f = D(!1), k = {
238
+ ...Me,
239
+ ...a,
240
+ disableResize: !h
241
+ }, w = (r) => {
242
+ if (i.value) {
243
+ console.warn("[useGridstack] Grid already initialized");
244
+ return;
245
+ }
246
+ const l = te();
247
+ o.value = oe(t.value, l), i.value = ze.init(k, r), i.value.on("change", W), i.value.on("added", S), i.value.on("removed", J);
248
+ const c = t.value.map((g) => {
249
+ const m = o.value.get(g.id);
250
+ return Z(g, m);
251
+ });
252
+ i.value.load(c), y.value = !0;
253
+ }, W = (r, l) => {
254
+ if (!f.value) {
255
+ for (const c of l) {
256
+ const { id: g, position: m } = ee(c);
257
+ if (g) {
258
+ const $ = o.value.get(g), I = typeof c.w == "number" ? c.w : $?.width, L = typeof c.h == "number" ? c.h : $?.height;
259
+ o.value.set(g, {
260
+ ...m,
261
+ ...typeof I == "number" ? { width: I } : {},
262
+ ...typeof L == "number" ? { height: L } : {}
263
+ });
264
+ }
265
+ }
266
+ o.value = new Map(o.value), z?.(o.value), p && P();
267
+ }
268
+ }, S = (r, l) => {
269
+ for (const c of l) {
270
+ const { id: g, position: m } = ee(c);
271
+ g && !o.value.has(g) && o.value.set(g, m);
272
+ }
273
+ o.value = new Map(o.value);
274
+ }, J = (r, l) => {
275
+ for (const c of l)
276
+ c.id && o.value.delete(c.id);
277
+ o.value = new Map(o.value);
278
+ }, R = () => {
279
+ i.value && (i.value.off("change"), i.value.off("added"), i.value.off("removed"), i.value.destroy(!1), i.value = null, y.value = !1);
280
+ }, U = (r) => {
281
+ if (!i.value) return;
282
+ const l = o.value.get(r.id) ?? r.position, c = Z(r, l), g = document.querySelector(`[gs-id="${r.id}"]`);
283
+ g && i.value.makeWidget(g, c);
284
+ }, F = (r) => {
285
+ if (!i.value) return;
286
+ const l = document.querySelector(`[gs-id="${r}"]`);
287
+ l && i.value.removeWidget(l, !1), o.value.delete(r);
288
+ }, C = (r, l, c, g) => {
289
+ const m = l.gridstackNode, $ = o.value.get(r), I = m?.x ?? c?.x ?? $?.x ?? 0, L = m?.y ?? c?.y ?? $?.y ?? 0, H = m?.w ?? g?.width ?? $?.width, Q = m?.h ?? g?.height ?? $?.height;
290
+ o.value.set(r, {
291
+ x: I,
292
+ y: L,
293
+ ...typeof H == "number" ? { width: H } : {},
294
+ ...typeof Q == "number" ? { height: Q } : {}
295
+ }), o.value = new Map(o.value);
296
+ }, q = (r, l) => {
297
+ if (!i.value) return;
298
+ const c = document.querySelector(`[gs-id="${r}"]`);
299
+ c && (f.value = !0, i.value.update(c, { x: l.x, y: l.y }), C(r, c, l), f.value = !1);
300
+ }, G = (r, l) => {
301
+ if (!i.value) return;
302
+ const c = document.querySelector(`[gs-id="${r}"]`);
303
+ c && (f.value = !0, i.value.update(c, { w: l.width, h: l.height }), C(r, c, void 0, l), f.value = !1);
304
+ }, P = () => {
305
+ ue(t.value, o.value);
306
+ }, E = () => {
307
+ const r = te();
308
+ r && (o.value = oe(t.value, r), A());
309
+ }, T = () => {
310
+ o.value = /* @__PURE__ */ new Map();
311
+ for (const r of t.value)
312
+ r.position && o.value.set(r.id, { ...r.position });
313
+ A(), P();
314
+ }, A = () => {
315
+ if (i.value) {
316
+ f.value = !0, i.value.batchUpdate();
317
+ for (const r of t.value) {
318
+ const l = o.value.get(r.id);
319
+ if (l) {
320
+ const c = document.querySelector(`[gs-id="${r.id}"]`);
321
+ c && i.value.update(c, {
322
+ x: l.x,
323
+ y: l.y,
324
+ // Restores a persisted size; omitted when unknown so Gridstack keeps
325
+ // whatever the element already declares.
326
+ ...typeof l.width == "number" ? { w: l.width } : {},
327
+ ...typeof l.height == "number" ? { h: l.height } : {}
328
+ });
329
+ }
330
+ }
331
+ i.value.batchUpdate(!1), f.value = !1;
332
+ }
333
+ }, O = (r) => {
334
+ if (!i.value) {
335
+ r();
336
+ return;
337
+ }
338
+ f.value = !0, i.value.batchUpdate(), r(), i.value.batchUpdate(!1), f.value = !1;
339
+ };
340
+ return le(
341
+ t,
342
+ async (r, l) => {
343
+ if (!i.value || !y.value) return;
344
+ await de();
345
+ const c = r.filter((m) => !l?.some(($) => $.id === m.id)), g = l?.filter((m) => !r.some(($) => $.id === m.id)).map((m) => m.id) ?? [];
346
+ for (const m of g)
347
+ F(m);
348
+ for (const m of c)
349
+ U(m);
350
+ },
351
+ { deep: !1 }
352
+ ), pe(() => {
353
+ R();
354
+ }), {
355
+ grid: i,
356
+ layout: o,
357
+ isInitialized: y,
358
+ initGrid: w,
359
+ destroyGrid: R,
360
+ addWidget: U,
361
+ removeWidget: F,
362
+ updateWidgetPosition: q,
363
+ updateWidgetSize: G,
364
+ saveLayout: P,
365
+ loadLayout: E,
366
+ resetToDefaults: T,
367
+ batchUpdate: O
368
+ };
369
+ }
370
+ const Ee = {}, Te = {
371
+ class: "dashboard-widget-skeleton",
372
+ "aria-hidden": "true"
373
+ };
374
+ function Ie(t, s) {
375
+ return v(), _("div", Te, [...s[0] || (s[0] = [
376
+ me('<div class="dashboard-widget-skeleton__header"><div class="dashboard-widget-skeleton__icon"></div><div class="dashboard-widget-skeleton__title"></div></div><div class="dashboard-widget-skeleton__stats"><div class="dashboard-widget-skeleton__stat"></div><div class="dashboard-widget-skeleton__stat"></div><div class="dashboard-widget-skeleton__stat"></div></div><div class="dashboard-widget-skeleton__body"><div class="dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w80"></div><div class="dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w60"></div><div class="dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w90"></div><div class="dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w70"></div></div>', 3)
377
+ ])]);
378
+ }
379
+ const Ne = /* @__PURE__ */ $e(Ee, [["render", Ie]]), Be = ["aria-label"], Re = ["aria-label"], Ue = ["gs-id", "gs-x", "gs-y", "gs-w", "gs-h", "aria-label", "onKeydown"], Fe = { class: "grid-stack-item-content" }, Ce = {
380
+ key: 0,
381
+ class: "vc-gridstack-dashboard__drag-handle",
382
+ "aria-hidden": "true"
383
+ }, He = {
384
+ class: "vc-gridstack-dashboard__live-region",
385
+ role: "status",
386
+ "aria-live": "polite",
387
+ "aria-atomic": "true"
388
+ }, ne = 2, Ke = /* @__PURE__ */ B({
389
+ __name: "GridstackDashboard",
390
+ props: {
391
+ showDragHandles: { type: Boolean, default: !1 },
392
+ resizable: { type: Boolean, default: !1 },
393
+ ariaLabel: { default: "Dashboard widgets. Drag a widget, or focus one and press Enter to rearrange with the arrow keys." }
394
+ },
395
+ setup(t, { expose: s }) {
396
+ const a = [
397
+ { x: 0, y: 0, w: 6, h: 6 },
398
+ { x: 6, y: 0, w: 6, h: 6 },
399
+ { x: 0, y: 6, w: 6, h: 6 },
400
+ { x: 6, y: 6, w: 6, h: 6 }
401
+ ];
402
+ function h() {
403
+ if (typeof window > "u") return null;
404
+ try {
405
+ const e = window.localStorage.getItem(j);
406
+ if (!e) return null;
407
+ const u = JSON.parse(e);
408
+ if (!Array.isArray(u)) return null;
409
+ const n = u.filter(
410
+ (d) => !!d && typeof d == "object" && typeof d.w == "number" && typeof d.h == "number" && typeof d.x == "number" && typeof d.y == "number"
411
+ ).map((d) => ({ x: d.x, y: d.y, w: d.w, h: d.h }));
412
+ return n.length > 0 ? n : null;
413
+ } catch {
414
+ return null;
415
+ }
416
+ }
417
+ const p = t, z = D(null), i = D(""), o = fe(We, D(!0)), y = se(() => o.value ? [] : h() ?? a), f = (e) => ({
418
+ gridColumn: `${e.x + 1} / span ${e.w}`,
419
+ gridRow: `${e.y + 1} / span ${e.h}`
420
+ }), k = xe(), w = se(() => k.getWidgets()), { layout: W, isInitialized: S, initGrid: J, saveLayout: R, resetToDefaults: U, updateWidgetPosition: F, updateWidgetSize: C } = Oe(w, {
421
+ resizable: p.resizable,
422
+ autoSave: !0,
423
+ gridOptions: {
424
+ draggable: {
425
+ handle: p.showDragHandles ? ".vc-gridstack-dashboard__drag-handle" : ".grid-stack-item-content"
426
+ }
427
+ },
428
+ onLayoutChange: (e) => {
429
+ for (const [u, n] of e)
430
+ k.updateWidgetPosition(u, n);
431
+ L("Widget positions updated");
432
+ }
433
+ }), q = (e) => W.value.get(e), G = D(null), P = D(null), E = D(null), T = (e) => W.value.get(e.id) ?? e.position ?? { x: 0, y: 0 }, A = (e) => {
434
+ const u = W.value.get(e.id);
435
+ return {
436
+ width: u?.width ?? e.size.width,
437
+ height: u?.height ?? e.size.height
438
+ };
439
+ }, O = (e) => e.name || e.id, r = (e) => {
440
+ G.value = e.id, P.value = { ...T(e) }, E.value = { ...A(e) }, L(
441
+ `${O(e)} picked up. Use arrow keys to move, Shift and arrow keys to resize, Enter to drop, Escape to cancel.`
442
+ );
443
+ }, l = (e) => {
444
+ G.value = null, P.value = null, E.value = null, R();
445
+ const { x: u, y: n } = T(e);
446
+ L(`${O(e)} dropped at column ${u + 1}, row ${n + 1}.`);
447
+ }, c = (e) => {
448
+ const u = P.value, n = E.value, d = A(e);
449
+ n && (n.width !== d.width || n.height !== d.height) && C(e.id, n), u && F(e.id, u), G.value = null, P.value = null, E.value = null, L(`Move cancelled. ${O(e)} returned to its original position and size.`);
450
+ }, g = (e, u, n) => {
451
+ const d = T(e), x = { x: d.x + u, y: d.y + n };
452
+ if (x.x < 0 || x.y < 0) return;
453
+ F(e.id, x);
454
+ const K = T(e);
455
+ L(`${O(e)} moved to column ${K.x + 1}, row ${K.y + 1}.`);
456
+ }, m = (e, u, n) => {
457
+ const d = A(e), x = u ? Math.max(ne, d.width + u) : d.width, K = n ? Math.max(ne, d.height + n) : d.height;
458
+ if (x === d.width && K === d.height) return;
459
+ C(e.id, { width: x, height: K });
460
+ const ae = A(e);
461
+ L(`${O(e)} resized to ${ae.width} by ${ae.height} cells.`);
462
+ }, $ = (e, u) => {
463
+ const n = G.value === u.id;
464
+ if (e.key === "Enter" || e.key === " ") {
465
+ e.preventDefault(), n ? l(u) : r(u);
466
+ return;
467
+ }
468
+ if (e.key === "Escape" && n) {
469
+ e.preventDefault(), c(u);
470
+ return;
471
+ }
472
+ const d = e.key === "ArrowLeft" ? -1 : e.key === "ArrowRight" ? 1 : 0, x = e.key === "ArrowUp" ? -1 : e.key === "ArrowDown" ? 1 : 0;
473
+ d === 0 && x === 0 || !n || (e.preventDefault(), e.shiftKey ? p.resizable && m(u, d, x) : g(u, d, x));
474
+ }, I = (e, u) => {
475
+ const n = e.name || e.id, d = G.value === e.id ? "Picked up. Arrow keys move, Enter drops, Escape cancels." : "Press Enter to pick up and rearrange with the arrow keys.";
476
+ return `${n}, widget ${u + 1} of ${w.value.length}. ${d}`;
477
+ }, L = (e) => {
478
+ i.value = e, setTimeout(() => {
479
+ i.value = "";
480
+ }, 1e3);
481
+ }, H = async () => {
482
+ await de(), z.value && !S.value && J(z.value);
483
+ };
484
+ return ve(H), le(o, (e) => {
485
+ e && H();
486
+ }), s({
487
+ rearrangeWidgets: () => {
488
+ U();
489
+ },
490
+ recalculateLayout: () => {
491
+ },
492
+ saveLayout: R,
493
+ useBuiltInPositions: () => (U(), !0)
494
+ }), (e, u) => (v(), V(Se, {
495
+ "no-padding": "",
496
+ class: "vc-gridstack-dashboard"
497
+ }, {
498
+ default: ge(() => [
499
+ X(o) ? (v(), _("div", {
500
+ key: 1,
501
+ ref_key: "gridRef",
502
+ ref: z,
503
+ class: "grid-stack vc-gridstack-dashboard__grid",
504
+ role: "list",
505
+ "aria-label": t.ariaLabel
506
+ }, [
507
+ (v(!0), _(re, null, ie(w.value, (n, d) => (v(), _("div", {
508
+ key: n.id,
509
+ class: ce(["grid-stack-item", { "vc-gridstack-dashboard__item--grabbed": G.value === n.id }]),
510
+ "gs-id": n.id,
511
+ "gs-x": q(n.id)?.x ?? n.position?.x ?? 0,
512
+ "gs-y": q(n.id)?.y ?? n.position?.y ?? 0,
513
+ "gs-w": A(n).width,
514
+ "gs-h": A(n).height,
515
+ "gs-min-w": 2,
516
+ "gs-min-h": 2,
517
+ role: "listitem",
518
+ tabindex: "0",
519
+ "aria-label": I(n, d),
520
+ onKeydown: (x) => $(x, n)
521
+ }, [
522
+ b("div", Fe, [
523
+ t.showDragHandles ? (v(), _("div", Ce, [...u[0] || (u[0] = [
524
+ b("svg", {
525
+ width: "16",
526
+ height: "16",
527
+ viewBox: "0 0 16 16",
528
+ fill: "currentColor"
529
+ }, [
530
+ b("circle", {
531
+ cx: "5",
532
+ cy: "3",
533
+ r: "1.5"
534
+ }),
535
+ b("circle", {
536
+ cx: "11",
537
+ cy: "3",
538
+ r: "1.5"
539
+ }),
540
+ b("circle", {
541
+ cx: "5",
542
+ cy: "8",
543
+ r: "1.5"
544
+ }),
545
+ b("circle", {
546
+ cx: "11",
547
+ cy: "8",
548
+ r: "1.5"
549
+ }),
550
+ b("circle", {
551
+ cx: "5",
552
+ cy: "13",
553
+ r: "1.5"
554
+ }),
555
+ b("circle", {
556
+ cx: "11",
557
+ cy: "13",
558
+ r: "1.5"
559
+ })
560
+ ], -1)
561
+ ])])) : N("", !0),
562
+ (v(), V(_e(n.component), be({ ref_for: !0 }, n.props || {}, { class: "vc-gridstack-dashboard__widget-content" }), null, 16))
563
+ ])
564
+ ], 42, Ue))), 128))
565
+ ], 8, Re)) : (v(), _("div", {
566
+ key: 0,
567
+ class: "vc-gridstack-dashboard__skeleton-grid",
568
+ role: "status",
569
+ "aria-busy": "true",
570
+ "aria-label": t.ariaLabel
571
+ }, [
572
+ (v(!0), _(re, null, ie(y.value, (n, d) => (v(), V(Ne, {
573
+ key: `skeleton-${d}`,
574
+ class: "vc-gridstack-dashboard__skeleton-item",
575
+ style: ye(f(n))
576
+ }, null, 8, ["style"]))), 128))
577
+ ], 8, Be)),
578
+ b("div", He, Y(i.value), 1)
579
+ ]),
580
+ _: 1
581
+ }));
582
+ }
583
+ }), No = /* @__PURE__ */ B({
584
+ __name: "DraggableDashboard",
585
+ props: {
586
+ showDragHandles: { type: Boolean, default: !1 },
587
+ resizable: { type: Boolean, default: !1 },
588
+ ariaLabel: { default: "Dashboard widgets. Drag widgets to rearrange." }
589
+ },
590
+ setup(t, { expose: s }) {
591
+ const a = D(null);
592
+ return s({
593
+ rearrangeWidgets: () => {
594
+ a.value?.rearrangeWidgets?.();
595
+ },
596
+ recalculateLayout: () => {
597
+ a.value?.recalculateLayout?.();
598
+ },
599
+ saveLayout: () => {
600
+ a.value?.saveLayout?.();
601
+ },
602
+ useBuiltInPositions: () => a.value?.useBuiltInPositions?.() ?? !1
603
+ }), (o, y) => (v(), V(Ke, {
604
+ ref_key: "dashboardRef",
605
+ ref: a,
606
+ "show-drag-handles": t.showDragHandles,
607
+ resizable: t.resizable,
608
+ "aria-label": t.ariaLabel
609
+ }, null, 8, ["show-drag-handles", "resizable", "aria-label"]));
610
+ }
611
+ }), Bo = Z, Ro = ee, Uo = te, Fo = ue, Co = oe, Ho = Ge, Ko = j, je = { class: "dashboard-widget-card" }, qe = { class: "dashboard-widget-card__header" }, Ve = { class: "dashboard-widget-card__header-content" }, Ye = {
612
+ key: 0,
613
+ class: "dashboard-widget-card__icon-wrapper"
614
+ }, Je = { class: "dashboard-widget-card__title" }, Qe = {
615
+ key: 0,
616
+ class: "dashboard-widget-card__actions"
617
+ }, Xe = {
618
+ key: 0,
619
+ class: "dashboard-widget-card__stats"
620
+ }, Ze = { class: "dashboard-widget-card__body" }, et = {
621
+ key: 1,
622
+ class: "dashboard-widget-card__footer"
623
+ }, jo = /* @__PURE__ */ B({
624
+ __name: "dashboard-widget-card",
625
+ props: {
626
+ header: {},
627
+ icon: {},
628
+ loading: { type: Boolean }
629
+ },
630
+ setup(t) {
631
+ const s = t;
632
+ return (a, h) => (v(), _("div", je, [
633
+ b("div", qe, [
634
+ M(a.$slots, "header", {}, () => [
635
+ b("div", Ve, [
636
+ t.icon ? (v(), _("div", Ye, [
637
+ we(X(De), {
638
+ class: "dashboard-widget-card__icon",
639
+ icon: t.icon,
640
+ size: "l"
641
+ }, null, 8, ["icon"])
642
+ ])) : N("", !0),
643
+ b("div", Je, Y(s.header), 1)
644
+ ])
645
+ ]),
646
+ a.$slots.actions ? (v(), _("div", Qe, [
647
+ M(a.$slots, "actions")
648
+ ])) : N("", !0)
649
+ ]),
650
+ a.$slots.stats ? (v(), _("div", Xe, [
651
+ M(a.$slots, "stats")
652
+ ])) : N("", !0),
653
+ ke((v(), _("div", Ze, [
654
+ M(a.$slots, "content")
655
+ ])), [
656
+ [X(Le), t.loading]
657
+ ]),
658
+ a.$slots.footer ? (v(), _("div", et, [
659
+ M(a.$slots, "footer")
660
+ ])) : N("", !0)
661
+ ]));
662
+ }
663
+ }), tt = { class: "dashboard-stat-item" }, ot = { class: "dashboard-stat-item__label" }, qo = /* @__PURE__ */ B({
664
+ __name: "dashboard-stat-item",
665
+ props: {
666
+ value: {},
667
+ label: {},
668
+ variant: {}
669
+ },
670
+ setup(t) {
671
+ return (s, a) => (v(), _("div", tt, [
672
+ b("div", {
673
+ class: ce(["dashboard-stat-item__value", t.variant ? `dashboard-stat-item__value--${t.variant}` : ""])
674
+ }, Y(t.value), 3),
675
+ b("div", ot, Y(t.label), 1)
676
+ ]));
677
+ }
678
+ }), at = { class: "tw-divide-y tw-divide-[var(--neutrals-200)]" }, Vo = /* @__PURE__ */ B({
679
+ __name: "dashboard-feed-list",
680
+ setup(t) {
681
+ return (s, a) => (v(), _("div", at, [
682
+ M(s.$slots, "default")
683
+ ]));
684
+ }
685
+ }), st = { class: "tw-flex tw-items-center tw-gap-2.5 tw-min-w-0" }, rt = {
686
+ key: 0,
687
+ class: "tw-flex tw-items-center tw-gap-3 tw-flex-shrink-0 tw-ml-3"
688
+ }, Yo = /* @__PURE__ */ B({
689
+ __name: "dashboard-feed-row",
690
+ emits: ["click"],
691
+ setup(t) {
692
+ return (s, a) => (v(), _("div", {
693
+ class: "dashboard-feed-row",
694
+ onClick: a[0] || (a[0] = (h) => s.$emit("click"))
695
+ }, [
696
+ b("div", st, [
697
+ M(s.$slots, "default")
698
+ ]),
699
+ s.$slots.trailing ? (v(), _("div", rt, [
700
+ M(s.$slots, "trailing")
701
+ ])) : N("", !0)
702
+ ]));
703
+ }
704
+ });
705
+ export {
706
+ Ko as L,
707
+ Vo as _,
708
+ Yo as a,
709
+ qo as b,
710
+ jo as c,
711
+ No as d,
712
+ Ho as e,
713
+ Ro as f,
714
+ Uo as l,
715
+ Co as m,
716
+ Fo as s,
717
+ Bo as t,
718
+ Oe as u
719
+ };