@vue/devtools-electron 8.0.2 → 8.0.3

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 (28) hide show
  1. package/client/IconTitle.vue_vue_type_script_setup_true_lang-DLtdfn-T.js +25 -0
  2. package/client/{SectionBlock-xKhegVP9.js → SectionBlock-cb4DPSS8.js} +32 -32
  3. package/client/assets-DrHz0toh.js +1049 -0
  4. package/client/{components-BrOQ-ofv.js → components-D9oYqSOd.js} +3 -3
  5. package/client/{custom-inspector-tab-view-CkdhUYIP.js → custom-inspector-tab-view-BXQti9hQ.js} +3 -3
  6. package/client/{custom-tab-view-B5kvwrLc.js → custom-tab-view-vRg-h0gX.js} +3 -3
  7. package/client/devtools-panel.css +1 -1
  8. package/client/devtools-panel.js +1 -1
  9. package/client/{graph-CFurbIKf.js → graph-DAdoYvsj.js} +24166 -23913
  10. package/client/{index-i0Vo12ev.js → index-e6Cke-ty.js} +15848 -16028
  11. package/client/{overview-BJSdT74g.js → overview-DoRkU2w7.js} +2 -2
  12. package/client/{pages-IcPQYatG.js → pages-D6NTK9Y9.js} +128 -128
  13. package/client/pinia-CcHBChl0.js +11 -0
  14. package/client/{router-Dw9ZK4h3.js → router-CPCI84Qu.js} +1 -1
  15. package/client/{settings-kuD3Maam.js → settings-DEG_TfAU.js} +11 -11
  16. package/client/{timeline-BeMBNQIL.js → timeline-nZEynGnP.js} +38 -38
  17. package/dist/cli.cjs +4 -4
  18. package/dist/cli.mjs +4 -4
  19. package/dist/devtools.js +286 -311
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/user-app.cjs +1 -1
  23. package/dist/user-app.iife.js +55 -55
  24. package/dist/user-app.js +1 -1
  25. package/package.json +7 -8
  26. package/client/IconTitle.vue_vue_type_script_setup_true_lang-Dw_OETO7.js +0 -25
  27. package/client/assets-_5Yea5Fb.js +0 -1049
  28. package/client/pinia-DKTNMgsj.js +0 -11
@@ -0,0 +1,1049 @@
1
+ import { d as T, aq as lt, ay as Z, i as w, a7 as at, c as h, a as P, o as u, b as l, F as z, v as F, n as M, u as n, t as _, s as C, a6 as rt, e as S, w as A, H, r as L, M as Q, T as E, ak as X, az as ut, av as nt, Y as ct, aA as Y, aa as dt, q as D, S as st, f as tt, U as q, a5 as ot, aB as pt, ax as K, z as G, aj as et, a8 as ht, aC as ft, aD as mt, aw as vt, a0 as yt, at as gt, I as xt, J as bt, V as wt } from "./index-e6Cke-ty.js";
2
+ import { _ as $t } from "./SectionBlock-cb4DPSS8.js";
3
+ import { _ as _t } from "./IconTitle.vue_vue_type_script_setup_true_lang-DLtdfn-T.js";
4
+ const kt = {
5
+ key: 0,
6
+ relative: "",
7
+ "code-block": ""
8
+ }, Bt = {
9
+ flex: "~ wrap",
10
+ "w-full": ""
11
+ }, Ct = ["onClick"], At = {
12
+ flex: "~ gap-2",
13
+ px3: "",
14
+ pb3: ""
15
+ }, Pt = /* @__PURE__ */ T({
16
+ __name: "CodeSnippets",
17
+ props: {
18
+ codeSnippets: {},
19
+ eventType: {}
20
+ },
21
+ setup(a) {
22
+ const i = a, t = lt(i.codeSnippets[0]), { copy: e } = Z(), o = w(() => t.value?.lang || "text");
23
+ return at(() => {
24
+ i.codeSnippets.includes(t.value) || (t.value = i.codeSnippets[0]);
25
+ }), (s, r) => a.codeSnippets.length ? (u(), h("div", kt, [
26
+ l("div", Bt, [
27
+ (u(!0), h(z, null, F(a.codeSnippets, (d, y) => (u(), h("button", {
28
+ key: y,
29
+ px4: "",
30
+ py2: "",
31
+ border: "r base",
32
+ hover: "bg-active",
33
+ class: M(d === n(t) ? "" : "border-b"),
34
+ onClick: (m) => t.value = d
35
+ }, [
36
+ l("div", {
37
+ class: M(d === n(t) ? "" : "op30"),
38
+ "font-mono": ""
39
+ }, _(d.name), 3)
40
+ ], 10, Ct))), 128)),
41
+ r[1] || (r[1] = l("div", {
42
+ border: "b base",
43
+ "flex-auto": ""
44
+ }, null, -1))
45
+ ]),
46
+ n(t) ? (u(), h(z, { key: 0 }, [
47
+ C(n(rt), {
48
+ code: n(t).code,
49
+ lang: n(o),
50
+ lines: !1,
51
+ "w-full": "",
52
+ "of-auto": "",
53
+ p3: ""
54
+ }, null, 8, ["code", "lang"]),
55
+ l("div", At, [
56
+ C(n(Q), {
57
+ onClick: r[0] || (r[0] = (d) => n(e)(n(t).code, { silent: !1, type: a.eventType || `code-snippet-${n(t).name}` }))
58
+ }, {
59
+ icon: A(() => [
60
+ L(s.$slots, "i-carbon-copy")
61
+ ]),
62
+ default: A(() => [
63
+ r[2] || (r[2] = H(" Copy ", -1))
64
+ ]),
65
+ _: 3
66
+ }),
67
+ n(t)?.docs ? (u(), S(n(Q), {
68
+ key: 0,
69
+ to: n(t).docs,
70
+ target: "_blank"
71
+ }, {
72
+ icon: A(() => [
73
+ L(s.$slots, "i-carbon-catalog")
74
+ ]),
75
+ default: A(() => [
76
+ r[3] || (r[3] = H(" Docs ", -1))
77
+ ]),
78
+ _: 3
79
+ }, 8, ["to"])) : P("", !0)
80
+ ])
81
+ ], 64)) : P("", !0)
82
+ ])) : P("", !0);
83
+ }
84
+ }), St = ["title"], zt = /* @__PURE__ */ T({
85
+ __name: "FilepathItem",
86
+ props: {
87
+ filepath: {},
88
+ lineBreak: { type: Boolean },
89
+ subpath: { type: Boolean }
90
+ },
91
+ setup(a) {
92
+ const i = a, t = w(
93
+ () => ({ path: i.filepath })
94
+ ), { copy: e } = Z();
95
+ return (o, s) => E((u(), h("button", {
96
+ "font-mono": "",
97
+ "hover:underline": "",
98
+ class: M(a.lineBreak ? "" : "ws-nowrap of-hidden truncate"),
99
+ title: a.filepath,
100
+ onClick: s[0] || (s[0] = (r) => n(e)(a.filepath))
101
+ }, [
102
+ H(_(n(t).path), 1)
103
+ ], 10, St)), [
104
+ [n(X), "Copy file path"]
105
+ ]);
106
+ }
107
+ });
108
+ function jt(a) {
109
+ return typeof a == "string" ? `'${a}'` : new Vt().serialize(a);
110
+ }
111
+ const Vt = /* @__PURE__ */ (function() {
112
+ class a {
113
+ #t = /* @__PURE__ */ new Map();
114
+ compare(t, e) {
115
+ const o = typeof t, s = typeof e;
116
+ return o === "string" && s === "string" ? t.localeCompare(e) : o === "number" && s === "number" ? t - e : String.prototype.localeCompare.call(this.serialize(t, !0), this.serialize(e, !0));
117
+ }
118
+ serialize(t, e) {
119
+ if (t === null) return "null";
120
+ switch (typeof t) {
121
+ case "string":
122
+ return e ? t : `'${t}'`;
123
+ case "bigint":
124
+ return `${t}n`;
125
+ case "object":
126
+ return this.$object(t);
127
+ case "function":
128
+ return this.$function(t);
129
+ }
130
+ return String(t);
131
+ }
132
+ serializeObject(t) {
133
+ const e = Object.prototype.toString.call(t);
134
+ if (e !== "[object Object]") return this.serializeBuiltInType(e.length < 10 ? `unknown:${e}` : e.slice(8, -1), t);
135
+ const o = t.constructor, s = o === Object || o === void 0 ? "" : o.name;
136
+ if (s !== "" && globalThis[s] === o) return this.serializeBuiltInType(s, t);
137
+ if (typeof t.toJSON == "function") {
138
+ const r = t.toJSON();
139
+ return s + (r !== null && typeof r == "object" ? this.$object(r) : `(${this.serialize(r)})`);
140
+ }
141
+ return this.serializeObjectEntries(s, Object.entries(t));
142
+ }
143
+ serializeBuiltInType(t, e) {
144
+ const o = this["$" + t];
145
+ if (o) return o.call(this, e);
146
+ if (typeof e?.entries == "function") return this.serializeObjectEntries(t, e.entries());
147
+ throw new Error(`Cannot serialize ${t}`);
148
+ }
149
+ serializeObjectEntries(t, e) {
150
+ const o = Array.from(e).sort((r, d) => this.compare(r[0], d[0]));
151
+ let s = `${t}{`;
152
+ for (let r = 0; r < o.length; r++) {
153
+ const [d, y] = o[r];
154
+ s += `${this.serialize(d, !0)}:${this.serialize(y)}`, r < o.length - 1 && (s += ",");
155
+ }
156
+ return s + "}";
157
+ }
158
+ $object(t) {
159
+ let e = this.#t.get(t);
160
+ return e === void 0 && (this.#t.set(t, `#${this.#t.size}`), e = this.serializeObject(t), this.#t.set(t, e)), e;
161
+ }
162
+ $function(t) {
163
+ const e = Function.prototype.toString.call(t);
164
+ return e.slice(-15) === "[native code] }" ? `${t.name || ""}()[native]` : `${t.name}(${t.length})${e.replace(/\s*\n\s*/g, "")}`;
165
+ }
166
+ $Array(t) {
167
+ let e = "[";
168
+ for (let o = 0; o < t.length; o++) e += this.serialize(t[o]), o < t.length - 1 && (e += ",");
169
+ return e + "]";
170
+ }
171
+ $Date(t) {
172
+ try {
173
+ return `Date(${t.toISOString()})`;
174
+ } catch {
175
+ return "Date(null)";
176
+ }
177
+ }
178
+ $ArrayBuffer(t) {
179
+ return `ArrayBuffer[${new Uint8Array(t).join(",")}]`;
180
+ }
181
+ $Set(t) {
182
+ return `Set${this.$Array(Array.from(t).sort((e, o) => this.compare(e, o)))}`;
183
+ }
184
+ $Map(t) {
185
+ return this.serializeObjectEntries("Map", t.entries());
186
+ }
187
+ }
188
+ for (const i of ["Error", "RegExp", "URL"]) a.prototype["$" + i] = function(t) {
189
+ return `${i}(${t})`;
190
+ };
191
+ for (const i of ["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"]) a.prototype["$" + i] = function(t) {
192
+ return `${i}[${t.join(",")}]`;
193
+ };
194
+ for (const i of ["BigInt64Array", "BigUint64Array"]) a.prototype["$" + i] = function(t) {
195
+ return `${i}[${t.join("n,")}${t.length > 0 ? "n" : ""}]`;
196
+ };
197
+ return a;
198
+ })(), It = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225], Dt = [1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998], Tt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", O = [];
199
+ class Ut {
200
+ _data = new J();
201
+ _hash = new J([...It]);
202
+ _nDataBytes = 0;
203
+ _minBufferSize = 0;
204
+ finalize(i) {
205
+ i && this._append(i);
206
+ const t = this._nDataBytes * 8, e = this._data.sigBytes * 8;
207
+ return this._data.words[e >>> 5] |= 128 << 24 - e % 32, this._data.words[(e + 64 >>> 9 << 4) + 14] = Math.floor(t / 4294967296), this._data.words[(e + 64 >>> 9 << 4) + 15] = t, this._data.sigBytes = this._data.words.length * 4, this._process(), this._hash;
208
+ }
209
+ _doProcessBlock(i, t) {
210
+ const e = this._hash.words;
211
+ let o = e[0], s = e[1], r = e[2], d = e[3], y = e[4], m = e[5], j = e[6], V = e[7];
212
+ for (let b = 0; b < 64; b++) {
213
+ if (b < 16) O[b] = i[t + b] | 0;
214
+ else {
215
+ const p = O[b - 15], c = (p << 25 | p >>> 7) ^ (p << 14 | p >>> 18) ^ p >>> 3, $ = O[b - 2], k = ($ << 15 | $ >>> 17) ^ ($ << 13 | $ >>> 19) ^ $ >>> 10;
216
+ O[b] = c + O[b - 7] + k + O[b - 16];
217
+ }
218
+ const U = y & m ^ ~y & j, W = o & s ^ o & r ^ s & r, g = (o << 30 | o >>> 2) ^ (o << 19 | o >>> 13) ^ (o << 10 | o >>> 22), f = (y << 26 | y >>> 6) ^ (y << 21 | y >>> 11) ^ (y << 7 | y >>> 25), v = V + f + U + Dt[b] + O[b], I = g + W;
219
+ V = j, j = m, m = y, y = d + v | 0, d = r, r = s, s = o, o = v + I | 0;
220
+ }
221
+ e[0] = e[0] + o | 0, e[1] = e[1] + s | 0, e[2] = e[2] + r | 0, e[3] = e[3] + d | 0, e[4] = e[4] + y | 0, e[5] = e[5] + m | 0, e[6] = e[6] + j | 0, e[7] = e[7] + V | 0;
222
+ }
223
+ _append(i) {
224
+ typeof i == "string" && (i = J.fromUtf8(i)), this._data.concat(i), this._nDataBytes += i.sigBytes;
225
+ }
226
+ _process(i) {
227
+ let t, e = this._data.sigBytes / 64;
228
+ i ? e = Math.ceil(e) : e = Math.max((e | 0) - this._minBufferSize, 0);
229
+ const o = e * 16, s = Math.min(o * 4, this._data.sigBytes);
230
+ if (o) {
231
+ for (let r = 0; r < o; r += 16) this._doProcessBlock(this._data.words, r);
232
+ t = this._data.words.splice(0, o), this._data.sigBytes -= s;
233
+ }
234
+ return new J(t, s);
235
+ }
236
+ }
237
+ class J {
238
+ words;
239
+ sigBytes;
240
+ constructor(i, t) {
241
+ i = this.words = i || [], this.sigBytes = t === void 0 ? i.length * 4 : t;
242
+ }
243
+ static fromUtf8(i) {
244
+ const t = unescape(encodeURIComponent(i)), e = t.length, o = [];
245
+ for (let s = 0; s < e; s++) o[s >>> 2] |= (t.charCodeAt(s) & 255) << 24 - s % 4 * 8;
246
+ return new J(o, e);
247
+ }
248
+ toBase64() {
249
+ const i = [];
250
+ for (let t = 0; t < this.sigBytes; t += 3) {
251
+ const e = this.words[t >>> 2] >>> 24 - t % 4 * 8 & 255, o = this.words[t + 1 >>> 2] >>> 24 - (t + 1) % 4 * 8 & 255, s = this.words[t + 2 >>> 2] >>> 24 - (t + 2) % 4 * 8 & 255, r = e << 16 | o << 8 | s;
252
+ for (let d = 0; d < 4 && t * 8 + d * 6 < this.sigBytes * 8; d++) i.push(Tt.charAt(r >>> 6 * (3 - d) & 63));
253
+ }
254
+ return i.join("");
255
+ }
256
+ concat(i) {
257
+ if (this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8, this.words.length = Math.ceil(this.sigBytes / 4), this.sigBytes % 4) for (let t = 0; t < i.sigBytes; t++) {
258
+ const e = i.words[t >>> 2] >>> 24 - t % 4 * 8 & 255;
259
+ this.words[this.sigBytes + t >>> 2] |= e << 24 - (this.sigBytes + t) % 4 * 8;
260
+ }
261
+ else for (let t = 0; t < i.sigBytes; t += 4) this.words[this.sigBytes + t >>> 2] = i.words[t >>> 2];
262
+ this.sigBytes += i.sigBytes;
263
+ }
264
+ }
265
+ function Ot(a) {
266
+ return new Ut().finalize(a).toBase64();
267
+ }
268
+ function Ft(a) {
269
+ return Ot(jt(a));
270
+ }
271
+ const Et = /* @__PURE__ */ T({
272
+ __name: "AssetFontPreview",
273
+ props: {
274
+ asset: {}
275
+ },
276
+ setup(a) {
277
+ const i = a, t = w(() => `devtools-assets-${Ft(i.asset)}`);
278
+ return ut(w(() => `
279
+ @font-face {
280
+ font-family: '${t.value}';
281
+ src: url('${i.asset.publicPath}');
282
+ }
283
+ `)), (e, o) => (u(), h("div", {
284
+ "of-hidden": "",
285
+ style: nt({ fontFamily: `'${n(t)}'` })
286
+ }, " Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz ", 4));
287
+ }
288
+ }), Mt = {
289
+ flex: "",
290
+ "items-center": "",
291
+ "justify-center": "",
292
+ "of-hidden": "",
293
+ "bg-active": "",
294
+ "object-cover": "",
295
+ p1: ""
296
+ }, Lt = ["src"], Rt = {
297
+ key: 2,
298
+ "i-carbon-document": "",
299
+ "text-3xl": "",
300
+ op20: ""
301
+ }, Nt = {
302
+ key: 3,
303
+ "w-full": "",
304
+ "self-start": "",
305
+ p4: ""
306
+ }, qt = ["textContent"], Gt = { key: 4 }, Jt = ["src", "autoplay", "controls"], Ht = { key: 5 }, Kt = {
307
+ key: 0,
308
+ "i-carbon-volume-up": "",
309
+ "text-3xl": "",
310
+ op20: ""
311
+ }, Wt = ["src"], Xt = {
312
+ key: 6,
313
+ "i-vscode-icons-file-type-wasm": "",
314
+ "text-3xl": ""
315
+ }, Yt = {
316
+ key: 7,
317
+ "i-carbon-help": "",
318
+ "text-3xl": "",
319
+ op20: ""
320
+ }, it = /* @__PURE__ */ T({
321
+ __name: "AssetPreview",
322
+ props: {
323
+ asset: {},
324
+ textContent: {},
325
+ detail: { type: Boolean }
326
+ },
327
+ setup(a) {
328
+ return (i, t) => {
329
+ const e = Et;
330
+ return u(), h("div", Mt, [
331
+ a.asset.type === "image" ? (u(), h("img", {
332
+ key: 0,
333
+ src: a.asset.publicPath
334
+ }, null, 8, Lt)) : a.asset.type === "font" ? (u(), S(e, {
335
+ key: a.asset.publicPath,
336
+ asset: a.asset,
337
+ "self-stretch": "",
338
+ p2: "",
339
+ "text-2xl": ""
340
+ }, null, 8, ["asset"])) : a.asset.type === "text" && !a.textContent ? (u(), h("div", Rt)) : a.asset.type === "text" && a.textContent ? (u(), h("div", Nt, [
341
+ l("pre", {
342
+ "max-h-10rem": "",
343
+ "of-hidden": "",
344
+ "text-xs": "",
345
+ "font-mono": "",
346
+ textContent: _(a.textContent)
347
+ }, null, 8, qt)
348
+ ])) : a.asset.type === "video" ? (u(), h("div", Gt, [
349
+ l("video", {
350
+ src: a.asset.publicPath,
351
+ autoplay: a.detail,
352
+ controls: a.detail
353
+ }, null, 8, Jt)
354
+ ])) : a.asset.type === "audio" ? (u(), h("div", Ht, [
355
+ a.detail ? (u(), h("audio", {
356
+ key: 1,
357
+ src: a.asset.publicPath,
358
+ controls: ""
359
+ }, null, 8, Wt)) : (u(), h("div", Kt))
360
+ ])) : a.asset.type === "wasm" ? (u(), h("div", Xt)) : (u(), h("div", Yt))
361
+ ]);
362
+ };
363
+ }
364
+ }), Qt = {
365
+ flex: "~ col gap-4",
366
+ "min-h-full": "",
367
+ "w-full": "",
368
+ "of-hidden": "",
369
+ p4: ""
370
+ }, Zt = {
371
+ flex: "~",
372
+ "items-center": "",
373
+ "justify-center": ""
374
+ }, te = {
375
+ "max-w-full": "",
376
+ "w-full": "",
377
+ "table-fixed": ""
378
+ }, ee = {
379
+ flex: "~ gap-1",
380
+ "w-full": "",
381
+ "items-center": ""
382
+ }, ne = {
383
+ flex: "~ gap-1",
384
+ "w-full": "",
385
+ "items-center": "",
386
+ "of-hidden": ""
387
+ }, se = {
388
+ "flex-auto": "",
389
+ "of-hidden": "",
390
+ truncate: "",
391
+ "ws-pre": "",
392
+ "font-mono": ""
393
+ }, oe = { capitalize: "" }, ie = { key: 0 }, le = { op70: "" }, ae = { flex: "~ gap2 wrap" }, re = /* @__PURE__ */ T({
394
+ __name: "AssetDetails",
395
+ props: {
396
+ modelValue: {}
397
+ },
398
+ setup(a, { emit: i }) {
399
+ const t = a, e = i, o = ct(), s = st(t, "modelValue", e, { passive: !0 }), r = w(() => o.vitePluginDetected.value), d = Y(() => K.value.getAssetImporters(s.value.publicPath).then((p) => p), []), y = w(() => dt.value), m = Y(() => {
400
+ if (s.value.type === "image")
401
+ return K.value.getImageMeta(s.value.filePath).then((p) => p);
402
+ }), j = D(), V = D(0), b = Y(async () => {
403
+ if (s.value.type !== "text")
404
+ return;
405
+ V.value;
406
+ const p = await K.value.getTextAssetContent(s.value.filePath).then((c) => c);
407
+ return j.value = p, p;
408
+ }), U = w(() => {
409
+ const p = [];
410
+ if (s.value.type === "image") {
411
+ const c = m.value?.width ? `
412
+ width="${m.value.width}"
413
+ height="${m.value.height}" ` : " ";
414
+ return p.push(
415
+ { lang: "vue-html", code: `<img${c}
416
+ src="${s.value.publicPath}"
417
+ />`, name: "Plain Image" }
418
+ ), p;
419
+ }
420
+ return p.push({
421
+ lang: "html",
422
+ code: `<a download href="${s.value.publicPath}">
423
+ Download ${s.value.path.split("/").slice(-1)[0]}
424
+ </a>`,
425
+ name: "Download link"
426
+ }), p;
427
+ }), { copy: W } = Z(), g = pt(() => s.value.mtime), f = w(() => {
428
+ const p = s.value.size;
429
+ return p < 1024 ? `${p} B` : p < 1024 * 1024 ? `${(p / 1024).toFixed(2)} KB` : `${(p / 1024 / 1024).toFixed(2)} MB`;
430
+ }), v = w(() => {
431
+ if (!m.value?.width || !m.value?.height)
432
+ return "";
433
+ const p = ($, k) => k ? p(k, $ % k) : $, c = p(m.value.width, m.value.height);
434
+ return c > 3 ? `${m.value.width / c}:${m.value.height / c}` : "";
435
+ }), I = w(() => [
436
+ "image",
437
+ "text",
438
+ "video",
439
+ "audio",
440
+ "font"
441
+ ].includes(s.value.type));
442
+ return (p, c) => {
443
+ const $ = it, k = zt, R = ot("RouterLink"), x = Pt;
444
+ return u(), h("div", Qt, [
445
+ n(I) ? (u(), h(z, { key: 0 }, [
446
+ c[2] || (c[2] = l("div", {
447
+ flex: "~ gap2",
448
+ "mb--2": "",
449
+ "items-center": "",
450
+ op50: ""
451
+ }, [
452
+ l("div", { "x-divider": "" }),
453
+ l("div", { "flex-none": "" }, " Preview "),
454
+ l("div", { "x-divider": "" })
455
+ ], -1)),
456
+ l("div", Zt, [
457
+ C($, {
458
+ detail: "",
459
+ "max-h-80": "",
460
+ "min-h-20": "",
461
+ "min-w-20": "",
462
+ "w-auto": "",
463
+ rounded: "",
464
+ border: "~ base",
465
+ asset: n(s),
466
+ "text-content": n(b)
467
+ }, null, 8, ["asset", "text-content"])
468
+ ])
469
+ ], 64)) : P("", !0),
470
+ c[12] || (c[12] = l("div", {
471
+ flex: "~ gap2",
472
+ "mb--2": "",
473
+ "items-center": "",
474
+ op50: ""
475
+ }, [
476
+ l("div", { "x-divider": "" }),
477
+ l("div", { "flex-none": "" }, " Details "),
478
+ l("div", { "x-divider": "" })
479
+ ], -1)),
480
+ l("table", te, [
481
+ l("tbody", null, [
482
+ l("tr", null, [
483
+ c[3] || (c[3] = l("td", {
484
+ "w-30": "",
485
+ "ws-nowrap": "",
486
+ pr5: "",
487
+ "text-right": "",
488
+ op50: ""
489
+ }, " Filepath ", -1)),
490
+ l("td", null, [
491
+ l("div", ee, [
492
+ C(k, {
493
+ filepath: n(s).filePath,
494
+ "text-left": ""
495
+ }, null, 8, ["filepath"]),
496
+ n(r) && n(y) ? E((u(), S(n(q), {
497
+ key: 0,
498
+ title: "Open in Editor",
499
+ icon: "i-carbon-launch",
500
+ action: "",
501
+ "flex-none": "",
502
+ border: !1,
503
+ onClick: c[0] || (c[0] = (B) => n(tt)(n(s).filePath))
504
+ }, null, 512)), [
505
+ [n(X), "Open in Editor"]
506
+ ]) : P("", !0)
507
+ ])
508
+ ])
509
+ ]),
510
+ l("tr", null, [
511
+ c[4] || (c[4] = l("td", {
512
+ "w-30": "",
513
+ "ws-nowrap": "",
514
+ pr5: "",
515
+ "text-right": "",
516
+ op50: ""
517
+ }, " Public Path ", -1)),
518
+ l("td", null, [
519
+ l("div", ne, [
520
+ l("div", se, _(n(s).publicPath), 1),
521
+ E(C(n(q), {
522
+ title: "Copy public path",
523
+ icon: "i-carbon-copy",
524
+ action: "",
525
+ mr1: "",
526
+ "mt--2px": "",
527
+ "flex-none": "",
528
+ border: !1,
529
+ onClick: c[1] || (c[1] = (B) => n(W)(n(s).publicPath, { type: "assets-public-path" }))
530
+ }, null, 512), [
531
+ [n(X), "Copy public path"]
532
+ ]),
533
+ C(R, {
534
+ to: n(s).publicPath,
535
+ target: "_blank"
536
+ }, {
537
+ default: A(() => [
538
+ E(C(n(q), {
539
+ icon: "i-carbon-launch",
540
+ action: "",
541
+ "flex-none": "",
542
+ border: !1,
543
+ title: "Open in Browser"
544
+ }, null, 512), [
545
+ [n(X), "Open in Browser"]
546
+ ])
547
+ ]),
548
+ _: 1
549
+ }, 8, ["to"])
550
+ ])
551
+ ])
552
+ ]),
553
+ l("tr", null, [
554
+ c[5] || (c[5] = l("td", {
555
+ "w-30": "",
556
+ "ws-nowrap": "",
557
+ pr5: "",
558
+ "text-right": "",
559
+ op50: ""
560
+ }, " Type ", -1)),
561
+ l("td", oe, _(n(s).type), 1)
562
+ ]),
563
+ n(m)?.width ? (u(), h(z, { key: 0 }, [
564
+ l("tr", null, [
565
+ c[6] || (c[6] = l("td", {
566
+ "w-30": "",
567
+ "ws-nowrap": "",
568
+ pr5: "",
569
+ "text-right": "",
570
+ op50: ""
571
+ }, " Image Size ", -1)),
572
+ l("td", null, _(n(m).width) + " x " + _(n(m).height), 1)
573
+ ]),
574
+ n(v) ? (u(), h("tr", ie, [
575
+ c[7] || (c[7] = l("td", {
576
+ "w-30": "",
577
+ "ws-nowrap": "",
578
+ pr5: "",
579
+ "text-right": "",
580
+ op50: ""
581
+ }, " Aspect Ratio ", -1)),
582
+ l("td", null, _(n(v)), 1)
583
+ ])) : P("", !0)
584
+ ], 64)) : P("", !0),
585
+ l("tr", null, [
586
+ c[8] || (c[8] = l("td", {
587
+ "w-30": "",
588
+ "ws-nowrap": "",
589
+ pr5: "",
590
+ "text-right": "",
591
+ op50: ""
592
+ }, " File size ", -1)),
593
+ l("td", null, _(n(f)), 1)
594
+ ]),
595
+ l("tr", null, [
596
+ c[9] || (c[9] = l("td", {
597
+ "w-30": "",
598
+ "ws-nowrap": "",
599
+ pr5: "",
600
+ "text-right": "",
601
+ op50: ""
602
+ }, " Last modified ", -1)),
603
+ l("td", null, [
604
+ H(_(new Date(n(s).mtime).toLocaleString()) + " ", 1),
605
+ l("span", le, "(" + _(n(g)) + ")", 1)
606
+ ])
607
+ ]),
608
+ l("tr", null, [
609
+ c[10] || (c[10] = l("td", {
610
+ "w-30": "",
611
+ "ws-nowrap": "",
612
+ pr5: "",
613
+ "text-right": "",
614
+ "align-top": "",
615
+ op50: ""
616
+ }, " Importers ", -1)),
617
+ l("td", null, [
618
+ n(d).length > 0 ? (u(!0), h(z, { key: 0 }, F(n(d), (B) => (u(), h("div", {
619
+ key: B.url,
620
+ flex: "~ gap-1",
621
+ "w-full": "",
622
+ "items-center": ""
623
+ }, [
624
+ C(k, {
625
+ filepath: B.id || B.url,
626
+ "text-left": ""
627
+ }, null, 8, ["filepath"]),
628
+ n(o).vitePluginDetected.value && n(y) && B.id ? E((u(), S(n(q), {
629
+ key: 0,
630
+ title: "Open in Editor",
631
+ icon: "i-carbon-launch",
632
+ action: "",
633
+ "flex-none": "",
634
+ border: !1,
635
+ onClick: (N) => n(tt)(B.id)
636
+ }, null, 8, ["onClick"])), [
637
+ [n(X), "Open in Editor"]
638
+ ]) : P("", !0)
639
+ ]))), 128)) : (u(), h(z, { key: 1 }, [
640
+ H(" None ")
641
+ ], 64))
642
+ ])
643
+ ])
644
+ ])
645
+ ]),
646
+ c[13] || (c[13] = l("div", {
647
+ flex: "~ gap2",
648
+ "mb--2": "",
649
+ "items-center": "",
650
+ op50: ""
651
+ }, [
652
+ l("div", { "x-divider": "" }),
653
+ l("div", { "flex-none": "" }, " Actions "),
654
+ l("div", { "x-divider": "" })
655
+ ], -1)),
656
+ l("div", ae, [
657
+ C(n(Q), {
658
+ to: n(s).publicPath,
659
+ download: "",
660
+ target: "_blank"
661
+ }, {
662
+ icon: A(() => [
663
+ L(p.$slots, "i-carbon-download")
664
+ ]),
665
+ default: A(() => [
666
+ c[11] || (c[11] = H(" Download ", -1))
667
+ ]),
668
+ _: 3
669
+ }, 8, ["to"])
670
+ ]),
671
+ c[14] || (c[14] = l("div", { "flex-auto": "" }, null, -1)),
672
+ n(U).length ? (u(), S(x, {
673
+ key: 1,
674
+ border: "t base",
675
+ "mx--4": "",
676
+ "mb--4": "",
677
+ "code-snippets": n(U)
678
+ }, null, 8, ["code-snippets"])) : P("", !0)
679
+ ]);
680
+ };
681
+ }
682
+ }), ue = /* @__PURE__ */ T({
683
+ __name: "AssetListItem",
684
+ props: {
685
+ item: {},
686
+ index: { default: 0 },
687
+ modelValue: {}
688
+ },
689
+ setup(a, { emit: i }) {
690
+ const t = a, o = st(t, "modelValue", i, { passive: !0 }), s = w(() => t.item?.children?.length), r = D(!0), d = w(() => s.value ? "i-carbon-folder" : t.item.type === "image" ? "i-carbon-image" : t.item.type === "video" ? "i-carbon-video" : t.item.type === "audio" ? "i-carbon-volume-up" : t.item.type === "font" ? "i-carbon-text-small-caps" : t.item.type === "text" ? "i-carbon-document" : t.item.type === "json" ? "i-carbon-json" : t.item.type === "wasm" ? "i-vscode-icons-file-type-wasm" : "i-carbon-document-blank");
691
+ return (y, m) => {
692
+ const j = ot("AssetListItem", !0);
693
+ return u(), h("div", null, [
694
+ l("button", {
695
+ flex: "~ gap-2",
696
+ "w-full": "",
697
+ "items-center": "",
698
+ hover: "bg-active",
699
+ px4: "",
700
+ py1: "",
701
+ style: nt({ paddingLeft: `calc(1rem + ${a.index * 1.5}em)` }),
702
+ class: M({ "bg-active": !n(s) && n(o)?.filePath === a.item?.filePath }),
703
+ border: "b base",
704
+ onClick: m[0] || (m[0] = (V) => n(s) ? r.value = !n(r) : o.value = a.item)
705
+ }, [
706
+ l("div", {
707
+ class: M(n(d))
708
+ }, null, 2),
709
+ l("span", {
710
+ class: M({ "flex items-center": n(s) }),
711
+ "flex-auto": "",
712
+ "text-start": "",
713
+ "text-sm": "",
714
+ "font-mono": ""
715
+ }, _(a.item.path), 3),
716
+ n(s) ? (u(), S(n(q), {
717
+ key: 0,
718
+ icon: "carbon:chevron-right",
719
+ "transform-rotate": n(r) ? 90 : 0,
720
+ transition: ""
721
+ }, null, 8, ["transform-rotate"])) : P("", !0)
722
+ ], 6),
723
+ n(r) ? L(y.$slots, "default", { key: 0 }, () => [
724
+ (u(!0), h(z, null, F(a.item?.children, (V) => (u(), S(j, {
725
+ key: V.filepath,
726
+ modelValue: n(o),
727
+ "onUpdate:modelValue": m[1] || (m[1] = (b) => G(o) ? o.value = b : null),
728
+ item: V,
729
+ index: a.index + 1
730
+ }, null, 8, ["modelValue", "item", "index"]))), 128))
731
+ ]) : P("", !0)
732
+ ]);
733
+ };
734
+ }
735
+ }), ce = {
736
+ flex: "~ col gap-1",
737
+ hover: "bg-active",
738
+ "items-center": "",
739
+ "of-hidden": "",
740
+ rounded: "",
741
+ p2: ""
742
+ }, de = {
743
+ "w-full": "",
744
+ "of-hidden": "",
745
+ truncate: "",
746
+ "ws-nowrap": "",
747
+ "text-center": "",
748
+ "text-xs": ""
749
+ }, pe = /* @__PURE__ */ T({
750
+ __name: "AssetGridItem",
751
+ props: {
752
+ asset: {},
753
+ folder: {}
754
+ },
755
+ setup(a) {
756
+ const i = a, t = w(() => i.folder && i.asset.path.startsWith(i.folder) ? i.asset.path.slice(i.folder.length) : i.asset.path);
757
+ return (e, o) => {
758
+ const s = it;
759
+ return u(), h("button", ce, [
760
+ C(s, {
761
+ "h-30": "",
762
+ "w-30": "",
763
+ rounded: "",
764
+ border: "~ base",
765
+ asset: a.asset
766
+ }, null, 8, ["asset"]),
767
+ l("div", de, _(n(t)), 1)
768
+ ]);
769
+ };
770
+ }
771
+ }), he = {
772
+ flex: "~ col gap2",
773
+ border: "b base",
774
+ "navbar-glass": "",
775
+ "flex-1": "",
776
+ p4: ""
777
+ }, fe = {
778
+ flex: "~ gap4",
779
+ "items-center": ""
780
+ }, me = /* @__PURE__ */ T({
781
+ __name: "Navbar",
782
+ props: {
783
+ search: {},
784
+ noPadding: { type: Boolean }
785
+ },
786
+ emits: ["update:search"],
787
+ setup(a, { emit: i }) {
788
+ const t = a, e = i, o = D(t.search);
789
+ return et(() => t.search, (s) => {
790
+ o.value = s;
791
+ }), et(o, () => {
792
+ e("update:search", o.value);
793
+ }), (s, r) => (u(), h("div", he, [
794
+ l("div", fe, [
795
+ L(s.$slots, "search", {}, () => [
796
+ a.search !== void 0 ? (u(), S(n(ht), {
797
+ key: 0,
798
+ modelValue: n(o),
799
+ "onUpdate:modelValue": r[0] || (r[0] = (d) => G(o) ? o.value = d : null),
800
+ placeholder: "Search...",
801
+ "left-icon": "i-carbon-search",
802
+ class: M(["flex-auto", { "px-5 py-2": !a.noPadding }])
803
+ }, null, 8, ["modelValue", "class"])) : P("", !0)
804
+ ]),
805
+ L(s.$slots, "actions")
806
+ ]),
807
+ L(s.$slots, "default")
808
+ ]));
809
+ }
810
+ }), ve = {
811
+ block: "",
812
+ "h-full": "",
813
+ "of-hidden": "",
814
+ class: "drawer-container relative"
815
+ }, ye = {
816
+ "h-full": "",
817
+ "w-full": "",
818
+ "of-auto": ""
819
+ }, ge = {
820
+ "flex-none": "",
821
+ flex: "~ gap2 items-center",
822
+ "text-lg": ""
823
+ }, xe = {
824
+ flex: "~ items-center justify-center",
825
+ absolute: "",
826
+ "bottom-0": "",
827
+ "right-2px": "",
828
+ "h-4": "",
829
+ "w-4": "",
830
+ "rounded-full": "",
831
+ "bg-primary-800": "",
832
+ "text-8px": "",
833
+ "text-white": ""
834
+ }, be = {
835
+ "w-full": "",
836
+ flex: "~ gap-2 items-center",
837
+ rounded: "",
838
+ px2: "",
839
+ py2: ""
840
+ }, we = {
841
+ "text-xs": "",
842
+ op75: ""
843
+ }, $e = { op50: "" }, _e = { key: 0 }, ke = {
844
+ "mt--4": "",
845
+ px2: "",
846
+ grid: "~ cols-minmax-8rem"
847
+ }, Be = {
848
+ key: 1,
849
+ p2: "",
850
+ grid: "~ cols-minmax-8rem"
851
+ }, Ce = { key: 1 }, Ae = 50, Ve = /* @__PURE__ */ T({
852
+ __name: "assets",
853
+ setup(a) {
854
+ const i = D(""), t = D(), e = D("grid"), o = D([]), s = w(() => {
855
+ const g = [];
856
+ for (const f of o.value || []) {
857
+ const v = f.path.split(".").pop();
858
+ v && !g.find((I) => I.value === v) && g.push({ label: v, value: v });
859
+ }
860
+ return g;
861
+ }), r = D([]);
862
+ ft(() => s.value, (g) => {
863
+ r.value = g.map((f) => f.value);
864
+ });
865
+ const d = D(), y = w(() => new mt(o.value || [], {
866
+ keys: [
867
+ "path"
868
+ ]
869
+ })), m = w(() => (i.value ? y.value.search(i.value).map((f) => f.item) : o.value || []).filter((f) => {
870
+ const v = f.path.split(".").pop();
871
+ return !v || r.value.includes(v);
872
+ })), j = w(() => {
873
+ const g = {};
874
+ for (const f of m.value) {
875
+ const v = `${f.relativePath.split("/").slice(0, -1).join("/")}/`;
876
+ g[v] || (g[v] = []), g[v].push(f);
877
+ }
878
+ return Object.entries(g).sort(([f], [v]) => f.localeCompare(v));
879
+ }), V = w(() => {
880
+ const g = { children: [] }, f = (v, I, p) => {
881
+ const [c, ...$] = I;
882
+ let k = v.children.find((R) => R.path === c);
883
+ k || (k = { ...p, path: c, children: [] }, v.children.push(k)), $.length > 1 ? f(k, $, p) : $.length === 1 && k.children.push({ ...p, path: $[0] });
884
+ };
885
+ return m.value.forEach((v) => {
886
+ const I = v.relativePath.split("/").filter((p) => p !== "");
887
+ f(g, I, v);
888
+ }), g.children;
889
+ });
890
+ function b() {
891
+ K.value.getStaticAssets().then((g) => {
892
+ o.value = g;
893
+ });
894
+ }
895
+ function U() {
896
+ b();
897
+ }
898
+ vt(() => {
899
+ b(), K.functions.on("assetsUpdated", U);
900
+ });
901
+ function W() {
902
+ e.value = e.value === "list" ? "grid" : "list";
903
+ }
904
+ return yt(() => {
905
+ K.functions.off("assetsUpdated", U);
906
+ }), (g, f) => {
907
+ const v = _t, I = me, p = pe, c = $t, $ = ue, k = re, R = wt("tooltip");
908
+ return u(), h("div", ve, [
909
+ l("div", ye, [
910
+ C(I, {
911
+ ref_key: "navbar",
912
+ ref: t,
913
+ search: n(i),
914
+ "onUpdate:search": f[1] || (f[1] = (x) => G(i) ? i.value = x : null),
915
+ pb2: "",
916
+ "no-padding": !0
917
+ }, {
918
+ actions: A(() => [
919
+ l("div", ge, [
920
+ C(n(xt), {
921
+ modelValue: n(r),
922
+ "onUpdate:modelValue": f[0] || (f[0] = (x) => G(r) ? r.value = x : null),
923
+ multiple: !0,
924
+ options: n(s)
925
+ }, {
926
+ button: A(() => [
927
+ E((u(), S(v, {
928
+ icon: "i-carbon-filter hover:op50",
929
+ border: !1,
930
+ title: "Filter",
931
+ relative: "",
932
+ "cursor-pointer": "",
933
+ p2: "",
934
+ "text-lg": "",
935
+ onClick: () => {
936
+ }
937
+ }, {
938
+ default: A(() => [
939
+ l("span", xe, _(n(r).length), 1)
940
+ ]),
941
+ _: 1
942
+ })), [
943
+ [
944
+ R,
945
+ "Filter",
946
+ void 0,
947
+ { "bottom-end": !0 }
948
+ ]
949
+ ])
950
+ ]),
951
+ item: A(({
952
+ item: x,
953
+ active: B
954
+ }) => [
955
+ l("div", be, [
956
+ C(n(bt), { "model-value": B }, null, 8, ["model-value"]),
957
+ l("span", we, _(x.label), 1)
958
+ ])
959
+ ]),
960
+ _: 1
961
+ }, 8, ["modelValue", "options"]),
962
+ E(C(n(q), {
963
+ border: !1,
964
+ icon: n(e) === "grid" ? "i-carbon-list" : "i-carbon-grid",
965
+ title: "Toggle view",
966
+ action: "",
967
+ "cursor-pointer": "",
968
+ "text-lg": "",
969
+ onClick: W
970
+ }, null, 8, ["icon"]), [
971
+ [
972
+ R,
973
+ "Toggle View",
974
+ void 0,
975
+ { "bottom-end": !0 }
976
+ ]
977
+ ])
978
+ ])
979
+ ]),
980
+ default: A(() => [
981
+ l("div", $e, [
982
+ n(i) ? (u(), h("span", _e, _(n(m).length) + " matched · ", 1)) : P("", !0),
983
+ l("span", null, _(n(o)?.length) + " assets in total", 1)
984
+ ])
985
+ ]),
986
+ _: 1
987
+ }, 8, ["search"]),
988
+ n(e) === "grid" ? (u(), h(z, { key: 0 }, [
989
+ n(j).length > 1 ? (u(!0), h(z, { key: 0 }, F(n(j), ([x, B]) => (u(), S(c, {
990
+ key: x,
991
+ text: x,
992
+ description: `${B.length} items`,
993
+ open: B.length <= Ae,
994
+ padding: !1
995
+ }, {
996
+ default: A(() => [
997
+ l("div", ke, [
998
+ (u(!0), h(z, null, F(B, (N) => (u(), S(p, {
999
+ key: N.path,
1000
+ asset: N,
1001
+ folder: x,
1002
+ onClick: (Pe) => d.value = N
1003
+ }, null, 8, ["asset", "folder", "onClick"]))), 128))
1004
+ ])
1005
+ ]),
1006
+ _: 2
1007
+ }, 1032, ["text", "description", "open"]))), 128)) : (u(), h("div", Be, [
1008
+ (u(!0), h(z, null, F(n(m), (x) => (u(), S(p, {
1009
+ key: x.path,
1010
+ asset: x,
1011
+ onClick: (B) => d.value = x
1012
+ }, null, 8, ["asset", "onClick"]))), 128))
1013
+ ]))
1014
+ ], 64)) : (u(), h("div", Ce, [
1015
+ (u(!0), h(z, null, F(n(V), (x, B) => (u(), S($, {
1016
+ key: B,
1017
+ modelValue: n(d),
1018
+ "onUpdate:modelValue": f[2] || (f[2] = (N) => G(d) ? d.value = N : null),
1019
+ item: x
1020
+ }, null, 8, ["modelValue", "item"]))), 128))
1021
+ ]))
1022
+ ]),
1023
+ C(n(gt), {
1024
+ "model-value": !!n(d),
1025
+ top: n(t),
1026
+ permanent: "",
1027
+ "mount-to": ".drawer-container",
1028
+ position: "absolute",
1029
+ "content-class": "w120 text-sm",
1030
+ "onUpdate:modelValue": f[4] || (f[4] = (x) => {
1031
+ x || (d.value = void 0);
1032
+ })
1033
+ }, {
1034
+ default: A(() => [
1035
+ n(d) ? (u(), S(k, {
1036
+ key: 0,
1037
+ modelValue: n(d),
1038
+ "onUpdate:modelValue": f[3] || (f[3] = (x) => G(d) ? d.value = x : null)
1039
+ }, null, 8, ["modelValue"])) : P("", !0)
1040
+ ]),
1041
+ _: 1
1042
+ }, 8, ["model-value", "top"])
1043
+ ]);
1044
+ };
1045
+ }
1046
+ });
1047
+ export {
1048
+ Ve as default
1049
+ };