@graffiti-garden/wrapper-vue 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/plugin.mjs +475 -366
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/Discover.vue.d.ts +5 -0
- package/dist/node/Discover.vue.d.ts.map +1 -1
- package/dist/node/Get.vue.d.ts +5 -0
- package/dist/node/Get.vue.d.ts.map +1 -1
- package/dist/node/RecoverOrphans.vue.d.ts +5 -0
- package/dist/node/RecoverOrphans.vue.d.ts.map +1 -1
- package/dist/node/composables.d.ts +9 -3
- package/dist/node/composables.d.ts.map +1 -1
- package/dist/node/plugin.d.ts +27 -0
- package/dist/node/plugin.d.ts.map +1 -1
- package/dist/node/plugin.js +1 -1
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/plugin.mjs +262 -152
- package/dist/node/plugin.mjs.map +1 -1
- package/dist/node/pollers.d.ts +1 -1
- package/dist/node/pollers.d.ts.map +1 -1
- package/dist/node/reducers.d.ts +3 -3
- package/dist/node/reducers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Discover.vue +17 -6
- package/src/Get.vue +17 -6
- package/src/RecoverOrphans.vue +16 -5
- package/src/composables.ts +116 -25
- package/src/pollers.ts +14 -2
- package/src/reducers.ts +11 -3
package/dist/browser/plugin.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var v = (t, n, e) =>
|
|
4
|
-
import { inject as X, ref as
|
|
1
|
+
var pe = Object.defineProperty;
|
|
2
|
+
var de = (t, n, e) => n in t ? pe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var v = (t, n, e) => de(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { inject as X, ref as U, computed as ye, watch as ve, onScopeDispose as me, toValue as P, defineComponent as L, toRef as w, renderSlot as W, unref as m } from "vue";
|
|
5
5
|
const Y = Symbol(), Z = Symbol();
|
|
6
|
-
function
|
|
6
|
+
function B() {
|
|
7
7
|
const t = X(Y);
|
|
8
8
|
if (!t)
|
|
9
9
|
throw new Error(
|
|
@@ -11,8 +11,8 @@ function N() {
|
|
|
11
11
|
);
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
14
|
+
function Le() {
|
|
15
|
+
return B();
|
|
16
16
|
}
|
|
17
17
|
function ee() {
|
|
18
18
|
const t = X(Z);
|
|
@@ -22,21 +22,25 @@ function ee() {
|
|
|
22
22
|
);
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var be = class {
|
|
26
26
|
}, we = class te extends Error {
|
|
27
27
|
constructor(n) {
|
|
28
|
-
super(n), this.name = "
|
|
28
|
+
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, te.prototype);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, ge = class ne extends Error {
|
|
31
31
|
constructor(n) {
|
|
32
|
-
super(n), this.name = "
|
|
32
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ne.prototype);
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Pe = class re extends Error {
|
|
35
35
|
constructor(n) {
|
|
36
|
-
super(n), this.name = "
|
|
36
|
+
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, re.prototype);
|
|
37
|
+
}
|
|
38
|
+
}, je = class ie extends Error {
|
|
39
|
+
constructor(n) {
|
|
40
|
+
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ie.prototype);
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
|
-
class
|
|
43
|
+
class xe {
|
|
40
44
|
constructor(n) {
|
|
41
45
|
v(this, "poll", async (n) => {
|
|
42
46
|
let e;
|
|
@@ -54,12 +58,24 @@ class Pe {
|
|
|
54
58
|
clear() {
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
|
-
class
|
|
61
|
+
class oe {
|
|
58
62
|
constructor(n) {
|
|
59
63
|
v(this, "iterator");
|
|
60
64
|
v(this, "continue");
|
|
61
65
|
v(this, "poll", async (n) => {
|
|
62
|
-
|
|
66
|
+
if (!this.iterator)
|
|
67
|
+
if (this.continue)
|
|
68
|
+
try {
|
|
69
|
+
this.iterator = this.continue();
|
|
70
|
+
} catch (e) {
|
|
71
|
+
if (e instanceof we)
|
|
72
|
+
n("clear"), this.iterator = this.streamFactory();
|
|
73
|
+
else
|
|
74
|
+
throw e;
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
this.iterator = this.streamFactory();
|
|
78
|
+
for (; this.iterator; ) {
|
|
63
79
|
const e = this.iterator, r = await e.next();
|
|
64
80
|
if (e === this.iterator) {
|
|
65
81
|
if (r.done) {
|
|
@@ -87,15 +103,15 @@ class ie {
|
|
|
87
103
|
this.iterator = void 0, this.continue = void 0;
|
|
88
104
|
}
|
|
89
105
|
}
|
|
90
|
-
function
|
|
106
|
+
function se(t, n) {
|
|
91
107
|
return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
|
|
92
108
|
}
|
|
93
|
-
class
|
|
109
|
+
class Oe {
|
|
94
110
|
constructor() {
|
|
95
|
-
v(this, "entry",
|
|
111
|
+
v(this, "entry", U());
|
|
96
112
|
}
|
|
97
113
|
get result() {
|
|
98
|
-
return
|
|
114
|
+
return ye(() => {
|
|
99
115
|
const n = this.entry.value;
|
|
100
116
|
return n && (n.tombstone ? null : n.object);
|
|
101
117
|
});
|
|
@@ -104,12 +120,16 @@ class xe {
|
|
|
104
120
|
this.entry.value = void 0;
|
|
105
121
|
}
|
|
106
122
|
onEntry(n) {
|
|
107
|
-
(
|
|
123
|
+
if (n === "clear") {
|
|
124
|
+
this.clear();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
(!n || se(n, this.entry.value)) && (this.entry.value = n);
|
|
108
128
|
}
|
|
109
129
|
}
|
|
110
|
-
class
|
|
130
|
+
class ae {
|
|
111
131
|
constructor(n) {
|
|
112
|
-
v(this, "results",
|
|
132
|
+
v(this, "results", U([]));
|
|
113
133
|
v(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
114
134
|
v(this, "batchFlattenTimer");
|
|
115
135
|
this.graffiti = n;
|
|
@@ -122,184 +142,273 @@ class se {
|
|
|
122
142
|
}
|
|
123
143
|
onEntry(n) {
|
|
124
144
|
if (!n) return;
|
|
145
|
+
if (n === "clear") {
|
|
146
|
+
this.clear();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
125
149
|
const e = this.resultsRaw.get(n.object.url);
|
|
126
|
-
|
|
150
|
+
se(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
127
151
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
128
152
|
}, 0)));
|
|
129
153
|
}
|
|
130
154
|
}
|
|
131
|
-
function J(t, n, e, r) {
|
|
132
|
-
let
|
|
133
|
-
async function
|
|
134
|
-
|
|
135
|
-
for await (const
|
|
136
|
-
if (
|
|
137
|
-
console.error(
|
|
155
|
+
function J(t, n, e, r, o) {
|
|
156
|
+
let i;
|
|
157
|
+
async function a() {
|
|
158
|
+
i = e();
|
|
159
|
+
for await (const f of i) {
|
|
160
|
+
if (f.error) {
|
|
161
|
+
console.error(f.error);
|
|
138
162
|
continue;
|
|
139
163
|
}
|
|
140
|
-
t.onEntry(
|
|
164
|
+
t.onEntry(f);
|
|
141
165
|
}
|
|
142
166
|
}
|
|
143
|
-
|
|
144
|
-
|
|
167
|
+
let c = !1;
|
|
168
|
+
const l = async () => {
|
|
169
|
+
if (!c) {
|
|
170
|
+
c = !0;
|
|
171
|
+
try {
|
|
172
|
+
await n.poll(t.onEntry.bind(t));
|
|
173
|
+
} finally {
|
|
174
|
+
c = !1, P(o) && l();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}, s = U(!1);
|
|
178
|
+
return ve(
|
|
145
179
|
r,
|
|
146
|
-
async (
|
|
147
|
-
if (JSON.stringify(
|
|
148
|
-
|
|
180
|
+
async (f, p) => {
|
|
181
|
+
if (JSON.stringify(f) !== JSON.stringify(p)) {
|
|
182
|
+
i == null || i.return(null), t.clear(), n.clear(), a(), s.value = !0;
|
|
149
183
|
try {
|
|
150
|
-
await
|
|
184
|
+
await l();
|
|
151
185
|
} finally {
|
|
152
|
-
|
|
186
|
+
s.value = !1;
|
|
153
187
|
}
|
|
154
188
|
}
|
|
155
189
|
},
|
|
156
190
|
{
|
|
157
191
|
immediate: !0
|
|
158
192
|
}
|
|
159
|
-
),
|
|
193
|
+
), me(() => i == null ? void 0 : i.return(null)), { poll: l, isInitialPolling: s };
|
|
160
194
|
}
|
|
161
195
|
function ue(t, n) {
|
|
162
196
|
return () => {
|
|
163
|
-
const e =
|
|
197
|
+
const e = P(n);
|
|
164
198
|
return e === void 0 ? t == null ? void 0 : t.value : e;
|
|
165
199
|
};
|
|
166
200
|
}
|
|
167
|
-
function
|
|
201
|
+
function S(t) {
|
|
168
202
|
return t.map((n) => n());
|
|
169
203
|
}
|
|
170
|
-
function
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
204
|
+
function Ee(t, n, e, r = !1) {
|
|
205
|
+
const o = B(), i = ee(), a = () => P(t), c = () => P(n), l = ue(i, e), s = [a, c, l], f = () => o.synchronizeDiscover(...S(s)), p = () => o.discover(...S(s)), u = new ae(o), d = new oe(p), { poll: h, isInitialPolling: y } = J(
|
|
206
|
+
u,
|
|
207
|
+
d,
|
|
208
|
+
f,
|
|
174
209
|
s,
|
|
175
|
-
|
|
210
|
+
r
|
|
176
211
|
);
|
|
177
212
|
return {
|
|
178
213
|
/**
|
|
179
|
-
* A [
|
|
180
|
-
* an array of Graffiti objects.
|
|
214
|
+
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
215
|
+
* an array of Graffiti objects.
|
|
181
216
|
*/
|
|
182
|
-
|
|
217
|
+
objects: u.results,
|
|
218
|
+
/**
|
|
219
|
+
* @deprecated Use {@link objects} instead.
|
|
220
|
+
*/
|
|
221
|
+
get results() {
|
|
222
|
+
return console.warn(
|
|
223
|
+
"The `results` property is deprecated. Use `objects` instead."
|
|
224
|
+
), this.objects;
|
|
225
|
+
},
|
|
183
226
|
/**
|
|
184
227
|
* A method to poll for new results.
|
|
185
228
|
*/
|
|
186
|
-
poll:
|
|
229
|
+
poll: h,
|
|
187
230
|
/**
|
|
188
|
-
* A boolean [
|
|
189
|
-
* that indicates if the poll is currently running.
|
|
231
|
+
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
232
|
+
* that indicates if the *first* poll is currently running.
|
|
190
233
|
* Useful to show a loading spinner or disable a button.
|
|
234
|
+
*
|
|
235
|
+
* This also tracks new polls when the arguments have changed,
|
|
236
|
+
* but it does not track ongoing polls from either calling
|
|
237
|
+
* {@link poll} or using the `autopoll` argument.
|
|
238
|
+
*/
|
|
239
|
+
isInitialPolling: y,
|
|
240
|
+
/**
|
|
241
|
+
* @deprecated Use {@link isInitialPolling} instead.
|
|
191
242
|
*/
|
|
192
|
-
isPolling
|
|
243
|
+
get isPolling() {
|
|
244
|
+
return console.warn(
|
|
245
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
246
|
+
), this.isInitialPolling;
|
|
247
|
+
}
|
|
193
248
|
};
|
|
194
249
|
}
|
|
195
|
-
function
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
250
|
+
function Se(t, n, e, r = !1) {
|
|
251
|
+
const o = B(), i = ee(), a = () => P(t), c = () => P(n), l = ue(i, e), s = [
|
|
252
|
+
a,
|
|
253
|
+
c,
|
|
199
254
|
l
|
|
200
|
-
],
|
|
255
|
+
], f = () => o.synchronizeGet(...S(s)), p = new Oe(), u = () => o.get(...S(s)), d = new xe(u), { poll: h, isInitialPolling: y } = J(
|
|
256
|
+
p,
|
|
257
|
+
d,
|
|
201
258
|
f,
|
|
202
|
-
c,
|
|
203
259
|
s,
|
|
204
|
-
|
|
260
|
+
r
|
|
205
261
|
);
|
|
206
262
|
return {
|
|
207
263
|
/**
|
|
208
|
-
* A [
|
|
264
|
+
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
209
265
|
* the retrieved Graffiti object, if it exists. If the object has been deleted,
|
|
210
266
|
* the result is `null`. If the object is still being fetched, the result is `undefined`.
|
|
211
267
|
*/
|
|
212
|
-
|
|
268
|
+
object: p.result,
|
|
269
|
+
/**
|
|
270
|
+
* @deprecated Use {@link object} instead.
|
|
271
|
+
*/
|
|
272
|
+
get result() {
|
|
273
|
+
return console.warn(
|
|
274
|
+
"The `result` property is deprecated. Use `object` instead."
|
|
275
|
+
), this.object;
|
|
276
|
+
},
|
|
213
277
|
/**
|
|
214
278
|
* A method to poll for new results.
|
|
215
279
|
*/
|
|
216
|
-
poll:
|
|
280
|
+
poll: h,
|
|
217
281
|
/**
|
|
218
|
-
* A boolean [
|
|
219
|
-
* that indicates if the poll is currently running.
|
|
282
|
+
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
283
|
+
* that indicates if the *first* poll is currently running.
|
|
220
284
|
* Useful to show a loading spinner or disable a button.
|
|
285
|
+
*
|
|
286
|
+
* This also tracks new polls when the arguments have changed,
|
|
287
|
+
* but it does not track ongoing polls from either calling
|
|
288
|
+
* {@link poll} or using the `autopoll` argument.
|
|
289
|
+
*/
|
|
290
|
+
isInitialPolling: y,
|
|
291
|
+
/**
|
|
292
|
+
* @deprecated Use {@link isInitialPolling} instead.
|
|
221
293
|
*/
|
|
222
|
-
isPolling
|
|
294
|
+
get isPolling() {
|
|
295
|
+
return console.warn(
|
|
296
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
297
|
+
), this.isInitialPolling;
|
|
298
|
+
}
|
|
223
299
|
};
|
|
224
300
|
}
|
|
225
|
-
function
|
|
226
|
-
const
|
|
301
|
+
function Ge(t, n, e = !1) {
|
|
302
|
+
const r = B(), a = [() => P(t), () => P(n)], c = () => r.synchronizeRecoverOrphans(...S(a)), l = new ae(r), s = () => r.recoverOrphans(...S(a)), f = new oe(s), { poll: p, isInitialPolling: u } = J(
|
|
227
303
|
l,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
304
|
+
f,
|
|
305
|
+
c,
|
|
306
|
+
a,
|
|
307
|
+
e
|
|
231
308
|
);
|
|
232
309
|
return {
|
|
233
310
|
/**
|
|
234
|
-
* A [
|
|
235
|
-
* an array of Graffiti objects.
|
|
311
|
+
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
312
|
+
* an array of Graffiti objects.
|
|
236
313
|
*/
|
|
237
|
-
|
|
314
|
+
objects: l.results,
|
|
315
|
+
/**
|
|
316
|
+
* @deprecated Use {@link objects} instead.
|
|
317
|
+
*/
|
|
318
|
+
get results() {
|
|
319
|
+
return console.warn(
|
|
320
|
+
"The `result` property is deprecated. Use `object` instead."
|
|
321
|
+
), this.objects;
|
|
322
|
+
},
|
|
238
323
|
/**
|
|
239
324
|
* A method to poll for new results.
|
|
240
325
|
*/
|
|
241
|
-
poll:
|
|
326
|
+
poll: p,
|
|
242
327
|
/**
|
|
243
|
-
* A boolean [
|
|
244
|
-
* that indicates if the poll is currently running.
|
|
328
|
+
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
329
|
+
* that indicates if the *first* poll is currently running.
|
|
245
330
|
* Useful to show a loading spinner or disable a button.
|
|
331
|
+
*
|
|
332
|
+
* This also tracks new polls when the arguments have changed,
|
|
333
|
+
* but it does not track ongoing polls from either calling
|
|
334
|
+
* {@link poll} or using the `autopoll` argument.
|
|
335
|
+
*/
|
|
336
|
+
isInitialPolling: u,
|
|
337
|
+
/**
|
|
338
|
+
* @deprecated Use {@link isInitialPolling} instead.
|
|
246
339
|
*/
|
|
247
|
-
isPolling
|
|
340
|
+
get isPolling() {
|
|
341
|
+
return console.warn(
|
|
342
|
+
"The `isPolling` property is deprecated. Use `isInitialPolling` instead."
|
|
343
|
+
), this.isInitialPolling;
|
|
344
|
+
}
|
|
248
345
|
};
|
|
249
346
|
}
|
|
250
|
-
const
|
|
347
|
+
const ce = /* @__PURE__ */ L({
|
|
251
348
|
__name: "Discover",
|
|
252
349
|
props: {
|
|
253
350
|
channels: {},
|
|
254
351
|
schema: {},
|
|
255
|
-
session: {}
|
|
352
|
+
session: {},
|
|
353
|
+
autopoll: { type: Boolean }
|
|
256
354
|
},
|
|
257
355
|
setup(t) {
|
|
258
|
-
const n = t, {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
356
|
+
const n = t, { objects: e, results: r, poll: o, isPolling: i, isInitialPolling: a } = Ee(
|
|
357
|
+
w(n, "channels"),
|
|
358
|
+
w(n, "schema"),
|
|
359
|
+
w(n, "session"),
|
|
360
|
+
w(n, "autopoll")
|
|
262
361
|
);
|
|
263
|
-
return (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
362
|
+
return (c, l) => W(c.$slots, "default", {
|
|
363
|
+
objects: m(e),
|
|
364
|
+
results: m(r),
|
|
365
|
+
poll: m(o),
|
|
366
|
+
isPolling: m(i),
|
|
367
|
+
isInitialPolling: m(a)
|
|
267
368
|
});
|
|
268
369
|
}
|
|
269
|
-
}),
|
|
370
|
+
}), le = /* @__PURE__ */ L({
|
|
270
371
|
__name: "Get",
|
|
271
372
|
props: {
|
|
272
373
|
url: {},
|
|
273
374
|
schema: {},
|
|
274
|
-
session: {}
|
|
375
|
+
session: {},
|
|
376
|
+
autopoll: { type: Boolean }
|
|
275
377
|
},
|
|
276
378
|
setup(t) {
|
|
277
|
-
const n = t, {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
379
|
+
const n = t, { object: e, result: r, poll: o, isPolling: i, isInitialPolling: a } = Se(
|
|
380
|
+
w(n, "url"),
|
|
381
|
+
w(n, "schema"),
|
|
382
|
+
w(n, "session"),
|
|
383
|
+
w(n, "autopoll")
|
|
281
384
|
);
|
|
282
|
-
return (
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
385
|
+
return (c, l) => W(c.$slots, "default", {
|
|
386
|
+
object: m(e),
|
|
387
|
+
result: m(r),
|
|
388
|
+
poll: m(o),
|
|
389
|
+
isPolling: m(i),
|
|
390
|
+
isInitialPolling: m(a)
|
|
286
391
|
});
|
|
287
392
|
}
|
|
288
|
-
}),
|
|
393
|
+
}), fe = /* @__PURE__ */ L({
|
|
289
394
|
__name: "RecoverOrphans",
|
|
290
395
|
props: {
|
|
291
396
|
schema: {},
|
|
292
|
-
session: {}
|
|
397
|
+
session: {},
|
|
398
|
+
autopoll: { type: Boolean }
|
|
293
399
|
},
|
|
294
400
|
setup(t) {
|
|
295
|
-
const n = t, {
|
|
296
|
-
|
|
297
|
-
|
|
401
|
+
const n = t, { objects: e, results: r, poll: o, isPolling: i, isInitialPolling: a } = Ge(
|
|
402
|
+
w(n, "schema"),
|
|
403
|
+
w(n, "session"),
|
|
404
|
+
w(n, "autopoll")
|
|
298
405
|
);
|
|
299
|
-
return (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
406
|
+
return (c, l) => W(c.$slots, "default", {
|
|
407
|
+
objects: m(e),
|
|
408
|
+
results: m(r),
|
|
409
|
+
poll: m(o),
|
|
410
|
+
isPolling: m(i),
|
|
411
|
+
isInitialPolling: m(a)
|
|
303
412
|
});
|
|
304
413
|
}
|
|
305
414
|
});
|
|
@@ -317,15 +426,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
317
426
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
318
427
|
PERFORMANCE OF THIS SOFTWARE.
|
|
319
428
|
***************************************************************************** */
|
|
320
|
-
var
|
|
321
|
-
return
|
|
429
|
+
var V = function(t, n) {
|
|
430
|
+
return V = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
322
431
|
e.__proto__ = r;
|
|
323
432
|
} || function(e, r) {
|
|
324
433
|
for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
|
|
325
|
-
},
|
|
434
|
+
}, V(t, n);
|
|
326
435
|
};
|
|
327
|
-
function
|
|
328
|
-
|
|
436
|
+
function _e(t, n) {
|
|
437
|
+
V(t, n);
|
|
329
438
|
function e() {
|
|
330
439
|
this.constructor = t;
|
|
331
440
|
}
|
|
@@ -333,45 +442,45 @@ function Ee(t, n) {
|
|
|
333
442
|
}
|
|
334
443
|
function G(t, n, e, r) {
|
|
335
444
|
function o(i) {
|
|
336
|
-
return i instanceof e ? i : new e(function(
|
|
337
|
-
|
|
445
|
+
return i instanceof e ? i : new e(function(a) {
|
|
446
|
+
a(i);
|
|
338
447
|
});
|
|
339
448
|
}
|
|
340
|
-
return new (e || (e = Promise))(function(i,
|
|
341
|
-
function
|
|
449
|
+
return new (e || (e = Promise))(function(i, a) {
|
|
450
|
+
function c(f) {
|
|
342
451
|
try {
|
|
343
452
|
s(r.next(f));
|
|
344
453
|
} catch (p) {
|
|
345
|
-
|
|
454
|
+
a(p);
|
|
346
455
|
}
|
|
347
456
|
}
|
|
348
|
-
function
|
|
457
|
+
function l(f) {
|
|
349
458
|
try {
|
|
350
459
|
s(r.throw(f));
|
|
351
460
|
} catch (p) {
|
|
352
|
-
|
|
461
|
+
a(p);
|
|
353
462
|
}
|
|
354
463
|
}
|
|
355
464
|
function s(f) {
|
|
356
|
-
f.done ? i(f.value) : o(f.value).then(
|
|
465
|
+
f.done ? i(f.value) : o(f.value).then(c, l);
|
|
357
466
|
}
|
|
358
467
|
s((r = r.apply(t, [])).next());
|
|
359
468
|
});
|
|
360
469
|
}
|
|
361
|
-
function
|
|
470
|
+
function j(t, n) {
|
|
362
471
|
var e = { label: 0, sent: function() {
|
|
363
472
|
if (i[0] & 1) throw i[1];
|
|
364
473
|
return i[1];
|
|
365
|
-
}, trys: [], ops: [] }, r, o, i,
|
|
366
|
-
return
|
|
474
|
+
}, trys: [], ops: [] }, r, o, i, a;
|
|
475
|
+
return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
|
|
367
476
|
return this;
|
|
368
|
-
}),
|
|
369
|
-
function
|
|
477
|
+
}), a;
|
|
478
|
+
function c(s) {
|
|
370
479
|
return function(f) {
|
|
371
|
-
return
|
|
480
|
+
return l([s, f]);
|
|
372
481
|
};
|
|
373
482
|
}
|
|
374
|
-
function
|
|
483
|
+
function l(s) {
|
|
375
484
|
if (r) throw new TypeError("Generator is already executing.");
|
|
376
485
|
for (; e; ) try {
|
|
377
486
|
if (r = 1, o && (i = s[0] & 2 ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
|
|
@@ -428,46 +537,46 @@ function _(t) {
|
|
|
428
537
|
};
|
|
429
538
|
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
430
539
|
}
|
|
431
|
-
function
|
|
432
|
-
return this instanceof
|
|
540
|
+
function T(t) {
|
|
541
|
+
return this instanceof T ? (this.v = t, this) : new T(t);
|
|
433
542
|
}
|
|
434
|
-
function
|
|
543
|
+
function Ie(t, n, e) {
|
|
435
544
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
436
545
|
var r = e.apply(t, n || []), o, i = [];
|
|
437
|
-
return o = {},
|
|
546
|
+
return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() {
|
|
438
547
|
return this;
|
|
439
548
|
}, o;
|
|
440
|
-
function u
|
|
441
|
-
r[
|
|
549
|
+
function a(u) {
|
|
550
|
+
r[u] && (o[u] = function(d) {
|
|
442
551
|
return new Promise(function(h, y) {
|
|
443
|
-
i.push([
|
|
552
|
+
i.push([u, d, h, y]) > 1 || c(u, d);
|
|
444
553
|
});
|
|
445
554
|
});
|
|
446
555
|
}
|
|
447
|
-
function
|
|
556
|
+
function c(u, d) {
|
|
448
557
|
try {
|
|
449
|
-
|
|
558
|
+
l(r[u](d));
|
|
450
559
|
} catch (h) {
|
|
451
560
|
p(i[0][3], h);
|
|
452
561
|
}
|
|
453
562
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
563
|
+
function l(u) {
|
|
564
|
+
u.value instanceof T ? Promise.resolve(u.value.v).then(s, f) : p(i[0][2], u);
|
|
456
565
|
}
|
|
457
|
-
function s(
|
|
458
|
-
|
|
566
|
+
function s(u) {
|
|
567
|
+
c("next", u);
|
|
459
568
|
}
|
|
460
|
-
function f(
|
|
461
|
-
|
|
569
|
+
function f(u) {
|
|
570
|
+
c("throw", u);
|
|
462
571
|
}
|
|
463
|
-
function p(
|
|
464
|
-
|
|
572
|
+
function p(u, d) {
|
|
573
|
+
u(d), i.shift(), i.length && c(i[0][0], i[0][1]);
|
|
465
574
|
}
|
|
466
575
|
}
|
|
467
|
-
var
|
|
576
|
+
var he = (
|
|
468
577
|
/** @class */
|
|
469
578
|
function(t) {
|
|
470
|
-
|
|
579
|
+
_e(n, t);
|
|
471
580
|
function n(e) {
|
|
472
581
|
var r = t.call(this, e) || this;
|
|
473
582
|
return Object.defineProperty(r, "name", {
|
|
@@ -560,12 +669,12 @@ var fe = (
|
|
|
560
669
|
return this._q.shift();
|
|
561
670
|
}, t;
|
|
562
671
|
})();
|
|
563
|
-
function
|
|
672
|
+
function C(t) {
|
|
564
673
|
t != null && typeof t.then == "function" && t.then(A, A);
|
|
565
674
|
}
|
|
566
|
-
var
|
|
675
|
+
var M = 0, H = 1, O = 2, q = 3, $ = 4, D = 1024, A = function() {
|
|
567
676
|
};
|
|
568
|
-
function
|
|
677
|
+
function E(t) {
|
|
569
678
|
var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
|
|
570
679
|
if (n != null)
|
|
571
680
|
throw n;
|
|
@@ -578,9 +687,9 @@ function S(t) {
|
|
|
578
687
|
});
|
|
579
688
|
}
|
|
580
689
|
function x(t, n) {
|
|
581
|
-
var e = t.state >=
|
|
690
|
+
var e = t.state >= q;
|
|
582
691
|
return Promise.resolve(n).then(function(r) {
|
|
583
|
-
return !e && t.state >=
|
|
692
|
+
return !e && t.state >= $ ? E(t).then(function(o) {
|
|
584
693
|
return {
|
|
585
694
|
value: o,
|
|
586
695
|
done: !0
|
|
@@ -592,15 +701,15 @@ function K(t, n) {
|
|
|
592
701
|
var e, r;
|
|
593
702
|
if (!(t.state >= O))
|
|
594
703
|
if (t.state = O, t.onnext(), t.onstop(), t.err == null && (t.err = n), t.pushes.length === 0 && (typeof t.buffer > "u" || t.buffer.empty))
|
|
595
|
-
|
|
704
|
+
I(t);
|
|
596
705
|
else
|
|
597
706
|
try {
|
|
598
707
|
for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
|
|
599
|
-
var
|
|
600
|
-
|
|
708
|
+
var a = i.value;
|
|
709
|
+
a.resolve();
|
|
601
710
|
}
|
|
602
|
-
} catch (
|
|
603
|
-
e = { error:
|
|
711
|
+
} catch (c) {
|
|
712
|
+
e = { error: c };
|
|
604
713
|
} finally {
|
|
605
714
|
try {
|
|
606
715
|
i && !i.done && (r = o.return) && r.call(o);
|
|
@@ -609,19 +718,19 @@ function K(t, n) {
|
|
|
609
718
|
}
|
|
610
719
|
}
|
|
611
720
|
}
|
|
612
|
-
function
|
|
721
|
+
function I(t) {
|
|
613
722
|
var n, e;
|
|
614
|
-
if (!(t.state >=
|
|
615
|
-
t.state < O && K(t), t.state =
|
|
723
|
+
if (!(t.state >= q)) {
|
|
724
|
+
t.state < O && K(t), t.state = q, t.buffer = void 0;
|
|
616
725
|
try {
|
|
617
726
|
for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
|
|
618
|
-
var i = o.value,
|
|
619
|
-
return
|
|
727
|
+
var i = o.value, a = t.pending === void 0 ? E(t) : t.pending.then(function() {
|
|
728
|
+
return E(t);
|
|
620
729
|
});
|
|
621
|
-
i.resolve(x(t,
|
|
730
|
+
i.resolve(x(t, a));
|
|
622
731
|
}
|
|
623
|
-
} catch (
|
|
624
|
-
n = { error:
|
|
732
|
+
} catch (c) {
|
|
733
|
+
n = { error: c };
|
|
625
734
|
} finally {
|
|
626
735
|
try {
|
|
627
736
|
o && !o.done && (e = r.return) && e.call(r);
|
|
@@ -633,41 +742,41 @@ function R(t) {
|
|
|
633
742
|
}
|
|
634
743
|
}
|
|
635
744
|
function Q(t) {
|
|
636
|
-
t.state >=
|
|
745
|
+
t.state >= $ || (t.state < q && I(t), t.state = $);
|
|
637
746
|
}
|
|
638
|
-
function
|
|
639
|
-
if (
|
|
640
|
-
throw new
|
|
747
|
+
function Te(t, n) {
|
|
748
|
+
if (C(n), t.pushes.length >= D)
|
|
749
|
+
throw new he("No more than " + D + " pending calls to push are allowed on a single repeater.");
|
|
641
750
|
if (t.state >= O)
|
|
642
751
|
return Promise.resolve(void 0);
|
|
643
752
|
var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
|
|
644
753
|
return n;
|
|
645
754
|
});
|
|
646
|
-
e = e.catch(function(
|
|
647
|
-
t.state < O && (t.err =
|
|
755
|
+
e = e.catch(function(l) {
|
|
756
|
+
t.state < O && (t.err = l), Q(t);
|
|
648
757
|
});
|
|
649
758
|
var r;
|
|
650
759
|
if (t.nexts.length) {
|
|
651
760
|
var o = t.nexts.shift();
|
|
652
|
-
o.resolve(x(t, e)), t.nexts.length ? r = Promise.resolve(t.nexts[0].value) : typeof t.buffer < "u" && !t.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(
|
|
653
|
-
return t.onnext =
|
|
761
|
+
o.resolve(x(t, e)), t.nexts.length ? r = Promise.resolve(t.nexts[0].value) : typeof t.buffer < "u" && !t.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(l) {
|
|
762
|
+
return t.onnext = l;
|
|
654
763
|
});
|
|
655
|
-
} else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(
|
|
656
|
-
return t.pushes.push({ resolve:
|
|
764
|
+
} else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(l) {
|
|
765
|
+
return t.pushes.push({ resolve: l, value: e });
|
|
657
766
|
});
|
|
658
|
-
var i = !0,
|
|
767
|
+
var i = !0, a = {}, c = r.catch(function(l) {
|
|
659
768
|
if (i)
|
|
660
|
-
throw
|
|
769
|
+
throw l;
|
|
661
770
|
});
|
|
662
|
-
return
|
|
663
|
-
return i = !1, Promise.prototype.then.call(r,
|
|
664
|
-
},
|
|
665
|
-
return i = !1, Promise.prototype.catch.call(r,
|
|
666
|
-
},
|
|
667
|
-
return
|
|
668
|
-
}).catch(function(
|
|
669
|
-
t.err =
|
|
670
|
-
}),
|
|
771
|
+
return a.then = function(l, s) {
|
|
772
|
+
return i = !1, Promise.prototype.then.call(r, l, s);
|
|
773
|
+
}, a.catch = function(l) {
|
|
774
|
+
return i = !1, Promise.prototype.catch.call(r, l);
|
|
775
|
+
}, a.finally = r.finally.bind(r), t.pending = e.then(function() {
|
|
776
|
+
return c;
|
|
777
|
+
}).catch(function(l) {
|
|
778
|
+
t.err = l, Q(t);
|
|
779
|
+
}), a;
|
|
671
780
|
}
|
|
672
781
|
function Re(t) {
|
|
673
782
|
var n = K.bind(null, t), e = new Promise(function(r) {
|
|
@@ -678,7 +787,7 @@ function Re(t) {
|
|
|
678
787
|
function ze(t) {
|
|
679
788
|
if (!(t.state >= H)) {
|
|
680
789
|
t.state = H;
|
|
681
|
-
var n =
|
|
790
|
+
var n = Te.bind(null, t), e = Re(t);
|
|
682
791
|
t.execution = new Promise(function(r) {
|
|
683
792
|
return r(t.executor(n, e));
|
|
684
793
|
}), t.execution.catch(function() {
|
|
@@ -686,15 +795,15 @@ function ze(t) {
|
|
|
686
795
|
});
|
|
687
796
|
}
|
|
688
797
|
}
|
|
689
|
-
var
|
|
798
|
+
var F = /* @__PURE__ */ new WeakMap(), R = (
|
|
690
799
|
/** @class */
|
|
691
800
|
function() {
|
|
692
801
|
function t(n, e) {
|
|
693
|
-
|
|
802
|
+
F.set(this, {
|
|
694
803
|
executor: n,
|
|
695
804
|
buffer: e,
|
|
696
805
|
err: void 0,
|
|
697
|
-
state:
|
|
806
|
+
state: M,
|
|
698
807
|
pushes: [],
|
|
699
808
|
nexts: [],
|
|
700
809
|
pending: void 0,
|
|
@@ -704,13 +813,13 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
|
|
|
704
813
|
});
|
|
705
814
|
}
|
|
706
815
|
return t.prototype.next = function(n) {
|
|
707
|
-
|
|
708
|
-
var e =
|
|
816
|
+
C(n);
|
|
817
|
+
var e = F.get(this);
|
|
709
818
|
if (e === void 0)
|
|
710
819
|
throw new Error("WeakMap error");
|
|
711
|
-
if (e.nexts.length >=
|
|
712
|
-
throw new
|
|
713
|
-
if (e.state <=
|
|
820
|
+
if (e.nexts.length >= D)
|
|
821
|
+
throw new he("No more than " + D + " pending calls to next are allowed on a single repeater.");
|
|
822
|
+
if (e.state <= M && ze(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
|
|
714
823
|
var r = x(e, e.buffer.remove());
|
|
715
824
|
if (e.pushes.length) {
|
|
716
825
|
var o = e.pushes.shift();
|
|
@@ -721,44 +830,44 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
|
|
|
721
830
|
var i = e.pushes.shift();
|
|
722
831
|
return e.onnext = i.resolve, x(e, i.value);
|
|
723
832
|
} else if (e.state >= O)
|
|
724
|
-
return
|
|
725
|
-
return new Promise(function(
|
|
726
|
-
return e.nexts.push({ resolve:
|
|
833
|
+
return I(e), x(e, E(e));
|
|
834
|
+
return new Promise(function(a) {
|
|
835
|
+
return e.nexts.push({ resolve: a, value: n });
|
|
727
836
|
});
|
|
728
837
|
}, t.prototype.return = function(n) {
|
|
729
|
-
|
|
730
|
-
var e =
|
|
838
|
+
C(n);
|
|
839
|
+
var e = F.get(this);
|
|
731
840
|
if (e === void 0)
|
|
732
841
|
throw new Error("WeakMap error");
|
|
733
|
-
return
|
|
842
|
+
return I(e), e.execution = Promise.resolve(e.execution).then(function() {
|
|
734
843
|
return n;
|
|
735
|
-
}), x(e,
|
|
844
|
+
}), x(e, E(e));
|
|
736
845
|
}, t.prototype.throw = function(n) {
|
|
737
|
-
var e =
|
|
846
|
+
var e = F.get(this);
|
|
738
847
|
if (e === void 0)
|
|
739
848
|
throw new Error("WeakMap error");
|
|
740
|
-
return e.state <=
|
|
849
|
+
return e.state <= M || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (I(e), e.err == null && (e.err = n), x(e, E(e))) : this.next(Promise.reject(n));
|
|
741
850
|
}, t.prototype[Symbol.asyncIterator] = function() {
|
|
742
851
|
return this;
|
|
743
|
-
}, t.race = ke, t.merge =
|
|
852
|
+
}, t.race = ke, t.merge = Fe, t.zip = qe, t.latest = De, t;
|
|
744
853
|
}()
|
|
745
854
|
);
|
|
746
|
-
function
|
|
855
|
+
function N(t, n) {
|
|
747
856
|
var e, r, o = [], i = function(s) {
|
|
748
857
|
s != null && typeof s[Symbol.asyncIterator] == "function" ? o.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? o.push(s[Symbol.iterator]()) : o.push(function() {
|
|
749
|
-
return
|
|
750
|
-
return
|
|
751
|
-
switch (
|
|
858
|
+
return Ie(this, arguments, function() {
|
|
859
|
+
return j(this, function(u) {
|
|
860
|
+
switch (u.label) {
|
|
752
861
|
case 0:
|
|
753
|
-
return n.yieldValues ? [4,
|
|
862
|
+
return n.yieldValues ? [4, T(s)] : [3, 3];
|
|
754
863
|
case 1:
|
|
755
|
-
return [4,
|
|
864
|
+
return [4, u.sent()];
|
|
756
865
|
case 2:
|
|
757
|
-
|
|
866
|
+
u.sent(), u.label = 3;
|
|
758
867
|
case 3:
|
|
759
|
-
return n.returnValues ? [4,
|
|
868
|
+
return n.returnValues ? [4, T(s)] : [3, 5];
|
|
760
869
|
case 4:
|
|
761
|
-
return [2,
|
|
870
|
+
return [2, u.sent()];
|
|
762
871
|
case 5:
|
|
763
872
|
return [
|
|
764
873
|
2
|
|
@@ -770,15 +879,15 @@ function V(t, n) {
|
|
|
770
879
|
}());
|
|
771
880
|
};
|
|
772
881
|
try {
|
|
773
|
-
for (var
|
|
774
|
-
var
|
|
775
|
-
i(
|
|
882
|
+
for (var a = _(t), c = a.next(); !c.done; c = a.next()) {
|
|
883
|
+
var l = c.value;
|
|
884
|
+
i(l);
|
|
776
885
|
}
|
|
777
886
|
} catch (s) {
|
|
778
887
|
e = { error: s };
|
|
779
888
|
} finally {
|
|
780
889
|
try {
|
|
781
|
-
|
|
890
|
+
c && !c.done && (r = a.return) && r.call(a);
|
|
782
891
|
} finally {
|
|
783
892
|
if (e) throw e.error;
|
|
784
893
|
}
|
|
@@ -786,11 +895,11 @@ function V(t, n) {
|
|
|
786
895
|
return o;
|
|
787
896
|
}
|
|
788
897
|
function ke(t) {
|
|
789
|
-
var n = this, e =
|
|
790
|
-
return new
|
|
898
|
+
var n = this, e = N(t, { returnValues: !0 });
|
|
899
|
+
return new R(function(r, o) {
|
|
791
900
|
return G(n, void 0, void 0, function() {
|
|
792
|
-
var i,
|
|
793
|
-
return
|
|
901
|
+
var i, a, c, l, s, f;
|
|
902
|
+
return j(this, function(p) {
|
|
794
903
|
switch (p.label) {
|
|
795
904
|
case 0:
|
|
796
905
|
if (!e.length)
|
|
@@ -798,39 +907,39 @@ function ke(t) {
|
|
|
798
907
|
2
|
|
799
908
|
/*return*/
|
|
800
909
|
];
|
|
801
|
-
|
|
802
|
-
i(),
|
|
910
|
+
a = !1, o.then(function() {
|
|
911
|
+
i(), a = !0;
|
|
803
912
|
}), p.label = 1;
|
|
804
913
|
case 1:
|
|
805
|
-
p.trys.push([1, , 5, 7]),
|
|
806
|
-
var
|
|
807
|
-
return
|
|
808
|
-
switch (
|
|
914
|
+
p.trys.push([1, , 5, 7]), l = void 0, s = 0, f = function() {
|
|
915
|
+
var u, d, h, y, b, z;
|
|
916
|
+
return j(this, function(k) {
|
|
917
|
+
switch (k.label) {
|
|
809
918
|
case 0:
|
|
810
|
-
|
|
919
|
+
u = s;
|
|
811
920
|
try {
|
|
812
|
-
for (d = (
|
|
813
|
-
y = h.value, Promise.resolve(y.next()).then(function(
|
|
814
|
-
|
|
815
|
-
}, function(
|
|
816
|
-
return o(
|
|
921
|
+
for (d = (b = void 0, _(e)), h = d.next(); !h.done; h = d.next())
|
|
922
|
+
y = h.value, Promise.resolve(y.next()).then(function(g) {
|
|
923
|
+
g.done ? (o(), c === void 0 && (c = g)) : s === u && (s++, i(g));
|
|
924
|
+
}, function(g) {
|
|
925
|
+
return o(g);
|
|
817
926
|
});
|
|
818
|
-
} catch (
|
|
819
|
-
|
|
927
|
+
} catch (g) {
|
|
928
|
+
b = { error: g };
|
|
820
929
|
} finally {
|
|
821
930
|
try {
|
|
822
|
-
h && !h.done && (
|
|
931
|
+
h && !h.done && (z = d.return) && z.call(d);
|
|
823
932
|
} finally {
|
|
824
|
-
if (
|
|
933
|
+
if (b) throw b.error;
|
|
825
934
|
}
|
|
826
935
|
}
|
|
827
|
-
return [4, new Promise(function(
|
|
828
|
-
return i =
|
|
936
|
+
return [4, new Promise(function(g) {
|
|
937
|
+
return i = g;
|
|
829
938
|
})];
|
|
830
939
|
case 1:
|
|
831
|
-
return
|
|
940
|
+
return l = k.sent(), l === void 0 ? [3, 3] : [4, r(l.value)];
|
|
832
941
|
case 2:
|
|
833
|
-
|
|
942
|
+
k.sent(), k.label = 3;
|
|
834
943
|
case 3:
|
|
835
944
|
return [
|
|
836
945
|
2
|
|
@@ -840,14 +949,14 @@ function ke(t) {
|
|
|
840
949
|
});
|
|
841
950
|
}, p.label = 2;
|
|
842
951
|
case 2:
|
|
843
|
-
return
|
|
952
|
+
return a ? [3, 4] : [5, f()];
|
|
844
953
|
case 3:
|
|
845
954
|
return p.sent(), [3, 2];
|
|
846
955
|
case 4:
|
|
847
|
-
return [2,
|
|
956
|
+
return [2, c && c.value];
|
|
848
957
|
case 5:
|
|
849
|
-
return o(), [4, Promise.race(e.map(function(
|
|
850
|
-
return
|
|
958
|
+
return o(), [4, Promise.race(e.map(function(u) {
|
|
959
|
+
return u.return && u.return();
|
|
851
960
|
}))];
|
|
852
961
|
case 6:
|
|
853
962
|
return p.sent(), [
|
|
@@ -864,12 +973,12 @@ function ke(t) {
|
|
|
864
973
|
});
|
|
865
974
|
});
|
|
866
975
|
}
|
|
867
|
-
function
|
|
868
|
-
var n = this, e =
|
|
869
|
-
return new
|
|
976
|
+
function Fe(t) {
|
|
977
|
+
var n = this, e = N(t, { yieldValues: !0 });
|
|
978
|
+
return new R(function(r, o) {
|
|
870
979
|
return G(n, void 0, void 0, function() {
|
|
871
|
-
var i,
|
|
872
|
-
return
|
|
980
|
+
var i, a, c, l = this;
|
|
981
|
+
return j(this, function(s) {
|
|
873
982
|
switch (s.label) {
|
|
874
983
|
case 0:
|
|
875
984
|
if (!e.length)
|
|
@@ -877,11 +986,11 @@ function Te(t) {
|
|
|
877
986
|
2
|
|
878
987
|
/*return*/
|
|
879
988
|
];
|
|
880
|
-
i = [],
|
|
989
|
+
i = [], a = !1, o.then(function() {
|
|
881
990
|
var f, p;
|
|
882
|
-
|
|
991
|
+
a = !0;
|
|
883
992
|
try {
|
|
884
|
-
for (var
|
|
993
|
+
for (var u = _(i), d = u.next(); !d.done; d = u.next()) {
|
|
885
994
|
var h = d.value;
|
|
886
995
|
h();
|
|
887
996
|
}
|
|
@@ -889,7 +998,7 @@ function Te(t) {
|
|
|
889
998
|
f = { error: y };
|
|
890
999
|
} finally {
|
|
891
1000
|
try {
|
|
892
|
-
d && !d.done && (p =
|
|
1001
|
+
d && !d.done && (p = u.return) && p.call(u);
|
|
893
1002
|
} finally {
|
|
894
1003
|
if (f) throw f.error;
|
|
895
1004
|
}
|
|
@@ -897,14 +1006,14 @@ function Te(t) {
|
|
|
897
1006
|
}), s.label = 1;
|
|
898
1007
|
case 1:
|
|
899
1008
|
return s.trys.push([1, , 3, 4]), [4, Promise.all(e.map(function(f, p) {
|
|
900
|
-
return G(
|
|
901
|
-
var
|
|
902
|
-
return
|
|
1009
|
+
return G(l, void 0, void 0, function() {
|
|
1010
|
+
var u, d;
|
|
1011
|
+
return j(this, function(h) {
|
|
903
1012
|
switch (h.label) {
|
|
904
1013
|
case 0:
|
|
905
1014
|
h.trys.push([0, , 6, 9]), h.label = 1;
|
|
906
1015
|
case 1:
|
|
907
|
-
return
|
|
1016
|
+
return a ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
|
|
908
1017
|
return i[p](y);
|
|
909
1018
|
}, function(y) {
|
|
910
1019
|
return o(y);
|
|
@@ -912,10 +1021,10 @@ function Te(t) {
|
|
|
912
1021
|
i[p] = y;
|
|
913
1022
|
})]);
|
|
914
1023
|
case 2:
|
|
915
|
-
return
|
|
1024
|
+
return u = h.sent(), u === void 0 ? [3, 4] : u.done ? (c = u, [
|
|
916
1025
|
2
|
|
917
1026
|
/*return*/
|
|
918
|
-
]) : [4, r(
|
|
1027
|
+
]) : [4, r(u.value)];
|
|
919
1028
|
case 3:
|
|
920
1029
|
h.sent(), h.label = 4;
|
|
921
1030
|
case 4:
|
|
@@ -941,7 +1050,7 @@ function Te(t) {
|
|
|
941
1050
|
});
|
|
942
1051
|
}))];
|
|
943
1052
|
case 2:
|
|
944
|
-
return s.sent(), [2,
|
|
1053
|
+
return s.sent(), [2, c && c.value];
|
|
945
1054
|
case 3:
|
|
946
1055
|
return o(), [
|
|
947
1056
|
7
|
|
@@ -958,22 +1067,22 @@ function Te(t) {
|
|
|
958
1067
|
});
|
|
959
1068
|
}
|
|
960
1069
|
function qe(t) {
|
|
961
|
-
var n = this, e =
|
|
962
|
-
return new
|
|
1070
|
+
var n = this, e = N(t, { returnValues: !0 });
|
|
1071
|
+
return new R(function(r, o) {
|
|
963
1072
|
return G(n, void 0, void 0, function() {
|
|
964
|
-
var i,
|
|
965
|
-
return
|
|
1073
|
+
var i, a, c, l;
|
|
1074
|
+
return j(this, function(s) {
|
|
966
1075
|
switch (s.label) {
|
|
967
1076
|
case 0:
|
|
968
1077
|
if (!e.length)
|
|
969
1078
|
return o(), [2, []];
|
|
970
|
-
|
|
971
|
-
i(),
|
|
1079
|
+
a = !1, o.then(function() {
|
|
1080
|
+
i(), a = !0;
|
|
972
1081
|
}), s.label = 1;
|
|
973
1082
|
case 1:
|
|
974
1083
|
s.trys.push([1, , 6, 8]), s.label = 2;
|
|
975
1084
|
case 2:
|
|
976
|
-
return
|
|
1085
|
+
return a ? [3, 5] : (Promise.all(e.map(function(f) {
|
|
977
1086
|
return f.next();
|
|
978
1087
|
})).then(function(f) {
|
|
979
1088
|
return i(f);
|
|
@@ -983,14 +1092,14 @@ function qe(t) {
|
|
|
983
1092
|
return i = f;
|
|
984
1093
|
})]);
|
|
985
1094
|
case 3:
|
|
986
|
-
return
|
|
1095
|
+
return c = s.sent(), c === void 0 ? [
|
|
987
1096
|
2
|
|
988
1097
|
/*return*/
|
|
989
|
-
] : (
|
|
1098
|
+
] : (l = c.map(function(f) {
|
|
990
1099
|
return f.value;
|
|
991
|
-
}),
|
|
1100
|
+
}), c.some(function(f) {
|
|
992
1101
|
return f.done;
|
|
993
|
-
}) ? [2,
|
|
1102
|
+
}) ? [2, l] : [4, r(l)]);
|
|
994
1103
|
case 4:
|
|
995
1104
|
return s.sent(), [3, 2];
|
|
996
1105
|
case 5:
|
|
@@ -1015,76 +1124,76 @@ function qe(t) {
|
|
|
1015
1124
|
});
|
|
1016
1125
|
}
|
|
1017
1126
|
function De(t) {
|
|
1018
|
-
var n = this, e =
|
|
1127
|
+
var n = this, e = N(t, {
|
|
1019
1128
|
yieldValues: !0,
|
|
1020
1129
|
returnValues: !0
|
|
1021
1130
|
});
|
|
1022
|
-
return new
|
|
1131
|
+
return new R(function(r, o) {
|
|
1023
1132
|
return G(n, void 0, void 0, function() {
|
|
1024
|
-
var i,
|
|
1025
|
-
return
|
|
1133
|
+
var i, a, c, l, s, f = this;
|
|
1134
|
+
return j(this, function(p) {
|
|
1026
1135
|
switch (p.label) {
|
|
1027
1136
|
case 0:
|
|
1028
1137
|
if (!e.length)
|
|
1029
1138
|
return o(), [2, []];
|
|
1030
|
-
|
|
1031
|
-
var
|
|
1139
|
+
a = [], c = !1, o.then(function() {
|
|
1140
|
+
var u, d;
|
|
1032
1141
|
i();
|
|
1033
1142
|
try {
|
|
1034
|
-
for (var h = _(
|
|
1035
|
-
var
|
|
1036
|
-
|
|
1143
|
+
for (var h = _(a), y = h.next(); !y.done; y = h.next()) {
|
|
1144
|
+
var b = y.value;
|
|
1145
|
+
b();
|
|
1037
1146
|
}
|
|
1038
|
-
} catch (
|
|
1039
|
-
|
|
1147
|
+
} catch (z) {
|
|
1148
|
+
u = { error: z };
|
|
1040
1149
|
} finally {
|
|
1041
1150
|
try {
|
|
1042
1151
|
y && !y.done && (d = h.return) && d.call(h);
|
|
1043
1152
|
} finally {
|
|
1044
|
-
if (
|
|
1153
|
+
if (u) throw u.error;
|
|
1045
1154
|
}
|
|
1046
1155
|
}
|
|
1047
|
-
|
|
1156
|
+
c = !0;
|
|
1048
1157
|
}), p.label = 1;
|
|
1049
1158
|
case 1:
|
|
1050
|
-
return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(
|
|
1051
|
-
return
|
|
1052
|
-
})).then(function(
|
|
1053
|
-
return i(
|
|
1054
|
-
}, function(
|
|
1055
|
-
return o(
|
|
1056
|
-
}), [4, new Promise(function(
|
|
1057
|
-
return i =
|
|
1159
|
+
return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(u) {
|
|
1160
|
+
return u.next();
|
|
1161
|
+
})).then(function(u) {
|
|
1162
|
+
return i(u);
|
|
1163
|
+
}, function(u) {
|
|
1164
|
+
return o(u);
|
|
1165
|
+
}), [4, new Promise(function(u) {
|
|
1166
|
+
return i = u;
|
|
1058
1167
|
})];
|
|
1059
1168
|
case 2:
|
|
1060
|
-
return
|
|
1169
|
+
return l = p.sent(), l === void 0 ? [
|
|
1061
1170
|
2
|
|
1062
1171
|
/*return*/
|
|
1063
|
-
] : (s =
|
|
1064
|
-
return
|
|
1065
|
-
}),
|
|
1066
|
-
return
|
|
1172
|
+
] : (s = l.map(function(u) {
|
|
1173
|
+
return u.value;
|
|
1174
|
+
}), l.every(function(u) {
|
|
1175
|
+
return u.done;
|
|
1067
1176
|
}) ? [2, s] : [4, r(s.slice())]);
|
|
1068
1177
|
case 3:
|
|
1069
|
-
return p.sent(), [4, Promise.all(e.map(function(
|
|
1178
|
+
return p.sent(), [4, Promise.all(e.map(function(u, d) {
|
|
1070
1179
|
return G(f, void 0, void 0, function() {
|
|
1071
1180
|
var h;
|
|
1072
|
-
return
|
|
1181
|
+
return j(this, function(y) {
|
|
1073
1182
|
switch (y.label) {
|
|
1074
1183
|
case 0:
|
|
1075
|
-
if (
|
|
1076
|
-
return [2,
|
|
1184
|
+
if (l[d].done)
|
|
1185
|
+
return [2, l[d].value];
|
|
1077
1186
|
y.label = 1;
|
|
1078
1187
|
case 1:
|
|
1079
|
-
return
|
|
1080
|
-
return
|
|
1081
|
-
}, function(
|
|
1082
|
-
return o(
|
|
1083
|
-
}), [4, new Promise(function(
|
|
1084
|
-
return
|
|
1188
|
+
return c ? [3, 4] : (Promise.resolve(u.next()).then(function(b) {
|
|
1189
|
+
return a[d](b);
|
|
1190
|
+
}, function(b) {
|
|
1191
|
+
return o(b);
|
|
1192
|
+
}), [4, new Promise(function(b) {
|
|
1193
|
+
return a[d] = b;
|
|
1085
1194
|
})]);
|
|
1086
1195
|
case 2:
|
|
1087
|
-
return h = y.sent(), h === void 0 ? [2,
|
|
1196
|
+
return h = y.sent(), h === void 0 ? [2, l[d].value] : h.done ? [2, h.value] : (s[d] = h.value, [4, r(s.slice())]);
|
|
1088
1197
|
case 3:
|
|
1089
1198
|
return y.sent(), [3, 1];
|
|
1090
1199
|
case 4:
|
|
@@ -1099,8 +1208,8 @@ function De(t) {
|
|
|
1099
1208
|
case 4:
|
|
1100
1209
|
return [2, p.sent()];
|
|
1101
1210
|
case 5:
|
|
1102
|
-
return o(), [4, Promise.all(e.map(function(
|
|
1103
|
-
return
|
|
1211
|
+
return o(), [4, Promise.all(e.map(function(u) {
|
|
1212
|
+
return u.return && u.return();
|
|
1104
1213
|
}))];
|
|
1105
1214
|
case 6:
|
|
1106
1215
|
return p.sent(), [
|
|
@@ -1117,36 +1226,36 @@ function De(t) {
|
|
|
1117
1226
|
});
|
|
1118
1227
|
});
|
|
1119
1228
|
}
|
|
1120
|
-
function
|
|
1229
|
+
function Ae(t) {
|
|
1121
1230
|
return typeof t == "string" ? t : t.url;
|
|
1122
1231
|
}
|
|
1123
|
-
function
|
|
1232
|
+
function Ue(t, n, e, r) {
|
|
1124
1233
|
const o = e[n];
|
|
1125
1234
|
if (!(!o || !o.length))
|
|
1126
1235
|
try {
|
|
1127
1236
|
r[n] = t(r[n], o, !0, !1).newDocument;
|
|
1128
1237
|
} catch (i) {
|
|
1129
|
-
throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new
|
|
1238
|
+
throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new Pe(i.message) : new je(i.name + ": " + i.message) : i;
|
|
1130
1239
|
}
|
|
1131
1240
|
}
|
|
1132
|
-
function
|
|
1241
|
+
function Be(t, n) {
|
|
1133
1242
|
try {
|
|
1134
1243
|
return t.compile(n);
|
|
1135
1244
|
} catch (e) {
|
|
1136
|
-
throw new
|
|
1245
|
+
throw new ge(
|
|
1137
1246
|
e instanceof Error ? e.message : void 0
|
|
1138
1247
|
);
|
|
1139
1248
|
}
|
|
1140
1249
|
}
|
|
1141
|
-
function
|
|
1250
|
+
function Ne(t, n, e) {
|
|
1142
1251
|
t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
|
|
1143
1252
|
(r) => n.includes(r)
|
|
1144
1253
|
));
|
|
1145
1254
|
}
|
|
1146
|
-
function
|
|
1255
|
+
function Me(t, n) {
|
|
1147
1256
|
return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
|
|
1148
1257
|
}
|
|
1149
|
-
class Ve extends
|
|
1258
|
+
class Ve extends be {
|
|
1150
1259
|
/**
|
|
1151
1260
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1152
1261
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
@@ -1188,7 +1297,7 @@ class Ve extends me {
|
|
|
1188
1297
|
v(this, "patch", async (...e) => {
|
|
1189
1298
|
const r = await this.graffiti.patch(...e), o = { ...r };
|
|
1190
1299
|
for (const i of ["value", "channels", "allowed"])
|
|
1191
|
-
|
|
1300
|
+
Ue(await this.applyPatch, i, e[0], o);
|
|
1192
1301
|
return await this.synchronizeDispatch(
|
|
1193
1302
|
{
|
|
1194
1303
|
tombstone: !0,
|
|
@@ -1235,17 +1344,17 @@ class Ve extends me {
|
|
|
1235
1344
|
})()), this.applyPatch_;
|
|
1236
1345
|
}
|
|
1237
1346
|
synchronize(e, r, o, i) {
|
|
1238
|
-
const
|
|
1239
|
-
return new
|
|
1240
|
-
async (
|
|
1241
|
-
const f =
|
|
1242
|
-
for (const h of [d,
|
|
1347
|
+
const a = /* @__PURE__ */ new Set();
|
|
1348
|
+
return new R(
|
|
1349
|
+
async (l, s) => {
|
|
1350
|
+
const f = Be(await this.ajv, o), p = (u, d) => {
|
|
1351
|
+
for (const h of [d, u])
|
|
1243
1352
|
if (h != null && h.tombstone)
|
|
1244
|
-
|
|
1245
|
-
else if (h && e(h.object) && (this.options.omniscient ||
|
|
1353
|
+
a.has(h.object.url) && l(h);
|
|
1354
|
+
else if (h && e(h.object) && (this.options.omniscient || Me(h.object, i))) {
|
|
1246
1355
|
const y = { ...h.object };
|
|
1247
|
-
if (this.options.omniscient ||
|
|
1248
|
-
|
|
1356
|
+
if (this.options.omniscient || Ne(y, r, i), f(y)) {
|
|
1357
|
+
l({ object: y }), a.add(y.url);
|
|
1249
1358
|
break;
|
|
1250
1359
|
}
|
|
1251
1360
|
}
|
|
@@ -1269,10 +1378,10 @@ class Ve extends me {
|
|
|
1269
1378
|
*/
|
|
1270
1379
|
synchronizeDiscover(...e) {
|
|
1271
1380
|
const [r, o, i] = e;
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1381
|
+
function a(c) {
|
|
1382
|
+
return c.channels.some((l) => r.includes(l));
|
|
1274
1383
|
}
|
|
1275
|
-
return this.synchronize(
|
|
1384
|
+
return this.synchronize(a, r, o, i);
|
|
1276
1385
|
}
|
|
1277
1386
|
/**
|
|
1278
1387
|
* This method has the same signature as {@link get} but
|
|
@@ -1287,11 +1396,11 @@ class Ve extends me {
|
|
|
1287
1396
|
* @group Synchronize Methods
|
|
1288
1397
|
*/
|
|
1289
1398
|
synchronizeGet(...e) {
|
|
1290
|
-
const [r, o, i] = e,
|
|
1291
|
-
function l
|
|
1292
|
-
return
|
|
1399
|
+
const [r, o, i] = e, a = Ae(r);
|
|
1400
|
+
function c(l) {
|
|
1401
|
+
return l.url === a;
|
|
1293
1402
|
}
|
|
1294
|
-
return this.synchronize(
|
|
1403
|
+
return this.synchronize(c, [], o, i);
|
|
1295
1404
|
}
|
|
1296
1405
|
/**
|
|
1297
1406
|
* This method has the same signature as {@link recoverOrphans} but
|
|
@@ -1308,8 +1417,8 @@ class Ve extends me {
|
|
|
1308
1417
|
*/
|
|
1309
1418
|
synchronizeRecoverOrphans(...e) {
|
|
1310
1419
|
const [r, o] = e;
|
|
1311
|
-
function i(
|
|
1312
|
-
return
|
|
1420
|
+
function i(a) {
|
|
1421
|
+
return a.actor === o.actor && a.channels.length === 0;
|
|
1313
1422
|
}
|
|
1314
1423
|
return this.synchronize(i, [], r, o);
|
|
1315
1424
|
}
|
|
@@ -1337,10 +1446,10 @@ class Ve extends me {
|
|
|
1337
1446
|
for (; ; ) {
|
|
1338
1447
|
const o = await e.next();
|
|
1339
1448
|
if (o.done) {
|
|
1340
|
-
const { continue: i, cursor:
|
|
1449
|
+
const { continue: i, cursor: a } = o.value;
|
|
1341
1450
|
return {
|
|
1342
1451
|
continue: () => r.objectStreamContinue(i()),
|
|
1343
|
-
cursor:
|
|
1452
|
+
cursor: a
|
|
1344
1453
|
};
|
|
1345
1454
|
}
|
|
1346
1455
|
o.value.error || r.synchronizeDispatch(
|
|
@@ -1360,42 +1469,42 @@ class Ve extends me {
|
|
|
1360
1469
|
}();
|
|
1361
1470
|
}
|
|
1362
1471
|
}
|
|
1363
|
-
const
|
|
1472
|
+
const We = {
|
|
1364
1473
|
install(t, n) {
|
|
1365
|
-
const e = n.graffiti, r = new Ve(e), o =
|
|
1474
|
+
const e = n.graffiti, r = new Ve(e), o = U(void 0);
|
|
1366
1475
|
r.sessionEvents.addEventListener("initialized", async (i) => {
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1371
|
-
const
|
|
1372
|
-
s.pathname.startsWith(
|
|
1476
|
+
const a = i.detail;
|
|
1477
|
+
if (a && a.error && console.error(a.error), a && a.href) {
|
|
1478
|
+
const c = t.config.globalProperties.$router;
|
|
1479
|
+
if (c) {
|
|
1480
|
+
const l = c.options.history.base, s = new URL(a.href);
|
|
1481
|
+
s.pathname.startsWith(l) && (s.pathname = s.pathname.slice(l.length)), await c.replace(s.pathname + s.search + s.hash);
|
|
1373
1482
|
}
|
|
1374
1483
|
}
|
|
1375
1484
|
o.value || (o.value = null);
|
|
1376
1485
|
}), r.sessionEvents.addEventListener("login", (i) => {
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
console.error("Error logging in:"), console.error(
|
|
1486
|
+
const a = i.detail;
|
|
1487
|
+
if (a.error) {
|
|
1488
|
+
console.error("Error logging in:"), console.error(a.error);
|
|
1380
1489
|
return;
|
|
1381
1490
|
} else
|
|
1382
|
-
o.value =
|
|
1491
|
+
o.value = a.session;
|
|
1383
1492
|
}), r.sessionEvents.addEventListener("logout", (i) => {
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
}), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover",
|
|
1493
|
+
const a = i.detail;
|
|
1494
|
+
a.error ? (console.error("Error logging out:"), console.error(a.error)) : o.value = null;
|
|
1495
|
+
}), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover", ce), t.component("GraffitiGet", le), t.component("GraffitiRecoverOrphans", fe), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
|
|
1387
1496
|
}
|
|
1388
|
-
},
|
|
1497
|
+
}, Je = ce, Ke = le, He = fe;
|
|
1389
1498
|
export {
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1499
|
+
Je as GraffitiDiscover,
|
|
1500
|
+
Ke as GraffitiGet,
|
|
1501
|
+
We as GraffitiPlugin,
|
|
1502
|
+
He as GraffitiRecoverOrphans,
|
|
1503
|
+
Le as useGraffiti,
|
|
1504
|
+
Ee as useGraffitiDiscover,
|
|
1505
|
+
Se as useGraffitiGet,
|
|
1506
|
+
Ge as useGraffitiRecoverOrphans,
|
|
1398
1507
|
ee as useGraffitiSession,
|
|
1399
|
-
|
|
1508
|
+
B as useGraffitiSynchronize
|
|
1400
1509
|
};
|
|
1401
1510
|
//# sourceMappingURL=plugin.mjs.map
|