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