@bquery/bquery 1.8.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +255 -27
- package/dist/{a11y-DVBCy09c.js → a11y-DG2i4iZN.js} +3 -3
- package/dist/{a11y-DVBCy09c.js.map → a11y-DG2i4iZN.js.map} +1 -1
- package/dist/a11y.es.mjs +1 -1
- package/dist/{component-L3-JfOFz.js → component-DRotf1hl.js} +19 -18
- package/dist/{component-L3-JfOFz.js.map → component-DRotf1hl.js.map} +1 -1
- package/dist/component.es.mjs +1 -1
- package/dist/concurrency/errors.d.ts +29 -0
- package/dist/concurrency/errors.d.ts.map +1 -0
- package/dist/concurrency/high-level.d.ts +85 -0
- package/dist/concurrency/high-level.d.ts.map +1 -0
- package/dist/concurrency/index.d.ts +19 -0
- package/dist/concurrency/index.d.ts.map +1 -0
- package/dist/concurrency/internal.d.ts +26 -0
- package/dist/concurrency/internal.d.ts.map +1 -0
- package/dist/concurrency/pipeline.d.ts +30 -0
- package/dist/concurrency/pipeline.d.ts.map +1 -0
- package/dist/concurrency/pool.d.ts +48 -0
- package/dist/concurrency/pool.d.ts.map +1 -0
- package/dist/concurrency/reactive.d.ts +107 -0
- package/dist/concurrency/reactive.d.ts.map +1 -0
- package/dist/concurrency/rpc.d.ts +46 -0
- package/dist/concurrency/rpc.d.ts.map +1 -0
- package/dist/concurrency/support.d.ts +23 -0
- package/dist/concurrency/support.d.ts.map +1 -0
- package/dist/concurrency/task.d.ts +31 -0
- package/dist/concurrency/task.d.ts.map +1 -0
- package/dist/concurrency/types.d.ts +343 -0
- package/dist/concurrency/types.d.ts.map +1 -0
- package/dist/concurrency-BU1wPEsZ.js +826 -0
- package/dist/concurrency-BU1wPEsZ.js.map +1 -0
- package/dist/concurrency.es.mjs +29 -0
- package/dist/{constraints-D5RHQLmP.js → constraints-CqjhmpZC.js} +1 -1
- package/dist/{constraints-D5RHQLmP.js.map → constraints-CqjhmpZC.js.map} +1 -1
- package/dist/core-CongXJuo.js +87 -0
- package/dist/core-CongXJuo.js.map +1 -0
- package/dist/{custom-directives-Dr4C5lVV.js → custom-directives-BjFzFhuf.js} +1 -1
- package/dist/{custom-directives-Dr4C5lVV.js.map → custom-directives-BjFzFhuf.js.map} +1 -1
- package/dist/{devtools-BhB2iDPT.js → devtools-C5FExMwv.js} +2 -2
- package/dist/{devtools-BhB2iDPT.js.map → devtools-C5FExMwv.js.map} +1 -1
- package/dist/devtools.es.mjs +1 -1
- package/dist/{dnd-NwZBYh4l.js → dnd-BAqzPlSo.js} +1 -1
- package/dist/{dnd-NwZBYh4l.js.map → dnd-BAqzPlSo.js.map} +1 -1
- package/dist/dnd.es.mjs +1 -1
- package/dist/effect-Cc51IH91.js +87 -0
- package/dist/effect-Cc51IH91.js.map +1 -0
- package/dist/{env-CTdvLaH2.js → env-PvwYHnJq.js} +1 -1
- package/dist/{env-CTdvLaH2.js.map → env-PvwYHnJq.js.map} +1 -1
- package/dist/{forms-UcRHsYxC.js → forms-Dx1Scvh0.js} +30 -29
- package/dist/{forms-UcRHsYxC.js.map → forms-Dx1Scvh0.js.map} +1 -1
- package/dist/forms.es.mjs +1 -1
- package/dist/full.d.ts +6 -4
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +240 -206
- package/dist/full.iife.js +117 -33
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +117 -33
- package/dist/full.umd.js.map +1 -1
- package/dist/{i18n-kuF6Ekj6.js → i18n-Cazyk9RD.js} +3 -3
- package/dist/{i18n-kuF6Ekj6.js.map → i18n-Cazyk9RD.js.map} +1 -1
- package/dist/i18n.es.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.mjs +274 -240
- package/dist/media/index.d.ts +10 -3
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/observers.d.ts +99 -0
- package/dist/media/observers.d.ts.map +1 -0
- package/dist/media/types.d.ts +125 -0
- package/dist/media/types.d.ts.map +1 -1
- package/dist/media-dAKIGPk3.js +514 -0
- package/dist/media-dAKIGPk3.js.map +1 -0
- package/dist/media.es.mjs +12 -9
- package/dist/{motion-BJsAuULb.js → motion-BBMso9Ir.js} +1 -1
- package/dist/{motion-BJsAuULb.js.map → motion-BBMso9Ir.js.map} +1 -1
- package/dist/motion.es.mjs +1 -1
- package/dist/mount-C8O2vXkQ.js +450 -0
- package/dist/mount-C8O2vXkQ.js.map +1 -0
- package/dist/{platform-Dw2gE3zI.js → platform-BPHIXbw8.js} +17 -16
- package/dist/{platform-Dw2gE3zI.js.map → platform-BPHIXbw8.js.map} +1 -1
- package/dist/platform.es.mjs +1 -1
- package/dist/{plugin-C2WuC8SF.js → plugin-DjTqWg-P.js} +2 -2
- package/dist/{plugin-C2WuC8SF.js.map → plugin-DjTqWg-P.js.map} +1 -1
- package/dist/plugin.es.mjs +1 -1
- package/dist/reactive/index.d.ts +2 -2
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/signal.d.ts +2 -1
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/watch.d.ts +49 -0
- package/dist/reactive/watch.d.ts.map +1 -1
- package/dist/reactive/websocket.d.ts +6 -3
- package/dist/reactive/websocket.d.ts.map +1 -1
- package/dist/reactive-BAd2hfl8.js +1171 -0
- package/dist/reactive-BAd2hfl8.js.map +1 -0
- package/dist/reactive.es.mjs +41 -37
- package/dist/readonly-C0ZwS1Tf.js +35 -0
- package/dist/readonly-C0ZwS1Tf.js.map +1 -0
- package/dist/{registry-B08iilIh.js → registry-Cr6VH8CR.js} +1 -1
- package/dist/{registry-B08iilIh.js.map → registry-Cr6VH8CR.js.map} +1 -1
- package/dist/{router-CQikC9Ed.js → router-CCepRMpC.js} +29 -28
- package/dist/{router-CQikC9Ed.js.map → router-CCepRMpC.js.map} +1 -1
- package/dist/router.es.mjs +1 -1
- package/dist/{ssr-_dAcGdzu.js → ssr-D-1IPcfw.js} +4 -4
- package/dist/{ssr-_dAcGdzu.js.map → ssr-D-1IPcfw.js.map} +1 -1
- package/dist/ssr.es.mjs +1 -1
- package/dist/{store-Cb3gPRve.js → store-CjmEeX9-.js} +6 -6
- package/dist/{store-Cb3gPRve.js.map → store-CjmEeX9-.js.map} +1 -1
- package/dist/store.es.mjs +2 -2
- package/dist/{testing-C5Sjfsna.js → testing-TdfaL7VE.js} +8 -8
- package/dist/{testing-C5Sjfsna.js.map → testing-TdfaL7VE.js.map} +1 -1
- package/dist/testing.es.mjs +1 -1
- package/dist/{untrack-D0fnO5k2.js → untrack-bjWDNdyE.js} +11 -10
- package/dist/{untrack-D0fnO5k2.js.map → untrack-bjWDNdyE.js.map} +1 -1
- package/dist/view/directives/aria.d.ts +7 -0
- package/dist/view/directives/aria.d.ts.map +1 -0
- package/dist/view/directives/error.d.ts +7 -0
- package/dist/view/directives/error.d.ts.map +1 -0
- package/dist/view/directives/index.d.ts +2 -0
- package/dist/view/directives/index.d.ts.map +1 -1
- package/dist/view/mount.d.ts.map +1 -1
- package/dist/view/process.d.ts +2 -0
- package/dist/view/process.d.ts.map +1 -1
- package/dist/view.es.mjs +12 -11
- package/package.json +18 -14
- package/src/concurrency/errors.ts +57 -0
- package/src/concurrency/high-level.ts +387 -0
- package/src/concurrency/index.ts +63 -0
- package/src/concurrency/internal.ts +100 -0
- package/src/concurrency/pipeline.ts +133 -0
- package/src/concurrency/pool.ts +450 -0
- package/src/concurrency/reactive.ts +339 -0
- package/src/concurrency/rpc.ts +380 -0
- package/src/concurrency/support.ts +44 -0
- package/src/concurrency/task.ts +318 -0
- package/src/concurrency/types.ts +431 -0
- package/src/full.ts +77 -0
- package/src/index.ts +3 -0
- package/src/media/index.ts +20 -2
- package/src/media/observers.ts +418 -0
- package/src/media/types.ts +136 -0
- package/src/reactive/index.ts +3 -0
- package/src/reactive/signal.ts +2 -1
- package/src/reactive/watch.ts +138 -0
- package/src/reactive/websocket.ts +31 -8
- package/src/view/directives/aria.ts +72 -0
- package/src/view/directives/error.ts +56 -0
- package/src/view/directives/index.ts +2 -0
- package/src/view/mount.ts +4 -0
- package/src/view/process.ts +6 -0
- package/dist/core-DdtZHzsS.js +0 -168
- package/dist/core-DdtZHzsS.js.map +0 -1
- package/dist/media-i-fB5WxI.js +0 -340
- package/dist/media-i-fB5WxI.js.map +0 -1
- package/dist/mount-B4Y8bk8Z.js +0 -403
- package/dist/mount-B4Y8bk8Z.js.map +0 -1
- package/dist/reactive-DwkhUJfP.js +0 -1148
- package/dist/reactive-DwkhUJfP.js.map +0 -1
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import { n as E } from "./core-CongXJuo.js";
|
|
2
|
+
import { n as w, r as L } from "./readonly-C0ZwS1Tf.js";
|
|
3
|
+
var p = class extends Error {
|
|
4
|
+
constructor(e, r, t) {
|
|
5
|
+
super(e), this.name = "TaskWorkerError", this.code = r, t !== void 0 && (this.cause = t);
|
|
6
|
+
}
|
|
7
|
+
}, q = class extends p {
|
|
8
|
+
constructor(e = "Concurrency tasks are not supported in this environment.", r) {
|
|
9
|
+
super(e, "UNSUPPORTED", r), this.name = "TaskWorkerUnsupportedError";
|
|
10
|
+
}
|
|
11
|
+
}, I = class extends p {
|
|
12
|
+
constructor(e, r) {
|
|
13
|
+
super(e, "SERIALIZATION", r), this.name = "TaskWorkerSerializationError";
|
|
14
|
+
}
|
|
15
|
+
}, N = class extends p {
|
|
16
|
+
constructor(e, r) {
|
|
17
|
+
super(e, "TIMEOUT", r), this.name = "TaskWorkerTimeoutError";
|
|
18
|
+
}
|
|
19
|
+
}, R = class extends p {
|
|
20
|
+
constructor(e = "The worker task was aborted.", r) {
|
|
21
|
+
super(e, "ABORT", r), this.name = "TaskWorkerAbortError";
|
|
22
|
+
}
|
|
23
|
+
}, oe = /* @__PURE__ */ new Set([
|
|
24
|
+
"ABORT",
|
|
25
|
+
"BUSY",
|
|
26
|
+
"METHOD_NOT_FOUND",
|
|
27
|
+
"QUEUE_CLEARED",
|
|
28
|
+
"QUEUE_FULL",
|
|
29
|
+
"SERIALIZATION",
|
|
30
|
+
"TERMINATED",
|
|
31
|
+
"TIMEOUT",
|
|
32
|
+
"UNSUPPORTED",
|
|
33
|
+
"WORKER"
|
|
34
|
+
]), se = /\{\s*\[native code\]\s*\}$/u, ae = (e) => typeof e == "string" && oe.has(e), z = (e) => {
|
|
35
|
+
if (!(typeof e != "number" || !Number.isFinite(e) || e <= 0))
|
|
36
|
+
return e;
|
|
37
|
+
}, S = (e) => {
|
|
38
|
+
const r = Function.prototype.toString.call(e).trim();
|
|
39
|
+
if (!r || se.test(r)) throw new I("Task handlers must be standalone user-defined functions or arrow functions.");
|
|
40
|
+
try {
|
|
41
|
+
if (typeof new Function(`return (${r});`)() != "function") throw new TypeError("Task handler did not revive as a function.");
|
|
42
|
+
} catch (t) {
|
|
43
|
+
throw new I("Task handlers must be standalone functions that can be reconstructed in a worker context.", t);
|
|
44
|
+
}
|
|
45
|
+
return r;
|
|
46
|
+
}, _ = (e, r) => {
|
|
47
|
+
const t = new Blob([e], { type: "text/javascript" }), n = URL.createObjectURL(t);
|
|
48
|
+
try {
|
|
49
|
+
return new Worker(n, r ? { name: r } : void 0);
|
|
50
|
+
} finally {
|
|
51
|
+
URL.revokeObjectURL(n);
|
|
52
|
+
}
|
|
53
|
+
}, j = (e) => {
|
|
54
|
+
const r = e?.message || "Worker task failed.", t = ae(e?.code) ? e.code : "WORKER", n = t === "TIMEOUT" ? new N(r) : new p(r, t);
|
|
55
|
+
return n.name = e?.name || n.name, e?.stack && (n.stack = e.stack), n;
|
|
56
|
+
};
|
|
57
|
+
function ie() {
|
|
58
|
+
const e = typeof globalThis.Worker == "function", r = typeof globalThis.Blob == "function", t = typeof globalThis.URL < "u" && globalThis.URL !== null && typeof globalThis.URL.createObjectURL == "function" && typeof globalThis.URL.revokeObjectURL == "function";
|
|
59
|
+
return {
|
|
60
|
+
worker: e,
|
|
61
|
+
blob: r,
|
|
62
|
+
objectUrl: t,
|
|
63
|
+
abortController: typeof globalThis.AbortController == "function",
|
|
64
|
+
supported: e && r && t
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function F() {
|
|
68
|
+
return ie().supported;
|
|
69
|
+
}
|
|
70
|
+
var D = "bq:rpc", ue = (e) => {
|
|
71
|
+
const r = Object.keys(e);
|
|
72
|
+
if (r.length === 0) throw new I("RPC workers require at least one standalone method handler.");
|
|
73
|
+
return r.map((t) => {
|
|
74
|
+
const n = e[t];
|
|
75
|
+
if (typeof n != "function") throw new I(`RPC handler "${t}" must be a standalone function.`);
|
|
76
|
+
return [t, S(n)];
|
|
77
|
+
});
|
|
78
|
+
}, ce = (e) => `'use strict';
|
|
79
|
+
const serializeError = (error) => {
|
|
80
|
+
if (error && typeof error === 'object') {
|
|
81
|
+
return {
|
|
82
|
+
code: typeof error.code === 'string' ? error.code : undefined,
|
|
83
|
+
message: typeof error.message === 'string' ? error.message : 'Worker RPC call failed.',
|
|
84
|
+
name: typeof error.name === 'string' ? error.name : 'Error',
|
|
85
|
+
stack: typeof error.stack === 'string' ? error.stack : undefined,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
message: typeof error === 'string' ? error : 'Worker RPC call failed.',
|
|
91
|
+
name: 'Error',
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const handlers = Object.create(null);
|
|
96
|
+
${e.map(([r, t]) => `handlers[${JSON.stringify(r)}] = (${t});`).join(`
|
|
97
|
+
`)}
|
|
98
|
+
|
|
99
|
+
const hasOwn = Object.prototype.hasOwnProperty;
|
|
100
|
+
|
|
101
|
+
self.onmessage = async (event) => {
|
|
102
|
+
const message = event.data;
|
|
103
|
+
if (!message || message.type !== '${D}') {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const method = typeof message.method === 'string' ? message.method : '';
|
|
108
|
+
if (!hasOwn.call(handlers, method)) {
|
|
109
|
+
self.postMessage({
|
|
110
|
+
error: {
|
|
111
|
+
code: 'METHOD_NOT_FOUND',
|
|
112
|
+
message: 'Unknown RPC method "' + String(method) + '".',
|
|
113
|
+
name: 'TaskWorkerError',
|
|
114
|
+
},
|
|
115
|
+
id: message.id,
|
|
116
|
+
type: 'bq:error',
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
const result = await handlers[method](message.payload);
|
|
123
|
+
self.postMessage({ id: message.id, result, type: 'bq:result' });
|
|
124
|
+
} catch (error) {
|
|
125
|
+
self.postMessage({ error: serializeError(error), id: message.id, type: 'bq:error' });
|
|
126
|
+
}
|
|
127
|
+
};`;
|
|
128
|
+
function M(e, r = {}) {
|
|
129
|
+
if (!F()) throw new q();
|
|
130
|
+
const t = ce(ue(e)), n = z(r.timeout);
|
|
131
|
+
let a = !1, s = null, o = null, d = 0, f;
|
|
132
|
+
const u = () => {
|
|
133
|
+
o && (o.timeoutId !== void 0 && clearTimeout(o.timeoutId), o.abortHandler && f?.removeEventListener("abort", o.abortHandler), o = null, f = void 0);
|
|
134
|
+
}, h = () => {
|
|
135
|
+
s && (s.onmessage = null, s.onerror = null, s.terminate(), s = null);
|
|
136
|
+
}, m = (c) => {
|
|
137
|
+
if (!o) return;
|
|
138
|
+
const l = o;
|
|
139
|
+
u(), l.reject(c);
|
|
140
|
+
}, y = () => {
|
|
141
|
+
if (a) throw new p("The RPC worker has already been terminated.", "TERMINATED");
|
|
142
|
+
if (s) return s;
|
|
143
|
+
const c = _(t, r.name);
|
|
144
|
+
return c.onmessage = (l) => {
|
|
145
|
+
const i = o;
|
|
146
|
+
if (!i) return;
|
|
147
|
+
const g = l.data;
|
|
148
|
+
if (!(!g || g.id !== i.id)) {
|
|
149
|
+
if (u(), g.type === "bq:error") {
|
|
150
|
+
i.reject(j(g.error));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
i.resolve(g.result);
|
|
154
|
+
}
|
|
155
|
+
}, c.onerror = (l) => {
|
|
156
|
+
const i = new p(l.message || "Worker RPC execution failed.", "WORKER");
|
|
157
|
+
h(), m(i);
|
|
158
|
+
}, s = c, c;
|
|
159
|
+
}, k = (c) => {
|
|
160
|
+
h(), m(c);
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
get busy() {
|
|
164
|
+
return o !== null;
|
|
165
|
+
},
|
|
166
|
+
get state() {
|
|
167
|
+
return a ? "terminated" : o ? "running" : "idle";
|
|
168
|
+
},
|
|
169
|
+
call(c, l, i = {}) {
|
|
170
|
+
if (a) return Promise.reject(new p("The RPC worker has already been terminated.", "TERMINATED"));
|
|
171
|
+
if (o) return Promise.reject(new p("This RPC worker is already processing a request. Wait for the current call to finish or create another worker.", "BUSY"));
|
|
172
|
+
if (i.signal?.aborted) return Promise.reject(new R());
|
|
173
|
+
const g = y(), b = z(i.timeout) ?? n, T = d++;
|
|
174
|
+
return new Promise((P, v) => {
|
|
175
|
+
const W = {
|
|
176
|
+
id: T,
|
|
177
|
+
reject: v,
|
|
178
|
+
resolve: P
|
|
179
|
+
};
|
|
180
|
+
i.signal && (W.abortHandler = () => {
|
|
181
|
+
k(new R());
|
|
182
|
+
}, f = i.signal, i.signal.addEventListener("abort", W.abortHandler, { once: !0 })), b !== void 0 && (W.timeoutId = setTimeout(() => {
|
|
183
|
+
k(new N(`Worker RPC call exceeded the timeout of ${b}ms.`));
|
|
184
|
+
}, b)), o = W;
|
|
185
|
+
try {
|
|
186
|
+
g.postMessage({
|
|
187
|
+
id: T,
|
|
188
|
+
method: c,
|
|
189
|
+
payload: l,
|
|
190
|
+
type: D
|
|
191
|
+
}, i.transfer ?? []);
|
|
192
|
+
} catch (ne) {
|
|
193
|
+
h(), m(new I("Failed to serialize the RPC payload or transfer list for worker execution.", ne));
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
terminate() {
|
|
198
|
+
a || (a = !0, h(), m(new p("The RPC worker was terminated.", "TERMINATED")));
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
async function Ie(e, r, t, n = {}) {
|
|
203
|
+
const a = M(e, n);
|
|
204
|
+
try {
|
|
205
|
+
return await a.call(r, t, n);
|
|
206
|
+
} finally {
|
|
207
|
+
a.terminate();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
var H = "bq:run", le = (e) => `'use strict';
|
|
211
|
+
const serializeError = (error) => {
|
|
212
|
+
if (error && typeof error === 'object') {
|
|
213
|
+
return {
|
|
214
|
+
code: typeof error.code === 'string' ? error.code : undefined,
|
|
215
|
+
message: typeof error.message === 'string' ? error.message : 'Worker task failed.',
|
|
216
|
+
name: typeof error.name === 'string' ? error.name : 'Error',
|
|
217
|
+
stack: typeof error.stack === 'string' ? error.stack : undefined,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
message: typeof error === 'string' ? error : 'Worker task failed.',
|
|
223
|
+
name: 'Error',
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const handler = (${e});
|
|
228
|
+
|
|
229
|
+
if (typeof handler !== 'function') {
|
|
230
|
+
throw new TypeError('The worker task handler must evaluate to a function.');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
self.onmessage = async (event) => {
|
|
234
|
+
const message = event.data;
|
|
235
|
+
if (!message || message.type !== '${H}') {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
try {
|
|
240
|
+
const result = await handler(message.payload);
|
|
241
|
+
self.postMessage({ id: message.id, result, type: 'bq:result' });
|
|
242
|
+
} catch (error) {
|
|
243
|
+
self.postMessage({ error: serializeError(error), id: message.id, type: 'bq:error' });
|
|
244
|
+
}
|
|
245
|
+
};`;
|
|
246
|
+
function A(e, r = {}) {
|
|
247
|
+
if (!F()) throw new q();
|
|
248
|
+
const t = le(S(e)), n = z(r.timeout);
|
|
249
|
+
let a = !1, s = null, o = null, d = 0;
|
|
250
|
+
const f = () => {
|
|
251
|
+
o && (o.timeoutId !== void 0 && clearTimeout(o.timeoutId), o.abortHandler && u?.removeEventListener("abort", o.abortHandler), o = null, u = void 0);
|
|
252
|
+
};
|
|
253
|
+
let u;
|
|
254
|
+
const h = () => {
|
|
255
|
+
s && (s.onmessage = null, s.onerror = null, s.terminate(), s = null);
|
|
256
|
+
}, m = (c) => {
|
|
257
|
+
if (!o) return;
|
|
258
|
+
const l = o;
|
|
259
|
+
f(), l.reject(c);
|
|
260
|
+
}, y = () => {
|
|
261
|
+
if (a) throw new p("The task worker has already been terminated.", "TERMINATED");
|
|
262
|
+
if (s) return s;
|
|
263
|
+
const c = _(t, r.name);
|
|
264
|
+
return c.onmessage = (l) => {
|
|
265
|
+
const i = o;
|
|
266
|
+
if (!i) return;
|
|
267
|
+
const g = l.data;
|
|
268
|
+
if (!(!g || g.id !== i.id)) {
|
|
269
|
+
if (f(), g.type === "bq:error") {
|
|
270
|
+
i.reject(j(g.error));
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
i.resolve(g.result);
|
|
274
|
+
}
|
|
275
|
+
}, c.onerror = (l) => {
|
|
276
|
+
const i = new p(l.message || "Worker execution failed.", "WORKER");
|
|
277
|
+
h(), m(i);
|
|
278
|
+
}, s = c, c;
|
|
279
|
+
}, k = (c) => {
|
|
280
|
+
h(), m(c);
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
get busy() {
|
|
284
|
+
return o !== null;
|
|
285
|
+
},
|
|
286
|
+
get state() {
|
|
287
|
+
return a ? "terminated" : o ? "running" : "idle";
|
|
288
|
+
},
|
|
289
|
+
run(c, l = {}) {
|
|
290
|
+
if (a) return Promise.reject(new p("The task worker has already been terminated.", "TERMINATED"));
|
|
291
|
+
if (o) return Promise.reject(new p("This task worker is already running a task. Create another worker or wait for the current task to finish.", "BUSY"));
|
|
292
|
+
if (l.signal?.aborted) return Promise.reject(new R());
|
|
293
|
+
const i = y(), g = z(l.timeout) ?? n, b = d++;
|
|
294
|
+
return new Promise((T, P) => {
|
|
295
|
+
const v = {
|
|
296
|
+
id: b,
|
|
297
|
+
reject: P,
|
|
298
|
+
resolve: T
|
|
299
|
+
};
|
|
300
|
+
l.signal && (v.abortHandler = () => {
|
|
301
|
+
k(new R());
|
|
302
|
+
}, u = l.signal, l.signal.addEventListener("abort", v.abortHandler, { once: !0 })), g !== void 0 && (v.timeoutId = setTimeout(() => {
|
|
303
|
+
k(new N(`Worker task exceeded the timeout of ${g}ms.`));
|
|
304
|
+
}, g)), o = v;
|
|
305
|
+
try {
|
|
306
|
+
i.postMessage({
|
|
307
|
+
id: b,
|
|
308
|
+
payload: c,
|
|
309
|
+
type: H
|
|
310
|
+
}, l.transfer ?? []);
|
|
311
|
+
} catch (W) {
|
|
312
|
+
h(), m(new I("Failed to serialize the task input or transfer list for worker execution.", W));
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
terminate() {
|
|
317
|
+
a || (a = !0, h(), m(new p("The task worker was terminated.", "TERMINATED")));
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
async function de(e, r, t = {}) {
|
|
322
|
+
const n = A(e, t);
|
|
323
|
+
try {
|
|
324
|
+
return await n.run(r, t);
|
|
325
|
+
} finally {
|
|
326
|
+
n.terminate();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
var fe = 4, B = (e, r) => {
|
|
330
|
+
if (e === void 0) return fe;
|
|
331
|
+
if (!Number.isInteger(e) || e < 1) throw new RangeError(`${r} concurrency must be a positive integer.`);
|
|
332
|
+
return e;
|
|
333
|
+
}, Q = (e, r) => {
|
|
334
|
+
if (e === void 0) return Number.POSITIVE_INFINITY;
|
|
335
|
+
if (e === Number.POSITIVE_INFINITY) return e;
|
|
336
|
+
if (!Number.isInteger(e) || e < 0) throw new RangeError(`${r} maxQueue must be a non-negative integer or Infinity.`);
|
|
337
|
+
return e;
|
|
338
|
+
}, U = (e) => {
|
|
339
|
+
e.abortHandler && e.signal && e.signal.removeEventListener("abort", e.abortHandler), e.abortHandler = void 0, e.signal = void 0;
|
|
340
|
+
}, K = ({ abortedWhileQueuedMessage: e, clearMessage: r, concurrency: t, createWorkers: n, queueFullMessage: a, terminatedMessage: s, workerTerminatedMessage: o, runWorker: d, maxQueue: f }) => {
|
|
341
|
+
const u = [], h = n(t);
|
|
342
|
+
let m = !1, y = 0;
|
|
343
|
+
const k = () => {
|
|
344
|
+
if (!(m || u.length === 0))
|
|
345
|
+
for (const l of h) {
|
|
346
|
+
if (u.length === 0) return;
|
|
347
|
+
if (l.busy) continue;
|
|
348
|
+
const i = u.shift();
|
|
349
|
+
if (i.signal?.aborted) {
|
|
350
|
+
U(i), i.reject(new R(e));
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
U(i), y++, d(l, i.job, i.options).then(i.resolve, i.reject).finally(() => {
|
|
354
|
+
y--, k();
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}, c = (l) => {
|
|
358
|
+
const i = u.splice(0);
|
|
359
|
+
for (const g of i)
|
|
360
|
+
U(g), g.reject(l);
|
|
361
|
+
};
|
|
362
|
+
return {
|
|
363
|
+
get state() {
|
|
364
|
+
return m ? "terminated" : y > 0 || u.length > 0 ? "running" : "idle";
|
|
365
|
+
},
|
|
366
|
+
get busy() {
|
|
367
|
+
return y > 0 || u.length > 0;
|
|
368
|
+
},
|
|
369
|
+
concurrency: t,
|
|
370
|
+
get pending() {
|
|
371
|
+
return y;
|
|
372
|
+
},
|
|
373
|
+
get size() {
|
|
374
|
+
return u.length;
|
|
375
|
+
},
|
|
376
|
+
enqueue(l, i = {}) {
|
|
377
|
+
return m ? Promise.reject(new p(o, "TERMINATED")) : i.signal?.aborted ? Promise.reject(new R()) : new Promise((g, b) => {
|
|
378
|
+
const T = {
|
|
379
|
+
job: l,
|
|
380
|
+
options: i,
|
|
381
|
+
reject: b,
|
|
382
|
+
resolve: g
|
|
383
|
+
}, P = h.find((v) => !v.busy);
|
|
384
|
+
if (P) {
|
|
385
|
+
y++, d(P, l, i).then(g, b).finally(() => {
|
|
386
|
+
y--, k();
|
|
387
|
+
});
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (u.length >= f) {
|
|
391
|
+
b(new p(a, "QUEUE_FULL"));
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
i.signal && (T.signal = i.signal, T.abortHandler = () => {
|
|
395
|
+
const v = u.indexOf(T);
|
|
396
|
+
v !== -1 && (u.splice(v, 1), U(T), b(new R(e)));
|
|
397
|
+
}, i.signal.addEventListener("abort", T.abortHandler, { once: !0 })), u.push(T);
|
|
398
|
+
});
|
|
399
|
+
},
|
|
400
|
+
clear() {
|
|
401
|
+
m || u.length === 0 || c(new p(r, "QUEUE_CLEARED"));
|
|
402
|
+
},
|
|
403
|
+
terminate() {
|
|
404
|
+
if (!m) {
|
|
405
|
+
m = !0, c(new p(s, "TERMINATED"));
|
|
406
|
+
for (const l of h) "terminate" in l && typeof l.terminate == "function" && l.terminate();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}, Y = (e, r) => e ? r === 1 ? [e] : Array.from({ length: r }, (t, n) => `${e}-${n + 1}`) : Array.from({ length: r }, () => {
|
|
411
|
+
});
|
|
412
|
+
function $(e, r = {}) {
|
|
413
|
+
const { concurrency: t, maxQueue: n, ...a } = r, s = K({
|
|
414
|
+
abortedWhileQueuedMessage: "The queued task was aborted before execution started.",
|
|
415
|
+
clearMessage: "The task pool queue was cleared.",
|
|
416
|
+
concurrency: B(t, "Task pool"),
|
|
417
|
+
createWorkers(o) {
|
|
418
|
+
const d = [], f = Y(a.name, o);
|
|
419
|
+
try {
|
|
420
|
+
for (let u = 0; u < o; u++) d.push(A(e, {
|
|
421
|
+
...a,
|
|
422
|
+
name: f[u]
|
|
423
|
+
}));
|
|
424
|
+
} catch (u) {
|
|
425
|
+
for (const h of d) h.terminate();
|
|
426
|
+
throw u;
|
|
427
|
+
}
|
|
428
|
+
return d;
|
|
429
|
+
},
|
|
430
|
+
queueFullMessage: "The task pool queue is full. Increase maxQueue, wait for pending tasks, or raise pool concurrency.",
|
|
431
|
+
terminatedMessage: "The task pool was terminated.",
|
|
432
|
+
workerTerminatedMessage: "The task pool has already been terminated.",
|
|
433
|
+
runWorker(o, d, f) {
|
|
434
|
+
return o.run(d, f);
|
|
435
|
+
},
|
|
436
|
+
maxQueue: Q(n, "Task pool")
|
|
437
|
+
});
|
|
438
|
+
return {
|
|
439
|
+
get state() {
|
|
440
|
+
return s.state;
|
|
441
|
+
},
|
|
442
|
+
get busy() {
|
|
443
|
+
return s.busy;
|
|
444
|
+
},
|
|
445
|
+
get concurrency() {
|
|
446
|
+
return s.concurrency;
|
|
447
|
+
},
|
|
448
|
+
get pending() {
|
|
449
|
+
return s.pending;
|
|
450
|
+
},
|
|
451
|
+
get size() {
|
|
452
|
+
return s.size;
|
|
453
|
+
},
|
|
454
|
+
run(o, d) {
|
|
455
|
+
return s.enqueue(o, d);
|
|
456
|
+
},
|
|
457
|
+
clear() {
|
|
458
|
+
s.clear();
|
|
459
|
+
},
|
|
460
|
+
terminate() {
|
|
461
|
+
s.terminate();
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
function me(e, r = {}) {
|
|
466
|
+
const { concurrency: t, maxQueue: n, ...a } = r, s = K({
|
|
467
|
+
abortedWhileQueuedMessage: "The queued RPC call was aborted before execution started.",
|
|
468
|
+
clearMessage: "The RPC pool queue was cleared.",
|
|
469
|
+
concurrency: B(t, "RPC pool"),
|
|
470
|
+
createWorkers(o) {
|
|
471
|
+
const d = [], f = Y(a.name, o);
|
|
472
|
+
try {
|
|
473
|
+
for (let u = 0; u < o; u++) d.push(M(e, {
|
|
474
|
+
...a,
|
|
475
|
+
name: f[u]
|
|
476
|
+
}));
|
|
477
|
+
} catch (u) {
|
|
478
|
+
for (const h of d) h.terminate();
|
|
479
|
+
throw u;
|
|
480
|
+
}
|
|
481
|
+
return d;
|
|
482
|
+
},
|
|
483
|
+
queueFullMessage: "The RPC pool queue is full. Increase maxQueue, wait for pending calls, or raise pool concurrency.",
|
|
484
|
+
terminatedMessage: "The RPC pool was terminated.",
|
|
485
|
+
workerTerminatedMessage: "The RPC pool has already been terminated.",
|
|
486
|
+
runWorker(o, d, f) {
|
|
487
|
+
return o.call(d.method, d.input, f);
|
|
488
|
+
},
|
|
489
|
+
maxQueue: Q(n, "RPC pool")
|
|
490
|
+
});
|
|
491
|
+
return {
|
|
492
|
+
get state() {
|
|
493
|
+
return s.state;
|
|
494
|
+
},
|
|
495
|
+
get busy() {
|
|
496
|
+
return s.busy;
|
|
497
|
+
},
|
|
498
|
+
get concurrency() {
|
|
499
|
+
return s.concurrency;
|
|
500
|
+
},
|
|
501
|
+
get pending() {
|
|
502
|
+
return s.pending;
|
|
503
|
+
},
|
|
504
|
+
get size() {
|
|
505
|
+
return s.size;
|
|
506
|
+
},
|
|
507
|
+
call(o, d, f) {
|
|
508
|
+
return s.enqueue({
|
|
509
|
+
input: d,
|
|
510
|
+
method: o
|
|
511
|
+
}, f);
|
|
512
|
+
},
|
|
513
|
+
clear() {
|
|
514
|
+
s.clear();
|
|
515
|
+
},
|
|
516
|
+
terminate() {
|
|
517
|
+
s.terminate();
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
var ge = async (e) => {
|
|
522
|
+
const r = new Function(`return (${e.handlerSource});`)();
|
|
523
|
+
if (typeof r != "function") throw new TypeError("The serialized task handler did not revive as a function.");
|
|
524
|
+
return await r(e.input);
|
|
525
|
+
}, he = async (e) => {
|
|
526
|
+
const r = new Function(`return (${e.handlerSource});`)();
|
|
527
|
+
if (typeof r != "function") throw new TypeError("The serialized collection handler did not revive as a function.");
|
|
528
|
+
const t = [];
|
|
529
|
+
for (const n of e.items) t.push({
|
|
530
|
+
index: n.index,
|
|
531
|
+
value: await r(n.value, n.index)
|
|
532
|
+
});
|
|
533
|
+
return t;
|
|
534
|
+
}, pe = async (e) => {
|
|
535
|
+
const r = new Function(`return (${e.reducerSource});`)();
|
|
536
|
+
if (typeof r != "function") throw new TypeError("The serialized reducer did not revive as a function.");
|
|
537
|
+
let t = e.initialValue;
|
|
538
|
+
for (let n = 0; n < e.values.length; n++) t = await r(t, e.values[n], n);
|
|
539
|
+
return t;
|
|
540
|
+
}, V = (e, r) => {
|
|
541
|
+
if (e === void 0) return 1;
|
|
542
|
+
if (!Number.isInteger(e) || e < 1) throw new RangeError(`${r} batchSize must be a positive integer.`);
|
|
543
|
+
return e;
|
|
544
|
+
}, G = (e) => $(ge, e), Z = (e) => ({
|
|
545
|
+
handlerSource: S(e.handler),
|
|
546
|
+
input: e.input
|
|
547
|
+
}), x = async (e, r, t = {}, n) => {
|
|
548
|
+
if (e.length === 0) return [];
|
|
549
|
+
const a = S(r), { batchSize: s, signal: o, ...d } = t, f = V(s, n), u = $(he, d), h = [];
|
|
550
|
+
for (let m = 0; m < e.length; m += f) {
|
|
551
|
+
const y = Math.min(m + f, e.length), k = [];
|
|
552
|
+
for (let c = m; c < y; c += 1) k.push({
|
|
553
|
+
index: c,
|
|
554
|
+
value: e[c]
|
|
555
|
+
});
|
|
556
|
+
h.push({
|
|
557
|
+
items: k,
|
|
558
|
+
handlerSource: a
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
try {
|
|
562
|
+
const m = await Promise.all(h.map((k) => u.run(k, o ? { signal: o } : void 0))), y = new Array(e.length);
|
|
563
|
+
for (const k of m) for (const c of k) y[c.index] = c.value;
|
|
564
|
+
return y;
|
|
565
|
+
} finally {
|
|
566
|
+
u.terminate();
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
async function Oe(e, r = {}) {
|
|
570
|
+
if (e.length === 0) return [];
|
|
571
|
+
const t = G(r);
|
|
572
|
+
try {
|
|
573
|
+
return await Promise.all(e.map((n) => t.run(Z(n), n.options)));
|
|
574
|
+
} finally {
|
|
575
|
+
t.terminate();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
async function Se(e, r, t = {}) {
|
|
579
|
+
if (e.length === 0) return [];
|
|
580
|
+
const n = V(r, "batchTasks"), a = G(t), s = [];
|
|
581
|
+
try {
|
|
582
|
+
for (let o = 0; o < e.length; o += n) {
|
|
583
|
+
const d = e.slice(o, o + n), f = await Promise.all(d.map((u) => a.run(Z(u), u.options)));
|
|
584
|
+
s.push(...f);
|
|
585
|
+
}
|
|
586
|
+
return s;
|
|
587
|
+
} finally {
|
|
588
|
+
a.terminate();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
async function ye(e, r, t = {}) {
|
|
592
|
+
return x(e, r, t, "map");
|
|
593
|
+
}
|
|
594
|
+
async function ke(e, r, t = {}) {
|
|
595
|
+
const n = await x(e, r, t, "filter"), a = [];
|
|
596
|
+
for (let s = 0; s < e.length; s += 1)
|
|
597
|
+
n[s] && (s in e ? a.push(e[s]) : a.length += 1);
|
|
598
|
+
return a;
|
|
599
|
+
}
|
|
600
|
+
async function we(e, r, t = {}) {
|
|
601
|
+
return e.length === 0 ? !1 : (await x(e, r, t, "some")).some(Boolean);
|
|
602
|
+
}
|
|
603
|
+
async function be(e, r, t = {}) {
|
|
604
|
+
return e.length === 0 ? !0 : (await x(e, r, t, "every")).every(Boolean);
|
|
605
|
+
}
|
|
606
|
+
async function Te(e, r, t = {}) {
|
|
607
|
+
if (e.length === 0) return;
|
|
608
|
+
const n = (await x(e, r, t, "find")).findIndex(Boolean);
|
|
609
|
+
return n === -1 ? void 0 : e[n];
|
|
610
|
+
}
|
|
611
|
+
async function ve(e, r, t, n = {}) {
|
|
612
|
+
return e.length === 0 ? t : de(pe, {
|
|
613
|
+
initialValue: t,
|
|
614
|
+
reducerSource: S(r),
|
|
615
|
+
values: e
|
|
616
|
+
}, n);
|
|
617
|
+
}
|
|
618
|
+
var O = (e, r = {}) => ({
|
|
619
|
+
...e,
|
|
620
|
+
...r
|
|
621
|
+
}), Ee = (e, r = {}) => ({
|
|
622
|
+
signal: "signal" in r ? r.signal : e.signal,
|
|
623
|
+
timeout: "timeout" in r ? r.timeout : e.timeout,
|
|
624
|
+
transfer: r.transfer
|
|
625
|
+
}), Re = class J {
|
|
626
|
+
constructor(r, t) {
|
|
627
|
+
this.valuesPromise = r, this.defaults = t;
|
|
628
|
+
}
|
|
629
|
+
createNext(r) {
|
|
630
|
+
return new J(this.valuesPromise.then((t) => r(t)), this.defaults);
|
|
631
|
+
}
|
|
632
|
+
map(r, t) {
|
|
633
|
+
const n = O(this.defaults, t);
|
|
634
|
+
return this.createNext((a) => ye(a, r, n));
|
|
635
|
+
}
|
|
636
|
+
filter(r, t) {
|
|
637
|
+
const n = O(this.defaults, t);
|
|
638
|
+
return this.createNext((a) => ke(a, r, n));
|
|
639
|
+
}
|
|
640
|
+
toArray() {
|
|
641
|
+
return this.valuesPromise.then((r) => r.slice());
|
|
642
|
+
}
|
|
643
|
+
some(r, t) {
|
|
644
|
+
const n = O(this.defaults, t);
|
|
645
|
+
return this.valuesPromise.then((a) => we(a, r, n));
|
|
646
|
+
}
|
|
647
|
+
every(r, t) {
|
|
648
|
+
const n = O(this.defaults, t);
|
|
649
|
+
return this.valuesPromise.then((a) => be(a, r, n));
|
|
650
|
+
}
|
|
651
|
+
find(r, t) {
|
|
652
|
+
const n = O(this.defaults, t);
|
|
653
|
+
return this.valuesPromise.then((a) => Te(a, r, n));
|
|
654
|
+
}
|
|
655
|
+
reduce(r, t, n) {
|
|
656
|
+
const a = Ee(this.defaults, n);
|
|
657
|
+
return this.valuesPromise.then((s) => ve(s, r, t, a));
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
function xe(e, r = {}) {
|
|
661
|
+
return new Re(Promise.resolve(e.slice()), r);
|
|
662
|
+
}
|
|
663
|
+
var X = (e, r) => {
|
|
664
|
+
L(() => {
|
|
665
|
+
r.state.value = e.state, r.busy.value = e.busy;
|
|
666
|
+
});
|
|
667
|
+
}, ee = (e, r) => {
|
|
668
|
+
L(() => {
|
|
669
|
+
r.state.value = e.state, r.busy.value = e.busy, r.concurrency.value = e.concurrency, r.pending.value = e.pending, r.size.value = e.size;
|
|
670
|
+
});
|
|
671
|
+
}, re = (e) => ({
|
|
672
|
+
busy: E(e.busy),
|
|
673
|
+
state: E(e.state)
|
|
674
|
+
}), te = (e) => ({
|
|
675
|
+
busy: E(e.busy),
|
|
676
|
+
concurrency: E(e.concurrency),
|
|
677
|
+
pending: E(e.pending),
|
|
678
|
+
size: E(e.size),
|
|
679
|
+
state: E(e.state)
|
|
680
|
+
}), C = (e, r) => (r(), e.finally(() => {
|
|
681
|
+
r(), queueMicrotask(r);
|
|
682
|
+
}));
|
|
683
|
+
function Ue(e, r = {}) {
|
|
684
|
+
const t = A(e, r), n = re(t), a = () => {
|
|
685
|
+
X(t, n);
|
|
686
|
+
};
|
|
687
|
+
return {
|
|
688
|
+
get busy() {
|
|
689
|
+
return t.busy;
|
|
690
|
+
},
|
|
691
|
+
get state() {
|
|
692
|
+
return t.state;
|
|
693
|
+
},
|
|
694
|
+
busy$: w(n.busy),
|
|
695
|
+
state$: w(n.state),
|
|
696
|
+
run(s, o = {}) {
|
|
697
|
+
return C(t.run(s, o), a);
|
|
698
|
+
},
|
|
699
|
+
terminate() {
|
|
700
|
+
t.terminate(), a();
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function ze(e, r = {}) {
|
|
705
|
+
const t = M(e, r), n = re(t), a = () => {
|
|
706
|
+
X(t, n);
|
|
707
|
+
};
|
|
708
|
+
return {
|
|
709
|
+
get busy() {
|
|
710
|
+
return t.busy;
|
|
711
|
+
},
|
|
712
|
+
get state() {
|
|
713
|
+
return t.state;
|
|
714
|
+
},
|
|
715
|
+
busy$: w(n.busy),
|
|
716
|
+
state$: w(n.state),
|
|
717
|
+
call(s, o, d = {}) {
|
|
718
|
+
return C(t.call(s, o, d), a);
|
|
719
|
+
},
|
|
720
|
+
terminate() {
|
|
721
|
+
t.terminate(), a();
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
function Ce(e, r = {}) {
|
|
726
|
+
const t = $(e, r), n = te(t), a = () => {
|
|
727
|
+
ee(t, n);
|
|
728
|
+
};
|
|
729
|
+
return {
|
|
730
|
+
get busy() {
|
|
731
|
+
return t.busy;
|
|
732
|
+
},
|
|
733
|
+
get concurrency() {
|
|
734
|
+
return t.concurrency;
|
|
735
|
+
},
|
|
736
|
+
get pending() {
|
|
737
|
+
return t.pending;
|
|
738
|
+
},
|
|
739
|
+
get size() {
|
|
740
|
+
return t.size;
|
|
741
|
+
},
|
|
742
|
+
get state() {
|
|
743
|
+
return t.state;
|
|
744
|
+
},
|
|
745
|
+
busy$: w(n.busy),
|
|
746
|
+
concurrency$: w(n.concurrency),
|
|
747
|
+
pending$: w(n.pending),
|
|
748
|
+
size$: w(n.size),
|
|
749
|
+
state$: w(n.state),
|
|
750
|
+
run(s, o = {}) {
|
|
751
|
+
return C(t.run(s, o), a);
|
|
752
|
+
},
|
|
753
|
+
clear() {
|
|
754
|
+
t.clear(), a();
|
|
755
|
+
},
|
|
756
|
+
terminate() {
|
|
757
|
+
t.terminate(), a();
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function Ne(e, r = {}) {
|
|
762
|
+
const t = me(e, r), n = te(t), a = () => {
|
|
763
|
+
ee(t, n);
|
|
764
|
+
};
|
|
765
|
+
return {
|
|
766
|
+
get busy() {
|
|
767
|
+
return t.busy;
|
|
768
|
+
},
|
|
769
|
+
get concurrency() {
|
|
770
|
+
return t.concurrency;
|
|
771
|
+
},
|
|
772
|
+
get pending() {
|
|
773
|
+
return t.pending;
|
|
774
|
+
},
|
|
775
|
+
get size() {
|
|
776
|
+
return t.size;
|
|
777
|
+
},
|
|
778
|
+
get state() {
|
|
779
|
+
return t.state;
|
|
780
|
+
},
|
|
781
|
+
busy$: w(n.busy),
|
|
782
|
+
concurrency$: w(n.concurrency),
|
|
783
|
+
pending$: w(n.pending),
|
|
784
|
+
size$: w(n.size),
|
|
785
|
+
state$: w(n.state),
|
|
786
|
+
call(s, o, d = {}) {
|
|
787
|
+
return C(t.call(s, o, d), a);
|
|
788
|
+
},
|
|
789
|
+
clear() {
|
|
790
|
+
t.clear(), a();
|
|
791
|
+
},
|
|
792
|
+
terminate() {
|
|
793
|
+
t.terminate(), a();
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
export {
|
|
798
|
+
p as C,
|
|
799
|
+
q as E,
|
|
800
|
+
R as S,
|
|
801
|
+
N as T,
|
|
802
|
+
de as _,
|
|
803
|
+
xe as a,
|
|
804
|
+
ie as b,
|
|
805
|
+
ke as c,
|
|
806
|
+
Oe as d,
|
|
807
|
+
ve as f,
|
|
808
|
+
A as g,
|
|
809
|
+
$ as h,
|
|
810
|
+
Ue as i,
|
|
811
|
+
Te as l,
|
|
812
|
+
me as m,
|
|
813
|
+
ze as n,
|
|
814
|
+
Se as o,
|
|
815
|
+
we as p,
|
|
816
|
+
Ce as r,
|
|
817
|
+
be as s,
|
|
818
|
+
Ne as t,
|
|
819
|
+
ye as u,
|
|
820
|
+
Ie as v,
|
|
821
|
+
I as w,
|
|
822
|
+
F as x,
|
|
823
|
+
M as y
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
//# sourceMappingURL=concurrency-BU1wPEsZ.js.map
|