@camstack/addon-tailscale-client 0.1.12 → 0.1.13
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/assets/icon.svg +1 -0
- package/dist/tailscale.addon.js +14388 -84
- package/dist/tailscale.addon.js.map +1 -1
- package/dist/tailscale.addon.mjs +14384 -81
- package/dist/tailscale.addon.mjs.map +1 -1
- package/package.json +7 -32
- package/dist/@mf-types/compiled-types/page/TailscaleClientOverviewPage.d.ts +0 -20
- package/dist/@mf-types/compiled-types/page/TailscaleClientOverviewPage.d.ts.map +0 -1
- package/dist/@mf-types/compiled-types/page/page.d.ts +0 -8
- package/dist/@mf-types/compiled-types/page/page.d.ts.map +0 -1
- package/dist/@mf-types/page.d.ts +0 -2
- package/dist/@mf-types.d.ts +0 -3
- package/dist/@mf-types.zip +0 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-bYM9BuS1.mjs +0 -12
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-CtHD1dC0.mjs +0 -12
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.mjs-fz-lQtUx.mjs +0 -12
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-B-3nffMn.mjs +0 -73
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-6CvhJC3f.mjs +0 -42
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-Sv3rXvki.mjs +0 -46
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react__loadShare__.mjs-BBqTAV2L.mjs +0 -56
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-BK8BTUon.mjs +0 -18
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_2_dom__loadShare__.mjs-B6pR25zU.mjs +0 -28
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-kyoamNQ7.mjs +0 -18
- package/dist/_stub.js +0 -652
- package/dist/_virtual_mf-localSharedImportMap___mfe_internal__addon_tailscale_client_page-PXP_-hRW.mjs +0 -156
- package/dist/addon-tailscale-client.css +0 -3
- package/dist/client-1J4MstR_.mjs +0 -7592
- package/dist/dist-C168hexw.mjs +0 -17192
- package/dist/dist-CPnIfsyh.mjs +0 -2229
- package/dist/dist-CmoRvaEc.mjs +0 -2483
- package/dist/dist-CwyDJZhZ.mjs +0 -16329
- package/dist/dist-DNrrMIdr.mjs +0 -662
- package/dist/dist-i1I4ldIE.mjs +0 -1260
- package/dist/getErrorShape-BPSzUA7W-C2H3tqHP.mjs +0 -189
- package/dist/hostInit-KpnzzkeJ.mjs +0 -144
- package/dist/jsx-runtime-BmcMHbj3.mjs +0 -22
- package/dist/modern-CWdms43F.mjs +0 -2184
- package/dist/react-BXkW-3WQ.mjs +0 -293
- package/dist/react-dom-BcGsvCWU.mjs +0 -131
- package/dist/remoteEntry.js +0 -83
- package/dist/rolldown-runtime-DC4cgjXG.mjs +0 -20
- package/dist/virtualExposes-wANYNTM2.mjs +0 -27
package/dist/dist-CmoRvaEc.mjs
DELETED
|
@@ -1,2483 +0,0 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./getErrorShape-BPSzUA7W-C2H3tqHP.mjs";
|
|
2
|
-
//#region ../../node_modules/@trpc/client/dist/objectSpread2-BvkFp-_Y.mjs
|
|
3
|
-
var m = Object.create, h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, ee = Object.getOwnPropertyNames, te = Object.getPrototypeOf, ne = Object.prototype.hasOwnProperty, _ = (e, t) => function() {
|
|
4
|
-
return t || (0, e[ee(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
5
|
-
}, re = (e, t, n, r) => {
|
|
6
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = ee(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ne.call(e, s) && s !== n && h(e, s, {
|
|
7
|
-
get: ((e) => t[e]).bind(null, s),
|
|
8
|
-
enumerable: !(r = g(t, s)) || r.enumerable
|
|
9
|
-
});
|
|
10
|
-
return e;
|
|
11
|
-
}, v = (e, t, n) => (n = e == null ? {} : m(te(e)), re(t || !e || !e.__esModule ? h(n, "default", {
|
|
12
|
-
value: e,
|
|
13
|
-
enumerable: !0
|
|
14
|
-
}) : n, e)), ie = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e, t) {
|
|
15
|
-
function n(e) {
|
|
16
|
-
"@babel/helpers - typeof";
|
|
17
|
-
return t.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
18
|
-
return typeof e;
|
|
19
|
-
} : function(e) {
|
|
20
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
21
|
-
}, t.exports.__esModule = !0, t.exports.default = t.exports, n(e);
|
|
22
|
-
}
|
|
23
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
24
|
-
} }), ae = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e, t) {
|
|
25
|
-
var n = ie().default;
|
|
26
|
-
function r(e, t) {
|
|
27
|
-
if (n(e) != "object" || !e) return e;
|
|
28
|
-
var r = e[Symbol.toPrimitive];
|
|
29
|
-
if (r !== void 0) {
|
|
30
|
-
var i = r.call(e, t || "default");
|
|
31
|
-
if (n(i) != "object") return i;
|
|
32
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
33
|
-
}
|
|
34
|
-
return (t === "string" ? String : Number)(e);
|
|
35
|
-
}
|
|
36
|
-
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
37
|
-
} }), oe = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e, t) {
|
|
38
|
-
var n = ie().default, r = ae();
|
|
39
|
-
function i(e) {
|
|
40
|
-
var t = r(e, "string");
|
|
41
|
-
return n(t) == "symbol" ? t : t + "";
|
|
42
|
-
}
|
|
43
|
-
t.exports = i, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
44
|
-
} }), y = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e, t) {
|
|
45
|
-
var n = oe();
|
|
46
|
-
function r(e, t, r) {
|
|
47
|
-
return (t = n(t)) in e ? Object.defineProperty(e, t, {
|
|
48
|
-
value: r,
|
|
49
|
-
enumerable: !0,
|
|
50
|
-
configurable: !0,
|
|
51
|
-
writable: !0
|
|
52
|
-
}) : e[t] = r, e;
|
|
53
|
-
}
|
|
54
|
-
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
55
|
-
} }), b = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e, t) {
|
|
56
|
-
var n = y();
|
|
57
|
-
function r(e, t) {
|
|
58
|
-
var n = Object.keys(e);
|
|
59
|
-
if (Object.getOwnPropertySymbols) {
|
|
60
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
61
|
-
t && (r = r.filter(function(t) {
|
|
62
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
63
|
-
})), n.push.apply(n, r);
|
|
64
|
-
}
|
|
65
|
-
return n;
|
|
66
|
-
}
|
|
67
|
-
function i(e) {
|
|
68
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
69
|
-
var i = arguments[t] == null ? {} : arguments[t];
|
|
70
|
-
t % 2 ? r(Object(i), !0).forEach(function(t) {
|
|
71
|
-
n(e, t, i[t]);
|
|
72
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : r(Object(i)).forEach(function(t) {
|
|
73
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t));
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return e;
|
|
77
|
-
}
|
|
78
|
-
t.exports = i, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
79
|
-
} });
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region ../../node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs
|
|
82
|
-
function x(e) {
|
|
83
|
-
let t = {
|
|
84
|
-
subscribe(t) {
|
|
85
|
-
let n = null, r = !1, i = !1, a = !1;
|
|
86
|
-
function o() {
|
|
87
|
-
if (n === null) {
|
|
88
|
-
a = !0;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
i || (i = !0, typeof n == "function" ? n() : n && n.unsubscribe());
|
|
92
|
-
}
|
|
93
|
-
return n = e({
|
|
94
|
-
next(e) {
|
|
95
|
-
var n;
|
|
96
|
-
r || (n = t.next) == null || n.call(t, e);
|
|
97
|
-
},
|
|
98
|
-
error(e) {
|
|
99
|
-
var n;
|
|
100
|
-
r || (r = !0, (n = t.error) == null || n.call(t, e), o());
|
|
101
|
-
},
|
|
102
|
-
complete() {
|
|
103
|
-
var e;
|
|
104
|
-
r || (r = !0, (e = t.complete) == null || e.call(t), o());
|
|
105
|
-
}
|
|
106
|
-
}), a && o(), { unsubscribe: o };
|
|
107
|
-
},
|
|
108
|
-
pipe(...e) {
|
|
109
|
-
return e.reduce(se, t);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return t;
|
|
113
|
-
}
|
|
114
|
-
function se(e, t) {
|
|
115
|
-
return t(e);
|
|
116
|
-
}
|
|
117
|
-
function ce(e) {
|
|
118
|
-
let t = new AbortController();
|
|
119
|
-
return new Promise((n, r) => {
|
|
120
|
-
let i = !1;
|
|
121
|
-
function a() {
|
|
122
|
-
i || (i = !0, o.unsubscribe());
|
|
123
|
-
}
|
|
124
|
-
t.signal.addEventListener("abort", () => {
|
|
125
|
-
r(t.signal.reason);
|
|
126
|
-
});
|
|
127
|
-
let o = e.subscribe({
|
|
128
|
-
next(e) {
|
|
129
|
-
i = !0, n(e), a();
|
|
130
|
-
},
|
|
131
|
-
error(e) {
|
|
132
|
-
r(e);
|
|
133
|
-
},
|
|
134
|
-
complete() {
|
|
135
|
-
t.abort(), a();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region ../../node_modules/@trpc/server/dist/observable-CUiPknO-.mjs
|
|
142
|
-
function le(e) {
|
|
143
|
-
return (e) => {
|
|
144
|
-
let t = 0, n = null, r = [];
|
|
145
|
-
function i() {
|
|
146
|
-
n ||= e.subscribe({
|
|
147
|
-
next(e) {
|
|
148
|
-
for (let n of r) {
|
|
149
|
-
var t;
|
|
150
|
-
(t = n.next) == null || t.call(n, e);
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
error(e) {
|
|
154
|
-
for (let n of r) {
|
|
155
|
-
var t;
|
|
156
|
-
(t = n.error) == null || t.call(n, e);
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
complete() {
|
|
160
|
-
for (let t of r) {
|
|
161
|
-
var e;
|
|
162
|
-
(e = t.complete) == null || e.call(t);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
function a() {
|
|
168
|
-
if (t === 0 && n) {
|
|
169
|
-
let e = n;
|
|
170
|
-
n = null, e.unsubscribe();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return x((e) => (t++, r.push(e), i(), { unsubscribe() {
|
|
174
|
-
t--, a();
|
|
175
|
-
let n = r.findIndex((t) => t === e);
|
|
176
|
-
n > -1 && r.splice(n, 1);
|
|
177
|
-
} }));
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
function ue(e) {
|
|
181
|
-
return (t) => x((n) => t.subscribe({
|
|
182
|
-
next(t) {
|
|
183
|
-
var r;
|
|
184
|
-
(r = e.next) == null || r.call(e, t), n.next(t);
|
|
185
|
-
},
|
|
186
|
-
error(t) {
|
|
187
|
-
var r;
|
|
188
|
-
(r = e.error) == null || r.call(e, t), n.error(t);
|
|
189
|
-
},
|
|
190
|
-
complete() {
|
|
191
|
-
var t;
|
|
192
|
-
(t = e.complete) == null || t.call(e), n.complete();
|
|
193
|
-
}
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
function S(e) {
|
|
197
|
-
let t = e, n = [], r = (e) => {
|
|
198
|
-
t !== void 0 && e.next(t), n.push(e);
|
|
199
|
-
}, i = (e) => {
|
|
200
|
-
n.splice(n.indexOf(e), 1);
|
|
201
|
-
}, a = x((e) => (r(e), () => {
|
|
202
|
-
i(e);
|
|
203
|
-
}));
|
|
204
|
-
return a.next = (e) => {
|
|
205
|
-
if (t !== e) {
|
|
206
|
-
t = e;
|
|
207
|
-
for (let t of n) t.next(e);
|
|
208
|
-
}
|
|
209
|
-
}, a.get = () => t, a;
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region ../../node_modules/@trpc/client/dist/splitLink-B7Cuf2c_.mjs
|
|
213
|
-
function de(e) {
|
|
214
|
-
return x((t) => {
|
|
215
|
-
function n(t = 0, r = e.op) {
|
|
216
|
-
let i = e.links[t];
|
|
217
|
-
if (!i) throw Error("No more links to execute - did you forget to add an ending link?");
|
|
218
|
-
return i({
|
|
219
|
-
op: r,
|
|
220
|
-
next(e) {
|
|
221
|
-
return n(t + 1, e);
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return n().subscribe(t);
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
function fe(e) {
|
|
229
|
-
return Array.isArray(e) ? e : [e];
|
|
230
|
-
}
|
|
231
|
-
function pe(e) {
|
|
232
|
-
return (t) => {
|
|
233
|
-
let n = fe(e.true).map((e) => e(t)), r = fe(e.false).map((e) => e(t));
|
|
234
|
-
return (t) => x((i) => {
|
|
235
|
-
let a = e.condition(t.op) ? n : r;
|
|
236
|
-
return de({
|
|
237
|
-
op: t.op,
|
|
238
|
-
links: a
|
|
239
|
-
}).subscribe(i);
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region ../../node_modules/@trpc/server/dist/tracked-DWInO6EQ.mjs
|
|
245
|
-
var me = s(c(), 1), he = class extends Error {
|
|
246
|
-
constructor(e) {
|
|
247
|
-
super(ge(e)), Object.assign(this, e);
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
function ge(e) {
|
|
251
|
-
if ("message" in e) return String(e.message);
|
|
252
|
-
}
|
|
253
|
-
function _e(e) {
|
|
254
|
-
if (e instanceof Error) return e;
|
|
255
|
-
let t = typeof e;
|
|
256
|
-
if (!(t === "undefined" || t === "function" || e === null)) {
|
|
257
|
-
if (t !== "object") return Error(String(e));
|
|
258
|
-
if (n(e)) return new he(e);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function C(e) {
|
|
262
|
-
if (e instanceof w || e instanceof Error && e.name === "TRPCError") return e;
|
|
263
|
-
let t = new w({
|
|
264
|
-
code: "INTERNAL_SERVER_ERROR",
|
|
265
|
-
cause: e
|
|
266
|
-
});
|
|
267
|
-
return e instanceof Error && e.stack && (t.stack = e.stack), t;
|
|
268
|
-
}
|
|
269
|
-
var w = class extends Error {
|
|
270
|
-
constructor(e) {
|
|
271
|
-
let t = _e(e.cause), n = e.message ?? t?.message ?? e.code;
|
|
272
|
-
super(n, { cause: t }), (0, me.default)(this, "cause", void 0), (0, me.default)(this, "code", void 0), this.code = e.code, this.name = "TRPCError", this.cause ??= t;
|
|
273
|
-
}
|
|
274
|
-
}, T = s(d(), 1);
|
|
275
|
-
function ve(e, t) {
|
|
276
|
-
if ("error" in e) {
|
|
277
|
-
let n = t.deserialize(e.error);
|
|
278
|
-
return {
|
|
279
|
-
ok: !1,
|
|
280
|
-
error: (0, T.default)((0, T.default)({}, e), {}, { error: n })
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
return {
|
|
284
|
-
ok: !0,
|
|
285
|
-
result: (0, T.default)((0, T.default)({}, e.result), (!e.result.type || e.result.type === "data") && {
|
|
286
|
-
type: "data",
|
|
287
|
-
data: t.deserialize(e.result.data)
|
|
288
|
-
})
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
var ye = class extends Error {
|
|
292
|
-
constructor() {
|
|
293
|
-
super("Unable to transform response from server");
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
function E(e, t) {
|
|
297
|
-
let r;
|
|
298
|
-
try {
|
|
299
|
-
r = ve(e, t);
|
|
300
|
-
} catch {
|
|
301
|
-
throw new ye();
|
|
302
|
-
}
|
|
303
|
-
if (!r.ok && (!n(r.error.error) || typeof r.error.error.code != "number") || r.ok && !n(r.result)) throw new ye();
|
|
304
|
-
return r;
|
|
305
|
-
}
|
|
306
|
-
s(d(), 1);
|
|
307
|
-
function be(e) {
|
|
308
|
-
return typeof e == "function";
|
|
309
|
-
}
|
|
310
|
-
async function xe(e, t) {
|
|
311
|
-
let { _def: n } = e, r = n.procedures[t];
|
|
312
|
-
for (; !r;) {
|
|
313
|
-
let e = Object.keys(n.lazy).find((e) => t.startsWith(e));
|
|
314
|
-
if (!e) return null;
|
|
315
|
-
await n.lazy[e].load(), r = n.procedures[t];
|
|
316
|
-
}
|
|
317
|
-
return r;
|
|
318
|
-
}
|
|
319
|
-
async function Se(e) {
|
|
320
|
-
let { type: t, path: n } = e, r = await xe(e.router, n);
|
|
321
|
-
if (!r || !be(r) || r._def.type !== t && !e.allowMethodOverride) throw new w({
|
|
322
|
-
code: "NOT_FOUND",
|
|
323
|
-
message: `No "${t}"-procedure on path "${n}"`
|
|
324
|
-
});
|
|
325
|
-
/* istanbul ignore if -- @preserve */
|
|
326
|
-
if (r._def.type !== t && e.allowMethodOverride && r._def.type === "subscription") throw new w({
|
|
327
|
-
code: "METHOD_NOT_SUPPORTED",
|
|
328
|
-
message: "Method override is not supported for subscriptions"
|
|
329
|
-
});
|
|
330
|
-
return r(e);
|
|
331
|
-
}
|
|
332
|
-
var Ce = Symbol();
|
|
333
|
-
function we(e) {
|
|
334
|
-
return Array.isArray(e) && e[2] === Ce;
|
|
335
|
-
}
|
|
336
|
-
s(d(), 1);
|
|
337
|
-
function Te(e) {
|
|
338
|
-
return n(e) && e.name === "AbortError";
|
|
339
|
-
}
|
|
340
|
-
var D = s(c(), 1), Ee, O = /* @__PURE__ */ new WeakMap(), De = () => {};
|
|
341
|
-
Ee = Symbol.toStringTag;
|
|
342
|
-
var Oe = class e {
|
|
343
|
-
constructor(e) {
|
|
344
|
-
(0, D.default)(this, "promise", void 0), (0, D.default)(this, "subscribers", []), (0, D.default)(this, "settlement", null), (0, D.default)(this, Ee, "Unpromise"), typeof e == "function" ? this.promise = new Promise(e) : this.promise = e;
|
|
345
|
-
let t = this.promise.then((e) => {
|
|
346
|
-
let { subscribers: t } = this;
|
|
347
|
-
this.subscribers = null, this.settlement = {
|
|
348
|
-
status: "fulfilled",
|
|
349
|
-
value: e
|
|
350
|
-
}, t?.forEach(({ resolve: t }) => {
|
|
351
|
-
t(e);
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
"catch" in t && t.catch((e) => {
|
|
355
|
-
let { subscribers: t } = this;
|
|
356
|
-
this.subscribers = null, this.settlement = {
|
|
357
|
-
status: "rejected",
|
|
358
|
-
reason: e
|
|
359
|
-
}, t?.forEach(({ reject: t }) => {
|
|
360
|
-
t(e);
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
subscribe() {
|
|
365
|
-
let e, t, { settlement: n } = this;
|
|
366
|
-
if (n === null) {
|
|
367
|
-
if (this.subscribers === null) throw Error("Unpromise settled but still has subscribers");
|
|
368
|
-
let n = Ae();
|
|
369
|
-
this.subscribers = je(this.subscribers, n), e = n.promise, t = () => {
|
|
370
|
-
this.subscribers !== null && (this.subscribers = Ne(this.subscribers, n));
|
|
371
|
-
};
|
|
372
|
-
} else {
|
|
373
|
-
let { status: r } = n;
|
|
374
|
-
e = r === "fulfilled" ? Promise.resolve(n.value) : Promise.reject(n.reason), t = De;
|
|
375
|
-
}
|
|
376
|
-
return Object.assign(e, { unsubscribe: t });
|
|
377
|
-
}
|
|
378
|
-
then(e, t) {
|
|
379
|
-
let n = this.subscribe(), { unsubscribe: r } = n;
|
|
380
|
-
return Object.assign(n.then(e, t), { unsubscribe: r });
|
|
381
|
-
}
|
|
382
|
-
catch(e) {
|
|
383
|
-
let t = this.subscribe(), { unsubscribe: n } = t;
|
|
384
|
-
return Object.assign(t.catch(e), { unsubscribe: n });
|
|
385
|
-
}
|
|
386
|
-
finally(e) {
|
|
387
|
-
let t = this.subscribe(), { unsubscribe: n } = t;
|
|
388
|
-
return Object.assign(t.finally(e), { unsubscribe: n });
|
|
389
|
-
}
|
|
390
|
-
static proxy(t) {
|
|
391
|
-
let n = e.getSubscribablePromise(t);
|
|
392
|
-
return n === void 0 ? e.createSubscribablePromise(t) : n;
|
|
393
|
-
}
|
|
394
|
-
static createSubscribablePromise(t) {
|
|
395
|
-
let n = new e(t);
|
|
396
|
-
return O.set(t, n), O.set(n, n), n;
|
|
397
|
-
}
|
|
398
|
-
static getSubscribablePromise(e) {
|
|
399
|
-
return O.get(e);
|
|
400
|
-
}
|
|
401
|
-
static resolve(t) {
|
|
402
|
-
let n = typeof t == "object" && t && "then" in t && typeof t.then == "function" ? t : Promise.resolve(t);
|
|
403
|
-
return e.proxy(n).subscribe();
|
|
404
|
-
}
|
|
405
|
-
static async any(t) {
|
|
406
|
-
let n = (Array.isArray(t) ? t : [...t]).map(e.resolve);
|
|
407
|
-
try {
|
|
408
|
-
return await Promise.any(n);
|
|
409
|
-
} finally {
|
|
410
|
-
n.forEach(({ unsubscribe: e }) => {
|
|
411
|
-
e();
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
static async race(t) {
|
|
416
|
-
let n = (Array.isArray(t) ? t : [...t]).map(e.resolve);
|
|
417
|
-
try {
|
|
418
|
-
return await Promise.race(n);
|
|
419
|
-
} finally {
|
|
420
|
-
n.forEach(({ unsubscribe: e }) => {
|
|
421
|
-
e();
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
static async raceReferences(e) {
|
|
426
|
-
let t = e.map(ke);
|
|
427
|
-
try {
|
|
428
|
-
return await Promise.race(t);
|
|
429
|
-
} finally {
|
|
430
|
-
for (let e of t) e.unsubscribe();
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
function ke(e) {
|
|
435
|
-
return Oe.proxy(e).then(() => [e]);
|
|
436
|
-
}
|
|
437
|
-
function Ae() {
|
|
438
|
-
let e, t;
|
|
439
|
-
return {
|
|
440
|
-
promise: new Promise((n, r) => {
|
|
441
|
-
e = n, t = r;
|
|
442
|
-
}),
|
|
443
|
-
resolve: e,
|
|
444
|
-
reject: t
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
function je(e, t) {
|
|
448
|
-
return [...e, t];
|
|
449
|
-
}
|
|
450
|
-
function Me(e, t) {
|
|
451
|
-
return [...e.slice(0, t), ...e.slice(t + 1)];
|
|
452
|
-
}
|
|
453
|
-
function Ne(e, t) {
|
|
454
|
-
let n = e.indexOf(t);
|
|
455
|
-
return n === -1 ? e : Me(e, n);
|
|
456
|
-
}
|
|
457
|
-
var Pe, Fe;
|
|
458
|
-
(Pe = Symbol).dispose ?? (Pe.dispose = Symbol()), (Fe = Symbol).asyncDispose ?? (Fe.asyncDispose = Symbol());
|
|
459
|
-
function k(e, t) {
|
|
460
|
-
let n = e, r = n[Symbol.dispose];
|
|
461
|
-
return n[Symbol.dispose] = () => {
|
|
462
|
-
t(), r?.();
|
|
463
|
-
}, n;
|
|
464
|
-
}
|
|
465
|
-
function Ie(e, t) {
|
|
466
|
-
let n = e, r = n[Symbol.asyncDispose];
|
|
467
|
-
return n[Symbol.asyncDispose] = async () => {
|
|
468
|
-
await t(), await r?.();
|
|
469
|
-
}, n;
|
|
470
|
-
}
|
|
471
|
-
var Le = Symbol();
|
|
472
|
-
function Re(e) {
|
|
473
|
-
let t = null;
|
|
474
|
-
return k({ start() {
|
|
475
|
-
if (t) throw Error("Timer already started");
|
|
476
|
-
return new Promise((n) => {
|
|
477
|
-
t = setTimeout(() => n(Le), e);
|
|
478
|
-
});
|
|
479
|
-
} }, () => {
|
|
480
|
-
t && clearTimeout(t);
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
var A = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e, t) {
|
|
484
|
-
function n() {
|
|
485
|
-
var e = typeof SuppressedError == "function" ? SuppressedError : function(e, t) {
|
|
486
|
-
var n = Error();
|
|
487
|
-
return n.name = "SuppressedError", n.error = e, n.suppressed = t, n;
|
|
488
|
-
}, t = {}, n = [];
|
|
489
|
-
function r(e, t) {
|
|
490
|
-
if (t != null) {
|
|
491
|
-
if (Object(t) !== t) throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
492
|
-
if (e) var r = t[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
|
|
493
|
-
if (r === void 0 && (r = t[Symbol.dispose || Symbol.for("Symbol.dispose")], e)) var i = r;
|
|
494
|
-
if (typeof r != "function") throw TypeError("Object is not disposable.");
|
|
495
|
-
i && (r = function() {
|
|
496
|
-
try {
|
|
497
|
-
i.call(t);
|
|
498
|
-
} catch (e) {
|
|
499
|
-
return Promise.reject(e);
|
|
500
|
-
}
|
|
501
|
-
}), n.push({
|
|
502
|
-
v: t,
|
|
503
|
-
d: r,
|
|
504
|
-
a: e
|
|
505
|
-
});
|
|
506
|
-
} else e && n.push({
|
|
507
|
-
d: t,
|
|
508
|
-
a: e
|
|
509
|
-
});
|
|
510
|
-
return t;
|
|
511
|
-
}
|
|
512
|
-
return {
|
|
513
|
-
e: t,
|
|
514
|
-
u: r.bind(null, !1),
|
|
515
|
-
a: r.bind(null, !0),
|
|
516
|
-
d: function() {
|
|
517
|
-
var r, i = this.e, a = 0;
|
|
518
|
-
function o() {
|
|
519
|
-
for (; r = n.pop();) try {
|
|
520
|
-
if (!r.a && a === 1) return a = 0, n.push(r), Promise.resolve().then(o);
|
|
521
|
-
if (r.d) {
|
|
522
|
-
var e = r.d.call(r.v);
|
|
523
|
-
if (r.a) return a |= 2, Promise.resolve(e).then(o, s);
|
|
524
|
-
} else a |= 1;
|
|
525
|
-
} catch (e) {
|
|
526
|
-
return s(e);
|
|
527
|
-
}
|
|
528
|
-
if (a === 1) return i === t ? Promise.resolve() : Promise.reject(i);
|
|
529
|
-
if (i !== t) throw i;
|
|
530
|
-
}
|
|
531
|
-
function s(n) {
|
|
532
|
-
return i = i === t ? n : new e(n, i), o();
|
|
533
|
-
}
|
|
534
|
-
return o();
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
539
|
-
} }), j = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e, t) {
|
|
540
|
-
function n(e, t) {
|
|
541
|
-
this.v = e, this.k = t;
|
|
542
|
-
}
|
|
543
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
544
|
-
} }), M = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e, t) {
|
|
545
|
-
var n = j();
|
|
546
|
-
function r(e) {
|
|
547
|
-
return new n(e, 0);
|
|
548
|
-
}
|
|
549
|
-
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
550
|
-
} }), N = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e, t) {
|
|
551
|
-
var n = j();
|
|
552
|
-
function r(e) {
|
|
553
|
-
return function() {
|
|
554
|
-
return new i(e.apply(this, arguments));
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
function i(e) {
|
|
558
|
-
var t, r;
|
|
559
|
-
function i(t, r) {
|
|
560
|
-
try {
|
|
561
|
-
var o = e[t](r), s = o.value, c = s instanceof n;
|
|
562
|
-
Promise.resolve(c ? s.v : s).then(function(n) {
|
|
563
|
-
if (c) {
|
|
564
|
-
var r = t === "return" ? "return" : "next";
|
|
565
|
-
if (!s.k || n.done) return i(r, n);
|
|
566
|
-
n = e[r](n).value;
|
|
567
|
-
}
|
|
568
|
-
a(o.done ? "return" : "normal", n);
|
|
569
|
-
}, function(e) {
|
|
570
|
-
i("throw", e);
|
|
571
|
-
});
|
|
572
|
-
} catch (e) {
|
|
573
|
-
a("throw", e);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
function a(e, n) {
|
|
577
|
-
switch (e) {
|
|
578
|
-
case "return":
|
|
579
|
-
t.resolve({
|
|
580
|
-
value: n,
|
|
581
|
-
done: !0
|
|
582
|
-
});
|
|
583
|
-
break;
|
|
584
|
-
case "throw":
|
|
585
|
-
t.reject(n);
|
|
586
|
-
break;
|
|
587
|
-
default: t.resolve({
|
|
588
|
-
value: n,
|
|
589
|
-
done: !1
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
(t = t.next) ? i(t.key, t.arg) : r = null;
|
|
593
|
-
}
|
|
594
|
-
this._invoke = function(e, n) {
|
|
595
|
-
return new Promise(function(a, o) {
|
|
596
|
-
var s = {
|
|
597
|
-
key: e,
|
|
598
|
-
arg: n,
|
|
599
|
-
resolve: a,
|
|
600
|
-
reject: o,
|
|
601
|
-
next: null
|
|
602
|
-
};
|
|
603
|
-
r ? r = r.next = s : (t = r = s, i(e, n));
|
|
604
|
-
});
|
|
605
|
-
}, typeof e.return != "function" && (this.return = void 0);
|
|
606
|
-
}
|
|
607
|
-
i.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
608
|
-
return this;
|
|
609
|
-
}, i.prototype.next = function(e) {
|
|
610
|
-
return this._invoke("next", e);
|
|
611
|
-
}, i.prototype.throw = function(e) {
|
|
612
|
-
return this._invoke("throw", e);
|
|
613
|
-
}, i.prototype.return = function(e) {
|
|
614
|
-
return this._invoke("return", e);
|
|
615
|
-
}, t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
616
|
-
} });
|
|
617
|
-
s(A(), 1), s(M(), 1), s(N(), 1);
|
|
618
|
-
function ze(e) {
|
|
619
|
-
let t = e[Symbol.asyncIterator]();
|
|
620
|
-
return t[Symbol.asyncDispose] ? t : Ie(t, async () => {
|
|
621
|
-
await t.return?.call(t);
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
function Be() {
|
|
625
|
-
let e, t;
|
|
626
|
-
return {
|
|
627
|
-
promise: new Promise((n, r) => {
|
|
628
|
-
e = n, t = r;
|
|
629
|
-
}),
|
|
630
|
-
resolve: e,
|
|
631
|
-
reject: t
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
s(A(), 1), s(M(), 1), s(N(), 1), s(A(), 1), s(M(), 1), s(N(), 1);
|
|
635
|
-
var Ve = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e, t) {
|
|
636
|
-
function n(e) {
|
|
637
|
-
var t, n, i, a = 2;
|
|
638
|
-
for (typeof Symbol < "u" && (n = Symbol.asyncIterator, i = Symbol.iterator); a--;) {
|
|
639
|
-
if (n && (t = e[n]) != null) return t.call(e);
|
|
640
|
-
if (i && (t = e[i]) != null) return new r(t.call(e));
|
|
641
|
-
n = "@@asyncIterator", i = "@@iterator";
|
|
642
|
-
}
|
|
643
|
-
throw TypeError("Object is not async iterable");
|
|
644
|
-
}
|
|
645
|
-
function r(e) {
|
|
646
|
-
function t(e) {
|
|
647
|
-
if (Object(e) !== e) return Promise.reject(/* @__PURE__ */ TypeError(e + " is not an object."));
|
|
648
|
-
var t = e.done;
|
|
649
|
-
return Promise.resolve(e.value).then(function(e) {
|
|
650
|
-
return {
|
|
651
|
-
value: e,
|
|
652
|
-
done: t
|
|
653
|
-
};
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
return r = function(e) {
|
|
657
|
-
this.s = e, this.n = e.next;
|
|
658
|
-
}, r.prototype = {
|
|
659
|
-
s: null,
|
|
660
|
-
n: null,
|
|
661
|
-
next: function() {
|
|
662
|
-
return t(this.n.apply(this.s, arguments));
|
|
663
|
-
},
|
|
664
|
-
return: function(e) {
|
|
665
|
-
var n = this.s.return;
|
|
666
|
-
return n === void 0 ? Promise.resolve({
|
|
667
|
-
value: e,
|
|
668
|
-
done: !0
|
|
669
|
-
}) : t(n.apply(this.s, arguments));
|
|
670
|
-
},
|
|
671
|
-
throw: function(e) {
|
|
672
|
-
var n = this.s.return;
|
|
673
|
-
return n === void 0 ? Promise.reject(e) : t(n.apply(this.s, arguments));
|
|
674
|
-
}
|
|
675
|
-
}, new r(e);
|
|
676
|
-
}
|
|
677
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
678
|
-
} }), He = s(M(), 1), Ue = s(N(), 1), We = s(A(), 1);
|
|
679
|
-
s(Ve(), 1);
|
|
680
|
-
var Ge = 0, Ke = 1, qe = 0, Je = 1, Ye = 0, Xe = 1, Ze = 2, Qe = class extends Error {
|
|
681
|
-
constructor(e) {
|
|
682
|
-
super("Received error from server"), this.data = e;
|
|
683
|
-
}
|
|
684
|
-
}, $e = (e) => ({ getReader() {
|
|
685
|
-
return new ReadableStream({ start(t) {
|
|
686
|
-
e.on("data", (e) => {
|
|
687
|
-
t.enqueue(e);
|
|
688
|
-
}), e.on("end", () => {
|
|
689
|
-
t.close();
|
|
690
|
-
}), e.on("error", (e) => {
|
|
691
|
-
t.error(e);
|
|
692
|
-
});
|
|
693
|
-
} }).getReader();
|
|
694
|
-
} });
|
|
695
|
-
function et(e) {
|
|
696
|
-
let t = "getReader" in e ? e.getReader() : $e(e).getReader(), n = "";
|
|
697
|
-
return new ReadableStream({
|
|
698
|
-
async pull(e) {
|
|
699
|
-
let { done: n, value: r } = await t.read();
|
|
700
|
-
n ? e.close() : e.enqueue(r);
|
|
701
|
-
},
|
|
702
|
-
cancel() {
|
|
703
|
-
return t.cancel();
|
|
704
|
-
}
|
|
705
|
-
}).pipeThrough(new TextDecoderStream()).pipeThrough(new TransformStream({ transform(e, t) {
|
|
706
|
-
n += e;
|
|
707
|
-
let r = n.split("\n");
|
|
708
|
-
n = r.pop() ?? "";
|
|
709
|
-
for (let e of r) t.enqueue(e);
|
|
710
|
-
} }));
|
|
711
|
-
}
|
|
712
|
-
function tt(e) {
|
|
713
|
-
let t = et(e), n = !1;
|
|
714
|
-
return t.pipeThrough(new TransformStream({ transform(e, t) {
|
|
715
|
-
if (n) {
|
|
716
|
-
let n = JSON.parse(e);
|
|
717
|
-
t.enqueue(n);
|
|
718
|
-
} else {
|
|
719
|
-
let r = JSON.parse(e);
|
|
720
|
-
t.enqueue(r), n = !0;
|
|
721
|
-
}
|
|
722
|
-
} }));
|
|
723
|
-
}
|
|
724
|
-
function nt(e) {
|
|
725
|
-
let t = /* @__PURE__ */ new Map();
|
|
726
|
-
function n() {
|
|
727
|
-
return Array.from(t.values()).every((e) => e.closed);
|
|
728
|
-
}
|
|
729
|
-
function r() {
|
|
730
|
-
let t, r = new ReadableStream({ start(e) {
|
|
731
|
-
t = e;
|
|
732
|
-
} }), i = {
|
|
733
|
-
enqueue: (e) => t.enqueue(e),
|
|
734
|
-
close: () => {
|
|
735
|
-
t.close(), a(), n() && e.abort();
|
|
736
|
-
},
|
|
737
|
-
closed: !1,
|
|
738
|
-
getReaderResource: () => {
|
|
739
|
-
let e = r.getReader();
|
|
740
|
-
return k(e, () => {
|
|
741
|
-
i.close(), e.releaseLock();
|
|
742
|
-
});
|
|
743
|
-
},
|
|
744
|
-
error: (e) => {
|
|
745
|
-
t.error(e), a();
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
function a() {
|
|
749
|
-
Object.assign(i, {
|
|
750
|
-
closed: !0,
|
|
751
|
-
close: () => {},
|
|
752
|
-
enqueue: () => {},
|
|
753
|
-
getReaderResource: null,
|
|
754
|
-
error: () => {}
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
return i;
|
|
758
|
-
}
|
|
759
|
-
function i(e) {
|
|
760
|
-
let n = t.get(e);
|
|
761
|
-
return n || (n = r(), t.set(e, n)), n;
|
|
762
|
-
}
|
|
763
|
-
function a(e) {
|
|
764
|
-
for (let n of t.values()) n.error(e);
|
|
765
|
-
}
|
|
766
|
-
function o() {
|
|
767
|
-
for (let e of t.values()) e.close();
|
|
768
|
-
}
|
|
769
|
-
return {
|
|
770
|
-
getOrCreate: i,
|
|
771
|
-
cancelAll: a,
|
|
772
|
-
closeAll: o
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
async function rt(e) {
|
|
776
|
-
let { deserialize: t = (e) => e } = e, n = tt(e.from);
|
|
777
|
-
t && (n = n.pipeThrough(new TransformStream({ transform(e, n) {
|
|
778
|
-
n.enqueue(t(e));
|
|
779
|
-
} })));
|
|
780
|
-
let r = Be(), i = nt(e.abortController);
|
|
781
|
-
function a(t) {
|
|
782
|
-
let [n, r, a] = t, s = i.getOrCreate(a);
|
|
783
|
-
switch (r) {
|
|
784
|
-
case Ge: return l(async () => {
|
|
785
|
-
try {
|
|
786
|
-
var t = (0, We.default)();
|
|
787
|
-
let { value: n } = await t.u(s.getReaderResource()).read(), [r, i, a] = n;
|
|
788
|
-
switch (i) {
|
|
789
|
-
case qe: return o(a);
|
|
790
|
-
case Je: throw e.formatError?.call(e, { error: a }) ?? new Qe(a);
|
|
791
|
-
}
|
|
792
|
-
} catch (e) {
|
|
793
|
-
t.e = e;
|
|
794
|
-
} finally {
|
|
795
|
-
t.d();
|
|
796
|
-
}
|
|
797
|
-
});
|
|
798
|
-
case Ke: return l((0, Ue.default)(function* () {
|
|
799
|
-
try {
|
|
800
|
-
var t = (0, We.default)();
|
|
801
|
-
let n = t.u(s.getReaderResource());
|
|
802
|
-
for (;;) {
|
|
803
|
-
let { value: t } = yield (0, He.default)(n.read()), [r, i, a] = t;
|
|
804
|
-
switch (i) {
|
|
805
|
-
case Xe:
|
|
806
|
-
yield o(a);
|
|
807
|
-
break;
|
|
808
|
-
case Ye: return o(a);
|
|
809
|
-
case Ze: throw e.formatError?.call(e, { error: a }) ?? new Qe(a);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
} catch (e) {
|
|
813
|
-
t.e = e;
|
|
814
|
-
} finally {
|
|
815
|
-
t.d();
|
|
816
|
-
}
|
|
817
|
-
}));
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
function o(e) {
|
|
821
|
-
let [[t], ...n] = e;
|
|
822
|
-
for (let e of n) {
|
|
823
|
-
let [n] = e, r = a(e);
|
|
824
|
-
if (n === null) return r;
|
|
825
|
-
t[n] = r;
|
|
826
|
-
}
|
|
827
|
-
return t;
|
|
828
|
-
}
|
|
829
|
-
let s = () => {
|
|
830
|
-
r &&= (r.reject(/* @__PURE__ */ Error("Stream closed before head was received")), null), i.closeAll();
|
|
831
|
-
}, c = (e) => {
|
|
832
|
-
r?.reject(e), r = null, i.cancelAll(e);
|
|
833
|
-
};
|
|
834
|
-
return n.pipeTo(new WritableStream({
|
|
835
|
-
write(e) {
|
|
836
|
-
if (r) {
|
|
837
|
-
let t = e;
|
|
838
|
-
for (let [n, r] of Object.entries(e)) t[n] = o(r);
|
|
839
|
-
r.resolve(t), r = null;
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
let t = e, [n] = t;
|
|
843
|
-
i.getOrCreate(n).enqueue(t);
|
|
844
|
-
},
|
|
845
|
-
close: s,
|
|
846
|
-
abort: c
|
|
847
|
-
})).catch((t) => {
|
|
848
|
-
var n;
|
|
849
|
-
(n = e.onError) == null || n.call(e, { error: t }), c(t);
|
|
850
|
-
}), [await r.promise];
|
|
851
|
-
}
|
|
852
|
-
var it = f({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(e, t) {
|
|
853
|
-
var n = j();
|
|
854
|
-
function r(e) {
|
|
855
|
-
var t = {}, r = !1;
|
|
856
|
-
function i(t, i) {
|
|
857
|
-
return r = !0, i = new Promise(function(n) {
|
|
858
|
-
n(e[t](i));
|
|
859
|
-
}), {
|
|
860
|
-
done: !1,
|
|
861
|
-
value: new n(i, 1)
|
|
862
|
-
};
|
|
863
|
-
}
|
|
864
|
-
return t[typeof Symbol < "u" && Symbol.iterator || "@@iterator"] = function() {
|
|
865
|
-
return this;
|
|
866
|
-
}, t.next = function(e) {
|
|
867
|
-
return r ? (r = !1, e) : i("next", e);
|
|
868
|
-
}, typeof e.throw == "function" && (t.throw = function(e) {
|
|
869
|
-
if (r) throw r = !1, e;
|
|
870
|
-
return i("throw", e);
|
|
871
|
-
}), typeof e.return == "function" && (t.return = function(e) {
|
|
872
|
-
return r ? (r = !1, e) : i("return", e);
|
|
873
|
-
}), t;
|
|
874
|
-
}
|
|
875
|
-
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
876
|
-
} });
|
|
877
|
-
s(Ve(), 1);
|
|
878
|
-
var at = s(M(), 1), ot = s(N(), 1);
|
|
879
|
-
s(it(), 1);
|
|
880
|
-
var st = s(A(), 1), ct = "ping", lt = "serialized-error", ut = "connected", dt = "return";
|
|
881
|
-
async function ft(e) {
|
|
882
|
-
try {
|
|
883
|
-
var t = (0, st.default)();
|
|
884
|
-
let n = t.u(Re(e.timeoutMs)), r = await Oe.race([e.promise, n.start()]);
|
|
885
|
-
return r === Le ? await e.onTimeout() : r;
|
|
886
|
-
} catch (e) {
|
|
887
|
-
t.e = e;
|
|
888
|
-
} finally {
|
|
889
|
-
t.d();
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
function pt(e) {
|
|
893
|
-
let { deserialize: t = (e) => e } = e, n = a(), r = e.signal, i = null, o = () => new ReadableStream({
|
|
894
|
-
async start(a) {
|
|
895
|
-
let [o, s] = await Promise.all([e.url(), e.init()]), c = i = new e.EventSource(o, s);
|
|
896
|
-
a.enqueue({
|
|
897
|
-
type: "connecting",
|
|
898
|
-
eventSource: i,
|
|
899
|
-
event: null
|
|
900
|
-
}), c.addEventListener(ut, (e) => {
|
|
901
|
-
let t = JSON.parse(e.data);
|
|
902
|
-
n = t, a.enqueue({
|
|
903
|
-
type: "connected",
|
|
904
|
-
options: t,
|
|
905
|
-
eventSource: c
|
|
906
|
-
});
|
|
907
|
-
}), c.addEventListener(lt, (e) => {
|
|
908
|
-
let n = e;
|
|
909
|
-
a.enqueue({
|
|
910
|
-
type: "serialized-error",
|
|
911
|
-
error: t(JSON.parse(n.data)),
|
|
912
|
-
eventSource: c
|
|
913
|
-
});
|
|
914
|
-
}), c.addEventListener(ct, () => {
|
|
915
|
-
a.enqueue({
|
|
916
|
-
type: "ping",
|
|
917
|
-
eventSource: c
|
|
918
|
-
});
|
|
919
|
-
}), c.addEventListener(dt, () => {
|
|
920
|
-
c.close(), a.close(), i = null;
|
|
921
|
-
}), c.addEventListener("error", (e) => {
|
|
922
|
-
c.readyState === c.CLOSED ? a.error(e) : a.enqueue({
|
|
923
|
-
type: "connecting",
|
|
924
|
-
eventSource: c,
|
|
925
|
-
event: e
|
|
926
|
-
});
|
|
927
|
-
}), c.addEventListener("message", (e) => {
|
|
928
|
-
let n = e, r = { data: t(JSON.parse(n.data)) };
|
|
929
|
-
n.lastEventId && (r.id = n.lastEventId), a.enqueue({
|
|
930
|
-
type: "data",
|
|
931
|
-
data: r,
|
|
932
|
-
eventSource: c
|
|
933
|
-
});
|
|
934
|
-
});
|
|
935
|
-
let l = () => {
|
|
936
|
-
try {
|
|
937
|
-
c.close(), a.close();
|
|
938
|
-
} catch {}
|
|
939
|
-
};
|
|
940
|
-
r.aborted ? l() : r.addEventListener("abort", l);
|
|
941
|
-
},
|
|
942
|
-
cancel() {
|
|
943
|
-
i?.close();
|
|
944
|
-
}
|
|
945
|
-
}), s = () => {
|
|
946
|
-
let e = o(), t = e.getReader();
|
|
947
|
-
async function n() {
|
|
948
|
-
await t.cancel(), i = null;
|
|
949
|
-
}
|
|
950
|
-
return Ie({
|
|
951
|
-
read() {
|
|
952
|
-
return t.read();
|
|
953
|
-
},
|
|
954
|
-
async recreate() {
|
|
955
|
-
await n(), e = o(), t = e.getReader();
|
|
956
|
-
}
|
|
957
|
-
}, n);
|
|
958
|
-
};
|
|
959
|
-
return l((0, ot.default)(function* () {
|
|
960
|
-
try {
|
|
961
|
-
var e = (0, st.default)();
|
|
962
|
-
let t = e.a(s());
|
|
963
|
-
for (;;) {
|
|
964
|
-
let e = t.read(), r = n.reconnectAfterInactivityMs;
|
|
965
|
-
r && (e = ft({
|
|
966
|
-
promise: e,
|
|
967
|
-
timeoutMs: r,
|
|
968
|
-
onTimeout: async () => {
|
|
969
|
-
let e = {
|
|
970
|
-
value: {
|
|
971
|
-
type: "timeout",
|
|
972
|
-
ms: r,
|
|
973
|
-
eventSource: i
|
|
974
|
-
},
|
|
975
|
-
done: !1
|
|
976
|
-
};
|
|
977
|
-
return await t.recreate(), e;
|
|
978
|
-
}
|
|
979
|
-
}));
|
|
980
|
-
let a = yield (0, at.default)(e);
|
|
981
|
-
if (a.done) return a.value;
|
|
982
|
-
yield a.value;
|
|
983
|
-
}
|
|
984
|
-
} catch (t) {
|
|
985
|
-
e.e = t;
|
|
986
|
-
} finally {
|
|
987
|
-
yield (0, at.default)(e.d());
|
|
988
|
-
}
|
|
989
|
-
}));
|
|
990
|
-
}
|
|
991
|
-
s(N(), 1), s(d(), 1);
|
|
992
|
-
//#endregion
|
|
993
|
-
//#region ../../node_modules/@trpc/client/dist/TRPCClientError-apv8gw59.mjs
|
|
994
|
-
var P = v(y(), 1), F = v(b(), 1);
|
|
995
|
-
function I(e) {
|
|
996
|
-
return e instanceof L;
|
|
997
|
-
}
|
|
998
|
-
function mt(e) {
|
|
999
|
-
return n(e) && n(e.error) && typeof e.error.code == "number" && typeof e.error.message == "string";
|
|
1000
|
-
}
|
|
1001
|
-
function ht(e, t) {
|
|
1002
|
-
return typeof e == "string" ? e : n(e) && typeof e.message == "string" ? e.message : t;
|
|
1003
|
-
}
|
|
1004
|
-
var L = class e extends Error {
|
|
1005
|
-
constructor(t, n) {
|
|
1006
|
-
var r, i;
|
|
1007
|
-
let a = n?.cause;
|
|
1008
|
-
super(t, { cause: a }), (0, P.default)(this, "cause", void 0), (0, P.default)(this, "shape", void 0), (0, P.default)(this, "data", void 0), (0, P.default)(this, "meta", void 0), this.meta = n?.meta, this.cause = a, this.shape = n == null || (r = n.result) == null ? void 0 : r.error, this.data = n == null || (i = n.result) == null ? void 0 : i.error.data, this.name = "TRPCClientError", Object.setPrototypeOf(this, e.prototype);
|
|
1009
|
-
}
|
|
1010
|
-
static from(t, n = {}) {
|
|
1011
|
-
let r = t;
|
|
1012
|
-
return I(r) ? (n.meta && (r.meta = (0, F.default)((0, F.default)({}, r.meta), n.meta)), r) : mt(r) ? new e(r.error.message, (0, F.default)((0, F.default)({}, n), {}, {
|
|
1013
|
-
result: r,
|
|
1014
|
-
cause: n.cause
|
|
1015
|
-
})) : new e(ht(r, "Unknown error"), (0, F.default)((0, F.default)({}, n), {}, { cause: r }));
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
//#endregion
|
|
1019
|
-
//#region ../../node_modules/@trpc/client/dist/unstable-internals-Bg7n9BBj.mjs
|
|
1020
|
-
function R(e) {
|
|
1021
|
-
let t = e;
|
|
1022
|
-
return t ? "input" in t ? t : {
|
|
1023
|
-
input: t,
|
|
1024
|
-
output: t
|
|
1025
|
-
} : {
|
|
1026
|
-
input: {
|
|
1027
|
-
serialize: (e) => e,
|
|
1028
|
-
deserialize: (e) => e
|
|
1029
|
-
},
|
|
1030
|
-
output: {
|
|
1031
|
-
serialize: (e) => e,
|
|
1032
|
-
deserialize: (e) => e
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
}
|
|
1036
|
-
//#endregion
|
|
1037
|
-
//#region ../../node_modules/@trpc/client/dist/httpUtils-pyf5RF99.mjs
|
|
1038
|
-
var gt = (e) => typeof e == "function";
|
|
1039
|
-
function _t(e) {
|
|
1040
|
-
if (e) return e;
|
|
1041
|
-
if (typeof window < "u" && gt(window.fetch)) return window.fetch;
|
|
1042
|
-
if (typeof globalThis < "u" && gt(globalThis.fetch)) return globalThis.fetch;
|
|
1043
|
-
throw Error("No fetch implementation found");
|
|
1044
|
-
}
|
|
1045
|
-
var z = v(b(), 1);
|
|
1046
|
-
function B(e) {
|
|
1047
|
-
return {
|
|
1048
|
-
url: e.url.toString(),
|
|
1049
|
-
fetch: e.fetch,
|
|
1050
|
-
transformer: R(e.transformer),
|
|
1051
|
-
methodOverride: e.methodOverride
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
function vt(e) {
|
|
1055
|
-
let t = {};
|
|
1056
|
-
for (let n = 0; n < e.length; n++) t[n] = e[n];
|
|
1057
|
-
return t;
|
|
1058
|
-
}
|
|
1059
|
-
var yt = {
|
|
1060
|
-
query: "GET",
|
|
1061
|
-
mutation: "POST",
|
|
1062
|
-
subscription: "PATCH"
|
|
1063
|
-
};
|
|
1064
|
-
function bt(e) {
|
|
1065
|
-
return "input" in e ? e.transformer.input.serialize(e.input) : vt(e.inputs.map((t) => e.transformer.input.serialize(t)));
|
|
1066
|
-
}
|
|
1067
|
-
var V = (e) => {
|
|
1068
|
-
let t = e.url.split("?"), n = t[0].replace(/\/$/, "") + "/" + e.path, r = [];
|
|
1069
|
-
if (t[1] && r.push(t[1]), "inputs" in e && r.push("batch=1"), e.type === "query" || e.type === "subscription") {
|
|
1070
|
-
let t = bt(e);
|
|
1071
|
-
t !== void 0 && e.methodOverride !== "POST" && r.push(`input=${encodeURIComponent(JSON.stringify(t))}`);
|
|
1072
|
-
}
|
|
1073
|
-
return r.length && (n += "?" + r.join("&")), n;
|
|
1074
|
-
}, xt = (e) => {
|
|
1075
|
-
if (e.type === "query" && e.methodOverride !== "POST") return;
|
|
1076
|
-
let t = bt(e);
|
|
1077
|
-
return t === void 0 ? void 0 : JSON.stringify(t);
|
|
1078
|
-
}, St = (e) => Et((0, z.default)((0, z.default)({}, e), {}, {
|
|
1079
|
-
contentTypeHeader: "application/json",
|
|
1080
|
-
getUrl: V,
|
|
1081
|
-
getBody: xt
|
|
1082
|
-
})), Ct = class extends Error {
|
|
1083
|
-
constructor() {
|
|
1084
|
-
let e = "AbortError";
|
|
1085
|
-
super(e), this.name = e, this.message = e;
|
|
1086
|
-
}
|
|
1087
|
-
}, wt = (e) => {
|
|
1088
|
-
var t;
|
|
1089
|
-
if (e?.aborted) throw (t = e.throwIfAborted) == null || t.call(e), typeof DOMException < "u" ? new DOMException("AbortError", "AbortError") : new Ct();
|
|
1090
|
-
};
|
|
1091
|
-
async function Tt(e) {
|
|
1092
|
-
wt(e.signal);
|
|
1093
|
-
let t = e.getUrl(e), n = e.getBody(e), r = e.methodOverride ?? yt[e.type], i = await (async () => {
|
|
1094
|
-
let t = await e.headers();
|
|
1095
|
-
return Symbol.iterator in t ? Object.fromEntries(t) : t;
|
|
1096
|
-
})(), a = (0, z.default)((0, z.default)((0, z.default)({}, e.contentTypeHeader && r !== "GET" ? { "content-type": e.contentTypeHeader } : {}), e.trpcAcceptHeader ? { [e.trpcAcceptHeaderKey ?? "trpc-accept"]: e.trpcAcceptHeader } : void 0), i);
|
|
1097
|
-
return _t(e.fetch)(t, {
|
|
1098
|
-
method: r,
|
|
1099
|
-
signal: e.signal,
|
|
1100
|
-
body: n,
|
|
1101
|
-
headers: a
|
|
1102
|
-
});
|
|
1103
|
-
}
|
|
1104
|
-
async function Et(e) {
|
|
1105
|
-
let t = {}, n = await Tt(e);
|
|
1106
|
-
t.response = n;
|
|
1107
|
-
let r = await n.json();
|
|
1108
|
-
return t.responseJSON = r, {
|
|
1109
|
-
json: r,
|
|
1110
|
-
meta: t
|
|
1111
|
-
};
|
|
1112
|
-
}
|
|
1113
|
-
//#endregion
|
|
1114
|
-
//#region ../../node_modules/@trpc/client/dist/httpLink-lG_6juPY.mjs
|
|
1115
|
-
function Dt(e) {
|
|
1116
|
-
return e instanceof Uint8Array || e instanceof Blob;
|
|
1117
|
-
}
|
|
1118
|
-
function Ot(e) {
|
|
1119
|
-
return e instanceof FormData;
|
|
1120
|
-
}
|
|
1121
|
-
function kt(e) {
|
|
1122
|
-
return Dt(e) || Ot(e);
|
|
1123
|
-
}
|
|
1124
|
-
var H = v(b(), 1), At = (e) => {
|
|
1125
|
-
if ("input" in e) {
|
|
1126
|
-
let { input: t } = e;
|
|
1127
|
-
if (Ot(t)) {
|
|
1128
|
-
if (e.type !== "mutation" && e.methodOverride !== "POST") throw Error("FormData is only supported for mutations");
|
|
1129
|
-
return Et((0, H.default)((0, H.default)({}, e), {}, {
|
|
1130
|
-
contentTypeHeader: void 0,
|
|
1131
|
-
getUrl: V,
|
|
1132
|
-
getBody: () => t
|
|
1133
|
-
}));
|
|
1134
|
-
}
|
|
1135
|
-
if (Dt(t)) {
|
|
1136
|
-
if (e.type !== "mutation" && e.methodOverride !== "POST") throw Error("Octet type input is only supported for mutations");
|
|
1137
|
-
return Et((0, H.default)((0, H.default)({}, e), {}, {
|
|
1138
|
-
contentTypeHeader: "application/octet-stream",
|
|
1139
|
-
getUrl: V,
|
|
1140
|
-
getBody: () => t
|
|
1141
|
-
}));
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
return St(e);
|
|
1145
|
-
};
|
|
1146
|
-
function jt(e) {
|
|
1147
|
-
let t = B(e);
|
|
1148
|
-
return () => (n) => {
|
|
1149
|
-
let { op: r } = n;
|
|
1150
|
-
return x((n) => {
|
|
1151
|
-
let { path: i, input: a, type: o } = r;
|
|
1152
|
-
/* istanbul ignore if -- @preserve */
|
|
1153
|
-
if (o === "subscription") throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
1154
|
-
let s = At((0, H.default)((0, H.default)({}, t), {}, {
|
|
1155
|
-
type: o,
|
|
1156
|
-
path: i,
|
|
1157
|
-
input: a,
|
|
1158
|
-
signal: r.signal,
|
|
1159
|
-
headers() {
|
|
1160
|
-
return e.headers ? typeof e.headers == "function" ? e.headers({ op: r }) : e.headers : {};
|
|
1161
|
-
}
|
|
1162
|
-
})), c;
|
|
1163
|
-
return s.then((e) => {
|
|
1164
|
-
c = e.meta;
|
|
1165
|
-
let r = E(e.json, t.transformer.output);
|
|
1166
|
-
if (!r.ok) {
|
|
1167
|
-
n.error(L.from(r.error, { meta: c }));
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
n.next({
|
|
1171
|
-
context: e.meta,
|
|
1172
|
-
result: r.result
|
|
1173
|
-
}), n.complete();
|
|
1174
|
-
}).catch((e) => {
|
|
1175
|
-
n.error(L.from(e, { meta: c }));
|
|
1176
|
-
}), () => {};
|
|
1177
|
-
});
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
//#endregion
|
|
1181
|
-
//#region ../../node_modules/@trpc/client/dist/httpBatchLink-LhidKAPw.mjs
|
|
1182
|
-
var Mt = () => {
|
|
1183
|
-
throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
1184
|
-
};
|
|
1185
|
-
function U(e) {
|
|
1186
|
-
let t = null, n = null, r = () => {
|
|
1187
|
-
clearTimeout(n), n = null, t = null;
|
|
1188
|
-
};
|
|
1189
|
-
function i(t) {
|
|
1190
|
-
let n = [[]], r = 0;
|
|
1191
|
-
for (;;) {
|
|
1192
|
-
let o = t[r];
|
|
1193
|
-
if (!o) break;
|
|
1194
|
-
let s = n[n.length - 1];
|
|
1195
|
-
if (o.aborted) {
|
|
1196
|
-
var i;
|
|
1197
|
-
(i = o.reject) == null || i.call(o, /* @__PURE__ */ Error("Aborted")), r++;
|
|
1198
|
-
continue;
|
|
1199
|
-
}
|
|
1200
|
-
if (e.validate(s.concat(o).map((e) => e.key))) {
|
|
1201
|
-
s.push(o), r++;
|
|
1202
|
-
continue;
|
|
1203
|
-
}
|
|
1204
|
-
if (s.length === 0) {
|
|
1205
|
-
var a;
|
|
1206
|
-
(a = o.reject) == null || a.call(o, /* @__PURE__ */ Error("Input is too big for a single dispatch")), r++;
|
|
1207
|
-
continue;
|
|
1208
|
-
}
|
|
1209
|
-
n.push([]);
|
|
1210
|
-
}
|
|
1211
|
-
return n;
|
|
1212
|
-
}
|
|
1213
|
-
function a() {
|
|
1214
|
-
let n = i(t);
|
|
1215
|
-
r();
|
|
1216
|
-
for (let t of n) {
|
|
1217
|
-
if (!t.length) continue;
|
|
1218
|
-
let n = { items: t };
|
|
1219
|
-
for (let e of t) e.batch = n;
|
|
1220
|
-
e.fetch(n.items.map((e) => e.key)).then(async (e) => {
|
|
1221
|
-
await Promise.all(e.map(async (e, t) => {
|
|
1222
|
-
let r = n.items[t];
|
|
1223
|
-
try {
|
|
1224
|
-
var i;
|
|
1225
|
-
let t = await Promise.resolve(e);
|
|
1226
|
-
(i = r.resolve) == null || i.call(r, t);
|
|
1227
|
-
} catch (e) {
|
|
1228
|
-
var a;
|
|
1229
|
-
(a = r.reject) == null || a.call(r, e);
|
|
1230
|
-
}
|
|
1231
|
-
r.batch = null, r.reject = null, r.resolve = null;
|
|
1232
|
-
}));
|
|
1233
|
-
for (let e of n.items) {
|
|
1234
|
-
var t;
|
|
1235
|
-
(t = e.reject) == null || t.call(e, /* @__PURE__ */ Error("Missing result")), e.batch = null;
|
|
1236
|
-
}
|
|
1237
|
-
}).catch((e) => {
|
|
1238
|
-
for (let r of n.items) {
|
|
1239
|
-
var t;
|
|
1240
|
-
(t = r.reject) == null || t.call(r, e), r.batch = null;
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
function o(e) {
|
|
1246
|
-
let r = {
|
|
1247
|
-
aborted: !1,
|
|
1248
|
-
key: e,
|
|
1249
|
-
batch: null,
|
|
1250
|
-
resolve: Mt,
|
|
1251
|
-
reject: Mt
|
|
1252
|
-
}, i = new Promise((e, n) => {
|
|
1253
|
-
r.reject = n, r.resolve = e, t ??= [], t.push(r);
|
|
1254
|
-
});
|
|
1255
|
-
return n ??= setTimeout(a), i;
|
|
1256
|
-
}
|
|
1257
|
-
return { load: o };
|
|
1258
|
-
}
|
|
1259
|
-
function Nt(...e) {
|
|
1260
|
-
let t = new AbortController(), n = e.length, r = 0, i = () => {
|
|
1261
|
-
++r === n && t.abort();
|
|
1262
|
-
};
|
|
1263
|
-
for (let t of e) t?.aborted ? i() : t?.addEventListener("abort", i, { once: !0 });
|
|
1264
|
-
return t.signal;
|
|
1265
|
-
}
|
|
1266
|
-
function W(...e) {
|
|
1267
|
-
let t = new AbortController();
|
|
1268
|
-
for (let n of e) n?.aborted ? t.abort() : n?.addEventListener("abort", () => t.abort(), { once: !0 });
|
|
1269
|
-
return t.signal;
|
|
1270
|
-
}
|
|
1271
|
-
function Pt(e) {
|
|
1272
|
-
return new Promise((t, n) => {
|
|
1273
|
-
if (e.aborted) {
|
|
1274
|
-
n(e.reason);
|
|
1275
|
-
return;
|
|
1276
|
-
}
|
|
1277
|
-
e.addEventListener("abort", () => {
|
|
1278
|
-
n(e.reason);
|
|
1279
|
-
}, { once: !0 });
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
var G = v(b(), 1);
|
|
1283
|
-
function Ft(e) {
|
|
1284
|
-
let t = B(e), n = e.maxURLLength ?? Infinity, r = e.maxItems ?? Infinity;
|
|
1285
|
-
return () => {
|
|
1286
|
-
let i = (i) => ({
|
|
1287
|
-
validate(e) {
|
|
1288
|
-
if (n === Infinity && r === Infinity) return !0;
|
|
1289
|
-
if (e.length > r) return !1;
|
|
1290
|
-
let a = e.map((e) => e.path).join(","), o = e.map((e) => e.input);
|
|
1291
|
-
return V((0, G.default)((0, G.default)({}, t), {}, {
|
|
1292
|
-
type: i,
|
|
1293
|
-
path: a,
|
|
1294
|
-
inputs: o,
|
|
1295
|
-
signal: null
|
|
1296
|
-
})).length <= n;
|
|
1297
|
-
},
|
|
1298
|
-
async fetch(n) {
|
|
1299
|
-
let r = n.map((e) => e.path).join(","), a = n.map((e) => e.input), o = Nt(...n.map((e) => e.signal)), s = await St((0, G.default)((0, G.default)({}, t), {}, {
|
|
1300
|
-
path: r,
|
|
1301
|
-
inputs: a,
|
|
1302
|
-
type: i,
|
|
1303
|
-
headers() {
|
|
1304
|
-
return e.headers ? typeof e.headers == "function" ? e.headers({ opList: n }) : e.headers : {};
|
|
1305
|
-
},
|
|
1306
|
-
signal: o
|
|
1307
|
-
}));
|
|
1308
|
-
return (Array.isArray(s.json) ? s.json : n.map(() => s.json)).map((e) => ({
|
|
1309
|
-
meta: s.meta,
|
|
1310
|
-
json: e
|
|
1311
|
-
}));
|
|
1312
|
-
}
|
|
1313
|
-
}), a = {
|
|
1314
|
-
query: U(i("query")),
|
|
1315
|
-
mutation: U(i("mutation"))
|
|
1316
|
-
};
|
|
1317
|
-
return ({ op: e }) => x((n) => {
|
|
1318
|
-
/* istanbul ignore if -- @preserve */
|
|
1319
|
-
if (e.type === "subscription") throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
1320
|
-
let r = a[e.type].load(e), i;
|
|
1321
|
-
return r.then((e) => {
|
|
1322
|
-
i = e;
|
|
1323
|
-
let r = E(e.json, t.transformer.output);
|
|
1324
|
-
if (!r.ok) {
|
|
1325
|
-
n.error(L.from(r.error, { meta: e.meta }));
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
n.next({
|
|
1329
|
-
context: e.meta,
|
|
1330
|
-
result: r.result
|
|
1331
|
-
}), n.complete();
|
|
1332
|
-
}).catch((e) => {
|
|
1333
|
-
n.error(L.from(e, { meta: i?.meta }));
|
|
1334
|
-
}), () => {};
|
|
1335
|
-
});
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
//#endregion
|
|
1339
|
-
//#region ../../node_modules/@trpc/client/dist/loggerLink-ineCN1PO.mjs
|
|
1340
|
-
var K = v(b(), 1);
|
|
1341
|
-
function It(e) {
|
|
1342
|
-
return typeof FormData > "u" ? !1 : e instanceof FormData;
|
|
1343
|
-
}
|
|
1344
|
-
var q = {
|
|
1345
|
-
css: {
|
|
1346
|
-
query: ["72e3ff", "3fb0d8"],
|
|
1347
|
-
mutation: ["c5a3fc", "904dfc"],
|
|
1348
|
-
subscription: ["ff49e1", "d83fbe"]
|
|
1349
|
-
},
|
|
1350
|
-
ansi: {
|
|
1351
|
-
regular: {
|
|
1352
|
-
query: ["\x1B[30;46m", "\x1B[97;46m"],
|
|
1353
|
-
mutation: ["\x1B[30;45m", "\x1B[97;45m"],
|
|
1354
|
-
subscription: ["\x1B[30;42m", "\x1B[97;42m"]
|
|
1355
|
-
},
|
|
1356
|
-
bold: {
|
|
1357
|
-
query: ["\x1B[1;30;46m", "\x1B[1;97;46m"],
|
|
1358
|
-
mutation: ["\x1B[1;30;45m", "\x1B[1;97;45m"],
|
|
1359
|
-
subscription: ["\x1B[1;30;42m", "\x1B[1;97;42m"]
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
};
|
|
1363
|
-
function Lt(e) {
|
|
1364
|
-
let { direction: t, type: n, withContext: r, path: i, id: a, input: o } = e, s = [], c = [];
|
|
1365
|
-
if (e.colorMode === "none") s.push(t === "up" ? ">>" : "<<", n, `#${a}`, i);
|
|
1366
|
-
else if (e.colorMode === "ansi") {
|
|
1367
|
-
let [e, r] = q.ansi.regular[n], [o, c] = q.ansi.bold[n];
|
|
1368
|
-
s.push(t === "up" ? e : r, t === "up" ? ">>" : "<<", n, t === "up" ? o : c, `#${a}`, i, "\x1B[0m");
|
|
1369
|
-
} else {
|
|
1370
|
-
let [e, r] = q.css[n], o = `
|
|
1371
|
-
background-color: #${t === "up" ? e : r};
|
|
1372
|
-
color: ${t === "up" ? "black" : "white"};
|
|
1373
|
-
padding: 2px;
|
|
1374
|
-
`;
|
|
1375
|
-
s.push("%c", t === "up" ? ">>" : "<<", n, `#${a}`, `%c${i}%c`, "%O"), c.push(o, `${o}; font-weight: bold;`, `${o}; font-weight: normal;`);
|
|
1376
|
-
}
|
|
1377
|
-
return t === "up" ? c.push(r ? {
|
|
1378
|
-
input: o,
|
|
1379
|
-
context: e.context
|
|
1380
|
-
} : { input: o }) : c.push((0, K.default)({
|
|
1381
|
-
input: o,
|
|
1382
|
-
result: e.result,
|
|
1383
|
-
elapsedMs: e.elapsedMs
|
|
1384
|
-
}, r && { context: e.context })), {
|
|
1385
|
-
parts: s,
|
|
1386
|
-
args: c
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
var Rt = ({ c: e = console, colorMode: t = "css", withContext: n }) => (r) => {
|
|
1390
|
-
let i = r.input, a = It(i) ? Object.fromEntries(i) : i, { parts: o, args: s } = Lt((0, K.default)((0, K.default)({}, r), {}, {
|
|
1391
|
-
colorMode: t,
|
|
1392
|
-
input: a,
|
|
1393
|
-
withContext: n
|
|
1394
|
-
}));
|
|
1395
|
-
e[r.direction === "down" && r.result && (r.result instanceof Error || "error" in r.result.result && r.result.result.error) ? "error" : "log"].apply(null, [o.join(" ")].concat(s));
|
|
1396
|
-
};
|
|
1397
|
-
function zt(e = {}) {
|
|
1398
|
-
let { enabled: t = () => !0 } = e, n = e.colorMode ?? (typeof window > "u" ? "ansi" : "css"), r = e.withContext ?? n === "css", { logger: i = Rt({
|
|
1399
|
-
c: e.console,
|
|
1400
|
-
colorMode: n,
|
|
1401
|
-
withContext: r
|
|
1402
|
-
}) } = e;
|
|
1403
|
-
return () => ({ op: e, next: n }) => x((r) => {
|
|
1404
|
-
t((0, K.default)((0, K.default)({}, e), {}, { direction: "up" })) && i((0, K.default)((0, K.default)({}, e), {}, { direction: "up" }));
|
|
1405
|
-
let a = Date.now();
|
|
1406
|
-
function o(n) {
|
|
1407
|
-
let r = Date.now() - a;
|
|
1408
|
-
t((0, K.default)((0, K.default)({}, e), {}, {
|
|
1409
|
-
direction: "down",
|
|
1410
|
-
result: n
|
|
1411
|
-
})) && i((0, K.default)((0, K.default)({}, e), {}, {
|
|
1412
|
-
direction: "down",
|
|
1413
|
-
elapsedMs: r,
|
|
1414
|
-
result: n
|
|
1415
|
-
}));
|
|
1416
|
-
}
|
|
1417
|
-
return n(e).pipe(ue({
|
|
1418
|
-
next(e) {
|
|
1419
|
-
o(e);
|
|
1420
|
-
},
|
|
1421
|
-
error(e) {
|
|
1422
|
-
o(e);
|
|
1423
|
-
}
|
|
1424
|
-
})).subscribe(r);
|
|
1425
|
-
});
|
|
1426
|
-
}
|
|
1427
|
-
//#endregion
|
|
1428
|
-
//#region ../../node_modules/@trpc/client/dist/wsLink-DSf4KOdW.mjs
|
|
1429
|
-
var Bt = {
|
|
1430
|
-
encode: (e) => JSON.stringify(e),
|
|
1431
|
-
decode: (e) => {
|
|
1432
|
-
if (typeof e != "string") throw Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");
|
|
1433
|
-
return JSON.parse(e);
|
|
1434
|
-
}
|
|
1435
|
-
}, Vt = {
|
|
1436
|
-
enabled: !1,
|
|
1437
|
-
closeMs: 0
|
|
1438
|
-
}, Ht = {
|
|
1439
|
-
enabled: !1,
|
|
1440
|
-
pongTimeoutMs: 1e3,
|
|
1441
|
-
intervalMs: 5e3
|
|
1442
|
-
}, Ut = (e) => e === 0 ? 0 : Math.min(1e3 * 2 ** e, 3e4), J = (e, ...t) => typeof e == "function" ? e(...t) : e, Wt = v(y(), 1), Y = class e extends Error {
|
|
1443
|
-
constructor(t) {
|
|
1444
|
-
super(t.message, { cause: t.cause }), this.name = "TRPCWebSocketClosedError", Object.setPrototypeOf(this, e.prototype);
|
|
1445
|
-
}
|
|
1446
|
-
}, Gt = class {
|
|
1447
|
-
constructor(e, t) {
|
|
1448
|
-
this.onTimeout = e, this.timeoutMs = t, (0, Wt.default)(this, "timeout", void 0);
|
|
1449
|
-
}
|
|
1450
|
-
reset() {
|
|
1451
|
-
this.timeout &&= (clearTimeout(this.timeout), setTimeout(this.onTimeout, this.timeoutMs));
|
|
1452
|
-
}
|
|
1453
|
-
start() {
|
|
1454
|
-
clearTimeout(this.timeout), this.timeout = setTimeout(this.onTimeout, this.timeoutMs);
|
|
1455
|
-
}
|
|
1456
|
-
stop() {
|
|
1457
|
-
clearTimeout(this.timeout), this.timeout = void 0;
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
function Kt() {
|
|
1461
|
-
let e, t;
|
|
1462
|
-
return {
|
|
1463
|
-
promise: new Promise((n, r) => {
|
|
1464
|
-
e = n, t = r;
|
|
1465
|
-
}),
|
|
1466
|
-
resolve: e,
|
|
1467
|
-
reject: t
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1470
|
-
async function qt(e) {
|
|
1471
|
-
let t = await J(e.url);
|
|
1472
|
-
return e.connectionParams ? t + `${t.includes("?") ? "&" : "?"}connectionParams=1` : t;
|
|
1473
|
-
}
|
|
1474
|
-
async function Jt(e, t) {
|
|
1475
|
-
let n = {
|
|
1476
|
-
method: "connectionParams",
|
|
1477
|
-
data: await J(e)
|
|
1478
|
-
};
|
|
1479
|
-
return t.encode(n);
|
|
1480
|
-
}
|
|
1481
|
-
var Yt = v(y(), 1), Xt = class {
|
|
1482
|
-
constructor() {
|
|
1483
|
-
(0, Yt.default)(this, "outgoingRequests", []), (0, Yt.default)(this, "pendingRequests", {});
|
|
1484
|
-
}
|
|
1485
|
-
register(e, t) {
|
|
1486
|
-
let { promise: n, resolve: r } = Kt();
|
|
1487
|
-
return this.outgoingRequests.push({
|
|
1488
|
-
id: String(e.id),
|
|
1489
|
-
message: e,
|
|
1490
|
-
end: n,
|
|
1491
|
-
callbacks: {
|
|
1492
|
-
next: t.next,
|
|
1493
|
-
complete: () => {
|
|
1494
|
-
t.complete(), r();
|
|
1495
|
-
},
|
|
1496
|
-
error: (e) => {
|
|
1497
|
-
t.error(e), r();
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
}), () => {
|
|
1501
|
-
this.delete(e.id), t.complete(), r();
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
delete(e) {
|
|
1505
|
-
e !== null && (this.outgoingRequests = this.outgoingRequests.filter(({ id: t }) => t !== String(e)), delete this.pendingRequests[String(e)]);
|
|
1506
|
-
}
|
|
1507
|
-
flush() {
|
|
1508
|
-
let e = this.outgoingRequests;
|
|
1509
|
-
this.outgoingRequests = [];
|
|
1510
|
-
for (let t of e) this.pendingRequests[t.id] = t;
|
|
1511
|
-
return e;
|
|
1512
|
-
}
|
|
1513
|
-
getPendingRequests() {
|
|
1514
|
-
return Object.values(this.pendingRequests);
|
|
1515
|
-
}
|
|
1516
|
-
getPendingRequest(e) {
|
|
1517
|
-
return e === null ? null : this.pendingRequests[String(e)];
|
|
1518
|
-
}
|
|
1519
|
-
getOutgoingRequests() {
|
|
1520
|
-
return this.outgoingRequests;
|
|
1521
|
-
}
|
|
1522
|
-
getRequests() {
|
|
1523
|
-
return [...this.getOutgoingRequests().map((e) => ({
|
|
1524
|
-
state: "outgoing",
|
|
1525
|
-
message: e.message,
|
|
1526
|
-
end: e.end,
|
|
1527
|
-
callbacks: e.callbacks
|
|
1528
|
-
})), ...this.getPendingRequests().map((e) => ({
|
|
1529
|
-
state: "pending",
|
|
1530
|
-
message: e.message,
|
|
1531
|
-
end: e.end,
|
|
1532
|
-
callbacks: e.callbacks
|
|
1533
|
-
}))];
|
|
1534
|
-
}
|
|
1535
|
-
hasPendingRequests() {
|
|
1536
|
-
return this.getPendingRequests().length > 0;
|
|
1537
|
-
}
|
|
1538
|
-
hasPendingSubscriptions() {
|
|
1539
|
-
return this.getPendingRequests().some((e) => e.message.method === "subscription");
|
|
1540
|
-
}
|
|
1541
|
-
hasOutgoingRequests() {
|
|
1542
|
-
return this.outgoingRequests.length > 0;
|
|
1543
|
-
}
|
|
1544
|
-
}, X = v(y(), 1);
|
|
1545
|
-
function Zt(e) {
|
|
1546
|
-
let { promise: t, resolve: n, reject: r } = Kt();
|
|
1547
|
-
return e.addEventListener("open", () => {
|
|
1548
|
-
e.removeEventListener("error", r), n();
|
|
1549
|
-
}), e.addEventListener("error", r), t;
|
|
1550
|
-
}
|
|
1551
|
-
function Qt(e, { intervalMs: t, pongTimeoutMs: n }) {
|
|
1552
|
-
let r, i;
|
|
1553
|
-
function a() {
|
|
1554
|
-
r = setTimeout(() => {
|
|
1555
|
-
e.send("PING"), i = setTimeout(() => {
|
|
1556
|
-
e.close();
|
|
1557
|
-
}, n);
|
|
1558
|
-
}, t);
|
|
1559
|
-
}
|
|
1560
|
-
function o() {
|
|
1561
|
-
clearTimeout(r), a();
|
|
1562
|
-
}
|
|
1563
|
-
function s() {
|
|
1564
|
-
clearTimeout(i), o();
|
|
1565
|
-
}
|
|
1566
|
-
e.addEventListener("open", a), e.addEventListener("message", ({ data: e }) => {
|
|
1567
|
-
clearTimeout(r), a(), e === "PONG" && s();
|
|
1568
|
-
}), e.addEventListener("close", () => {
|
|
1569
|
-
clearTimeout(r), clearTimeout(i);
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
var $t = class e {
|
|
1573
|
-
constructor(t) {
|
|
1574
|
-
if ((0, X.default)(this, "id", ++e.connectCount), (0, X.default)(this, "WebSocketPonyfill", void 0), (0, X.default)(this, "urlOptions", void 0), (0, X.default)(this, "keepAliveOpts", void 0), (0, X.default)(this, "encoder", void 0), (0, X.default)(this, "wsObservable", S(null)), (0, X.default)(this, "openPromise", null), this.WebSocketPonyfill = t.WebSocketPonyfill ?? WebSocket, !this.WebSocketPonyfill) throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
|
|
1575
|
-
this.urlOptions = t.urlOptions, this.keepAliveOpts = t.keepAlive, this.encoder = t.encoder;
|
|
1576
|
-
}
|
|
1577
|
-
get ws() {
|
|
1578
|
-
return this.wsObservable.get();
|
|
1579
|
-
}
|
|
1580
|
-
set ws(e) {
|
|
1581
|
-
this.wsObservable.next(e);
|
|
1582
|
-
}
|
|
1583
|
-
isOpen() {
|
|
1584
|
-
return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;
|
|
1585
|
-
}
|
|
1586
|
-
isClosed() {
|
|
1587
|
-
return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);
|
|
1588
|
-
}
|
|
1589
|
-
async open() {
|
|
1590
|
-
var t = this;
|
|
1591
|
-
if (t.openPromise) return t.openPromise;
|
|
1592
|
-
t.id = ++e.connectCount, t.openPromise = qt(t.urlOptions).then((e) => new t.WebSocketPonyfill(e)).then(async (e) => {
|
|
1593
|
-
t.ws = e, e.binaryType = "arraybuffer", e.addEventListener("message", function({ data: e }) {
|
|
1594
|
-
e === "PING" && this.send("PONG");
|
|
1595
|
-
}), t.keepAliveOpts.enabled && Qt(e, t.keepAliveOpts), e.addEventListener("close", () => {
|
|
1596
|
-
t.ws === e && (t.ws = null);
|
|
1597
|
-
}), await Zt(e), t.urlOptions.connectionParams && e.send(await Jt(t.urlOptions.connectionParams, t.encoder));
|
|
1598
|
-
});
|
|
1599
|
-
try {
|
|
1600
|
-
await t.openPromise;
|
|
1601
|
-
} finally {
|
|
1602
|
-
t.openPromise = null;
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
async close() {
|
|
1606
|
-
var e = this;
|
|
1607
|
-
try {
|
|
1608
|
-
await e.openPromise;
|
|
1609
|
-
} finally {
|
|
1610
|
-
var t;
|
|
1611
|
-
(t = e.ws) == null || t.close();
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
};
|
|
1615
|
-
(0, X.default)($t, "connectCount", 0);
|
|
1616
|
-
function en(e) {
|
|
1617
|
-
return e.isOpen() ? {
|
|
1618
|
-
id: e.id,
|
|
1619
|
-
state: "open",
|
|
1620
|
-
ws: e.ws
|
|
1621
|
-
} : e.isClosed() ? {
|
|
1622
|
-
id: e.id,
|
|
1623
|
-
state: "closed",
|
|
1624
|
-
ws: e.ws
|
|
1625
|
-
} : e.ws ? {
|
|
1626
|
-
id: e.id,
|
|
1627
|
-
state: "connecting",
|
|
1628
|
-
ws: e.ws
|
|
1629
|
-
} : null;
|
|
1630
|
-
}
|
|
1631
|
-
var Z = v(y(), 1), Q = v(b(), 1), tn = class {
|
|
1632
|
-
constructor(e) {
|
|
1633
|
-
(0, Z.default)(this, "connectionState", void 0), (0, Z.default)(this, "allowReconnect", !1), (0, Z.default)(this, "requestManager", new Xt()), (0, Z.default)(this, "activeConnection", void 0), (0, Z.default)(this, "reconnectRetryDelay", void 0), (0, Z.default)(this, "inactivityTimeout", void 0), (0, Z.default)(this, "callbacks", void 0), (0, Z.default)(this, "lazyMode", void 0), (0, Z.default)(this, "encoder", void 0), (0, Z.default)(this, "reconnecting", null), this.encoder = e.experimental_encoder ?? Bt, this.callbacks = {
|
|
1634
|
-
onOpen: e.onOpen,
|
|
1635
|
-
onClose: e.onClose,
|
|
1636
|
-
onError: e.onError
|
|
1637
|
-
};
|
|
1638
|
-
let t = (0, Q.default)((0, Q.default)({}, Vt), e.lazy);
|
|
1639
|
-
this.inactivityTimeout = new Gt(() => {
|
|
1640
|
-
if (this.requestManager.hasOutgoingRequests() || this.requestManager.hasPendingRequests()) {
|
|
1641
|
-
this.inactivityTimeout.reset();
|
|
1642
|
-
return;
|
|
1643
|
-
}
|
|
1644
|
-
this.close().catch(() => null);
|
|
1645
|
-
}, t.closeMs), this.activeConnection = new $t({
|
|
1646
|
-
WebSocketPonyfill: e.WebSocket,
|
|
1647
|
-
urlOptions: e,
|
|
1648
|
-
keepAlive: (0, Q.default)((0, Q.default)({}, Ht), e.keepAlive),
|
|
1649
|
-
encoder: this.encoder
|
|
1650
|
-
}), this.activeConnection.wsObservable.subscribe({ next: (e) => {
|
|
1651
|
-
e && this.setupWebSocketListeners(e);
|
|
1652
|
-
} }), this.reconnectRetryDelay = e.retryDelayMs ?? Ut, this.lazyMode = t.enabled, this.connectionState = S({
|
|
1653
|
-
type: "state",
|
|
1654
|
-
state: t.enabled ? "idle" : "connecting",
|
|
1655
|
-
error: null
|
|
1656
|
-
}), this.lazyMode || this.open().catch(() => null);
|
|
1657
|
-
}
|
|
1658
|
-
async open() {
|
|
1659
|
-
var e = this;
|
|
1660
|
-
e.allowReconnect = !0, e.connectionState.get().state === "idle" && e.connectionState.next({
|
|
1661
|
-
type: "state",
|
|
1662
|
-
state: "connecting",
|
|
1663
|
-
error: null
|
|
1664
|
-
});
|
|
1665
|
-
try {
|
|
1666
|
-
await e.activeConnection.open();
|
|
1667
|
-
} catch (t) {
|
|
1668
|
-
return e.reconnect(new Y({
|
|
1669
|
-
message: "Initialization error",
|
|
1670
|
-
cause: t
|
|
1671
|
-
})), e.reconnecting;
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
async close() {
|
|
1675
|
-
var e = this;
|
|
1676
|
-
e.allowReconnect = !1, e.inactivityTimeout.stop();
|
|
1677
|
-
let t = [];
|
|
1678
|
-
for (let n of e.requestManager.getRequests()) n.message.method === "subscription" ? n.callbacks.complete() : n.state === "outgoing" ? n.callbacks.error(L.from(new Y({ message: "Closed before connection was established" }))) : t.push(n.end);
|
|
1679
|
-
await Promise.all(t).catch(() => null), await e.activeConnection.close().catch(() => null), e.connectionState.next({
|
|
1680
|
-
type: "state",
|
|
1681
|
-
state: "idle",
|
|
1682
|
-
error: null
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
request({ op: { id: e, type: t, path: n, input: r, signal: i }, transformer: a, lastEventId: o }) {
|
|
1686
|
-
return x((s) => {
|
|
1687
|
-
let c = this.batchSend({
|
|
1688
|
-
id: e,
|
|
1689
|
-
method: t,
|
|
1690
|
-
params: {
|
|
1691
|
-
input: a.input.serialize(r),
|
|
1692
|
-
path: n,
|
|
1693
|
-
lastEventId: o
|
|
1694
|
-
}
|
|
1695
|
-
}, (0, Q.default)((0, Q.default)({}, s), {}, { next(e) {
|
|
1696
|
-
let t = E(e, a.output);
|
|
1697
|
-
if (!t.ok) {
|
|
1698
|
-
s.error(L.from(t.error));
|
|
1699
|
-
return;
|
|
1700
|
-
}
|
|
1701
|
-
s.next({ result: t.result });
|
|
1702
|
-
} }));
|
|
1703
|
-
return () => {
|
|
1704
|
-
c(), t === "subscription" && this.activeConnection.isOpen() && this.send({
|
|
1705
|
-
id: e,
|
|
1706
|
-
method: "subscription.stop"
|
|
1707
|
-
}), i?.removeEventListener("abort", c);
|
|
1708
|
-
};
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
get connection() {
|
|
1712
|
-
return en(this.activeConnection);
|
|
1713
|
-
}
|
|
1714
|
-
reconnect(e) {
|
|
1715
|
-
var t = this;
|
|
1716
|
-
if (this.connectionState.next({
|
|
1717
|
-
type: "state",
|
|
1718
|
-
state: "connecting",
|
|
1719
|
-
error: L.from(e)
|
|
1720
|
-
}), this.reconnecting) return;
|
|
1721
|
-
let n = async (e) => {
|
|
1722
|
-
try {
|
|
1723
|
-
await o(t.reconnectRetryDelay(e)), t.allowReconnect && (await t.activeConnection.close(), await t.activeConnection.open(), t.requestManager.hasPendingRequests() && t.send(t.requestManager.getPendingRequests().map(({ message: e }) => e))), t.reconnecting = null;
|
|
1724
|
-
} catch {
|
|
1725
|
-
await n(e + 1);
|
|
1726
|
-
}
|
|
1727
|
-
};
|
|
1728
|
-
this.reconnecting = n(0);
|
|
1729
|
-
}
|
|
1730
|
-
setupWebSocketListeners(e) {
|
|
1731
|
-
var t = this;
|
|
1732
|
-
let n = (e) => {
|
|
1733
|
-
let t = this.requestManager.getPendingRequests();
|
|
1734
|
-
for (let { message: n, callbacks: r } of t) n.method !== "subscription" && (r.error(L.from(e ?? new Y({
|
|
1735
|
-
message: "WebSocket closed",
|
|
1736
|
-
cause: e
|
|
1737
|
-
}))), this.requestManager.delete(n.id));
|
|
1738
|
-
};
|
|
1739
|
-
e.addEventListener("open", () => {
|
|
1740
|
-
l(async () => {
|
|
1741
|
-
var e, n;
|
|
1742
|
-
t.lazyMode && t.inactivityTimeout.start(), (e = (n = t.callbacks).onOpen) == null || e.call(n), t.connectionState.next({
|
|
1743
|
-
type: "state",
|
|
1744
|
-
state: "pending",
|
|
1745
|
-
error: null
|
|
1746
|
-
});
|
|
1747
|
-
}).catch((t) => {
|
|
1748
|
-
e.close(3e3), n(t);
|
|
1749
|
-
});
|
|
1750
|
-
}), e.addEventListener("message", ({ data: e }) => {
|
|
1751
|
-
if (this.inactivityTimeout.reset(), ["PING", "PONG"].includes(e)) return;
|
|
1752
|
-
let t = this.encoder.decode(e);
|
|
1753
|
-
if ("method" in t) {
|
|
1754
|
-
this.handleIncomingRequest(t);
|
|
1755
|
-
return;
|
|
1756
|
-
}
|
|
1757
|
-
this.handleResponseMessage(t);
|
|
1758
|
-
}), e.addEventListener("close", (e) => {
|
|
1759
|
-
var t, r;
|
|
1760
|
-
n(e), (t = (r = this.callbacks).onClose) == null || t.call(r, e), (!this.lazyMode || this.requestManager.hasPendingSubscriptions()) && this.reconnect(new Y({
|
|
1761
|
-
message: "WebSocket closed",
|
|
1762
|
-
cause: e
|
|
1763
|
-
}));
|
|
1764
|
-
}), e.addEventListener("error", (e) => {
|
|
1765
|
-
var t, r;
|
|
1766
|
-
n(e), (t = (r = this.callbacks).onError) == null || t.call(r, e), this.reconnect(new Y({
|
|
1767
|
-
message: "WebSocket closed",
|
|
1768
|
-
cause: e
|
|
1769
|
-
}));
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
handleResponseMessage(e) {
|
|
1773
|
-
let t = this.requestManager.getPendingRequest(e.id);
|
|
1774
|
-
if (!t) return;
|
|
1775
|
-
t.callbacks.next(e);
|
|
1776
|
-
let n = !0;
|
|
1777
|
-
"result" in e && t.message.method === "subscription" && (e.result.type === "data" && (t.message.params.lastEventId = e.result.id), e.result.type !== "stopped" && (n = !1)), n && (t.callbacks.complete(), this.requestManager.delete(e.id));
|
|
1778
|
-
}
|
|
1779
|
-
handleIncomingRequest(e) {
|
|
1780
|
-
e.method === "reconnect" && this.reconnect(new Y({ message: "Server requested reconnect" }));
|
|
1781
|
-
}
|
|
1782
|
-
send(e) {
|
|
1783
|
-
if (!this.activeConnection.isOpen()) throw Error("Active connection is not open");
|
|
1784
|
-
let t = e instanceof Array ? e : [e];
|
|
1785
|
-
this.activeConnection.ws.send(this.encoder.encode(t.length === 1 ? t[0] : t));
|
|
1786
|
-
}
|
|
1787
|
-
batchSend(e, t) {
|
|
1788
|
-
var n = this;
|
|
1789
|
-
return this.inactivityTimeout.reset(), l(async () => {
|
|
1790
|
-
n.activeConnection.isOpen() || await n.open(), await o(0), n.requestManager.hasOutgoingRequests() && n.send(n.requestManager.flush().map(({ message: e }) => e));
|
|
1791
|
-
}).catch((n) => {
|
|
1792
|
-
this.requestManager.delete(e.id), t.error(L.from(n));
|
|
1793
|
-
}), this.requestManager.register(e, t);
|
|
1794
|
-
}
|
|
1795
|
-
};
|
|
1796
|
-
function nn(e) {
|
|
1797
|
-
return new tn(e);
|
|
1798
|
-
}
|
|
1799
|
-
function rn(e) {
|
|
1800
|
-
let { client: t } = e, n = R(e.transformer);
|
|
1801
|
-
return () => ({ op: e }) => x((r) => {
|
|
1802
|
-
let i = e.type === "subscription" ? t.connectionState.subscribe({ next(t) {
|
|
1803
|
-
r.next({
|
|
1804
|
-
result: t,
|
|
1805
|
-
context: e.context
|
|
1806
|
-
});
|
|
1807
|
-
} }) : null, a = t.request({
|
|
1808
|
-
op: e,
|
|
1809
|
-
transformer: n
|
|
1810
|
-
}).subscribe(r);
|
|
1811
|
-
return () => {
|
|
1812
|
-
a.unsubscribe(), i?.unsubscribe();
|
|
1813
|
-
};
|
|
1814
|
-
});
|
|
1815
|
-
}
|
|
1816
|
-
//#endregion
|
|
1817
|
-
//#region ../../node_modules/@trpc/client/dist/index.mjs
|
|
1818
|
-
var an = v(y(), 1), on = v(b(), 1), sn = class {
|
|
1819
|
-
constructor(e) {
|
|
1820
|
-
(0, an.default)(this, "links", void 0), (0, an.default)(this, "runtime", void 0), (0, an.default)(this, "requestId", void 0), this.requestId = 0, this.runtime = {}, this.links = e.links.map((e) => e(this.runtime));
|
|
1821
|
-
}
|
|
1822
|
-
$request(e) {
|
|
1823
|
-
return de({
|
|
1824
|
-
links: this.links,
|
|
1825
|
-
op: (0, on.default)((0, on.default)({}, e), {}, {
|
|
1826
|
-
context: e.context ?? {},
|
|
1827
|
-
id: ++this.requestId
|
|
1828
|
-
})
|
|
1829
|
-
}).pipe(le());
|
|
1830
|
-
}
|
|
1831
|
-
async requestAsPromise(e) {
|
|
1832
|
-
var t = this;
|
|
1833
|
-
try {
|
|
1834
|
-
return (await ce(t.$request(e))).result.data;
|
|
1835
|
-
} catch (e) {
|
|
1836
|
-
throw L.from(e);
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
query(e, t, n) {
|
|
1840
|
-
return this.requestAsPromise({
|
|
1841
|
-
type: "query",
|
|
1842
|
-
path: e,
|
|
1843
|
-
input: t,
|
|
1844
|
-
context: n?.context,
|
|
1845
|
-
signal: n?.signal
|
|
1846
|
-
});
|
|
1847
|
-
}
|
|
1848
|
-
mutation(e, t, n) {
|
|
1849
|
-
return this.requestAsPromise({
|
|
1850
|
-
type: "mutation",
|
|
1851
|
-
path: e,
|
|
1852
|
-
input: t,
|
|
1853
|
-
context: n?.context,
|
|
1854
|
-
signal: n?.signal
|
|
1855
|
-
});
|
|
1856
|
-
}
|
|
1857
|
-
subscription(e, t, n) {
|
|
1858
|
-
return this.$request({
|
|
1859
|
-
type: "subscription",
|
|
1860
|
-
path: e,
|
|
1861
|
-
input: t,
|
|
1862
|
-
context: n.context,
|
|
1863
|
-
signal: n.signal
|
|
1864
|
-
}).subscribe({
|
|
1865
|
-
next(e) {
|
|
1866
|
-
switch (e.result.type) {
|
|
1867
|
-
case "state":
|
|
1868
|
-
var t;
|
|
1869
|
-
(t = n.onConnectionStateChange) == null || t.call(n, e.result);
|
|
1870
|
-
break;
|
|
1871
|
-
case "started":
|
|
1872
|
-
var r;
|
|
1873
|
-
(r = n.onStarted) == null || r.call(n, { context: e.context });
|
|
1874
|
-
break;
|
|
1875
|
-
case "stopped":
|
|
1876
|
-
var i;
|
|
1877
|
-
(i = n.onStopped) == null || i.call(n);
|
|
1878
|
-
break;
|
|
1879
|
-
case "data":
|
|
1880
|
-
case void 0:
|
|
1881
|
-
var a;
|
|
1882
|
-
(a = n.onData) == null || a.call(n, e.result.data);
|
|
1883
|
-
break;
|
|
1884
|
-
}
|
|
1885
|
-
},
|
|
1886
|
-
error(e) {
|
|
1887
|
-
var t;
|
|
1888
|
-
(t = n.onError) == null || t.call(n, e);
|
|
1889
|
-
},
|
|
1890
|
-
complete() {
|
|
1891
|
-
var e;
|
|
1892
|
-
(e = n.onComplete) == null || e.call(n);
|
|
1893
|
-
}
|
|
1894
|
-
});
|
|
1895
|
-
}
|
|
1896
|
-
};
|
|
1897
|
-
function cn(e) {
|
|
1898
|
-
return new sn(e);
|
|
1899
|
-
}
|
|
1900
|
-
var ln = Symbol.for("trpc_untypedClient"), un = {
|
|
1901
|
-
query: "query",
|
|
1902
|
-
mutate: "mutation",
|
|
1903
|
-
subscribe: "subscription"
|
|
1904
|
-
}, dn = (e) => un[e];
|
|
1905
|
-
function fn(e) {
|
|
1906
|
-
let t = i(({ path: t, args: n }) => {
|
|
1907
|
-
let r = [...t], i = dn(r.pop()), a = r.join(".");
|
|
1908
|
-
return e[i](a, ...n);
|
|
1909
|
-
});
|
|
1910
|
-
return u((n) => n === ln ? e : t[n]);
|
|
1911
|
-
}
|
|
1912
|
-
function pn(e) {
|
|
1913
|
-
return fn(new sn(e));
|
|
1914
|
-
}
|
|
1915
|
-
function mn(e) {
|
|
1916
|
-
return e[ln];
|
|
1917
|
-
}
|
|
1918
|
-
var $ = v(b(), 1);
|
|
1919
|
-
function hn(e) {
|
|
1920
|
-
let t = B(e), n = e.maxURLLength ?? Infinity, r = e.maxItems ?? Infinity;
|
|
1921
|
-
return () => {
|
|
1922
|
-
let i = (i) => ({
|
|
1923
|
-
validate(e) {
|
|
1924
|
-
if (n === Infinity && r === Infinity) return !0;
|
|
1925
|
-
if (e.length > r) return !1;
|
|
1926
|
-
let a = e.map((e) => e.path).join(","), o = e.map((e) => e.input);
|
|
1927
|
-
return V((0, $.default)((0, $.default)({}, t), {}, {
|
|
1928
|
-
type: i,
|
|
1929
|
-
path: a,
|
|
1930
|
-
inputs: o,
|
|
1931
|
-
signal: null
|
|
1932
|
-
})).length <= n;
|
|
1933
|
-
},
|
|
1934
|
-
async fetch(n) {
|
|
1935
|
-
let r = n.map((e) => e.path).join(","), a = n.map((e) => e.input), o = Nt(...n.map((e) => e.signal)), s = new AbortController(), c = await Tt((0, $.default)((0, $.default)({}, t), {}, {
|
|
1936
|
-
signal: W(o, s.signal),
|
|
1937
|
-
type: i,
|
|
1938
|
-
contentTypeHeader: "application/json",
|
|
1939
|
-
trpcAcceptHeader: "application/jsonl",
|
|
1940
|
-
trpcAcceptHeaderKey: e.streamHeader ?? "trpc-accept",
|
|
1941
|
-
getUrl: V,
|
|
1942
|
-
getBody: xt,
|
|
1943
|
-
inputs: a,
|
|
1944
|
-
path: r,
|
|
1945
|
-
headers() {
|
|
1946
|
-
return e.headers ? typeof e.headers == "function" ? e.headers({ opList: n }) : e.headers : {};
|
|
1947
|
-
}
|
|
1948
|
-
}));
|
|
1949
|
-
if (!c.ok) {
|
|
1950
|
-
let e = await c.json();
|
|
1951
|
-
return "error" in e && (e.error = t.transformer.output.deserialize(e.error)), n.map(() => Promise.resolve({
|
|
1952
|
-
json: e,
|
|
1953
|
-
meta: { response: c }
|
|
1954
|
-
}));
|
|
1955
|
-
}
|
|
1956
|
-
let [l] = await rt({
|
|
1957
|
-
from: c.body,
|
|
1958
|
-
deserialize: (e) => t.transformer.output.deserialize(e),
|
|
1959
|
-
formatError(e) {
|
|
1960
|
-
let t = e.error;
|
|
1961
|
-
return L.from({ error: t });
|
|
1962
|
-
},
|
|
1963
|
-
abortController: s
|
|
1964
|
-
});
|
|
1965
|
-
return Object.keys(n).map(async (e) => {
|
|
1966
|
-
let t = await Promise.resolve(l[e]);
|
|
1967
|
-
if ("result" in t) {
|
|
1968
|
-
let e = await Promise.resolve(t.result);
|
|
1969
|
-
t = { result: { data: await Promise.resolve(e.data) } };
|
|
1970
|
-
}
|
|
1971
|
-
return {
|
|
1972
|
-
json: t,
|
|
1973
|
-
meta: { response: c }
|
|
1974
|
-
};
|
|
1975
|
-
});
|
|
1976
|
-
}
|
|
1977
|
-
}), a = {
|
|
1978
|
-
query: U(i("query")),
|
|
1979
|
-
mutation: U(i("mutation"))
|
|
1980
|
-
};
|
|
1981
|
-
return ({ op: e }) => x((t) => {
|
|
1982
|
-
/* istanbul ignore if -- @preserve */
|
|
1983
|
-
if (e.type === "subscription") throw Error("Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
1984
|
-
let n = a[e.type].load(e), r;
|
|
1985
|
-
return n.then((e) => {
|
|
1986
|
-
if (r = e, "error" in e.json) {
|
|
1987
|
-
t.error(L.from(e.json, { meta: e.meta }));
|
|
1988
|
-
return;
|
|
1989
|
-
} else if ("result" in e.json) {
|
|
1990
|
-
t.next({
|
|
1991
|
-
context: e.meta,
|
|
1992
|
-
result: e.json.result
|
|
1993
|
-
}), t.complete();
|
|
1994
|
-
return;
|
|
1995
|
-
}
|
|
1996
|
-
t.complete();
|
|
1997
|
-
}).catch((e) => {
|
|
1998
|
-
t.error(L.from(e, { meta: r?.meta }));
|
|
1999
|
-
}), () => {};
|
|
2000
|
-
});
|
|
2001
|
-
};
|
|
2002
|
-
}
|
|
2003
|
-
var gn = hn, _n = v(b(), 1);
|
|
2004
|
-
function vn(e, t) {
|
|
2005
|
-
return !t || e != null && typeof e != "object" ? e : (0, _n.default)((0, _n.default)({}, e ?? {}), {}, { lastEventId: t });
|
|
2006
|
-
}
|
|
2007
|
-
var yn = v(_({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e, t) {
|
|
2008
|
-
function n(e) {
|
|
2009
|
-
var t, n, i, a = 2;
|
|
2010
|
-
for (typeof Symbol < "u" && (n = Symbol.asyncIterator, i = Symbol.iterator); a--;) {
|
|
2011
|
-
if (n && (t = e[n]) != null) return t.call(e);
|
|
2012
|
-
if (i && (t = e[i]) != null) return new r(t.call(e));
|
|
2013
|
-
n = "@@asyncIterator", i = "@@iterator";
|
|
2014
|
-
}
|
|
2015
|
-
throw TypeError("Object is not async iterable");
|
|
2016
|
-
}
|
|
2017
|
-
function r(e) {
|
|
2018
|
-
function t(e) {
|
|
2019
|
-
if (Object(e) !== e) return Promise.reject(/* @__PURE__ */ TypeError(e + " is not an object."));
|
|
2020
|
-
var t = e.done;
|
|
2021
|
-
return Promise.resolve(e.value).then(function(e) {
|
|
2022
|
-
return {
|
|
2023
|
-
value: e,
|
|
2024
|
-
done: t
|
|
2025
|
-
};
|
|
2026
|
-
});
|
|
2027
|
-
}
|
|
2028
|
-
return r = function(e) {
|
|
2029
|
-
this.s = e, this.n = e.next;
|
|
2030
|
-
}, r.prototype = {
|
|
2031
|
-
s: null,
|
|
2032
|
-
n: null,
|
|
2033
|
-
next: function() {
|
|
2034
|
-
return t(this.n.apply(this.s, arguments));
|
|
2035
|
-
},
|
|
2036
|
-
return: function(e) {
|
|
2037
|
-
var n = this.s.return;
|
|
2038
|
-
return n === void 0 ? Promise.resolve({
|
|
2039
|
-
value: e,
|
|
2040
|
-
done: !0
|
|
2041
|
-
}) : t(n.apply(this.s, arguments));
|
|
2042
|
-
},
|
|
2043
|
-
throw: function(e) {
|
|
2044
|
-
var n = this.s.return;
|
|
2045
|
-
return n === void 0 ? Promise.reject(e) : t(n.apply(this.s, arguments));
|
|
2046
|
-
}
|
|
2047
|
-
}, new r(e);
|
|
2048
|
-
}
|
|
2049
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
2050
|
-
} })(), 1);
|
|
2051
|
-
async function bn(e) {
|
|
2052
|
-
let t = await J(e.url);
|
|
2053
|
-
if (e.connectionParams) {
|
|
2054
|
-
let n = await J(e.connectionParams), r = t.includes("?") ? "&" : "?";
|
|
2055
|
-
t += r + "connectionParams=" + encodeURIComponent(JSON.stringify(n));
|
|
2056
|
-
}
|
|
2057
|
-
return t;
|
|
2058
|
-
}
|
|
2059
|
-
function xn(e) {
|
|
2060
|
-
let t = R(e.transformer);
|
|
2061
|
-
return () => ({ op: n }) => x((i) => {
|
|
2062
|
-
let { type: a, path: o, input: s } = n;
|
|
2063
|
-
/* istanbul ignore if -- @preserve */
|
|
2064
|
-
if (a !== "subscription") throw Error("httpSubscriptionLink only supports subscriptions");
|
|
2065
|
-
let c, u = new AbortController(), d = pt({
|
|
2066
|
-
url: async () => V({
|
|
2067
|
-
transformer: t,
|
|
2068
|
-
url: await bn(e),
|
|
2069
|
-
input: vn(s, c),
|
|
2070
|
-
path: o,
|
|
2071
|
-
type: a,
|
|
2072
|
-
signal: null
|
|
2073
|
-
}),
|
|
2074
|
-
init: () => J(e.eventSourceOptions, { op: n }),
|
|
2075
|
-
signal: W(n.signal, u.signal),
|
|
2076
|
-
deserialize: (e) => t.output.deserialize(e),
|
|
2077
|
-
EventSource: e.EventSource ?? globalThis.EventSource
|
|
2078
|
-
}), f = S({
|
|
2079
|
-
type: "state",
|
|
2080
|
-
state: "connecting",
|
|
2081
|
-
error: null
|
|
2082
|
-
}), p = f.subscribe({ next(e) {
|
|
2083
|
-
i.next({ result: e });
|
|
2084
|
-
} });
|
|
2085
|
-
return l(async () => {
|
|
2086
|
-
var e = !1, t = !1, n;
|
|
2087
|
-
try {
|
|
2088
|
-
for (var a = (0, yn.default)(d), o; e = !(o = await a.next()).done; e = !1) {
|
|
2089
|
-
let e = o.value;
|
|
2090
|
-
switch (e.type) {
|
|
2091
|
-
case "ping": break;
|
|
2092
|
-
case "data":
|
|
2093
|
-
let t = e.data, n;
|
|
2094
|
-
t.id ? (c = t.id, n = {
|
|
2095
|
-
id: t.id,
|
|
2096
|
-
data: t
|
|
2097
|
-
}) : n = { data: t.data }, i.next({
|
|
2098
|
-
result: n,
|
|
2099
|
-
context: { eventSource: e.eventSource }
|
|
2100
|
-
});
|
|
2101
|
-
break;
|
|
2102
|
-
case "connected":
|
|
2103
|
-
i.next({
|
|
2104
|
-
result: { type: "started" },
|
|
2105
|
-
context: { eventSource: e.eventSource }
|
|
2106
|
-
}), f.next({
|
|
2107
|
-
type: "state",
|
|
2108
|
-
state: "pending",
|
|
2109
|
-
error: null
|
|
2110
|
-
});
|
|
2111
|
-
break;
|
|
2112
|
-
case "serialized-error": {
|
|
2113
|
-
let t = L.from({ error: e.error });
|
|
2114
|
-
if (r.includes(e.error.code)) {
|
|
2115
|
-
f.next({
|
|
2116
|
-
type: "state",
|
|
2117
|
-
state: "connecting",
|
|
2118
|
-
error: t
|
|
2119
|
-
});
|
|
2120
|
-
break;
|
|
2121
|
-
}
|
|
2122
|
-
throw t;
|
|
2123
|
-
}
|
|
2124
|
-
case "connecting": {
|
|
2125
|
-
let t = f.get(), n = e.event && L.from(e.event);
|
|
2126
|
-
if (!n && t.state === "connecting") break;
|
|
2127
|
-
f.next({
|
|
2128
|
-
type: "state",
|
|
2129
|
-
state: "connecting",
|
|
2130
|
-
error: n
|
|
2131
|
-
});
|
|
2132
|
-
break;
|
|
2133
|
-
}
|
|
2134
|
-
case "timeout": f.next({
|
|
2135
|
-
type: "state",
|
|
2136
|
-
state: "connecting",
|
|
2137
|
-
error: new L(`Timeout of ${e.ms}ms reached while waiting for a response`)
|
|
2138
|
-
});
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
} catch (e) {
|
|
2142
|
-
t = !0, n = e;
|
|
2143
|
-
} finally {
|
|
2144
|
-
try {
|
|
2145
|
-
e && a.return != null && await a.return();
|
|
2146
|
-
} finally {
|
|
2147
|
-
if (t) throw n;
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
i.next({ result: { type: "stopped" } }), f.next({
|
|
2151
|
-
type: "state",
|
|
2152
|
-
state: "idle",
|
|
2153
|
-
error: null
|
|
2154
|
-
}), i.complete();
|
|
2155
|
-
}).catch((e) => {
|
|
2156
|
-
i.error(L.from(e));
|
|
2157
|
-
}), () => {
|
|
2158
|
-
i.complete(), u.abort(), p.unsubscribe();
|
|
2159
|
-
};
|
|
2160
|
-
});
|
|
2161
|
-
}
|
|
2162
|
-
var Sn = xn, Cn = v(b(), 1);
|
|
2163
|
-
function wn(e) {
|
|
2164
|
-
return () => (t) => x((n) => {
|
|
2165
|
-
let r, i, a;
|
|
2166
|
-
s(1);
|
|
2167
|
-
function o() {
|
|
2168
|
-
let e = t.op;
|
|
2169
|
-
return a ? (0, Cn.default)((0, Cn.default)({}, e), {}, { input: vn(e.input, a) }) : e;
|
|
2170
|
-
}
|
|
2171
|
-
function s(c) {
|
|
2172
|
-
let l = o();
|
|
2173
|
-
r = t.next(l).subscribe({
|
|
2174
|
-
error(t) {
|
|
2175
|
-
if (!e.retry({
|
|
2176
|
-
op: l,
|
|
2177
|
-
attempts: c,
|
|
2178
|
-
error: t
|
|
2179
|
-
})) {
|
|
2180
|
-
n.error(t);
|
|
2181
|
-
return;
|
|
2182
|
-
}
|
|
2183
|
-
let r = e.retryDelayMs?.call(e, c) ?? 0;
|
|
2184
|
-
if (r <= 0) {
|
|
2185
|
-
s(c + 1);
|
|
2186
|
-
return;
|
|
2187
|
-
}
|
|
2188
|
-
i = setTimeout(() => s(c + 1), r);
|
|
2189
|
-
},
|
|
2190
|
-
next(e) {
|
|
2191
|
-
(!e.result.type || e.result.type === "data") && e.result.id && (a = e.result.id), n.next(e);
|
|
2192
|
-
},
|
|
2193
|
-
complete() {
|
|
2194
|
-
n.complete();
|
|
2195
|
-
}
|
|
2196
|
-
});
|
|
2197
|
-
}
|
|
2198
|
-
return () => {
|
|
2199
|
-
r.unsubscribe(), clearTimeout(i);
|
|
2200
|
-
};
|
|
2201
|
-
});
|
|
2202
|
-
}
|
|
2203
|
-
var Tn = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e, t) {
|
|
2204
|
-
function n() {
|
|
2205
|
-
var e = typeof SuppressedError == "function" ? SuppressedError : function(e, t) {
|
|
2206
|
-
var n = Error();
|
|
2207
|
-
return n.name = "SuppressedError", n.error = e, n.suppressed = t, n;
|
|
2208
|
-
}, t = {}, n = [];
|
|
2209
|
-
function r(e, t) {
|
|
2210
|
-
if (t != null) {
|
|
2211
|
-
if (Object(t) !== t) throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
2212
|
-
if (e) var r = t[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
|
|
2213
|
-
if (r === void 0 && (r = t[Symbol.dispose || Symbol.for("Symbol.dispose")], e)) var i = r;
|
|
2214
|
-
if (typeof r != "function") throw TypeError("Object is not disposable.");
|
|
2215
|
-
i && (r = function() {
|
|
2216
|
-
try {
|
|
2217
|
-
i.call(t);
|
|
2218
|
-
} catch (e) {
|
|
2219
|
-
return Promise.reject(e);
|
|
2220
|
-
}
|
|
2221
|
-
}), n.push({
|
|
2222
|
-
v: t,
|
|
2223
|
-
d: r,
|
|
2224
|
-
a: e
|
|
2225
|
-
});
|
|
2226
|
-
} else e && n.push({
|
|
2227
|
-
d: t,
|
|
2228
|
-
a: e
|
|
2229
|
-
});
|
|
2230
|
-
return t;
|
|
2231
|
-
}
|
|
2232
|
-
return {
|
|
2233
|
-
e: t,
|
|
2234
|
-
u: r.bind(null, !1),
|
|
2235
|
-
a: r.bind(null, !0),
|
|
2236
|
-
d: function() {
|
|
2237
|
-
var r, i = this.e, a = 0;
|
|
2238
|
-
function o() {
|
|
2239
|
-
for (; r = n.pop();) try {
|
|
2240
|
-
if (!r.a && a === 1) return a = 0, n.push(r), Promise.resolve().then(o);
|
|
2241
|
-
if (r.d) {
|
|
2242
|
-
var e = r.d.call(r.v);
|
|
2243
|
-
if (r.a) return a |= 2, Promise.resolve(e).then(o, s);
|
|
2244
|
-
} else a |= 1;
|
|
2245
|
-
} catch (e) {
|
|
2246
|
-
return s(e);
|
|
2247
|
-
}
|
|
2248
|
-
if (a === 1) return i === t ? Promise.resolve() : Promise.reject(i);
|
|
2249
|
-
if (i !== t) throw i;
|
|
2250
|
-
}
|
|
2251
|
-
function s(n) {
|
|
2252
|
-
return i = i === t ? n : new e(n, i), o();
|
|
2253
|
-
}
|
|
2254
|
-
return o();
|
|
2255
|
-
}
|
|
2256
|
-
};
|
|
2257
|
-
}
|
|
2258
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
2259
|
-
} }), En = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e, t) {
|
|
2260
|
-
function n(e, t) {
|
|
2261
|
-
this.v = e, this.k = t;
|
|
2262
|
-
}
|
|
2263
|
-
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
2264
|
-
} }), Dn = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e, t) {
|
|
2265
|
-
var n = En();
|
|
2266
|
-
function r(e) {
|
|
2267
|
-
return new n(e, 0);
|
|
2268
|
-
}
|
|
2269
|
-
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
2270
|
-
} }), On = _({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e, t) {
|
|
2271
|
-
var n = En();
|
|
2272
|
-
function r(e) {
|
|
2273
|
-
return function() {
|
|
2274
|
-
return new i(e.apply(this, arguments));
|
|
2275
|
-
};
|
|
2276
|
-
}
|
|
2277
|
-
function i(e) {
|
|
2278
|
-
var t, r;
|
|
2279
|
-
function i(t, r) {
|
|
2280
|
-
try {
|
|
2281
|
-
var o = e[t](r), s = o.value, c = s instanceof n;
|
|
2282
|
-
Promise.resolve(c ? s.v : s).then(function(n) {
|
|
2283
|
-
if (c) {
|
|
2284
|
-
var r = t === "return" ? "return" : "next";
|
|
2285
|
-
if (!s.k || n.done) return i(r, n);
|
|
2286
|
-
n = e[r](n).value;
|
|
2287
|
-
}
|
|
2288
|
-
a(o.done ? "return" : "normal", n);
|
|
2289
|
-
}, function(e) {
|
|
2290
|
-
i("throw", e);
|
|
2291
|
-
});
|
|
2292
|
-
} catch (e) {
|
|
2293
|
-
a("throw", e);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
function a(e, n) {
|
|
2297
|
-
switch (e) {
|
|
2298
|
-
case "return":
|
|
2299
|
-
t.resolve({
|
|
2300
|
-
value: n,
|
|
2301
|
-
done: !0
|
|
2302
|
-
});
|
|
2303
|
-
break;
|
|
2304
|
-
case "throw":
|
|
2305
|
-
t.reject(n);
|
|
2306
|
-
break;
|
|
2307
|
-
default: t.resolve({
|
|
2308
|
-
value: n,
|
|
2309
|
-
done: !1
|
|
2310
|
-
});
|
|
2311
|
-
}
|
|
2312
|
-
(t = t.next) ? i(t.key, t.arg) : r = null;
|
|
2313
|
-
}
|
|
2314
|
-
this._invoke = function(e, n) {
|
|
2315
|
-
return new Promise(function(a, o) {
|
|
2316
|
-
var s = {
|
|
2317
|
-
key: e,
|
|
2318
|
-
arg: n,
|
|
2319
|
-
resolve: a,
|
|
2320
|
-
reject: o,
|
|
2321
|
-
next: null
|
|
2322
|
-
};
|
|
2323
|
-
r ? r = r.next = s : (t = r = s, i(e, n));
|
|
2324
|
-
});
|
|
2325
|
-
}, typeof e.return != "function" && (this.return = void 0);
|
|
2326
|
-
}
|
|
2327
|
-
i.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2328
|
-
return this;
|
|
2329
|
-
}, i.prototype.next = function(e) {
|
|
2330
|
-
return this._invoke("next", e);
|
|
2331
|
-
}, i.prototype.throw = function(e) {
|
|
2332
|
-
return this._invoke("throw", e);
|
|
2333
|
-
}, i.prototype.return = function(e) {
|
|
2334
|
-
return this._invoke("return", e);
|
|
2335
|
-
}, t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
2336
|
-
} }), kn = v(Tn(), 1), An = v(Dn(), 1), jn = v(On(), 1), Mn = v(b(), 1);
|
|
2337
|
-
function Nn(n) {
|
|
2338
|
-
let i = R(n.transformer), a = (e) => {
|
|
2339
|
-
if (n.transformer || e === void 0) return e;
|
|
2340
|
-
let t = JSON.stringify(i.input.serialize(e));
|
|
2341
|
-
return JSON.parse(i.output.deserialize(t));
|
|
2342
|
-
};
|
|
2343
|
-
return () => ({ op: i }) => x((o) => {
|
|
2344
|
-
let s, c = new AbortController(), u = W(i.signal, c.signal), d = Pt(u);
|
|
2345
|
-
d.catch(() => {});
|
|
2346
|
-
let f = i.input;
|
|
2347
|
-
async function m(e) {
|
|
2348
|
-
return f = e, s = await n.createContext(), Se({
|
|
2349
|
-
router: n.router,
|
|
2350
|
-
path: i.path,
|
|
2351
|
-
getRawInput: async () => e,
|
|
2352
|
-
ctx: s,
|
|
2353
|
-
type: i.type,
|
|
2354
|
-
signal: u,
|
|
2355
|
-
batchIndex: 0
|
|
2356
|
-
});
|
|
2357
|
-
}
|
|
2358
|
-
function h(e) {
|
|
2359
|
-
var t;
|
|
2360
|
-
Te(e) || (t = n.onError) == null || t.call(n, {
|
|
2361
|
-
error: C(e),
|
|
2362
|
-
type: i.type,
|
|
2363
|
-
path: i.path,
|
|
2364
|
-
input: f,
|
|
2365
|
-
ctx: s
|
|
2366
|
-
});
|
|
2367
|
-
}
|
|
2368
|
-
function g(t) {
|
|
2369
|
-
if (I(t)) return t;
|
|
2370
|
-
let r = C(t), o = e({
|
|
2371
|
-
config: n.router._def._config,
|
|
2372
|
-
ctx: s,
|
|
2373
|
-
error: r,
|
|
2374
|
-
input: f,
|
|
2375
|
-
path: i.path,
|
|
2376
|
-
type: i.type
|
|
2377
|
-
});
|
|
2378
|
-
return L.from({ error: a(o) }, { cause: t instanceof Error ? t : void 0 });
|
|
2379
|
-
}
|
|
2380
|
-
return l(async () => {
|
|
2381
|
-
switch (i.type) {
|
|
2382
|
-
case "query":
|
|
2383
|
-
case "mutation": {
|
|
2384
|
-
let e = await m(i.input);
|
|
2385
|
-
if (!p(e)) {
|
|
2386
|
-
o.next({ result: { data: a(e) } }), o.complete();
|
|
2387
|
-
break;
|
|
2388
|
-
}
|
|
2389
|
-
o.next({ result: { data: (0, jn.default)(function* () {
|
|
2390
|
-
try {
|
|
2391
|
-
var t = (0, kn.default)();
|
|
2392
|
-
let n = t.a(ze(e));
|
|
2393
|
-
t.u(k({}, () => {
|
|
2394
|
-
o.complete();
|
|
2395
|
-
}));
|
|
2396
|
-
try {
|
|
2397
|
-
for (;;) {
|
|
2398
|
-
let e = yield (0, An.default)(Promise.race([n.next(), d]));
|
|
2399
|
-
if (e.done) return a(e.value);
|
|
2400
|
-
yield a(e.value);
|
|
2401
|
-
}
|
|
2402
|
-
} catch (e) {
|
|
2403
|
-
throw h(e), g(e);
|
|
2404
|
-
}
|
|
2405
|
-
} catch (e) {
|
|
2406
|
-
t.e = e;
|
|
2407
|
-
} finally {
|
|
2408
|
-
yield (0, An.default)(t.d());
|
|
2409
|
-
}
|
|
2410
|
-
})() } });
|
|
2411
|
-
break;
|
|
2412
|
-
}
|
|
2413
|
-
case "subscription": try {
|
|
2414
|
-
var e = (0, kn.default)();
|
|
2415
|
-
let s = S({
|
|
2416
|
-
type: "state",
|
|
2417
|
-
state: "connecting",
|
|
2418
|
-
error: null
|
|
2419
|
-
}), c = s.subscribe({ next(e) {
|
|
2420
|
-
o.next({ result: e });
|
|
2421
|
-
} }), l;
|
|
2422
|
-
for (e.u(k({}, async () => {
|
|
2423
|
-
o.complete(), s.next({
|
|
2424
|
-
type: "state",
|
|
2425
|
-
state: "idle",
|
|
2426
|
-
error: null
|
|
2427
|
-
}), c.unsubscribe();
|
|
2428
|
-
}));;) try {
|
|
2429
|
-
var n = (0, kn.default)();
|
|
2430
|
-
let e = await m(vn(i.input, l));
|
|
2431
|
-
if (!p(e)) throw Error("Expected an async iterable");
|
|
2432
|
-
let c = n.a(ze(e));
|
|
2433
|
-
for (o.next({ result: { type: "started" } }), s.next({
|
|
2434
|
-
type: "state",
|
|
2435
|
-
state: "pending",
|
|
2436
|
-
error: null
|
|
2437
|
-
});;) {
|
|
2438
|
-
let e;
|
|
2439
|
-
try {
|
|
2440
|
-
e = await Promise.race([c.next(), d]);
|
|
2441
|
-
} catch (e) {
|
|
2442
|
-
if (Te(e)) return;
|
|
2443
|
-
let n = C(e);
|
|
2444
|
-
if (!r.includes(t[n.code])) throw g(n);
|
|
2445
|
-
h(n), s.next({
|
|
2446
|
-
type: "state",
|
|
2447
|
-
state: "connecting",
|
|
2448
|
-
error: g(n)
|
|
2449
|
-
});
|
|
2450
|
-
break;
|
|
2451
|
-
}
|
|
2452
|
-
if (e.done) return;
|
|
2453
|
-
let n;
|
|
2454
|
-
we(e.value) ? (l = e.value[0], n = {
|
|
2455
|
-
id: e.value[0],
|
|
2456
|
-
data: {
|
|
2457
|
-
id: e.value[0],
|
|
2458
|
-
data: e.value[1]
|
|
2459
|
-
}
|
|
2460
|
-
}) : n = { data: e.value }, o.next({ result: (0, Mn.default)((0, Mn.default)({}, n), {}, { data: a(n.data) }) });
|
|
2461
|
-
}
|
|
2462
|
-
} catch (e) {
|
|
2463
|
-
n.e = e;
|
|
2464
|
-
} finally {
|
|
2465
|
-
await n.d();
|
|
2466
|
-
}
|
|
2467
|
-
break;
|
|
2468
|
-
} catch (t) {
|
|
2469
|
-
e.e = t;
|
|
2470
|
-
} finally {
|
|
2471
|
-
e.d();
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
|
-
}).catch((e) => {
|
|
2475
|
-
h(e), o.error(g(e));
|
|
2476
|
-
}), () => {
|
|
2477
|
-
c.abort();
|
|
2478
|
-
};
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
var Pn = Nn;
|
|
2482
|
-
//#endregion
|
|
2483
|
-
export { L as TRPCClientError, sn as TRPCUntypedClient, dn as clientCallTypeToProcedureType, pn as createTRPCClient, pn as createTRPCProxyClient, fn as createTRPCClientProxy, cn as createTRPCUntypedClient, nn as createWSClient, Pn as experimental_localLink, _t as getFetch, mn as getUntypedClient, Ft as httpBatchLink, hn as httpBatchStreamLink, jt as httpLink, xn as httpSubscriptionLink, Ot as isFormData, kt as isNonJsonSerializable, Dt as isOctetType, I as isTRPCClientError, Bt as jsonEncoder, zt as loggerLink, wn as retryLink, pe as splitLink, gn as unstable_httpBatchStreamLink, Sn as unstable_httpSubscriptionLink, Nn as unstable_localLink, rn as wsLink };
|