pinia-plugin-subscription 0.0.0-beta.7 → 0.0.0-beta.9
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.
|
@@ -3,6 +3,7 @@ class Mn {
|
|
|
3
3
|
_console;
|
|
4
4
|
_createInstance;
|
|
5
5
|
_name;
|
|
6
|
+
_pluginOptions;
|
|
6
7
|
_storeInstance;
|
|
7
8
|
_resetStoreCallback;
|
|
8
9
|
_storeOnActionSubscription;
|
|
@@ -15,6 +16,12 @@ class Mn {
|
|
|
15
16
|
get name() {
|
|
16
17
|
return this._name;
|
|
17
18
|
}
|
|
19
|
+
get pluginOptions() {
|
|
20
|
+
return this._pluginOptions ?? {};
|
|
21
|
+
}
|
|
22
|
+
set pluginOptions(e) {
|
|
23
|
+
this._pluginOptions = e;
|
|
24
|
+
}
|
|
18
25
|
get resetStoreCallback() {
|
|
19
26
|
return this._resetStoreCallback;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class Mn {
|
|
|
34
41
|
this._name = e, this._createInstance = n, s && (this._console = s);
|
|
35
42
|
}
|
|
36
43
|
invoke({ store: e, options: n }, s) {
|
|
37
|
-
this._storeInstance = this._createInstance(e, n, s, this.console), this._storeInstance && (this._subscriptions = this._storeInstance.getSubscriptions(), this._storeMutationSubscription = this._storeInstance.storeSubscribe, this._storeOnActionSubscription = this._storeInstance.onAction, this.pluginCreated && this.pluginCreated(e));
|
|
44
|
+
this._storeInstance = this._createInstance(e, { ...n, ...this.pluginOptions }, s, this.console), this._storeInstance && (this._subscriptions = this._storeInstance.getSubscriptions(), this._storeMutationSubscription = this._storeInstance.storeSubscribe, this._storeOnActionSubscription = this._storeInstance.onAction, this.pluginCreated && this.pluginCreated(e));
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
class Vt {
|
|
@@ -55,14 +62,14 @@ class Vt {
|
|
|
55
62
|
constructor(e, n) {
|
|
56
63
|
this._debug = e, n && (this._console = n);
|
|
57
64
|
}
|
|
58
|
-
debugLog(e
|
|
59
|
-
this._debug &&
|
|
65
|
+
debugLog(...e) {
|
|
66
|
+
this._debug && (Array.isArray(e) && (e[0] = `${this._className} - ${e[0]}`), this.console.log(...e));
|
|
60
67
|
}
|
|
61
68
|
logError(...e) {
|
|
62
69
|
this.console.error(...e);
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
|
-
const
|
|
72
|
+
const At = "pinia-plugin-subscription", le = (t, e = "white") => `background-color: ${t}; color: ${e}; padding: 1px; margin-right: 5px; font-size: 12px`;
|
|
66
73
|
function ae(t, e) {
|
|
67
74
|
if (!t)
|
|
68
75
|
throw new Error("Style instructions are required");
|
|
@@ -85,7 +92,7 @@ class ue {
|
|
|
85
92
|
info: { bgColor: this._bgColor, color: this._color, icon: this._icon }
|
|
86
93
|
};
|
|
87
94
|
formatMessage(e, n) {
|
|
88
|
-
return ` [${n} ${
|
|
95
|
+
return ` [${n} ${At}] - ${e} `;
|
|
89
96
|
}
|
|
90
97
|
generateStyle(e) {
|
|
91
98
|
return le(e.bgColor, e.color);
|
|
@@ -119,12 +126,12 @@ class ue {
|
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
class fe extends ue {
|
|
122
|
-
_pluginName =
|
|
129
|
+
_pluginName = At;
|
|
123
130
|
}
|
|
124
|
-
const
|
|
131
|
+
const pe = new fe();
|
|
125
132
|
function Pn(t, e, n) {
|
|
126
133
|
const s = n ? { storeOptions: n } : {};
|
|
127
|
-
return typeof e == "function" ?
|
|
134
|
+
return typeof e == "function" ? he(
|
|
128
135
|
t,
|
|
129
136
|
e,
|
|
130
137
|
s
|
|
@@ -134,20 +141,21 @@ function Pn(t, e, n) {
|
|
|
134
141
|
s
|
|
135
142
|
);
|
|
136
143
|
}
|
|
137
|
-
function
|
|
144
|
+
function he(t, e, n) {
|
|
138
145
|
return It(t, e, n);
|
|
139
146
|
}
|
|
140
147
|
function de(t, e, n) {
|
|
141
148
|
return n && (e = { ...e, ...n ?? {} }), It(t, e);
|
|
142
149
|
}
|
|
143
150
|
const _e = /* @__PURE__ */ new Set(["_", "$"]);
|
|
144
|
-
function
|
|
151
|
+
function xt(t) {
|
|
145
152
|
return _e.has(t[0]);
|
|
146
153
|
}
|
|
147
154
|
function $t(t) {
|
|
148
155
|
return t ? Array.isArray(t) ? t.length === 0 : typeof t == "object" ? Object.keys(t).length === 0 : typeof t == "string" ? t.trim() === "" : !1 : !(typeof t == "boolean" || typeof t == "number");
|
|
149
156
|
}
|
|
150
157
|
class ge extends Vt {
|
|
158
|
+
_className = "PluginSubscription";
|
|
151
159
|
_resetStoreCallback = [];
|
|
152
160
|
_subscribers = [];
|
|
153
161
|
_subscriptions = [];
|
|
@@ -159,7 +167,7 @@ class ge extends Vt {
|
|
|
159
167
|
return this._subscriptions;
|
|
160
168
|
}
|
|
161
169
|
constructor(e, n) {
|
|
162
|
-
super(n,
|
|
170
|
+
super(n, pe), this._subscribers = e;
|
|
163
171
|
}
|
|
164
172
|
addResetStoreCallback(e) {
|
|
165
173
|
this._resetStoreCallback.push(e);
|
|
@@ -191,7 +199,7 @@ class ge extends Vt {
|
|
|
191
199
|
rewriteResetStore({ store: e }, n, s) {
|
|
192
200
|
e.$reset = () => {
|
|
193
201
|
this.executeResetStoreCallbacks(e), Object.keys(s).forEach((r) => {
|
|
194
|
-
|
|
202
|
+
xt(r) || (e[r] = n[r] ?? s[r]);
|
|
195
203
|
}), e.$patch(JSON.parse(JSON.stringify(n)));
|
|
196
204
|
};
|
|
197
205
|
}
|
|
@@ -238,9 +246,9 @@ const Dt = () => {
|
|
|
238
246
|
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), F = Object.assign, ye = Object.prototype.hasOwnProperty, at = (t, e) => ye.call(t, e), d = Array.isArray, K = (t) => Tt(t) === "[object Map]", V = (t) => typeof t == "function", N = (t) => typeof t == "string", W = (t) => typeof t == "symbol", _ = (t) => t !== null && typeof t == "object", Se = Object.prototype.toString, Tt = (t) => Se.call(t), Mt = (t) => Tt(t).slice(8, -1), Z = (t) => N(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, Ee = (t) => {
|
|
239
247
|
const e = /* @__PURE__ */ Object.create(null);
|
|
240
248
|
return ((n) => e[n] || (e[n] = t(n)));
|
|
241
|
-
},
|
|
242
|
-
let
|
|
243
|
-
const tt = () =>
|
|
249
|
+
}, Oe = Ee((t) => t.charAt(0).toUpperCase() + t.slice(1)), ht = (t, e) => !Object.is(t, e);
|
|
250
|
+
let Ot;
|
|
251
|
+
const tt = () => Ot || (Ot = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
244
252
|
function dt(t) {
|
|
245
253
|
if (d(t)) {
|
|
246
254
|
const e = {};
|
|
@@ -254,10 +262,10 @@ function dt(t) {
|
|
|
254
262
|
} else if (N(t) || _(t))
|
|
255
263
|
return t;
|
|
256
264
|
}
|
|
257
|
-
const
|
|
265
|
+
const we = /;(?![^(]*\))/g, Ne = /:([^]+)/, ve = /\/\*[^]*?\*\//g;
|
|
258
266
|
function Re(t) {
|
|
259
267
|
const e = {};
|
|
260
|
-
return t.replace(ve, "").split(
|
|
268
|
+
return t.replace(ve, "").split(we).forEach((n) => {
|
|
261
269
|
if (n) {
|
|
262
270
|
const s = n.split(Ne);
|
|
263
271
|
s.length > 1 && (e[s[0].trim()] = s[1].trim());
|
|
@@ -336,7 +344,7 @@ class Ce {
|
|
|
336
344
|
}
|
|
337
345
|
const Ft = /* @__PURE__ */ new WeakMap(), nt = Symbol(
|
|
338
346
|
process.env.NODE_ENV !== "production" ? "Object iterate" : ""
|
|
339
|
-
),
|
|
347
|
+
), wt = Symbol(
|
|
340
348
|
process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
|
|
341
349
|
), Nt = Symbol(
|
|
342
350
|
process.env.NODE_ENV !== "production" ? "Array iterate" : ""
|
|
@@ -360,17 +368,17 @@ function I(t, e, n, s, r, o) {
|
|
|
360
368
|
else {
|
|
361
369
|
const a = d(t), f = a && Z(n);
|
|
362
370
|
if (a && n === "length") {
|
|
363
|
-
const
|
|
364
|
-
i.forEach((l,
|
|
365
|
-
(
|
|
371
|
+
const h = Number(s);
|
|
372
|
+
i.forEach((l, p) => {
|
|
373
|
+
(p === "length" || p === Nt || !W(p) && p >= h) && c(l);
|
|
366
374
|
});
|
|
367
375
|
} else
|
|
368
376
|
switch ((n !== void 0 || i.has(void 0)) && c(i.get(n)), f && c(i.get(Nt)), e) {
|
|
369
377
|
case "add":
|
|
370
|
-
a ? f && c(i.get("length")) : (c(i.get(nt)), K(t) && c(i.get(
|
|
378
|
+
a ? f && c(i.get("length")) : (c(i.get(nt)), K(t) && c(i.get(wt)));
|
|
371
379
|
break;
|
|
372
380
|
case "delete":
|
|
373
|
-
a || (c(i.get(nt)), K(t) && c(i.get(
|
|
381
|
+
a || (c(i.get(nt)), K(t) && c(i.get(wt)));
|
|
374
382
|
break;
|
|
375
383
|
case "set":
|
|
376
384
|
K(t) && c(i.get(nt));
|
|
@@ -383,7 +391,7 @@ function Ie(t, e) {
|
|
|
383
391
|
const n = Ft.get(t);
|
|
384
392
|
return n && n.get(e);
|
|
385
393
|
}
|
|
386
|
-
function
|
|
394
|
+
function x(t) {
|
|
387
395
|
const e = u(t);
|
|
388
396
|
return e === t || y(t) ? e : e.map(v);
|
|
389
397
|
}
|
|
@@ -399,18 +407,18 @@ const Ve = {
|
|
|
399
407
|
return rt(this, Symbol.iterator, (t) => R(this, t));
|
|
400
408
|
},
|
|
401
409
|
concat(...t) {
|
|
402
|
-
return
|
|
403
|
-
...t.map((e) => d(e) ?
|
|
410
|
+
return x(this).concat(
|
|
411
|
+
...t.map((e) => d(e) ? x(e) : e)
|
|
404
412
|
);
|
|
405
413
|
},
|
|
406
414
|
entries() {
|
|
407
415
|
return rt(this, "entries", (t) => (t[1] = R(this, t[1]), t));
|
|
408
416
|
},
|
|
409
417
|
every(t, e) {
|
|
410
|
-
return
|
|
418
|
+
return O(this, "every", t, e, void 0, arguments);
|
|
411
419
|
},
|
|
412
420
|
filter(t, e) {
|
|
413
|
-
return
|
|
421
|
+
return O(
|
|
414
422
|
this,
|
|
415
423
|
"filter",
|
|
416
424
|
t,
|
|
@@ -420,7 +428,7 @@ const Ve = {
|
|
|
420
428
|
);
|
|
421
429
|
},
|
|
422
430
|
find(t, e) {
|
|
423
|
-
return
|
|
431
|
+
return O(
|
|
424
432
|
this,
|
|
425
433
|
"find",
|
|
426
434
|
t,
|
|
@@ -430,10 +438,10 @@ const Ve = {
|
|
|
430
438
|
);
|
|
431
439
|
},
|
|
432
440
|
findIndex(t, e) {
|
|
433
|
-
return
|
|
441
|
+
return O(this, "findIndex", t, e, void 0, arguments);
|
|
434
442
|
},
|
|
435
443
|
findLast(t, e) {
|
|
436
|
-
return
|
|
444
|
+
return O(
|
|
437
445
|
this,
|
|
438
446
|
"findLast",
|
|
439
447
|
t,
|
|
@@ -443,11 +451,11 @@ const Ve = {
|
|
|
443
451
|
);
|
|
444
452
|
},
|
|
445
453
|
findLastIndex(t, e) {
|
|
446
|
-
return
|
|
454
|
+
return O(this, "findLastIndex", t, e, void 0, arguments);
|
|
447
455
|
},
|
|
448
456
|
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
449
457
|
forEach(t, e) {
|
|
450
|
-
return
|
|
458
|
+
return O(this, "forEach", t, e, void 0, arguments);
|
|
451
459
|
},
|
|
452
460
|
includes(...t) {
|
|
453
461
|
return st(this, "includes", t);
|
|
@@ -456,14 +464,14 @@ const Ve = {
|
|
|
456
464
|
return st(this, "indexOf", t);
|
|
457
465
|
},
|
|
458
466
|
join(t) {
|
|
459
|
-
return
|
|
467
|
+
return x(this).join(t);
|
|
460
468
|
},
|
|
461
469
|
// keys() iterator only reads `length`, no optimization required
|
|
462
470
|
lastIndexOf(...t) {
|
|
463
471
|
return st(this, "lastIndexOf", t);
|
|
464
472
|
},
|
|
465
473
|
map(t, e) {
|
|
466
|
-
return
|
|
474
|
+
return O(this, "map", t, e, void 0, arguments);
|
|
467
475
|
},
|
|
468
476
|
pop() {
|
|
469
477
|
return k(this, "pop");
|
|
@@ -482,19 +490,19 @@ const Ve = {
|
|
|
482
490
|
},
|
|
483
491
|
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
484
492
|
some(t, e) {
|
|
485
|
-
return
|
|
493
|
+
return O(this, "some", t, e, void 0, arguments);
|
|
486
494
|
},
|
|
487
495
|
splice(...t) {
|
|
488
496
|
return k(this, "splice", t);
|
|
489
497
|
},
|
|
490
498
|
toReversed() {
|
|
491
|
-
return
|
|
499
|
+
return x(this).toReversed();
|
|
492
500
|
},
|
|
493
501
|
toSorted(t) {
|
|
494
|
-
return
|
|
502
|
+
return x(this).toSorted(t);
|
|
495
503
|
},
|
|
496
504
|
toSpliced(...t) {
|
|
497
|
-
return
|
|
505
|
+
return x(this).toSpliced(...t);
|
|
498
506
|
},
|
|
499
507
|
unshift(...t) {
|
|
500
508
|
return k(this, "unshift", t);
|
|
@@ -510,21 +518,21 @@ function rt(t, e, n) {
|
|
|
510
518
|
return o.done || (o.value = n(o.value)), o;
|
|
511
519
|
}), r;
|
|
512
520
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
521
|
+
const Ae = Array.prototype;
|
|
522
|
+
function O(t, e, n, s, r, o) {
|
|
515
523
|
const i = mt(t), c = i !== t && !y(t), a = i[e];
|
|
516
|
-
if (a !==
|
|
524
|
+
if (a !== Ae[e]) {
|
|
517
525
|
const l = a.apply(t, o);
|
|
518
526
|
return c ? v(l) : l;
|
|
519
527
|
}
|
|
520
528
|
let f = n;
|
|
521
|
-
i !== t && (c ? f = function(l,
|
|
522
|
-
return n.call(this, R(t, l),
|
|
523
|
-
} : n.length > 2 && (f = function(l,
|
|
524
|
-
return n.call(this, l,
|
|
529
|
+
i !== t && (c ? f = function(l, p) {
|
|
530
|
+
return n.call(this, R(t, l), p, t);
|
|
531
|
+
} : n.length > 2 && (f = function(l, p) {
|
|
532
|
+
return n.call(this, l, p, t);
|
|
525
533
|
}));
|
|
526
|
-
const
|
|
527
|
-
return c && r ? r(
|
|
534
|
+
const h = a.call(i, f, s);
|
|
535
|
+
return c && r ? r(h) : h;
|
|
528
536
|
}
|
|
529
537
|
function vt(t, e, n, s) {
|
|
530
538
|
const r = mt(t);
|
|
@@ -544,7 +552,7 @@ function k(t, e, n = []) {
|
|
|
544
552
|
const s = u(t)[e].apply(t, n);
|
|
545
553
|
return bt(), s;
|
|
546
554
|
}
|
|
547
|
-
const
|
|
555
|
+
const xe = /* @__PURE__ */ be("__proto__,__v_isRef,__isVue"), jt = new Set(
|
|
548
556
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(W)
|
|
549
557
|
);
|
|
550
558
|
function $e(t) {
|
|
@@ -583,7 +591,7 @@ class kt {
|
|
|
583
591
|
// its class methods
|
|
584
592
|
g(e) ? e : s
|
|
585
593
|
);
|
|
586
|
-
if ((W(n) ? jt.has(n) :
|
|
594
|
+
if ((W(n) ? jt.has(n) : xe(n)) || o)
|
|
587
595
|
return c;
|
|
588
596
|
if (g(c)) {
|
|
589
597
|
const a = i && Z(n) ? c : c.value;
|
|
@@ -613,7 +621,7 @@ class De extends kt {
|
|
|
613
621
|
s,
|
|
614
622
|
g(e) ? e : r
|
|
615
623
|
);
|
|
616
|
-
return e === u(r) && (c ?
|
|
624
|
+
return e === u(r) && (c ? ht(s, o) && I(e, "set", n, s, o) : I(e, "add", n, s)), a;
|
|
617
625
|
}
|
|
618
626
|
deleteProperty(e, n) {
|
|
619
627
|
const s = at(e, n), r = e[n], o = Reflect.deleteProperty(e, n);
|
|
@@ -651,9 +659,9 @@ function Fe(t, e, n) {
|
|
|
651
659
|
return {
|
|
652
660
|
// iterator protocol
|
|
653
661
|
next() {
|
|
654
|
-
const { value:
|
|
655
|
-
return l ? { value:
|
|
656
|
-
value: c ? [f(
|
|
662
|
+
const { value: h, done: l } = a.next();
|
|
663
|
+
return l ? { value: h, done: l } : {
|
|
664
|
+
value: c ? [f(h[0]), f(h[1])] : f(h),
|
|
657
665
|
done: l
|
|
658
666
|
};
|
|
659
667
|
},
|
|
@@ -669,7 +677,7 @@ function q(t) {
|
|
|
669
677
|
if (process.env.NODE_ENV !== "production") {
|
|
670
678
|
const n = e[0] ? `on key "${e[0]}" ` : "";
|
|
671
679
|
M(
|
|
672
|
-
`${
|
|
680
|
+
`${Oe(t)} operation ${n}failed: target is readonly.`,
|
|
673
681
|
u(this)
|
|
674
682
|
);
|
|
675
683
|
}
|
|
@@ -700,7 +708,7 @@ function je(t, e) {
|
|
|
700
708
|
const i = this, c = i.__v_raw;
|
|
701
709
|
u(c);
|
|
702
710
|
const a = e ? ut : t ? L : v;
|
|
703
|
-
return c.forEach((f,
|
|
711
|
+
return c.forEach((f, h) => r.call(o, a(f), a(h), i));
|
|
704
712
|
}
|
|
705
713
|
};
|
|
706
714
|
return F(
|
|
@@ -721,15 +729,15 @@ function je(t, e) {
|
|
|
721
729
|
const i = u(this), { has: c, get: a } = U(i);
|
|
722
730
|
let f = c.call(i, r);
|
|
723
731
|
f ? process.env.NODE_ENV !== "production" && Rt(i, c, r) : (r = u(r), f = c.call(i, r));
|
|
724
|
-
const
|
|
725
|
-
return i.set(r, o), f ?
|
|
732
|
+
const h = a.call(i, r);
|
|
733
|
+
return i.set(r, o), f ? ht(o, h) && I(i, "set", r, o, h) : I(i, "add", r, o), this;
|
|
726
734
|
},
|
|
727
735
|
delete(r) {
|
|
728
736
|
const o = u(this), { has: i, get: c } = U(o);
|
|
729
737
|
let a = i.call(o, r);
|
|
730
738
|
a ? process.env.NODE_ENV !== "production" && Rt(o, i, r) : (r = u(r), a = i.call(o, r));
|
|
731
|
-
const f = c ? c.call(o, r) : void 0,
|
|
732
|
-
return a && I(o, "delete", r, void 0, f),
|
|
739
|
+
const f = c ? c.call(o, r) : void 0, h = o.delete(r);
|
|
740
|
+
return a && I(o, "delete", r, void 0, f), h;
|
|
733
741
|
},
|
|
734
742
|
clear() {
|
|
735
743
|
const r = u(this), o = r.size !== 0, i = process.env.NODE_ENV !== "production" ? K(r) ? new Map(r) : new Set(r) : void 0, c = r.clear();
|
|
@@ -869,7 +877,7 @@ class qe {
|
|
|
869
877
|
}
|
|
870
878
|
set value(e) {
|
|
871
879
|
const n = this._rawValue, s = this.__v_isShallow || y(e) || E(e);
|
|
872
|
-
e = s ? e : u(e),
|
|
880
|
+
e = s ? e : u(e), ht(e, n) && (this._rawValue = e, this._value = s ? e : v(e), process.env.NODE_ENV !== "production" ? this.dep.trigger({
|
|
873
881
|
target: this,
|
|
874
882
|
type: "set",
|
|
875
883
|
key: "value",
|
|
@@ -923,18 +931,18 @@ function Ge(t, e, n) {
|
|
|
923
931
|
function Qe(t, e, n) {
|
|
924
932
|
return new Be(t, e, n);
|
|
925
933
|
}
|
|
926
|
-
const
|
|
934
|
+
const A = [];
|
|
927
935
|
function Xe(t) {
|
|
928
|
-
|
|
936
|
+
A.push(t);
|
|
929
937
|
}
|
|
930
938
|
function Ze() {
|
|
931
|
-
|
|
939
|
+
A.pop();
|
|
932
940
|
}
|
|
933
941
|
let ot = !1;
|
|
934
942
|
function P(t, ...e) {
|
|
935
943
|
if (ot) return;
|
|
936
944
|
ot = !0;
|
|
937
|
-
const n =
|
|
945
|
+
const n = A.length ? A[A.length - 1].component : null, s = n && n.appContext.config.warnHandler, r = tn();
|
|
938
946
|
if (s)
|
|
939
947
|
St(
|
|
940
948
|
s,
|
|
@@ -962,7 +970,7 @@ function P(t, ...e) {
|
|
|
962
970
|
ot = !1;
|
|
963
971
|
}
|
|
964
972
|
function tn() {
|
|
965
|
-
let t =
|
|
973
|
+
let t = A[A.length - 1];
|
|
966
974
|
if (!t)
|
|
967
975
|
return [];
|
|
968
976
|
const e = [];
|
|
@@ -1047,10 +1055,10 @@ function Bt(t, e, n, s = !0) {
|
|
|
1047
1055
|
let c = e.parent;
|
|
1048
1056
|
const a = e.proxy, f = process.env.NODE_ENV !== "production" ? Jt[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
|
|
1049
1057
|
for (; c; ) {
|
|
1050
|
-
const
|
|
1051
|
-
if (
|
|
1052
|
-
for (let l = 0; l <
|
|
1053
|
-
if (
|
|
1058
|
+
const h = c.ec;
|
|
1059
|
+
if (h) {
|
|
1060
|
+
for (let l = 0; l < h.length; l++)
|
|
1061
|
+
if (h[l](t, a, f) === !1)
|
|
1054
1062
|
return;
|
|
1055
1063
|
}
|
|
1056
1064
|
c = c.parent;
|
|
@@ -1079,14 +1087,14 @@ function sn(t, e, n, s = !0, r = !1) {
|
|
|
1079
1087
|
}
|
|
1080
1088
|
}
|
|
1081
1089
|
const m = [];
|
|
1082
|
-
let
|
|
1090
|
+
let w = -1;
|
|
1083
1091
|
const T = [];
|
|
1084
1092
|
let C = null, $ = 0;
|
|
1085
1093
|
const on = /* @__PURE__ */ Promise.resolve();
|
|
1086
|
-
let
|
|
1094
|
+
let pt = null;
|
|
1087
1095
|
const cn = 100;
|
|
1088
1096
|
function ln(t) {
|
|
1089
|
-
let e =
|
|
1097
|
+
let e = w + 1, n = m.length;
|
|
1090
1098
|
for (; e < n; ) {
|
|
1091
1099
|
const s = e + n >>> 1, r = m[s], o = z(r);
|
|
1092
1100
|
o < t || o === t && r.flags & 2 ? e = s + 1 : n = s;
|
|
@@ -1101,7 +1109,7 @@ function an(t) {
|
|
|
1101
1109
|
}
|
|
1102
1110
|
}
|
|
1103
1111
|
function Yt() {
|
|
1104
|
-
|
|
1112
|
+
pt || (pt = on.then(Gt));
|
|
1105
1113
|
}
|
|
1106
1114
|
function un(t) {
|
|
1107
1115
|
d(t) ? T.push(...t) : C && t.id === -1 ? C.splice($ + 1, 0, t) : t.flags & 1 || (T.push(t), t.flags |= 1), Yt();
|
|
@@ -1127,8 +1135,8 @@ function Gt(t) {
|
|
|
1127
1135
|
process.env.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map());
|
|
1128
1136
|
const e = process.env.NODE_ENV !== "production" ? (n) => Qt(t, n) : Dt;
|
|
1129
1137
|
try {
|
|
1130
|
-
for (
|
|
1131
|
-
const n = m[
|
|
1138
|
+
for (w = 0; w < m.length; w++) {
|
|
1139
|
+
const n = m[w];
|
|
1132
1140
|
if (n && !(n.flags & 8)) {
|
|
1133
1141
|
if (process.env.NODE_ENV !== "production" && e(n))
|
|
1134
1142
|
continue;
|
|
@@ -1140,11 +1148,11 @@ function Gt(t) {
|
|
|
1140
1148
|
}
|
|
1141
1149
|
}
|
|
1142
1150
|
} finally {
|
|
1143
|
-
for (;
|
|
1144
|
-
const n = m[
|
|
1151
|
+
for (; w < m.length; w++) {
|
|
1152
|
+
const n = m[w];
|
|
1145
1153
|
n && (n.flags &= -2);
|
|
1146
1154
|
}
|
|
1147
|
-
|
|
1155
|
+
w = -1, m.length = 0, fn(t), pt = null, (m.length || T.length) && Gt(t);
|
|
1148
1156
|
}
|
|
1149
1157
|
}
|
|
1150
1158
|
function Qt(t, e) {
|
|
@@ -1161,12 +1169,12 @@ function Qt(t, e) {
|
|
|
1161
1169
|
}
|
|
1162
1170
|
const it = /* @__PURE__ */ new Map();
|
|
1163
1171
|
process.env.NODE_ENV !== "production" && (tt().__VUE_HMR_RUNTIME__ = {
|
|
1164
|
-
createRecord: ct(
|
|
1165
|
-
rerender: ct(
|
|
1172
|
+
createRecord: ct(pn),
|
|
1173
|
+
rerender: ct(hn),
|
|
1166
1174
|
reload: ct(dn)
|
|
1167
1175
|
});
|
|
1168
1176
|
const Y = /* @__PURE__ */ new Map();
|
|
1169
|
-
function
|
|
1177
|
+
function pn(t, e) {
|
|
1170
1178
|
return Y.has(t) ? !1 : (Y.set(t, {
|
|
1171
1179
|
initialDef: G(e),
|
|
1172
1180
|
instances: /* @__PURE__ */ new Set()
|
|
@@ -1175,7 +1183,7 @@ function hn(t, e) {
|
|
|
1175
1183
|
function G(t) {
|
|
1176
1184
|
return ce(t) ? t.__vccOpts : t;
|
|
1177
1185
|
}
|
|
1178
|
-
function
|
|
1186
|
+
function hn(t, e) {
|
|
1179
1187
|
const n = Y.get(t);
|
|
1180
1188
|
n && (n.initialDef.render = e, [...n.instances].forEach((s) => {
|
|
1181
1189
|
e && (s.render = e, G(s.type).render = e), s.renderCache = [], s.job.flags & 8 || s.update();
|
|
@@ -1238,8 +1246,8 @@ const bn = Symbol.for("v-ndc"), mn = {};
|
|
|
1238
1246
|
process.env.NODE_ENV !== "production" && (mn.ownKeys = (t) => (P(
|
|
1239
1247
|
"Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
|
|
1240
1248
|
), Reflect.ownKeys(t)));
|
|
1241
|
-
const yn = {}, te = (t) => Object.getPrototypeOf(t) === yn, Sn = (t) => t.__isSuspense, ee = Symbol.for("v-fgt"), En = Symbol.for("v-txt"),
|
|
1242
|
-
function
|
|
1249
|
+
const yn = {}, te = (t) => Object.getPrototypeOf(t) === yn, Sn = (t) => t.__isSuspense, ee = Symbol.for("v-fgt"), En = Symbol.for("v-txt"), On = Symbol.for("v-cmt");
|
|
1250
|
+
function wn(t) {
|
|
1243
1251
|
return t ? t.__v_isVNode === !0 : !1;
|
|
1244
1252
|
}
|
|
1245
1253
|
const Nn = (...t) => re(
|
|
@@ -1283,7 +1291,7 @@ function vn(t, e = null, n = null, s = 0, r = null, o = t === ee ? 0 : 1, i = !1
|
|
|
1283
1291
|
}
|
|
1284
1292
|
const Rn = process.env.NODE_ENV !== "production" ? Nn : re;
|
|
1285
1293
|
function re(t, e = null, n = null, s = 0, r = null, o = !1) {
|
|
1286
|
-
if ((!t || t === bn) && (process.env.NODE_ENV !== "production" && !t && P(`Invalid vnode type when creating vnode: ${t}.`), t =
|
|
1294
|
+
if ((!t || t === bn) && (process.env.NODE_ENV !== "production" && !t && P(`Invalid vnode type when creating vnode: ${t}.`), t = On), wn(t)) {
|
|
1287
1295
|
const c = X(
|
|
1288
1296
|
t,
|
|
1289
1297
|
e,
|
|
@@ -1318,7 +1326,7 @@ function Cn(t) {
|
|
|
1318
1326
|
return t ? H(t) || te(t) ? F({}, t) : t : null;
|
|
1319
1327
|
}
|
|
1320
1328
|
function X(t, e, n = !1, s = !1) {
|
|
1321
|
-
const { props: r, ref: o, patchFlag: i, children: c, transition: a } = t, f = e ? Vn(r || {}, e) : r,
|
|
1329
|
+
const { props: r, ref: o, patchFlag: i, children: c, transition: a } = t, f = e ? Vn(r || {}, e) : r, h = {
|
|
1322
1330
|
__v_isVNode: !0,
|
|
1323
1331
|
__v_skip: !0,
|
|
1324
1332
|
type: t.type,
|
|
@@ -1363,9 +1371,9 @@ function X(t, e, n = !1, s = !1) {
|
|
|
1363
1371
|
ce: t.ce
|
|
1364
1372
|
};
|
|
1365
1373
|
return a && s && Zt(
|
|
1366
|
-
|
|
1367
|
-
a.clone(
|
|
1368
|
-
),
|
|
1374
|
+
h,
|
|
1375
|
+
a.clone(h)
|
|
1376
|
+
), h;
|
|
1369
1377
|
}
|
|
1370
1378
|
function se(t) {
|
|
1371
1379
|
const e = X(t);
|
|
@@ -1423,7 +1431,7 @@ function Vn(...t) {
|
|
|
1423
1431
|
);
|
|
1424
1432
|
}
|
|
1425
1433
|
process.env.NODE_ENV;
|
|
1426
|
-
const
|
|
1434
|
+
const An = /(?:^|[-_])\w/g, xn = (t) => t.replace(An, (e) => e.toUpperCase()).replace(/[-_]/g, "");
|
|
1427
1435
|
function oe(t, e = !0) {
|
|
1428
1436
|
return V(t) ? t.displayName || t.name : t.name || e && t.__name;
|
|
1429
1437
|
}
|
|
@@ -1443,7 +1451,7 @@ function ie(t, e, n = !1) {
|
|
|
1443
1451
|
t.parent.type.components
|
|
1444
1452
|
) || r(t.appContext.components);
|
|
1445
1453
|
}
|
|
1446
|
-
return s ?
|
|
1454
|
+
return s ? xn(s) : n ? "App" : "Anonymous";
|
|
1447
1455
|
}
|
|
1448
1456
|
function ce(t) {
|
|
1449
1457
|
return V(t) && "__vccOpts" in t;
|
|
@@ -1459,13 +1467,13 @@ function $n() {
|
|
|
1459
1467
|
if (l.__isVue)
|
|
1460
1468
|
return ["div", t, "VueInstance"];
|
|
1461
1469
|
if (g(l)) {
|
|
1462
|
-
const
|
|
1470
|
+
const p = l.value;
|
|
1463
1471
|
return [
|
|
1464
1472
|
"div",
|
|
1465
1473
|
{},
|
|
1466
|
-
["span", t,
|
|
1474
|
+
["span", t, h(l)],
|
|
1467
1475
|
"<",
|
|
1468
|
-
c(
|
|
1476
|
+
c(p),
|
|
1469
1477
|
">"
|
|
1470
1478
|
];
|
|
1471
1479
|
} else {
|
|
@@ -1503,12 +1511,12 @@ function $n() {
|
|
|
1503
1511
|
}
|
|
1504
1512
|
};
|
|
1505
1513
|
function o(l) {
|
|
1506
|
-
const
|
|
1507
|
-
l.type.props && l.props &&
|
|
1514
|
+
const p = [];
|
|
1515
|
+
l.type.props && l.props && p.push(i("props", u(l.props))), l.setupState !== lt && p.push(i("setup", l.setupState)), l.data !== lt && p.push(i("data", u(l.data)));
|
|
1508
1516
|
const b = a(l, "computed");
|
|
1509
|
-
b &&
|
|
1517
|
+
b && p.push(i("computed", b));
|
|
1510
1518
|
const S = a(l, "inject");
|
|
1511
|
-
return S &&
|
|
1519
|
+
return S && p.push(i("injected", S)), p.push([
|
|
1512
1520
|
"div",
|
|
1513
1521
|
{},
|
|
1514
1522
|
[
|
|
@@ -1519,10 +1527,10 @@ function $n() {
|
|
|
1519
1527
|
"$ (internal): "
|
|
1520
1528
|
],
|
|
1521
1529
|
["object", { object: l }]
|
|
1522
|
-
]),
|
|
1530
|
+
]), p;
|
|
1523
1531
|
}
|
|
1524
|
-
function i(l,
|
|
1525
|
-
return
|
|
1532
|
+
function i(l, p) {
|
|
1533
|
+
return p = F({}, p), Object.keys(p).length ? [
|
|
1526
1534
|
"div",
|
|
1527
1535
|
{ style: "line-height:1.25em;margin-bottom:0.6em" },
|
|
1528
1536
|
[
|
|
@@ -1537,33 +1545,33 @@ function $n() {
|
|
|
1537
1545
|
{
|
|
1538
1546
|
style: "padding-left:1.25em"
|
|
1539
1547
|
},
|
|
1540
|
-
...Object.keys(
|
|
1548
|
+
...Object.keys(p).map((b) => [
|
|
1541
1549
|
"div",
|
|
1542
1550
|
{},
|
|
1543
1551
|
["span", s, b + ": "],
|
|
1544
|
-
c(
|
|
1552
|
+
c(p[b], !1)
|
|
1545
1553
|
])
|
|
1546
1554
|
]
|
|
1547
1555
|
] : ["span", {}];
|
|
1548
1556
|
}
|
|
1549
|
-
function c(l,
|
|
1550
|
-
return typeof l == "number" ? ["span", e, l] : typeof l == "string" ? ["span", n, JSON.stringify(l)] : typeof l == "boolean" ? ["span", s, l] : _(l) ? ["object", { object:
|
|
1557
|
+
function c(l, p = !0) {
|
|
1558
|
+
return typeof l == "number" ? ["span", e, l] : typeof l == "string" ? ["span", n, JSON.stringify(l)] : typeof l == "boolean" ? ["span", s, l] : _(l) ? ["object", { object: p ? u(l) : l }] : ["span", n, String(l)];
|
|
1551
1559
|
}
|
|
1552
|
-
function a(l,
|
|
1560
|
+
function a(l, p) {
|
|
1553
1561
|
const b = l.type;
|
|
1554
1562
|
if (V(b))
|
|
1555
1563
|
return;
|
|
1556
1564
|
const S = {};
|
|
1557
1565
|
for (const j in l.ctx)
|
|
1558
|
-
f(b, j,
|
|
1566
|
+
f(b, j, p) && (S[j] = l.ctx[j]);
|
|
1559
1567
|
return S;
|
|
1560
1568
|
}
|
|
1561
|
-
function f(l,
|
|
1569
|
+
function f(l, p, b) {
|
|
1562
1570
|
const S = l[b];
|
|
1563
|
-
if (d(S) && S.includes(
|
|
1571
|
+
if (d(S) && S.includes(p) || _(S) && p in S || l.extends && f(l.extends, p, b) || l.mixins && l.mixins.some((j) => f(j, p, b)))
|
|
1564
1572
|
return !0;
|
|
1565
1573
|
}
|
|
1566
|
-
function
|
|
1574
|
+
function h(l) {
|
|
1567
1575
|
return y(l) ? "ShallowRef" : l.effect ? "ComputedRef" : "Ref";
|
|
1568
1576
|
}
|
|
1569
1577
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(r) : window.devtoolsFormatters = [r];
|
|
@@ -1576,6 +1584,7 @@ function Dn() {
|
|
|
1576
1584
|
}
|
|
1577
1585
|
process.env.NODE_ENV !== "production" && Dn();
|
|
1578
1586
|
class Fn extends Vt {
|
|
1587
|
+
_className = "Store";
|
|
1579
1588
|
_onAction;
|
|
1580
1589
|
_options;
|
|
1581
1590
|
_store;
|
|
@@ -1640,7 +1649,7 @@ class Fn extends Vt {
|
|
|
1640
1649
|
return new this(e, n, s, r);
|
|
1641
1650
|
}
|
|
1642
1651
|
hasDeniedFirstChar(e) {
|
|
1643
|
-
return
|
|
1652
|
+
return xt(e[0]);
|
|
1644
1653
|
}
|
|
1645
1654
|
static hasRequiredKeys(e) {
|
|
1646
1655
|
return this._requiredKeys === void 0 || this._requiredKeys?.every((n) => !!e[n]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(_,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],T):(_=typeof globalThis<"u"?globalThis:_||self,T(_["pinia-plugin-subscription"]={},_.Pinia))})(this,(function(_,T){"use strict";class fe{_console;_createInstance;_name;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;get console(){return this._console??console}get name(){return this._name}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(e){this._subscriptions=e}constructor(e,n,s){this._name=e,this._createInstance=n,s&&(this._console=s)}invoke({store:e,options:n},s){this._storeInstance=this._createInstance(e,n,s,this.console),this._storeInstance&&(this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(e))}}class vt{_console;_debug=!1;get console(){return this._console??console}set console(e){this._console=e}get debug(){return this._debug}set debug(e){this._debug=e}constructor(e,n){this._debug=e,n&&(this._console=n)}debugLog(e,n){this._debug&&this.console.log(`${this.constructor.name} - ${e}`,n)}logError(...e){this.console.error(...e)}}const Rt="pinia-plugin-subscription",he=(t,e="white")=>`background-color: ${t}; color: ${e}; padding: 1px; margin-right: 5px; font-size: 12px`;function pe(t,e){if(!t)throw new Error("Style instructions are required");console.log("%c%s",t,e.shift(),...e)}class Ct{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(e,n){return` [${n} ${Rt}] - ${e} `}generateStyle(e){return he(e.bgColor,e.color)}getStyleDefinition(e){return this._styles[e??"info"]}log(...e){this.useLog(this.getStyleDefinition(),e)}error(...e){this.useLog(this.getStyleDefinition("error"),e)}rebuildArgs(e,n){if(typeof e=="string")return[this.formatMessage(e,n)];if(Array.isArray(e))return[this.formatMessage(e.shift(),n),...e??[]]}useLog(e,n){pe(this.generateStyle(e),this.rebuildArgs(n,e.icon))}}class de extends Ct{_pluginName=Rt}const _e=new de;function ge(t,e,n){const s=n?{storeOptions:n}:{};return typeof e=="function"?be(t,e,s):me(t,e,s)}function be(t,e,n){return T.defineStore(t,e,n)}function me(t,e,n){return n&&(e={...e,...n??{}}),T.defineStore(t,e)}const ye=new Set(["_","$"]);function It(t){return ye.has(t[0])}function rt(t){return t?Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:typeof t=="string"?t.trim()==="":!1:!(typeof t=="boolean"||typeof t=="number")}class Vt extends vt{_resetStoreCallback=[];_subscribers=[];_subscriptions=[];set subscribers(e){this._subscribers=e}get subscriptions(){if(!rt(this._subscriptions))return this._subscriptions}constructor(e,n){super(n,_e),this._subscribers=e}addResetStoreCallback(e){this._resetStoreCallback.push(e)}executeResetStoreCallbacks(e){this._resetStoreCallback.forEach(n=>n(e))}plugin({store:e,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - store: ${e.$id}`,["subscriber:",this._subscribers,"store:",e,"options:",n]);try{this._subscribers.forEach(s=>{s.invoke({store:e,options:n},this.debug),s.subscriptions&&this.subscriptionDelivery({store:e,options:n},s.subscriptions),s.storeMutationSubscription&&this.storeMutationSubscription(s.storeMutationSubscription),s.storeOnActionSubscription&&this.storeOnActionSubscription(s.storeOnActionSubscription),s.resetStoreCallback&&this.addResetStoreCallback(s.resetStoreCallback)}),this.rewriteResetStore({store:e},Object.assign({},e.$state),Object.assign({},e))}catch(s){this.logError(s,e,n)}}}rewriteResetStore({store:e},n,s){e.$reset=()=>{this.executeResetStoreCallbacks(e),Object.keys(s).forEach(r=>{It(r)||(e[r]=n[r]??s[r])}),e.$patch(JSON.parse(JSON.stringify(n)))}}storeOnActionSubscription(e){const{store:n,callback:s}=e();n.$onAction(({after:r,args:o,name:i})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,[r,o,i,n]),s({after:r,args:o,name:i})})}storeMutationSubscription(e){const{store:n,callback:s}=e();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,[r,n]),s(r)})}subscriptionDelivery({store:e,options:n},s){Object.entries(s).forEach(([r,o])=>{try{const{subscription:i,subscriptionOptions:c}=o;this.debugLog(`subscriptionDelivery() - store: ${e.$id}`,["pluginName:",r,"subscription:",i,"options:",c]),i.invoke({store:e,options:{...n,...c}},this.debug)}catch(i){this.logError(`subscriptionDelivery() - ${r}`,i,e,n)}})}}function Se(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const st=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const At=()=>{},Ee=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),x=Object.assign,we=Object.prototype.hasOwnProperty,ot=(t,e)=>we.call(t,e),d=Array.isArray,K=t=>$t(t)==="[object Map]",C=t=>typeof t=="function",O=t=>typeof t=="string",H=t=>typeof t=="symbol",g=t=>t!==null&&typeof t=="object",Oe=Object.prototype.toString,$t=t=>Oe.call(t),Tt=t=>$t(t).slice(8,-1),J=t=>O(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ne=(t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))})(t=>t.charAt(0).toUpperCase()+t.slice(1)),it=(t,e)=>!Object.is(t,e);let xt;const B=()=>xt||(xt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ct(t){if(d(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],r=O(s)?Ie(s):ct(s);if(r)for(const o in r)e[o]=r[o]}return e}else if(O(t)||g(t))return t}const ve=/;(?![^(]*\))/g,Re=/:([^]+)/,Ce=/\/\*[^]*?\*\//g;function Ie(t){const e={};return t.replace(Ce,"").split(ve).forEach(n=>{if(n){const s=n.split(Re);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function lt(t){let e="";if(O(t))e=t;else if(d(t))for(let n=0;n<t.length;n++){const s=lt(t[n]);s&&(e+=s+" ")}else if(g(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function D(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let Dt=0,at;function ut(){Dt++}function ft(){if(--Dt>0)return;let t;for(;at;){let e=at;for(at=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}class Ve{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){}trigger(e){this.version++,this.notify(e)}notify(e){ut();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(x({effect:n.sub},e));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ft()}}}const Mt=new WeakMap,ht=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Pt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Ft=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function kn(t,e,n){}function I(t,e,n,s,r,o){const i=Mt.get(t);if(!i)return;const c=a=>{a&&(process.env.NODE_ENV!=="production"?a.trigger({target:t,type:e,key:n,newValue:s,oldValue:r,oldTarget:o}):a.trigger())};if(ut(),e==="clear")i.forEach(c);else{const a=d(t),f=a&&J(n);if(a&&n==="length"){const p=Number(s);i.forEach((l,h)=>{(h==="length"||h===Ft||!H(h)&&h>=p)&&c(l)})}else switch((n!==void 0||i.has(void 0))&&c(i.get(n)),f&&c(i.get(Ft)),e){case"add":a?f&&c(i.get("length")):(c(i.get(ht)),K(t)&&c(i.get(Pt)));break;case"delete":a||(c(i.get(ht)),K(t)&&c(i.get(Pt)));break;case"set":K(t)&&c(i.get(ht));break}}ft()}function Ae(t,e){const n=Mt.get(t);return n&&n.get(e)}function M(t){const e=u(t);return e===t||m(t)?e:e.map(v)}function pt(t){return t=u(t),t}function V(t,e){return E(t)?mt(t)?W(v(e)):W(e):v(e)}const $e={__proto__:null,[Symbol.iterator](){return dt(this,Symbol.iterator,t=>V(this,t))},concat(...t){return M(this).concat(...t.map(e=>d(e)?M(e):e))},entries(){return dt(this,"entries",t=>(t[1]=V(this,t[1]),t))},every(t,e){return N(this,"every",t,e,void 0,arguments)},filter(t,e){return N(this,"filter",t,e,n=>n.map(s=>V(this,s)),arguments)},find(t,e){return N(this,"find",t,e,n=>V(this,n),arguments)},findIndex(t,e){return N(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return N(this,"findLast",t,e,n=>V(this,n),arguments)},findLastIndex(t,e){return N(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return N(this,"forEach",t,e,void 0,arguments)},includes(...t){return _t(this,"includes",t)},indexOf(...t){return _t(this,"indexOf",t)},join(t){return M(this).join(t)},lastIndexOf(...t){return _t(this,"lastIndexOf",t)},map(t,e){return N(this,"map",t,e,void 0,arguments)},pop(){return L(this,"pop")},push(...t){return L(this,"push",t)},reduce(t,...e){return jt(this,"reduce",t,e)},reduceRight(t,...e){return jt(this,"reduceRight",t,e)},shift(){return L(this,"shift")},some(t,e){return N(this,"some",t,e,void 0,arguments)},splice(...t){return L(this,"splice",t)},toReversed(){return M(this).toReversed()},toSorted(t){return M(this).toSorted(t)},toSpliced(...t){return M(this).toSpliced(...t)},unshift(...t){return L(this,"unshift",t)},values(){return dt(this,"values",t=>V(this,t))}};function dt(t,e,n){const s=pt(t),r=s[e]();return s!==t&&!m(t)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const Te=Array.prototype;function N(t,e,n,s,r,o){const i=pt(t),c=i!==t&&!m(t),a=i[e];if(a!==Te[e]){const l=a.apply(t,o);return c?v(l):l}let f=n;i!==t&&(c?f=function(l,h){return n.call(this,V(t,l),h,t)}:n.length>2&&(f=function(l,h){return n.call(this,l,h,t)}));const p=a.call(i,f,s);return c&&r?r(p):p}function jt(t,e,n,s){const r=pt(t);let o=n;return r!==t&&(m(t)?n.length>3&&(o=function(i,c,a){return n.call(this,i,c,a,t)}):o=function(i,c,a){return n.call(this,i,V(t,c),a,t)}),r[e](o,...s)}function _t(t,e,n){const s=u(t),r=s[e](...n);return(r===-1||r===!1)&&z(n[0])?(n[0]=u(n[0]),s[e](...n)):r}function L(t,e,n=[]){ut();const s=u(t)[e].apply(t,n);return ft(),s}const xe=Se("__proto__,__v_isRef,__isVue"),kt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(H));function De(t){return H(t)||(t=String(t)),u(this).hasOwnProperty(t)}class Kt{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?We:Wt:o?ze:zt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const i=d(e);if(!r){let a;if(i&&(a=$e[n]))return a;if(n==="hasOwnProperty")return De}const c=Reflect.get(e,n,b(e)?e:s);if((H(n)?kt.has(n):xe(n))||o)return c;if(b(c)){const a=i&&J(n)?c:c.value;return r&&g(a)?bt(a):a}return g(c)?r?bt(c):Ut(c):c}}class Me extends Kt{constructor(e=!1){super(!1,e)}set(e,n,s,r){let o=e[n];const i=d(e)&&J(n);if(!this._isShallow){const f=E(o);if(!m(s)&&!E(s)&&(o=u(o),s=u(s)),!i&&b(o)&&!b(s))return f?(process.env.NODE_ENV!=="production"&&D(`Set operation on key "${String(n)}" failed: target is readonly.`,e[n]),!0):(o.value=s,!0)}const c=i?Number(n)<e.length:ot(e,n),a=Reflect.set(e,n,s,b(e)?e:r);return e===u(r)&&(c?it(s,o)&&I(e,"set",n,s,o):I(e,"add",n,s)),a}deleteProperty(e,n){const s=ot(e,n),r=e[n],o=Reflect.deleteProperty(e,n);return o&&s&&I(e,"delete",n,void 0,r),o}has(e,n){const s=Reflect.has(e,n);return!H(n)||kt.has(n),s}ownKeys(e){return Reflect.ownKeys(e)}}class Pe extends Kt{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&D(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&D(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Fe=new Me,je=new Pe,gt=t=>t,Y=t=>Reflect.getPrototypeOf(t);function ke(t,e,n){return function(...s){const r=this.__v_raw,o=u(r),i=K(o),c=t==="entries"||t===Symbol.iterator&&i,a=r[t](...s),f=n?gt:e?W:v;return{next(){const{value:p,done:l}=a.next();return l?{value:p,done:l}:{value:c?[f(p[0]),f(p[1])]:f(p),done:l}},[Symbol.iterator](){return this}}}}function G(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";D(`${Ne(t)} operation ${n}failed: target is readonly.`,u(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Ke(t,e){const n={get(r){const o=this.__v_raw,i=u(o),c=u(r),{has:a}=Y(i),f=e?gt:t?W:v;if(a.call(i,r))return f(o.get(r));if(a.call(i,c))return f(o.get(c));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!t&&(u(r),void 0),r.size},has(r){const o=this.__v_raw;u(o);const i=u(r);return r===i?o.has(r):o.has(r)||o.has(i)},forEach(r,o){const i=this,c=i.__v_raw;u(c);const a=e?gt:t?W:v;return c.forEach((f,p)=>r.call(o,a(f),a(p),i))}};return x(n,t?{add:G("add"),set:G("set"),delete:G("delete"),clear:G("clear")}:{add(r){!e&&!m(r)&&!E(r)&&(r=u(r));const o=u(this);return Y(o).has.call(o,r)||(o.add(r),I(o,"add",r,r)),this},set(r,o){!e&&!m(o)&&!E(o)&&(o=u(o));const i=u(this),{has:c,get:a}=Y(i);let f=c.call(i,r);f?process.env.NODE_ENV!=="production"&&Lt(i,c,r):(r=u(r),f=c.call(i,r));const p=a.call(i,r);return i.set(r,o),f?it(o,p)&&I(i,"set",r,o,p):I(i,"add",r,o),this},delete(r){const o=u(this),{has:i,get:c}=Y(o);let a=i.call(o,r);a?process.env.NODE_ENV!=="production"&&Lt(o,i,r):(r=u(r),a=i.call(o,r));const f=c?c.call(o,r):void 0,p=o.delete(r);return a&&I(o,"delete",r,void 0,f),p},clear(){const r=u(this),o=r.size!==0,i=process.env.NODE_ENV!=="production"?K(r)?new Map(r):new Set(r):void 0,c=r.clear();return o&&I(r,"clear",void 0,void 0,i),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ke(r,t,e)}),n}function Ht(t,e){const n=Ke(t,e);return(s,r,o)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?s:Reflect.get(ot(n,r)&&r in s?n:s,r,o)}const He={get:Ht(!1,!1)},Le={get:Ht(!0,!1)};function Lt(t,e,n){const s=u(n);if(s!==n&&e.call(t,s)){const r=Tt(t);D(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const zt=new WeakMap,ze=new WeakMap,Wt=new WeakMap,We=new WeakMap;function Ue(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qe(t){return t.__v_skip||!Object.isExtensible(t)?0:Ue(Tt(t))}function Ut(t){return E(t)?t:qt(t,!1,Fe,He,zt)}function bt(t){return qt(t,!0,je,Le,Wt)}function qt(t,e,n,s,r){if(!g(t))return process.env.NODE_ENV!=="production"&&D(`value cannot be made ${e?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=qe(t);if(o===0)return t;const i=r.get(t);if(i)return i;const c=new Proxy(t,o===2?s:n);return r.set(t,c),c}function mt(t){return E(t)?mt(t.__v_raw):!!(t&&t.__v_isReactive)}function E(t){return!!(t&&t.__v_isReadonly)}function m(t){return!!(t&&t.__v_isShallow)}function z(t){return t?!!t.__v_raw:!1}function u(t){const e=t&&t.__v_raw;return e?u(e):t}const v=t=>g(t)?Ut(t):t,W=t=>g(t)?bt(t):t;function b(t){return t?t.__v_isRef===!0:!1}function Jt(t){return Je(t,!1)}function Je(t,e){return b(t)?t:new Be(t,e)}class Be{constructor(e,n){this.dep=new Ve,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:u(e),this._value=n?e:v(e),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||m(e)||E(e);e=s?e:u(e),it(e,n)&&(this._rawValue=e,this._value=s?e:v(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:n}):this.dep.trigger())}}function Ye(t){return b(t)?t.value:t}class Ge{constructor(e,n,s){this._object=e,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=u(e);let r=!0,o=e;if(!d(e)||!J(String(n)))do r=!z(o)||m(o);while(r&&(o=o.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Ye(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&b(this._raw[this._key])){const n=this._object[this._key];if(b(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Ae(this._raw,this._key)}}class Qe{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Xe(t,e,n){return b(t)?t:C(t)?new Qe(t):g(t)&&arguments.length>1?Ze(t,e,n):Jt(t)}function Ze(t,e,n){return new Ge(t,e,n)}const $=[];function tn(t){$.push(t)}function en(){$.pop()}let yt=!1;function P(t,...e){if(yt)return;yt=!0;const n=$.length?$[$.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=nn();if(s)St(s,n,11,[t+e.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${ae(n,o.type)}>`).join(`
|
|
1
|
+
(function(_,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],T):(_=typeof globalThis<"u"?globalThis:_||self,T(_["pinia-plugin-subscription"]={},_.Pinia))})(this,(function(_,T){"use strict";class fe{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;get console(){return this._console??console}get name(){return this._name}get pluginOptions(){return this._pluginOptions??{}}set pluginOptions(e){this._pluginOptions=e}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(e){this._subscriptions=e}constructor(e,n,s){this._name=e,this._createInstance=n,s&&(this._console=s)}invoke({store:e,options:n},s){this._storeInstance=this._createInstance(e,{...n,...this.pluginOptions},s,this.console),this._storeInstance&&(this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(e))}}class vt{_console;_debug=!1;get console(){return this._console??console}set console(e){this._console=e}get debug(){return this._debug}set debug(e){this._debug=e}constructor(e,n){this._debug=e,n&&(this._console=n)}debugLog(...e){this._debug&&(Array.isArray(e)&&(e[0]=`${this._className} - ${e[0]}`),this.console.log(...e))}logError(...e){this.console.error(...e)}}const Rt="pinia-plugin-subscription",pe=(t,e="white")=>`background-color: ${t}; color: ${e}; padding: 1px; margin-right: 5px; font-size: 12px`;function he(t,e){if(!t)throw new Error("Style instructions are required");console.log("%c%s",t,e.shift(),...e)}class Ct{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(e,n){return` [${n} ${Rt}] - ${e} `}generateStyle(e){return pe(e.bgColor,e.color)}getStyleDefinition(e){return this._styles[e??"info"]}log(...e){this.useLog(this.getStyleDefinition(),e)}error(...e){this.useLog(this.getStyleDefinition("error"),e)}rebuildArgs(e,n){if(typeof e=="string")return[this.formatMessage(e,n)];if(Array.isArray(e))return[this.formatMessage(e.shift(),n),...e??[]]}useLog(e,n){he(this.generateStyle(e),this.rebuildArgs(n,e.icon))}}class de extends Ct{_pluginName=Rt}const _e=new de;function ge(t,e,n){const s=n?{storeOptions:n}:{};return typeof e=="function"?be(t,e,s):me(t,e,s)}function be(t,e,n){return T.defineStore(t,e,n)}function me(t,e,n){return n&&(e={...e,...n??{}}),T.defineStore(t,e)}const ye=new Set(["_","$"]);function It(t){return ye.has(t[0])}function rt(t){return t?Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:typeof t=="string"?t.trim()==="":!1:!(typeof t=="boolean"||typeof t=="number")}class Vt extends vt{_className="PluginSubscription";_resetStoreCallback=[];_subscribers=[];_subscriptions=[];set subscribers(e){this._subscribers=e}get subscriptions(){if(!rt(this._subscriptions))return this._subscriptions}constructor(e,n){super(n,_e),this._subscribers=e}addResetStoreCallback(e){this._resetStoreCallback.push(e)}executeResetStoreCallbacks(e){this._resetStoreCallback.forEach(n=>n(e))}plugin({store:e,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - store: ${e.$id}`,["subscriber:",this._subscribers,"store:",e,"options:",n]);try{this._subscribers.forEach(s=>{s.invoke({store:e,options:n},this.debug),s.subscriptions&&this.subscriptionDelivery({store:e,options:n},s.subscriptions),s.storeMutationSubscription&&this.storeMutationSubscription(s.storeMutationSubscription),s.storeOnActionSubscription&&this.storeOnActionSubscription(s.storeOnActionSubscription),s.resetStoreCallback&&this.addResetStoreCallback(s.resetStoreCallback)}),this.rewriteResetStore({store:e},Object.assign({},e.$state),Object.assign({},e))}catch(s){this.logError(s,e,n)}}}rewriteResetStore({store:e},n,s){e.$reset=()=>{this.executeResetStoreCallbacks(e),Object.keys(s).forEach(r=>{It(r)||(e[r]=n[r]??s[r])}),e.$patch(JSON.parse(JSON.stringify(n)))}}storeOnActionSubscription(e){const{store:n,callback:s}=e();n.$onAction(({after:r,args:o,name:i})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,[r,o,i,n]),s({after:r,args:o,name:i})})}storeMutationSubscription(e){const{store:n,callback:s}=e();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,[r,n]),s(r)})}subscriptionDelivery({store:e,options:n},s){Object.entries(s).forEach(([r,o])=>{try{const{subscription:i,subscriptionOptions:c}=o;this.debugLog(`subscriptionDelivery() - store: ${e.$id}`,["pluginName:",r,"subscription:",i,"options:",c]),i.invoke({store:e,options:{...n,...c}},this.debug)}catch(i){this.logError(`subscriptionDelivery() - ${r}`,i,e,n)}})}}function Se(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const st=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const At=()=>{},Ee=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),x=Object.assign,Oe=Object.prototype.hasOwnProperty,ot=(t,e)=>Oe.call(t,e),d=Array.isArray,K=t=>$t(t)==="[object Map]",C=t=>typeof t=="function",w=t=>typeof t=="string",H=t=>typeof t=="symbol",g=t=>t!==null&&typeof t=="object",we=Object.prototype.toString,$t=t=>we.call(t),Tt=t=>$t(t).slice(8,-1),J=t=>w(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ne=(t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))})(t=>t.charAt(0).toUpperCase()+t.slice(1)),it=(t,e)=>!Object.is(t,e);let xt;const B=()=>xt||(xt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ct(t){if(d(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],r=w(s)?Ie(s):ct(s);if(r)for(const o in r)e[o]=r[o]}return e}else if(w(t)||g(t))return t}const ve=/;(?![^(]*\))/g,Re=/:([^]+)/,Ce=/\/\*[^]*?\*\//g;function Ie(t){const e={};return t.replace(Ce,"").split(ve).forEach(n=>{if(n){const s=n.split(Re);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function lt(t){let e="";if(w(t))e=t;else if(d(t))for(let n=0;n<t.length;n++){const s=lt(t[n]);s&&(e+=s+" ")}else if(g(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function D(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let Dt=0,at;function ut(){Dt++}function ft(){if(--Dt>0)return;let t;for(;at;){let e=at;for(at=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}class Ve{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){}trigger(e){this.version++,this.notify(e)}notify(e){ut();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(x({effect:n.sub},e));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ft()}}}const Pt=new WeakMap,pt=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Mt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Ft=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function kn(t,e,n){}function I(t,e,n,s,r,o){const i=Pt.get(t);if(!i)return;const c=a=>{a&&(process.env.NODE_ENV!=="production"?a.trigger({target:t,type:e,key:n,newValue:s,oldValue:r,oldTarget:o}):a.trigger())};if(ut(),e==="clear")i.forEach(c);else{const a=d(t),f=a&&J(n);if(a&&n==="length"){const h=Number(s);i.forEach((l,p)=>{(p==="length"||p===Ft||!H(p)&&p>=h)&&c(l)})}else switch((n!==void 0||i.has(void 0))&&c(i.get(n)),f&&c(i.get(Ft)),e){case"add":a?f&&c(i.get("length")):(c(i.get(pt)),K(t)&&c(i.get(Mt)));break;case"delete":a||(c(i.get(pt)),K(t)&&c(i.get(Mt)));break;case"set":K(t)&&c(i.get(pt));break}}ft()}function Ae(t,e){const n=Pt.get(t);return n&&n.get(e)}function P(t){const e=u(t);return e===t||m(t)?e:e.map(v)}function ht(t){return t=u(t),t}function V(t,e){return E(t)?mt(t)?W(v(e)):W(e):v(e)}const $e={__proto__:null,[Symbol.iterator](){return dt(this,Symbol.iterator,t=>V(this,t))},concat(...t){return P(this).concat(...t.map(e=>d(e)?P(e):e))},entries(){return dt(this,"entries",t=>(t[1]=V(this,t[1]),t))},every(t,e){return N(this,"every",t,e,void 0,arguments)},filter(t,e){return N(this,"filter",t,e,n=>n.map(s=>V(this,s)),arguments)},find(t,e){return N(this,"find",t,e,n=>V(this,n),arguments)},findIndex(t,e){return N(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return N(this,"findLast",t,e,n=>V(this,n),arguments)},findLastIndex(t,e){return N(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return N(this,"forEach",t,e,void 0,arguments)},includes(...t){return _t(this,"includes",t)},indexOf(...t){return _t(this,"indexOf",t)},join(t){return P(this).join(t)},lastIndexOf(...t){return _t(this,"lastIndexOf",t)},map(t,e){return N(this,"map",t,e,void 0,arguments)},pop(){return L(this,"pop")},push(...t){return L(this,"push",t)},reduce(t,...e){return jt(this,"reduce",t,e)},reduceRight(t,...e){return jt(this,"reduceRight",t,e)},shift(){return L(this,"shift")},some(t,e){return N(this,"some",t,e,void 0,arguments)},splice(...t){return L(this,"splice",t)},toReversed(){return P(this).toReversed()},toSorted(t){return P(this).toSorted(t)},toSpliced(...t){return P(this).toSpliced(...t)},unshift(...t){return L(this,"unshift",t)},values(){return dt(this,"values",t=>V(this,t))}};function dt(t,e,n){const s=ht(t),r=s[e]();return s!==t&&!m(t)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const Te=Array.prototype;function N(t,e,n,s,r,o){const i=ht(t),c=i!==t&&!m(t),a=i[e];if(a!==Te[e]){const l=a.apply(t,o);return c?v(l):l}let f=n;i!==t&&(c?f=function(l,p){return n.call(this,V(t,l),p,t)}:n.length>2&&(f=function(l,p){return n.call(this,l,p,t)}));const h=a.call(i,f,s);return c&&r?r(h):h}function jt(t,e,n,s){const r=ht(t);let o=n;return r!==t&&(m(t)?n.length>3&&(o=function(i,c,a){return n.call(this,i,c,a,t)}):o=function(i,c,a){return n.call(this,i,V(t,c),a,t)}),r[e](o,...s)}function _t(t,e,n){const s=u(t),r=s[e](...n);return(r===-1||r===!1)&&z(n[0])?(n[0]=u(n[0]),s[e](...n)):r}function L(t,e,n=[]){ut();const s=u(t)[e].apply(t,n);return ft(),s}const xe=Se("__proto__,__v_isRef,__isVue"),kt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(H));function De(t){return H(t)||(t=String(t)),u(this).hasOwnProperty(t)}class Kt{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?We:Wt:o?ze:zt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const i=d(e);if(!r){let a;if(i&&(a=$e[n]))return a;if(n==="hasOwnProperty")return De}const c=Reflect.get(e,n,b(e)?e:s);if((H(n)?kt.has(n):xe(n))||o)return c;if(b(c)){const a=i&&J(n)?c:c.value;return r&&g(a)?bt(a):a}return g(c)?r?bt(c):Ut(c):c}}class Pe extends Kt{constructor(e=!1){super(!1,e)}set(e,n,s,r){let o=e[n];const i=d(e)&&J(n);if(!this._isShallow){const f=E(o);if(!m(s)&&!E(s)&&(o=u(o),s=u(s)),!i&&b(o)&&!b(s))return f?(process.env.NODE_ENV!=="production"&&D(`Set operation on key "${String(n)}" failed: target is readonly.`,e[n]),!0):(o.value=s,!0)}const c=i?Number(n)<e.length:ot(e,n),a=Reflect.set(e,n,s,b(e)?e:r);return e===u(r)&&(c?it(s,o)&&I(e,"set",n,s,o):I(e,"add",n,s)),a}deleteProperty(e,n){const s=ot(e,n),r=e[n],o=Reflect.deleteProperty(e,n);return o&&s&&I(e,"delete",n,void 0,r),o}has(e,n){const s=Reflect.has(e,n);return!H(n)||kt.has(n),s}ownKeys(e){return Reflect.ownKeys(e)}}class Me extends Kt{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&D(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&D(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Fe=new Pe,je=new Me,gt=t=>t,Y=t=>Reflect.getPrototypeOf(t);function ke(t,e,n){return function(...s){const r=this.__v_raw,o=u(r),i=K(o),c=t==="entries"||t===Symbol.iterator&&i,a=r[t](...s),f=n?gt:e?W:v;return{next(){const{value:h,done:l}=a.next();return l?{value:h,done:l}:{value:c?[f(h[0]),f(h[1])]:f(h),done:l}},[Symbol.iterator](){return this}}}}function G(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";D(`${Ne(t)} operation ${n}failed: target is readonly.`,u(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Ke(t,e){const n={get(r){const o=this.__v_raw,i=u(o),c=u(r),{has:a}=Y(i),f=e?gt:t?W:v;if(a.call(i,r))return f(o.get(r));if(a.call(i,c))return f(o.get(c));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!t&&(u(r),void 0),r.size},has(r){const o=this.__v_raw;u(o);const i=u(r);return r===i?o.has(r):o.has(r)||o.has(i)},forEach(r,o){const i=this,c=i.__v_raw;u(c);const a=e?gt:t?W:v;return c.forEach((f,h)=>r.call(o,a(f),a(h),i))}};return x(n,t?{add:G("add"),set:G("set"),delete:G("delete"),clear:G("clear")}:{add(r){!e&&!m(r)&&!E(r)&&(r=u(r));const o=u(this);return Y(o).has.call(o,r)||(o.add(r),I(o,"add",r,r)),this},set(r,o){!e&&!m(o)&&!E(o)&&(o=u(o));const i=u(this),{has:c,get:a}=Y(i);let f=c.call(i,r);f?process.env.NODE_ENV!=="production"&&Lt(i,c,r):(r=u(r),f=c.call(i,r));const h=a.call(i,r);return i.set(r,o),f?it(o,h)&&I(i,"set",r,o,h):I(i,"add",r,o),this},delete(r){const o=u(this),{has:i,get:c}=Y(o);let a=i.call(o,r);a?process.env.NODE_ENV!=="production"&&Lt(o,i,r):(r=u(r),a=i.call(o,r));const f=c?c.call(o,r):void 0,h=o.delete(r);return a&&I(o,"delete",r,void 0,f),h},clear(){const r=u(this),o=r.size!==0,i=process.env.NODE_ENV!=="production"?K(r)?new Map(r):new Set(r):void 0,c=r.clear();return o&&I(r,"clear",void 0,void 0,i),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ke(r,t,e)}),n}function Ht(t,e){const n=Ke(t,e);return(s,r,o)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?s:Reflect.get(ot(n,r)&&r in s?n:s,r,o)}const He={get:Ht(!1,!1)},Le={get:Ht(!0,!1)};function Lt(t,e,n){const s=u(n);if(s!==n&&e.call(t,s)){const r=Tt(t);D(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const zt=new WeakMap,ze=new WeakMap,Wt=new WeakMap,We=new WeakMap;function Ue(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qe(t){return t.__v_skip||!Object.isExtensible(t)?0:Ue(Tt(t))}function Ut(t){return E(t)?t:qt(t,!1,Fe,He,zt)}function bt(t){return qt(t,!0,je,Le,Wt)}function qt(t,e,n,s,r){if(!g(t))return process.env.NODE_ENV!=="production"&&D(`value cannot be made ${e?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=qe(t);if(o===0)return t;const i=r.get(t);if(i)return i;const c=new Proxy(t,o===2?s:n);return r.set(t,c),c}function mt(t){return E(t)?mt(t.__v_raw):!!(t&&t.__v_isReactive)}function E(t){return!!(t&&t.__v_isReadonly)}function m(t){return!!(t&&t.__v_isShallow)}function z(t){return t?!!t.__v_raw:!1}function u(t){const e=t&&t.__v_raw;return e?u(e):t}const v=t=>g(t)?Ut(t):t,W=t=>g(t)?bt(t):t;function b(t){return t?t.__v_isRef===!0:!1}function Jt(t){return Je(t,!1)}function Je(t,e){return b(t)?t:new Be(t,e)}class Be{constructor(e,n){this.dep=new Ve,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:u(e),this._value=n?e:v(e),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||m(e)||E(e);e=s?e:u(e),it(e,n)&&(this._rawValue=e,this._value=s?e:v(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:n}):this.dep.trigger())}}function Ye(t){return b(t)?t.value:t}class Ge{constructor(e,n,s){this._object=e,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=u(e);let r=!0,o=e;if(!d(e)||!J(String(n)))do r=!z(o)||m(o);while(r&&(o=o.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Ye(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&b(this._raw[this._key])){const n=this._object[this._key];if(b(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Ae(this._raw,this._key)}}class Qe{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Xe(t,e,n){return b(t)?t:C(t)?new Qe(t):g(t)&&arguments.length>1?Ze(t,e,n):Jt(t)}function Ze(t,e,n){return new Ge(t,e,n)}const $=[];function tn(t){$.push(t)}function en(){$.pop()}let yt=!1;function M(t,...e){if(yt)return;yt=!0;const n=$.length?$[$.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=nn();if(s)St(s,n,11,[t+e.map(o=>{var i,c;return(c=(i=o.toString)==null?void 0:i.call(o))!=null?c:JSON.stringify(o)}).join(""),n&&n.proxy,r.map(({vnode:o})=>`at <${ae(n,o.type)}>`).join(`
|
|
2
2
|
`),r]);else{const o=[`[Vue warn]: ${t}`,...e];r.length&&o.push(`
|
|
3
3
|
`,...rn(r)),console.warn(...o)}yt=!1}function nn(){let t=$[$.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const s=t.component&&t.component.parent;t=s&&s.vnode}return e}function rn(t){const e=[];return t.forEach((n,s)=>{e.push(...s===0?[]:[`
|
|
4
|
-
`],...sn(n))}),e}function sn({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",s=t.component?t.component.parent==null:!1,r=` at <${ae(t.component,t.type,s)}`,o=">"+n;return t.props?[r,...on(t.props),o]:[r+o]}function on(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(s=>{e.push(...Bt(s,t[s]))}),n.length>3&&e.push(" ..."),e}function Bt(t,e,n){return
|
|
5
|
-
Component that was made reactive: `,t)),Cn(t,e,n,s,r,i,o,!0)}function Vn(t){return t?z(t)||re(t)?x({},t):t:null}function nt(t,e,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:c,transition:a}=t,f=e?$n(r||{},e):r,
|
|
4
|
+
`],...sn(n))}),e}function sn({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",s=t.component?t.component.parent==null:!1,r=` at <${ae(t.component,t.type,s)}`,o=">"+n;return t.props?[r,...on(t.props),o]:[r+o]}function on(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(s=>{e.push(...Bt(s,t[s]))}),n.length>3&&e.push(" ..."),e}function Bt(t,e,n){return w(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:b(e)?(e=Bt(t,u(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):C(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=u(e),n?e:[`${t}=`,e])}const Yt={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function St(t,e,n,s){try{return s?t(...s):t()}catch(r){Gt(r,e,n)}}function Gt(t,e,n,s=!0){const r=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=e&&e.appContext.config||st;if(e){let c=e.parent;const a=e.proxy,f=process.env.NODE_ENV!=="production"?Yt[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let l=0;l<h.length;l++)if(h[l](t,a,f)===!1)return}c=c.parent}if(o){St(o,null,10,[t,a,f]);return}}cn(t,n,r,s,i)}function cn(t,e,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const o=Yt[e];if(n&&tn(n),M(`Unhandled error${o?` during execution of ${o}`:""}`),n&&en(),s)throw t;console.error(t)}else{if(r)throw t;console.error(t)}}const y=[];let R=-1;const F=[];let A=null,j=0;const ln=Promise.resolve();let Et=null;const an=100;function un(t){let e=R+1,n=y.length;for(;e<n;){const s=e+n>>>1,r=y[s],o=U(r);o<t||o===t&&r.flags&2?e=s+1:n=s}return e}function fn(t){if(!(t.flags&1)){const e=U(t),n=y[y.length-1];!n||!(t.flags&2)&&e>=U(n)?y.push(t):y.splice(un(e),0,t),t.flags|=1,Qt()}}function Qt(){Et||(Et=ln.then(Xt))}function pn(t){d(t)?F.push(...t):A&&t.id===-1?A.splice(j+1,0,t):t.flags&1||(F.push(t),t.flags|=1),Qt()}function hn(t){if(F.length){const e=[...new Set(F)].sort((n,s)=>U(n)-U(s));if(F.length=0,A){A.push(...e);return}for(A=e,process.env.NODE_ENV!=="production"&&(t=t||new Map),j=0;j<A.length;j++){const n=A[j];process.env.NODE_ENV!=="production"&&Zt(t,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}A=null,j=0}}const U=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Xt(t){process.env.NODE_ENV!=="production"&&(t=t||new Map);const e=process.env.NODE_ENV!=="production"?n=>Zt(t,n):At;try{for(R=0;R<y.length;R++){const n=y[R];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&e(n))continue;n.flags&4&&(n.flags&=-2),St(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;R<y.length;R++){const n=y[R];n&&(n.flags&=-2)}R=-1,y.length=0,hn(t),Et=null,(y.length||F.length)&&Xt(t)}}function Zt(t,e){const n=t.get(e)||0;if(n>an){const s=e.i,r=s&&le(s.type);return Gt(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return t.set(e,n+1),!1}const Ot=new Map;process.env.NODE_ENV!=="production"&&(B().__VUE_HMR_RUNTIME__={createRecord:wt(dn),rerender:wt(_n),reload:wt(gn)});const Q=new Map;function dn(t,e){return Q.has(t)?!1:(Q.set(t,{initialDef:X(e),instances:new Set}),!0)}function X(t){return ue(t)?t.__vccOpts:t}function _n(t,e){const n=Q.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(s=>{e&&(s.render=e,X(s.type).render=e),s.renderCache=[],s.job.flags&8||s.update()}))}function gn(t,e){const n=Q.get(t);if(!n)return;e=X(e),te(n.initialDef,e);const s=[...n.instances];for(let r=0;r<s.length;r++){const o=s[r],i=X(o.type);let c=Ot.get(i);c||(i!==n.initialDef&&te(i,e),Ot.set(i,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(e.styles),c.delete(o)):o.parent?fn(()=>{o.job.flags&8||(o.parent.update(),c.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(i)}pn(()=>{Ot.clear()})}function te(t,e){x(t,e);for(const n in t)n!=="__file"&&!(n in e)&&delete t[n]}function wt(t){return(e,n)=>{try{return t(e,n)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let k,Z=[];function ee(t,e){var n,s;k=t,k?(k.enabled=!0,Z.forEach(({event:r,args:o})=>k.emit(r,...o)),Z=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{ee(o,e)}),setTimeout(()=>{k||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Z=[])},3e3)):Z=[]}let tt=null,bn=null;const mn=t=>t.__isTeleport;function ne(t,e){t.shapeFlag&6&&t.component?(t.transition=e,ne(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}B().requestIdleCallback,B().cancelIdleCallback;const yn=Symbol.for("v-ndc"),Sn={};process.env.NODE_ENV!=="production"&&(Sn.ownKeys=t=>(M("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(t)));const En={},re=t=>Object.getPrototypeOf(t)===En,On=t=>t.__isSuspense,se=Symbol.for("v-fgt"),wn=Symbol.for("v-txt"),Nn=Symbol.for("v-cmt");function vn(t){return t?t.__v_isVNode===!0:!1}const Rn=(...t)=>ie(...t),oe=({key:t})=>t??null,et=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?w(t)||b(t)||C(t)?{i:tt,r:t,k:e,f:!!n}:t:null);function Cn(t,e=null,n=null,s=0,r=null,o=t===se?0:1,i=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&oe(e),ref:e&&et(e),scopeId:bn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:tt};return c?(Nt(a,n),o&128&&t.normalize(a)):n&&(a.shapeFlag|=w(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&M("VNode created with invalid key (NaN). VNode type:",a.type),a}const In=process.env.NODE_ENV!=="production"?Rn:ie;function ie(t,e=null,n=null,s=0,r=null,o=!1){if((!t||t===yn)&&(process.env.NODE_ENV!=="production"&&!t&&M(`Invalid vnode type when creating vnode: ${t}.`),t=Nn),vn(t)){const c=nt(t,e,!0);return n&&Nt(c,n),c.patchFlag=-2,c}if(ue(t)&&(t=t.__vccOpts),e){e=Vn(e);let{class:c,style:a}=e;c&&!w(c)&&(e.class=lt(c)),g(a)&&(z(a)&&!d(a)&&(a=x({},a)),e.style=ct(a))}const i=w(t)?1:On(t)?128:mn(t)?64:g(t)?4:C(t)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&z(t)&&(t=u(t),M("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
5
|
+
Component that was made reactive: `,t)),Cn(t,e,n,s,r,i,o,!0)}function Vn(t){return t?z(t)||re(t)?x({},t):t:null}function nt(t,e,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:c,transition:a}=t,f=e?$n(r||{},e):r,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:f,key:f&&oe(f),ref:e&&e.ref?n&&o?d(o)?o.concat(et(e)):[o,et(e)]:et(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&d(c)?c.map(ce):c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==se?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:a,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&nt(t.ssContent),ssFallback:t.ssFallback&&nt(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&s&&ne(h,a.clone(h)),h}function ce(t){const e=nt(t);return d(t.children)&&(e.children=t.children.map(ce)),e}function An(t=" ",e=0){return In(wn,null,t,e)}function Nt(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(d(e))n=16;else if(typeof e=="object")if(s&65){const r=e.default;r&&(r._c&&(r._d=!1),Nt(t,r()),r._c&&(r._d=!0));return}else n=32,!e._&&!re(e)&&(e._ctx=tt);else C(e)?(e={default:e,_ctx:tt},n=32):(e=String(e),s&64?(n=16,e=[An(e)]):n=8);t.children=e,t.shapeFlag|=n}function $n(...t){const e={};for(let n=0;n<t.length;n++){const s=t[n];for(const r in s)if(r==="class")e.class!==s.class&&(e.class=lt([e.class,s.class]));else if(r==="style")e.style=ct([e.style,s.style]);else if(Ee(r)){const o=e[r],i=s[r];i&&o!==i&&!(d(o)&&o.includes(i))&&(e[r]=o?[].concat(o,i):i)}else r!==""&&(e[r]=s[r])}return e}{const t=B(),e=(n,s)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};e("__VUE_INSTANCE_SETTERS__",n=>n),e("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const Tn=/(?:^|[-_])\w/g,xn=t=>t.replace(Tn,e=>e.toUpperCase()).replace(/[-_]/g,"");function le(t,e=!0){return C(t)?t.displayName||t.name:t.name||e&&t.__name}function ae(t,e,n=!1){let s=le(e);if(!s&&e.__file){const r=e.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&t){const r=o=>{for(const i in o)if(o[i]===e)return i};s=r(t.components)||t.parent&&r(t.parent.type.components)||r(t.appContext.components)}return s?xn(s):n?"App":"Anonymous"}function ue(t){return C(t)&&"__vccOpts"in t}function Dn(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(l){if(!g(l))return null;if(l.__isVue)return["div",t,"VueInstance"];if(b(l)){const p=l.value;return["div",{},["span",t,h(l)],"<",c(p),">"]}else{if(mt(l))return["div",{},["span",t,m(l)?"ShallowReactive":"Reactive"],"<",c(l),`>${E(l)?" (readonly)":""}`];if(E(l))return["div",{},["span",t,m(l)?"ShallowReadonly":"Readonly"],"<",c(l),">"]}return null},hasBody(l){return l&&l.__isVue},body(l){if(l&&l.__isVue)return["div",{},...o(l.$)]}};function o(l){const p=[];l.type.props&&l.props&&p.push(i("props",u(l.props))),l.setupState!==st&&p.push(i("setup",l.setupState)),l.data!==st&&p.push(i("data",u(l.data)));const S=a(l,"computed");S&&p.push(i("computed",S));const O=a(l,"inject");return O&&p.push(i("injected",O)),p.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:l}]]),p}function i(l,p){return p=x({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},l],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(S=>["div",{},["span",s,S+": "],c(p[S],!1)])]]:["span",{}]}function c(l,p=!0){return typeof l=="number"?["span",e,l]:typeof l=="string"?["span",n,JSON.stringify(l)]:typeof l=="boolean"?["span",s,l]:g(l)?["object",{object:p?u(l):l}]:["span",n,String(l)]}function a(l,p){const S=l.type;if(C(S))return;const O={};for(const q in l.ctx)f(S,q,p)&&(O[q]=l.ctx[q]);return O}function f(l,p,S){const O=l[S];if(d(O)&&O.includes(p)||g(O)&&p in O||l.extends&&f(l.extends,p,S)||l.mixins&&l.mixins.some(q=>f(q,p,S)))return!0}function h(l){return m(l)?"ShallowRef":l.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Pn(){Dn()}process.env.NODE_ENV!=="production"&&Pn();class Mn extends vt{_className="Store";_onAction;_options;_store;_subscriptions={};_storeSubscribe;static _requiredKeys;get onAction(){if(this._onAction)return()=>({store:this.store,callback:this._onAction})}set onAction(e){this._onAction=e}get options(){return this._options}get state(){return this._store.$state}set state(e){this._store.$state=e}get store(){return this._store}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(e){this._storeSubscribe=e}constructor(e,n,s=!1,r){super(s,r),this._options=n.storeOptions,this._store=e}addToState(e,n){this.isOptionApi()||n?.value||(n=Jt(n)),this.state[e]=n,this.store[e]=Xe(this.state,e)}addSubscription(e,n,s){this._subscriptions[e]={subscription:n,subscriptionOptions:s}}static customizeStore(e,n,s=!1,r){if(s&&r&&r.log(`Store - customizeStore() - ${e.$id}`,n),n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(e,n,s,r)}hasDeniedFirstChar(e){return It(e[0])}static hasRequiredKeys(e){return this._requiredKeys===void 0||this._requiredKeys?.every(n=>!!e[n])}getOption(e){return this.options&&this.options[e]}getStatePropertyValue(e){return this.getValue(this.state[e])}getSubscriptions(){if(!rt(this._subscriptions))return this._subscriptions}getValue(e){return e?.__v_isRef?e.value:e}isOptionApi(){return this.store._isOptionsAPI}stateHas(e){return this.state.hasOwnProperty(e)}storeHas(e){return this.store.hasOwnProperty(e)}}function Fn(t,e=!1){typeof e!="boolean"&&(e=!1);const n=new Vt(t,e);return n.plugin.bind(n)}_.CustomConsole=Ct,_.PluginSubscriber=fe,_.PluginSubscription=Vt,_.Store=Mn,_.createPlugin=Fn,_.defineAStore=ge,_.isEmpty=rt,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PiniaPlugin, PiniaPluginContext, Store as PiniaStore, StateTree } from "pinia"
|
|
2
|
+
import type { Console } from "./log"
|
|
2
3
|
import type { PluginSubscriber as PluginSubscriberInterface, PluginSubscriptions, StoreOnActionSubscription, StoreMutationSubscription } from "./plugin"
|
|
3
|
-
import { DefineAugmentedStore, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store"
|
|
4
|
+
import type { DefineAugmentedStore, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store"
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
declare module 'pinia-plugin-subscription' {
|
|
@@ -10,35 +11,55 @@ declare module 'pinia-plugin-subscription' {
|
|
|
10
11
|
|
|
11
12
|
export function isEmpty(value: any): boolean
|
|
12
13
|
|
|
14
|
+
export default abstract class Debug {
|
|
15
|
+
protected abstract _className: string
|
|
16
|
+
public console: Console
|
|
17
|
+
public debug: boolean
|
|
18
|
+
|
|
19
|
+
constructor(debug: boolean, customConsole?: Console)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
debugLog(message: string, args: any): void
|
|
23
|
+
|
|
24
|
+
logError(...args: any): void
|
|
25
|
+
}
|
|
26
|
+
|
|
13
27
|
export abstract class CustomConsole {
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
17
|
-
protected
|
|
18
|
-
protected
|
|
19
|
-
protected
|
|
20
|
-
protected
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
protected _bgColor: string
|
|
29
|
+
protected _color: string
|
|
30
|
+
protected _icon: string
|
|
31
|
+
protected _errorBgColor: string
|
|
32
|
+
protected _errorColor: string
|
|
33
|
+
protected _errorIcon: string
|
|
34
|
+
protected abstract _pluginName: string
|
|
35
|
+
|
|
36
|
+
log(...args: any): void
|
|
37
|
+
logError(...args: any): void
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
export abstract class PluginSubscriber<Instance extends Store> implements PluginSubscriberInterface {
|
|
41
|
+
public console: CustomConsole
|
|
27
42
|
public name: string
|
|
43
|
+
public pluginOptions: AnyObject
|
|
28
44
|
public resetStoreCallback: ((store?: PiniaStore) => void) | undefined
|
|
29
45
|
public storeOnActionSubscription: StoreOnActionSubscription | undefined
|
|
30
46
|
public storeMutationSubscription: StoreMutationSubscription | undefined
|
|
31
47
|
protected pluginCreated?: (store: PiniaStore) => void
|
|
32
48
|
public subscriptions: PluginSubscriptions | undefined
|
|
33
49
|
|
|
34
|
-
constructor(
|
|
50
|
+
constructor(
|
|
51
|
+
pluginName: string,
|
|
52
|
+
createInstanceFunction: (store: PiniaStore, options: AnyObject, debug?: boolean) => Instance | undefined,
|
|
53
|
+
pluginConsole?: CustomConsole
|
|
54
|
+
)
|
|
35
55
|
|
|
36
56
|
public invoke(context: PiniaPluginContext, debug?: boolean): void
|
|
37
57
|
}
|
|
38
58
|
|
|
39
|
-
export class Store {
|
|
40
|
-
constructor(store: PiniaStore, options: AnyObject, debug
|
|
59
|
+
export class Store extends Debug {
|
|
60
|
+
constructor(store: PiniaStore, options: AnyObject, debug: boolean)
|
|
41
61
|
|
|
62
|
+
protected _className: string
|
|
42
63
|
protected static _requiredKeys?: string[]
|
|
43
64
|
public debug: boolean
|
|
44
65
|
public onAction: StoreOnActionSubscription | undefined
|
|
@@ -56,7 +77,8 @@ declare module 'pinia-plugin-subscription' {
|
|
|
56
77
|
static customizeStore<Instance extends Store>(
|
|
57
78
|
store: PiniaStore,
|
|
58
79
|
options: AnyObject,
|
|
59
|
-
debug
|
|
80
|
+
debug: boolean,
|
|
81
|
+
console?: Console
|
|
60
82
|
): Instance | undefined
|
|
61
83
|
|
|
62
84
|
debugLog(message: string, args: any): void
|
|
@@ -85,6 +107,6 @@ export interface AnyObject {
|
|
|
85
107
|
export interface SearchCollectionCriteria {
|
|
86
108
|
[key: number | string | symbol]: boolean | number | string;
|
|
87
109
|
}
|
|
88
|
-
export { LogType, StyleDefinition as ConsoleStyleDefinition, StyleDefinitionKeys as ConsoleStyleDefinitionKeys, StyleDefinitions as ConsoleStyleDefinitions } from './log';
|
|
110
|
+
export { Console, LogType, StyleDefinition as ConsoleStyleDefinition, StyleDefinitionKeys as ConsoleStyleDefinitionKeys, StyleDefinitions as ConsoleStyleDefinitions } from './log';
|
|
89
111
|
export type { CustomStore, DefineAugmentedStore, PluginStoreOptions, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store";
|
|
90
|
-
export type { PluginSubscriber as PluginSubscriberInterface } from "./plugin";
|
|
112
|
+
export type { PluginSubscriber as PluginSubscriberInterface } from "./plugin";
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { PiniaPluginContext, StateTree, Store, SubscriptionCallbackMutation } from "pinia";
|
|
2
2
|
import { StoreOptions } from "./store";
|
|
3
3
|
import { PluginSubscriberInterface } from ".";
|
|
4
|
-
import { Console } from "./log";
|
|
5
4
|
export interface PluginSubscriber {
|
|
6
|
-
|
|
7
|
-
invoke: (context: PiniaPluginContext, debug: boolean, customConsole?: Console) => void;
|
|
5
|
+
invoke: (context: PiniaPluginContext, debug?: boolean) => void;
|
|
8
6
|
name: string;
|
|
9
7
|
resetStoreCallback?: (store?: Store) => void;
|
|
10
8
|
storeOnActionSubscription?: StoreOnActionSubscription;
|