@graffiti-garden/wrapper-vue 0.7.2 → 1.0.4
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/README.md +2 -3
- package/dist/browser/ajv-D_HICdxS.mjs +4447 -0
- package/dist/browser/ajv-D_HICdxS.mjs.map +1 -0
- package/dist/browser/plugin.mjs +1003 -943
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/components/ActorToHandle.vue.d.ts +23 -0
- package/dist/node/components/ActorToHandle.vue.d.ts.map +1 -0
- package/dist/node/{Discover.vue.d.ts → components/Discover.vue.d.ts} +4 -4
- package/dist/node/components/Discover.vue.d.ts.map +1 -0
- package/dist/node/{Get.vue.d.ts → components/Get.vue.d.ts} +2 -5
- package/dist/node/components/Get.vue.d.ts.map +1 -0
- package/dist/node/components/GetMedia.vue.d.ts +36 -0
- package/dist/node/components/GetMedia.vue.d.ts.map +1 -0
- package/dist/node/components/HandleToActor.vue.d.ts +23 -0
- package/dist/node/components/HandleToActor.vue.d.ts.map +1 -0
- package/dist/node/components/ObjectInfo.vue.d.ts +7 -0
- package/dist/node/components/ObjectInfo.vue.d.ts.map +1 -0
- package/dist/node/composables/actor-to-handle.d.ts +25 -0
- package/dist/node/composables/actor-to-handle.d.ts.map +1 -0
- package/dist/node/composables/discover.d.ts +38 -0
- package/dist/node/composables/discover.d.ts.map +1 -0
- package/dist/node/composables/get-media.d.ts +31 -0
- package/dist/node/composables/get-media.d.ts.map +1 -0
- package/dist/node/composables/get.d.ts +28 -0
- package/dist/node/composables/get.d.ts.map +1 -0
- package/dist/node/composables/handle-to-actor.d.ts +25 -0
- package/dist/node/composables/handle-to-actor.d.ts.map +1 -0
- package/dist/node/composables/resolve-string.d.ts +6 -0
- package/dist/node/composables/resolve-string.d.ts.map +1 -0
- package/dist/node/globals.d.ts +3 -5
- package/dist/node/globals.d.ts.map +1 -1
- package/dist/node/plugin.d.ts +174 -75
- 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 +468 -333
- package/dist/node/plugin.mjs.map +1 -1
- package/package.json +15 -14
- package/src/components/ActorToHandle.vue +16 -0
- package/src/{Discover.vue → components/Discover.vue} +15 -9
- package/src/{Get.vue → components/Get.vue} +7 -11
- package/src/components/GetMedia.vue +75 -0
- package/src/components/HandleToActor.vue +16 -0
- package/src/components/ObjectInfo.vue +127 -0
- package/src/composables/actor-to-handle.ts +32 -0
- package/src/composables/discover.ts +202 -0
- package/src/composables/get-media.ts +116 -0
- package/src/composables/get.ts +109 -0
- package/src/composables/handle-to-actor.ts +32 -0
- package/src/composables/resolve-string.ts +46 -0
- package/src/globals.ts +24 -2
- package/src/plugin.ts +84 -29
- package/dist/browser/ajv-C30pimY5.mjs +0 -4400
- package/dist/browser/ajv-C30pimY5.mjs.map +0 -1
- package/dist/browser/index-CWfNKdDL.mjs +0 -424
- package/dist/browser/index-CWfNKdDL.mjs.map +0 -1
- package/dist/node/Discover.vue.d.ts.map +0 -1
- package/dist/node/Get.vue.d.ts.map +0 -1
- package/dist/node/RecoverOrphans.vue.d.ts +0 -31
- package/dist/node/RecoverOrphans.vue.d.ts.map +0 -1
- package/dist/node/composables.d.ts +0 -75
- package/dist/node/composables.d.ts.map +0 -1
- package/dist/node/pollers.d.ts +0 -28
- package/dist/node/pollers.d.ts.map +0 -1
- package/dist/node/reducers.d.ts +0 -37
- package/dist/node/reducers.d.ts.map +0 -1
- package/src/RecoverOrphans.vue +0 -37
- package/src/composables.ts +0 -347
- package/src/pollers.ts +0 -119
- package/src/reducers.ts +0 -124
package/dist/browser/plugin.mjs
CHANGED
|
@@ -1,310 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ref as k, onScopeDispose as le, watch as H, toValue as P, defineComponent as _, toRef as S, renderSlot as N, unref as v, createElementVNode as p, toDisplayString as O, createElementBlock as b, openBlock as w, createVNode as V, createCommentVNode as de, Fragment as re, renderList as oe } from "vue";
|
|
2
|
+
var D = class pe extends Error {
|
|
3
|
+
constructor(n) {
|
|
4
|
+
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, pe.prototype);
|
|
5
|
+
}
|
|
6
|
+
}, Se = class ve extends Error {
|
|
7
|
+
constructor(n) {
|
|
8
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ve.prototype);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function te(e) {
|
|
12
|
+
return typeof e == "string" ? e : e.url;
|
|
13
|
+
}
|
|
14
|
+
function Ge(e, n) {
|
|
15
|
+
return !Array.isArray(e.allowed) || typeof n?.actor == "string" && (e.actor === n.actor || e.allowed.includes(n.actor));
|
|
16
|
+
}
|
|
17
|
+
function ke(e, n, t) {
|
|
18
|
+
if (t === e.actor) return e;
|
|
19
|
+
let o = e.allowed && t ? [t] : void 0, i = e.channels.filter((r) => n.includes(r));
|
|
20
|
+
return { ...e, allowed: o, channels: i };
|
|
21
|
+
}
|
|
22
|
+
const I = {};
|
|
23
|
+
function Ee(e) {
|
|
24
|
+
if (!I.graffitiSession)
|
|
25
|
+
I.graffitiSession = e;
|
|
26
|
+
else
|
|
27
|
+
throw new Error(
|
|
28
|
+
"Graffiti session already set - plugin installed multiple times?"
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function Oe(e) {
|
|
32
|
+
if (!I.graffitiSynchronize)
|
|
33
|
+
I.graffitiSynchronize = e;
|
|
34
|
+
else
|
|
35
|
+
throw new Error(
|
|
36
|
+
"Graffiti synchronize already set - plugin installed multiple times?"
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function X() {
|
|
40
|
+
const e = I.graffitiSynchronize;
|
|
41
|
+
if (!e)
|
|
9
42
|
throw new Error(
|
|
10
43
|
"No Graffiti instance provided, did you forget to install the plugin?"
|
|
11
44
|
);
|
|
12
|
-
return
|
|
45
|
+
return e;
|
|
13
46
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
47
|
+
function ae() {
|
|
48
|
+
return X();
|
|
16
49
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
50
|
+
function ct() {
|
|
51
|
+
const e = I.graffitiSession;
|
|
52
|
+
if (!e)
|
|
20
53
|
throw new Error(
|
|
21
54
|
"No Graffiti session provided, did you forget to install the plugin?"
|
|
22
55
|
);
|
|
23
|
-
return
|
|
56
|
+
return e;
|
|
24
57
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
constructor(n) {
|
|
36
|
-
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, te.prototype);
|
|
37
|
-
}
|
|
38
|
-
}, ge = class ne extends Error {
|
|
39
|
-
constructor(n) {
|
|
40
|
-
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ne.prototype);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
class Pe {
|
|
44
|
-
constructor(n) {
|
|
45
|
-
v(this, "poll", async (n) => {
|
|
46
|
-
let e;
|
|
47
|
-
const r = this.getter;
|
|
48
|
-
try {
|
|
49
|
-
e = await r();
|
|
50
|
-
} catch {
|
|
51
|
-
this.getter === r && n(null);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.getter === r && n({ object: e });
|
|
58
|
+
function Ae(e, n, t, o = !1) {
|
|
59
|
+
const i = X(), r = /* @__PURE__ */ new Map(), s = k([]);
|
|
60
|
+
let a = async () => {
|
|
61
|
+
};
|
|
62
|
+
const c = async () => a(), u = k(!0);
|
|
63
|
+
let f, h;
|
|
64
|
+
le(() => {
|
|
65
|
+
f?.return(null), h?.return({
|
|
66
|
+
continue: () => h,
|
|
67
|
+
cursor: ""
|
|
55
68
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
});
|
|
70
|
+
const l = k(0);
|
|
71
|
+
function y(d = 0) {
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
l.value++;
|
|
74
|
+
}, d);
|
|
59
75
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
return H(
|
|
77
|
+
() => ({
|
|
78
|
+
args: [P(e), P(n), P(t)],
|
|
79
|
+
refresh: l.value
|
|
80
|
+
}),
|
|
81
|
+
({ args: d }, m, j) => {
|
|
82
|
+
r.clear(), s.value = [], u.value = !0;
|
|
83
|
+
const E = i.synchronizeDiscover(...d);
|
|
84
|
+
f = E;
|
|
85
|
+
let G, g = !0;
|
|
86
|
+
j(() => {
|
|
87
|
+
g = !1, E.return(null), G?.return({
|
|
88
|
+
continue: () => h,
|
|
89
|
+
cursor: ""
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
let L;
|
|
93
|
+
(async () => {
|
|
94
|
+
for await (const x of E) {
|
|
95
|
+
if (!g) break;
|
|
96
|
+
x.tombstone ? r.delete(x.object.url) : r.set(x.object.url, x.object), L || (L = new Promise((ee) => {
|
|
97
|
+
setTimeout(() => {
|
|
98
|
+
g && (s.value = Array.from(r.values())), L = void 0, ee();
|
|
99
|
+
}, 50);
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
})();
|
|
103
|
+
let Z = !1, fe = () => i.discover(...d);
|
|
104
|
+
a = async () => {
|
|
105
|
+
if (!(Z || !g)) {
|
|
106
|
+
Z = !0;
|
|
68
107
|
try {
|
|
69
|
-
|
|
70
|
-
} catch
|
|
71
|
-
|
|
72
|
-
n("clear"), this.iterator = this.streamFactory();
|
|
73
|
-
else
|
|
74
|
-
throw e;
|
|
75
|
-
}
|
|
76
|
-
else
|
|
77
|
-
this.iterator = this.streamFactory();
|
|
78
|
-
for (; this.iterator; ) {
|
|
79
|
-
const e = this.iterator, r = await e.next();
|
|
80
|
-
if (e === this.iterator) {
|
|
81
|
-
if (r.done) {
|
|
82
|
-
this.iterator = void 0, r.value && (this.continue = r.value.continue);
|
|
83
|
-
break;
|
|
108
|
+
G = fe(d[2]);
|
|
109
|
+
} catch {
|
|
110
|
+
return y(5e3);
|
|
84
111
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
if (g) {
|
|
113
|
+
for (h = G; ; ) {
|
|
114
|
+
let x;
|
|
115
|
+
try {
|
|
116
|
+
x = await G.next();
|
|
117
|
+
} catch (ee) {
|
|
118
|
+
return ee instanceof D ? y() : y(5e3);
|
|
119
|
+
}
|
|
120
|
+
if (!g) return;
|
|
121
|
+
if (x.done) {
|
|
122
|
+
fe = x.value.continue;
|
|
123
|
+
break;
|
|
124
|
+
} else x.value.error && console.error(x.value.error);
|
|
125
|
+
}
|
|
126
|
+
await new Promise((x) => setTimeout(x, 0)), L && await L, g && (Z = !1, u.value = !1, P(o) && c());
|
|
88
127
|
}
|
|
89
|
-
n(r.value);
|
|
90
128
|
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
this.iterator = void 0, this.continue = void 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function ie(t, n) {
|
|
107
|
-
return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
|
|
108
|
-
}
|
|
109
|
-
class je {
|
|
110
|
-
constructor() {
|
|
111
|
-
v(this, "entry", B());
|
|
112
|
-
}
|
|
113
|
-
get result() {
|
|
114
|
-
return pe(() => {
|
|
115
|
-
const n = this.entry.value;
|
|
116
|
-
return n && (n.tombstone ? null : n.object);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
clear() {
|
|
120
|
-
this.entry.value = void 0;
|
|
121
|
-
}
|
|
122
|
-
onEntry(n) {
|
|
123
|
-
if (n === "clear") {
|
|
124
|
-
this.clear();
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
(!n || ie(n, this.entry.value)) && (this.entry.value = n);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
class oe {
|
|
131
|
-
constructor(n) {
|
|
132
|
-
v(this, "results", B([]));
|
|
133
|
-
v(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
134
|
-
v(this, "batchFlattenTimer");
|
|
135
|
-
this.graffiti = n;
|
|
136
|
-
}
|
|
137
|
-
clear() {
|
|
138
|
-
this.resultsRaw.clear(), this.results.value = [], clearTimeout(this.batchFlattenTimer), this.batchFlattenTimer = void 0;
|
|
139
|
-
}
|
|
140
|
-
flattenResults() {
|
|
141
|
-
this.results.value = Array.from(this.resultsRaw.values()).reduce((n, e) => (e.tombstone || n.push(e.object), n), []);
|
|
142
|
-
}
|
|
143
|
-
onEntry(n) {
|
|
144
|
-
if (!n) return;
|
|
145
|
-
if (n === "clear") {
|
|
146
|
-
this.clear();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const e = this.resultsRaw.get(n.object.url);
|
|
150
|
-
ie(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
151
|
-
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
152
|
-
}, 0)));
|
|
153
|
-
}
|
|
129
|
+
}, c();
|
|
130
|
+
},
|
|
131
|
+
{ immediate: !0 }
|
|
132
|
+
), H(
|
|
133
|
+
() => P(o),
|
|
134
|
+
(d) => d && c()
|
|
135
|
+
), {
|
|
136
|
+
objects: s,
|
|
137
|
+
poll: c,
|
|
138
|
+
isFirstPoll: u
|
|
139
|
+
};
|
|
154
140
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
t.onEntry(h);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
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
|
-
} catch {
|
|
175
|
-
await new Promise((d) => setTimeout(d, 2e3));
|
|
176
|
-
} finally {
|
|
177
|
-
if (h !== c) return;
|
|
178
|
-
l = !1, P(o) && s();
|
|
179
|
-
}
|
|
180
|
-
}, f = B(!1);
|
|
181
|
-
return de(
|
|
182
|
-
r,
|
|
183
|
-
async (h, u) => {
|
|
184
|
-
if (JSON.stringify(h) === JSON.stringify(u))
|
|
185
|
-
return;
|
|
186
|
-
i == null || i.return(null), t.clear(), n.clear(), a(), c = () => n.poll(t.onEntry.bind(t));
|
|
187
|
-
const d = c;
|
|
188
|
-
l = !1, f.value = !0;
|
|
141
|
+
function me(e, n) {
|
|
142
|
+
const t = k(void 0);
|
|
143
|
+
return H(
|
|
144
|
+
() => P(e),
|
|
145
|
+
async (o, i, r) => {
|
|
146
|
+
let s = !0;
|
|
147
|
+
r(() => {
|
|
148
|
+
s = !1;
|
|
149
|
+
}), t.value = void 0;
|
|
189
150
|
try {
|
|
190
|
-
await
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
151
|
+
const a = await n(o);
|
|
152
|
+
s && (t.value = a);
|
|
153
|
+
} catch (a) {
|
|
154
|
+
if (!s) return;
|
|
155
|
+
a instanceof D ? t.value = null : console.error(a);
|
|
194
156
|
}
|
|
195
157
|
},
|
|
196
|
-
{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
), ye(() => {
|
|
200
|
-
i == null || i.return(null), t.clear(), n.clear(), c = void 0;
|
|
201
|
-
}), { poll: s, isInitialPolling: f };
|
|
202
|
-
}
|
|
203
|
-
function se(t, n) {
|
|
204
|
-
return () => {
|
|
205
|
-
const e = P(n);
|
|
206
|
-
return e === void 0 ? t == null ? void 0 : t.value : e;
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function E(t) {
|
|
210
|
-
return t.map((n) => n());
|
|
211
|
-
}
|
|
212
|
-
function xe(t, n, e, r = !1) {
|
|
213
|
-
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(
|
|
214
|
-
u,
|
|
215
|
-
d,
|
|
216
|
-
f,
|
|
217
|
-
s,
|
|
218
|
-
r
|
|
219
|
-
);
|
|
220
|
-
return {
|
|
221
|
-
/**
|
|
222
|
-
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
223
|
-
* an array of Graffiti objects.
|
|
224
|
-
*/
|
|
225
|
-
objects: u.results,
|
|
226
|
-
/**
|
|
227
|
-
* A method to poll for new results.
|
|
228
|
-
*/
|
|
229
|
-
poll: p,
|
|
230
|
-
/**
|
|
231
|
-
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
232
|
-
* that indicates if the *first* poll is currently running.
|
|
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
|
|
158
|
+
{ immediate: !0 }
|
|
159
|
+
), {
|
|
160
|
+
output: t
|
|
240
161
|
};
|
|
241
162
|
}
|
|
242
|
-
function
|
|
243
|
-
|
|
244
|
-
a,
|
|
245
|
-
l,
|
|
246
|
-
c
|
|
247
|
-
], f = () => o.synchronizeGet(...E(s)), h = new je(), u = () => o.get(...E(s)), d = new Pe(u), { poll: p, isInitialPolling: y } = H(
|
|
248
|
-
h,
|
|
249
|
-
d,
|
|
250
|
-
f,
|
|
251
|
-
s,
|
|
252
|
-
r
|
|
253
|
-
);
|
|
254
|
-
return {
|
|
255
|
-
/**
|
|
256
|
-
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
257
|
-
* the retrieved Graffiti object, if it exists. If the object has been deleted,
|
|
258
|
-
* the result is `null`. If the object is still being fetched, the result is `undefined`.
|
|
259
|
-
*/
|
|
260
|
-
object: h.result,
|
|
261
|
-
/**
|
|
262
|
-
* A method to poll for new results.
|
|
263
|
-
*/
|
|
264
|
-
poll: p,
|
|
265
|
-
/**
|
|
266
|
-
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
267
|
-
* that indicates if the *first* poll is currently running.
|
|
268
|
-
* Useful to show a loading spinner or disable a button.
|
|
269
|
-
*
|
|
270
|
-
* This also tracks new polls when the arguments have changed,
|
|
271
|
-
* but it does not track ongoing polls from either calling
|
|
272
|
-
* {@link poll} or using the `autopoll` argument.
|
|
273
|
-
*/
|
|
274
|
-
isInitialPolling: y
|
|
275
|
-
};
|
|
163
|
+
function be(e) {
|
|
164
|
+
return e === void 0 ? "Loading..." : e === null ? "Not found" : e;
|
|
276
165
|
}
|
|
277
|
-
function
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
l,
|
|
282
|
-
a,
|
|
283
|
-
e
|
|
166
|
+
function Te(e) {
|
|
167
|
+
const n = ae(), { output: t } = me(
|
|
168
|
+
e,
|
|
169
|
+
n.actorToHandle.bind(n)
|
|
284
170
|
);
|
|
285
|
-
return {
|
|
286
|
-
/**
|
|
287
|
-
* A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
288
|
-
* an array of Graffiti objects.
|
|
289
|
-
*/
|
|
290
|
-
objects: c.results,
|
|
291
|
-
/**
|
|
292
|
-
* A method to poll for new results.
|
|
293
|
-
*/
|
|
294
|
-
poll: h,
|
|
295
|
-
/**
|
|
296
|
-
* A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
297
|
-
* that indicates if the *first* poll is currently running.
|
|
298
|
-
* Useful to show a loading spinner or disable a button.
|
|
299
|
-
*
|
|
300
|
-
* This also tracks new polls when the arguments have changed,
|
|
301
|
-
* but it does not track ongoing polls from either calling
|
|
302
|
-
* {@link poll} or using the `autopoll` argument.
|
|
303
|
-
*/
|
|
304
|
-
isInitialPolling: u
|
|
305
|
-
};
|
|
171
|
+
return { handle: t };
|
|
306
172
|
}
|
|
307
|
-
const
|
|
173
|
+
const W = /* @__PURE__ */ _({
|
|
174
|
+
__name: "ActorToHandle",
|
|
175
|
+
props: {
|
|
176
|
+
actor: {}
|
|
177
|
+
},
|
|
178
|
+
setup(e) {
|
|
179
|
+
const t = S(e, "actor"), { handle: o } = Te(t);
|
|
180
|
+
return (i, r) => N(i.$slots, "default", { handle: v(o) }, () => [
|
|
181
|
+
p("span", null, O(v(be)(v(o))), 1)
|
|
182
|
+
]);
|
|
183
|
+
}
|
|
184
|
+
}), $e = ["data-url"], ze = { key: 0 }, De = { key: 1 }, Ie = { key: 0 }, Me = { key: 1 }, _e = { key: 0 }, Re = ["disabled"], Le = { key: 1 }, qe = { key: 2 }, K = /* @__PURE__ */ _({
|
|
185
|
+
__name: "ObjectInfo",
|
|
186
|
+
props: {
|
|
187
|
+
object: {}
|
|
188
|
+
},
|
|
189
|
+
setup(e) {
|
|
190
|
+
const n = ae(), t = k(!1);
|
|
191
|
+
async function o(i, r) {
|
|
192
|
+
t.value = !0, await new Promise((s) => setTimeout(s, 0)), confirm(
|
|
193
|
+
"Are you sure you want to delete this object? It cannot be undone."
|
|
194
|
+
) && await n.delete(i, r), t.value = !1;
|
|
195
|
+
}
|
|
196
|
+
return (i, r) => e.object ? (w(), b("article", {
|
|
197
|
+
key: 0,
|
|
198
|
+
"data-url": e.object.url
|
|
199
|
+
}, [
|
|
200
|
+
p("header", null, [
|
|
201
|
+
r[4] || (r[4] = p("h2", null, "Graffiti Object", -1)),
|
|
202
|
+
p("dl", null, [
|
|
203
|
+
r[1] || (r[1] = p("dt", null, "Object URL", -1)),
|
|
204
|
+
p("dd", null, [
|
|
205
|
+
p("code", null, O(e.object.url), 1)
|
|
206
|
+
]),
|
|
207
|
+
r[2] || (r[2] = p("dt", null, "Actor", -1)),
|
|
208
|
+
p("dd", null, [
|
|
209
|
+
p("code", null, O(e.object.actor), 1)
|
|
210
|
+
]),
|
|
211
|
+
r[3] || (r[3] = p("dt", null, "Handle", -1)),
|
|
212
|
+
p("dd", null, [
|
|
213
|
+
V(W, {
|
|
214
|
+
actor: e.object.actor
|
|
215
|
+
}, null, 8, ["actor"])
|
|
216
|
+
])
|
|
217
|
+
])
|
|
218
|
+
]),
|
|
219
|
+
p("section", null, [
|
|
220
|
+
r[5] || (r[5] = p("h3", null, "Content", -1)),
|
|
221
|
+
p("pre", null, O(e.object.value), 1)
|
|
222
|
+
]),
|
|
223
|
+
p("section", null, [
|
|
224
|
+
r[10] || (r[10] = p("h3", null, "Allowed Actors", -1)),
|
|
225
|
+
Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (w(), b("p", De, [...r[7] || (r[7] = [
|
|
226
|
+
p("em", null, "Noone", -1)
|
|
227
|
+
])])) : de("", !0) : (w(), b("p", ze, [...r[6] || (r[6] = [
|
|
228
|
+
p("em", null, "Public", -1)
|
|
229
|
+
])])),
|
|
230
|
+
p("ul", null, [
|
|
231
|
+
(w(!0), b(re, null, oe(e.object.allowed, (s) => (w(), b("li", { key: s }, [
|
|
232
|
+
p("dl", null, [
|
|
233
|
+
r[8] || (r[8] = p("dt", null, "Actor", -1)),
|
|
234
|
+
p("dd", null, [
|
|
235
|
+
p("code", null, O(s), 1)
|
|
236
|
+
]),
|
|
237
|
+
r[9] || (r[9] = p("dt", null, "Handle", -1)),
|
|
238
|
+
p("dd", null, [
|
|
239
|
+
V(W, { actor: s }, null, 8, ["actor"])
|
|
240
|
+
])
|
|
241
|
+
])
|
|
242
|
+
]))), 128))
|
|
243
|
+
])
|
|
244
|
+
]),
|
|
245
|
+
p("section", null, [
|
|
246
|
+
r[12] || (r[12] = p("h3", null, "Channels", -1)),
|
|
247
|
+
e.object.channels?.length ? (w(), b("ul", Ie, [
|
|
248
|
+
(w(!0), b(re, null, oe(e.object.channels, (s) => (w(), b("li", { key: s }, [
|
|
249
|
+
p("code", null, O(s), 1)
|
|
250
|
+
]))), 128))
|
|
251
|
+
])) : (w(), b("p", Me, [...r[11] || (r[11] = [
|
|
252
|
+
p("em", null, "No channels", -1)
|
|
253
|
+
])]))
|
|
254
|
+
]),
|
|
255
|
+
p("footer", null, [
|
|
256
|
+
p("nav", null, [
|
|
257
|
+
p("ul", null, [
|
|
258
|
+
i.$graffitiSession.value?.actor === e.object.actor ? (w(), b("li", _e, [
|
|
259
|
+
p("button", {
|
|
260
|
+
disabled: t.value,
|
|
261
|
+
onClick: r[0] || (r[0] = (s) => o(e.object, i.$graffitiSession.value))
|
|
262
|
+
}, O(t.value ? "Deleting..." : "Delete"), 9, Re)
|
|
263
|
+
])) : de("", !0)
|
|
264
|
+
])
|
|
265
|
+
])
|
|
266
|
+
])
|
|
267
|
+
], 8, $e)) : e.object === null ? (w(), b("article", Le, [...r[13] || (r[13] = [
|
|
268
|
+
p("header", null, [
|
|
269
|
+
p("h2", null, "Graffiti Object")
|
|
270
|
+
], -1),
|
|
271
|
+
p("p", null, [
|
|
272
|
+
p("em", null, "Object not found")
|
|
273
|
+
], -1)
|
|
274
|
+
])])) : (w(), b("article", qe, [...r[14] || (r[14] = [
|
|
275
|
+
p("header", null, [
|
|
276
|
+
p("h2", null, "Graffiti Object")
|
|
277
|
+
], -1),
|
|
278
|
+
p("p", null, [
|
|
279
|
+
p("em", null, "Loading...")
|
|
280
|
+
], -1)
|
|
281
|
+
])]));
|
|
282
|
+
}
|
|
283
|
+
}), He = { key: 0 }, Ce = { key: 1 }, we = /* @__PURE__ */ _({
|
|
308
284
|
__name: "Discover",
|
|
309
285
|
props: {
|
|
310
286
|
channels: {},
|
|
@@ -312,516 +288,658 @@ const ae = /* @__PURE__ */ W({
|
|
|
312
288
|
session: {},
|
|
313
289
|
autopoll: { type: Boolean }
|
|
314
290
|
},
|
|
315
|
-
setup(
|
|
316
|
-
const n =
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
291
|
+
setup(e) {
|
|
292
|
+
const n = e, { objects: t, poll: o, isFirstPoll: i } = Ae(
|
|
293
|
+
S(n, "channels"),
|
|
294
|
+
S(n, "schema"),
|
|
295
|
+
S(n, "session"),
|
|
296
|
+
S(n, "autopoll")
|
|
321
297
|
);
|
|
322
|
-
return (
|
|
323
|
-
objects:
|
|
324
|
-
poll:
|
|
325
|
-
|
|
326
|
-
})
|
|
298
|
+
return (r, s) => N(r.$slots, "default", {
|
|
299
|
+
objects: v(t),
|
|
300
|
+
poll: v(o),
|
|
301
|
+
isFirstPoll: v(i)
|
|
302
|
+
}, () => [
|
|
303
|
+
v(i) ? (w(), b("p", Ce, [...s[0] || (s[0] = [
|
|
304
|
+
p("em", null, " Loading... ", -1)
|
|
305
|
+
])])) : (w(), b("ul", He, [
|
|
306
|
+
(w(!0), b(re, null, oe(v(t), (a) => (w(), b("li", {
|
|
307
|
+
key: a.url
|
|
308
|
+
}, [
|
|
309
|
+
V(K, { object: a }, null, 8, ["object"])
|
|
310
|
+
]))), 128))
|
|
311
|
+
]))
|
|
312
|
+
]);
|
|
327
313
|
}
|
|
328
|
-
})
|
|
314
|
+
});
|
|
315
|
+
function Ne(e, n, t) {
|
|
316
|
+
const o = X(), i = k(void 0);
|
|
317
|
+
let r = async () => {
|
|
318
|
+
};
|
|
319
|
+
const s = async () => r();
|
|
320
|
+
let a;
|
|
321
|
+
return le(() => {
|
|
322
|
+
a?.return(null);
|
|
323
|
+
}), H(
|
|
324
|
+
() => [P(e), P(n), P(t)],
|
|
325
|
+
(c, u, f) => {
|
|
326
|
+
i.value = void 0;
|
|
327
|
+
const h = o.synchronizeGet(...c);
|
|
328
|
+
a = h;
|
|
329
|
+
let l = !0;
|
|
330
|
+
f(() => {
|
|
331
|
+
l = !1, h.return(null);
|
|
332
|
+
}), (async () => {
|
|
333
|
+
for await (const d of h) {
|
|
334
|
+
if (!l) return;
|
|
335
|
+
d.tombstone ? i.value = null : i.value = d.object;
|
|
336
|
+
}
|
|
337
|
+
})();
|
|
338
|
+
let y = !1;
|
|
339
|
+
r = async () => {
|
|
340
|
+
if (!(y || !l)) {
|
|
341
|
+
y = !0;
|
|
342
|
+
try {
|
|
343
|
+
await o.get(...c);
|
|
344
|
+
} catch (d) {
|
|
345
|
+
d instanceof D || console.error(d);
|
|
346
|
+
}
|
|
347
|
+
await new Promise((d) => setTimeout(d, 0)), y = !1;
|
|
348
|
+
}
|
|
349
|
+
}, s();
|
|
350
|
+
},
|
|
351
|
+
{ immediate: !0 }
|
|
352
|
+
), {
|
|
353
|
+
object: i,
|
|
354
|
+
poll: s
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
const ge = /* @__PURE__ */ _({
|
|
329
358
|
__name: "Get",
|
|
330
359
|
props: {
|
|
331
360
|
url: {},
|
|
332
361
|
schema: {},
|
|
333
|
-
session: {}
|
|
334
|
-
autopoll: { type: Boolean }
|
|
362
|
+
session: {}
|
|
335
363
|
},
|
|
336
|
-
setup(
|
|
337
|
-
const n =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
b(n, "autopoll")
|
|
364
|
+
setup(e) {
|
|
365
|
+
const n = e, { object: t, poll: o } = Ne(
|
|
366
|
+
S(n, "url"),
|
|
367
|
+
S(n, "schema"),
|
|
368
|
+
S(n, "session")
|
|
342
369
|
);
|
|
343
|
-
return (i,
|
|
344
|
-
object:
|
|
345
|
-
poll:
|
|
346
|
-
|
|
347
|
-
|
|
370
|
+
return (i, r) => N(i.$slots, "default", {
|
|
371
|
+
object: v(t),
|
|
372
|
+
poll: v(o)
|
|
373
|
+
}, () => [
|
|
374
|
+
V(K, { object: v(t) }, null, 8, ["object"])
|
|
375
|
+
]);
|
|
348
376
|
}
|
|
349
|
-
})
|
|
350
|
-
|
|
377
|
+
});
|
|
378
|
+
function Ue(e, n, t) {
|
|
379
|
+
const o = X(), i = k(
|
|
380
|
+
void 0
|
|
381
|
+
), r = k(0);
|
|
382
|
+
let s = null, a = () => {
|
|
383
|
+
};
|
|
384
|
+
function c() {
|
|
385
|
+
return s || (r.value++, s = new Promise((u) => {
|
|
386
|
+
a = () => {
|
|
387
|
+
s = null, u();
|
|
388
|
+
};
|
|
389
|
+
}), s);
|
|
390
|
+
}
|
|
391
|
+
return H(
|
|
392
|
+
() => ({
|
|
393
|
+
args: [P(e), P(n), P(t)],
|
|
394
|
+
pollCounter: r.value
|
|
395
|
+
}),
|
|
396
|
+
async ({ args: u }, f, h) => {
|
|
397
|
+
i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl), i.value = void 0;
|
|
398
|
+
let l = !0;
|
|
399
|
+
h(() => {
|
|
400
|
+
l = !1;
|
|
401
|
+
});
|
|
402
|
+
try {
|
|
403
|
+
const { data: y, actor: d, allowed: m } = await o.getMedia(...u);
|
|
404
|
+
if (!l) return;
|
|
405
|
+
const j = URL.createObjectURL(y);
|
|
406
|
+
i.value = {
|
|
407
|
+
data: y,
|
|
408
|
+
dataUrl: j,
|
|
409
|
+
actor: d,
|
|
410
|
+
allowed: m
|
|
411
|
+
};
|
|
412
|
+
} catch (y) {
|
|
413
|
+
if (!l) return;
|
|
414
|
+
y instanceof D ? i.value = null : console.error(y);
|
|
415
|
+
} finally {
|
|
416
|
+
a();
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{ immediate: !0 }
|
|
420
|
+
), le(() => {
|
|
421
|
+
a(), i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl);
|
|
422
|
+
}), {
|
|
423
|
+
media: i,
|
|
424
|
+
poll: c
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
const Be = ["src", "alt"], Ve = ["src", "alt"], We = ["src", "alt"], Fe = ["src", "alt"], Je = ["data", "alt"], Qe = { key: 6 }, Xe = { key: 7 }, je = /* @__PURE__ */ _({
|
|
428
|
+
__name: "GetMedia",
|
|
351
429
|
props: {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
430
|
+
url: {},
|
|
431
|
+
accept: {},
|
|
432
|
+
session: {}
|
|
355
433
|
},
|
|
356
|
-
setup(
|
|
357
|
-
const n =
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
434
|
+
setup(e) {
|
|
435
|
+
const n = e, { media: t, poll: o } = Ue(
|
|
436
|
+
S(n, "url"),
|
|
437
|
+
S(n, "accept"),
|
|
438
|
+
S(n, "session")
|
|
361
439
|
);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
440
|
+
function i() {
|
|
441
|
+
t.value && (window.location.href = t.value.dataUrl);
|
|
442
|
+
}
|
|
443
|
+
return (r, s) => N(r.$slots, "default", {
|
|
444
|
+
media: v(t),
|
|
445
|
+
poll: v(o)
|
|
446
|
+
}, () => [
|
|
447
|
+
v(t)?.data.type.startsWith("image/") ? (w(), b("img", {
|
|
448
|
+
key: 0,
|
|
449
|
+
src: v(t).dataUrl,
|
|
450
|
+
alt: `An image by ${v(t).actor}`
|
|
451
|
+
}, null, 8, Be)) : v(t)?.data.type.startsWith("video/") ? (w(), b("video", {
|
|
452
|
+
key: 1,
|
|
453
|
+
controls: "",
|
|
454
|
+
src: v(t).dataUrl,
|
|
455
|
+
alt: `A video by ${v(t).actor}`
|
|
456
|
+
}, null, 8, Ve)) : v(t)?.data.type.startsWith("audio/") ? (w(), b("audio", {
|
|
457
|
+
key: 2,
|
|
458
|
+
controls: "",
|
|
459
|
+
src: v(t).dataUrl,
|
|
460
|
+
alt: `Audio by ${v(t).actor}`
|
|
461
|
+
}, null, 8, We)) : v(t)?.data.type === "text/html" ? (w(), b("iframe", {
|
|
462
|
+
key: 3,
|
|
463
|
+
src: v(t).dataUrl,
|
|
464
|
+
alt: `HTML by ${v(t).actor}`,
|
|
465
|
+
sandbox: ""
|
|
466
|
+
}, null, 8, Fe)) : v(t)?.data.type.startsWith("application/pdf") ? (w(), b("object", {
|
|
467
|
+
key: 4,
|
|
468
|
+
data: v(t).dataUrl,
|
|
469
|
+
type: "application/pdf",
|
|
470
|
+
alt: `PDF by ${v(t).actor}`
|
|
471
|
+
}, null, 8, Je)) : v(t) ? (w(), b("button", {
|
|
472
|
+
key: 5,
|
|
473
|
+
onClick: i
|
|
474
|
+
}, "Download")) : v(t) === null ? (w(), b("p", Qe, [...s[0] || (s[0] = [
|
|
475
|
+
p("em", null, "Media not found", -1)
|
|
476
|
+
])])) : (w(), b("p", Xe, [...s[1] || (s[1] = [
|
|
477
|
+
p("em", null, " Loading... ", -1)
|
|
478
|
+
])]))
|
|
479
|
+
]);
|
|
367
480
|
}
|
|
368
481
|
});
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
482
|
+
function Ke(e) {
|
|
483
|
+
const n = ae(), { output: t } = me(
|
|
484
|
+
e,
|
|
485
|
+
n.handleToActor.bind(n)
|
|
486
|
+
);
|
|
487
|
+
return { actor: t };
|
|
488
|
+
}
|
|
489
|
+
const xe = /* @__PURE__ */ _({
|
|
490
|
+
__name: "HandleToActor",
|
|
491
|
+
props: {
|
|
492
|
+
handle: {}
|
|
493
|
+
},
|
|
494
|
+
setup(e) {
|
|
495
|
+
const t = S(e, "handle"), { actor: o } = Ke(t);
|
|
496
|
+
return (i, r) => N(i.$slots, "default", { actor: v(o) }, () => [
|
|
497
|
+
p("span", null, O(v(be)(v(o))), 1)
|
|
498
|
+
]);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
var ie = function(e, n) {
|
|
502
|
+
return ie = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, o) {
|
|
503
|
+
t.__proto__ = o;
|
|
504
|
+
} || function(t, o) {
|
|
505
|
+
for (var i in o) o.hasOwnProperty(i) && (t[i] = o[i]);
|
|
506
|
+
}, ie(e, n);
|
|
389
507
|
};
|
|
390
|
-
function
|
|
391
|
-
|
|
392
|
-
function
|
|
393
|
-
this.constructor =
|
|
508
|
+
function Ye(e, n) {
|
|
509
|
+
ie(e, n);
|
|
510
|
+
function t() {
|
|
511
|
+
this.constructor = e;
|
|
394
512
|
}
|
|
395
|
-
|
|
513
|
+
e.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
|
|
396
514
|
}
|
|
397
|
-
function
|
|
398
|
-
function
|
|
399
|
-
return
|
|
400
|
-
|
|
515
|
+
function M(e, n, t, o) {
|
|
516
|
+
function i(r) {
|
|
517
|
+
return r instanceof t ? r : new t(function(s) {
|
|
518
|
+
s(r);
|
|
401
519
|
});
|
|
402
520
|
}
|
|
403
|
-
return new (
|
|
404
|
-
function
|
|
521
|
+
return new (t || (t = Promise))(function(r, s) {
|
|
522
|
+
function a(f) {
|
|
405
523
|
try {
|
|
406
|
-
|
|
524
|
+
u(o.next(f));
|
|
407
525
|
} catch (h) {
|
|
408
|
-
|
|
526
|
+
s(h);
|
|
409
527
|
}
|
|
410
528
|
}
|
|
411
529
|
function c(f) {
|
|
412
530
|
try {
|
|
413
|
-
|
|
531
|
+
u(o.throw(f));
|
|
414
532
|
} catch (h) {
|
|
415
|
-
|
|
533
|
+
s(h);
|
|
416
534
|
}
|
|
417
535
|
}
|
|
418
|
-
function
|
|
419
|
-
f.done ?
|
|
536
|
+
function u(f) {
|
|
537
|
+
f.done ? r(f.value) : i(f.value).then(a, c);
|
|
420
538
|
}
|
|
421
|
-
|
|
539
|
+
u((o = o.apply(e, [])).next());
|
|
422
540
|
});
|
|
423
541
|
}
|
|
424
|
-
function
|
|
425
|
-
var
|
|
426
|
-
if (
|
|
427
|
-
return
|
|
428
|
-
}, trys: [], ops: [] },
|
|
429
|
-
return
|
|
542
|
+
function A(e, n) {
|
|
543
|
+
var t = { label: 0, sent: function() {
|
|
544
|
+
if (r[0] & 1) throw r[1];
|
|
545
|
+
return r[1];
|
|
546
|
+
}, trys: [], ops: [] }, o, i, r, s;
|
|
547
|
+
return s = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
430
548
|
return this;
|
|
431
|
-
}),
|
|
432
|
-
function
|
|
549
|
+
}), s;
|
|
550
|
+
function a(u) {
|
|
433
551
|
return function(f) {
|
|
434
|
-
return c([
|
|
552
|
+
return c([u, f]);
|
|
435
553
|
};
|
|
436
554
|
}
|
|
437
|
-
function c(
|
|
438
|
-
if (
|
|
439
|
-
for (;
|
|
440
|
-
if (
|
|
441
|
-
switch (
|
|
555
|
+
function c(u) {
|
|
556
|
+
if (o) throw new TypeError("Generator is already executing.");
|
|
557
|
+
for (; t; ) try {
|
|
558
|
+
if (o = 1, i && (r = u[0] & 2 ? i.return : u[0] ? i.throw || ((r = i.return) && r.call(i), 0) : i.next) && !(r = r.call(i, u[1])).done) return r;
|
|
559
|
+
switch (i = 0, r && (u = [u[0] & 2, r.value]), u[0]) {
|
|
442
560
|
case 0:
|
|
443
561
|
case 1:
|
|
444
|
-
|
|
562
|
+
r = u;
|
|
445
563
|
break;
|
|
446
564
|
case 4:
|
|
447
|
-
return
|
|
565
|
+
return t.label++, { value: u[1], done: !1 };
|
|
448
566
|
case 5:
|
|
449
|
-
|
|
567
|
+
t.label++, i = u[1], u = [0];
|
|
450
568
|
continue;
|
|
451
569
|
case 7:
|
|
452
|
-
|
|
570
|
+
u = t.ops.pop(), t.trys.pop();
|
|
453
571
|
continue;
|
|
454
572
|
default:
|
|
455
|
-
if (
|
|
456
|
-
|
|
573
|
+
if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (u[0] === 6 || u[0] === 2)) {
|
|
574
|
+
t = 0;
|
|
457
575
|
continue;
|
|
458
576
|
}
|
|
459
|
-
if (
|
|
460
|
-
|
|
577
|
+
if (u[0] === 3 && (!r || u[1] > r[0] && u[1] < r[3])) {
|
|
578
|
+
t.label = u[1];
|
|
461
579
|
break;
|
|
462
580
|
}
|
|
463
|
-
if (
|
|
464
|
-
|
|
581
|
+
if (u[0] === 6 && t.label < r[1]) {
|
|
582
|
+
t.label = r[1], r = u;
|
|
465
583
|
break;
|
|
466
584
|
}
|
|
467
|
-
if (
|
|
468
|
-
|
|
585
|
+
if (r && t.label < r[2]) {
|
|
586
|
+
t.label = r[2], t.ops.push(u);
|
|
469
587
|
break;
|
|
470
588
|
}
|
|
471
|
-
|
|
589
|
+
r[2] && t.ops.pop(), t.trys.pop();
|
|
472
590
|
continue;
|
|
473
591
|
}
|
|
474
|
-
|
|
592
|
+
u = n.call(e, t);
|
|
475
593
|
} catch (f) {
|
|
476
|
-
|
|
594
|
+
u = [6, f], i = 0;
|
|
477
595
|
} finally {
|
|
478
|
-
|
|
596
|
+
o = r = 0;
|
|
479
597
|
}
|
|
480
|
-
if (
|
|
481
|
-
return { value:
|
|
598
|
+
if (u[0] & 5) throw u[1];
|
|
599
|
+
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
482
600
|
}
|
|
483
601
|
}
|
|
484
|
-
function
|
|
485
|
-
var n = typeof Symbol == "function" && Symbol.iterator,
|
|
486
|
-
if (
|
|
487
|
-
if (
|
|
602
|
+
function R(e) {
|
|
603
|
+
var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], o = 0;
|
|
604
|
+
if (t) return t.call(e);
|
|
605
|
+
if (e && typeof e.length == "number") return {
|
|
488
606
|
next: function() {
|
|
489
|
-
return
|
|
607
|
+
return e && o >= e.length && (e = void 0), { value: e && e[o++], done: !e };
|
|
490
608
|
}
|
|
491
609
|
};
|
|
492
610
|
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
493
611
|
}
|
|
494
|
-
function
|
|
495
|
-
return this instanceof
|
|
612
|
+
function C(e) {
|
|
613
|
+
return this instanceof C ? (this.v = e, this) : new C(e);
|
|
496
614
|
}
|
|
497
|
-
function
|
|
615
|
+
function Ze(e, n, t) {
|
|
498
616
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
499
|
-
var
|
|
500
|
-
return
|
|
617
|
+
var o = t.apply(e, n || []), i, r = [];
|
|
618
|
+
return i = {}, s("next"), s("throw"), s("return"), i[Symbol.asyncIterator] = function() {
|
|
501
619
|
return this;
|
|
502
|
-
},
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
return new Promise(function(
|
|
506
|
-
|
|
620
|
+
}, i;
|
|
621
|
+
function s(l) {
|
|
622
|
+
o[l] && (i[l] = function(y) {
|
|
623
|
+
return new Promise(function(d, m) {
|
|
624
|
+
r.push([l, y, d, m]) > 1 || a(l, y);
|
|
507
625
|
});
|
|
508
626
|
});
|
|
509
627
|
}
|
|
510
|
-
function l
|
|
628
|
+
function a(l, y) {
|
|
511
629
|
try {
|
|
512
|
-
c(
|
|
513
|
-
} catch (
|
|
514
|
-
h(
|
|
630
|
+
c(o[l](y));
|
|
631
|
+
} catch (d) {
|
|
632
|
+
h(r[0][3], d);
|
|
515
633
|
}
|
|
516
634
|
}
|
|
517
|
-
function c(
|
|
518
|
-
|
|
635
|
+
function c(l) {
|
|
636
|
+
l.value instanceof C ? Promise.resolve(l.value.v).then(u, f) : h(r[0][2], l);
|
|
519
637
|
}
|
|
520
|
-
function
|
|
521
|
-
|
|
638
|
+
function u(l) {
|
|
639
|
+
a("next", l);
|
|
522
640
|
}
|
|
523
|
-
function f(
|
|
524
|
-
|
|
641
|
+
function f(l) {
|
|
642
|
+
a("throw", l);
|
|
525
643
|
}
|
|
526
|
-
function h(
|
|
527
|
-
|
|
644
|
+
function h(l, y) {
|
|
645
|
+
l(y), r.shift(), r.length && a(r[0][0], r[0][1]);
|
|
528
646
|
}
|
|
529
647
|
}
|
|
530
|
-
var
|
|
648
|
+
var Pe = (
|
|
531
649
|
/** @class */
|
|
532
|
-
function(
|
|
533
|
-
|
|
534
|
-
function n(
|
|
535
|
-
var
|
|
536
|
-
return Object.defineProperty(
|
|
650
|
+
(function(e) {
|
|
651
|
+
Ye(n, e);
|
|
652
|
+
function n(t) {
|
|
653
|
+
var o = e.call(this, t) || this;
|
|
654
|
+
return Object.defineProperty(o, "name", {
|
|
537
655
|
value: "RepeaterOverflowError",
|
|
538
656
|
enumerable: !1
|
|
539
|
-
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(
|
|
657
|
+
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(o, o.constructor.prototype) : o.__proto__ = o.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(o, o.constructor), o;
|
|
540
658
|
}
|
|
541
659
|
return n;
|
|
542
|
-
}(Error)
|
|
660
|
+
})(Error)
|
|
543
661
|
);
|
|
544
662
|
(function() {
|
|
545
|
-
function
|
|
663
|
+
function e(n) {
|
|
546
664
|
if (n < 0)
|
|
547
665
|
throw new RangeError("Capacity may not be less than 0");
|
|
548
666
|
this._c = n, this._q = [];
|
|
549
667
|
}
|
|
550
|
-
return Object.defineProperty(
|
|
668
|
+
return Object.defineProperty(e.prototype, "empty", {
|
|
551
669
|
get: function() {
|
|
552
670
|
return this._q.length === 0;
|
|
553
671
|
},
|
|
554
672
|
enumerable: !1,
|
|
555
673
|
configurable: !0
|
|
556
|
-
}), Object.defineProperty(
|
|
674
|
+
}), Object.defineProperty(e.prototype, "full", {
|
|
557
675
|
get: function() {
|
|
558
676
|
return this._q.length >= this._c;
|
|
559
677
|
},
|
|
560
678
|
enumerable: !1,
|
|
561
679
|
configurable: !0
|
|
562
|
-
}),
|
|
680
|
+
}), e.prototype.add = function(n) {
|
|
563
681
|
if (this.full)
|
|
564
682
|
throw new Error("Buffer full");
|
|
565
683
|
this._q.push(n);
|
|
566
|
-
},
|
|
684
|
+
}, e.prototype.remove = function() {
|
|
567
685
|
if (this.empty)
|
|
568
686
|
throw new Error("Buffer empty");
|
|
569
687
|
return this._q.shift();
|
|
570
|
-
},
|
|
688
|
+
}, e;
|
|
571
689
|
})();
|
|
572
690
|
(function() {
|
|
573
|
-
function
|
|
691
|
+
function e(n) {
|
|
574
692
|
if (n < 1)
|
|
575
693
|
throw new RangeError("Capacity may not be less than 1");
|
|
576
694
|
this._c = n, this._q = [];
|
|
577
695
|
}
|
|
578
|
-
return Object.defineProperty(
|
|
696
|
+
return Object.defineProperty(e.prototype, "empty", {
|
|
579
697
|
get: function() {
|
|
580
698
|
return this._q.length === 0;
|
|
581
699
|
},
|
|
582
700
|
enumerable: !1,
|
|
583
701
|
configurable: !0
|
|
584
|
-
}), Object.defineProperty(
|
|
702
|
+
}), Object.defineProperty(e.prototype, "full", {
|
|
585
703
|
get: function() {
|
|
586
704
|
return !1;
|
|
587
705
|
},
|
|
588
706
|
enumerable: !1,
|
|
589
707
|
configurable: !0
|
|
590
|
-
}),
|
|
708
|
+
}), e.prototype.add = function(n) {
|
|
591
709
|
for (; this._q.length >= this._c; )
|
|
592
710
|
this._q.shift();
|
|
593
711
|
this._q.push(n);
|
|
594
|
-
},
|
|
712
|
+
}, e.prototype.remove = function() {
|
|
595
713
|
if (this.empty)
|
|
596
714
|
throw new Error("Buffer empty");
|
|
597
715
|
return this._q.shift();
|
|
598
|
-
},
|
|
716
|
+
}, e;
|
|
599
717
|
})();
|
|
600
718
|
(function() {
|
|
601
|
-
function
|
|
719
|
+
function e(n) {
|
|
602
720
|
if (n < 1)
|
|
603
721
|
throw new RangeError("Capacity may not be less than 1");
|
|
604
722
|
this._c = n, this._q = [];
|
|
605
723
|
}
|
|
606
|
-
return Object.defineProperty(
|
|
724
|
+
return Object.defineProperty(e.prototype, "empty", {
|
|
607
725
|
get: function() {
|
|
608
726
|
return this._q.length === 0;
|
|
609
727
|
},
|
|
610
728
|
enumerable: !1,
|
|
611
729
|
configurable: !0
|
|
612
|
-
}), Object.defineProperty(
|
|
730
|
+
}), Object.defineProperty(e.prototype, "full", {
|
|
613
731
|
get: function() {
|
|
614
732
|
return !1;
|
|
615
733
|
},
|
|
616
734
|
enumerable: !1,
|
|
617
735
|
configurable: !0
|
|
618
|
-
}),
|
|
736
|
+
}), e.prototype.add = function(n) {
|
|
619
737
|
this._q.length < this._c && this._q.push(n);
|
|
620
|
-
},
|
|
738
|
+
}, e.prototype.remove = function() {
|
|
621
739
|
if (this.empty)
|
|
622
740
|
throw new Error("Buffer empty");
|
|
623
741
|
return this._q.shift();
|
|
624
|
-
},
|
|
742
|
+
}, e;
|
|
625
743
|
})();
|
|
626
|
-
function
|
|
627
|
-
|
|
744
|
+
function se(e) {
|
|
745
|
+
e != null && typeof e.then == "function" && e.then(Q, Q);
|
|
628
746
|
}
|
|
629
|
-
var
|
|
747
|
+
var ne = 0, he = 1, $ = 2, F = 3, ue = 4, J = 1024, Q = function() {
|
|
630
748
|
};
|
|
631
|
-
function
|
|
632
|
-
var n =
|
|
749
|
+
function z(e) {
|
|
750
|
+
var n = e.err, t = Promise.resolve(e.execution).then(function(o) {
|
|
633
751
|
if (n != null)
|
|
634
752
|
throw n;
|
|
635
|
-
return
|
|
753
|
+
return o;
|
|
636
754
|
});
|
|
637
|
-
return
|
|
755
|
+
return e.err = void 0, e.execution = t.then(function() {
|
|
638
756
|
}, function() {
|
|
639
|
-
}),
|
|
640
|
-
return
|
|
757
|
+
}), e.pending === void 0 ? t : e.pending.then(function() {
|
|
758
|
+
return t;
|
|
641
759
|
});
|
|
642
760
|
}
|
|
643
|
-
function
|
|
644
|
-
var
|
|
645
|
-
return Promise.resolve(n).then(function(
|
|
646
|
-
return !
|
|
761
|
+
function T(e, n) {
|
|
762
|
+
var t = e.state >= F;
|
|
763
|
+
return Promise.resolve(n).then(function(o) {
|
|
764
|
+
return !t && e.state >= ue ? z(e).then(function(i) {
|
|
647
765
|
return {
|
|
648
|
-
value:
|
|
766
|
+
value: i,
|
|
649
767
|
done: !0
|
|
650
768
|
};
|
|
651
|
-
}) : { value:
|
|
769
|
+
}) : { value: o, done: t };
|
|
652
770
|
});
|
|
653
771
|
}
|
|
654
|
-
function
|
|
655
|
-
var
|
|
656
|
-
if (!(
|
|
657
|
-
if (
|
|
658
|
-
|
|
772
|
+
function ce(e, n) {
|
|
773
|
+
var t, o;
|
|
774
|
+
if (!(e.state >= $))
|
|
775
|
+
if (e.state = $, e.onnext(), e.onstop(), e.err == null && (e.err = n), e.pushes.length === 0 && (typeof e.buffer > "u" || e.buffer.empty))
|
|
776
|
+
q(e);
|
|
659
777
|
else
|
|
660
778
|
try {
|
|
661
|
-
for (var
|
|
662
|
-
var
|
|
663
|
-
|
|
779
|
+
for (var i = R(e.pushes), r = i.next(); !r.done; r = i.next()) {
|
|
780
|
+
var s = r.value;
|
|
781
|
+
s.resolve();
|
|
664
782
|
}
|
|
665
|
-
} catch (
|
|
666
|
-
|
|
783
|
+
} catch (a) {
|
|
784
|
+
t = { error: a };
|
|
667
785
|
} finally {
|
|
668
786
|
try {
|
|
669
|
-
|
|
787
|
+
r && !r.done && (o = i.return) && o.call(i);
|
|
670
788
|
} finally {
|
|
671
|
-
if (
|
|
789
|
+
if (t) throw t.error;
|
|
672
790
|
}
|
|
673
791
|
}
|
|
674
792
|
}
|
|
675
|
-
function
|
|
676
|
-
var n,
|
|
677
|
-
if (!(
|
|
678
|
-
|
|
793
|
+
function q(e) {
|
|
794
|
+
var n, t;
|
|
795
|
+
if (!(e.state >= F)) {
|
|
796
|
+
e.state < $ && ce(e), e.state = F, e.buffer = void 0;
|
|
679
797
|
try {
|
|
680
|
-
for (var
|
|
681
|
-
var
|
|
682
|
-
return
|
|
798
|
+
for (var o = R(e.nexts), i = o.next(); !i.done; i = o.next()) {
|
|
799
|
+
var r = i.value, s = e.pending === void 0 ? z(e) : e.pending.then(function() {
|
|
800
|
+
return z(e);
|
|
683
801
|
});
|
|
684
|
-
|
|
802
|
+
r.resolve(T(e, s));
|
|
685
803
|
}
|
|
686
|
-
} catch (
|
|
687
|
-
n = { error:
|
|
804
|
+
} catch (a) {
|
|
805
|
+
n = { error: a };
|
|
688
806
|
} finally {
|
|
689
807
|
try {
|
|
690
|
-
|
|
808
|
+
i && !i.done && (t = o.return) && t.call(o);
|
|
691
809
|
} finally {
|
|
692
810
|
if (n) throw n.error;
|
|
693
811
|
}
|
|
694
812
|
}
|
|
695
|
-
|
|
813
|
+
e.pushes = [], e.nexts = [];
|
|
696
814
|
}
|
|
697
815
|
}
|
|
698
|
-
function
|
|
699
|
-
|
|
816
|
+
function ye(e) {
|
|
817
|
+
e.state >= ue || (e.state < F && q(e), e.state = ue);
|
|
700
818
|
}
|
|
701
|
-
function
|
|
702
|
-
if (
|
|
703
|
-
throw new
|
|
704
|
-
if (
|
|
819
|
+
function et(e, n) {
|
|
820
|
+
if (se(n), e.pushes.length >= J)
|
|
821
|
+
throw new Pe("No more than " + J + " pending calls to push are allowed on a single repeater.");
|
|
822
|
+
if (e.state >= $)
|
|
705
823
|
return Promise.resolve(void 0);
|
|
706
|
-
var
|
|
824
|
+
var t = e.pending === void 0 ? Promise.resolve(n) : e.pending.then(function() {
|
|
707
825
|
return n;
|
|
708
826
|
});
|
|
709
|
-
|
|
710
|
-
|
|
827
|
+
t = t.catch(function(c) {
|
|
828
|
+
e.state < $ && (e.err = c), ye(e);
|
|
711
829
|
});
|
|
712
|
-
var
|
|
713
|
-
if (
|
|
714
|
-
var
|
|
715
|
-
|
|
716
|
-
return
|
|
830
|
+
var o;
|
|
831
|
+
if (e.nexts.length) {
|
|
832
|
+
var i = e.nexts.shift();
|
|
833
|
+
i.resolve(T(e, t)), e.nexts.length ? o = Promise.resolve(e.nexts[0].value) : typeof e.buffer < "u" && !e.buffer.full ? o = Promise.resolve(void 0) : o = new Promise(function(c) {
|
|
834
|
+
return e.onnext = c;
|
|
717
835
|
});
|
|
718
|
-
} else typeof
|
|
719
|
-
return
|
|
836
|
+
} else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t), o = Promise.resolve(void 0)) : o = new Promise(function(c) {
|
|
837
|
+
return e.pushes.push({ resolve: c, value: t });
|
|
720
838
|
});
|
|
721
|
-
var
|
|
722
|
-
if (
|
|
839
|
+
var r = !0, s = {}, a = o.catch(function(c) {
|
|
840
|
+
if (r)
|
|
723
841
|
throw c;
|
|
724
842
|
});
|
|
725
|
-
return
|
|
726
|
-
return
|
|
727
|
-
},
|
|
728
|
-
return
|
|
729
|
-
},
|
|
730
|
-
return
|
|
843
|
+
return s.then = function(c, u) {
|
|
844
|
+
return r = !1, Promise.prototype.then.call(o, c, u);
|
|
845
|
+
}, s.catch = function(c) {
|
|
846
|
+
return r = !1, Promise.prototype.catch.call(o, c);
|
|
847
|
+
}, s.finally = o.finally.bind(o), e.pending = t.then(function() {
|
|
848
|
+
return a;
|
|
731
849
|
}).catch(function(c) {
|
|
732
|
-
|
|
733
|
-
}),
|
|
850
|
+
e.err = c, ye(e);
|
|
851
|
+
}), s;
|
|
734
852
|
}
|
|
735
|
-
function
|
|
736
|
-
var n =
|
|
737
|
-
return
|
|
853
|
+
function tt(e) {
|
|
854
|
+
var n = ce.bind(null, e), t = new Promise(function(o) {
|
|
855
|
+
return e.onstop = o;
|
|
738
856
|
});
|
|
739
|
-
return n.then =
|
|
857
|
+
return n.then = t.then.bind(t), n.catch = t.catch.bind(t), n.finally = t.finally.bind(t), n;
|
|
740
858
|
}
|
|
741
|
-
function
|
|
742
|
-
if (!(
|
|
743
|
-
|
|
744
|
-
var n =
|
|
745
|
-
|
|
746
|
-
return
|
|
747
|
-
}),
|
|
748
|
-
return
|
|
859
|
+
function nt(e) {
|
|
860
|
+
if (!(e.state >= he)) {
|
|
861
|
+
e.state = he;
|
|
862
|
+
var n = et.bind(null, e), t = tt(e);
|
|
863
|
+
e.execution = new Promise(function(o) {
|
|
864
|
+
return o(e.executor(n, t));
|
|
865
|
+
}), e.execution.catch(function() {
|
|
866
|
+
return ce(e);
|
|
749
867
|
});
|
|
750
868
|
}
|
|
751
869
|
}
|
|
752
|
-
var
|
|
870
|
+
var B = /* @__PURE__ */ new WeakMap(), U = (
|
|
753
871
|
/** @class */
|
|
754
|
-
function() {
|
|
755
|
-
function
|
|
756
|
-
|
|
872
|
+
(function() {
|
|
873
|
+
function e(n, t) {
|
|
874
|
+
B.set(this, {
|
|
757
875
|
executor: n,
|
|
758
|
-
buffer:
|
|
876
|
+
buffer: t,
|
|
759
877
|
err: void 0,
|
|
760
|
-
state:
|
|
878
|
+
state: ne,
|
|
761
879
|
pushes: [],
|
|
762
880
|
nexts: [],
|
|
763
881
|
pending: void 0,
|
|
764
882
|
execution: void 0,
|
|
765
|
-
onnext:
|
|
766
|
-
onstop:
|
|
883
|
+
onnext: Q,
|
|
884
|
+
onstop: Q
|
|
767
885
|
});
|
|
768
886
|
}
|
|
769
|
-
return
|
|
770
|
-
|
|
771
|
-
var
|
|
772
|
-
if (
|
|
887
|
+
return e.prototype.next = function(n) {
|
|
888
|
+
se(n);
|
|
889
|
+
var t = B.get(this);
|
|
890
|
+
if (t === void 0)
|
|
773
891
|
throw new Error("WeakMap error");
|
|
774
|
-
if (
|
|
775
|
-
throw new
|
|
776
|
-
if (
|
|
777
|
-
var
|
|
778
|
-
if (
|
|
779
|
-
var
|
|
780
|
-
|
|
892
|
+
if (t.nexts.length >= J)
|
|
893
|
+
throw new Pe("No more than " + J + " pending calls to next are allowed on a single repeater.");
|
|
894
|
+
if (t.state <= ne && nt(t), t.onnext(n), typeof t.buffer < "u" && !t.buffer.empty) {
|
|
895
|
+
var o = T(t, t.buffer.remove());
|
|
896
|
+
if (t.pushes.length) {
|
|
897
|
+
var i = t.pushes.shift();
|
|
898
|
+
t.buffer.add(i.value), t.onnext = i.resolve;
|
|
781
899
|
}
|
|
782
|
-
return
|
|
783
|
-
} else if (
|
|
784
|
-
var
|
|
785
|
-
return
|
|
786
|
-
} else if (
|
|
787
|
-
return
|
|
788
|
-
return new Promise(function(
|
|
789
|
-
return
|
|
900
|
+
return o;
|
|
901
|
+
} else if (t.pushes.length) {
|
|
902
|
+
var r = t.pushes.shift();
|
|
903
|
+
return t.onnext = r.resolve, T(t, r.value);
|
|
904
|
+
} else if (t.state >= $)
|
|
905
|
+
return q(t), T(t, z(t));
|
|
906
|
+
return new Promise(function(s) {
|
|
907
|
+
return t.nexts.push({ resolve: s, value: n });
|
|
790
908
|
});
|
|
791
|
-
},
|
|
792
|
-
|
|
793
|
-
var
|
|
794
|
-
if (
|
|
909
|
+
}, e.prototype.return = function(n) {
|
|
910
|
+
se(n);
|
|
911
|
+
var t = B.get(this);
|
|
912
|
+
if (t === void 0)
|
|
795
913
|
throw new Error("WeakMap error");
|
|
796
|
-
return
|
|
914
|
+
return q(t), t.execution = Promise.resolve(t.execution).then(function() {
|
|
797
915
|
return n;
|
|
798
|
-
}),
|
|
799
|
-
},
|
|
800
|
-
var
|
|
801
|
-
if (
|
|
916
|
+
}), T(t, z(t));
|
|
917
|
+
}, e.prototype.throw = function(n) {
|
|
918
|
+
var t = B.get(this);
|
|
919
|
+
if (t === void 0)
|
|
802
920
|
throw new Error("WeakMap error");
|
|
803
|
-
return
|
|
804
|
-
},
|
|
921
|
+
return t.state <= ne || t.state >= $ || typeof t.buffer < "u" && !t.buffer.empty ? (q(t), t.err == null && (t.err = n), T(t, z(t))) : this.next(Promise.reject(n));
|
|
922
|
+
}, e.prototype[Symbol.asyncIterator] = function() {
|
|
805
923
|
return this;
|
|
806
|
-
},
|
|
807
|
-
}()
|
|
924
|
+
}, e.race = rt, e.merge = ot, e.zip = it, e.latest = st, e;
|
|
925
|
+
})()
|
|
808
926
|
);
|
|
809
|
-
function
|
|
810
|
-
var
|
|
811
|
-
|
|
812
|
-
return
|
|
813
|
-
return
|
|
814
|
-
switch (
|
|
927
|
+
function Y(e, n) {
|
|
928
|
+
var t, o, i = [], r = function(u) {
|
|
929
|
+
u != null && typeof u[Symbol.asyncIterator] == "function" ? i.push(u[Symbol.asyncIterator]()) : u != null && typeof u[Symbol.iterator] == "function" ? i.push(u[Symbol.iterator]()) : i.push((function() {
|
|
930
|
+
return Ze(this, arguments, function() {
|
|
931
|
+
return A(this, function(l) {
|
|
932
|
+
switch (l.label) {
|
|
815
933
|
case 0:
|
|
816
|
-
return n.yieldValues ? [4,
|
|
934
|
+
return n.yieldValues ? [4, C(u)] : [3, 3];
|
|
817
935
|
case 1:
|
|
818
|
-
return [4,
|
|
936
|
+
return [4, l.sent()];
|
|
819
937
|
case 2:
|
|
820
|
-
|
|
938
|
+
l.sent(), l.label = 3;
|
|
821
939
|
case 3:
|
|
822
|
-
return n.returnValues ? [4,
|
|
940
|
+
return n.returnValues ? [4, C(u)] : [3, 5];
|
|
823
941
|
case 4:
|
|
824
|
-
return [2,
|
|
942
|
+
return [2, l.sent()];
|
|
825
943
|
case 5:
|
|
826
944
|
return [
|
|
827
945
|
2
|
|
@@ -830,70 +948,70 @@ function V(t, n) {
|
|
|
830
948
|
}
|
|
831
949
|
});
|
|
832
950
|
});
|
|
833
|
-
}());
|
|
951
|
+
})());
|
|
834
952
|
};
|
|
835
953
|
try {
|
|
836
|
-
for (var
|
|
837
|
-
var c =
|
|
838
|
-
|
|
954
|
+
for (var s = R(e), a = s.next(); !a.done; a = s.next()) {
|
|
955
|
+
var c = a.value;
|
|
956
|
+
r(c);
|
|
839
957
|
}
|
|
840
|
-
} catch (
|
|
841
|
-
|
|
958
|
+
} catch (u) {
|
|
959
|
+
t = { error: u };
|
|
842
960
|
} finally {
|
|
843
961
|
try {
|
|
844
|
-
|
|
962
|
+
a && !a.done && (o = s.return) && o.call(s);
|
|
845
963
|
} finally {
|
|
846
|
-
if (
|
|
964
|
+
if (t) throw t.error;
|
|
847
965
|
}
|
|
848
966
|
}
|
|
849
|
-
return
|
|
967
|
+
return i;
|
|
850
968
|
}
|
|
851
|
-
function
|
|
852
|
-
var n = this,
|
|
853
|
-
return new
|
|
854
|
-
return
|
|
855
|
-
var
|
|
856
|
-
return
|
|
969
|
+
function rt(e) {
|
|
970
|
+
var n = this, t = Y(e, { returnValues: !0 });
|
|
971
|
+
return new U(function(o, i) {
|
|
972
|
+
return M(n, void 0, void 0, function() {
|
|
973
|
+
var r, s, a, c, u, f;
|
|
974
|
+
return A(this, function(h) {
|
|
857
975
|
switch (h.label) {
|
|
858
976
|
case 0:
|
|
859
|
-
if (!
|
|
860
|
-
return
|
|
977
|
+
if (!t.length)
|
|
978
|
+
return i(), [
|
|
861
979
|
2
|
|
862
980
|
/*return*/
|
|
863
981
|
];
|
|
864
|
-
|
|
865
|
-
|
|
982
|
+
s = !1, i.then(function() {
|
|
983
|
+
r(), s = !0;
|
|
866
984
|
}), h.label = 1;
|
|
867
985
|
case 1:
|
|
868
|
-
h.trys.push([1, , 5, 7]), c = void 0,
|
|
869
|
-
var
|
|
870
|
-
return
|
|
871
|
-
switch (
|
|
986
|
+
h.trys.push([1, , 5, 7]), c = void 0, u = 0, f = function() {
|
|
987
|
+
var l, y, d, m, j, E;
|
|
988
|
+
return A(this, function(G) {
|
|
989
|
+
switch (G.label) {
|
|
872
990
|
case 0:
|
|
873
|
-
|
|
991
|
+
l = u;
|
|
874
992
|
try {
|
|
875
|
-
for (
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}, function(
|
|
879
|
-
return
|
|
993
|
+
for (y = (j = void 0, R(t)), d = y.next(); !d.done; d = y.next())
|
|
994
|
+
m = d.value, Promise.resolve(m.next()).then(function(g) {
|
|
995
|
+
g.done ? (i(), a === void 0 && (a = g)) : u === l && (u++, r(g));
|
|
996
|
+
}, function(g) {
|
|
997
|
+
return i(g);
|
|
880
998
|
});
|
|
881
|
-
} catch (
|
|
882
|
-
|
|
999
|
+
} catch (g) {
|
|
1000
|
+
j = { error: g };
|
|
883
1001
|
} finally {
|
|
884
1002
|
try {
|
|
885
|
-
|
|
1003
|
+
d && !d.done && (E = y.return) && E.call(y);
|
|
886
1004
|
} finally {
|
|
887
|
-
if (
|
|
1005
|
+
if (j) throw j.error;
|
|
888
1006
|
}
|
|
889
1007
|
}
|
|
890
|
-
return [4, new Promise(function(
|
|
891
|
-
return
|
|
1008
|
+
return [4, new Promise(function(g) {
|
|
1009
|
+
return r = g;
|
|
892
1010
|
})];
|
|
893
1011
|
case 1:
|
|
894
|
-
return c =
|
|
1012
|
+
return c = G.sent(), c === void 0 ? [3, 3] : [4, o(c.value)];
|
|
895
1013
|
case 2:
|
|
896
|
-
|
|
1014
|
+
G.sent(), G.label = 3;
|
|
897
1015
|
case 3:
|
|
898
1016
|
return [
|
|
899
1017
|
2
|
|
@@ -903,14 +1021,14 @@ function ke(t) {
|
|
|
903
1021
|
});
|
|
904
1022
|
}, h.label = 2;
|
|
905
1023
|
case 2:
|
|
906
|
-
return
|
|
1024
|
+
return s ? [3, 4] : [5, f()];
|
|
907
1025
|
case 3:
|
|
908
1026
|
return h.sent(), [3, 2];
|
|
909
1027
|
case 4:
|
|
910
|
-
return [2,
|
|
1028
|
+
return [2, a && a.value];
|
|
911
1029
|
case 5:
|
|
912
|
-
return
|
|
913
|
-
return
|
|
1030
|
+
return i(), [4, Promise.race(t.map(function(l) {
|
|
1031
|
+
return l.return && l.return();
|
|
914
1032
|
}))];
|
|
915
1033
|
case 6:
|
|
916
1034
|
return h.sent(), [
|
|
@@ -927,68 +1045,68 @@ function ke(t) {
|
|
|
927
1045
|
});
|
|
928
1046
|
});
|
|
929
1047
|
}
|
|
930
|
-
function
|
|
931
|
-
var n = this,
|
|
932
|
-
return new
|
|
933
|
-
return
|
|
934
|
-
var
|
|
935
|
-
return
|
|
936
|
-
switch (
|
|
1048
|
+
function ot(e) {
|
|
1049
|
+
var n = this, t = Y(e, { yieldValues: !0 });
|
|
1050
|
+
return new U(function(o, i) {
|
|
1051
|
+
return M(n, void 0, void 0, function() {
|
|
1052
|
+
var r, s, a, c = this;
|
|
1053
|
+
return A(this, function(u) {
|
|
1054
|
+
switch (u.label) {
|
|
937
1055
|
case 0:
|
|
938
|
-
if (!
|
|
939
|
-
return
|
|
1056
|
+
if (!t.length)
|
|
1057
|
+
return i(), [
|
|
940
1058
|
2
|
|
941
1059
|
/*return*/
|
|
942
1060
|
];
|
|
943
|
-
|
|
1061
|
+
r = [], s = !1, i.then(function() {
|
|
944
1062
|
var f, h;
|
|
945
|
-
|
|
1063
|
+
s = !0;
|
|
946
1064
|
try {
|
|
947
|
-
for (var
|
|
948
|
-
var
|
|
949
|
-
|
|
1065
|
+
for (var l = R(r), y = l.next(); !y.done; y = l.next()) {
|
|
1066
|
+
var d = y.value;
|
|
1067
|
+
d();
|
|
950
1068
|
}
|
|
951
|
-
} catch (
|
|
952
|
-
f = { error:
|
|
1069
|
+
} catch (m) {
|
|
1070
|
+
f = { error: m };
|
|
953
1071
|
} finally {
|
|
954
1072
|
try {
|
|
955
|
-
|
|
1073
|
+
y && !y.done && (h = l.return) && h.call(l);
|
|
956
1074
|
} finally {
|
|
957
1075
|
if (f) throw f.error;
|
|
958
1076
|
}
|
|
959
1077
|
}
|
|
960
|
-
}),
|
|
1078
|
+
}), u.label = 1;
|
|
961
1079
|
case 1:
|
|
962
|
-
return
|
|
963
|
-
return
|
|
964
|
-
var
|
|
965
|
-
return
|
|
966
|
-
switch (
|
|
1080
|
+
return u.trys.push([1, , 3, 4]), [4, Promise.all(t.map(function(f, h) {
|
|
1081
|
+
return M(c, void 0, void 0, function() {
|
|
1082
|
+
var l, y;
|
|
1083
|
+
return A(this, function(d) {
|
|
1084
|
+
switch (d.label) {
|
|
967
1085
|
case 0:
|
|
968
|
-
|
|
1086
|
+
d.trys.push([0, , 6, 9]), d.label = 1;
|
|
969
1087
|
case 1:
|
|
970
|
-
return
|
|
971
|
-
return
|
|
972
|
-
}, function(
|
|
973
|
-
return
|
|
974
|
-
}), [4, new Promise(function(
|
|
975
|
-
|
|
1088
|
+
return s ? [3, 5] : (Promise.resolve(f.next()).then(function(m) {
|
|
1089
|
+
return r[h](m);
|
|
1090
|
+
}, function(m) {
|
|
1091
|
+
return i(m);
|
|
1092
|
+
}), [4, new Promise(function(m) {
|
|
1093
|
+
r[h] = m;
|
|
976
1094
|
})]);
|
|
977
1095
|
case 2:
|
|
978
|
-
return
|
|
1096
|
+
return l = d.sent(), l === void 0 ? [3, 4] : l.done ? (a = l, [
|
|
979
1097
|
2
|
|
980
1098
|
/*return*/
|
|
981
|
-
]) : [4,
|
|
1099
|
+
]) : [4, o(l.value)];
|
|
982
1100
|
case 3:
|
|
983
|
-
|
|
1101
|
+
d.sent(), d.label = 4;
|
|
984
1102
|
case 4:
|
|
985
1103
|
return [3, 1];
|
|
986
1104
|
case 5:
|
|
987
1105
|
return [3, 9];
|
|
988
1106
|
case 6:
|
|
989
|
-
return
|
|
1107
|
+
return y = f.return, y ? [4, f.return()] : [3, 8];
|
|
990
1108
|
case 7:
|
|
991
|
-
|
|
1109
|
+
y = d.sent(), d.label = 8;
|
|
992
1110
|
case 8:
|
|
993
1111
|
return [
|
|
994
1112
|
7
|
|
@@ -1004,9 +1122,9 @@ function Ie(t) {
|
|
|
1004
1122
|
});
|
|
1005
1123
|
}))];
|
|
1006
1124
|
case 2:
|
|
1007
|
-
return
|
|
1125
|
+
return u.sent(), [2, a && a.value];
|
|
1008
1126
|
case 3:
|
|
1009
|
-
return
|
|
1127
|
+
return i(), [
|
|
1010
1128
|
7
|
|
1011
1129
|
/*endfinally*/
|
|
1012
1130
|
];
|
|
@@ -1020,50 +1138,50 @@ function Ie(t) {
|
|
|
1020
1138
|
});
|
|
1021
1139
|
});
|
|
1022
1140
|
}
|
|
1023
|
-
function
|
|
1024
|
-
var n = this,
|
|
1025
|
-
return new
|
|
1026
|
-
return
|
|
1027
|
-
var
|
|
1028
|
-
return
|
|
1029
|
-
switch (
|
|
1141
|
+
function it(e) {
|
|
1142
|
+
var n = this, t = Y(e, { returnValues: !0 });
|
|
1143
|
+
return new U(function(o, i) {
|
|
1144
|
+
return M(n, void 0, void 0, function() {
|
|
1145
|
+
var r, s, a, c;
|
|
1146
|
+
return A(this, function(u) {
|
|
1147
|
+
switch (u.label) {
|
|
1030
1148
|
case 0:
|
|
1031
|
-
if (!
|
|
1032
|
-
return
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}),
|
|
1149
|
+
if (!t.length)
|
|
1150
|
+
return i(), [2, []];
|
|
1151
|
+
s = !1, i.then(function() {
|
|
1152
|
+
r(), s = !0;
|
|
1153
|
+
}), u.label = 1;
|
|
1036
1154
|
case 1:
|
|
1037
|
-
|
|
1155
|
+
u.trys.push([1, , 6, 8]), u.label = 2;
|
|
1038
1156
|
case 2:
|
|
1039
|
-
return
|
|
1157
|
+
return s ? [3, 5] : (Promise.all(t.map(function(f) {
|
|
1040
1158
|
return f.next();
|
|
1041
1159
|
})).then(function(f) {
|
|
1042
|
-
return
|
|
1160
|
+
return r(f);
|
|
1043
1161
|
}, function(f) {
|
|
1044
|
-
return
|
|
1162
|
+
return i(f);
|
|
1045
1163
|
}), [4, new Promise(function(f) {
|
|
1046
|
-
return
|
|
1164
|
+
return r = f;
|
|
1047
1165
|
})]);
|
|
1048
1166
|
case 3:
|
|
1049
|
-
return
|
|
1167
|
+
return a = u.sent(), a === void 0 ? [
|
|
1050
1168
|
2
|
|
1051
1169
|
/*return*/
|
|
1052
|
-
] : (c =
|
|
1170
|
+
] : (c = a.map(function(f) {
|
|
1053
1171
|
return f.value;
|
|
1054
|
-
}),
|
|
1172
|
+
}), a.some(function(f) {
|
|
1055
1173
|
return f.done;
|
|
1056
|
-
}) ? [2, c] : [4,
|
|
1174
|
+
}) ? [2, c] : [4, o(c)]);
|
|
1057
1175
|
case 4:
|
|
1058
|
-
return
|
|
1176
|
+
return u.sent(), [3, 2];
|
|
1059
1177
|
case 5:
|
|
1060
1178
|
return [3, 8];
|
|
1061
1179
|
case 6:
|
|
1062
|
-
return
|
|
1180
|
+
return i(), [4, Promise.all(t.map(function(f) {
|
|
1063
1181
|
return f.return && f.return();
|
|
1064
1182
|
}))];
|
|
1065
1183
|
case 7:
|
|
1066
|
-
return
|
|
1184
|
+
return u.sent(), [
|
|
1067
1185
|
7
|
|
1068
1186
|
/*endfinally*/
|
|
1069
1187
|
];
|
|
@@ -1077,79 +1195,79 @@ function Te(t) {
|
|
|
1077
1195
|
});
|
|
1078
1196
|
});
|
|
1079
1197
|
}
|
|
1080
|
-
function
|
|
1081
|
-
var n = this,
|
|
1198
|
+
function st(e) {
|
|
1199
|
+
var n = this, t = Y(e, {
|
|
1082
1200
|
yieldValues: !0,
|
|
1083
1201
|
returnValues: !0
|
|
1084
1202
|
});
|
|
1085
|
-
return new
|
|
1086
|
-
return
|
|
1087
|
-
var
|
|
1088
|
-
return
|
|
1203
|
+
return new U(function(o, i) {
|
|
1204
|
+
return M(n, void 0, void 0, function() {
|
|
1205
|
+
var r, s, a, c, u, f = this;
|
|
1206
|
+
return A(this, function(h) {
|
|
1089
1207
|
switch (h.label) {
|
|
1090
1208
|
case 0:
|
|
1091
|
-
if (!
|
|
1092
|
-
return
|
|
1093
|
-
|
|
1094
|
-
var
|
|
1095
|
-
|
|
1209
|
+
if (!t.length)
|
|
1210
|
+
return i(), [2, []];
|
|
1211
|
+
s = [], a = !1, i.then(function() {
|
|
1212
|
+
var l, y;
|
|
1213
|
+
r();
|
|
1096
1214
|
try {
|
|
1097
|
-
for (var
|
|
1098
|
-
var
|
|
1099
|
-
|
|
1215
|
+
for (var d = R(s), m = d.next(); !m.done; m = d.next()) {
|
|
1216
|
+
var j = m.value;
|
|
1217
|
+
j();
|
|
1100
1218
|
}
|
|
1101
|
-
} catch (
|
|
1102
|
-
|
|
1219
|
+
} catch (E) {
|
|
1220
|
+
l = { error: E };
|
|
1103
1221
|
} finally {
|
|
1104
1222
|
try {
|
|
1105
|
-
|
|
1223
|
+
m && !m.done && (y = d.return) && y.call(d);
|
|
1106
1224
|
} finally {
|
|
1107
|
-
if (
|
|
1225
|
+
if (l) throw l.error;
|
|
1108
1226
|
}
|
|
1109
1227
|
}
|
|
1110
|
-
|
|
1228
|
+
a = !0;
|
|
1111
1229
|
}), h.label = 1;
|
|
1112
1230
|
case 1:
|
|
1113
|
-
return h.trys.push([1, , 5, 7]), Promise.all(
|
|
1114
|
-
return
|
|
1115
|
-
})).then(function(
|
|
1116
|
-
return
|
|
1117
|
-
}, function(
|
|
1118
|
-
return
|
|
1119
|
-
}), [4, new Promise(function(
|
|
1120
|
-
return
|
|
1231
|
+
return h.trys.push([1, , 5, 7]), Promise.all(t.map(function(l) {
|
|
1232
|
+
return l.next();
|
|
1233
|
+
})).then(function(l) {
|
|
1234
|
+
return r(l);
|
|
1235
|
+
}, function(l) {
|
|
1236
|
+
return i(l);
|
|
1237
|
+
}), [4, new Promise(function(l) {
|
|
1238
|
+
return r = l;
|
|
1121
1239
|
})];
|
|
1122
1240
|
case 2:
|
|
1123
1241
|
return c = h.sent(), c === void 0 ? [
|
|
1124
1242
|
2
|
|
1125
1243
|
/*return*/
|
|
1126
|
-
] : (
|
|
1127
|
-
return
|
|
1128
|
-
}), c.every(function(
|
|
1129
|
-
return
|
|
1130
|
-
}) ? [2,
|
|
1244
|
+
] : (u = c.map(function(l) {
|
|
1245
|
+
return l.value;
|
|
1246
|
+
}), c.every(function(l) {
|
|
1247
|
+
return l.done;
|
|
1248
|
+
}) ? [2, u] : [4, o(u.slice())]);
|
|
1131
1249
|
case 3:
|
|
1132
|
-
return h.sent(), [4, Promise.all(
|
|
1133
|
-
return
|
|
1134
|
-
var
|
|
1135
|
-
return
|
|
1136
|
-
switch (
|
|
1250
|
+
return h.sent(), [4, Promise.all(t.map(function(l, y) {
|
|
1251
|
+
return M(f, void 0, void 0, function() {
|
|
1252
|
+
var d;
|
|
1253
|
+
return A(this, function(m) {
|
|
1254
|
+
switch (m.label) {
|
|
1137
1255
|
case 0:
|
|
1138
|
-
if (c[
|
|
1139
|
-
return [2, c[
|
|
1140
|
-
|
|
1256
|
+
if (c[y].done)
|
|
1257
|
+
return [2, c[y].value];
|
|
1258
|
+
m.label = 1;
|
|
1141
1259
|
case 1:
|
|
1142
|
-
return
|
|
1143
|
-
return
|
|
1144
|
-
}, function(
|
|
1145
|
-
return
|
|
1146
|
-
}), [4, new Promise(function(
|
|
1147
|
-
return
|
|
1260
|
+
return a ? [3, 4] : (Promise.resolve(l.next()).then(function(j) {
|
|
1261
|
+
return s[y](j);
|
|
1262
|
+
}, function(j) {
|
|
1263
|
+
return i(j);
|
|
1264
|
+
}), [4, new Promise(function(j) {
|
|
1265
|
+
return s[y] = j;
|
|
1148
1266
|
})]);
|
|
1149
1267
|
case 2:
|
|
1150
|
-
return
|
|
1268
|
+
return d = m.sent(), d === void 0 ? [2, c[y].value] : d.done ? [2, d.value] : (u[y] = d.value, [4, o(u.slice())]);
|
|
1151
1269
|
case 3:
|
|
1152
|
-
return
|
|
1270
|
+
return m.sent(), [3, 1];
|
|
1153
1271
|
case 4:
|
|
1154
1272
|
return [
|
|
1155
1273
|
2
|
|
@@ -1162,8 +1280,8 @@ function Fe(t) {
|
|
|
1162
1280
|
case 4:
|
|
1163
1281
|
return [2, h.sent()];
|
|
1164
1282
|
case 5:
|
|
1165
|
-
return
|
|
1166
|
-
return
|
|
1283
|
+
return i(), [4, Promise.all(t.map(function(l) {
|
|
1284
|
+
return l.return && l.return();
|
|
1167
1285
|
}))];
|
|
1168
1286
|
case 6:
|
|
1169
1287
|
return h.sent(), [
|
|
@@ -1180,149 +1298,57 @@ function Fe(t) {
|
|
|
1180
1298
|
});
|
|
1181
1299
|
});
|
|
1182
1300
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
return
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
);
|
|
1301
|
+
class ut {
|
|
1302
|
+
ajv_;
|
|
1303
|
+
graffiti;
|
|
1304
|
+
callbacks = /* @__PURE__ */ new Set();
|
|
1305
|
+
options;
|
|
1306
|
+
login;
|
|
1307
|
+
logout;
|
|
1308
|
+
sessionEvents;
|
|
1309
|
+
postMedia;
|
|
1310
|
+
getMedia;
|
|
1311
|
+
deleteMedia;
|
|
1312
|
+
actorToHandle;
|
|
1313
|
+
handleToActor;
|
|
1314
|
+
get ajv() {
|
|
1315
|
+
return this.ajv_ || (this.ajv_ = (async () => {
|
|
1316
|
+
const { default: n } = await import("./ajv-D_HICdxS.mjs").then((t) => t.a);
|
|
1317
|
+
return new n({ strict: !1 });
|
|
1318
|
+
})()), this.ajv_;
|
|
1202
1319
|
}
|
|
1203
|
-
}
|
|
1204
|
-
function Ne(t, n, e) {
|
|
1205
|
-
t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
|
|
1206
|
-
(r) => n.includes(r)
|
|
1207
|
-
));
|
|
1208
|
-
}
|
|
1209
|
-
function Be(t, n) {
|
|
1210
|
-
return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
|
|
1211
|
-
}
|
|
1212
|
-
class Me extends ve {
|
|
1213
1320
|
/**
|
|
1214
1321
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1215
1322
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
1216
1323
|
* must be used for all functions for the synchronize methods to work.
|
|
1217
1324
|
*/
|
|
1218
|
-
constructor(
|
|
1219
|
-
|
|
1220
|
-
v(this, "ajv_");
|
|
1221
|
-
v(this, "applyPatch_");
|
|
1222
|
-
v(this, "graffiti");
|
|
1223
|
-
v(this, "callbacks", /* @__PURE__ */ new Set());
|
|
1224
|
-
v(this, "options");
|
|
1225
|
-
v(this, "channelStats");
|
|
1226
|
-
v(this, "login");
|
|
1227
|
-
v(this, "logout");
|
|
1228
|
-
v(this, "sessionEvents");
|
|
1229
|
-
v(this, "get", async (...e) => {
|
|
1230
|
-
const r = await this.graffiti.get(...e);
|
|
1231
|
-
return this.synchronizeDispatch({ object: r }), r;
|
|
1232
|
-
});
|
|
1233
|
-
v(this, "put", async (...e) => {
|
|
1234
|
-
const r = await this.graffiti.put(...e), o = e[0], i = {
|
|
1235
|
-
...r,
|
|
1236
|
-
value: o.value,
|
|
1237
|
-
channels: o.channels,
|
|
1238
|
-
allowed: o.allowed
|
|
1239
|
-
};
|
|
1240
|
-
return await this.synchronizeDispatch(
|
|
1241
|
-
{
|
|
1242
|
-
tombstone: !0,
|
|
1243
|
-
object: r
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
object: i
|
|
1247
|
-
},
|
|
1248
|
-
!0
|
|
1249
|
-
), r;
|
|
1250
|
-
});
|
|
1251
|
-
v(this, "patch", async (...e) => {
|
|
1252
|
-
const r = await this.graffiti.patch(...e), o = { ...r };
|
|
1253
|
-
for (const i of ["value", "channels", "allowed"])
|
|
1254
|
-
De(await this.applyPatch, i, e[0], o);
|
|
1255
|
-
return await this.synchronizeDispatch(
|
|
1256
|
-
{
|
|
1257
|
-
tombstone: !0,
|
|
1258
|
-
object: r
|
|
1259
|
-
},
|
|
1260
|
-
{
|
|
1261
|
-
object: o
|
|
1262
|
-
},
|
|
1263
|
-
!0
|
|
1264
|
-
), r;
|
|
1265
|
-
});
|
|
1266
|
-
v(this, "delete", async (...e) => {
|
|
1267
|
-
const r = await this.graffiti.delete(...e);
|
|
1268
|
-
return await this.synchronizeDispatch(
|
|
1269
|
-
{
|
|
1270
|
-
tombstone: !0,
|
|
1271
|
-
object: r
|
|
1272
|
-
},
|
|
1273
|
-
void 0,
|
|
1274
|
-
!0
|
|
1275
|
-
), r;
|
|
1276
|
-
});
|
|
1277
|
-
v(this, "discover", (...e) => {
|
|
1278
|
-
const r = this.graffiti.discover(...e);
|
|
1279
|
-
return this.objectStream(r);
|
|
1280
|
-
});
|
|
1281
|
-
v(this, "recoverOrphans", (...e) => {
|
|
1282
|
-
const r = this.graffiti.recoverOrphans(...e);
|
|
1283
|
-
return this.objectStream(r);
|
|
1284
|
-
});
|
|
1285
|
-
v(this, "continueObjectStream", (...e) => this.graffiti.continueObjectStream(...e));
|
|
1286
|
-
this.options = r ?? {}, this.graffiti = e, this.channelStats = e.channelStats.bind(e), this.login = e.login.bind(e), this.logout = e.logout.bind(e), this.sessionEvents = e.sessionEvents;
|
|
1287
|
-
}
|
|
1288
|
-
get ajv() {
|
|
1289
|
-
return this.ajv_ || (this.ajv_ = (async () => {
|
|
1290
|
-
const { default: e } = await import("./ajv-C30pimY5.mjs").then((r) => r.a);
|
|
1291
|
-
return new e({ strict: !1 });
|
|
1292
|
-
})()), this.ajv_;
|
|
1293
|
-
}
|
|
1294
|
-
get applyPatch() {
|
|
1295
|
-
return this.applyPatch_ || (this.applyPatch_ = (async () => {
|
|
1296
|
-
const { applyPatch: e } = await import("./index-CWfNKdDL.mjs");
|
|
1297
|
-
return e;
|
|
1298
|
-
})()), this.applyPatch_;
|
|
1325
|
+
constructor(n, t) {
|
|
1326
|
+
this.options = t ?? {}, this.graffiti = n, this.login = n.login.bind(n), this.logout = n.logout.bind(n), this.sessionEvents = n.sessionEvents, this.postMedia = n.postMedia.bind(n), this.getMedia = n.getMedia.bind(n), this.deleteMedia = n.deleteMedia.bind(n), this.actorToHandle = n.actorToHandle.bind(n), this.handleToActor = n.handleToActor.bind(n);
|
|
1299
1327
|
}
|
|
1300
|
-
synchronize(
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
if (this.options.omniscient || Ne(y, r, i), f(y)) {
|
|
1313
|
-
c({ object: y }), a.add(y.url);
|
|
1314
|
-
break;
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1328
|
+
synchronize(n, t, o, i, r = /* @__PURE__ */ new Set()) {
|
|
1329
|
+
const s = new U(
|
|
1330
|
+
async (a, c) => {
|
|
1331
|
+
const u = lt(await this.ajv, o), f = (h) => {
|
|
1332
|
+
if (h?.tombstone)
|
|
1333
|
+
r.has(h.object.url) && a(h);
|
|
1334
|
+
else if (h && n(h.object) && (this.options.omniscient || Ge(h.object, i))) {
|
|
1335
|
+
let l = JSON.parse(
|
|
1336
|
+
JSON.stringify(h.object)
|
|
1337
|
+
);
|
|
1338
|
+
this.options.omniscient || (l = ke(l, t, i?.actor)), u(l) && (a({ object: l }), r.add(l.url));
|
|
1339
|
+
}
|
|
1317
1340
|
};
|
|
1318
|
-
this.callbacks.add(
|
|
1341
|
+
this.callbacks.add(f), await c, this.callbacks.delete(f);
|
|
1319
1342
|
}
|
|
1320
1343
|
);
|
|
1344
|
+
return (async function* () {
|
|
1345
|
+
for await (const a of s) yield a;
|
|
1346
|
+
})();
|
|
1321
1347
|
}
|
|
1322
1348
|
/**
|
|
1323
1349
|
* This method has the same signature as {@link discover} but listens for
|
|
1324
|
-
* changes made via {@link
|
|
1325
|
-
* fetched from {@link get}, {@link discover}, and {@link
|
|
1350
|
+
* changes made via {@link post} and {@link delete} or
|
|
1351
|
+
* fetched from {@link get}, {@link discover}, and {@link continueDiscover}
|
|
1326
1352
|
* and then streams appropriate changes to provide a responsive and
|
|
1327
1353
|
* consistent user experience.
|
|
1328
1354
|
*
|
|
@@ -1330,53 +1356,38 @@ class Me extends ve {
|
|
|
1330
1356
|
* and will not terminate unless the user calls the `return` method on the iterator
|
|
1331
1357
|
* or `break`s out of the loop.
|
|
1332
1358
|
*
|
|
1333
|
-
* @group Synchronize Methods
|
|
1359
|
+
* @group 0 - Synchronize Methods
|
|
1334
1360
|
*/
|
|
1335
|
-
synchronizeDiscover(
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
return l.channels.some((c) => r.includes(c));
|
|
1361
|
+
synchronizeDiscover(n, t, o) {
|
|
1362
|
+
function i(r) {
|
|
1363
|
+
return r.channels.some((s) => n.includes(s));
|
|
1339
1364
|
}
|
|
1340
|
-
return this.synchronize(
|
|
1365
|
+
return this.synchronize(i, n, t, o);
|
|
1341
1366
|
}
|
|
1342
1367
|
/**
|
|
1343
1368
|
* This method has the same signature as {@link get} but
|
|
1344
|
-
* listens for changes made via {@link
|
|
1345
|
-
* fetched from {@link get}, {@link discover}, and {@link
|
|
1369
|
+
* listens for changes made via {@link post}, and {@link delete} or
|
|
1370
|
+
* fetched from {@link get}, {@link discover}, and {@link continueDiscover} and then
|
|
1346
1371
|
* streams appropriate changes to provide a responsive and consistent user experience.
|
|
1347
1372
|
*
|
|
1348
1373
|
* Unlike {@link get}, which returns a single result, this method continuously
|
|
1349
1374
|
* listens for changes which are output as an asynchronous stream, similar
|
|
1350
1375
|
* to {@link discover}.
|
|
1351
1376
|
*
|
|
1352
|
-
* @group Synchronize Methods
|
|
1377
|
+
* @group 0 - Synchronize Methods
|
|
1353
1378
|
*/
|
|
1354
|
-
synchronizeGet(
|
|
1355
|
-
const
|
|
1356
|
-
function
|
|
1357
|
-
return
|
|
1379
|
+
synchronizeGet(n, t, o) {
|
|
1380
|
+
const i = te(n);
|
|
1381
|
+
function r(s) {
|
|
1382
|
+
return s.url === i;
|
|
1358
1383
|
}
|
|
1359
|
-
return this.synchronize(
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
* streams appropriate changes to provide a responsive and consistent user experience.
|
|
1367
|
-
*
|
|
1368
|
-
* Unlike {@link recoverOrphans}, this method continuously listens for changes
|
|
1369
|
-
* and will not terminate unless the user calls the `return` method on the iterator
|
|
1370
|
-
* or `break`s out of the loop.
|
|
1371
|
-
*
|
|
1372
|
-
* @group Synchronize Methods
|
|
1373
|
-
*/
|
|
1374
|
-
synchronizeRecoverOrphans(...e) {
|
|
1375
|
-
const [r, o] = e;
|
|
1376
|
-
function i(a) {
|
|
1377
|
-
return a.actor === o.actor && a.channels.length === 0;
|
|
1378
|
-
}
|
|
1379
|
-
return this.synchronize(i, [], r, o);
|
|
1384
|
+
return this.synchronize(
|
|
1385
|
+
r,
|
|
1386
|
+
[],
|
|
1387
|
+
t,
|
|
1388
|
+
o,
|
|
1389
|
+
/* @__PURE__ */ new Set([i])
|
|
1390
|
+
);
|
|
1380
1391
|
}
|
|
1381
1392
|
/**
|
|
1382
1393
|
* Streams changes made to *any* object in *any* channel
|
|
@@ -1387,80 +1398,129 @@ class Me extends ve {
|
|
|
1387
1398
|
*
|
|
1388
1399
|
* Be careful using this method. Without additional filters it can
|
|
1389
1400
|
* expose the user to content out of context.
|
|
1401
|
+
*
|
|
1402
|
+
* @group 0 - Synchronize Methods
|
|
1390
1403
|
*/
|
|
1391
|
-
synchronizeAll(
|
|
1392
|
-
return this.synchronize(() => !0, [],
|
|
1404
|
+
synchronizeAll(n, t) {
|
|
1405
|
+
return this.synchronize(() => !0, [], n, t);
|
|
1393
1406
|
}
|
|
1394
|
-
async synchronizeDispatch(
|
|
1395
|
-
for (const
|
|
1396
|
-
|
|
1397
|
-
|
|
1407
|
+
async synchronizeDispatch(n, t = !1) {
|
|
1408
|
+
for (const o of this.callbacks)
|
|
1409
|
+
o(n);
|
|
1410
|
+
t && await new Promise((o) => setTimeout(o, 0));
|
|
1398
1411
|
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1412
|
+
get = async (...n) => {
|
|
1413
|
+
try {
|
|
1414
|
+
const t = await this.graffiti.get(...n);
|
|
1415
|
+
return this.synchronizeDispatch({ object: t }), t;
|
|
1416
|
+
} catch (t) {
|
|
1417
|
+
throw t instanceof D && this.synchronizeDispatch({
|
|
1418
|
+
tombstone: !0,
|
|
1419
|
+
object: { url: te(n[0]) }
|
|
1420
|
+
}), t;
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
post = async (...n) => {
|
|
1424
|
+
const t = await this.graffiti.post(...n);
|
|
1425
|
+
return await this.synchronizeDispatch({ object: t }, !0), t;
|
|
1426
|
+
};
|
|
1427
|
+
delete = async (...n) => {
|
|
1428
|
+
const t = {
|
|
1429
|
+
tombstone: !0,
|
|
1430
|
+
object: { url: te(n[0]) }
|
|
1431
|
+
};
|
|
1432
|
+
try {
|
|
1433
|
+
const o = await this.graffiti.delete(...n);
|
|
1434
|
+
return await this.synchronizeDispatch(t, !0), o;
|
|
1435
|
+
} catch (o) {
|
|
1436
|
+
throw o instanceof D && await this.synchronizeDispatch(t, !0), o;
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
objectStreamContinue(n) {
|
|
1440
|
+
const t = this;
|
|
1441
|
+
return (async function* () {
|
|
1402
1442
|
for (; ; ) {
|
|
1403
|
-
const o = await
|
|
1443
|
+
const o = await n.next();
|
|
1404
1444
|
if (o.done) {
|
|
1405
|
-
const { continue: i, cursor:
|
|
1445
|
+
const { continue: i, cursor: r } = o.value;
|
|
1406
1446
|
return {
|
|
1407
|
-
continue: () =>
|
|
1408
|
-
cursor:
|
|
1447
|
+
continue: (s) => t.objectStreamContinue(i(s)),
|
|
1448
|
+
cursor: r
|
|
1409
1449
|
};
|
|
1410
1450
|
}
|
|
1411
|
-
o.value.error ||
|
|
1412
|
-
o.value
|
|
1413
|
-
), yield o.value;
|
|
1451
|
+
o.value.error || t.synchronizeDispatch(o.value), yield o.value;
|
|
1414
1452
|
}
|
|
1415
|
-
}();
|
|
1453
|
+
})();
|
|
1416
1454
|
}
|
|
1417
|
-
objectStream(
|
|
1418
|
-
const
|
|
1419
|
-
return async function* () {
|
|
1455
|
+
objectStream(n) {
|
|
1456
|
+
const t = this.objectStreamContinue(n);
|
|
1457
|
+
return (async function* () {
|
|
1420
1458
|
for (; ; ) {
|
|
1421
|
-
const o = await
|
|
1459
|
+
const o = await t.next();
|
|
1422
1460
|
if (o.done) return o.value;
|
|
1423
1461
|
(o.value.error || !o.value.tombstone) && (yield o.value);
|
|
1424
1462
|
}
|
|
1425
|
-
}();
|
|
1463
|
+
})();
|
|
1464
|
+
}
|
|
1465
|
+
discover = (...n) => {
|
|
1466
|
+
const t = this.graffiti.discover(...n);
|
|
1467
|
+
return this.objectStream(t);
|
|
1468
|
+
};
|
|
1469
|
+
continueDiscover = (...n) => {
|
|
1470
|
+
const t = this.graffiti.continueDiscover(...n);
|
|
1471
|
+
return this.objectStreamContinue(t);
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
function lt(e, n) {
|
|
1475
|
+
try {
|
|
1476
|
+
return e.compile(n);
|
|
1477
|
+
} catch (t) {
|
|
1478
|
+
throw new Se(
|
|
1479
|
+
t instanceof Error ? t.message : String(t)
|
|
1480
|
+
);
|
|
1426
1481
|
}
|
|
1427
1482
|
}
|
|
1428
|
-
const
|
|
1429
|
-
install(
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
if (
|
|
1434
|
-
const
|
|
1435
|
-
if (
|
|
1436
|
-
const c =
|
|
1437
|
-
|
|
1483
|
+
const ft = {
|
|
1484
|
+
install(e, n) {
|
|
1485
|
+
const t = n.graffiti, o = new ut(t), i = k(void 0);
|
|
1486
|
+
o.sessionEvents.addEventListener("initialized", async (r) => {
|
|
1487
|
+
const s = r.detail;
|
|
1488
|
+
if (s && s.error && console.error(s.error), s && s.href) {
|
|
1489
|
+
const a = e.config.globalProperties.$router;
|
|
1490
|
+
if (a) {
|
|
1491
|
+
const c = a.options.history.base, u = new URL(s.href);
|
|
1492
|
+
u.pathname.startsWith(c) && (u.pathname = u.pathname.slice(c.length)), await a.replace(u.pathname + u.search + u.hash);
|
|
1438
1493
|
}
|
|
1439
1494
|
}
|
|
1440
|
-
|
|
1441
|
-
}),
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1444
|
-
console.error("Error logging in:"), console.error(
|
|
1495
|
+
i.value || (i.value = null);
|
|
1496
|
+
}), o.sessionEvents.addEventListener("login", (r) => {
|
|
1497
|
+
const s = r.detail;
|
|
1498
|
+
if (s.error) {
|
|
1499
|
+
console.error("Error logging in:"), console.error(s.error);
|
|
1445
1500
|
return;
|
|
1446
1501
|
} else
|
|
1447
|
-
|
|
1448
|
-
}),
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1451
|
-
}),
|
|
1502
|
+
i.value = s.session;
|
|
1503
|
+
}), o.sessionEvents.addEventListener("logout", (r) => {
|
|
1504
|
+
const s = r.detail;
|
|
1505
|
+
s.error ? (console.error("Error logging out:"), console.error(s.error)) : i.value = null;
|
|
1506
|
+
}), Oe(o), Ee(i), e.component("GraffitiDiscover", we), e.component("GraffitiGet", ge), e.component("GraffitiGetMedia", je), e.component("GraffitiActorToHandle", W), e.component("GraffitiHandleToActor", xe), e.component("GraffitiObjectInfo", K), e.config.globalProperties.$graffiti = o, e.config.globalProperties.$graffitiSession = i;
|
|
1452
1507
|
}
|
|
1453
|
-
},
|
|
1508
|
+
}, dt = we, ht = ge, yt = je, pt = W, vt = xe, mt = K;
|
|
1454
1509
|
export {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1510
|
+
pt as GraffitiActorToHandle,
|
|
1511
|
+
dt as GraffitiDiscover,
|
|
1512
|
+
ht as GraffitiGet,
|
|
1513
|
+
yt as GraffitiGetMedia,
|
|
1514
|
+
vt as GraffitiHandleToActor,
|
|
1515
|
+
mt as GraffitiObjectInfo,
|
|
1516
|
+
ft as GraffitiPlugin,
|
|
1517
|
+
ae as useGraffiti,
|
|
1518
|
+
Te as useGraffitiActorToHandle,
|
|
1519
|
+
Ae as useGraffitiDiscover,
|
|
1520
|
+
Ne as useGraffitiGet,
|
|
1521
|
+
Ue as useGraffitiGetMedia,
|
|
1522
|
+
Ke as useGraffitiHandleToActor,
|
|
1523
|
+
ct as useGraffitiSession,
|
|
1524
|
+
X as useGraffitiSynchronize
|
|
1465
1525
|
};
|
|
1466
1526
|
//# sourceMappingURL=plugin.mjs.map
|