@pinia/colada-devtools 0.0.3 → 0.0.5
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/dist/index.js +239 -230
- package/dist/index.js.map +1 -1
- package/dist-panel/{_queryId_-dahx0N-a.js → _queryId_-BGMH9Qyr.js} +65 -65
- package/dist-panel/_queryId_-BGMH9Qyr.js.map +1 -0
- package/dist-panel/{index-BoUh47CR.js → index-BqoCeMqo.js} +2 -2
- package/dist-panel/{index-BoUh47CR.js.map → index-BqoCeMqo.js.map} +1 -1
- package/dist-panel/{index-BkrEntNA.js → index-D9g_5JvD.js} +3 -3
- package/dist-panel/{index-BkrEntNA.js.map → index-D9g_5JvD.js.map} +1 -1
- package/dist-panel/{index-Covr4drg.js → index-hPJdBAcc.js} +945 -926
- package/dist-panel/{index-Covr4drg.js.map → index-hPJdBAcc.js.map} +1 -1
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-CuAz6irK.js → loader-HsZ_tw6Q.js} +2 -2
- package/dist-panel/loader-HsZ_tw6Q.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-BRg0nGpd.js → mouse-pointer-click-BVbSKgPQ.js} +2 -2
- package/dist-panel/mouse-pointer-click-BVbSKgPQ.js.map +1 -0
- package/dist-panel/mutations-C5PrXZzg.js +13 -0
- package/dist-panel/mutations-C5PrXZzg.js.map +1 -0
- package/dist-panel/{queries-C8H8bbDX.js → queries-D1tnLOMJ.js} +88 -89
- package/dist-panel/queries-D1tnLOMJ.js.map +1 -0
- package/dist-panel/{settings-DoijmHf7.js → settings-BDqpjtmF.js} +2 -2
- package/dist-panel/{settings-DoijmHf7.js.map → settings-BDqpjtmF.js.map} +1 -1
- package/dist-shared/index.d.ts +1 -1
- package/dist-shared/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-panel/_queryId_-dahx0N-a.js.map +0 -1
- package/dist-panel/loader-CuAz6irK.js.map +0 -1
- package/dist-panel/mouse-pointer-click-BRg0nGpd.js.map +0 -1
- package/dist-panel/mutations-ComK9mEg.js +0 -13
- package/dist-panel/mutations-ComK9mEg.js.map +0 -1
- package/dist-panel/queries-C8H8bbDX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as
|
|
1
|
+
import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as T, getCurrentScope as J, onScopeDispose as Q, useTemplateRef as oe, shallowRef as N, watch as _, onBeforeUnmount as ie, createBlock as W, openBlock as x, Teleport as re, createElementVNode as se, nextTick as G, readonly as K, getCurrentInstance as ae, toRef as le, customRef as ue, computed as U, unref as F, withCtx as ce, createElementBlock as de } from "vue";
|
|
2
2
|
import { useQueryCache as fe } from "@pinia/colada";
|
|
3
3
|
import { DEVTOOLS_INFO_KEY as p, DuplexChannel as pe } from "@pinia/colada-devtools/shared";
|
|
4
4
|
const ve = /* @__PURE__ */ $({
|
|
@@ -7,89 +7,89 @@ const ve = /* @__PURE__ */ $({
|
|
|
7
7
|
const t = R(!1);
|
|
8
8
|
return L(() => {
|
|
9
9
|
t.value = !0;
|
|
10
|
-
}), (
|
|
10
|
+
}), (n, l) => t.value ? ne(n.$slots, "default", { key: 0 }) : M("", !0);
|
|
11
11
|
}
|
|
12
|
-
}),
|
|
12
|
+
}), b = () => performance.timeOrigin + performance.now();
|
|
13
13
|
function me(e) {
|
|
14
14
|
var t;
|
|
15
15
|
if (!I.has(e)) {
|
|
16
16
|
I.set(e, !0);
|
|
17
|
-
for (const
|
|
18
|
-
|
|
17
|
+
for (const n of e.getEntries())
|
|
18
|
+
n[t = p] ?? (n[t] = {
|
|
19
19
|
count: {
|
|
20
20
|
total: 0,
|
|
21
21
|
succeed: 0,
|
|
22
22
|
errored: 0,
|
|
23
23
|
cancelled: 0
|
|
24
24
|
},
|
|
25
|
-
updatedAt:
|
|
25
|
+
updatedAt: b(),
|
|
26
26
|
inactiveAt: 0,
|
|
27
27
|
simulate: null,
|
|
28
28
|
history: []
|
|
29
29
|
});
|
|
30
|
-
e.$onAction(({ name:
|
|
30
|
+
e.$onAction(({ name: n, args: l, after: r, onError: d }) => {
|
|
31
31
|
var h, f;
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (n === "create")
|
|
33
|
+
r((s) => {
|
|
34
|
+
s[p] = {
|
|
35
35
|
count: {
|
|
36
36
|
total: 0,
|
|
37
37
|
succeed: 0,
|
|
38
38
|
errored: 0,
|
|
39
39
|
cancelled: 0
|
|
40
40
|
},
|
|
41
|
-
updatedAt:
|
|
41
|
+
updatedAt: b(),
|
|
42
42
|
inactiveAt: 0,
|
|
43
43
|
simulate: null,
|
|
44
44
|
history: []
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
else if (
|
|
48
|
-
const [
|
|
49
|
-
|
|
50
|
-
const u =
|
|
51
|
-
id: (((h =
|
|
52
|
-
key:
|
|
53
|
-
state:
|
|
47
|
+
else if (n === "fetch") {
|
|
48
|
+
const [s] = l;
|
|
49
|
+
s[p].count.total++, s[p].updatedAt = b();
|
|
50
|
+
const u = b(), v = {
|
|
51
|
+
id: (((h = s[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
|
|
52
|
+
key: s.key,
|
|
53
|
+
state: s.state.value,
|
|
54
54
|
updatedAt: u,
|
|
55
55
|
createdAt: u,
|
|
56
56
|
fetchTime: null
|
|
57
|
-
},
|
|
58
|
-
|
|
57
|
+
}, E = T((f = s.options) == null ? void 0 : f.enabled) ?? !0;
|
|
58
|
+
E && (v.fetchTime = {
|
|
59
59
|
start: u,
|
|
60
60
|
end: null
|
|
61
|
-
}),
|
|
62
|
-
|
|
61
|
+
}), s[p].history.unshift(v), s[p].history = s[p].history.slice(0, 10), r(() => {
|
|
62
|
+
E && (v.fetchTime.end = b(), s[p].count.succeed++, v.state = s.state.value, v.updatedAt = b());
|
|
63
63
|
}), d(() => {
|
|
64
|
-
|
|
64
|
+
E && (v.fetchTime.end = b(), s[p].count.errored++, v.state = s.state.value, v.updatedAt = b());
|
|
65
65
|
});
|
|
66
|
-
} else if (
|
|
67
|
-
const [
|
|
68
|
-
|
|
69
|
-
} else if (
|
|
70
|
-
const [
|
|
71
|
-
let u =
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
} else if (n === "cancel") {
|
|
67
|
+
const [s] = l;
|
|
68
|
+
s.pending && s[p].count.cancelled++;
|
|
69
|
+
} else if (n === "setEntryState") {
|
|
70
|
+
const [s] = l;
|
|
71
|
+
let u = s[p].history[0];
|
|
72
|
+
r(() => {
|
|
73
|
+
s[p].updatedAt = b(), u ?? (u = s[p].history[0]), u && (u.state = s.state.value, u.updatedAt = b());
|
|
74
74
|
});
|
|
75
|
-
} else if (
|
|
76
|
-
const [
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
} else if (n === "untrack") {
|
|
76
|
+
const [s] = l;
|
|
77
|
+
r(() => {
|
|
78
|
+
s.active || (s[p].inactiveAt = b());
|
|
79
79
|
});
|
|
80
|
-
} else if (
|
|
81
|
-
const [
|
|
82
|
-
|
|
83
|
-
const u = e.getEntries({ key:
|
|
84
|
-
u && !u.active && (u[p].inactiveAt =
|
|
80
|
+
} else if (n === "setQueryData") {
|
|
81
|
+
const [s] = l;
|
|
82
|
+
r(() => {
|
|
83
|
+
const u = e.getEntries({ key: s, exact: !0 })[0];
|
|
84
|
+
u && !u.active && (u[p].inactiveAt = b());
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function S(e) {
|
|
91
91
|
return {
|
|
92
|
-
|
|
92
|
+
keyHash: e.keyHash,
|
|
93
93
|
key: e.key,
|
|
94
94
|
state: e.state.value,
|
|
95
95
|
asyncStatus: e.asyncStatus.value,
|
|
@@ -99,10 +99,10 @@ function w(e) {
|
|
|
99
99
|
options: e.options && {
|
|
100
100
|
staleTime: e.options.staleTime,
|
|
101
101
|
gcTime: e.options.gcTime,
|
|
102
|
-
refetchOnMount:
|
|
103
|
-
refetchOnReconnect:
|
|
104
|
-
refetchOnWindowFocus:
|
|
105
|
-
enabled:
|
|
102
|
+
refetchOnMount: T(e.options.refetchOnMount),
|
|
103
|
+
refetchOnReconnect: T(e.options.refetchOnReconnect),
|
|
104
|
+
refetchOnWindowFocus: T(e.options.refetchOnWindowFocus),
|
|
105
|
+
enabled: T(e.options.enabled)
|
|
106
106
|
},
|
|
107
107
|
deps: Array.from(e.deps).map(
|
|
108
108
|
(t) => "uid" in t ? {
|
|
@@ -120,127 +120,127 @@ function w(e) {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
const I = /* @__PURE__ */ new WeakMap();
|
|
123
|
-
function ye(e, t,
|
|
124
|
-
e.addEventListener(t,
|
|
125
|
-
e.removeEventListener(t,
|
|
123
|
+
function ye(e, t, n, l) {
|
|
124
|
+
e.addEventListener(t, n, l), J() && Q(() => {
|
|
125
|
+
e.removeEventListener(t, n);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
129
129
|
__name: "PiniaColadaDevtools",
|
|
130
130
|
setup(e) {
|
|
131
131
|
const t = fe();
|
|
132
|
-
me(t), t.$onAction(({ name:
|
|
133
|
-
if (
|
|
134
|
-
const [a] =
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
me(t), t.$onAction(({ name: i, after: o, onError: m, args: g }) => {
|
|
133
|
+
if (i === "remove") {
|
|
134
|
+
const [a] = g;
|
|
135
|
+
o(() => {
|
|
136
|
+
r.emit("queries:delete", S(a));
|
|
137
137
|
});
|
|
138
|
-
} else if (
|
|
139
|
-
const [a] =
|
|
140
|
-
if (
|
|
141
|
-
const y =
|
|
142
|
-
y.asyncStatus = "loading",
|
|
138
|
+
} else if (i === "track" || i === "untrack" || i === "cancel" || i === "invalidate" || i === "fetch" || i === "setEntryState") {
|
|
139
|
+
const [a] = g;
|
|
140
|
+
if (i === "fetch") {
|
|
141
|
+
const y = S(a);
|
|
142
|
+
y.asyncStatus = "loading", r.emit("queries:update", y);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
o(() => {
|
|
145
145
|
var y;
|
|
146
|
-
a[p].simulate = null,
|
|
147
|
-
|
|
146
|
+
a[p].simulate = null, r.emit("queries:update", S(a)), i === "fetch" && ((y = a.options) == null ? void 0 : y.staleTime) != null && Number.isFinite(a.options.staleTime) && setTimeout(() => {
|
|
147
|
+
r.emit("queries:update", S(a));
|
|
148
148
|
}, a.options.staleTime);
|
|
149
149
|
}), m(() => {
|
|
150
|
-
|
|
150
|
+
r.emit("queries:update", S(a));
|
|
151
151
|
});
|
|
152
|
-
} else if (
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
} else if (i === "create")
|
|
153
|
+
o((a) => {
|
|
154
|
+
r.emit("queries:update", S(a));
|
|
155
155
|
});
|
|
156
|
-
else if (
|
|
157
|
-
const [a] =
|
|
158
|
-
|
|
156
|
+
else if (i === "setQueryData") {
|
|
157
|
+
const [a] = g;
|
|
158
|
+
o(() => {
|
|
159
159
|
const y = t.getEntries({ key: a, exact: !0 })[0];
|
|
160
|
-
y &&
|
|
160
|
+
y && r.emit("queries:update", S(y));
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const n = oe("devtools"), l = N(new MessageChannel()), r = new pe(l.value.port1);
|
|
165
|
+
_(
|
|
166
166
|
l,
|
|
167
|
-
(
|
|
168
|
-
|
|
167
|
+
(i) => {
|
|
168
|
+
r.setPort(i.port1);
|
|
169
169
|
},
|
|
170
170
|
{ flush: "sync" }
|
|
171
|
-
),
|
|
172
|
-
console.log("[App] Received ping from devtools"),
|
|
173
|
-
}),
|
|
171
|
+
), r.on("ping", () => {
|
|
172
|
+
console.log("[App] Received ping from devtools"), r.emit("pong");
|
|
173
|
+
}), r.on("pong", () => {
|
|
174
174
|
console.log("[App] Received pong from devtools");
|
|
175
|
-
}),
|
|
176
|
-
t.invalidateQueries({ key:
|
|
177
|
-
}),
|
|
178
|
-
t.invalidateQueries({ key:
|
|
179
|
-
}),
|
|
180
|
-
const
|
|
181
|
-
|
|
175
|
+
}), r.on("queries:refetch", (i) => {
|
|
176
|
+
t.invalidateQueries({ key: i, exact: !0, active: null, stale: null });
|
|
177
|
+
}), r.on("queries:invalidate", (i) => {
|
|
178
|
+
t.invalidateQueries({ key: i, exact: !0 });
|
|
179
|
+
}), r.on("queries:reset", (i) => {
|
|
180
|
+
const o = t.getEntries({ key: i, exact: !0 })[0];
|
|
181
|
+
o && (t.cancel(o), t.setEntryState(o, {
|
|
182
182
|
status: "pending",
|
|
183
183
|
data: void 0,
|
|
184
184
|
error: null
|
|
185
185
|
}));
|
|
186
|
-
}),
|
|
187
|
-
const m = t.getEntries({ key:
|
|
188
|
-
m && (t.setEntryState(m,
|
|
189
|
-
}),
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
}),
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
}),
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
...
|
|
186
|
+
}), r.on("queries:set:state", (i, o) => {
|
|
187
|
+
const m = t.getEntries({ key: i, exact: !0 })[0];
|
|
188
|
+
m && (t.setEntryState(m, o), r.emit("queries:update", S(m)));
|
|
189
|
+
}), r.on("queries:simulate:loading", (i) => {
|
|
190
|
+
const o = t.getEntries({ key: i, exact: !0 })[0];
|
|
191
|
+
o && (o.asyncStatus.value = "loading", o[p].simulate = "loading", r.emit("queries:update", S(o)));
|
|
192
|
+
}), r.on("queries:simulate:loading:stop", (i) => {
|
|
193
|
+
const o = t.getEntries({ key: i, exact: !0 })[0];
|
|
194
|
+
o && o[p].simulate === "loading" && (o.asyncStatus.value = "idle", o[p].simulate = null, r.emit("queries:update", S(o)));
|
|
195
|
+
}), r.on("queries:simulate:error", (i) => {
|
|
196
|
+
const o = t.getEntries({ key: i, exact: !0 })[0];
|
|
197
|
+
o && (t.cancel(o), t.setEntryState(o, {
|
|
198
|
+
...o.state.value,
|
|
199
199
|
status: "error",
|
|
200
200
|
error: new Error("Simulated error")
|
|
201
|
-
}),
|
|
202
|
-
}),
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
...
|
|
206
|
-
status:
|
|
201
|
+
}), o[p].simulate = "error", r.emit("queries:update", S(o)));
|
|
202
|
+
}), r.on("queries:simulate:error:stop", (i) => {
|
|
203
|
+
const o = t.getEntries({ key: i, exact: !0 })[0];
|
|
204
|
+
o && o[p].simulate === "error" && (t.cancel(o), t.setEntryState(o, {
|
|
205
|
+
...o.state.value,
|
|
206
|
+
status: o.state.value.data !== void 0 ? "success" : "pending",
|
|
207
207
|
error: null
|
|
208
|
-
}),
|
|
208
|
+
}), o[p].simulate = null, r.emit("queries:update", S(o)));
|
|
209
209
|
});
|
|
210
210
|
const d = N(null);
|
|
211
|
-
|
|
211
|
+
_(d, () => {
|
|
212
212
|
l.value = new MessageChannel();
|
|
213
213
|
}), ye(
|
|
214
214
|
window,
|
|
215
215
|
"unload",
|
|
216
216
|
() => {
|
|
217
|
-
var
|
|
218
|
-
(
|
|
217
|
+
var i;
|
|
218
|
+
(i = d.value) == null || i.close();
|
|
219
219
|
},
|
|
220
220
|
{ passive: !0 }
|
|
221
221
|
), ie(() => {
|
|
222
|
-
var
|
|
223
|
-
(
|
|
222
|
+
var i;
|
|
223
|
+
(i = d.value) == null || i.close();
|
|
224
224
|
});
|
|
225
225
|
function h() {
|
|
226
|
-
var
|
|
227
|
-
(
|
|
226
|
+
var i;
|
|
227
|
+
(i = d.value) == null || i.close(), d.value = null;
|
|
228
228
|
}
|
|
229
229
|
function f() {
|
|
230
|
-
const
|
|
231
|
-
if (!
|
|
230
|
+
const i = n.value;
|
|
231
|
+
if (!i || !i.shadowRoot)
|
|
232
232
|
throw new Error("No devtools elemnt found for Pinia Colada devtools");
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
233
|
+
const o = i.shadowRoot.getElementById("root");
|
|
234
|
+
if (!o)
|
|
235
235
|
throw new Error("No devtools root element found for Pinia Colada devtools");
|
|
236
|
-
const m = Math.max(
|
|
236
|
+
const m = Math.max(o.offsetWidth, 400), g = Math.max(o.offsetHeight, 400), a = window.open(
|
|
237
237
|
"",
|
|
238
238
|
"pinia-colada-devtools",
|
|
239
|
-
`popup,width=${m},height=${
|
|
239
|
+
`popup,width=${m},height=${g}`
|
|
240
240
|
);
|
|
241
241
|
if (!a)
|
|
242
242
|
throw new Error("Failed to open PiP window for Pinia Colada devtools");
|
|
243
|
-
d.value = a, a.document.head.innerHTML = "", a.document.body.innerHTML = "", a.document.title = "🍹 Pinia Colada Devtools", a.document.body.style.margin = "0",
|
|
243
|
+
d.value = a, a.document.head.innerHTML = "", a.document.body.innerHTML = "", a.document.title = "🍹 Pinia Colada Devtools", a.document.body.style.margin = "0", s(i, a.document), a.addEventListener(
|
|
244
244
|
"unload",
|
|
245
245
|
() => {
|
|
246
246
|
d.value = null;
|
|
@@ -248,33 +248,42 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
248
248
|
{ passive: !0 }
|
|
249
249
|
);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
if (!
|
|
251
|
+
function s(i, o = document) {
|
|
252
|
+
if (!i || !i.shadowRoot)
|
|
253
253
|
throw new Error("No devtools element found for Pinia Colada devtools");
|
|
254
|
-
const m =
|
|
254
|
+
const m = o.getElementById("__pc-tw-properties") ?? o.createElement("style");
|
|
255
255
|
m.setAttribute("id", "__pc-tw-properties");
|
|
256
|
-
const
|
|
257
|
-
m.textContent =
|
|
256
|
+
const g = [...i.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
|
|
257
|
+
m.textContent = g, o.head.appendChild(m);
|
|
258
258
|
}
|
|
259
259
|
function u() {
|
|
260
260
|
d.value ? h() : f();
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
let v = 0;
|
|
263
|
+
async function E() {
|
|
264
|
+
if (!n.value) {
|
|
265
|
+
if (++v > 100)
|
|
266
|
+
throw new Error("Failed to find devtools element for Pinia Colada devtools");
|
|
267
|
+
setTimeout(() => {
|
|
268
|
+
E();
|
|
269
|
+
}, 100);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
s(n.value), r.emit("queries:all", t.getEntries({}).map(S)), r.emit(
|
|
264
273
|
"mutations:all",
|
|
265
274
|
// FIXME: mutations
|
|
266
|
-
t.getEntries({}).map(
|
|
275
|
+
t.getEntries({}).map(S)
|
|
267
276
|
);
|
|
268
277
|
}
|
|
269
|
-
return (
|
|
278
|
+
return (i, o) => (x(), W(re, {
|
|
270
279
|
to: d.value ? d.value.document.body : "body"
|
|
271
280
|
}, [
|
|
272
|
-
|
|
281
|
+
se("pinia-colada-devtools-panel", {
|
|
273
282
|
ref: "devtools",
|
|
274
283
|
".isPip": !!d.value,
|
|
275
284
|
".port": l.value.port2,
|
|
276
|
-
onTogglePip:
|
|
277
|
-
onReady:
|
|
285
|
+
onTogglePip: o[0] || (o[0] = (m) => u()),
|
|
286
|
+
onReady: o[1] || (o[1] = (m) => E())
|
|
278
287
|
}, null, 40, he)
|
|
279
288
|
], 8, ["to"]));
|
|
280
289
|
}
|
|
@@ -293,19 +302,19 @@ function Te(...e) {
|
|
|
293
302
|
return typeof t == "function" ? K(ue(() => ({ get: t, set: Ae }))) : R(t);
|
|
294
303
|
}
|
|
295
304
|
function Ce(e, t) {
|
|
296
|
-
function
|
|
297
|
-
return new Promise((
|
|
298
|
-
Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(
|
|
305
|
+
function n(...l) {
|
|
306
|
+
return new Promise((r, d) => {
|
|
307
|
+
Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(r).catch(d);
|
|
299
308
|
});
|
|
300
309
|
}
|
|
301
|
-
return
|
|
310
|
+
return n;
|
|
302
311
|
}
|
|
303
312
|
const Y = (e) => e();
|
|
304
|
-
function
|
|
313
|
+
function Pe(e = Y, t = {}) {
|
|
305
314
|
const {
|
|
306
|
-
initialState:
|
|
307
|
-
} = t, l = Te(
|
|
308
|
-
function
|
|
315
|
+
initialState: n = "active"
|
|
316
|
+
} = t, l = Te(n === "active");
|
|
317
|
+
function r() {
|
|
309
318
|
l.value = !1;
|
|
310
319
|
}
|
|
311
320
|
function d() {
|
|
@@ -314,34 +323,34 @@ function _e(e = Y, t = {}) {
|
|
|
314
323
|
const h = (...f) => {
|
|
315
324
|
l.value && e(...f);
|
|
316
325
|
};
|
|
317
|
-
return { isActive: K(l), pause:
|
|
326
|
+
return { isActive: K(l), pause: r, resume: d, eventFilter: h };
|
|
318
327
|
}
|
|
319
328
|
function q(e) {
|
|
320
329
|
return Array.isArray(e) ? e : [e];
|
|
321
330
|
}
|
|
322
|
-
function
|
|
331
|
+
function _e(e) {
|
|
323
332
|
return ae();
|
|
324
333
|
}
|
|
325
|
-
function Oe(e, t,
|
|
334
|
+
function Oe(e, t, n = {}) {
|
|
326
335
|
const {
|
|
327
336
|
eventFilter: l = Y,
|
|
328
|
-
...
|
|
329
|
-
} =
|
|
330
|
-
return
|
|
337
|
+
...r
|
|
338
|
+
} = n;
|
|
339
|
+
return _(
|
|
331
340
|
e,
|
|
332
341
|
Ce(
|
|
333
342
|
l,
|
|
334
343
|
t
|
|
335
344
|
),
|
|
336
|
-
|
|
345
|
+
r
|
|
337
346
|
);
|
|
338
347
|
}
|
|
339
|
-
function ke(e, t,
|
|
348
|
+
function ke(e, t, n = {}) {
|
|
340
349
|
const {
|
|
341
350
|
eventFilter: l,
|
|
342
|
-
initialState:
|
|
351
|
+
initialState: r = "active",
|
|
343
352
|
...d
|
|
344
|
-
} =
|
|
353
|
+
} = n, { eventFilter: h, pause: f, resume: s, isActive: u } = Pe(l, { initialState: r });
|
|
345
354
|
return { stop: Oe(
|
|
346
355
|
e,
|
|
347
356
|
t,
|
|
@@ -349,17 +358,17 @@ function ke(e, t, o = {}) {
|
|
|
349
358
|
...d,
|
|
350
359
|
eventFilter: h
|
|
351
360
|
}
|
|
352
|
-
), pause: f, resume:
|
|
361
|
+
), pause: f, resume: s, isActive: u };
|
|
353
362
|
}
|
|
354
|
-
function xe(e, t = !0,
|
|
355
|
-
|
|
363
|
+
function xe(e, t = !0, n) {
|
|
364
|
+
_e() ? L(e, n) : t ? e() : G(e);
|
|
356
365
|
}
|
|
357
|
-
function De(e, t,
|
|
358
|
-
return
|
|
366
|
+
function De(e, t, n) {
|
|
367
|
+
return _(
|
|
359
368
|
e,
|
|
360
369
|
t,
|
|
361
370
|
{
|
|
362
|
-
...
|
|
371
|
+
...n,
|
|
363
372
|
immediate: !0
|
|
364
373
|
}
|
|
365
374
|
);
|
|
@@ -367,43 +376,43 @@ function De(e, t, o) {
|
|
|
367
376
|
const D = Ee ? window : void 0;
|
|
368
377
|
function Re(e) {
|
|
369
378
|
var t;
|
|
370
|
-
const
|
|
371
|
-
return (t =
|
|
379
|
+
const n = T(e);
|
|
380
|
+
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
372
381
|
}
|
|
373
382
|
function z(...e) {
|
|
374
|
-
const t = [],
|
|
383
|
+
const t = [], n = () => {
|
|
375
384
|
t.forEach((f) => f()), t.length = 0;
|
|
376
|
-
}, l = (f,
|
|
377
|
-
const f = q(
|
|
378
|
-
return f.every((
|
|
385
|
+
}, l = (f, s, u, v) => (f.addEventListener(s, u, v), () => f.removeEventListener(s, u, v)), r = U(() => {
|
|
386
|
+
const f = q(T(e[0])).filter((s) => s != null);
|
|
387
|
+
return f.every((s) => typeof s != "string") ? f : void 0;
|
|
379
388
|
}), d = De(
|
|
380
389
|
() => {
|
|
381
|
-
var f,
|
|
390
|
+
var f, s;
|
|
382
391
|
return [
|
|
383
|
-
(
|
|
384
|
-
q(
|
|
385
|
-
q(F(
|
|
392
|
+
(s = (f = r.value) == null ? void 0 : f.map((u) => Re(u))) != null ? s : [D].filter((u) => u != null),
|
|
393
|
+
q(T(r.value ? e[1] : e[0])),
|
|
394
|
+
q(F(r.value ? e[2] : e[1])),
|
|
386
395
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
387
|
-
|
|
396
|
+
T(r.value ? e[3] : e[2])
|
|
388
397
|
];
|
|
389
398
|
},
|
|
390
|
-
([f,
|
|
391
|
-
if (
|
|
399
|
+
([f, s, u, v]) => {
|
|
400
|
+
if (n(), !(f != null && f.length) || !(s != null && s.length) || !(u != null && u.length))
|
|
392
401
|
return;
|
|
393
|
-
const
|
|
402
|
+
const E = be(v) ? { ...v } : v;
|
|
394
403
|
t.push(
|
|
395
404
|
...f.flatMap(
|
|
396
|
-
(i) =>
|
|
397
|
-
(
|
|
405
|
+
(i) => s.flatMap(
|
|
406
|
+
(o) => u.map((m) => l(i, o, m, E))
|
|
398
407
|
)
|
|
399
408
|
)
|
|
400
409
|
);
|
|
401
410
|
},
|
|
402
411
|
{ flush: "post" }
|
|
403
412
|
), h = () => {
|
|
404
|
-
d(),
|
|
413
|
+
d(), n();
|
|
405
414
|
};
|
|
406
|
-
return we(
|
|
415
|
+
return we(n), h;
|
|
407
416
|
}
|
|
408
417
|
const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__", qe = /* @__PURE__ */ Me();
|
|
409
418
|
function Me() {
|
|
@@ -449,128 +458,128 @@ const Fe = {
|
|
|
449
458
|
write: (e) => e.toISOString()
|
|
450
459
|
}
|
|
451
460
|
}, B = "vueuse-storage";
|
|
452
|
-
function $e(e, t,
|
|
453
|
-
var
|
|
461
|
+
function $e(e, t, n, l = {}) {
|
|
462
|
+
var r;
|
|
454
463
|
const {
|
|
455
464
|
flush: d = "pre",
|
|
456
465
|
deep: h = !0,
|
|
457
466
|
listenToStorageChanges: f = !0,
|
|
458
|
-
writeDefaults:
|
|
467
|
+
writeDefaults: s = !0,
|
|
459
468
|
mergeDefaults: u = !1,
|
|
460
469
|
shallow: v,
|
|
461
|
-
window:
|
|
470
|
+
window: E = D,
|
|
462
471
|
eventFilter: i,
|
|
463
|
-
onError:
|
|
472
|
+
onError: o = (c) => {
|
|
464
473
|
console.error(c);
|
|
465
474
|
},
|
|
466
|
-
initOnMounted:
|
|
467
|
-
} = l,
|
|
468
|
-
if (!
|
|
475
|
+
initOnMounted: m
|
|
476
|
+
} = l, g = (v ? N : R)(t), a = U(() => T(e));
|
|
477
|
+
if (!n)
|
|
469
478
|
try {
|
|
470
|
-
|
|
479
|
+
n = Ne("getDefaultStorage", () => {
|
|
471
480
|
var c;
|
|
472
481
|
return (c = D) == null ? void 0 : c.localStorage;
|
|
473
482
|
})();
|
|
474
483
|
} catch (c) {
|
|
475
|
-
|
|
484
|
+
o(c);
|
|
476
485
|
}
|
|
477
|
-
if (!
|
|
478
|
-
return
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
() => Z(
|
|
486
|
+
if (!n)
|
|
487
|
+
return g;
|
|
488
|
+
const y = T(t), j = We(y), C = (r = l.serializer) != null ? r : Fe[j], { pause: X, resume: H } = ke(
|
|
489
|
+
g,
|
|
490
|
+
() => Z(g.value),
|
|
482
491
|
{ flush: d, deep: h, eventFilter: i }
|
|
483
492
|
);
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}),
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
key:
|
|
493
|
+
_(a, () => P(), { flush: d }), E && f && xe(() => {
|
|
494
|
+
n instanceof Storage ? z(E, "storage", P, { passive: !0 }) : z(E, B, te), m && P();
|
|
495
|
+
}), m || P();
|
|
496
|
+
function V(c, w) {
|
|
497
|
+
if (E) {
|
|
498
|
+
const A = {
|
|
499
|
+
key: a.value,
|
|
491
500
|
oldValue: c,
|
|
492
|
-
newValue:
|
|
493
|
-
storageArea:
|
|
501
|
+
newValue: w,
|
|
502
|
+
storageArea: n
|
|
494
503
|
};
|
|
495
|
-
|
|
496
|
-
detail:
|
|
504
|
+
E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(B, {
|
|
505
|
+
detail: A
|
|
497
506
|
}));
|
|
498
507
|
}
|
|
499
508
|
}
|
|
500
509
|
function Z(c) {
|
|
501
510
|
try {
|
|
502
|
-
const
|
|
511
|
+
const w = n.getItem(a.value);
|
|
503
512
|
if (c == null)
|
|
504
|
-
|
|
513
|
+
V(w, null), n.removeItem(a.value);
|
|
505
514
|
else {
|
|
506
|
-
const
|
|
507
|
-
|
|
515
|
+
const A = C.write(c);
|
|
516
|
+
w !== A && (n.setItem(a.value, A), V(w, A));
|
|
508
517
|
}
|
|
509
|
-
} catch (
|
|
510
|
-
|
|
518
|
+
} catch (w) {
|
|
519
|
+
o(w);
|
|
511
520
|
}
|
|
512
521
|
}
|
|
513
522
|
function ee(c) {
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
return
|
|
523
|
+
const w = c ? c.newValue : n.getItem(a.value);
|
|
524
|
+
if (w == null)
|
|
525
|
+
return s && y != null && n.setItem(a.value, C.write(y)), y;
|
|
517
526
|
if (!c && u) {
|
|
518
|
-
const
|
|
519
|
-
return typeof u == "function" ? u(
|
|
520
|
-
} else return typeof
|
|
527
|
+
const A = C.read(w);
|
|
528
|
+
return typeof u == "function" ? u(A, y) : j === "object" && !Array.isArray(A) ? { ...y, ...A } : A;
|
|
529
|
+
} else return typeof w != "string" ? w : C.read(w);
|
|
521
530
|
}
|
|
522
|
-
function
|
|
523
|
-
if (!(c && c.storageArea !==
|
|
531
|
+
function P(c) {
|
|
532
|
+
if (!(c && c.storageArea !== n)) {
|
|
524
533
|
if (c && c.key == null) {
|
|
525
|
-
|
|
534
|
+
g.value = y;
|
|
526
535
|
return;
|
|
527
536
|
}
|
|
528
|
-
if (!(c && c.key !==
|
|
537
|
+
if (!(c && c.key !== a.value)) {
|
|
529
538
|
X();
|
|
530
539
|
try {
|
|
531
|
-
(c == null ? void 0 : c.newValue) !== C.write(
|
|
532
|
-
} catch (
|
|
533
|
-
|
|
540
|
+
(c == null ? void 0 : c.newValue) !== C.write(g.value) && (g.value = ee(c));
|
|
541
|
+
} catch (w) {
|
|
542
|
+
o(w);
|
|
534
543
|
} finally {
|
|
535
|
-
c ? G(
|
|
544
|
+
c ? G(H) : H();
|
|
536
545
|
}
|
|
537
546
|
}
|
|
538
547
|
}
|
|
539
548
|
}
|
|
540
549
|
function te(c) {
|
|
541
|
-
|
|
550
|
+
P(c.detail);
|
|
542
551
|
}
|
|
543
|
-
return
|
|
552
|
+
return g;
|
|
544
553
|
}
|
|
545
|
-
function Le(e, t,
|
|
546
|
-
const { window: l = D } =
|
|
547
|
-
return $e(e, t, l == null ? void 0 : l.localStorage,
|
|
554
|
+
function Le(e, t, n = {}) {
|
|
555
|
+
const { window: l = D } = n;
|
|
556
|
+
return $e(e, t, l == null ? void 0 : l.localStorage, n);
|
|
548
557
|
}
|
|
549
558
|
const Ie = /* @__PURE__ */ $({
|
|
550
559
|
__name: "PCDevtoolsWrapper",
|
|
551
560
|
setup(e) {
|
|
552
|
-
const t = R(!1),
|
|
561
|
+
const t = R(!1), n = Le("pinia-colada-devtools-open", !1);
|
|
553
562
|
async function l() {
|
|
554
563
|
if (!t.value && (t.value = !0, !customElements.get("pinia-colada-devtools-panel"))) {
|
|
555
564
|
const { DevtoolsPanel: d } = await import("@pinia/colada-devtools/panel");
|
|
556
565
|
customElements.define("pinia-colada-devtools-panel", d);
|
|
557
566
|
}
|
|
558
567
|
}
|
|
559
|
-
async function
|
|
560
|
-
await l(),
|
|
568
|
+
async function r() {
|
|
569
|
+
await l(), n.value = !0;
|
|
561
570
|
}
|
|
562
571
|
return L(() => {
|
|
563
572
|
requestIdleCallback(() => {
|
|
564
573
|
import("@pinia/colada-devtools/panel");
|
|
565
|
-
}),
|
|
574
|
+
}), n.value && r();
|
|
566
575
|
}), (d, h) => (x(), W(ve, null, {
|
|
567
576
|
default: ce(() => [
|
|
568
|
-
F(
|
|
577
|
+
F(n) ? M("", !0) : (x(), de("button", {
|
|
569
578
|
key: 0,
|
|
570
579
|
class: "fixed bottom-2 right-2 bg-primary-500 hover:cursor-pointer z-99999",
|
|
571
|
-
onClick: h[0] || (h[0] = (f) =>
|
|
580
|
+
onClick: h[0] || (h[0] = (f) => r())
|
|
572
581
|
}, " 🍹 Devtools ")),
|
|
573
|
-
t.value && F(
|
|
582
|
+
t.value && F(n) ? (x(), W(ge, { key: 1 })) : M("", !0)
|
|
574
583
|
]),
|
|
575
584
|
_: 1
|
|
576
585
|
}));
|