pinia-plugin-subscription 0.0.0-beta.11 → 0.0.0-beta.12
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.
|
@@ -225,18 +225,22 @@ class ge extends At {
|
|
|
225
225
|
"subscription:",
|
|
226
226
|
i,
|
|
227
227
|
"options:",
|
|
228
|
-
|
|
229
|
-
])
|
|
230
|
-
|
|
228
|
+
o
|
|
229
|
+
]);
|
|
230
|
+
const u = {
|
|
231
|
+
storeOptions: { ...n?.storeOptions ?? {}, ...c }
|
|
232
|
+
};
|
|
233
|
+
i.invoke(
|
|
234
|
+
{ store: e, options: { ...n, ...u } },
|
|
231
235
|
this.debug
|
|
232
236
|
), lt(a) || a?.forEach(
|
|
233
|
-
(
|
|
237
|
+
(h) => i.invoke(
|
|
234
238
|
{
|
|
235
|
-
store:
|
|
239
|
+
store: h,
|
|
236
240
|
options: {
|
|
237
241
|
...n,
|
|
238
|
-
...
|
|
239
|
-
...
|
|
242
|
+
...u,
|
|
243
|
+
...h?.storeOptions ?? {}
|
|
240
244
|
}
|
|
241
245
|
},
|
|
242
246
|
this.debug
|
|
@@ -258,10 +262,10 @@ const at = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
|
258
262
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
259
263
|
const Dt = () => {
|
|
260
264
|
}, me = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
|
|
261
|
-
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), F = Object.assign, ye = Object.prototype.hasOwnProperty, ut = (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,
|
|
265
|
+
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), F = Object.assign, ye = Object.prototype.hasOwnProperty, ut = (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, Oe = (t) => {
|
|
262
266
|
const e = /* @__PURE__ */ Object.create(null);
|
|
263
267
|
return ((n) => e[n] || (e[n] = t(n)));
|
|
264
|
-
},
|
|
268
|
+
}, Ee = Oe((t) => t.charAt(0).toUpperCase() + t.slice(1)), dt = (t, e) => !Object.is(t, e);
|
|
265
269
|
let wt;
|
|
266
270
|
const tt = () => wt || (wt = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
267
271
|
function _t(t) {
|
|
@@ -414,7 +418,7 @@ function yt(t) {
|
|
|
414
418
|
return t = f(t), t;
|
|
415
419
|
}
|
|
416
420
|
function R(t, e) {
|
|
417
|
-
return
|
|
421
|
+
return O(t) ? St(t) ? L(v(e)) : L(e) : v(e);
|
|
418
422
|
}
|
|
419
423
|
const Ve = {
|
|
420
424
|
__proto__: null,
|
|
@@ -430,10 +434,10 @@ const Ve = {
|
|
|
430
434
|
return rt(this, "entries", (t) => (t[1] = R(this, t[1]), t));
|
|
431
435
|
},
|
|
432
436
|
every(t, e) {
|
|
433
|
-
return
|
|
437
|
+
return E(this, "every", t, e, void 0, arguments);
|
|
434
438
|
},
|
|
435
439
|
filter(t, e) {
|
|
436
|
-
return
|
|
440
|
+
return E(
|
|
437
441
|
this,
|
|
438
442
|
"filter",
|
|
439
443
|
t,
|
|
@@ -443,7 +447,7 @@ const Ve = {
|
|
|
443
447
|
);
|
|
444
448
|
},
|
|
445
449
|
find(t, e) {
|
|
446
|
-
return
|
|
450
|
+
return E(
|
|
447
451
|
this,
|
|
448
452
|
"find",
|
|
449
453
|
t,
|
|
@@ -453,10 +457,10 @@ const Ve = {
|
|
|
453
457
|
);
|
|
454
458
|
},
|
|
455
459
|
findIndex(t, e) {
|
|
456
|
-
return
|
|
460
|
+
return E(this, "findIndex", t, e, void 0, arguments);
|
|
457
461
|
},
|
|
458
462
|
findLast(t, e) {
|
|
459
|
-
return
|
|
463
|
+
return E(
|
|
460
464
|
this,
|
|
461
465
|
"findLast",
|
|
462
466
|
t,
|
|
@@ -466,11 +470,11 @@ const Ve = {
|
|
|
466
470
|
);
|
|
467
471
|
},
|
|
468
472
|
findLastIndex(t, e) {
|
|
469
|
-
return
|
|
473
|
+
return E(this, "findLastIndex", t, e, void 0, arguments);
|
|
470
474
|
},
|
|
471
475
|
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
472
476
|
forEach(t, e) {
|
|
473
|
-
return
|
|
477
|
+
return E(this, "forEach", t, e, void 0, arguments);
|
|
474
478
|
},
|
|
475
479
|
includes(...t) {
|
|
476
480
|
return st(this, "includes", t);
|
|
@@ -486,7 +490,7 @@ const Ve = {
|
|
|
486
490
|
return st(this, "lastIndexOf", t);
|
|
487
491
|
},
|
|
488
492
|
map(t, e) {
|
|
489
|
-
return
|
|
493
|
+
return E(this, "map", t, e, void 0, arguments);
|
|
490
494
|
},
|
|
491
495
|
pop() {
|
|
492
496
|
return k(this, "pop");
|
|
@@ -505,7 +509,7 @@ const Ve = {
|
|
|
505
509
|
},
|
|
506
510
|
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
507
511
|
some(t, e) {
|
|
508
|
-
return
|
|
512
|
+
return E(this, "some", t, e, void 0, arguments);
|
|
509
513
|
},
|
|
510
514
|
splice(...t) {
|
|
511
515
|
return k(this, "splice", t);
|
|
@@ -534,7 +538,7 @@ function rt(t, e, n) {
|
|
|
534
538
|
}), r;
|
|
535
539
|
}
|
|
536
540
|
const Ae = Array.prototype;
|
|
537
|
-
function
|
|
541
|
+
function E(t, e, n, s, r, o) {
|
|
538
542
|
const i = yt(t), c = i !== t && !y(t), a = i[e];
|
|
539
543
|
if (a !== Ae[e]) {
|
|
540
544
|
const l = a.apply(t, o);
|
|
@@ -623,8 +627,8 @@ class De extends kt {
|
|
|
623
627
|
let o = e[n];
|
|
624
628
|
const i = d(e) && Z(n);
|
|
625
629
|
if (!this._isShallow) {
|
|
626
|
-
const u =
|
|
627
|
-
if (!y(s) && !
|
|
630
|
+
const u = O(o);
|
|
631
|
+
if (!y(s) && !O(s) && (o = f(o), s = f(s)), !i && g(o) && !g(s))
|
|
628
632
|
return u ? (process.env.NODE_ENV !== "production" && M(
|
|
629
633
|
`Set operation on key "${String(n)}" failed: target is readonly.`,
|
|
630
634
|
e[n]
|
|
@@ -692,7 +696,7 @@ function q(t) {
|
|
|
692
696
|
if (process.env.NODE_ENV !== "production") {
|
|
693
697
|
const n = e[0] ? `on key "${e[0]}" ` : "";
|
|
694
698
|
M(
|
|
695
|
-
`${
|
|
699
|
+
`${Ee(t)} operation ${n}failed: target is readonly.`,
|
|
696
700
|
f(this)
|
|
697
701
|
);
|
|
698
702
|
}
|
|
@@ -735,12 +739,12 @@ function je(t, e) {
|
|
|
735
739
|
clear: q("clear")
|
|
736
740
|
} : {
|
|
737
741
|
add(r) {
|
|
738
|
-
!e && !y(r) && !
|
|
742
|
+
!e && !y(r) && !O(r) && (r = f(r));
|
|
739
743
|
const o = f(this);
|
|
740
744
|
return U(o).has.call(o, r) || (o.add(r), I(o, "add", r, r)), this;
|
|
741
745
|
},
|
|
742
746
|
set(r, o) {
|
|
743
|
-
!e && !y(o) && !
|
|
747
|
+
!e && !y(o) && !O(o) && (o = f(o));
|
|
744
748
|
const i = f(this), { has: c, get: a } = U(i);
|
|
745
749
|
let u = c.call(i, r);
|
|
746
750
|
u ? process.env.NODE_ENV !== "production" && Ct(i, c, r) : (r = f(r), u = c.call(i, r));
|
|
@@ -815,7 +819,7 @@ function We(t) {
|
|
|
815
819
|
return t.__v_skip || !Object.isExtensible(t) ? 0 : ze(Mt(t));
|
|
816
820
|
}
|
|
817
821
|
function zt(t) {
|
|
818
|
-
return
|
|
822
|
+
return O(t) ? t : Wt(
|
|
819
823
|
t,
|
|
820
824
|
!1,
|
|
821
825
|
Me,
|
|
@@ -854,9 +858,9 @@ function Wt(t, e, n, s, r) {
|
|
|
854
858
|
return r.set(t, c), c;
|
|
855
859
|
}
|
|
856
860
|
function St(t) {
|
|
857
|
-
return
|
|
861
|
+
return O(t) ? St(t.__v_raw) : !!(t && t.__v_isReactive);
|
|
858
862
|
}
|
|
859
|
-
function
|
|
863
|
+
function O(t) {
|
|
860
864
|
return !!(t && t.__v_isReadonly);
|
|
861
865
|
}
|
|
862
866
|
function y(t) {
|
|
@@ -891,7 +895,7 @@ class qe {
|
|
|
891
895
|
}) : this.dep.track(), this._value;
|
|
892
896
|
}
|
|
893
897
|
set value(e) {
|
|
894
|
-
const n = this._rawValue, s = this.__v_isShallow || y(e) ||
|
|
898
|
+
const n = this._rawValue, s = this.__v_isShallow || y(e) || O(e);
|
|
895
899
|
e = s ? e : f(e), dt(e, n) && (this._rawValue = e, this._value = s ? e : v(e), process.env.NODE_ENV !== "production" ? this.dep.trigger({
|
|
896
900
|
target: this,
|
|
897
901
|
type: "set",
|
|
@@ -959,7 +963,7 @@ function P(t, ...e) {
|
|
|
959
963
|
ot = !0;
|
|
960
964
|
const n = A.length ? A[A.length - 1].component : null, s = n && n.appContext.config.warnHandler, r = tn();
|
|
961
965
|
if (s)
|
|
962
|
-
|
|
966
|
+
Ot(
|
|
963
967
|
s,
|
|
964
968
|
n,
|
|
965
969
|
11,
|
|
@@ -1057,7 +1061,7 @@ const Jt = {
|
|
|
1057
1061
|
15: "component update",
|
|
1058
1062
|
16: "app unmount cleanup function"
|
|
1059
1063
|
};
|
|
1060
|
-
function
|
|
1064
|
+
function Ot(t, e, n, s) {
|
|
1061
1065
|
try {
|
|
1062
1066
|
return s ? t(...s) : t();
|
|
1063
1067
|
} catch (r) {
|
|
@@ -1079,7 +1083,7 @@ function Bt(t, e, n, s = !0) {
|
|
|
1079
1083
|
c = c.parent;
|
|
1080
1084
|
}
|
|
1081
1085
|
if (o) {
|
|
1082
|
-
|
|
1086
|
+
Ot(o, null, 10, [
|
|
1083
1087
|
t,
|
|
1084
1088
|
a,
|
|
1085
1089
|
u
|
|
@@ -1155,7 +1159,7 @@ function Gt(t) {
|
|
|
1155
1159
|
if (n && !(n.flags & 8)) {
|
|
1156
1160
|
if (process.env.NODE_ENV !== "production" && e(n))
|
|
1157
1161
|
continue;
|
|
1158
|
-
n.flags & 4 && (n.flags &= -2),
|
|
1162
|
+
n.flags & 4 && (n.flags &= -2), Ot(
|
|
1159
1163
|
n,
|
|
1160
1164
|
n.i,
|
|
1161
1165
|
n.i ? 15 : 14
|
|
@@ -1261,7 +1265,7 @@ const bn = Symbol.for("v-ndc"), mn = {};
|
|
|
1261
1265
|
process.env.NODE_ENV !== "production" && (mn.ownKeys = (t) => (P(
|
|
1262
1266
|
"Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
|
|
1263
1267
|
), Reflect.ownKeys(t)));
|
|
1264
|
-
const yn = {}, te = (t) => Object.getPrototypeOf(t) === yn, Sn = (t) => t.__isSuspense, ee = Symbol.for("v-fgt"),
|
|
1268
|
+
const yn = {}, te = (t) => Object.getPrototypeOf(t) === yn, Sn = (t) => t.__isSuspense, ee = Symbol.for("v-fgt"), On = Symbol.for("v-txt"), En = Symbol.for("v-cmt");
|
|
1265
1269
|
function wn(t) {
|
|
1266
1270
|
return t ? t.__v_isVNode === !0 : !1;
|
|
1267
1271
|
}
|
|
@@ -1302,18 +1306,18 @@ function vn(t, e = null, n = null, s = 0, r = null, o = t === ee ? 0 : 1, i = !1
|
|
|
1302
1306
|
appContext: null,
|
|
1303
1307
|
ctx: Q
|
|
1304
1308
|
};
|
|
1305
|
-
return c ? (
|
|
1309
|
+
return c ? (Et(a, n), o & 128 && t.normalize(a)) : n && (a.shapeFlag |= N(n) ? 8 : 16), process.env.NODE_ENV !== "production" && a.key !== a.key && P("VNode created with invalid key (NaN). VNode type:", a.type), a;
|
|
1306
1310
|
}
|
|
1307
1311
|
const Rn = process.env.NODE_ENV !== "production" ? Nn : re;
|
|
1308
1312
|
function re(t, e = null, n = null, s = 0, r = null, o = !1) {
|
|
1309
|
-
if ((!t || t === bn) && (process.env.NODE_ENV !== "production" && !t && P(`Invalid vnode type when creating vnode: ${t}.`), t =
|
|
1313
|
+
if ((!t || t === bn) && (process.env.NODE_ENV !== "production" && !t && P(`Invalid vnode type when creating vnode: ${t}.`), t = En), wn(t)) {
|
|
1310
1314
|
const c = X(
|
|
1311
1315
|
t,
|
|
1312
1316
|
e,
|
|
1313
1317
|
!0
|
|
1314
1318
|
/* mergeRef: true */
|
|
1315
1319
|
);
|
|
1316
|
-
return n &&
|
|
1320
|
+
return n && Et(c, n), c.patchFlag = -2, c;
|
|
1317
1321
|
}
|
|
1318
1322
|
if (ce(t) && (t = t.__vccOpts), e) {
|
|
1319
1323
|
e = Cn(e);
|
|
@@ -1395,9 +1399,9 @@ function se(t) {
|
|
|
1395
1399
|
return d(t.children) && (e.children = t.children.map(se)), e;
|
|
1396
1400
|
}
|
|
1397
1401
|
function In(t = " ", e = 0) {
|
|
1398
|
-
return Rn(
|
|
1402
|
+
return Rn(On, null, t, e);
|
|
1399
1403
|
}
|
|
1400
|
-
function
|
|
1404
|
+
function Et(t, e) {
|
|
1401
1405
|
let n = 0;
|
|
1402
1406
|
const { shapeFlag: s } = t;
|
|
1403
1407
|
if (e == null)
|
|
@@ -1407,7 +1411,7 @@ function Ot(t, e) {
|
|
|
1407
1411
|
else if (typeof e == "object")
|
|
1408
1412
|
if (s & 65) {
|
|
1409
1413
|
const r = e.default;
|
|
1410
|
-
r && (r._c && (r._d = !1),
|
|
1414
|
+
r && (r._c && (r._d = !1), Et(t, r()), r._c && (r._d = !0));
|
|
1411
1415
|
return;
|
|
1412
1416
|
} else
|
|
1413
1417
|
n = 32, !e._ && !te(e) && (e._ctx = Q);
|
|
@@ -1499,9 +1503,9 @@ function $n() {
|
|
|
1499
1503
|
["span", t, y(l) ? "ShallowReactive" : "Reactive"],
|
|
1500
1504
|
"<",
|
|
1501
1505
|
c(l),
|
|
1502
|
-
`>${
|
|
1506
|
+
`>${O(l) ? " (readonly)" : ""}`
|
|
1503
1507
|
];
|
|
1504
|
-
if (
|
|
1508
|
+
if (O(l))
|
|
1505
1509
|
return [
|
|
1506
1510
|
"div",
|
|
1507
1511
|
{},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(_,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],$):(_=typeof globalThis<"u"?globalThis:_||self,$(_["pinia-plugin-subscription"]={},_.Pinia))})(this,(function(_,$){"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 $.defineStore(t,e,n)}function me(t,e,n){return n&&(e={...e,...n??{}}),$.defineStore(t,e)}const ye=new Set(["_","$"]);function It(t){return ye.has(t[0])}function J(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(!J(this._subscriptions))return this._subscriptions}constructor(e,n){super(n??!1,_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,stores:a}=o;this.debugLog(`subscriptionDelivery() - store: ${e.$id}`,["pluginName:",r,"subscription:",i,"options:",c]),i.invoke({store:e,options:{...n,...c}},this.debug),J(a)||a?.forEach(u=>i.invoke({store:u,options:{...n,...c,...u?.storeOptions??{}}},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=>Tt(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,Tt=t=>we.call(t),$t=t=>Tt(t).slice(8,-1),B=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 Y=()=>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),u=a&&B(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)),u&&c(i.get(Ft)),e){case"add":a?u&&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=f(t);return e===t||m(t)?e:e.map(v)}function ht(t){return t=f(t),t}function V(t,e){return E(t)?mt(t)?W(v(e)):W(e):v(e)}const Te={__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 $e=Array.prototype;function N(t,e,n,s,r,o){const i=ht(t),c=i!==t&&!m(t),a=i[e];if(a!==$e[e]){const l=a.apply(t,o);return c?v(l):l}let u=n;i!==t&&(c?u=function(l,p){return n.call(this,V(t,l),p,t)}:n.length>2&&(u=function(l,p){return n.call(this,l,p,t)}));const h=a.call(i,u,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=f(t),r=s[e](...n);return(r===-1||r===!1)&&z(n[0])?(n[0]=f(n[0]),s[e](...n)):r}function L(t,e,n=[]){ut();const s=f(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)),f(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=Te[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&&B(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)&&B(n);if(!this._isShallow){const u=E(o);if(!m(s)&&!E(s)&&(o=f(o),s=f(s)),!i&&b(o)&&!b(s))return u?(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===f(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,G=t=>Reflect.getPrototypeOf(t);function ke(t,e,n){return function(...s){const r=this.__v_raw,o=f(r),i=K(o),c=t==="entries"||t===Symbol.iterator&&i,a=r[t](...s),u=n?gt:e?W:v;return{next(){const{value:h,done:l}=a.next();return l?{value:h,done:l}:{value:c?[u(h[0]),u(h[1])]:u(h),done:l}},[Symbol.iterator](){return this}}}}function Q(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.`,f(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Ke(t,e){const n={get(r){const o=this.__v_raw,i=f(o),c=f(r),{has:a}=G(i),u=e?gt:t?W:v;if(a.call(i,r))return u(o.get(r));if(a.call(i,c))return u(o.get(c));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!t&&(f(r),void 0),r.size},has(r){const o=this.__v_raw;f(o);const i=f(r);return r===i?o.has(r):o.has(r)||o.has(i)},forEach(r,o){const i=this,c=i.__v_raw;f(c);const a=e?gt:t?W:v;return c.forEach((u,h)=>r.call(o,a(u),a(h),i))}};return x(n,t?{add:Q("add"),set:Q("set"),delete:Q("delete"),clear:Q("clear")}:{add(r){!e&&!m(r)&&!E(r)&&(r=f(r));const o=f(this);return G(o).has.call(o,r)||(o.add(r),I(o,"add",r,r)),this},set(r,o){!e&&!m(o)&&!E(o)&&(o=f(o));const i=f(this),{has:c,get:a}=G(i);let u=c.call(i,r);u?process.env.NODE_ENV!=="production"&&Lt(i,c,r):(r=f(r),u=c.call(i,r));const h=a.call(i,r);return i.set(r,o),u?it(o,h)&&I(i,"set",r,o,h):I(i,"add",r,o),this},delete(r){const o=f(this),{has:i,get:c}=G(o);let a=i.call(o,r);a?process.env.NODE_ENV!=="production"&&Lt(o,i,r):(r=f(r),a=i.call(o,r));const u=c?c.call(o,r):void 0,h=o.delete(r);return a&&I(o,"delete",r,void 0,u),h},clear(){const r=f(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=f(n);if(s!==n&&e.call(t,s)){const r=$t(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($t(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 f(t){const e=t&&t.__v_raw;return e?f(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:f(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:f(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=f(e);let r=!0,o=e;if(!d(e)||!B(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 T=[];function tn(t){T.push(t)}function en(){T.pop()}let yt=!1;function M(t,...e){if(yt)return;yt=!0;const n=T.length?T[T.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
|
-
`),
|
|
3
|
-
`,...
|
|
4
|
-
`],...
|
|
5
|
-
Component that was made reactive: `,t)),Cn(t,e,n,s,
|
|
1
|
+
(function(_,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],$):(_=typeof globalThis<"u"?globalThis:_||self,$(_["pinia-plugin-subscription"]={},_.Pinia))})(this,(function(_,$){"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,r){this._name=e,this._createInstance=n,r&&(this._console=r)}invoke({store:e,options:n},r){this._storeInstance=this._createInstance(e,{...n,...this.pluginOptions},r,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 r=n?{storeOptions:n}:{};return typeof e=="function"?be(t,e,r):me(t,e,r)}function be(t,e,n){return $.defineStore(t,e,n)}function me(t,e,n){return n&&(e={...e,...n??{}}),$.defineStore(t,e)}const ye=new Set(["_","$"]);function It(t){return ye.has(t[0])}function J(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(!J(this._subscriptions))return this._subscriptions}constructor(e,n){super(n??!1,_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(r=>{r.invoke({store:e,options:n},this.debug),r.subscriptions&&this.subscriptionDelivery({store:e,options:n},r.subscriptions),r.storeMutationSubscription&&this.storeMutationSubscription(r.storeMutationSubscription),r.storeOnActionSubscription&&this.storeOnActionSubscription(r.storeOnActionSubscription),r.resetStoreCallback&&this.addResetStoreCallback(r.resetStoreCallback)}),this.rewriteResetStore({store:e},Object.assign({},e.$state),Object.assign({},e))}catch(r){this.logError(r,e,n)}}}rewriteResetStore({store:e},n,r){e.$reset=()=>{this.executeResetStoreCallbacks(e),Object.keys(r).forEach(s=>{It(s)||(e[s]=n[s]??r[s])}),e.$patch(JSON.parse(JSON.stringify(n)))}}storeOnActionSubscription(e){const{store:n,callback:r}=e();n.$onAction(({after:s,args:o,name:i})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,[s,o,i,n]),r({after:s,args:o,name:i})})}storeMutationSubscription(e){const{store:n,callback:r}=e();n.$subscribe(s=>{this.debugLog(`$subscribe ${n.$id}`,[s,n]),r(s)})}subscriptionDelivery({store:e,options:n},r){Object.entries(r).forEach(([s,o])=>{try{const{subscription:i,subscriptionOptions:c,stores:a}=o;this.debugLog(`subscriptionDelivery() - store: ${e.$id}`,["pluginName:",s,"subscription:",i,"options:",o]);const u={storeOptions:{...n?.storeOptions??{},...c}};i.invoke({store:e,options:{...n,...u}},this.debug),J(a)||a?.forEach(h=>i.invoke({store:h,options:{...n,...u,...h?.storeOptions??{}}},this.debug))}catch(i){this.logError(`subscriptionDelivery() - ${s}`,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 rt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const At=()=>{},Oe=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),x=Object.assign,Ee=Object.prototype.hasOwnProperty,ot=(t,e)=>Ee.call(t,e),d=Array.isArray,K=t=>Tt(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,Tt=t=>we.call(t),$t=t=>Tt(t).slice(8,-1),B=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 Y=()=>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 r=t[n],s=w(r)?Ie(r):ct(r);if(s)for(const o in s)e[o]=s[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 r=n.split(Re);r.length>1&&(e[r[0].trim()]=r[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 r=lt(t[n]);r&&(e+=r+" ")}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(r){t||(t=r)}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,r,s,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:r,oldValue:s,oldTarget:o}):a.trigger())};if(ut(),e==="clear")i.forEach(c);else{const a=d(t),u=a&&B(n);if(a&&n==="length"){const h=Number(r);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)),u&&c(i.get(Ft)),e){case"add":a?u&&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=f(t);return e===t||m(t)?e:e.map(v)}function ht(t){return t=f(t),t}function V(t,e){return O(t)?mt(t)?W(v(e)):W(e):v(e)}const Te={__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(r=>V(this,r)),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 r=ht(t),s=r[e]();return r!==t&&!m(t)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const $e=Array.prototype;function N(t,e,n,r,s,o){const i=ht(t),c=i!==t&&!m(t),a=i[e];if(a!==$e[e]){const l=a.apply(t,o);return c?v(l):l}let u=n;i!==t&&(c?u=function(l,p){return n.call(this,V(t,l),p,t)}:n.length>2&&(u=function(l,p){return n.call(this,l,p,t)}));const h=a.call(i,u,r);return c&&s?s(h):h}function jt(t,e,n,r){const s=ht(t);let o=n;return s!==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)}),s[e](o,...r)}function _t(t,e,n){const r=f(t),s=r[e](...n);return(s===-1||s===!1)&&z(n[0])?(n[0]=f(n[0]),r[e](...n)):s}function L(t,e,n=[]){ut();const r=f(t)[e].apply(t,n);return ft(),r}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)),f(this).hasOwnProperty(t)}class Kt{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?We:Wt:o?ze:zt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const i=d(e);if(!s){let a;if(i&&(a=Te[n]))return a;if(n==="hasOwnProperty")return De}const c=Reflect.get(e,n,b(e)?e:r);if((H(n)?kt.has(n):xe(n))||o)return c;if(b(c)){const a=i&&B(n)?c:c.value;return s&&g(a)?bt(a):a}return g(c)?s?bt(c):Ut(c):c}}class Pe extends Kt{constructor(e=!1){super(!1,e)}set(e,n,r,s){let o=e[n];const i=d(e)&&B(n);if(!this._isShallow){const u=O(o);if(!m(r)&&!O(r)&&(o=f(o),r=f(r)),!i&&b(o)&&!b(r))return u?(process.env.NODE_ENV!=="production"&&D(`Set operation on key "${String(n)}" failed: target is readonly.`,e[n]),!0):(o.value=r,!0)}const c=i?Number(n)<e.length:ot(e,n),a=Reflect.set(e,n,r,b(e)?e:s);return e===f(s)&&(c?it(r,o)&&I(e,"set",n,r,o):I(e,"add",n,r)),a}deleteProperty(e,n){const r=ot(e,n),s=e[n],o=Reflect.deleteProperty(e,n);return o&&r&&I(e,"delete",n,void 0,s),o}has(e,n){const r=Reflect.has(e,n);return!H(n)||kt.has(n),r}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,G=t=>Reflect.getPrototypeOf(t);function ke(t,e,n){return function(...r){const s=this.__v_raw,o=f(s),i=K(o),c=t==="entries"||t===Symbol.iterator&&i,a=s[t](...r),u=n?gt:e?W:v;return{next(){const{value:h,done:l}=a.next();return l?{value:h,done:l}:{value:c?[u(h[0]),u(h[1])]:u(h),done:l}},[Symbol.iterator](){return this}}}}function Q(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.`,f(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Ke(t,e){const n={get(s){const o=this.__v_raw,i=f(o),c=f(s),{has:a}=G(i),u=e?gt:t?W:v;if(a.call(i,s))return u(o.get(s));if(a.call(i,c))return u(o.get(c));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!t&&(f(s),void 0),s.size},has(s){const o=this.__v_raw;f(o);const i=f(s);return s===i?o.has(s):o.has(s)||o.has(i)},forEach(s,o){const i=this,c=i.__v_raw;f(c);const a=e?gt:t?W:v;return c.forEach((u,h)=>s.call(o,a(u),a(h),i))}};return x(n,t?{add:Q("add"),set:Q("set"),delete:Q("delete"),clear:Q("clear")}:{add(s){!e&&!m(s)&&!O(s)&&(s=f(s));const o=f(this);return G(o).has.call(o,s)||(o.add(s),I(o,"add",s,s)),this},set(s,o){!e&&!m(o)&&!O(o)&&(o=f(o));const i=f(this),{has:c,get:a}=G(i);let u=c.call(i,s);u?process.env.NODE_ENV!=="production"&&Lt(i,c,s):(s=f(s),u=c.call(i,s));const h=a.call(i,s);return i.set(s,o),u?it(o,h)&&I(i,"set",s,o,h):I(i,"add",s,o),this},delete(s){const o=f(this),{has:i,get:c}=G(o);let a=i.call(o,s);a?process.env.NODE_ENV!=="production"&&Lt(o,i,s):(s=f(s),a=i.call(o,s));const u=c?c.call(o,s):void 0,h=o.delete(s);return a&&I(o,"delete",s,void 0,u),h},clear(){const s=f(this),o=s.size!==0,i=process.env.NODE_ENV!=="production"?K(s)?new Map(s):new Set(s):void 0,c=s.clear();return o&&I(s,"clear",void 0,void 0,i),c}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=ke(s,t,e)}),n}function Ht(t,e){const n=Ke(t,e);return(r,s,o)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?r:Reflect.get(ot(n,s)&&s in r?n:r,s,o)}const He={get:Ht(!1,!1)},Le={get:Ht(!0,!1)};function Lt(t,e,n){const r=f(n);if(r!==n&&e.call(t,r)){const s=$t(t);D(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="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($t(t))}function Ut(t){return O(t)?t:qt(t,!1,Fe,He,zt)}function bt(t){return qt(t,!0,je,Le,Wt)}function qt(t,e,n,r,s){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=s.get(t);if(i)return i;const c=new Proxy(t,o===2?r:n);return s.set(t,c),c}function mt(t){return O(t)?mt(t.__v_raw):!!(t&&t.__v_isReactive)}function O(t){return!!(t&&t.__v_isReadonly)}function m(t){return!!(t&&t.__v_isShallow)}function z(t){return t?!!t.__v_raw:!1}function f(t){const e=t&&t.__v_raw;return e?f(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:f(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,r=this.__v_isShallow||m(e)||O(e);e=r?e:f(e),it(e,n)&&(this._rawValue=e,this._value=r?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,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=f(e);let s=!0,o=e;if(!d(e)||!B(String(n)))do s=!z(o)||m(o);while(s&&(o=o.__v_raw));this._shallow=s}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 T=[];function tn(t){T.push(t)}function en(){T.pop()}let yt=!1;function M(t,...e){if(yt)return;yt=!0;const n=T.length?T[T.length-1].component:null,r=n&&n.appContext.config.warnHandler,s=nn();if(r)St(r,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,s.map(({vnode:o})=>`at <${ae(n,o.type)}>`).join(`
|
|
2
|
+
`),s]);else{const o=[`[Vue warn]: ${t}`,...e];s.length&&o.push(`
|
|
3
|
+
`,...sn(s)),console.warn(...o)}yt=!1}function nn(){let t=T[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 r=t.component&&t.component.parent;t=r&&r.vnode}return e}function sn(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[`
|
|
4
|
+
`],...rn(n))}),e}function rn({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,s=` at <${ae(t.component,t.type,r)}`,o=">"+n;return t.props?[s,...on(t.props),o]:[s+o]}function on(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...Bt(r,t[r]))}),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,f(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):C(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=f(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,r){try{return r?t(...r):t()}catch(s){Gt(s,e,n)}}function Gt(t,e,n,r=!0){const s=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=e&&e.appContext.config||rt;if(e){let c=e.parent;const a=e.proxy,u=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,u)===!1)return}c=c.parent}if(o){St(o,null,10,[t,a,u]);return}}cn(t,n,s,r,i)}function cn(t,e,n,r=!0,s=!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(),r)throw t;console.error(t)}else{if(s)throw t;console.error(t)}}const y=[];let R=-1;const F=[];let A=null,j=0;const ln=Promise.resolve();let Ot=null;const an=100;function un(t){let e=R+1,n=y.length;for(;e<n;){const r=e+n>>>1,s=y[r],o=U(s);o<t||o===t&&s.flags&2?e=r+1:n=r}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(){Ot||(Ot=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,r)=>U(n)-U(r));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),Ot=null,(y.length||F.length)&&Xt(t)}}function Zt(t,e){const n=t.get(e)||0;if(n>an){const r=e.i,s=r&&le(r.type);return Gt(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. 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 Et=new Map;process.env.NODE_ENV!=="production"&&(Y().__VUE_HMR_RUNTIME__={createRecord:wt(dn),rerender:wt(_n),reload:wt(gn)});const X=new Map;function dn(t,e){return X.has(t)?!1:(X.set(t,{initialDef:Z(e),instances:new Set}),!0)}function Z(t){return ue(t)?t.__vccOpts:t}function _n(t,e){const n=X.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(r=>{e&&(r.render=e,Z(r.type).render=e),r.renderCache=[],r.job.flags&8||r.update()}))}function gn(t,e){const n=X.get(t);if(!n)return;e=Z(e),te(n.initialDef,e);const r=[...n.instances];for(let s=0;s<r.length;s++){const o=r[s],i=Z(o.type);let c=Et.get(i);c||(i!==n.initialDef&&te(i,e),Et.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(()=>{Et.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(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let k,tt=[];function ee(t,e){var n,r;k=t,k?(k.enabled=!0,tt.forEach(({event:s,args:o})=>k.emit(s,...o)),tt=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.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,tt=[])},3e3)):tt=[]}let et=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}Y().requestIdleCallback,Y().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 On={},se=t=>Object.getPrototypeOf(t)===On,En=t=>t.__isSuspense,re=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,nt=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?w(t)||b(t)||C(t)?{i:et,r:t,k:e,f:!!n}:t:null);function Cn(t,e=null,n=null,r=0,s=null,o=t===re?0:1,i=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&oe(e),ref:e&&nt(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:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:et};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,r=0,s=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=st(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:En(t)?128:mn(t)?64:g(t)?4:C(t)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&z(t)&&(t=f(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,r,s,i,o,!0)}function Vn(t){return t?z(t)||se(t)?x({},t):t:null}function st(t,e,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:c,transition:a}=t,u=e?Tn(s||{},e):s,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&oe(u),ref:e&&e.ref?n&&o?d(o)?o.concat(nt(e)):[o,nt(e)]:nt(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!==re?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&&st(t.ssContent),ssFallback:t.ssFallback&&st(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&r&&ne(h,a.clone(h)),h}function ce(t){const e=st(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:r}=t;if(e==null)e=null;else if(d(e))n=16;else if(typeof e=="object")if(r&65){const s=e.default;s&&(s._c&&(s._d=!1),Nt(t,s()),s._c&&(s._d=!0));return}else n=32,!e._&&!se(e)&&(e._ctx=et);else C(e)?(e={default:e,_ctx:et},n=32):(e=String(e),r&64?(n=16,e=[An(e)]):n=8);t.children=e,t.shapeFlag|=n}function Tn(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const s in r)if(s==="class")e.class!==r.class&&(e.class=lt([e.class,r.class]));else if(s==="style")e.style=ct([e.style,r.style]);else if(Oe(s)){const o=e[s],i=r[s];i&&o!==i&&!(d(o)&&o.includes(i))&&(e[s]=o?[].concat(o,i):i)}else s!==""&&(e[s]=r[s])}return e}{const t=Y(),e=(n,r)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};e("__VUE_INSTANCE_SETTERS__",n=>n),e("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const $n=/(?:^|[-_])\w/g,xn=t=>t.replace($n,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 r=le(e);if(!r&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(r=s[1])}if(!r&&t){const s=o=>{for(const i in o)if(o[i]===e)return i};r=s(t.components)||t.parent&&s(t.parent.type.components)||s(t.appContext.components)}return r?xn(r):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"},r={style:"color:#eb2f96"},s={__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),`>${O(l)?" (readonly)":""}`];if(O(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",f(l.props))),l.setupState!==rt&&p.push(i("setup",l.setupState)),l.data!==rt&&p.push(i("data",f(l.data)));const S=a(l,"computed");S&&p.push(i("computed",S));const E=a(l,"inject");return E&&p.push(i("injected",E)),p.push(["div",{},["span",{style:r.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",r,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",r,l]:g(l)?["object",{object:p?f(l):l}]:["span",n,String(l)]}function a(l,p){const S=l.type;if(C(S))return;const E={};for(const q in l.ctx)u(S,q,p)&&(E[q]=l.ctx[q]);return E}function u(l,p,S){const E=l[S];if(d(E)&&E.includes(p)||g(E)&&p in E||l.extends&&u(l.extends,p,S)||l.mixins&&l.mixins.some(q=>u(q,p,S)))return!0}function h(l){return m(l)?"ShallowRef":l.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}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,r=!1,s){super(r,s),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,r){this._subscriptions[e]={subscription:n,...r??{}}}static customizeStore(e,n,r=!1,s){if(n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(e,n,r,s)}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(!J(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=J,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
PluginSubscriber as PluginSubscriberInterface,
|
|
5
5
|
PluginSubscriptions,
|
|
6
6
|
StoreOnActionSubscription,
|
|
7
|
+
StoreOnActionSubscriptionCallback,
|
|
7
8
|
StoreMutationSubscription,
|
|
8
9
|
StoreMutationSubscriptionCallback
|
|
9
10
|
} from "./plugin"
|
|
@@ -68,7 +69,7 @@ declare module 'pinia-plugin-subscription' {
|
|
|
68
69
|
protected _className: string
|
|
69
70
|
protected static _requiredKeys?: string[]
|
|
70
71
|
public debug: boolean
|
|
71
|
-
public onAction: StoreOnActionSubscription | undefined
|
|
72
|
+
public onAction: StoreOnActionSubscription | StoreOnActionSubscriptionCallback | undefined
|
|
72
73
|
public readonly options: StoreOptions
|
|
73
74
|
public state: StateTree
|
|
74
75
|
public storeSubscribe: StoreMutationSubscriptionCallback | undefined
|