@toa.io/extensions.exposition 1.0.0-alpha.309 → 1.0.0-alpha.310
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/components/exposition.octets/package.json +2 -2
- package/package.json +10 -10
- package/transpiled/Announcements.d.ts +26 -0
- package/transpiled/Announcements.js +34 -0
- package/transpiled/Announcements.js.map +1 -0
- package/transpiled/Factory.d.ts +9 -0
- package/transpiled/Factory.js +23 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/HTTP/messages.js +18 -11
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Tenant.d.ts +4 -6
- package/transpiled/Tenant.js +10 -6
- package/transpiled/Tenant.js.map +1 -1
- package/ui/dist/_app/immutable/chunks/{rVcvrprD.js → BCJPed3-.js} +2 -2
- package/ui/dist/_app/immutable/chunks/BDuDJR9X.js +1 -0
- package/ui/dist/_app/immutable/chunks/{C5Gh4akx.js → BFtcFZWO.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{56yC_-AY.js → ck6CK-dV.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.D8C20MS-.js → app.CwA5shUx.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.BxffyCG_.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.B6c2uOkR.js → 0.BFAzzuc1.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.BVPsxlaQ.js → 1.3yaVV_1F.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.BAtWW734.js → 2.B023p_6N.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{3.CsLFX9dt.js → 3.DqbaMF3I.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{4.sX-4H5Mv.js → 4.CoCUKIsu.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{5.Bm-aLOX9.js → 5.CTjWt55g.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{6.BgLVDdlM.js → 6.DArHyhJL.js} +1 -1
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +10 -10
- package/ui/dist/_app/immutable/chunks/Bv_eEfLr.js +0 -1
- package/ui/dist/_app/immutable/entry/start.C1-9hOoO.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.exposition",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.310",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Exposition",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"!**/.env*"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
32
|
-
"@toa.io/definitions": "1.0.0-alpha.
|
|
33
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
34
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
35
|
-
"content-type": "3.
|
|
31
|
+
"@toa.io/core": "1.0.0-alpha.310",
|
|
32
|
+
"@toa.io/definitions": "1.0.0-alpha.310",
|
|
33
|
+
"@toa.io/generic": "1.0.0-alpha.310",
|
|
34
|
+
"@toa.io/schemas": "1.0.0-alpha.310",
|
|
35
|
+
"content-type": "3.1.0",
|
|
36
36
|
"matchacho": "0.6.1",
|
|
37
37
|
"minimatch": "10.2.6",
|
|
38
38
|
"msgpackr": "2.1.0",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
"features:octets": "TSX_TSCONFIG_PATH=features/steps/tsconfig.json NODE_OPTIONS=--import=tsx cucumber-js features/octets.*"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@node-rs/bcrypt": "1.10.
|
|
65
|
-
"@simplewebauthn/server": "14.0.
|
|
64
|
+
"@node-rs/bcrypt": "1.10.9",
|
|
65
|
+
"@simplewebauthn/server": "14.0.2",
|
|
66
66
|
"@toa.io/agent": "*",
|
|
67
67
|
"@toa.io/extensions.storages": "*",
|
|
68
68
|
"@types/cors": "2.8.19",
|
|
69
69
|
"@types/negotiator": "0.6.5",
|
|
70
70
|
"jose": "6.2.12",
|
|
71
|
-
"js-yaml": "5.4.
|
|
71
|
+
"js-yaml": "5.4.2",
|
|
72
72
|
"lru-cache": "11.5.2",
|
|
73
73
|
"paseto": "4.0.1"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d952c57f77279729e26d52d50c6df47138ad0a4f"
|
|
76
76
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Connector } from '@toa.io/core';
|
|
2
|
+
import type { Branch } from './Branch.ts';
|
|
3
|
+
import type { Label } from './discovery.ts';
|
|
4
|
+
import type { bindings } from '@toa.io/core/types';
|
|
5
|
+
/**
|
|
6
|
+
* What every tenant in this process announces through, and what answers the gateway when it
|
|
7
|
+
* asks. One subscription rather than one per tenant: a subscription with no group consumes a
|
|
8
|
+
* queue the binding remembers by the exchange alone, so a second one here would share it and
|
|
9
|
+
* each ask would reach one tenant of the two.
|
|
10
|
+
*
|
|
11
|
+
* It is held by the extension's factory, which outlives every composition it hands a tenant to,
|
|
12
|
+
* and is taken down once the last of them has gone.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Announcements extends Connector {
|
|
15
|
+
private readonly broadcast;
|
|
16
|
+
private readonly tenants;
|
|
17
|
+
constructor(broadcast: Broadcast);
|
|
18
|
+
open(): Promise<void>;
|
|
19
|
+
/** Counts a tenant in, until what it returns is called. */
|
|
20
|
+
register(announce: Announce): () => void;
|
|
21
|
+
transmit(branch: Branch): Promise<void>;
|
|
22
|
+
private announce;
|
|
23
|
+
}
|
|
24
|
+
type Announce = () => Promise<void>;
|
|
25
|
+
type Broadcast = bindings.Broadcast<Label>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Connector } from '@toa.io/core';
|
|
2
|
+
/**
|
|
3
|
+
* What every tenant in this process announces through, and what answers the gateway when it
|
|
4
|
+
* asks. One subscription rather than one per tenant: a subscription with no group consumes a
|
|
5
|
+
* queue the binding remembers by the exchange alone, so a second one here would share it and
|
|
6
|
+
* each ask would reach one tenant of the two.
|
|
7
|
+
*
|
|
8
|
+
* It is held by the extension's factory, which outlives every composition it hands a tenant to,
|
|
9
|
+
* and is taken down once the last of them has gone.
|
|
10
|
+
*/
|
|
11
|
+
export class Announcements extends Connector {
|
|
12
|
+
broadcast;
|
|
13
|
+
tenants = new Set();
|
|
14
|
+
constructor(broadcast) {
|
|
15
|
+
super();
|
|
16
|
+
this.broadcast = broadcast;
|
|
17
|
+
this.depends(broadcast);
|
|
18
|
+
}
|
|
19
|
+
async open() {
|
|
20
|
+
await this.broadcast.receive('ping', this.announce.bind(this));
|
|
21
|
+
}
|
|
22
|
+
/** Counts a tenant in, until what it returns is called. */
|
|
23
|
+
register(announce) {
|
|
24
|
+
this.tenants.add(announce);
|
|
25
|
+
return () => this.tenants.delete(announce);
|
|
26
|
+
}
|
|
27
|
+
async transmit(branch) {
|
|
28
|
+
await this.broadcast.transmit('expose', branch);
|
|
29
|
+
}
|
|
30
|
+
async announce() {
|
|
31
|
+
await Promise.all(Array.from(this.tenants, (announce) => announce()));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=Announcements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Announcements.js","sourceRoot":"","sources":["../source/Announcements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IACzB,SAAS,CAAW;IACpB,OAAO,GAAG,IAAI,GAAG,EAAY,CAAA;IAE9C,YAAmB,SAAoB;QACrC,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAE1B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IACzB,CAAC;IAEe,KAAK,CAAC,IAAI;QACxB,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,2DAA2D;IACpD,QAAQ,CAAC,QAAkB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAE1B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAc;QAClC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IACjD,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IACvE,CAAC;CACF"}
|
package/transpiled/Factory.d.ts
CHANGED
|
@@ -3,8 +3,17 @@ import type { Connector, Contract, Locator } from '@toa.io/core';
|
|
|
3
3
|
import type { extensions } from '@toa.io/core/types';
|
|
4
4
|
export declare class Factory implements extensions.Factory {
|
|
5
5
|
private readonly host;
|
|
6
|
+
private announcing;
|
|
7
|
+
private announcements;
|
|
6
8
|
constructor(host: Host);
|
|
7
9
|
tenant(locator: Locator, node: syntax.Node, manifest: Manifest): Promise<Connector>;
|
|
10
|
+
/**
|
|
11
|
+
* The announcements this process holds, made if there are none. A factory is loaded once and
|
|
12
|
+
* outlives every composition it hands a tenant to, so what it remembers is replaced rather
|
|
13
|
+
* than handed out again once it has been taken down.
|
|
14
|
+
*/
|
|
15
|
+
private shared;
|
|
16
|
+
private announce;
|
|
8
17
|
service(): Promise<Connector | null>;
|
|
9
18
|
}
|
|
10
19
|
export type Host = extensions.Host;
|
package/transpiled/Factory.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { contract } from '@toa.io/core';
|
|
3
|
+
import { Announcements } from './Announcements.js';
|
|
3
4
|
import { Tenant } from './Tenant.js';
|
|
4
5
|
import { CHANNEL } from '@toa.io/definitions/extensions.exposition';
|
|
5
6
|
export class Factory {
|
|
6
7
|
host;
|
|
8
|
+
announcing;
|
|
9
|
+
announcements;
|
|
7
10
|
constructor(host) {
|
|
8
11
|
this.host = host;
|
|
9
12
|
}
|
|
10
13
|
async tenant(locator, node, manifest) {
|
|
11
|
-
const
|
|
14
|
+
const announcements = await this.shared();
|
|
12
15
|
const routes = createHash('sha256').update(JSON.stringify(node)).digest('hex');
|
|
13
16
|
// no timestamp: the tenant stamps each announcement with its own start time
|
|
14
17
|
const branch = {
|
|
@@ -21,7 +24,25 @@ export class Factory {
|
|
|
21
24
|
contract: contract.component(manifest),
|
|
22
25
|
routes
|
|
23
26
|
};
|
|
24
|
-
return new Tenant(
|
|
27
|
+
return new Tenant(announcements, branch);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The announcements this process holds, made if there are none. A factory is loaded once and
|
|
31
|
+
* outlives every composition it hands a tenant to, so what it remembers is replaced rather
|
|
32
|
+
* than handed out again once it has been taken down.
|
|
33
|
+
*/
|
|
34
|
+
async shared() {
|
|
35
|
+
if (this.announcements?.disposed === true) {
|
|
36
|
+
this.announcing = undefined;
|
|
37
|
+
this.announcements = undefined;
|
|
38
|
+
}
|
|
39
|
+
this.announcing ??= this.announce();
|
|
40
|
+
return await this.announcing;
|
|
41
|
+
}
|
|
42
|
+
async announce() {
|
|
43
|
+
const announcements = new Announcements(await this.host.broadcast(CHANNEL));
|
|
44
|
+
this.announcements = announcements;
|
|
45
|
+
return announcements;
|
|
25
46
|
}
|
|
26
47
|
async service() {
|
|
27
48
|
const { service } = await import('./service.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AAMnE,MAAM,OAAO,OAAO;IACD,IAAI,CAAM;IACnB,UAAU,CAAoC;IAC9C,aAAa,CAA2B;IAEhD,YAAmB,IAAU;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEM,KAAK,CAAC,MAAM,CACjB,OAAgB,EAChB,IAAiB,EACjB,QAAkB;QAElB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;QACzC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAE9E,4EAA4E;QAC5E,MAAM,MAAM,GAA8B;YACxC,oFAAoF;YACpF,SAAS,EAAE,OAAO,CAAC,SAAU;YAC7B,SAAS,EAAE,OAAO,CAAC,IAAI;YACvB,QAAQ,EAAE,OAAO,CAAC,SAAS,KAAK,UAAU;YAC1C,IAAI;YACJ,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;YACtC,MAAM;SACP,CAAA;QAED,OAAO,IAAI,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAC1C,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,MAAM;QAClB,IAAI,IAAI,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;YAC3B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAA;QAChC,CAAC;QAED,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAA;QAEnC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAA;IAC9B,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAE3E,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAElC,OAAO,aAAa,CAAA;IACtB,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAA;QAEhD,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACF"}
|
|
@@ -120,7 +120,7 @@ export function multipart(message, context, response) {
|
|
|
120
120
|
throw new NotAcceptable();
|
|
121
121
|
const encoder = context.encoder;
|
|
122
122
|
response.setHeader('content-type', `${encoder.multipart}; boundary=${BOUNDARY}`);
|
|
123
|
-
return new Framing(message.body, encoder, context
|
|
123
|
+
return new Framing(message.body, encoder, context);
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* A part is pulled when the reader takes one, so a slow reader holds the body back.
|
|
@@ -131,26 +131,34 @@ export function multipart(message, context, response) {
|
|
|
131
131
|
*
|
|
132
132
|
* Aborted, it ends with `FIN` instead of being cut: the gateway is stopping, and the reader is
|
|
133
133
|
* told the stream is over rather than left to find out.
|
|
134
|
+
*
|
|
135
|
+
* A body that fails ends with `FIN` as well. The parts already written are a prefix of what the
|
|
136
|
+
* body would have yielded, which is what `FIN` promises a reader of a stream anyway, and a reply
|
|
137
|
+
* cut instead reaches the reader as a broken connection — through a proxy, a protocol error
|
|
138
|
+
* that the reader cannot tell from a network failure.
|
|
134
139
|
*/
|
|
135
140
|
class Framing extends Readable {
|
|
136
141
|
body;
|
|
137
142
|
parts;
|
|
138
143
|
encoder;
|
|
139
144
|
signal;
|
|
145
|
+
path;
|
|
140
146
|
pulling = false;
|
|
141
147
|
stopping = false;
|
|
142
148
|
finished = false;
|
|
143
|
-
constructor(body, encoder,
|
|
149
|
+
constructor(body, encoder, context) {
|
|
144
150
|
super();
|
|
145
151
|
this.body = body;
|
|
146
152
|
this.encoder = encoder;
|
|
147
|
-
this.signal = signal;
|
|
153
|
+
this.signal = context.signal;
|
|
154
|
+
// a request without a URL is one a test made up
|
|
155
|
+
this.path = context.url?.pathname;
|
|
148
156
|
this.parts = body[Symbol.asyncIterator]();
|
|
149
157
|
this.push(Buffer.concat([CUT, CRLF, encoder.encode('ACK'), CRLF, CUT]));
|
|
150
|
-
if (signal.aborted)
|
|
158
|
+
if (this.signal.aborted)
|
|
151
159
|
this.stop();
|
|
152
160
|
else
|
|
153
|
-
signal.addEventListener('abort', this.stop, { once: true });
|
|
161
|
+
this.signal.addEventListener('abort', this.stop, { once: true });
|
|
154
162
|
}
|
|
155
163
|
_read() {
|
|
156
164
|
if (this.pulling || this.finished)
|
|
@@ -168,13 +176,12 @@ class Framing extends Readable {
|
|
|
168
176
|
try {
|
|
169
177
|
result = await this.parts.next();
|
|
170
178
|
}
|
|
171
|
-
catch (
|
|
179
|
+
catch (exception) {
|
|
172
180
|
// the body was destroyed by `stop`, and that is not an error of the stream
|
|
173
|
-
if (this.stopping)
|
|
174
|
-
this.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
throw error;
|
|
181
|
+
if (!this.stopping)
|
|
182
|
+
console.warn('Message stream error', { path: this.path, exception });
|
|
183
|
+
this.finish();
|
|
184
|
+
return;
|
|
178
185
|
}
|
|
179
186
|
finally {
|
|
180
187
|
this.pulling = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../source/HTTP/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,WAAW,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAe,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAItC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;AAC9C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,UAAU,GACd,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE;IAC7F,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,GAAG,CAA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AI,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,KAAK,CAAA;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,MAAM,CAAC,CAAA;AAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAChC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAA"}
|
package/transpiled/Tenant.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Connector } from '@toa.io/core';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Label } from './discovery.ts';
|
|
2
|
+
import type { Announcements } from './Announcements.ts';
|
|
4
3
|
import type { Branch } from './Branch.ts';
|
|
5
4
|
export declare class Tenant extends Connector {
|
|
6
|
-
private readonly
|
|
5
|
+
private readonly announcements;
|
|
7
6
|
private readonly branch;
|
|
8
7
|
private started;
|
|
9
8
|
private stopped;
|
|
10
|
-
|
|
9
|
+
private withdraw;
|
|
10
|
+
constructor(announcements: Announcements, branch: Omit<Branch, 'timestamp'>);
|
|
11
11
|
open(): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Announcing is stopped where the teardown begins, not in `dispose`, which a connector
|
|
@@ -19,5 +19,3 @@ export declare class Tenant extends Connector {
|
|
|
19
19
|
private announce;
|
|
20
20
|
private expose;
|
|
21
21
|
}
|
|
22
|
-
type Broadcast = bindings.Broadcast<Label>;
|
|
23
|
-
export {};
|
package/transpiled/Tenant.js
CHANGED
|
@@ -2,20 +2,23 @@ import { setTimeout } from 'node:timers/promises';
|
|
|
2
2
|
import { Connector } from '@toa.io/core';
|
|
3
3
|
import { BRANCH_TTL } from '@toa.io/definitions/extensions.exposition';
|
|
4
4
|
export class Tenant extends Connector {
|
|
5
|
-
|
|
5
|
+
announcements;
|
|
6
6
|
branch;
|
|
7
7
|
started = 0;
|
|
8
8
|
stopped = false;
|
|
9
|
-
|
|
9
|
+
withdraw;
|
|
10
|
+
constructor(announcements, branch) {
|
|
10
11
|
super();
|
|
11
|
-
this.
|
|
12
|
+
this.announcements = announcements;
|
|
12
13
|
this.branch = branch;
|
|
13
|
-
this.depends(
|
|
14
|
+
this.depends(announcements);
|
|
14
15
|
}
|
|
15
16
|
async open() {
|
|
16
17
|
this.started = Date.now();
|
|
18
|
+
// counted in before the first announcement: what answers an ask made in between is the
|
|
19
|
+
// announcement itself, and one made twice is the same announcement
|
|
20
|
+
this.withdraw = this.announcements.register(this.expose.bind(this));
|
|
17
21
|
await this.expose();
|
|
18
|
-
await this.broadcast.receive('ping', this.expose.bind(this));
|
|
19
22
|
void this.announce();
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
@@ -26,6 +29,7 @@ export class Tenant extends Connector {
|
|
|
26
29
|
*/
|
|
27
30
|
async close() {
|
|
28
31
|
this.stopped = true;
|
|
32
|
+
this.withdraw?.();
|
|
29
33
|
}
|
|
30
34
|
async announce() {
|
|
31
35
|
while (!this.stopped) {
|
|
@@ -41,7 +45,7 @@ export class Tenant extends Connector {
|
|
|
41
45
|
// is the same announcement by another route
|
|
42
46
|
if (this.stopped)
|
|
43
47
|
return;
|
|
44
|
-
await this.
|
|
48
|
+
await this.announcements.transmit({ ...this.branch, timestamp: this.started });
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
function exposeInterval(uptime) {
|
package/transpiled/Tenant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tenant.js","sourceRoot":"","sources":["../source/Tenant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"Tenant.js","sourceRoot":"","sources":["../source/Tenant.ts"],"names":[],"mapp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,KAAK,EAAE,CAAC,CAAA;YAElD,IAAI,IAAI,CAAC,OAAO;gBAAE,MAAK;YAEvB,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;QACrB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,MAAM;QAClB,uFAAuF;QACvF,4CAA4C;QAC5C,IAAI,IAAI,CAAC,OAAO;YAAE,OAAM;QAExB,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IAChF,CAAC;CACF;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO,IAAI,CAAC,KAAK,CACf,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,CACxE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,GAAG,KAAK,CAAA;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,CAAA;AAC/C,MAAM,UAAU,GAAG,OAAO,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,C as r,Ct as i,E as a,I as o,L as s,M as c,Mt as l,N as u,St as d,V as f,_t as p,a as m,bt as h,d as g,dt as _,et as v,ft as y,gt as b,ht as x,i as S,j as C,jt as ee,kt as w,o as T,st as te,tt as ne,vt as E,w as re,x as D,y as ie}from"./BVDJTrf4.js";import{s as ae}from"./
|
|
1
|
+
import{$ as e,A as t,At as n,C as r,Ct as i,E as a,I as o,L as s,M as c,Mt as l,N as u,St as d,V as f,_t as p,a as m,bt as h,d as g,dt as _,et as v,ft as y,gt as b,ht as x,i as S,j as C,jt as ee,kt as w,o as T,st as te,tt as ne,vt as E,w as re,x as D,y as ie}from"./BVDJTrf4.js";import{s as ae}from"./BDuDJR9X.js";import"./xihTtKlq.js";function O(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var k=l((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Err=void 0,e.Err=class extends Error{code;name=`Error`;message=``;cause;constructor(e,t){super(),this.code=e,delete this.stack,Object.defineProperty(this,"name",{enumerable:!1}),typeof t==`string`?(this.message=t,Object.defineProperty(this,"cause",{enumerable:!1})):(Object.defineProperty(this,"message",{enumerable:!1}),Object.defineProperty(this,"cause",{enumerable:t!==void 0,value:t}))}}}))();async function oe(e,t){if(!e.ok||!e.body||e.bodyUsed)return e;let n=e.headers.get(`content-type`);if(!n||!~n.indexOf(`multipart/`))return e;let r=n.indexOf(`boundary=`),i=`-`;if(~r){let e=r+9,t=n.indexOf(`;`,e);i=n.slice(e,t>-1?t:void 0).trim().replace(/"/g,``)}return async function*(e,t,n){let r,i,a,o=new TextDecoder(`utf8`),s=e.getReader(),c=!n||!n.multiple,l=t.length,u=``,d=[];try{let e;e:for(;!(e=await s.read()).done;){let n=o.decode(e.value,{stream:!0});r=u.length,u+=n;let s=n.indexOf(t);for(~s?r+=s:r=u.indexOf(t),d=[];~r;){let e=u.slice(0,r),n=u.slice(r+l);if(i){let t=e.indexOf(`\r
|
|
2
2
|
\r
|
|
3
3
|
`)+4,r=e.lastIndexOf(`\r
|
|
4
4
|
`,t),i=!1,o=e.slice(t,r>-1?void 0:r),s=String(e.slice(0,t)).trim().split(`\r
|
|
5
5
|
`),l={},u=s.length;for(;a=s[--u];a=a.split(`: `),l[a.shift().toLowerCase()]=a.join(`: `));if(a=l[`content-type`],a&&~a.indexOf(`application/json`))try{o=JSON.parse(o),i=!0}catch{}if(a={headers:l,body:o,json:i},c?yield a:d.push(a),n.slice(0,2)===`--`)break e}else t=`\r
|
|
6
|
-
`+t,i=l+=2;u=n,r=u.indexOf(t)}d.length&&(yield d)}}finally{d.length&&(yield d),await s.cancel()}}(e.body,`--${i}`,t)}var se=Object.defineProperty,ce=(e,t)=>{for(var n in t)se(e,n,{get:t[n],enumerable:!0})},A=Symbol(`meta`);function le(e){return e[A]??null}function ue(e,t){Object.defineProperty(e,A,{value:t,writable:!1,enumerable:!1,configurable:!1})}var de=class{origin;events;sleep;fetch=fetch.bind(globalThis);challenge=null;constructor(e){this.origin=e.origin,this.events=e.events,e.sleep!==void 0&&(this.sleep=JSON.stringify(e.sleep))}async json(e,t){let n=this.setup(t),r=await this.request(e,n),i=r.headers.get(`content-type`)===`application/json`?await r.json():await r.text();return typeof i==`object`&&i&&ue(i,{status:r.status,headers:r.headers}),r.ok?(this.events.emit(`response`,{status:r.status,headers:r.headers}),i):(this.events.emit(`error`,{code:r.status,body:i}),new k.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new k.Err(r.status,{body:await r.text()});let i=await oe(r),a=await i.next();if(n.debug&&console.debug(`Multipart ACK`,{path:e,body:a.value.body}),JSON.parse(a.value.body)!==`ACK`)throw Error(`No ACK`);return(async function*(){for await(let t of i){n.debug&&console.debug(`Multipart chunk`,{path:e,body:t.body});let r=JSON.parse(t.body);if(r===`FIN`)return;yield r}})()}async octets(e,t){let n=await this.multipart(e,t);if(n instanceof Error)return n;let r=(await n.next()).value,i=O();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new k.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new k.Err(`EXCEPTION`);t?.debug&&console.debug(`Emitting octets step`,{path:e,step:r.step,payload:n}),i.emit(r.step,n)}i.off(`*`)})(),[r,i]}authenticate(e){this.challenge=e}use(e){this.fetch=e}setup(e){if(e??={},e.headers??={},e.headers.accept??=`application/json`,this.sleep!==void 0&&(e.headers.sleep=this.sleep),e.credentials===`include`&&e.headers.authorization===void 0){if(this.challenge===null)throw Error(`Credentials must be set before sending authenticated request`);e.headers.authorization=this.challenge,delete e.credentials}return e.body!==void 0&&(e.method??=`POST`,e.body instanceof File||e.body instanceof ReadableStream?(e.duplex=`half`,e.headers[`content-type`]??=e.body.type??`application/octet-stream`):(e.body=JSON.stringify(e.body),e.headers[`content-type`]??=`application/json`)),e}async request(e,t){let n=new URL(e,this.origin),r=await this.fetch(n.href,t),i=r.headers.get(`authorization`);return i!==null&&(this.challenge=i,this.events.emit(`challenge`,i)),r}},fe=class{agent;path;init;constructor(e){this.agent=e.agent,this.path=e.path,this.init=e.init}async json(e,t){return await this.request(`json`,e,t)}async octets(e,t){return await this.request(`octets`,e,t)}async multipart(e,t){return await this.request(`multipart`,e,t)}async request(e,t,n){let r=typeof t==`string`?t:``;n=typeof t==`string`?n:t;let i=this.abs(r),a=Object.assign({},this.init,n);if(e===`json`)return await this.agent.json(i,a);if(e===`octets`)return await this.agent.octets(i,a);if(e===`multipart`)return await this.agent.multipart(i,a);throw Error(`Invalid method: ${e}`)}abs(e){let t=new URL(this.path,`https://void`),n=new URL(e,t);return n.pathname.endsWith(`/`)||(n.pathname+=`/`),n.pathname+n.search}},pe=class{events;agent;constructor(e){this.events=O(),this.agent=new de({origin:e.origin,events:this.events,sleep:e.sleep})}resource(e,t){return new fe({agent:this.agent,path:e,init:t})}authenticate(e){this.agent.authenticate(e)}use(e){this.agent.use(e)}};function me(e){return typeof e==`string`&&(e={origin:e}),new pe(e)}ce({},{format:()=>ge,test:()=>he});function he(e){return/^[[(]\d+\.\.\d+[\])]{1}$/.test(e)}function ge(e,t){let[n,r]=t.slice(1,-1).split(`..`);return[`${e}${t.startsWith(`(`)?`>`:`>=`}${n}`,`${e}${t.endsWith(`)`)?`<`:`<=`}${r}`]}var _e={title:`Discovery`,description:`What a Toa application serves`},j=typeof window>`u`?``:window.location.origin,ve=8002,ye=8003,be=Se(ve,`/.introspection/`),xe=Se(ye,`/.configuration/`);function Se(e,t){if(typeof window>`u`)return t;let{protocol:n,hostname:r}=window.location;return(Ce(r)?`${n}//${r}:${e}`:``)+t}function Ce(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e.startsWith(`192.168.`)||e.startsWith(`172.16.`)||e.startsWith(`10.`)}var we=`1`;(()=>{let e=new Date(Number.parseInt(ae)),t=e.getFullYear(),n=new Date(t,0,1).getTime(),r=new Date(t+1,0,1).getTime();return`${we}.${(t+(e.getTime()-n)/(r-n)).toFixed(4)}`})();var M=me({origin:j,sleep:void 0});console.info(`Origin connected`,j,`no sleep`);function Te(e){if(document.startViewTransition===void 0)return Promise.resolve(e?.());let t=e!==void 0;return t&&je(),new Promise(n=>{let r=document.startViewTransition(async()=>{De(),n(await e?.())});r.finished.then(i,i),r.ready.catch(N);function i(){t&&Me(),F()}})}function N(){}function Ee(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{De(),t(),await e.complete}});n.finished.then(F,F),n.ready.catch(N)})}var P=null;function De(){if(P===null)return;let e=P.el.style.viewTransitionName===P.name;P.el.style.viewTransitionName=e?``:P.name,P.el.style.viewTransitionClass=e?``:P.classes??``}function F(){P!==null&&P.el.style.viewTransitionName===P.name&&(Oe(P),P=null)}function Oe(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}var ke=E(!1),Ae=new Set;function je(){ke.set(!0);for(let e of Ae)e.original={name:e.node.style.viewTransitionName,classes:e.node.style.viewTransitionClass},e.node.style.viewTransitionName=e.options.name,e.options.classes!==void 0&&(e.node.style.viewTransitionClass=e.options.classes)}function Me(){for(let e of Ae)e.original!==void 0&&(e.node.style.viewTransitionName=e.original.name,e.node.style.viewTransitionClass=e.original.classes);ke.set(!1)}navigator.userAgent.toLowerCase().includes(`windows`);var Ne=/mac ?os|ios|ipad ?os/i.test(navigator.userAgentData?.platform??``)||/(Mac|iPhone|iPad|iPod)/.test(navigator.userAgent);/android/i.test(navigator.userAgent);var Pe=/(iPhone|iPad|iPod)/.test(navigator.userAgent),Fe=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);`ontouchstart`in window;var Ie=window.matchMedia(`(display-mode: standalone)`).matches,Le=/PWAShell/i.test(navigator.userAgent);navigator.userAgent.match(/PWAShell\/(\S+)/)?.[1];var Re=!(`ontouchstart`in window);[`en-US`,`en-LR`,`en-MM`].includes(navigator.language),[`en-US`,`en-GB`,`en-CA`,`en-AU`,`en-NZ`,`en-IE`,`en-IN`,`en-LR`,`en-MM`].includes(navigator.language);function ze(e=navigator.userAgent){return[/FBAN|FBAV|FB_IAB/i,/Instagram/i,/Twitter/i,/Line/i,/LinkedIn/i,/Snapchat/i,/WhatsApp/i,/WeChat/i,/Messenger/i,/QQ/i,/Reddit/i,/Puffin/i,/TikTok/i,/musical.ly/i,/YouTube/i,/Pinterest/i,/Discord/i,/Telegram/i,/Viber/i,/Slack/i,/Signal/i,/KakaoTalk/i,/Baidu/i].some(t=>t.test(e))||(()=>{let t=RegExp(`(${[`WebView`,`(iPhone|iPod|iPad)(?!.*Safari/)`,`Android.*(wv)`,`(AppleWebKit)(?!.*Safari)`].join(`|`)})`,`ig`);return e.match(t)!==null})()||`TelegramWebviewProxy`in window||`TelegramWebviewProxyProto`in window||`TelegramWebview`in window}ze(navigator.userAgent);var Be=new URLSearchParams;new URLSearchParams;function Ve(e){return Be.get(e)}function He(e,t=24){return p(e,n=>{let r=Date.now(),i=setInterval(()=>a(),1e3/t);function a(){let t=e-(Date.now()-r);t>0?n(t):(n(0),clearInterval(i))}return a(),()=>clearInterval(i)})}var Ue=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=E(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??Ge.revalidate,this.stale=e.stale??Ge.stale,e.persist!==void 0&&this.persist(e.persist),e.bind!==void 0&&this.bind(e.bind)}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}add(e){this.values?.set(e.id,e),this.store.update(t=>t===null||t instanceof Error?[e]:t.find(t=>t.id===e.id)===void 0?[e,...t]:t)}get(e,t){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.get(e,t)}extract(e){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.extract(e)}delete(e){this.values?.delete(e),this.store.update(t=>t===null||t instanceof Error?t:t.filter(t=>t.id!==e))}set(e,t){this.store.update(n=>{if(n===null||n instanceof Error)return[e];let r=n.findIndex(t=>t.id===e.id);return r===-1?t?.add===!0?[e,...n]:n:(n[r]=e,n)}),this.values?.set(e.id,e)}update(e,t,n){if(this.values===void 0)throw Error(`Collection: values is not defined`);let r=this.values.extract(e);if(r===null)return;let i=t(r)??r;this.set(i,n)}sync(){return(this.timestamp===0||this.timestamp+this.revalidate<Date.now())&&(this.stale||this.clear(),this.refresh()),this}async fetch(){return await this.refresh(),this}replace(e){let t=e;if(this.store.set(t),this.timestamp=Date.now(),this.values!==void 0)for(let e of t)this.values.set(e.id,e)}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error?this.store.set(e):this.replace(e)}persist(e){if(typeof window>`u`)return;let t=this.load(e);if(t!==null&&(this.store.set(t),this.values?.persistent===!1))for(let e of t)this.values.set(e.id,e);this.store.subscribe(t=>{t instanceof Error||(t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t)))})}load(e){if(typeof window>`u`)return null;let t=localStorage.getItem(e);if(t===null)return null;try{let n=JSON.parse(t);return Array.isArray(n)?n:(console.error(`Storage value for ${e} is not an array:`,n),null)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}clear(){this.store.set(null),this.values?.clear(),this.timestamp=0}};function We(e){return new Ue(e)}var Ge={revalidate:3e5,stale:!1},Ke=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??Ye.revalidate,this.store=e.persist===void 0||typeof window>`u`?E(this.default):qe(e.persist,this.default,e.session),e.bind&&this.bind(e.bind)}set(e){this.store.set(e)}update(e){this.store.update(t=>e(t))}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}extract(){return b(this.store)}sync(){this.request!==void 0&&this.timestamp+this.revalidate<Date.now()&&this.refresh()}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error||this.set(e)}bind(e){e.subscribe(e=>{e===null&&this.store.set(this.default)})}};function I(e={}){return new Ke(e)}function qe(e,t,n){let r=E(Je(e)??t),i=n?`sessionStorage`:`localStorage`;return r.subscribe(t=>{t===null?window[i].removeItem(e):window[i].setItem(e,JSON.stringify(t))}),r}function Je(e){let t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}var Ye={revalidate:3e5};function Xe(e,t){return new Promise(n=>{let r=!1,i=null;i=e.subscribe(e=>{t(e)&&(i?.(),r=!0,n(e))}),r&&i?.()})}function Ze(e){return Xe(e,e=>e!==null&&!(e instanceof Error))}var Qe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},$e=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},et=Symbol(`lucide-context`),tt=()=>h(et),nt=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),rt=u(`<svg><!><!></svg>`);function L(a,o){i(o,!0);let s=tt()??{},c=S(o,`color`,19,()=>s.color??`currentColor`),l=S(o,`size`,19,()=>s.size??24),u=S(o,`strokeWidth`,19,()=>s.strokeWidth??2),p=S(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),h=S(o,`iconNode`,19,()=>[]),_=m(o,nt),y=te(()=>p()?Number(u())*24/Number(l()):u());var b=rt();g(b,e=>({...Qe,...e,..._,width:l(),height:l(),stroke:c(),"stroke-width":f(y),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!$e(_)&&{"aria-hidden":`true`}]);var x=e(b);r(x,17,h,re,(e,n)=>{var r=te(()=>ee(f(n),2));let i=()=>f(r)[0],a=()=>f(r)[1];var o=C(),s=v(o);ie(s,i,!0,(e,t)=>{g(e,()=>({...a()}))}),t(e,o)});var T=ne(x);D(T,()=>o.children??n),w(b),t(a,b),d()}var it=new Set([`$$slots`,`$$events`,`$$legacy`]);function at(e,t){let n=m(t,it),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];L(e,T({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var ot=new Set([`$$slots`,`$$events`,`$$legacy`]);function st(e,t){let n=m(t,ot),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];L(e,T({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var ct=c(`<div class="m-auto flex flex-col items-center gap-4"><span class="text-destructive">Something went terribly wrong</span> <button class="p-4 border border-muted-foreground hover:bg-muted cursor-pointer rounded-md flex items-center gap-2"><!></button></div>`);function lt(n,r){let i=()=>y(r.store,`$store`,o),[o,c]=_(),l=S(r,`silent`,3,!1);var u=C(),d=v(u),f=e=>{var n=C(),i=v(n),o=e=>{var n=C(),i=v(n);D(i,()=>r.waiting),t(e,n)},s=e=>{at(e,{class:`animate-spin m-auto text-muted-foreground`})};a(i,e=>{r.waiting?e(o):l()||e(s,1)}),t(e,n)},p=n=>{var o=C(),c=v(o),u=e=>{var n=C(),a=v(n);D(a,()=>r.error,i),t(e,n)},d=n=>{var r=ct(),i=ne(e(r),2);st(e(i),{size:16}),w(i),w(r),s(`click`,i,()=>window.location.reload()),t(n,r)};a(c,e=>{r.error?e(u):l()||e(d,1)}),t(n,o)},m=e=>{var n=C(),a=v(n);D(a,()=>r.awaited,i),t(e,n)};a(d,e=>{i()===null?e(f):i()instanceof Error?e(p,1):e(m,-1)}),t(n,u),c()}o([`click`]);var R=I({persist:`auth:account`}),z=I({persist:`auth:challenge`,bind:R}),B=I({persist:`auth:method`}),V=E(!1),ut=E(!1),dt=x([z,R,V],([e,t,n])=>e!==null&&t!==null&&n===!1);function H(e){R.extract()?.id!==e.id&&R.set(null),R.set(e)}var ft=M.resource(`/accounts/echo/`);async function U(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),ft.json(t)}var pt=M.resource(`/identity/basic/`,{credentials:`include`});async function mt(e,t){return await pt.json(e,{method:`POST`,body:t})}var W=M.resource(`/accounts/otp/`);async function G(e,t){return typeof e==`string`?await W.json(e,{method:`POST`,body:t,credentials:`include`}):await W.json({method:`POST`,body:e})}var ht=M.resource(`/accounts/passkeys/`);async function gt(e,t){return typeof e==`string`?await ht.json(e,{method:`POST`,body:t,credentials:`include`}):await ht.json({method:`POST`,body:e})}var _t=M.resource(`/identity/federation/`,{credentials:`include`});async function vt(e,t){return await _t.json(e,{method:`POST`,body:t})}async function K(){let e=z.extract();if(e===null)return;let t=await U(e);if(t instanceof Error)return t;H(t)}function q(e,t){return e instanceof Error?e:(H(e),B.set(t),e)}var yt=I({persist:`auth:oidc:nonce`});function bt(e,t){let{client:n,endpoint:r,type:i,scope:a}=e;if(n===void 0||n===``)throw Error(`Client ID is required`);let o=xt(),s=new URLSearchParams({client_id:n,redirect_uri:window.location.origin+`/`,response_type:i,response_mode:`fragment`,scope:a,state:btoa(JSON.stringify({idp:t})),nonce:o});yt.set(o),window.location.href=r+`?`+s}function xt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var St=globalThis.__sveltekit_1w3b6zb.env,Ct={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:St.PUBLIC_APPLE_CLIENT_ID},google:{iss:`https://accounts.google.com`,endpoint:`https://accounts.google.com/o/oauth2/v2/auth`,type:`id_token`,scope:`openid profile`,client:St.PUBLIC_GOOGLE_CLIENT_ID}};async function wt(e){await Tt();let t=await new Promise(t=>{window.google.accounts.oauth2.initCodeClient({client_id:e.client,scope:e.scope,ux_mode:`popup`,state:btoa(JSON.stringify({idp:`google`})),redirect_uri:window.location.origin+`/`,callback:async e=>{t(e)}}).requestCode()});return t?.code===void 0?Error(`NO_RESPONSE`,{cause:t}):t.code}function Tt(){return new Promise((e,t)=>{if(window.google?.accounts?.oauth2!==void 0)return e(void 0);let n=document.createElement(`script`);n.src=`https://accounts.google.com/gsi/client`,n.async=!0,n.onload=()=>e(void 0),n.onerror=t,document.head.appendChild(n)})}var J=typeof window<`u`&&window;async function Et(e){await Dt(e);let t=await J.AppleID.auth.signIn().catch(e=>e);return t instanceof Error?t:t?.authorization===void 0?Error(`No authentication response received`,{cause:t}):t.authorization.code}function Dt(e){if(J.AppleID===void 0)return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=`https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js`,r.async=!0,r.onload=()=>{J.AppleID.auth.init({clientId:e.client,scope:e.scope,redirectURI:window.location.origin,state:btoa(JSON.stringify({idp:`apple`})),usePopup:!0}),t(void 0)},r.onerror=n,document.head.appendChild(r)})}var Ot={apple:Et,google:wt};async function kt(e,t){let n=await At(e);return n instanceof Error?n:t===void 0?Mt(e,n):jt(t,n)}async function At(e){let t=Ot[e]??bt,n=Ct[e],r=await t(n,e);if(r instanceof Error)return console.error(`Authentication failed`,r),r;if(r===void 0)throw Error(`No authentication code received, redirect flow is not supported`);let i={code:r,iss:n.iss,for:window.location.origin};return btoa(JSON.stringify(i))}async function jt(e,t){let n=await vt(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;K()}async function Mt(e,t){return q(await U(`Code `+t),e)}function Nt(){R.set(null)}async function Pt(e,t){return q(await U(`Basic `+btoa(`${e}:${t}`)),`password`)}async function Ft(e,t){return await mt(e,t)}async function It(e,t){let n=await Ft(e,t);if(n instanceof Error)return n;K()}async function Lt(e){return G({email:e})}async function Rt(e,t){return await G(e,{email:t})}async function zt(e,t){return q(await U(`OTP `+btoa(`${e}:${t}`)),`password`)}var Bt=M.resource(`/identity/passkeys/challenges/`);async function Vt(e,t){let n={type:e};return t===void 0?await Bt.json(`.`,{method:`POST`,body:n}):await Bt.json(t,{method:`POST`,body:n})}var Ht=M.resource(`/identity/passkeys/`);async function Ut(e){return await Ht.json(e,{credentials:`include`})}async function Wt(){return await Ut((await Ze(R)).id)}We({get:Wt,persist:`identity:passkeys`,bind:R,stale:!0});function Y(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Gt(e){return new TextEncoder().encode(e).buffer}function X(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Kt({id:e,transports:t}){return{id:Y(e),type:`public-key`,transports:t}}async function qt(e,t){let n={challenge:Y(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Gt(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Kt)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function Jt(e){let t={timeout:e.timeout,challenge:Y(e.challenge),allowCredentials:e.allowCredentials.map(Kt),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function Yt(e,t){let n=await Vt(`creation`,t);if(n instanceof Error)return n;let r=await qt({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:Xt(r,e),identity:n.identity}}function Xt(e,t){let n=e.response,r=n.getAuthenticatorData(),i=n.getTransports(),a=n.getPublicKeyAlgorithm(),o=n.getPublicKey(),s=e.getClientExtensionResults();if(o===null)throw Error(`No public key is created`);return{id:e.id,type:e.type,response:{attestationObject:X(n.attestationObject),clientDataJSON:X(n.clientDataJSON),authenticatorData:X(r),transports:i,publicKeyAlgorithm:a,publicKey:X(o)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:s,label:t}}async function Zt(e){let t=await Vt(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await Jt(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new $t:r:r===null?Error(`No credential given`):Qt(r)}function Qt(e){let t=e.response;return{id:e.id,type:e.type,response:{authenticatorData:X(t.authenticatorData),clientDataJSON:X(t.clientDataJSON),signature:X(t.signature),userHandle:t.userHandle===null?null:X(t.userHandle)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults()}}var $t=class extends Error{constructor(){super(),this.name=this.constructor.name}},en=typeof window>`u`||window.PublicKeyCredential!==void 0;async function tn(e,t){let n=await Yt(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await gt(n.identity,n.key);return r instanceof Error&&console.error(`Credential registration failed`,r),q(r,`passkey`)}async function nn(e){let t=await Zt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await gt(t);return n instanceof Error&&console.error(`Credential verification failed`,n),q(n,`passkey`)}var rn=M.resource(`/.discovery`);async function an(){let e=b(z)!==null;return await rn.json({method:`OPTIONS`,...e?{credentials:`include`}:{}})}async function on(e){let t=e.guarded&&b(z)!==null,n=await M.resource(e.path).json({method:e.verb,...e.body===void 0?{}:{body:e.body},...t?{credentials:`include`}:{}});if(n instanceof Error){let e=n.code;return{status:typeof e==`number`?e:0,body:n.cause??n.message,ok:!1}}return{status:(typeof n==`object`&&n?le(n):null)?.status??200,body:n,ok:!0}}var sn=I({get:an,persist:`discovery:tree`,bind:R}),cn=I({persist:`discovery:server`}),ln={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{identity:`Copy your account id`,markdown:`Download as Markdown`,mcp:`Copy the MCP address`,configuration:`Open Configuration`,introspection:`Open Introspection`,signin:`Sign in`,signout:`Sign out`,filter:`Filter resources`,back:`Back`}}},un=[`en-US`];function dn(e){return un.some(t=>t.startsWith(e))}function Z(e){return un.find(t=>t.startsWith(e))??`en-US`}var Q=l((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.format=o,e.parse=s;var t=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/[\\"]/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function o(e){let{type:t,parameters:r}=e;if(!t||!i.test(t))throw TypeError(`Invalid type: ${t}`);let a=t;if(r)for(let e of Object.keys(r)){if(!n.test(e))throw TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${y(r[e])}`}return a}function s(e,t){let n=t?.comma===!0?m:65536,r=e.length,i=_(e,t?.start??0,r),o=i;i=g(e,i,r,n);let s=v(e,o,i),c=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:c,index:i,parameters:new a}:h(e,c,i,r,n)}var c=32,l=9,u=59,d=61,f=34,p=92,m=44;function h(e,t,n,r,i){let o=new a;parameter:for(;n<r&&e.charCodeAt(n)!==i;){n=_(e,n+1,r);let t=n;for(;n<r;){let a=e.charCodeAt(n);if(a===i)break parameter;if(a===u)continue parameter;if(a===d){let a=v(e,t,n),s=e.slice(t,a).toLowerCase();if(n=_(e,n+1,r),n<r&&e.charCodeAt(n)===f){n++;let t=``;for(;n<r;){let a=e.charCodeAt(n++);if(a===f){n=g(e,n,r,i),o[s]===void 0&&(o[s]=t);break}if(a===p&&n<r){t+=e[n++];continue}t+=String.fromCharCode(a)}continue parameter}let c=n;if(n=g(e,n,r,i),o[s]===void 0){let t=v(e,c,n);o[s]=e.slice(c,t)}continue parameter}n++}}return{type:t,index:n,parameters:o}}function g(e,t,n,r){for(;t<n;){let n=e.charCodeAt(t);if(n===u||n===r)break;t++}return t}function _(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==c&&n!==l)break;t++}return t}function v(e,t,n){for(;n>t;){let t=e.charCodeAt(n-1);if(t!==c&&t!==l)break;n--}return n}function y(e){if(n.test(e))return e;if(t.test(e))return`"${e.replace(r,`\\$&`)}"`;throw TypeError(`Invalid parameter value: ${e}`)}})),$=l(((e,t)=>{var n=Q();t.exports=r;function r(e){for(var t=[],r=0;r<e.length;){var a=i(e,r),o=n.parse(e,{comma:!0,start:a});o.type=e.slice(a,a+o.type.length),t.push(o),r=o.index+1}return t}function i(e,t){for(var n=t;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;return n}})),fn=l(((e,t)=>{var n=$();t.exports=s,t.exports.preferredCharsets=s;function r(e){for(var t=n(e),r=0,a=0;r<t.length;r++){var o=i(t[r],r);o&&(t[a++]=o)}return t.length=a,t}function i(e,t){return e.type?{charset:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.charset.toLowerCase()===e.toLowerCase())r|=1;else if(t.charset!==`*`)return null;return{i:n,o:t.i,q:t.q,s:r}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.charset}function u(e){return e.q>0}})),pn=l(((e,t)=>{var n=$();t.exports=s,t.exports.preferredEncodings=s;function r(e){for(var t=n(e),r=!1,a=1,s=0,c=0;s<t.length;s++){var l=i(t[s],s);l&&(t[c++]=l,r||=o(`identity`,l),a=Math.min(a,l.q||1))}return r||(t[c++]={encoding:`identity`,q:a,i:s}),t.length=c,t}function i(e,t){return e.type?{encoding:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={encoding:e,o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.encoding.toLowerCase()===e.toLowerCase())r|=1;else if(t.encoding!==`*`)return null;return{encoding:e,i:n,o:t.i,q:t.q,s:r}}function s(e,t,n){var i=r(e||``),o=n?function(e,t){if(e.q!==t.q)return t.q-e.q;var r=n.indexOf(e.encoding),i=n.indexOf(t.encoding);return r===-1&&i===-1?t.s-e.s||e.o-t.o||e.i-t.i:r!==-1&&i!==-1?r-i:r===-1?1:-1}:c;if(!t)return i.filter(u).sort(o).map(l);var s=t.map(function(e,t){return a(e,i,t)});return s.filter(u).sort(o).map(function(e){return t[s.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function l(e){return e.encoding}function u(e){return e.q>0}})),mn=l(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredLanguages=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){if(!e.type)return null;var n=e.type.indexOf(`-`);return{prefix:n===-1?e.type:e.type.slice(0,n),suffix:n===-1?void 0:e.type.slice(n+1),q:e.parameters.q?parseFloat(e.parameters.q):1,i:t,full:e.type}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0);if(!i)return null;var o=0;if(t.full.toLowerCase()===i.full.toLowerCase())o|=4;else if(t.prefix.toLowerCase()===i.full.toLowerCase())o|=2;else if(t.full.toLowerCase()===i.prefix.toLowerCase())o|=1;else if(t.full!==`*`)return null;return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.full}function d(e){return e.q>0}})),hn=l(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredMediaTypes=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){var n=e.type.indexOf(`/`);if(n===-1)return null;var r=e.parameters.q?parseFloat(e.parameters.q):1;return delete e.parameters.q,{type:e.type.slice(0,n),subtype:e.type.slice(n+1),params:e.parameters,q:r,i:t}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0),o=0;if(!i)return null;if(t.type.toLowerCase()==i.type.toLowerCase())o|=4;else if(t.type!=`*`)return null;if(t.subtype.toLowerCase()==i.subtype.toLowerCase())o|=2;else if(t.subtype!=`*`)return null;var s=Object.keys(t.params);if(s.length>0){if(s.every(function(e){return t.params[e]==`*`||(t.params[e]||``).toLowerCase()==(i.params[e]||``).toLowerCase()}))o|=1;else return null}return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*/*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.type+`/`+e.subtype}function d(e){return e.q>0}}));l(((e,t)=>{var n=fn(),r=pn(),i=mn(),a=hn();t.exports=o,t.exports.Negotiator=o;function o(e){if(!(this instanceof o))return new o(e);this.request=e}o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers[`accept-charset`],e)},o.prototype.encoding=function(e,t){var n=this.encodings(e,t);return n&&n[0]},o.prototype.encodings=function(e,t){var n=t||{};return r(this.request.headers[`accept-encoding`],e,n.preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return i(this.request.headers[`accept-language`],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return a(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes}))();var gn=`en-US`,_n=I({persist:`intl:selected`}),vn=x([R,_n],([e,t])=>t?Z(t):yn()||(e?.locale!==void 0&&dn(e.locale)?Z(e.locale):gn));x(R,e=>e?.grammar??`none`);function yn(){if(typeof navigator<`u`){for(let e of navigator.languages)if(dn(e))return Z(e)}return null}var bn=x(vn,e=>ln[e]);export{Ne as A,be as B,B as C,L as D,at as E,Ie as F,j as H,Ee as I,Te as L,Pe as M,Fe as N,He as O,Le as P,M as R,ut as S,lt as T,le as U,_e as V,Ct as _,on as a,dt as b,tn as c,Lt as d,zt as f,kt as g,Nt as h,sn as i,Re as j,Ve as k,en as l,Pt as m,vn as n,an as o,It as p,cn as r,nn as s,bn as t,Rt as u,K as v,V as w,z as x,R as y,xe as z};
|
|
6
|
+
`+t,i=l+=2;u=n,r=u.indexOf(t)}d.length&&(yield d)}}finally{d.length&&(yield d),await s.cancel()}}(e.body,`--${i}`,t)}var se=Object.defineProperty,ce=(e,t)=>{for(var n in t)se(e,n,{get:t[n],enumerable:!0})},A=Symbol(`meta`);function le(e){return e[A]??null}function ue(e,t){Object.defineProperty(e,A,{value:t,writable:!1,enumerable:!1,configurable:!1})}var de=class{origin;events;sleep;fetch=fetch.bind(globalThis);challenge=null;constructor(e){this.origin=e.origin,this.events=e.events,e.sleep!==void 0&&(this.sleep=JSON.stringify(e.sleep))}async json(e,t){let n=this.setup(t),r=await this.request(e,n),i=r.headers.get(`content-type`)===`application/json`?await r.json():await r.text();return typeof i==`object`&&i&&ue(i,{status:r.status,headers:r.headers}),r.ok?(this.events.emit(`response`,{status:r.status,headers:r.headers}),i):(this.events.emit(`error`,{code:r.status,body:i}),new k.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new k.Err(r.status,{body:await r.text()});let i=await oe(r),a=await i.next();if(n.debug&&console.debug(`Multipart ACK`,{path:e,body:a.value.body}),JSON.parse(a.value.body)!==`ACK`)throw Error(`No ACK`);return(async function*(){for await(let t of i){n.debug&&console.debug(`Multipart chunk`,{path:e,body:t.body});let r=JSON.parse(t.body);if(r===`FIN`)return;yield r}})()}async octets(e,t){let n=await this.multipart(e,t);if(n instanceof Error)return n;let r=(await n.next()).value,i=O();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new k.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new k.Err(`EXCEPTION`);t?.debug&&console.debug(`Emitting octets step`,{path:e,step:r.step,payload:n}),i.emit(r.step,n)}i.off(`*`)})(),[r,i]}authenticate(e){this.challenge=e}use(e){this.fetch=e}setup(e){if(e??={},e.headers??={},e.headers.accept??=`application/json`,this.sleep!==void 0&&(e.headers.sleep=this.sleep),e.credentials===`include`&&e.headers.authorization===void 0){if(this.challenge===null)throw Error(`Credentials must be set before sending authenticated request`);e.headers.authorization=this.challenge,delete e.credentials}return e.body!==void 0&&(e.method??=`POST`,e.body instanceof File||e.body instanceof ReadableStream?(e.duplex=`half`,e.headers[`content-type`]??=e.body.type??`application/octet-stream`):(e.body=JSON.stringify(e.body),e.headers[`content-type`]??=`application/json`)),e}async request(e,t){let n=new URL(e,this.origin),r=await this.fetch(n.href,t),i=r.headers.get(`authorization`);return i!==null&&(this.challenge=i,this.events.emit(`challenge`,i)),r}},fe=class{agent;path;init;constructor(e){this.agent=e.agent,this.path=e.path,this.init=e.init}async json(e,t){return await this.request(`json`,e,t)}async octets(e,t){return await this.request(`octets`,e,t)}async multipart(e,t){return await this.request(`multipart`,e,t)}async request(e,t,n){let r=typeof t==`string`?t:``;n=typeof t==`string`?n:t;let i=this.abs(r),a=Object.assign({},this.init,n);if(e===`json`)return await this.agent.json(i,a);if(e===`octets`)return await this.agent.octets(i,a);if(e===`multipart`)return await this.agent.multipart(i,a);throw Error(`Invalid method: ${e}`)}abs(e){let t=new URL(this.path,`https://void`),n=new URL(e,t);return n.pathname.endsWith(`/`)||(n.pathname+=`/`),n.pathname+n.search}},pe=class{events;agent;constructor(e){this.events=O(),this.agent=new de({origin:e.origin,events:this.events,sleep:e.sleep})}resource(e,t){return new fe({agent:this.agent,path:e,init:t})}authenticate(e){this.agent.authenticate(e)}use(e){this.agent.use(e)}};function me(e){return typeof e==`string`&&(e={origin:e}),new pe(e)}ce({},{format:()=>ge,test:()=>he});function he(e){return/^[[(]\d+\.\.\d+[\])]{1}$/.test(e)}function ge(e,t){let[n,r]=t.slice(1,-1).split(`..`);return[`${e}${t.startsWith(`(`)?`>`:`>=`}${n}`,`${e}${t.endsWith(`)`)?`<`:`<=`}${r}`]}var _e={title:`Discovery`,description:`What a Toa application serves`},j=typeof window>`u`?``:window.location.origin,ve=8002,ye=8003,be=Se(ve,`/.introspection/`),xe=Se(ye,`/.configuration/`);function Se(e,t){if(typeof window>`u`)return t;let{protocol:n,hostname:r}=window.location;return(Ce(r)?`${n}//${r}:${e}`:``)+t}function Ce(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e.startsWith(`192.168.`)||e.startsWith(`172.16.`)||e.startsWith(`10.`)}var we=`1`;(()=>{let e=new Date(Number.parseInt(ae)),t=e.getFullYear(),n=new Date(t,0,1).getTime(),r=new Date(t+1,0,1).getTime();return`${we}.${(t+(e.getTime()-n)/(r-n)).toFixed(4)}`})();var M=me({origin:j,sleep:void 0});console.info(`Origin connected`,j,`no sleep`);function Te(e){if(document.startViewTransition===void 0)return Promise.resolve(e?.());let t=e!==void 0;return t&&je(),new Promise(n=>{let r=document.startViewTransition(async()=>{De(),n(await e?.())});r.finished.then(i,i),r.ready.catch(N);function i(){t&&Me(),F()}})}function N(){}function Ee(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{De(),t(),await e.complete}});n.finished.then(F,F),n.ready.catch(N)})}var P=null;function De(){if(P===null)return;let e=P.el.style.viewTransitionName===P.name;P.el.style.viewTransitionName=e?``:P.name,P.el.style.viewTransitionClass=e?``:P.classes??``}function F(){P!==null&&P.el.style.viewTransitionName===P.name&&(Oe(P),P=null)}function Oe(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}var ke=E(!1),Ae=new Set;function je(){ke.set(!0);for(let e of Ae)e.original={name:e.node.style.viewTransitionName,classes:e.node.style.viewTransitionClass},e.node.style.viewTransitionName=e.options.name,e.options.classes!==void 0&&(e.node.style.viewTransitionClass=e.options.classes)}function Me(){for(let e of Ae)e.original!==void 0&&(e.node.style.viewTransitionName=e.original.name,e.node.style.viewTransitionClass=e.original.classes);ke.set(!1)}navigator.userAgent.toLowerCase().includes(`windows`);var Ne=/mac ?os|ios|ipad ?os/i.test(navigator.userAgentData?.platform??``)||/(Mac|iPhone|iPad|iPod)/.test(navigator.userAgent);/android/i.test(navigator.userAgent);var Pe=/(iPhone|iPad|iPod)/.test(navigator.userAgent),Fe=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);`ontouchstart`in window;var Ie=window.matchMedia(`(display-mode: standalone)`).matches,Le=/PWAShell/i.test(navigator.userAgent);navigator.userAgent.match(/PWAShell\/(\S+)/)?.[1];var Re=!(`ontouchstart`in window);[`en-US`,`en-LR`,`en-MM`].includes(navigator.language),[`en-US`,`en-GB`,`en-CA`,`en-AU`,`en-NZ`,`en-IE`,`en-IN`,`en-LR`,`en-MM`].includes(navigator.language);function ze(e=navigator.userAgent){return[/FBAN|FBAV|FB_IAB/i,/Instagram/i,/Twitter/i,/Line/i,/LinkedIn/i,/Snapchat/i,/WhatsApp/i,/WeChat/i,/Messenger/i,/QQ/i,/Reddit/i,/Puffin/i,/TikTok/i,/musical.ly/i,/YouTube/i,/Pinterest/i,/Discord/i,/Telegram/i,/Viber/i,/Slack/i,/Signal/i,/KakaoTalk/i,/Baidu/i].some(t=>t.test(e))||(()=>{let t=RegExp(`(${[`WebView`,`(iPhone|iPod|iPad)(?!.*Safari/)`,`Android.*(wv)`,`(AppleWebKit)(?!.*Safari)`].join(`|`)})`,`ig`);return e.match(t)!==null})()||`TelegramWebviewProxy`in window||`TelegramWebviewProxyProto`in window||`TelegramWebview`in window}ze(navigator.userAgent);var Be=new URLSearchParams;new URLSearchParams;function Ve(e){return Be.get(e)}function He(e,t=24){return p(e,n=>{let r=Date.now(),i=setInterval(()=>a(),1e3/t);function a(){let t=e-(Date.now()-r);t>0?n(t):(n(0),clearInterval(i))}return a(),()=>clearInterval(i)})}var Ue=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=E(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??Ge.revalidate,this.stale=e.stale??Ge.stale,e.persist!==void 0&&this.persist(e.persist),e.bind!==void 0&&this.bind(e.bind)}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}add(e){this.values?.set(e.id,e),this.store.update(t=>t===null||t instanceof Error?[e]:t.find(t=>t.id===e.id)===void 0?[e,...t]:t)}get(e,t){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.get(e,t)}extract(e){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.extract(e)}delete(e){this.values?.delete(e),this.store.update(t=>t===null||t instanceof Error?t:t.filter(t=>t.id!==e))}set(e,t){this.store.update(n=>{if(n===null||n instanceof Error)return[e];let r=n.findIndex(t=>t.id===e.id);return r===-1?t?.add===!0?[e,...n]:n:(n[r]=e,n)}),this.values?.set(e.id,e)}update(e,t,n){if(this.values===void 0)throw Error(`Collection: values is not defined`);let r=this.values.extract(e);if(r===null)return;let i=t(r)??r;this.set(i,n)}sync(){return(this.timestamp===0||this.timestamp+this.revalidate<Date.now())&&(this.stale||this.clear(),this.refresh()),this}async fetch(){return await this.refresh(),this}replace(e){let t=e;if(this.store.set(t),this.timestamp=Date.now(),this.values!==void 0)for(let e of t)this.values.set(e.id,e)}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error?this.store.set(e):this.replace(e)}persist(e){if(typeof window>`u`)return;let t=this.load(e);if(t!==null&&(this.store.set(t),this.values?.persistent===!1))for(let e of t)this.values.set(e.id,e);this.store.subscribe(t=>{t instanceof Error||(t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t)))})}load(e){if(typeof window>`u`)return null;let t=localStorage.getItem(e);if(t===null)return null;try{let n=JSON.parse(t);return Array.isArray(n)?n:(console.error(`Storage value for ${e} is not an array:`,n),null)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}clear(){this.store.set(null),this.values?.clear(),this.timestamp=0}};function We(e){return new Ue(e)}var Ge={revalidate:3e5,stale:!1},Ke=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??Ye.revalidate,this.store=e.persist===void 0||typeof window>`u`?E(this.default):qe(e.persist,this.default,e.session),e.bind&&this.bind(e.bind)}set(e){this.store.set(e)}update(e){this.store.update(t=>e(t))}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}extract(){return b(this.store)}sync(){this.request!==void 0&&this.timestamp+this.revalidate<Date.now()&&this.refresh()}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error||this.set(e)}bind(e){e.subscribe(e=>{e===null&&this.store.set(this.default)})}};function I(e={}){return new Ke(e)}function qe(e,t,n){let r=E(Je(e)??t),i=n?`sessionStorage`:`localStorage`;return r.subscribe(t=>{t===null?window[i].removeItem(e):window[i].setItem(e,JSON.stringify(t))}),r}function Je(e){let t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}var Ye={revalidate:3e5};function Xe(e,t){return new Promise(n=>{let r=!1,i=null;i=e.subscribe(e=>{t(e)&&(i?.(),r=!0,n(e))}),r&&i?.()})}function Ze(e){return Xe(e,e=>e!==null&&!(e instanceof Error))}var Qe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},$e=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},et=Symbol(`lucide-context`),tt=()=>h(et),nt=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),rt=u(`<svg><!><!></svg>`);function L(a,o){i(o,!0);let s=tt()??{},c=S(o,`color`,19,()=>s.color??`currentColor`),l=S(o,`size`,19,()=>s.size??24),u=S(o,`strokeWidth`,19,()=>s.strokeWidth??2),p=S(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),h=S(o,`iconNode`,19,()=>[]),_=m(o,nt),y=te(()=>p()?Number(u())*24/Number(l()):u());var b=rt();g(b,e=>({...Qe,...e,..._,width:l(),height:l(),stroke:c(),"stroke-width":f(y),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!$e(_)&&{"aria-hidden":`true`}]);var x=e(b);r(x,17,h,re,(e,n)=>{var r=te(()=>ee(f(n),2));let i=()=>f(r)[0],a=()=>f(r)[1];var o=C(),s=v(o);ie(s,i,!0,(e,t)=>{g(e,()=>({...a()}))}),t(e,o)});var T=ne(x);D(T,()=>o.children??n),w(b),t(a,b),d()}var it=new Set([`$$slots`,`$$events`,`$$legacy`]);function at(e,t){let n=m(t,it),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];L(e,T({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var ot=new Set([`$$slots`,`$$events`,`$$legacy`]);function st(e,t){let n=m(t,ot),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];L(e,T({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var ct=c(`<div class="m-auto flex flex-col items-center gap-4"><span class="text-destructive">Something went terribly wrong</span> <button class="p-4 border border-muted-foreground hover:bg-muted cursor-pointer rounded-md flex items-center gap-2"><!></button></div>`);function lt(n,r){let i=()=>y(r.store,`$store`,o),[o,c]=_(),l=S(r,`silent`,3,!1);var u=C(),d=v(u),f=e=>{var n=C(),i=v(n),o=e=>{var n=C(),i=v(n);D(i,()=>r.waiting),t(e,n)},s=e=>{at(e,{class:`animate-spin m-auto text-muted-foreground`})};a(i,e=>{r.waiting?e(o):l()||e(s,1)}),t(e,n)},p=n=>{var o=C(),c=v(o),u=e=>{var n=C(),a=v(n);D(a,()=>r.error,i),t(e,n)},d=n=>{var r=ct(),i=ne(e(r),2);st(e(i),{size:16}),w(i),w(r),s(`click`,i,()=>window.location.reload()),t(n,r)};a(c,e=>{r.error?e(u):l()||e(d,1)}),t(n,o)},m=e=>{var n=C(),a=v(n);D(a,()=>r.awaited,i),t(e,n)};a(d,e=>{i()===null?e(f):i()instanceof Error?e(p,1):e(m,-1)}),t(n,u),c()}o([`click`]);var R=I({persist:`auth:account`}),z=I({persist:`auth:challenge`,bind:R}),B=I({persist:`auth:method`}),V=E(!1),ut=E(!1),dt=x([z,R,V],([e,t,n])=>e!==null&&t!==null&&n===!1);function H(e){R.extract()?.id!==e.id&&R.set(null),R.set(e)}var ft=M.resource(`/accounts/echo/`);async function U(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),ft.json(t)}var pt=M.resource(`/identity/basic/`,{credentials:`include`});async function mt(e,t){return await pt.json(e,{method:`POST`,body:t})}var W=M.resource(`/accounts/otp/`);async function G(e,t){return typeof e==`string`?await W.json(e,{method:`POST`,body:t,credentials:`include`}):await W.json({method:`POST`,body:e})}var ht=M.resource(`/accounts/passkeys/`);async function gt(e,t){return typeof e==`string`?await ht.json(e,{method:`POST`,body:t,credentials:`include`}):await ht.json({method:`POST`,body:e})}var _t=M.resource(`/identity/federation/`,{credentials:`include`});async function vt(e,t){return await _t.json(e,{method:`POST`,body:t})}async function K(){let e=z.extract();if(e===null)return;let t=await U(e);if(t instanceof Error)return t;H(t)}function q(e,t){return e instanceof Error?e:(H(e),B.set(t),e)}var yt=I({persist:`auth:oidc:nonce`});function bt(e,t){let{client:n,endpoint:r,type:i,scope:a}=e;if(n===void 0||n===``)throw Error(`Client ID is required`);let o=xt(),s=new URLSearchParams({client_id:n,redirect_uri:window.location.origin+`/`,response_type:i,response_mode:`fragment`,scope:a,state:btoa(JSON.stringify({idp:t})),nonce:o});yt.set(o),window.location.href=r+`?`+s}function xt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var St=globalThis.__sveltekit_wl5i37.env,Ct={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:St.PUBLIC_APPLE_CLIENT_ID},google:{iss:`https://accounts.google.com`,endpoint:`https://accounts.google.com/o/oauth2/v2/auth`,type:`id_token`,scope:`openid profile`,client:St.PUBLIC_GOOGLE_CLIENT_ID}};async function wt(e){await Tt();let t=await new Promise(t=>{window.google.accounts.oauth2.initCodeClient({client_id:e.client,scope:e.scope,ux_mode:`popup`,state:btoa(JSON.stringify({idp:`google`})),redirect_uri:window.location.origin+`/`,callback:async e=>{t(e)}}).requestCode()});return t?.code===void 0?Error(`NO_RESPONSE`,{cause:t}):t.code}function Tt(){return new Promise((e,t)=>{if(window.google?.accounts?.oauth2!==void 0)return e(void 0);let n=document.createElement(`script`);n.src=`https://accounts.google.com/gsi/client`,n.async=!0,n.onload=()=>e(void 0),n.onerror=t,document.head.appendChild(n)})}var J=typeof window<`u`&&window;async function Et(e){await Dt(e);let t=await J.AppleID.auth.signIn().catch(e=>e);return t instanceof Error?t:t?.authorization===void 0?Error(`No authentication response received`,{cause:t}):t.authorization.code}function Dt(e){if(J.AppleID===void 0)return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=`https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js`,r.async=!0,r.onload=()=>{J.AppleID.auth.init({clientId:e.client,scope:e.scope,redirectURI:window.location.origin,state:btoa(JSON.stringify({idp:`apple`})),usePopup:!0}),t(void 0)},r.onerror=n,document.head.appendChild(r)})}var Ot={apple:Et,google:wt};async function kt(e,t){let n=await At(e);return n instanceof Error?n:t===void 0?Mt(e,n):jt(t,n)}async function At(e){let t=Ot[e]??bt,n=Ct[e],r=await t(n,e);if(r instanceof Error)return console.error(`Authentication failed`,r),r;if(r===void 0)throw Error(`No authentication code received, redirect flow is not supported`);let i={code:r,iss:n.iss,for:window.location.origin};return btoa(JSON.stringify(i))}async function jt(e,t){let n=await vt(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;K()}async function Mt(e,t){return q(await U(`Code `+t),e)}function Nt(){R.set(null)}async function Pt(e,t){return q(await U(`Basic `+btoa(`${e}:${t}`)),`password`)}async function Ft(e,t){return await mt(e,t)}async function It(e,t){let n=await Ft(e,t);if(n instanceof Error)return n;K()}async function Lt(e){return G({email:e})}async function Rt(e,t){return await G(e,{email:t})}async function zt(e,t){return q(await U(`OTP `+btoa(`${e}:${t}`)),`password`)}var Bt=M.resource(`/identity/passkeys/challenges/`);async function Vt(e,t){let n={type:e};return t===void 0?await Bt.json(`.`,{method:`POST`,body:n}):await Bt.json(t,{method:`POST`,body:n})}var Ht=M.resource(`/identity/passkeys/`);async function Ut(e){return await Ht.json(e,{credentials:`include`})}async function Wt(){return await Ut((await Ze(R)).id)}We({get:Wt,persist:`identity:passkeys`,bind:R,stale:!0});function Y(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Gt(e){return new TextEncoder().encode(e).buffer}function X(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Kt({id:e,transports:t}){return{id:Y(e),type:`public-key`,transports:t}}async function qt(e,t){let n={challenge:Y(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Gt(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Kt)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function Jt(e){let t={timeout:e.timeout,challenge:Y(e.challenge),allowCredentials:e.allowCredentials.map(Kt),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function Yt(e,t){let n=await Vt(`creation`,t);if(n instanceof Error)return n;let r=await qt({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:Xt(r,e),identity:n.identity}}function Xt(e,t){let n=e.response,r=n.getAuthenticatorData(),i=n.getTransports(),a=n.getPublicKeyAlgorithm(),o=n.getPublicKey(),s=e.getClientExtensionResults();if(o===null)throw Error(`No public key is created`);return{id:e.id,type:e.type,response:{attestationObject:X(n.attestationObject),clientDataJSON:X(n.clientDataJSON),authenticatorData:X(r),transports:i,publicKeyAlgorithm:a,publicKey:X(o)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:s,label:t}}async function Zt(e){let t=await Vt(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await Jt(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new $t:r:r===null?Error(`No credential given`):Qt(r)}function Qt(e){let t=e.response;return{id:e.id,type:e.type,response:{authenticatorData:X(t.authenticatorData),clientDataJSON:X(t.clientDataJSON),signature:X(t.signature),userHandle:t.userHandle===null?null:X(t.userHandle)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults()}}var $t=class extends Error{constructor(){super(),this.name=this.constructor.name}},en=typeof window>`u`||window.PublicKeyCredential!==void 0;async function tn(e,t){let n=await Yt(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await gt(n.identity,n.key);return r instanceof Error&&console.error(`Credential registration failed`,r),q(r,`passkey`)}async function nn(e){let t=await Zt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await gt(t);return n instanceof Error&&console.error(`Credential verification failed`,n),q(n,`passkey`)}var rn=M.resource(`/.discovery`);async function an(){let e=b(z)!==null;return await rn.json({method:`OPTIONS`,...e?{credentials:`include`}:{}})}async function on(e){let t=e.guarded&&b(z)!==null,n=await M.resource(e.path).json({method:e.verb,...e.body===void 0?{}:{body:e.body},...t?{credentials:`include`}:{}});if(n instanceof Error){let e=n.code;return{status:typeof e==`number`?e:0,body:n.cause??n.message,ok:!1}}return{status:(typeof n==`object`&&n?le(n):null)?.status??200,body:n,ok:!0}}var sn=I({get:an,persist:`discovery:tree`,bind:R}),cn=I({persist:`discovery:server`}),ln={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{identity:`Copy your account id`,markdown:`Download as Markdown`,mcp:`Copy the MCP address`,configuration:`Open Configuration`,introspection:`Open Introspection`,signin:`Sign in`,signout:`Sign out`,filter:`Filter resources`,back:`Back`}}},un=[`en-US`];function dn(e){return un.some(t=>t.startsWith(e))}function Z(e){return un.find(t=>t.startsWith(e))??`en-US`}var Q=l((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.format=o,e.parse=s;var t=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/[\\"]/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function o(e){let{type:t,parameters:r}=e;if(!t||!i.test(t))throw TypeError(`Invalid type: ${t}`);let a=t;if(r)for(let e of Object.keys(r)){if(!n.test(e))throw TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${y(r[e])}`}return a}function s(e,t){let n=t?.comma===!0?m:65536,r=e.length,i=_(e,t?.start??0,r),o=i;i=g(e,i,r,n);let s=v(e,o,i),c=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:c,index:i,parameters:new a}:h(e,c,i,r,n)}var c=32,l=9,u=59,d=61,f=34,p=92,m=44;function h(e,t,n,r,i){let o=new a;parameter:for(;n<r&&e.charCodeAt(n)!==i;){n=_(e,n+1,r);let t=n;for(;n<r;){let a=e.charCodeAt(n);if(a===i)break parameter;if(a===u)continue parameter;if(a===d){let a=v(e,t,n),s=e.slice(t,a).toLowerCase();if(n=_(e,n+1,r),n<r&&e.charCodeAt(n)===f){n++;let t=``;for(;n<r;){let a=e.charCodeAt(n++);if(a===f){n=g(e,n,r,i),o[s]===void 0&&(o[s]=t);break}if(a===p&&n<r){t+=e[n++];continue}t+=String.fromCharCode(a)}continue parameter}let c=n;if(n=g(e,n,r,i),o[s]===void 0){let t=v(e,c,n);o[s]=e.slice(c,t)}continue parameter}n++}}return{type:t,index:n,parameters:o}}function g(e,t,n,r){for(;t<n;){let n=e.charCodeAt(t);if(n===u||n===r)break;t++}return t}function _(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==c&&n!==l)break;t++}return t}function v(e,t,n){for(;n>t;){let t=e.charCodeAt(n-1);if(t!==c&&t!==l)break;n--}return n}function y(e){if(n.test(e))return e;if(t.test(e))return`"${e.replace(r,`\\$&`)}"`;throw TypeError(`Invalid parameter value: ${e}`)}})),$=l(((e,t)=>{var n=Q();t.exports=r;function r(e){for(var t=[],r=0;r<e.length;){var a=i(e,r),o=n.parse(e,{comma:!0,start:a});o.type=e.slice(a,a+o.type.length),t.push(o),r=o.index+1}return t}function i(e,t){for(var n=t;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;return n}})),fn=l(((e,t)=>{var n=$();t.exports=s,t.exports.preferredCharsets=s;function r(e){for(var t=n(e),r=0,a=0;r<t.length;r++){var o=i(t[r],r);o&&(t[a++]=o)}return t.length=a,t}function i(e,t){return e.type?{charset:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.charset.toLowerCase()===e.toLowerCase())r|=1;else if(t.charset!==`*`)return null;return{i:n,o:t.i,q:t.q,s:r}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.charset}function u(e){return e.q>0}})),pn=l(((e,t)=>{var n=$();t.exports=s,t.exports.preferredEncodings=s;function r(e){for(var t=n(e),r=!1,a=1,s=0,c=0;s<t.length;s++){var l=i(t[s],s);l&&(t[c++]=l,r||=o(`identity`,l),a=Math.min(a,l.q||1))}return r||(t[c++]={encoding:`identity`,q:a,i:s}),t.length=c,t}function i(e,t){return e.type?{encoding:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={encoding:e,o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.encoding.toLowerCase()===e.toLowerCase())r|=1;else if(t.encoding!==`*`)return null;return{encoding:e,i:n,o:t.i,q:t.q,s:r}}function s(e,t,n){var i=r(e||``),o=n?function(e,t){if(e.q!==t.q)return t.q-e.q;var r=n.indexOf(e.encoding),i=n.indexOf(t.encoding);return r===-1&&i===-1?t.s-e.s||e.o-t.o||e.i-t.i:r!==-1&&i!==-1?r-i:r===-1?1:-1}:c;if(!t)return i.filter(u).sort(o).map(l);var s=t.map(function(e,t){return a(e,i,t)});return s.filter(u).sort(o).map(function(e){return t[s.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function l(e){return e.encoding}function u(e){return e.q>0}})),mn=l(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredLanguages=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){if(!e.type)return null;var n=e.type.indexOf(`-`);return{prefix:n===-1?e.type:e.type.slice(0,n),suffix:n===-1?void 0:e.type.slice(n+1),q:e.parameters.q?parseFloat(e.parameters.q):1,i:t,full:e.type}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0);if(!i)return null;var o=0;if(t.full.toLowerCase()===i.full.toLowerCase())o|=4;else if(t.prefix.toLowerCase()===i.full.toLowerCase())o|=2;else if(t.full.toLowerCase()===i.prefix.toLowerCase())o|=1;else if(t.full!==`*`)return null;return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.full}function d(e){return e.q>0}})),hn=l(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredMediaTypes=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){var n=e.type.indexOf(`/`);if(n===-1)return null;var r=e.parameters.q?parseFloat(e.parameters.q):1;return delete e.parameters.q,{type:e.type.slice(0,n),subtype:e.type.slice(n+1),params:e.parameters,q:r,i:t}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0),o=0;if(!i)return null;if(t.type.toLowerCase()==i.type.toLowerCase())o|=4;else if(t.type!=`*`)return null;if(t.subtype.toLowerCase()==i.subtype.toLowerCase())o|=2;else if(t.subtype!=`*`)return null;var s=Object.keys(t.params);if(s.length>0){if(s.every(function(e){return t.params[e]==`*`||(t.params[e]||``).toLowerCase()==(i.params[e]||``).toLowerCase()}))o|=1;else return null}return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*/*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.type+`/`+e.subtype}function d(e){return e.q>0}}));l(((e,t)=>{var n=fn(),r=pn(),i=mn(),a=hn();t.exports=o,t.exports.Negotiator=o;function o(e){if(!(this instanceof o))return new o(e);this.request=e}o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers[`accept-charset`],e)},o.prototype.encoding=function(e,t){var n=this.encodings(e,t);return n&&n[0]},o.prototype.encodings=function(e,t){var n=t||{};return r(this.request.headers[`accept-encoding`],e,n.preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return i(this.request.headers[`accept-language`],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return a(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes}))();var gn=`en-US`,_n=I({persist:`intl:selected`}),vn=x([R,_n],([e,t])=>t?Z(t):yn()||(e?.locale!==void 0&&dn(e.locale)?Z(e.locale):gn));x(R,e=>e?.grammar??`none`);function yn(){if(typeof navigator<`u`){for(let e of navigator.languages)if(dn(e))return Z(e)}return null}var bn=x(vn,e=>ln[e]);export{Ne as A,be as B,B as C,L as D,at as E,Ie as F,j as H,Ee as I,Te as L,Pe as M,Fe as N,He as O,Le as P,M as R,ut as S,lt as T,le as U,_e as V,Ct as _,on as a,dt as b,tn as c,Lt as d,zt as f,kt as g,Nt as h,sn as i,Re as j,Ve as k,en as l,Pt as m,vn as n,an as o,It as p,cn as r,nn as s,bn as t,Rt as u,K as v,V as w,z as x,R as y,xe as z};
|