@rebilly/instruments 12.86.0 → 12.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/index.js +564 -432
- package/dist/index.min.js +14 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @vue/shared v3.5.16
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
6
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
8
|
+
function makeMap(str) {
|
|
2
9
|
const map = /* @__PURE__ */ Object.create(null);
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
map[list[i]] = true;
|
|
6
|
-
}
|
|
7
|
-
return (val) => !!map[val];
|
|
10
|
+
for (const key of str.split(",")) map[key] = 1;
|
|
11
|
+
return (val) => val in map;
|
|
8
12
|
}
|
|
13
|
+
const extend$1 = Object.assign;
|
|
9
14
|
const hasOwnProperty$d = Object.prototype.hasOwnProperty;
|
|
10
15
|
const hasOwn = (val, key) => hasOwnProperty$d.call(val, key);
|
|
11
16
|
const isArray$7 = Array.isArray;
|
|
@@ -20,19 +25,38 @@ const toRawType = (value) => {
|
|
|
20
25
|
};
|
|
21
26
|
const isIntegerKey = (key) => isString$1(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
22
27
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
var define_process_env_default$1 = { NODE_ENV: "production" };
|
|
29
|
+
let activeSub;
|
|
30
|
+
let batchDepth = 0;
|
|
31
|
+
let batchedSub;
|
|
32
|
+
function startBatch() {
|
|
33
|
+
batchDepth++;
|
|
34
|
+
}
|
|
35
|
+
function endBatch() {
|
|
36
|
+
if (--batchDepth > 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let error;
|
|
40
|
+
while (batchedSub) {
|
|
41
|
+
let e2 = batchedSub;
|
|
42
|
+
batchedSub = void 0;
|
|
43
|
+
while (e2) {
|
|
44
|
+
const next = e2.next;
|
|
45
|
+
e2.next = void 0;
|
|
46
|
+
e2.flags &= -9;
|
|
47
|
+
if (e2.flags & 1) {
|
|
48
|
+
try {
|
|
49
|
+
;
|
|
50
|
+
e2.trigger();
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (!error) error = err;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
e2 = next;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (error) throw error;
|
|
59
|
+
}
|
|
36
60
|
let shouldTrack = true;
|
|
37
61
|
const trackStack = [];
|
|
38
62
|
function pauseTracking() {
|
|
@@ -43,183 +67,360 @@ function resetTracking() {
|
|
|
43
67
|
const last = trackStack.pop();
|
|
44
68
|
shouldTrack = last === void 0 ? true : last;
|
|
45
69
|
}
|
|
70
|
+
class Dep {
|
|
71
|
+
constructor(computed2) {
|
|
72
|
+
this.computed = computed2;
|
|
73
|
+
this.version = 0;
|
|
74
|
+
this.activeLink = void 0;
|
|
75
|
+
this.subs = void 0;
|
|
76
|
+
this.map = void 0;
|
|
77
|
+
this.key = void 0;
|
|
78
|
+
this.sc = 0;
|
|
79
|
+
}
|
|
80
|
+
track(debugInfo) {
|
|
81
|
+
{
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
trigger(debugInfo) {
|
|
86
|
+
this.version++;
|
|
87
|
+
this.notify(debugInfo);
|
|
88
|
+
}
|
|
89
|
+
notify(debugInfo) {
|
|
90
|
+
startBatch();
|
|
91
|
+
try {
|
|
92
|
+
if (!!(define_process_env_default$1.NODE_ENV !== "production")) ;
|
|
93
|
+
for (let link = this.subs; link; link = link.prevSub) {
|
|
94
|
+
if (link.sub.notify()) {
|
|
95
|
+
;
|
|
96
|
+
link.sub.dep.notify();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} finally {
|
|
100
|
+
endBatch();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
105
|
+
const ITERATE_KEY = Symbol(
|
|
106
|
+
""
|
|
107
|
+
);
|
|
108
|
+
const MAP_KEY_ITERATE_KEY = Symbol(
|
|
109
|
+
""
|
|
110
|
+
);
|
|
111
|
+
const ARRAY_ITERATE_KEY = Symbol(
|
|
112
|
+
""
|
|
113
|
+
);
|
|
46
114
|
function track(target, type, key) {
|
|
47
|
-
if (shouldTrack &&
|
|
115
|
+
if (shouldTrack && activeSub) {
|
|
48
116
|
let depsMap = targetMap.get(target);
|
|
49
117
|
if (!depsMap) {
|
|
50
118
|
targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
51
119
|
}
|
|
52
120
|
let dep = depsMap.get(key);
|
|
53
121
|
if (!dep) {
|
|
54
|
-
depsMap.set(key, dep =
|
|
122
|
+
depsMap.set(key, dep = new Dep());
|
|
123
|
+
dep.map = depsMap;
|
|
124
|
+
dep.key = key;
|
|
55
125
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
60
|
-
let shouldTrack2 = false;
|
|
61
|
-
{
|
|
62
|
-
if (!newTracked(dep)) {
|
|
63
|
-
dep.n |= trackOpBit;
|
|
64
|
-
shouldTrack2 = !wasTracked(dep);
|
|
126
|
+
{
|
|
127
|
+
dep.track();
|
|
65
128
|
}
|
|
66
129
|
}
|
|
67
|
-
if (shouldTrack2) {
|
|
68
|
-
dep.add(activeEffect);
|
|
69
|
-
activeEffect.deps.push(dep);
|
|
70
|
-
}
|
|
71
130
|
}
|
|
72
131
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
73
132
|
const depsMap = targetMap.get(target);
|
|
74
133
|
if (!depsMap) {
|
|
75
134
|
return;
|
|
76
135
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const newLength = Number(newValue);
|
|
82
|
-
depsMap.forEach((dep, key2) => {
|
|
83
|
-
if (key2 === "length" || key2 >= newLength) {
|
|
84
|
-
deps.push(dep);
|
|
136
|
+
const run = (dep) => {
|
|
137
|
+
if (dep) {
|
|
138
|
+
{
|
|
139
|
+
dep.trigger();
|
|
85
140
|
}
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
if (key !== void 0) {
|
|
89
|
-
deps.push(depsMap.get(key));
|
|
90
141
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
142
|
+
};
|
|
143
|
+
startBatch();
|
|
144
|
+
if (type === "clear") {
|
|
145
|
+
depsMap.forEach(run);
|
|
146
|
+
} else {
|
|
147
|
+
const targetIsArray = isArray$7(target);
|
|
148
|
+
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
149
|
+
if (targetIsArray && key === "length") {
|
|
150
|
+
const newLength = Number(newValue);
|
|
151
|
+
depsMap.forEach((dep, key2) => {
|
|
152
|
+
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol$2(key2) && key2 >= newLength) {
|
|
153
|
+
run(dep);
|
|
100
154
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
if (key !== void 0 || depsMap.has(void 0)) {
|
|
158
|
+
run(depsMap.get(key));
|
|
159
|
+
}
|
|
160
|
+
if (isArrayIndex) {
|
|
161
|
+
run(depsMap.get(ARRAY_ITERATE_KEY));
|
|
162
|
+
}
|
|
163
|
+
switch (type) {
|
|
164
|
+
case "add":
|
|
165
|
+
if (!targetIsArray) {
|
|
166
|
+
run(depsMap.get(ITERATE_KEY));
|
|
167
|
+
if (isMap$2(target)) {
|
|
168
|
+
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
169
|
+
}
|
|
170
|
+
} else if (isArrayIndex) {
|
|
171
|
+
run(depsMap.get("length"));
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case "delete":
|
|
175
|
+
if (!targetIsArray) {
|
|
176
|
+
run(depsMap.get(ITERATE_KEY));
|
|
177
|
+
if (isMap$2(target)) {
|
|
178
|
+
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "set":
|
|
105
183
|
if (isMap$2(target)) {
|
|
106
|
-
|
|
184
|
+
run(depsMap.get(ITERATE_KEY));
|
|
107
185
|
}
|
|
108
|
-
|
|
109
|
-
break;
|
|
110
|
-
case "set":
|
|
111
|
-
if (isMap$2(target)) {
|
|
112
|
-
deps.push(depsMap.get(ITERATE_KEY));
|
|
113
|
-
}
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (deps.length === 1) {
|
|
118
|
-
if (deps[0]) {
|
|
119
|
-
{
|
|
120
|
-
triggerEffects(deps[0]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
const effects = [];
|
|
125
|
-
for (const dep of deps) {
|
|
126
|
-
if (dep) {
|
|
127
|
-
effects.push(...dep);
|
|
186
|
+
break;
|
|
128
187
|
}
|
|
129
188
|
}
|
|
130
|
-
{
|
|
131
|
-
triggerEffects(createDep(effects));
|
|
132
|
-
}
|
|
133
189
|
}
|
|
190
|
+
endBatch();
|
|
134
191
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
192
|
+
function reactiveReadArray(array) {
|
|
193
|
+
const raw = toRaw(array);
|
|
194
|
+
if (raw === array) return raw;
|
|
195
|
+
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
196
|
+
return isShallow(array) ? raw : raw.map(toReactive);
|
|
197
|
+
}
|
|
198
|
+
function shallowReadArray(arr) {
|
|
199
|
+
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
200
|
+
return arr;
|
|
201
|
+
}
|
|
202
|
+
const arrayInstrumentations = {
|
|
203
|
+
__proto__: null,
|
|
204
|
+
[Symbol.iterator]() {
|
|
205
|
+
return iterator$1(this, Symbol.iterator, toReactive);
|
|
206
|
+
},
|
|
207
|
+
concat(...args) {
|
|
208
|
+
return reactiveReadArray(this).concat(
|
|
209
|
+
...args.map((x2) => isArray$7(x2) ? reactiveReadArray(x2) : x2)
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
entries() {
|
|
213
|
+
return iterator$1(this, "entries", (value) => {
|
|
214
|
+
value[1] = toReactive(value[1]);
|
|
215
|
+
return value;
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
every(fn, thisArg) {
|
|
219
|
+
return apply$2(this, "every", fn, thisArg, void 0, arguments);
|
|
220
|
+
},
|
|
221
|
+
filter(fn, thisArg) {
|
|
222
|
+
return apply$2(this, "filter", fn, thisArg, (v2) => v2.map(toReactive), arguments);
|
|
223
|
+
},
|
|
224
|
+
find(fn, thisArg) {
|
|
225
|
+
return apply$2(this, "find", fn, thisArg, toReactive, arguments);
|
|
226
|
+
},
|
|
227
|
+
findIndex(fn, thisArg) {
|
|
228
|
+
return apply$2(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
229
|
+
},
|
|
230
|
+
findLast(fn, thisArg) {
|
|
231
|
+
return apply$2(this, "findLast", fn, thisArg, toReactive, arguments);
|
|
232
|
+
},
|
|
233
|
+
findLastIndex(fn, thisArg) {
|
|
234
|
+
return apply$2(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
235
|
+
},
|
|
236
|
+
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
237
|
+
forEach(fn, thisArg) {
|
|
238
|
+
return apply$2(this, "forEach", fn, thisArg, void 0, arguments);
|
|
239
|
+
},
|
|
240
|
+
includes(...args) {
|
|
241
|
+
return searchProxy(this, "includes", args);
|
|
242
|
+
},
|
|
243
|
+
indexOf(...args) {
|
|
244
|
+
return searchProxy(this, "indexOf", args);
|
|
245
|
+
},
|
|
246
|
+
join(separator) {
|
|
247
|
+
return reactiveReadArray(this).join(separator);
|
|
248
|
+
},
|
|
249
|
+
// keys() iterator only reads `length`, no optimisation required
|
|
250
|
+
lastIndexOf(...args) {
|
|
251
|
+
return searchProxy(this, "lastIndexOf", args);
|
|
252
|
+
},
|
|
253
|
+
map(fn, thisArg) {
|
|
254
|
+
return apply$2(this, "map", fn, thisArg, void 0, arguments);
|
|
255
|
+
},
|
|
256
|
+
pop() {
|
|
257
|
+
return noTracking(this, "pop");
|
|
258
|
+
},
|
|
259
|
+
push(...args) {
|
|
260
|
+
return noTracking(this, "push", args);
|
|
261
|
+
},
|
|
262
|
+
reduce(fn, ...args) {
|
|
263
|
+
return reduce(this, "reduce", fn, args);
|
|
264
|
+
},
|
|
265
|
+
reduceRight(fn, ...args) {
|
|
266
|
+
return reduce(this, "reduceRight", fn, args);
|
|
267
|
+
},
|
|
268
|
+
shift() {
|
|
269
|
+
return noTracking(this, "shift");
|
|
270
|
+
},
|
|
271
|
+
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
272
|
+
some(fn, thisArg) {
|
|
273
|
+
return apply$2(this, "some", fn, thisArg, void 0, arguments);
|
|
274
|
+
},
|
|
275
|
+
splice(...args) {
|
|
276
|
+
return noTracking(this, "splice", args);
|
|
277
|
+
},
|
|
278
|
+
toReversed() {
|
|
279
|
+
return reactiveReadArray(this).toReversed();
|
|
280
|
+
},
|
|
281
|
+
toSorted(comparer) {
|
|
282
|
+
return reactiveReadArray(this).toSorted(comparer);
|
|
283
|
+
},
|
|
284
|
+
toSpliced(...args) {
|
|
285
|
+
return reactiveReadArray(this).toSpliced(...args);
|
|
286
|
+
},
|
|
287
|
+
unshift(...args) {
|
|
288
|
+
return noTracking(this, "unshift", args);
|
|
289
|
+
},
|
|
290
|
+
values() {
|
|
291
|
+
return iterator$1(this, "values", toReactive);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
function iterator$1(self2, method, wrapValue) {
|
|
295
|
+
const arr = shallowReadArray(self2);
|
|
296
|
+
const iter = arr[method]();
|
|
297
|
+
if (arr !== self2 && !isShallow(self2)) {
|
|
298
|
+
iter._next = iter.next;
|
|
299
|
+
iter.next = () => {
|
|
300
|
+
const result = iter._next();
|
|
301
|
+
if (result.value) {
|
|
302
|
+
result.value = wrapValue(result.value);
|
|
303
|
+
}
|
|
304
|
+
return result;
|
|
305
|
+
};
|
|
141
306
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
307
|
+
return iter;
|
|
308
|
+
}
|
|
309
|
+
const arrayProto$1 = Array.prototype;
|
|
310
|
+
function apply$2(self2, method, fn, thisArg, wrappedRetFn, args) {
|
|
311
|
+
const arr = shallowReadArray(self2);
|
|
312
|
+
const needsWrap = arr !== self2 && !isShallow(self2);
|
|
313
|
+
const methodFn = arr[method];
|
|
314
|
+
if (methodFn !== arrayProto$1[method]) {
|
|
315
|
+
const result2 = methodFn.apply(self2, args);
|
|
316
|
+
return needsWrap ? toReactive(result2) : result2;
|
|
317
|
+
}
|
|
318
|
+
let wrappedFn = fn;
|
|
319
|
+
if (arr !== self2) {
|
|
320
|
+
if (needsWrap) {
|
|
321
|
+
wrappedFn = function(item, index2) {
|
|
322
|
+
return fn.call(this, toReactive(item), index2, self2);
|
|
323
|
+
};
|
|
324
|
+
} else if (fn.length > 2) {
|
|
325
|
+
wrappedFn = function(item, index2) {
|
|
326
|
+
return fn.call(this, item, index2, self2);
|
|
327
|
+
};
|
|
145
328
|
}
|
|
146
329
|
}
|
|
330
|
+
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
331
|
+
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
147
332
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
333
|
+
function reduce(self2, method, fn, args) {
|
|
334
|
+
const arr = shallowReadArray(self2);
|
|
335
|
+
let wrappedFn = fn;
|
|
336
|
+
if (arr !== self2) {
|
|
337
|
+
if (!isShallow(self2)) {
|
|
338
|
+
wrappedFn = function(acc, item, index2) {
|
|
339
|
+
return fn.call(this, acc, toReactive(item), index2, self2);
|
|
340
|
+
};
|
|
341
|
+
} else if (fn.length > 3) {
|
|
342
|
+
wrappedFn = function(acc, item, index2) {
|
|
343
|
+
return fn.call(this, acc, item, index2, self2);
|
|
344
|
+
};
|
|
154
345
|
}
|
|
155
346
|
}
|
|
347
|
+
return arr[method](wrappedFn, ...args);
|
|
348
|
+
}
|
|
349
|
+
function searchProxy(self2, method, args) {
|
|
350
|
+
const arr = toRaw(self2);
|
|
351
|
+
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
352
|
+
const res = arr[method](...args);
|
|
353
|
+
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
354
|
+
args[0] = toRaw(args[0]);
|
|
355
|
+
return arr[method](...args);
|
|
356
|
+
}
|
|
357
|
+
return res;
|
|
358
|
+
}
|
|
359
|
+
function noTracking(self2, method, args = []) {
|
|
360
|
+
pauseTracking();
|
|
361
|
+
startBatch();
|
|
362
|
+
const res = toRaw(self2)[method].apply(self2, args);
|
|
363
|
+
endBatch();
|
|
364
|
+
resetTracking();
|
|
365
|
+
return res;
|
|
156
366
|
}
|
|
157
367
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
158
368
|
const builtInSymbols = new Set(
|
|
159
369
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$2)
|
|
160
370
|
);
|
|
161
|
-
const get$1 = /* @__PURE__ */ createGetter();
|
|
162
|
-
const readonlyGet = /* @__PURE__ */ createGetter(true);
|
|
163
|
-
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
|
|
164
|
-
function createArrayInstrumentations() {
|
|
165
|
-
const instrumentations = {};
|
|
166
|
-
["includes", "indexOf", "lastIndexOf"].forEach((key) => {
|
|
167
|
-
instrumentations[key] = function(...args) {
|
|
168
|
-
const arr = toRaw(this);
|
|
169
|
-
for (let i = 0, l = this.length; i < l; i++) {
|
|
170
|
-
track(arr, "get", i + "");
|
|
171
|
-
}
|
|
172
|
-
const res = arr[key](...args);
|
|
173
|
-
if (res === -1 || res === false) {
|
|
174
|
-
return arr[key](...args.map(toRaw));
|
|
175
|
-
} else {
|
|
176
|
-
return res;
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
});
|
|
180
|
-
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
181
|
-
instrumentations[key] = function(...args) {
|
|
182
|
-
pauseTracking();
|
|
183
|
-
const res = toRaw(this)[key].apply(this, args);
|
|
184
|
-
resetTracking();
|
|
185
|
-
return res;
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
return instrumentations;
|
|
189
|
-
}
|
|
190
371
|
function hasOwnProperty$c(key) {
|
|
372
|
+
if (!isSymbol$2(key)) key = String(key);
|
|
191
373
|
const obj = toRaw(this);
|
|
192
374
|
track(obj, "has", key);
|
|
193
375
|
return obj.hasOwnProperty(key);
|
|
194
376
|
}
|
|
195
|
-
|
|
196
|
-
|
|
377
|
+
class BaseReactiveHandler {
|
|
378
|
+
constructor(_isReadonly = false, _isShallow = false) {
|
|
379
|
+
this._isReadonly = _isReadonly;
|
|
380
|
+
this._isShallow = _isShallow;
|
|
381
|
+
}
|
|
382
|
+
get(target, key, receiver) {
|
|
383
|
+
if (key === "__v_skip") return target["__v_skip"];
|
|
384
|
+
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
|
|
197
385
|
if (key === "__v_isReactive") {
|
|
198
386
|
return !isReadonly2;
|
|
199
387
|
} else if (key === "__v_isReadonly") {
|
|
200
388
|
return isReadonly2;
|
|
201
389
|
} else if (key === "__v_isShallow") {
|
|
202
|
-
return
|
|
203
|
-
} else if (key === "__v_raw"
|
|
204
|
-
|
|
390
|
+
return isShallow2;
|
|
391
|
+
} else if (key === "__v_raw") {
|
|
392
|
+
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
393
|
+
// this means the receiver is a user proxy of the reactive proxy
|
|
394
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
395
|
+
return target;
|
|
396
|
+
}
|
|
397
|
+
return;
|
|
205
398
|
}
|
|
206
399
|
const targetIsArray = isArray$7(target);
|
|
207
400
|
if (!isReadonly2) {
|
|
208
|
-
|
|
209
|
-
|
|
401
|
+
let fn;
|
|
402
|
+
if (targetIsArray && (fn = arrayInstrumentations[key])) {
|
|
403
|
+
return fn;
|
|
210
404
|
}
|
|
211
405
|
if (key === "hasOwnProperty") {
|
|
212
406
|
return hasOwnProperty$c;
|
|
213
407
|
}
|
|
214
408
|
}
|
|
215
|
-
const res = Reflect.get(
|
|
409
|
+
const res = Reflect.get(
|
|
410
|
+
target,
|
|
411
|
+
key,
|
|
412
|
+
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
413
|
+
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
414
|
+
// its class methods
|
|
415
|
+
isRef(target) ? target : receiver
|
|
416
|
+
);
|
|
216
417
|
if (isSymbol$2(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
217
418
|
return res;
|
|
218
419
|
}
|
|
219
420
|
if (!isReadonly2) {
|
|
220
421
|
track(target, "get", key);
|
|
221
422
|
}
|
|
222
|
-
if (
|
|
423
|
+
if (isShallow2) {
|
|
223
424
|
return res;
|
|
224
425
|
}
|
|
225
426
|
if (isRef(res)) {
|
|
@@ -229,27 +430,36 @@ function createGetter(isReadonly2 = false, shallow = false) {
|
|
|
229
430
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
230
431
|
}
|
|
231
432
|
return res;
|
|
232
|
-
}
|
|
433
|
+
}
|
|
233
434
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
435
|
+
class MutableReactiveHandler extends BaseReactiveHandler {
|
|
436
|
+
constructor(isShallow2 = false) {
|
|
437
|
+
super(false, isShallow2);
|
|
438
|
+
}
|
|
439
|
+
set(target, key, value, receiver) {
|
|
237
440
|
let oldValue = target[key];
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
if (!shallow) {
|
|
441
|
+
if (!this._isShallow) {
|
|
442
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
242
443
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
243
444
|
oldValue = toRaw(oldValue);
|
|
244
445
|
value = toRaw(value);
|
|
245
446
|
}
|
|
246
447
|
if (!isArray$7(target) && isRef(oldValue) && !isRef(value)) {
|
|
247
|
-
|
|
248
|
-
|
|
448
|
+
if (isOldValueReadonly) {
|
|
449
|
+
return false;
|
|
450
|
+
} else {
|
|
451
|
+
oldValue.value = value;
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
249
454
|
}
|
|
250
455
|
}
|
|
251
456
|
const hadKey = isArray$7(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
252
|
-
const result = Reflect.set(
|
|
457
|
+
const result = Reflect.set(
|
|
458
|
+
target,
|
|
459
|
+
key,
|
|
460
|
+
value,
|
|
461
|
+
isRef(target) ? target : receiver
|
|
462
|
+
);
|
|
253
463
|
if (target === toRaw(receiver)) {
|
|
254
464
|
if (!hadKey) {
|
|
255
465
|
trigger(target, "add", key, value);
|
|
@@ -258,173 +468,61 @@ function createSetter(shallow = false) {
|
|
|
258
468
|
}
|
|
259
469
|
}
|
|
260
470
|
return result;
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
function deleteProperty(target, key) {
|
|
264
|
-
const hadKey = hasOwn(target, key);
|
|
265
|
-
target[key];
|
|
266
|
-
const result = Reflect.deleteProperty(target, key);
|
|
267
|
-
if (result && hadKey) {
|
|
268
|
-
trigger(target, "delete", key, void 0);
|
|
269
471
|
}
|
|
270
|
-
return result;
|
|
271
|
-
}
|
|
272
|
-
function has$1(target, key) {
|
|
273
|
-
const result = Reflect.has(target, key);
|
|
274
|
-
if (!isSymbol$2(key) || !builtInSymbols.has(key)) {
|
|
275
|
-
track(target, "has", key);
|
|
276
|
-
}
|
|
277
|
-
return result;
|
|
278
|
-
}
|
|
279
|
-
function ownKeys(target) {
|
|
280
|
-
track(target, "iterate", isArray$7(target) ? "length" : ITERATE_KEY);
|
|
281
|
-
return Reflect.ownKeys(target);
|
|
282
|
-
}
|
|
283
|
-
const mutableHandlers = {
|
|
284
|
-
get: get$1,
|
|
285
|
-
set: set$1,
|
|
286
|
-
deleteProperty,
|
|
287
|
-
has: has$1,
|
|
288
|
-
ownKeys
|
|
289
|
-
};
|
|
290
|
-
const readonlyHandlers = {
|
|
291
|
-
get: readonlyGet,
|
|
292
|
-
set(target, key) {
|
|
293
|
-
return true;
|
|
294
|
-
},
|
|
295
472
|
deleteProperty(target, key) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
function get(target, key, isReadonly2 = false, isShallow2 = false) {
|
|
302
|
-
target = target[
|
|
303
|
-
"__v_raw"
|
|
304
|
-
/* ReactiveFlags.RAW */
|
|
305
|
-
];
|
|
306
|
-
const rawTarget = toRaw(target);
|
|
307
|
-
const rawKey = toRaw(key);
|
|
308
|
-
if (!isReadonly2) {
|
|
309
|
-
if (key !== rawKey) {
|
|
310
|
-
track(rawTarget, "get", key);
|
|
311
|
-
}
|
|
312
|
-
track(rawTarget, "get", rawKey);
|
|
313
|
-
}
|
|
314
|
-
const { has: has2 } = getProto(rawTarget);
|
|
315
|
-
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
316
|
-
if (has2.call(rawTarget, key)) {
|
|
317
|
-
return wrap(target.get(key));
|
|
318
|
-
} else if (has2.call(rawTarget, rawKey)) {
|
|
319
|
-
return wrap(target.get(rawKey));
|
|
320
|
-
} else if (target !== rawTarget) {
|
|
321
|
-
target.get(key);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
function has(key, isReadonly2 = false) {
|
|
325
|
-
const target = this[
|
|
326
|
-
"__v_raw"
|
|
327
|
-
/* ReactiveFlags.RAW */
|
|
328
|
-
];
|
|
329
|
-
const rawTarget = toRaw(target);
|
|
330
|
-
const rawKey = toRaw(key);
|
|
331
|
-
if (!isReadonly2) {
|
|
332
|
-
if (key !== rawKey) {
|
|
333
|
-
track(rawTarget, "has", key);
|
|
473
|
+
const hadKey = hasOwn(target, key);
|
|
474
|
+
target[key];
|
|
475
|
+
const result = Reflect.deleteProperty(target, key);
|
|
476
|
+
if (result && hadKey) {
|
|
477
|
+
trigger(target, "delete", key, void 0);
|
|
334
478
|
}
|
|
335
|
-
|
|
479
|
+
return result;
|
|
336
480
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
];
|
|
344
|
-
!isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
345
|
-
return Reflect.get(target, "size", target);
|
|
346
|
-
}
|
|
347
|
-
function add(value) {
|
|
348
|
-
value = toRaw(value);
|
|
349
|
-
const target = toRaw(this);
|
|
350
|
-
const proto = getProto(target);
|
|
351
|
-
const hadKey = proto.has.call(target, value);
|
|
352
|
-
if (!hadKey) {
|
|
353
|
-
target.add(value);
|
|
354
|
-
trigger(target, "add", value, value);
|
|
481
|
+
has(target, key) {
|
|
482
|
+
const result = Reflect.has(target, key);
|
|
483
|
+
if (!isSymbol$2(key) || !builtInSymbols.has(key)) {
|
|
484
|
+
track(target, "has", key);
|
|
485
|
+
}
|
|
486
|
+
return result;
|
|
355
487
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (!hadKey) {
|
|
364
|
-
key = toRaw(key);
|
|
365
|
-
hadKey = has2.call(target, key);
|
|
366
|
-
}
|
|
367
|
-
const oldValue = get2.call(target, key);
|
|
368
|
-
target.set(key, value);
|
|
369
|
-
if (!hadKey) {
|
|
370
|
-
trigger(target, "add", key, value);
|
|
371
|
-
} else if (hasChanged(value, oldValue)) {
|
|
372
|
-
trigger(target, "set", key, value);
|
|
488
|
+
ownKeys(target) {
|
|
489
|
+
track(
|
|
490
|
+
target,
|
|
491
|
+
"iterate",
|
|
492
|
+
isArray$7(target) ? "length" : ITERATE_KEY
|
|
493
|
+
);
|
|
494
|
+
return Reflect.ownKeys(target);
|
|
373
495
|
}
|
|
374
|
-
return this;
|
|
375
496
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
let hadKey = has2.call(target, key);
|
|
380
|
-
if (!hadKey) {
|
|
381
|
-
key = toRaw(key);
|
|
382
|
-
hadKey = has2.call(target, key);
|
|
497
|
+
class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
498
|
+
constructor(isShallow2 = false) {
|
|
499
|
+
super(true, isShallow2);
|
|
383
500
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (hadKey) {
|
|
387
|
-
trigger(target, "delete", key, void 0);
|
|
501
|
+
set(target, key) {
|
|
502
|
+
return true;
|
|
388
503
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
function clear() {
|
|
392
|
-
const target = toRaw(this);
|
|
393
|
-
const hadItems = target.size !== 0;
|
|
394
|
-
const result = target.clear();
|
|
395
|
-
if (hadItems) {
|
|
396
|
-
trigger(target, "clear", void 0, void 0);
|
|
504
|
+
deleteProperty(target, key) {
|
|
505
|
+
return true;
|
|
397
506
|
}
|
|
398
|
-
return result;
|
|
399
|
-
}
|
|
400
|
-
function createForEach(isReadonly2, isShallow2) {
|
|
401
|
-
return function forEach2(callback, thisArg) {
|
|
402
|
-
const observed = this;
|
|
403
|
-
const target = observed[
|
|
404
|
-
"__v_raw"
|
|
405
|
-
/* ReactiveFlags.RAW */
|
|
406
|
-
];
|
|
407
|
-
const rawTarget = toRaw(target);
|
|
408
|
-
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
409
|
-
!isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
410
|
-
return target.forEach((value, key) => {
|
|
411
|
-
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
412
|
-
});
|
|
413
|
-
};
|
|
414
507
|
}
|
|
508
|
+
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
509
|
+
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
510
|
+
const toShallow = (value) => value;
|
|
511
|
+
const getProto = (v2) => Reflect.getPrototypeOf(v2);
|
|
415
512
|
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
416
513
|
return function(...args) {
|
|
417
|
-
const target = this[
|
|
418
|
-
"__v_raw"
|
|
419
|
-
/* ReactiveFlags.RAW */
|
|
420
|
-
];
|
|
514
|
+
const target = this["__v_raw"];
|
|
421
515
|
const rawTarget = toRaw(target);
|
|
422
516
|
const targetIsMap = isMap$2(rawTarget);
|
|
423
517
|
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
424
518
|
const isKeyOnly = method === "keys" && targetIsMap;
|
|
425
519
|
const innerIterator = target[method](...args);
|
|
426
520
|
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
427
|
-
!isReadonly2 && track(
|
|
521
|
+
!isReadonly2 && track(
|
|
522
|
+
rawTarget,
|
|
523
|
+
"iterate",
|
|
524
|
+
isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
|
|
525
|
+
);
|
|
428
526
|
return {
|
|
429
527
|
// iterator protocol
|
|
430
528
|
next() {
|
|
@@ -443,111 +541,144 @@ function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
|
443
541
|
}
|
|
444
542
|
function createReadonlyMethod(type) {
|
|
445
543
|
return function(...args) {
|
|
446
|
-
return type === "delete" ? false : this;
|
|
544
|
+
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
447
545
|
};
|
|
448
546
|
}
|
|
449
|
-
function createInstrumentations() {
|
|
450
|
-
const
|
|
451
|
-
get(key) {
|
|
452
|
-
return get(this, key);
|
|
453
|
-
},
|
|
454
|
-
get size() {
|
|
455
|
-
return size(this);
|
|
456
|
-
},
|
|
457
|
-
has,
|
|
458
|
-
add,
|
|
459
|
-
set,
|
|
460
|
-
delete: deleteEntry,
|
|
461
|
-
clear,
|
|
462
|
-
forEach: createForEach(false, false)
|
|
463
|
-
};
|
|
464
|
-
const shallowInstrumentations2 = {
|
|
465
|
-
get(key) {
|
|
466
|
-
return get(this, key, false, true);
|
|
467
|
-
},
|
|
468
|
-
get size() {
|
|
469
|
-
return size(this);
|
|
470
|
-
},
|
|
471
|
-
has,
|
|
472
|
-
add,
|
|
473
|
-
set,
|
|
474
|
-
delete: deleteEntry,
|
|
475
|
-
clear,
|
|
476
|
-
forEach: createForEach(false, true)
|
|
477
|
-
};
|
|
478
|
-
const readonlyInstrumentations2 = {
|
|
479
|
-
get(key) {
|
|
480
|
-
return get(this, key, true);
|
|
481
|
-
},
|
|
482
|
-
get size() {
|
|
483
|
-
return size(this, true);
|
|
484
|
-
},
|
|
485
|
-
has(key) {
|
|
486
|
-
return has.call(this, key, true);
|
|
487
|
-
},
|
|
488
|
-
add: createReadonlyMethod(
|
|
489
|
-
"add"
|
|
490
|
-
/* TriggerOpTypes.ADD */
|
|
491
|
-
),
|
|
492
|
-
set: createReadonlyMethod(
|
|
493
|
-
"set"
|
|
494
|
-
/* TriggerOpTypes.SET */
|
|
495
|
-
),
|
|
496
|
-
delete: createReadonlyMethod(
|
|
497
|
-
"delete"
|
|
498
|
-
/* TriggerOpTypes.DELETE */
|
|
499
|
-
),
|
|
500
|
-
clear: createReadonlyMethod(
|
|
501
|
-
"clear"
|
|
502
|
-
/* TriggerOpTypes.CLEAR */
|
|
503
|
-
),
|
|
504
|
-
forEach: createForEach(true, false)
|
|
505
|
-
};
|
|
506
|
-
const shallowReadonlyInstrumentations2 = {
|
|
547
|
+
function createInstrumentations(readonly2, shallow) {
|
|
548
|
+
const instrumentations = {
|
|
507
549
|
get(key) {
|
|
508
|
-
|
|
550
|
+
const target = this["__v_raw"];
|
|
551
|
+
const rawTarget = toRaw(target);
|
|
552
|
+
const rawKey = toRaw(key);
|
|
553
|
+
if (!readonly2) {
|
|
554
|
+
if (hasChanged(key, rawKey)) {
|
|
555
|
+
track(rawTarget, "get", key);
|
|
556
|
+
}
|
|
557
|
+
track(rawTarget, "get", rawKey);
|
|
558
|
+
}
|
|
559
|
+
const { has } = getProto(rawTarget);
|
|
560
|
+
const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
|
|
561
|
+
if (has.call(rawTarget, key)) {
|
|
562
|
+
return wrap(target.get(key));
|
|
563
|
+
} else if (has.call(rawTarget, rawKey)) {
|
|
564
|
+
return wrap(target.get(rawKey));
|
|
565
|
+
} else if (target !== rawTarget) {
|
|
566
|
+
target.get(key);
|
|
567
|
+
}
|
|
509
568
|
},
|
|
510
569
|
get size() {
|
|
511
|
-
|
|
570
|
+
const target = this["__v_raw"];
|
|
571
|
+
!readonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
572
|
+
return Reflect.get(target, "size", target);
|
|
512
573
|
},
|
|
513
574
|
has(key) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
575
|
+
const target = this["__v_raw"];
|
|
576
|
+
const rawTarget = toRaw(target);
|
|
577
|
+
const rawKey = toRaw(key);
|
|
578
|
+
if (!readonly2) {
|
|
579
|
+
if (hasChanged(key, rawKey)) {
|
|
580
|
+
track(rawTarget, "has", key);
|
|
581
|
+
}
|
|
582
|
+
track(rawTarget, "has", rawKey);
|
|
583
|
+
}
|
|
584
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
585
|
+
},
|
|
586
|
+
forEach(callback, thisArg) {
|
|
587
|
+
const observed = this;
|
|
588
|
+
const target = observed["__v_raw"];
|
|
589
|
+
const rawTarget = toRaw(target);
|
|
590
|
+
const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
|
|
591
|
+
!readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
592
|
+
return target.forEach((value, key) => {
|
|
593
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
594
|
+
});
|
|
595
|
+
}
|
|
533
596
|
};
|
|
534
|
-
|
|
597
|
+
extend$1(
|
|
598
|
+
instrumentations,
|
|
599
|
+
readonly2 ? {
|
|
600
|
+
add: createReadonlyMethod("add"),
|
|
601
|
+
set: createReadonlyMethod("set"),
|
|
602
|
+
delete: createReadonlyMethod("delete"),
|
|
603
|
+
clear: createReadonlyMethod("clear")
|
|
604
|
+
} : {
|
|
605
|
+
add(value) {
|
|
606
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
607
|
+
value = toRaw(value);
|
|
608
|
+
}
|
|
609
|
+
const target = toRaw(this);
|
|
610
|
+
const proto = getProto(target);
|
|
611
|
+
const hadKey = proto.has.call(target, value);
|
|
612
|
+
if (!hadKey) {
|
|
613
|
+
target.add(value);
|
|
614
|
+
trigger(target, "add", value, value);
|
|
615
|
+
}
|
|
616
|
+
return this;
|
|
617
|
+
},
|
|
618
|
+
set(key, value) {
|
|
619
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
620
|
+
value = toRaw(value);
|
|
621
|
+
}
|
|
622
|
+
const target = toRaw(this);
|
|
623
|
+
const { has, get } = getProto(target);
|
|
624
|
+
let hadKey = has.call(target, key);
|
|
625
|
+
if (!hadKey) {
|
|
626
|
+
key = toRaw(key);
|
|
627
|
+
hadKey = has.call(target, key);
|
|
628
|
+
}
|
|
629
|
+
const oldValue = get.call(target, key);
|
|
630
|
+
target.set(key, value);
|
|
631
|
+
if (!hadKey) {
|
|
632
|
+
trigger(target, "add", key, value);
|
|
633
|
+
} else if (hasChanged(value, oldValue)) {
|
|
634
|
+
trigger(target, "set", key, value);
|
|
635
|
+
}
|
|
636
|
+
return this;
|
|
637
|
+
},
|
|
638
|
+
delete(key) {
|
|
639
|
+
const target = toRaw(this);
|
|
640
|
+
const { has, get } = getProto(target);
|
|
641
|
+
let hadKey = has.call(target, key);
|
|
642
|
+
if (!hadKey) {
|
|
643
|
+
key = toRaw(key);
|
|
644
|
+
hadKey = has.call(target, key);
|
|
645
|
+
}
|
|
646
|
+
get ? get.call(target, key) : void 0;
|
|
647
|
+
const result = target.delete(key);
|
|
648
|
+
if (hadKey) {
|
|
649
|
+
trigger(target, "delete", key, void 0);
|
|
650
|
+
}
|
|
651
|
+
return result;
|
|
652
|
+
},
|
|
653
|
+
clear() {
|
|
654
|
+
const target = toRaw(this);
|
|
655
|
+
const hadItems = target.size !== 0;
|
|
656
|
+
const result = target.clear();
|
|
657
|
+
if (hadItems) {
|
|
658
|
+
trigger(
|
|
659
|
+
target,
|
|
660
|
+
"clear",
|
|
661
|
+
void 0,
|
|
662
|
+
void 0
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
return result;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
);
|
|
669
|
+
const iteratorMethods = [
|
|
670
|
+
"keys",
|
|
671
|
+
"values",
|
|
672
|
+
"entries",
|
|
673
|
+
Symbol.iterator
|
|
674
|
+
];
|
|
535
675
|
iteratorMethods.forEach((method) => {
|
|
536
|
-
|
|
537
|
-
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
538
|
-
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
539
|
-
shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
|
|
676
|
+
instrumentations[method] = createIterableMethod(method, readonly2, shallow);
|
|
540
677
|
});
|
|
541
|
-
return
|
|
542
|
-
mutableInstrumentations2,
|
|
543
|
-
readonlyInstrumentations2,
|
|
544
|
-
shallowInstrumentations2,
|
|
545
|
-
shallowReadonlyInstrumentations2
|
|
546
|
-
];
|
|
678
|
+
return instrumentations;
|
|
547
679
|
}
|
|
548
|
-
const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
|
|
549
680
|
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
550
|
-
const instrumentations =
|
|
681
|
+
const instrumentations = createInstrumentations(isReadonly2, shallow);
|
|
551
682
|
return (target, key, receiver) => {
|
|
552
683
|
if (key === "__v_isReactive") {
|
|
553
684
|
return !isReadonly2;
|
|
@@ -556,7 +687,11 @@ function createInstrumentationGetter(isReadonly2, shallow) {
|
|
|
556
687
|
} else if (key === "__v_raw") {
|
|
557
688
|
return target;
|
|
558
689
|
}
|
|
559
|
-
return Reflect.get(
|
|
690
|
+
return Reflect.get(
|
|
691
|
+
hasOwn(instrumentations, key) && key in target ? instrumentations : target,
|
|
692
|
+
key,
|
|
693
|
+
receiver
|
|
694
|
+
);
|
|
560
695
|
};
|
|
561
696
|
}
|
|
562
697
|
const mutableCollectionHandlers = {
|
|
@@ -584,68 +719,68 @@ function targetTypeMap(rawType) {
|
|
|
584
719
|
}
|
|
585
720
|
}
|
|
586
721
|
function getTargetType(value) {
|
|
587
|
-
return value[
|
|
588
|
-
"__v_skip"
|
|
589
|
-
/* ReactiveFlags.SKIP */
|
|
590
|
-
] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
722
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
591
723
|
}
|
|
592
724
|
function reactive(target) {
|
|
593
725
|
if (isReadonly(target)) {
|
|
594
726
|
return target;
|
|
595
727
|
}
|
|
596
|
-
return createReactiveObject(
|
|
728
|
+
return createReactiveObject(
|
|
729
|
+
target,
|
|
730
|
+
false,
|
|
731
|
+
mutableHandlers,
|
|
732
|
+
mutableCollectionHandlers,
|
|
733
|
+
reactiveMap
|
|
734
|
+
);
|
|
597
735
|
}
|
|
598
736
|
function readonly(target) {
|
|
599
|
-
return createReactiveObject(
|
|
737
|
+
return createReactiveObject(
|
|
738
|
+
target,
|
|
739
|
+
true,
|
|
740
|
+
readonlyHandlers,
|
|
741
|
+
readonlyCollectionHandlers,
|
|
742
|
+
readonlyMap
|
|
743
|
+
);
|
|
600
744
|
}
|
|
601
745
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
602
746
|
if (!isObject$b(target)) {
|
|
603
747
|
return target;
|
|
604
748
|
}
|
|
605
|
-
if (target[
|
|
606
|
-
"__v_raw"
|
|
607
|
-
/* ReactiveFlags.RAW */
|
|
608
|
-
] && !(isReadonly2 && target[
|
|
609
|
-
"__v_isReactive"
|
|
610
|
-
/* ReactiveFlags.IS_REACTIVE */
|
|
611
|
-
])) {
|
|
749
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
612
750
|
return target;
|
|
613
751
|
}
|
|
614
|
-
const existingProxy = proxyMap.get(target);
|
|
615
|
-
if (existingProxy) {
|
|
616
|
-
return existingProxy;
|
|
617
|
-
}
|
|
618
752
|
const targetType = getTargetType(target);
|
|
619
753
|
if (targetType === 0) {
|
|
620
754
|
return target;
|
|
621
755
|
}
|
|
622
|
-
const
|
|
756
|
+
const existingProxy = proxyMap.get(target);
|
|
757
|
+
if (existingProxy) {
|
|
758
|
+
return existingProxy;
|
|
759
|
+
}
|
|
760
|
+
const proxy = new Proxy(
|
|
761
|
+
target,
|
|
762
|
+
targetType === 2 ? collectionHandlers : baseHandlers
|
|
763
|
+
);
|
|
623
764
|
proxyMap.set(target, proxy);
|
|
624
765
|
return proxy;
|
|
625
766
|
}
|
|
626
767
|
function isReadonly(value) {
|
|
627
|
-
return !!(value && value[
|
|
628
|
-
"__v_isReadonly"
|
|
629
|
-
/* ReactiveFlags.IS_READONLY */
|
|
630
|
-
]);
|
|
768
|
+
return !!(value && value["__v_isReadonly"]);
|
|
631
769
|
}
|
|
632
770
|
function isShallow(value) {
|
|
633
|
-
return !!(value && value[
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
]
|
|
771
|
+
return !!(value && value["__v_isShallow"]);
|
|
772
|
+
}
|
|
773
|
+
function isProxy(value) {
|
|
774
|
+
return value ? !!value["__v_raw"] : false;
|
|
637
775
|
}
|
|
638
776
|
function toRaw(observed) {
|
|
639
|
-
const raw = observed && observed[
|
|
640
|
-
"__v_raw"
|
|
641
|
-
/* ReactiveFlags.RAW */
|
|
642
|
-
];
|
|
777
|
+
const raw = observed && observed["__v_raw"];
|
|
643
778
|
return raw ? toRaw(raw) : observed;
|
|
644
779
|
}
|
|
645
780
|
const toReactive = (value) => isObject$b(value) ? reactive(value) : value;
|
|
646
781
|
const toReadonly = (value) => isObject$b(value) ? readonly(value) : value;
|
|
647
782
|
function isRef(r2) {
|
|
648
|
-
return
|
|
783
|
+
return r2 ? r2["__v_isRef"] === true : false;
|
|
649
784
|
}
|
|
650
785
|
function isDOMElement(element) {
|
|
651
786
|
return element instanceof Element || element instanceof Document;
|
|
@@ -1096,9 +1231,9 @@ function mapCacheHas$1(key) {
|
|
|
1096
1231
|
var _mapCacheHas = mapCacheHas$1;
|
|
1097
1232
|
var getMapData = _getMapData;
|
|
1098
1233
|
function mapCacheSet$1(key, value) {
|
|
1099
|
-
var data = getMapData(this, key),
|
|
1234
|
+
var data = getMapData(this, key), size = data.size;
|
|
1100
1235
|
data.set(key, value);
|
|
1101
|
-
this.size += data.size ==
|
|
1236
|
+
this.size += data.size == size ? 0 : 1;
|
|
1102
1237
|
return this;
|
|
1103
1238
|
}
|
|
1104
1239
|
var _mapCacheSet = mapCacheSet$1;
|
|
@@ -2021,7 +2156,7 @@ var ParentAPI = /* @__PURE__ */ function() {
|
|
|
2021
2156
|
this.logger.debug("Parent: Awaiting event emissions from Child");
|
|
2022
2157
|
}
|
|
2023
2158
|
var _proto = ParentAPI2.prototype;
|
|
2024
|
-
_proto.get = function
|
|
2159
|
+
_proto.get = function get(property) {
|
|
2025
2160
|
var _this2 = this;
|
|
2026
2161
|
return new Postmate.Promise(function(resolve) {
|
|
2027
2162
|
var uid = generateNewMessageId();
|
|
@@ -3980,9 +4115,6 @@ function toFormData$1(obj, formData, options) {
|
|
|
3980
4115
|
if (utils$1.isDate(value)) {
|
|
3981
4116
|
return value.toISOString();
|
|
3982
4117
|
}
|
|
3983
|
-
if (utils$1.isBoolean(value)) {
|
|
3984
|
-
return value.toString();
|
|
3985
|
-
}
|
|
3986
4118
|
if (!useBlob && utils$1.isBlob(value)) {
|
|
3987
4119
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
3988
4120
|
}
|
|
@@ -5286,7 +5418,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
5286
5418
|
duplex: "half",
|
|
5287
5419
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
5288
5420
|
});
|
|
5289
|
-
let response = await fetch(request
|
|
5421
|
+
let response = await fetch(request);
|
|
5290
5422
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
5291
5423
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
5292
5424
|
const options = {};
|
|
@@ -5427,7 +5559,7 @@ function dispatchRequest(config) {
|
|
|
5427
5559
|
return Promise.reject(reason);
|
|
5428
5560
|
});
|
|
5429
5561
|
}
|
|
5430
|
-
const VERSION$1 = "1.
|
|
5562
|
+
const VERSION$1 = "1.9.0";
|
|
5431
5563
|
const validators$1 = {};
|
|
5432
5564
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
5433
5565
|
validators$1[type] = function validator2(thing) {
|
|
@@ -6331,7 +6463,7 @@ function C$1({ options: e2 }) {
|
|
|
6331
6463
|
}
|
|
6332
6464
|
function o2() {
|
|
6333
6465
|
const i = {
|
|
6334
|
-
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@
|
|
6466
|
+
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@7d2339b`
|
|
6335
6467
|
};
|
|
6336
6468
|
return e2.apiKey && (i["REB-APIKEY"] = e2.apiKey), i;
|
|
6337
6469
|
}
|
|
@@ -19601,12 +19733,12 @@ async function fetchData({
|
|
|
19601
19733
|
availableInstrumentsPromise
|
|
19602
19734
|
]);
|
|
19603
19735
|
if (isManageInstruments && availableInstruments && !readyToPay && !((_u = state.options) == null ? void 0 : _u.payout)) {
|
|
19604
|
-
const
|
|
19736
|
+
const set = /* @__PURE__ */ new Set();
|
|
19605
19737
|
availableInstruments.forEach((instrument) => {
|
|
19606
|
-
|
|
19738
|
+
set.add(instrument.method);
|
|
19607
19739
|
});
|
|
19608
19740
|
readyToPay = filterReadyToPay(
|
|
19609
|
-
Array.from(
|
|
19741
|
+
Array.from(set).map((method) => ({ method }))
|
|
19610
19742
|
);
|
|
19611
19743
|
}
|
|
19612
19744
|
return new DataInstance({
|