vitral 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.js +4 -4
- package/dist/auto.js +4 -4
- package/dist/chunk-B2MPYF4M.js +27 -0
- package/dist/{chunk-KZBH5MPD.js → chunk-HIVMSPGM.js} +4 -4
- package/dist/{chunk-C3QOBAUE.js → chunk-JBNITHPI.js} +1 -1
- package/dist/chunk-OVVGVPIV.js +21 -0
- package/dist/{chunk-K6EG7DMO.js → chunk-PLM7U7LR.js} +6 -5
- package/dist/{chunk-5JNV45BB.js → chunk-S7PIVPBX.js} +8 -2
- package/dist/{chunk-4Z77XNBR.js → chunk-UXLKRSOM.js} +2 -2
- package/dist/edge.d.ts +8 -2
- package/dist/edge.js +25 -10
- package/dist/element.js +4 -4
- package/dist/embed.js +2 -2
- package/dist/{expose-IAKYHJXF.js → expose-EQOWTJNC.js} +2 -2
- package/dist/{hydrate-YVZDJ2V7.js → hydrate-R76V2I36.js} +18 -4
- package/dist/iframe.js +3 -3
- package/dist/index.js +2 -2
- package/dist/match-CMBM_jLW.d.ts +16 -0
- package/dist/preact.js +3 -3
- package/dist/prefetch.js +1 -1
- package/dist/react-server.d.ts +20 -0
- package/dist/react-server.js +13 -0
- package/dist/react.d.ts +4 -1
- package/dist/react.js +18 -30
- package/dist/{reframe-LQL4DZYP.js → reframe-MUV472OU.js} +2 -2
- package/dist/routes.d.ts +2 -11
- package/dist/routes.js +26 -22
- package/dist/solid.js +3 -3
- package/dist/svelte.js +3 -3
- package/dist/testing.js +2 -2
- package/dist/vue.js +3 -3
- package/package.json +7 -3
package/dist/angular.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineVitralElement
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PLM7U7LR.js";
|
|
4
|
+
import "./chunk-UXLKRSOM.js";
|
|
5
5
|
import {
|
|
6
6
|
defineRemote,
|
|
7
7
|
events,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
navigate,
|
|
10
10
|
same,
|
|
11
11
|
shared
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HIVMSPGM.js";
|
|
13
13
|
import {
|
|
14
14
|
configure
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-S7PIVPBX.js";
|
|
16
16
|
import "./chunk-KU6HF2EW.js";
|
|
17
17
|
import "./chunk-TW7KYJQ6.js";
|
|
18
18
|
import "./chunk-463H6B56.js";
|
package/dist/auto.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineVitralElement
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PLM7U7LR.js";
|
|
4
|
+
import "./chunk-UXLKRSOM.js";
|
|
5
|
+
import "./chunk-HIVMSPGM.js";
|
|
6
|
+
import "./chunk-S7PIVPBX.js";
|
|
7
7
|
import "./chunk-KU6HF2EW.js";
|
|
8
8
|
import "./chunk-TW7KYJQ6.js";
|
|
9
9
|
import "./chunk-463H6B56.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/react-tree.tsx
|
|
2
|
+
import { Component as ReactComponent, createContext } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var VitralContext = createContext(null);
|
|
5
|
+
var Boundary = class extends ReactComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.state = { failed: false };
|
|
9
|
+
}
|
|
10
|
+
static getDerivedStateFromError() {
|
|
11
|
+
return { failed: true };
|
|
12
|
+
}
|
|
13
|
+
componentDidCatch(error) {
|
|
14
|
+
this.props.ctx?.reportError(error);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return this.state.failed ? null : this.props.children;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function RemoteTree({ Component, props, ctx }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(VitralContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(Boundary, { ctx, children: /* @__PURE__ */ jsx(Component, { ...props }) }) });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
VitralContext,
|
|
26
|
+
RemoteTree
|
|
27
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
loadFile,
|
|
4
4
|
registerSrc,
|
|
5
5
|
resolveEntry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S7PIVPBX.js";
|
|
7
7
|
import {
|
|
8
8
|
injectStyles
|
|
9
9
|
} from "./chunk-KU6HF2EW.js";
|
|
@@ -119,7 +119,7 @@ var noop = () => {
|
|
|
119
119
|
async function checkUpdates() {
|
|
120
120
|
const p = protocol();
|
|
121
121
|
const found = [];
|
|
122
|
-
const { splitName } = await import("./expose-
|
|
122
|
+
const { splitName } = await import("./expose-EQOWTJNC.js");
|
|
123
123
|
const remotes = /* @__PURE__ */ new Map();
|
|
124
124
|
for (const name of live.keys()) {
|
|
125
125
|
const root = splitName(name)[0];
|
|
@@ -164,8 +164,8 @@ async function mountOnce(target, name, props, options) {
|
|
|
164
164
|
const p = protocol();
|
|
165
165
|
await p.pending();
|
|
166
166
|
const isolate = options.isolate ?? registered(name)?.isolate ?? p.settings().isolate;
|
|
167
|
-
if (isolate === "iframe") return (frames ?? (await import("./reframe-
|
|
168
|
-
const { module: mod, ...resolved } = await (isolate == "reframe" ? (await import("./reframe-
|
|
167
|
+
if (isolate === "iframe") return (frames ?? (await import("./reframe-MUV472OU.js")).noFrames)(target, name, props, options).catch(fail);
|
|
168
|
+
const { module: mod, ...resolved } = await (isolate == "reframe" ? (await import("./reframe-MUV472OU.js")).load : load)(name, isolate, options.priority);
|
|
169
169
|
const untrack = track(name, resolved);
|
|
170
170
|
ctxHooks.watch?.(name);
|
|
171
171
|
const label = resolved.name ?? name;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/core/match.ts
|
|
2
|
+
var compiled = /* @__PURE__ */ new Map();
|
|
3
|
+
function compile(pattern) {
|
|
4
|
+
let re = compiled.get(pattern);
|
|
5
|
+
if (!re) {
|
|
6
|
+
const body = pattern.replace(/\/\*$|^\*$/, "\0").replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/:(\w+)/g, "(?<$1>[^/]+)").replace(/\/$/, "").replace("\0", "(?:/.*)?");
|
|
7
|
+
compiled.set(pattern, re = new RegExp(`^${body}/?$`));
|
|
8
|
+
}
|
|
9
|
+
return re;
|
|
10
|
+
}
|
|
11
|
+
function matchRoute(path, routes) {
|
|
12
|
+
for (const [pattern, name] of Object.entries(routes)) {
|
|
13
|
+
const m = compile(pattern).exec(path);
|
|
14
|
+
if (m) return { name, pattern, params: { ...m.groups } };
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
matchRoute
|
|
21
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot,
|
|
3
3
|
timings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UXLKRSOM.js";
|
|
5
5
|
import {
|
|
6
6
|
defineRemote,
|
|
7
7
|
memoSelect,
|
|
8
8
|
same,
|
|
9
9
|
shared
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HIVMSPGM.js";
|
|
11
11
|
import {
|
|
12
|
-
registerSrc
|
|
13
|
-
|
|
12
|
+
registerSrc,
|
|
13
|
+
warmSsr
|
|
14
|
+
} from "./chunk-S7PIVPBX.js";
|
|
14
15
|
|
|
15
16
|
// src/element.ts
|
|
16
17
|
var Base = typeof HTMLElement === "undefined" ? class {
|
|
@@ -68,7 +69,7 @@ var VitralRemoteElement = class extends Base {
|
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
const ssr = true ? this.querySelector(":scope>[data-vitral-ssr]") : null;
|
|
71
|
-
if (ssr) import("./hydrate-
|
|
72
|
+
if (ssr) warmSsr(ssr), import("./hydrate-R76V2I36.js").then((m) => this.isConnected && !this.#slot && (this.#slot = m.hydrateSlot(this, ssr, { ...options, props: this.#props })));
|
|
72
73
|
else this.#slot = hostSlot(this, options);
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
@@ -79,16 +79,21 @@ function loadRemote(name) {
|
|
|
79
79
|
return load(name).then((r) => r.module);
|
|
80
80
|
}
|
|
81
81
|
function loadModule(name) {
|
|
82
|
-
return import("./expose-
|
|
82
|
+
return import("./expose-EQOWTJNC.js").then((m) => m.resolveModule(name, (n) => loadFile(n))).catch(fail);
|
|
83
83
|
}
|
|
84
84
|
function preload(name) {
|
|
85
85
|
load(name).catch(() => {
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
var paths;
|
|
89
|
+
function warmSsr(holder) {
|
|
90
|
+
paths ??= import("./sri-576GTDIA.js").catch(() => null);
|
|
91
|
+
if (holder.querySelector("script[data-vitral-manifest]")?.textContent?.includes('"dedupe"')) import("./dedupe-S7BHQMOZ.js").catch(() => {
|
|
92
|
+
});
|
|
93
|
+
}
|
|
89
94
|
function load(name, isolate, priority) {
|
|
90
95
|
const file = (n) => loadFile(n, isolate, priority);
|
|
91
|
-
return (protocol().entry(name) || !name.includes("/") ? file(name).then((r) => mountable(name, r)) : import("./expose-
|
|
96
|
+
return (protocol().entry(name) || !name.includes("/") ? file(name).then((r) => mountable(name, r)) : import("./expose-EQOWTJNC.js").then((m) => m.resolveTarget(name, file))).catch(fail);
|
|
92
97
|
}
|
|
93
98
|
function loadFile(name, isolate, priority) {
|
|
94
99
|
const p = protocol();
|
|
@@ -196,6 +201,7 @@ export {
|
|
|
196
201
|
loadRemote,
|
|
197
202
|
loadModule,
|
|
198
203
|
preload,
|
|
204
|
+
warmSsr,
|
|
199
205
|
load,
|
|
200
206
|
loadFile,
|
|
201
207
|
resolveEntry,
|
package/dist/edge.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { R as Routes } from './match-CMBM_jLW.js';
|
|
1
2
|
import { P as Props } from './types-DUtcF3HO.js';
|
|
2
3
|
import './errors-kjBv6IH_.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Rewriter de HTML em streaming, para runtimes sem `HTMLRewriter` (Node, Deno,
|
|
6
|
-
* Bun). Faz só o que o gateway precisa: acha as tags de abertura de
|
|
7
|
-
*
|
|
7
|
+
* Bun). Faz só o que o gateway precisa: acha as tags de abertura de alguns
|
|
8
|
+
* elementos (`<vitral-remote>`, `<vitral-outlet>`) e dos filhos diretos deles, deixa ler e trocar
|
|
8
9
|
* atributos e inserir HTML logo depois da tag. O resto passa como veio.
|
|
9
10
|
*
|
|
10
11
|
* Ignora comentários e o conteúdo de `<script>`, `<style>`, `<textarea>` e
|
|
@@ -76,6 +77,11 @@ interface GatewayOptions {
|
|
|
76
77
|
isolate?: EdgeIsolation;
|
|
77
78
|
/** Remotes que esta URL usa, para os hints da primeira visita. */
|
|
78
79
|
preload?: (url: URL) => string[];
|
|
80
|
+
/**
|
|
81
|
+
* Rotas do `<vitral-outlet>` (o mesmo mapa de `routes()` no cliente). O
|
|
82
|
+
* remote da rota entra nos hints e, com `render`, sai renderizado no outlet.
|
|
83
|
+
*/
|
|
84
|
+
routes?: Routes;
|
|
79
85
|
/** `fetch` usado para falar com o host e os CDNs. Padrão: o global. */
|
|
80
86
|
fetch?: (request: Request) => Promise<Response>;
|
|
81
87
|
/** Por quanto tempo o gateway guarda manifestos e CSS, em ms. Padrão 60000. */
|
package/dist/edge.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
matchRoute
|
|
3
|
+
} from "./chunk-OVVGVPIV.js";
|
|
4
|
+
|
|
1
5
|
// src/edge/rewriter.ts
|
|
2
6
|
var RAW = /* @__PURE__ */ new Set(["script", "style", "textarea", "title"]);
|
|
3
7
|
var VOID = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "source", "track", "wbr"]);
|
|
@@ -42,7 +46,9 @@ var Tag = class {
|
|
|
42
46
|
return tag + this.#after;
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
|
-
function rewrite(body,
|
|
49
|
+
function rewrite(body, tags, handlers) {
|
|
50
|
+
const wanted = new Set([tags].flat());
|
|
51
|
+
let tag = "";
|
|
46
52
|
const decoder = new TextDecoder();
|
|
47
53
|
const encoder = new TextEncoder();
|
|
48
54
|
let buf = "";
|
|
@@ -109,7 +115,8 @@ function rewrite(body, tag, handlers) {
|
|
|
109
115
|
}
|
|
110
116
|
if (RAW.has(name)) raw = name;
|
|
111
117
|
const selfClosing = source.endsWith("/>") || VOID.has(name);
|
|
112
|
-
if (
|
|
118
|
+
if (depth < 0 && wanted.has(name)) {
|
|
119
|
+
tag = name;
|
|
113
120
|
const el = new Tag(name, source);
|
|
114
121
|
const r = handlers.element(el);
|
|
115
122
|
if (r) flush(), await r;
|
|
@@ -203,7 +210,8 @@ function gateway(options) {
|
|
|
203
210
|
const url = new URL(request.url);
|
|
204
211
|
if (url.pathname.startsWith(prefix)) return [];
|
|
205
212
|
const names = new Map(seen.get(url.pathname));
|
|
206
|
-
|
|
213
|
+
const route = options.routes && matchRoute(url.pathname, options.routes);
|
|
214
|
+
for (const name of [...route ? [route.name] : [], ...options.preload?.(url) ?? []]) if (!names.has(name)) names.set(name, remotes.get(name)?.isolate ?? options.isolate ?? "none");
|
|
207
215
|
const links = await Promise.all([...names].map(([name, isolate]) => linksFor(name, isolate)));
|
|
208
216
|
return links.flat();
|
|
209
217
|
}
|
|
@@ -212,7 +220,8 @@ function gateway(options) {
|
|
|
212
220
|
const m = r && await manifest(r).catch(() => null);
|
|
213
221
|
if (!r || !m) return [];
|
|
214
222
|
const { abs } = paths(r, m);
|
|
215
|
-
const
|
|
223
|
+
const own = (m.dedupe ?? []).flatMap((d) => [...d.chunks ?? [], d.file]);
|
|
224
|
+
const js = m.split ? [.../* @__PURE__ */ new Set([m.split.entry, ...m.split.chunks ?? [], ...own])] : [m.entry];
|
|
216
225
|
const hashed = !!m.integrity || Object.keys(m.files ?? {}).length > 0;
|
|
217
226
|
const out = js.map((u) => `<${local(r, abs(u))}>; ${hashed ? "rel=preload; as=fetch; crossorigin=anonymous" : "rel=modulepreload"}`);
|
|
218
227
|
for (const u of m.css ?? []) out.push(`<${local(r, abs(u))}>; rel=preload; as=${isolate === "shadow" ? "fetch" : "style"}; crossorigin=anonymous`);
|
|
@@ -245,9 +254,13 @@ function gateway(options) {
|
|
|
245
254
|
let ssr = false;
|
|
246
255
|
const element = async (el) => {
|
|
247
256
|
ssr = false;
|
|
248
|
-
const
|
|
257
|
+
const outlet = el.tagName === "vitral-outlet";
|
|
258
|
+
const src = outlet ? null : el.getAttribute("src");
|
|
249
259
|
let r;
|
|
250
|
-
if (
|
|
260
|
+
if (outlet) {
|
|
261
|
+
const route = options.routes && matchRoute(url.pathname, options.routes);
|
|
262
|
+
r = route ? remotes.get(route.name) : void 0;
|
|
263
|
+
} else if (src) {
|
|
251
264
|
const abs = new URL(decodeEntities(src), url).href;
|
|
252
265
|
for (const x of remotes.values()) if (x.url === abs || abs === new URL(local(x, x.url), url).href) r = x;
|
|
253
266
|
if (r && abs === r.url) el.setAttribute("src", local(r, r.url));
|
|
@@ -283,9 +296,11 @@ function gateway(options) {
|
|
|
283
296
|
const name = escapeAttr(label);
|
|
284
297
|
const scope = m.scope ? ` data-vitral-scope="${escapeAttr(m.scope)}"` : "";
|
|
285
298
|
const root = `<div data-vitral-root="${name}"${scope} style="display:contents">${html}</div>`;
|
|
299
|
+
const json = JSON.stringify(relocate(m, (u) => /^https?:\/\//.test(u) ? local(r, u) : u)).replace(/</g, "\\u003c");
|
|
300
|
+
const seed = `<script type="application/json" data-vitral-manifest="${escapeAttr(local(r, r.url))}">${json}</script>`;
|
|
286
301
|
const css = (m.css ?? []).map(abs);
|
|
287
302
|
const link = (u) => `<link rel="stylesheet" href="${escapeAttr(local(r, u))}" crossorigin="anonymous"${sri[u] ? ` integrity="${escapeAttr(sri[u])}"` : ""}>`;
|
|
288
|
-
if (isolate === "none") return `<div data-vitral-ssr data-vitral-slot="${name}">${css.map(link).join("")}${root}</div>`;
|
|
303
|
+
if (isolate === "none") return `<div data-vitral-ssr data-vitral-slot="${name}">${seed}${css.map(link).join("")}${root}</div>`;
|
|
289
304
|
const s = m.shadow;
|
|
290
305
|
const files = s && css[0] ? s.css.map((u) => new URL(u, css[0]).href) : css;
|
|
291
306
|
const global = s && css[0] ? (s.global ?? []).map((u) => new URL(u, css[0]).href) : [];
|
|
@@ -296,7 +311,7 @@ function gateway(options) {
|
|
|
296
311
|
})
|
|
297
312
|
);
|
|
298
313
|
const style = texts.length ? `<style data-vitral-ssr>${texts.join("\n").replace(/<\/style/gi, "<\\/style")}</style>` : "";
|
|
299
|
-
return `<div data-vitral-ssr data-vitral-slot="${name}">${global.map(link).join("")}<template shadowrootmode="open">${style}${root}</template></div>`;
|
|
314
|
+
return `<div data-vitral-ssr data-vitral-slot="${name}">${seed}${global.map(link).join("")}<template shadowrootmode="open">${style}${root}</template></div>`;
|
|
300
315
|
}
|
|
301
316
|
const handler = (async (request) => {
|
|
302
317
|
const url = new URL(request.url);
|
|
@@ -346,8 +361,8 @@ function clean(from) {
|
|
|
346
361
|
var pass = (res) => new Response(res.body, { status: res.status, statusText: res.statusText, headers: clean(res.headers) });
|
|
347
362
|
function transform(body, element, child) {
|
|
348
363
|
if (typeof HTMLRewriter !== "undefined")
|
|
349
|
-
return new HTMLRewriter().on("vitral-remote", { element }).on('vitral-remote > [slot="fallback"]', { element: child }).transform(new Response(body, { headers: { "content-type": "text/html" } })).body;
|
|
350
|
-
return rewrite(body, "vitral-remote", { element, child });
|
|
364
|
+
return new HTMLRewriter().on("vitral-remote", { element }).on("vitral-outlet", { element }).on('vitral-remote > [slot="fallback"]', { element: child }).on('vitral-outlet > [slot="fallback"]', { element: child }).transform(new Response(body, { headers: { "content-type": "text/html" } })).body;
|
|
365
|
+
return rewrite(body, ["vitral-remote", "vitral-outlet"], { element, child });
|
|
351
366
|
}
|
|
352
367
|
async function matches(bytes, integrity) {
|
|
353
368
|
for (const token of integrity.trim().split(/\s+/)) {
|
package/dist/element.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
VitralRemoteElement,
|
|
4
4
|
defineVitralElement,
|
|
5
5
|
elementRemote
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-PLM7U7LR.js";
|
|
7
|
+
import "./chunk-UXLKRSOM.js";
|
|
8
|
+
import "./chunk-HIVMSPGM.js";
|
|
9
|
+
import "./chunk-S7PIVPBX.js";
|
|
10
10
|
import "./chunk-KU6HF2EW.js";
|
|
11
11
|
import "./chunk-TW7KYJQ6.js";
|
|
12
12
|
import "./chunk-463H6B56.js";
|
package/dist/embed.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(()=>{var uo=Object.defineProperty;var h=(t,e)=>()=>(t&&(e=t(t=0)),e);var L=(t,e)=>{for(var o in e)uo(t,o,{get:e[o],enumerable:!0})};var O,W=h(()=>{"use strict";O={}});function Dt(){let t=new Map,e=new Map;return{emit(o,r){e.set(o,r);for(let n of[...t.get(o)??[]])try{n(r)}catch(s){console.error(`[vitral] handler de "${o}" falhou`,s)}},on(o,r){let n=t.get(o);return n||t.set(o,n=new Set),n.add(r),()=>n.delete(r)},last(o){return e.get(o)}}}var Ht=h(()=>{"use strict"});function po(){let t={timeout:15e3,retries:1,isolate:"none",allowedOrigins:null},e=new Map,o=new Map,r=Promise.resolve();return{protocol:Nt,events:Dt(),settings:()=>t,configure(n){Object.assign(t,n)},register(n,s){e.set(n,s),o.delete(n)},entry:n=>e.get(n),origins:()=>[...e.values()].filter(n=>n.url).map(n=>new URL(n.url).origin),pending(n){return n&&(r=Promise.all([r,n])),r.then(()=>{})},load(n,s){let a=o.get(n);if(!a){a=s();let i=a;i.catch(()=>o.get(n)===i&&o.delete(n)),o.set(n,a)}return a}}}function d(){let t=Ut[_t];return t&&typeof t.protocol=="number"&&t.protocol>=Nt?t:Ut[_t]=po()}var Nt,_t,Ut,R=h(()=>{"use strict";Ht();Nt=1,_t=Symbol.for("vitral"),Ut=globalThis});function M(t,e){if(
|
|
2
|
-
`),document.head.appendChild(c)}a.replaceSync(u);let p=[...e,t];return Promise.all(l.filter(c=>!p.includes(c)).map(c=>re(c,p))).then(c=>[...c.flat(),a])}).catch(()=>(dt.delete(t),[])),dt.set(t,n)),n}function ee(t){let e=document.documentElement,o=[],r=()=>{t.classList.remove(...o),o=[...e.classList].filter(a=>!t.classList.contains(a)),t.classList.add(...o);let s=e.getAttribute("data-theme");s===null?t.removeAttribute("data-theme"):t.setAttribute("data-theme",s)};r();let n=new MutationObserver(r);return n.observe(e,{attributeFilter:["class","data-theme"]}),()=>n.disconnect()}var dt,yo,Zt,vo,Eo,pt,mt,Qt,te,ht=h(()=>{"use strict";et();dt=new Map,yo=()=>{},Zt=new Set,vo=/url\(\s*(['"]?)(?![a-z]+:|\/\/|#)([^'")]+)\1\s*\)/gi,Eo=/@property\s+(--[\w-]+)\s*\{[^}]*\}|@font-face\s*\{[^}]*\}|@import\s+(?:url\(\s*)?(?:(['"])(.*?)\2|([^'"\s);]+))\s*\)?[^;]*;/gi;pt=new Map,mt=!1,Qt=t=>Object.getPrototypeOf(t)===customElements,te=new Map});function yt(t,e,o){let r=`${t} ${e??""}`,n=vt.get(r);return n||(n=q(t,d().settings().timeout,t,{integrity:e,priority:o}).then(s=>new TextDecoder().decode(s)),n.catch(()=>vt.delete(r)),vt.set(r,n)),n}function ie(t,e,o="auto"){if(e&&Po())Promise.resolve().then(()=>(ht(),gt)).then(r=>r.prefetch(t,o),se);else for(let r of t.css)document.querySelector(`link[href="${r}"]`)||C("preload",r,{as:"style",integrity:t.sri?.[r]??"",fetchPriority:o})}function ae(t,e,o,r){return e?Promise.resolve().then(()=>(ht(),gt)).then(n=>n.attachShadowRoot(e,o,t,d().settings().styles,r)):F(t.css,null,t.sri).then(()=>[se])}function F(t,e,o={}){let r=e??document,n=ne.get(r);n||ne.set(r,n=new Map);let s=e??document.head,a=d().settings().timeout;return Promise.all(t.map(i=>{let l=n.get(i);return l||(l=new Promise(u=>{let p=C("stylesheet",i,{integrity:o[i]??""},s);setTimeout(u,a),p.onload=()=>u(),p.onerror=()=>{p.remove(),n.delete(i),u()}}),n.set(i,l)),l}))}var ne,vt,se,Po,et=h(()=>{"use strict";R();k();ne=new WeakMap,vt=new Map,se=()=>{},Po=()=>typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype});var ue={};L(ue,{resolveModule:()=>Lo,resolveTarget:()=>xo,splitName:()=>le});function le(t){let e=d(),o=t.length;if(!e.entry(t))for(;(o=t.lastIndexOf("/",o-1))>0&&!e.entry(t.slice(0,o)););return o>0&&o<t.length?[t.slice(0,o),"."+t.slice(o)]:[t,null]}function xo(t,e){return ce(t,e).then(o=>Et(t,o))}function ce(t,e){let o=d();return o.entry(t)||!t.includes("/")?e(t):o.pending().then(async()=>{let[r,n]=le(t);if(!n)return e(t);let s=await e(r),a=s.exports?.exposes;if(!a?.[n])throw new f("NOT_EXPOSED",t,`${r} n\xE3o exp\xF5e ${n}. Expostos: ${Object.keys(a??{}).join(", ")}`);try{let i=a[n],l=await(typeof i=="function"?i():i);return{...s,module:l?.default??l,exports:l}}catch(i){throw new f("LOAD_FAILED",t,String(i),i)}})}async function Lo(t,e){let o=await ce(t,e);if(!o.exports)throw new f("INVALID_MODULE",t,"o remote foi carregado por uma c\xF3pia antiga da lib, que n\xE3o guarda os exports");return o.exports}var de=h(()=>{"use strict";w();ot();R()});async function me(t,e,o){let r=o.split(/\s+/).map(i=>/^sha(256|384|512)-([\w+/=-]+)/.exec(i)).filter(i=>!!i);if(!r.length)throw new f("INTEGRITY",t,`formato de integrity inv\xE1lido: ${o}`);let n=Math.max(...r.map(i=>+i[1])),s=btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest("SHA-"+n,e)))),a=r.filter(i=>+i[1]===n).map(i=>i[2]);if(!a.some(i=>pe(i)===pe(s)))throw new f("INTEGRITY",t,`o hash n\xE3o confere: esperado sha${n}-${a.join(" ou ")}, obtido sha${n}-${s}`)}var pe,fe=h(()=>{"use strict";w();pe=t=>t.replace(/-/g,"+").replace(/_/g,"/").replace(/=/g,"")});var Pe={};L(Pe,{importVerified:()=>Oo,verified:()=>be});async function Oo(t,e,o,r){let{entry:n,integrity:s,priority:a}=e;if(!Rt.has(n))try{let p=await V(r,t,(async()=>{let c=await be(e.split??{entry:n,chunks:[],sri:{[n]:s},priority:a},o);return c&&{ns:await o(c)}})());if(p)return p.ns}catch(u){if(Rt.add(n),u instanceof f&&u.code==="TIMEOUT")throw u}let i=await q(n,r,t,Rt.has(n)?{priority:a,cache:"reload"}:{priority:a});await me(t,i,s);let l=URL.createObjectURL(new Blob([i],{type:"text/javascript"}));try{return await o(l)}finally{URL.revokeObjectURL(l)}}async function To(t){if(wt)return await wt&&Re(t,!1);let e=!1;try{e=localStorage[ve]===navigator.userAgent}catch{}let o=await(wt=Re(t,!e));if(o&&!e)try{localStorage[ve]=navigator.userAgent}catch{}return o}async function be(t,e){let{entry:o,chunks:r,sri:n,priority:s="auto",dedupe:a=[]}=t,i=a.flatMap(p=>[...p.chunks??[],p.file]);if(![o,...r,...i].every(p=>Mo.test(n[p]??"")))return;let l=globalThis[Symbol.for("vitral")],u=async p=>{if(!e||!a.length)return;let{shared:c}=await Promise.resolve().then(()=>(Q(),Z));for(let g of a)c(l)(g.name,g.range,{version:g.version,url:g.file,load:async()=>(p&&await Promise.all([...g.chunks??[],g.file].map(m=>bt(m,n[m],s))),(await e(g.file)).default)})};if(he!==!1&&(he=await To(n))){await u();for(let p of r)fetch(p,{priority:s}).catch(()=>{});return o}if(await(ko??=Co()))return l.sri={...l.sri,...n},await u(!0),await Promise.all([...r,o].map(p=>bt(p,n[p],s))),o}async function Re(t,e){if(!HTMLScriptElement.supports?.("importmap"))return!1;let o={};for(let s in t)!/\.css([?#]|$)/.test(s)&&!ye.has(s)&&(ye.add(s),o[s]=t[s]);let r=e?["export{}","export{}//"].map(s=>URL.createObjectURL(new Blob([s],{type:"text/javascript"}))):[];for(let s of r)o[s]=we;let n=!0;try{let s=document.createElement("script");s.type="importmap",s.nonce=document.querySelector("script[nonce]")?.nonce??"",s.onerror=()=>n=!1,s.addEventListener("securitypolicyviolation",()=>n=!1),s.textContent=JSON.stringify({integrity:o}),document.head.append(s),await Ee(),await Ee(),n&&e&&(n=await Se(a=>import(a),r[0],r[1]))}catch{n=!1}for(let s of r)URL.revokeObjectURL(s);return n}function bt(t,e,o="auto"){return new Promise((r,n)=>{let s=C("modulepreload",t,{integrity:e,fetchPriority:o});s.onload=r,s.onerror=n})}function Co(){return document.createElement("link").relList.supports("modulepreload")?Se(t=>bt(t,we),ge,ge+"//"):Promise.resolve(!1)}function Se(t,e,o){return Promise.race([Promise.all([t(e).then(()=>!0,()=>!1),t(o).then(()=>!1,()=>!0)]).then(([r,n])=>r&&n),new Promise(r=>setTimeout(r,3e3,!1))])}var Rt,Mo,ge,we,he,ye,wt,ko,ve,Ee,xe=h(()=>{"use strict";fe();w();k();Rt=new Set;Mo=/^(sha(256|384|512)-[A-Za-z0-9+/]+={0,2}( +|$))+$/,ge="data:text/javascript,export{}",we="sha256-d3bjIZdvLjBurwdLwkSVOnEBPFFly+T1SR9r3VVHBGg=",ye=new Set,ve="vitral:sri-map";Ee=()=>new Promise(t=>{let e=new MessageChannel;e.port1.onmessage=()=>t(),e.port2.postMessage(0)})});var Ce={};L(Ce,{OVERRIDES_KEY:()=>rt,activeOverrides:()=>Te,clearOverrides:()=>Me,dropOverride:()=>$o,isRef:()=>St,manifestUrl:()=>nt,overrideFor:()=>Do,overridesEnabled:()=>Oe,resolveOverride:()=>ke,storeOverride:()=>Ao,storedOverrides:()=>xt});function Oe(){return!!d().settings().devOverrides||typeof location<"u"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname)}function Ao(t,e){let o=xt();e?o[t]=St(e)?e:nt(e):delete o[t],K(it,o)}function Io(){let t=Pt(st),e=new URLSearchParams(location.search).getAll("vitral").join(",").split(",");if(!e.some(Boolean))return t;for(let o of e){let r=o.indexOf("@");o==="off"?(Me(),Object.keys(t).forEach(n=>delete t[n])):r>0&&o.slice(r+1)==="off"?delete t[o.slice(0,r)]:r>0&&(t[o.slice(0,r)]=o.slice(r+1))}return K(st,t),t}function Me(){K(st,{}),K(it,{})}function $o(t){for(let e of[st,it]){let o=Pt(e);delete o[t],K(e,o)}}function ke(t,e){if(!St(e))return new URL(nt(e),location.href).href;let o=d().settings().devOverrides,r=typeof o=="object"?o.preview:void 0;if(!r)return;let n=r.replace(/\{name\}/g,encodeURIComponent(t)).replace(/\{ref\}/g,encodeURIComponent(e));return new URL(nt(n),location.href).href}function Te(){let t=Io(),e={};for(let[o,r]of[["navegador",xt()],["aba",t]])for(let[n,s]of Object.entries(r))e[n]={name:n,value:s,url:ke(n,s),source:o};return Object.values(e)}function Do(t){if(!Oe())return;let e=Te().find(a=>a.name===t);if(!e)return;let o=!Le.has(t)&&Le.add(t);if(!e.url){o&&console.warn(`[vitral] override ${t}@${e.value} ignorado: falta configure({ devOverrides: { preview } })`);return}let r=d(),n=r.settings().trusted??[],s=new URL(e.url).origin;return n.includes(s)||r.configure({trusted:[...n,s]}),o&&console.warn(`[vitral] override ativo: ${t} \u2192 ${e.url} (${e.source}). Para limpar: ?vitral=off`),{url:e.url}}var rt,nt,St,Pt,K,it,st,xt,Le,Ae=h(()=>{"use strict";R();rt="vitral:overrides";nt=t=>/\.(json|m?js)(\?|$)/.test(t)?t:t.replace(/\/?$/,"/vitral.json"),St=t=>/^[\w.-]+$/.test(t),Pt=t=>{try{return JSON.parse(t().getItem(rt)??"{}")??{}}catch{return{}}},K=(t,e)=>{try{Object.keys(e).length?t().setItem(rt,JSON.stringify(e)):t().removeItem(rt)}catch{}},it=()=>localStorage,st=()=>sessionStorage,xt=()=>Pt(it);Le=new Set});var Ue={};L(Ue,{bucket:()=>He,pick:()=>Ho,resetChannels:()=>jo,versionUrl:()=>De});async function Ho(t,e,o){if(typeof o.stable!="string")throw new f("INVALID_MODULE",t,`canal inv\xE1lido em ${e.url}: falta "stable"`);O.watch=Uo;let r={name:t,bucket:He(t)},{canary:n,stable:s}=o,a=await e.resolve?.(o,r)??(n&&r.bucket<n.percent?n.version:s);return a!==s&&_e()[t]===a&&(a=s),a===s||e.rollback===!1?U.delete(t):U.get(t)?.from!==a&&U.set(t,{from:a,to:s,errors:0,mounts:0,max:{errors:3,mounts:20,...e.rollback}}),{...e,url:De(a,e.url),integrity:void 0,manifest:void 0}}function He(t){let e=d().settings().canaryKey??_o(),o=2166136261;for(let r of`${e}:${t}`)o=Math.imul(o^r.charCodeAt(0),16777619);return(o>>>0)%100}function _o(){try{_??=localStorage.getItem(Ie)??void 0}catch{}if(!_){_=Math.random().toString(36).slice(2);try{localStorage.setItem(Ie,_)}catch{}}return _}function _e(){try{return{...JSON.parse(sessionStorage.getItem($e)||"{}"),...G}}catch{return G}}function Uo(t,e){for(let[o,r]of U)t!==o&&!t.startsWith(o+"/")||(e?++r.errors>=r.max.errors&&No(o,r):++r.mounts>r.max.mounts&&(r.mounts=1,r.errors=0))}function No(t,e){U.delete(t),G={..._e(),[t]:e.from};try{sessionStorage.setItem($e,JSON.stringify(G))}catch{}console.warn(`[vitral] ${t}: ${e.errors} erros em ${e.mounts} montagens da vers\xE3o ${e.from}; voltando para ${e.to}`);try{d().settings().onRollback?.({name:t,from:e.from,to:e.to,errors:e.errors,mounts:e.mounts})}catch{}let o=d();o.register(t,o.entry(t)),o.events.emit("vitral:refresh",t)}function jo(){U.clear(),G={},_=void 0}var $e,Ie,U,G,_,De,Ne=h(()=>{"use strict";w();W();R();k();$e="vitral:rollback",Ie="vitral:id",U=new Map,G={};De=(t,e)=>S(/[/:]|\.(m?js|json)$/.test(t)?t:`${t}/vitral.json`,e)});var je={};L(je,{checkContract:()=>Bo});async function Bo(t,e=d().settings().contract){let{satisfies:o}=await Promise.resolve().then(()=>(Q(),Z));if(t.version&&!o(t.version,e))return`o host aceita contrato ${e}, o remote publica ${t.version}`;let r=d().settings().offered??{};for(let n in t.peers){let s=r[n];if(s&&!o(s,t.peers[n]))return`o remote espera ${n} ${t.peers[n]}, o host oferece ${s}`}}var Be=h(()=>{"use strict";R()});function Ve(t){Ot(t).catch(()=>{})}function Ot(t,e,o){let r=n=>Vo(n,e,o);return(d().entry(t)||!t.includes("/")?r(t).then(n=>Et(t,n)):Promise.resolve().then(()=>(de(),ue)).then(n=>n.resolveTarget(t,r))).catch(z)}function Vo(t,e,o){let r=d();return r.load(t,async()=>{qe??=Promise.resolve().then(()=>(xe(),Pe)).catch(()=>null);let n;try{await r.pending();let s=await Fe(t),a=s?{isolate:r.entry(t)?.isolate,...s}:r.entry(t);if(!a)throw new f("NOT_REGISTERED",t,"remote n\xE3o registrado. Use configure({ remotes }).");if(a.module)return await qo(t,a);let i=performance.now();n=await Lt(t,a,o),D(t,"manifest",i),ie(n,(e??n.isolate??r.settings().isolate)==="shadow",o),i=performance.now();let l=await Bt(r.settings().retries,()=>Fo(t,n));return D(t,"js",i),{...n,module:l?.default??l,exports:l}}catch(s){throw M(b(s)?s:new f("LOAD_FAILED",t,String(s?.message??s),s),n)}})}function Fe(t){try{let e="vitral:overrides";if(location.search.includes("vitral")||localStorage[e]||sessionStorage[e])return Promise.resolve().then(()=>(Ae(),Ce)).then(o=>o.overrideFor(t))}catch{}}async function qo(t,e){let o=e.module;return typeof o=="function"&&(o=await o()),{module:o?.default??o,exports:o,entry:typeof location<"u"?location.href:"http://localhost/",css:e.css??[],isolate:e.isolate}}async function Lt(t,e,o){tt(t,e.url);let r=e.manifest??(new URL(e.url).pathname.endsWith(".json")?await X(e.url,d().settings().timeout,t,{cache:"no-cache",priority:o}):{name:t,entry:e.url});if(r?.stable)return Lt(t,await(await Promise.resolve().then(()=>(Ne(),Ue))).pick(t,e,r),o);if(typeof r?.entry!="string")throw new f("INVALID_MODULE",t,`manifesto inv\xE1lido em ${e.url}`);if(r.contract&&(e.contract||d().settings().contract)){let i=await(await Promise.resolve().then(()=>(Be(),je))).checkContract(r.contract,e.contract);if(i)throw new f("CONTRACT_MISMATCH",t,i)}let n=i=>S(i,e.url),s={};for(let i in r.files??{})s[n(i)]=r.files[i];let a={entry:n(r.entry),css:[...r.css??[],...e.css??[]].map(n),shadow:r.shadow,integrity:e.integrity??r.integrity,isolate:e.isolate,scope:r.scope,version:r.version,sri:s,priority:o,split:r.split&&!e.integrity?{entry:n(r.split.entry),chunks:(r.split.chunks??[]).map(n),sri:s,priority:o,dedupe:r.dedupe?.map(i=>({...i,file:n(i.file),chunks:i.chunks?.map(n)}))}:void 0};tt(t,a.entry);for(let i of[a.split?.entry,...(a.split?.dedupe??[]).map(l=>l.file)])i&&tt(t,i);if(t===e.url&&r.name){let i=await Fe(r.name);if(i)return{...await Lt(t,i),name:r.name};a.name=r.name,d().entry(r.name)||d().register(r.name,e)}return a}async function Fo(t,e){let{timeout:o}=d().settings(),r=s=>V(o,t,import(s)).catch(a=>{throw b(a)?a:new f("LOAD_FAILED",t,`falha ao importar ${e.entry}`,a)});if(!e.integrity)return r(e.entry);let n=await qe;if(!n)throw new f("LOAD_FAILED",t,"n\xE3o foi poss\xEDvel carregar o verificador de integrity");return n.importVerified(t,e,r,o)}function Et(t,e){if(typeof e.module?.mount!="function")throw new f("INVALID_MODULE",t,"o m\xF3dulo n\xE3o exporta mount(). Use defineRemote(), ou loadModule() para m\xF3dulo sem UI.");return e}var qe,ot=h(()=>{"use strict";et();w();H();R();k()});var Mt={};L(Mt,{load:()=>Ze,noFrames:()=>Ko});function Ze(t){throw new f("MOUNT_FAILED",t,"isolate sem suporte no embed.js")}var Ko,kt=h(()=>{"use strict";w();Ko=(t,e)=>Ze(e)});H();et();w();R();var I={emit:(t,e)=>d().events.emit(t,e),on:(t,e)=>d().events.on(t,e),last:t=>d().events.last(t)};function Ke(){let t=new Set,e=o=>{let r=()=>(t.delete(r),o());return t.add(r),r};return{bus:{emit:(o,r)=>I.emit(o,r),last:o=>I.last(o),on:(o,r)=>e(I.on(o,r))},track:e,dispose(){for(let o of[...t])o()}}}W();ot();function Ge(t,e={}){let o=new URL(t,location.href);if(o.origin!==location.origin){location.assign(o.href);return}e.replace?history.replaceState(history.state,"",o.href):history.pushState(history.state,"",o.href),dispatchEvent(new PopStateEvent("popstate",{state:history.state})),I.emit("vitral:navigate",o.pathname+o.search+o.hash)}R();w();var Je=new Map,J=new Map;function ze(t,e){return Je.set(t,e.entry),$.set(t,e),J.set(t,(J.get(t)??0)+1),()=>{let o=J.get(t)-1;o?J.set(t,o):(J.delete(t),Je.delete(t),$.delete(t))}}var Ye=null;function Xe(t,e,o,r){let n=0,s=I.on("vitral:refresh",a=>{if(a!==e&&!e.startsWith(a+"/"))return;let i=++n,l=o,u=r(l).then(p=>{if(t.unmount===We||i!==n)return p.unmount();let c=t;t=p,c.unmount(),o!==l&&p.update?.(o)});Ye?Ye.push(u):u.catch(console.error)});return{update(a){o=a,t.update?.(a)},unmount(){s(),t.unmount(),t={unmount:We}}}}var We=()=>{};k();async function to(t,e,o,r={}){return Xe(await Qe(t,e,o,r),e,o,n=>Qe(t,e,n,r))}var Go;async function Qe(t,e,o,r){let n=d();await n.pending();let s=r.isolate??Jo(e)?.isolate??n.settings().isolate;if(s==="iframe")return(Go??(await Promise.resolve().then(()=>(kt(),Mt))).noFrames)(t,e,o,r).catch(z);let{module:a,...i}=await(s=="reframe"?(await Promise.resolve().then(()=>(kt(),Mt))).load:Ot)(e,s,r.priority),l=ze(e,i);O.watch?.(e);let u=i.name??e,p=E=>{let P=document.createElement("div",E);return P.setAttribute("data-vitral-root",u),i.scope&&P.setAttribute("data-vitral-scope",i.scope),P.style.display="contents",P},c=performance.now(),[g,m=document.body,y=null,x=customElements,v=t.appendChild(p())]=await ae(i,s>"q"&&t,p,r.styles);D(e,"css",c),c=performance.now();let Y=Ke(),It=E=>P=>(v.addEventListener(E,P),()=>v.removeEventListener(E,P)),$t={name:u,baseUrl:new URL(".",i.entry).href,events:Y.bus,shadowRoot:y,portalContainer:m,customElements:x,reportError(E){let P=M(b(E)?E:new f("RENDER_FAILED",u,String(E?.message??E),E),i);r.onError?r.onError(P):console.error(P)},navigate:Ge,protocol:n.protocol,onActivate:It("vitral:activate"),onDeactivate:It("vitral:deactivate")};O.shared&&($t.shared=O.shared(e,Y.track));let at;try{at=await a.mount(v,o,$t),D(e,"mount",c)}catch(E){throw l(),Y.dispose(),g(),v.remove(),M(new f("MOUNT_FAILED",u,"erro ao montar",E),i)}let lt=!0;return{update(E){lt&&at.update?.(E)},unmount(){if(lt){lt=!1;try{at.unmount()}finally{l(),Y.dispose(),g(),v.remove()}}}}}function Jo(t){let e=d(),o=t;for(;o&&!e.entry(o);)o=o.slice(0,Math.max(0,o.lastIndexOf("/")));return o?e.entry(o):void 0}w();H();function eo(t,e){let{isolate:o}=e,r=m=>m.src?A(m.src,m.name):m.name??"",n=r(e),s=e.props??{},a=null,i=null,l=0,u="loading",p=(m,y=null)=>{u=m,i&&(i.style.display=m==="error"?"none":""),e.onStatus?.(m,y)},c=()=>{a?.unmount(),a=null,i?.remove(),i=null},g=()=>{let m=++l;c(),i=document.createElement("div"),i.setAttribute("data-vitral-slot",n),t.appendChild(i),p("loading");let y=v=>{m===l&&p("error",b(v)?v:new f("MOUNT_FAILED",n,String(v),v))},x=s;to(i,n,s,{isolate:o,priority:e.priority,styles:e.styles,onError:y}).then(v=>{if(m!==l)return v.unmount();a=v,s!==x&&v.update?.(s),p("ready")},y)};return g(),{update(m){s=m,a?.update?.(m)},set(m){let y=m.src||m.name!==void 0?r(m):n,x=y!==n||"isolate"in m&&m.isolate!==o;n=y,"isolate"in m&&(o=m.isolate),x&&g()},retry:g,destroy(){l++,c()},get status(){return u}}}ot();H();var Tt=()=>{};function ro(t){let e={};if(typeof performance>"u"||!performance.getEntriesByName)return e;for(let o of["manifest","js","css","mount"]){let r=performance.getEntriesByName(`vitral:${t}:${o}`,"measure").pop();r&&(e[o]=Math.round(r.duration*10)/10)}return e}function oo(t,e,o){if(e==="lazy"||e==="visible"){if(typeof IntersectionObserver>"u")return o(),Tt;let r=new IntersectionObserver(n=>{n.some(s=>s.isIntersecting)&&(r.disconnect(),o())},{rootMargin:"200px"});return r.observe(t),()=>r.disconnect()}if(e==="idle"){if(typeof requestIdleCallback>"u"){let n=setTimeout(o,1);return()=>clearTimeout(n)}let r=requestIdleCallback(o,{timeout:2e3});return()=>cancelIdleCallback(r)}if(e==="hover"){let r=()=>(n(),o()),n=()=>{t.removeEventListener("pointerenter",r),t.removeEventListener("focusin",r)};return t.addEventListener("pointerenter",r),t.addEventListener("focusin",r),n}return o(),Tt}var T=new Map,N=null;function no(t,e){try{t.moveBefore(e,null)}catch{t.appendChild(e)}}function Ct(t,e){for(let o of t.querySelectorAll("*"))o.hasAttribute("data-vitral-root")&&o.dispatchEvent(new Event(e)),o.shadowRoot&&Ct(o.shadowRoot,e)}function Yo(t,e,o){T.get(t)?.slot.destroy(),T.delete(t),N?.isConnected||(N=document.createElement("div"),N.hidden=!0,N.setAttribute("data-vitral-keep-alive",""),document.body.appendChild(N)),no(N,e.box),Ct(e.box,"vitral:deactivate"),T.set(t,e);for(let[r,n]of T){if(T.size<=o)break;T.delete(r),n.slot.destroy(),n.box.remove()}}function so(t,e){let{props:o={},keepAlive:r}=e,n=c=>c.src?A(c.src,c.name):c.name??"",s=n(e),a="loading",i=null,l=(c,g)=>{a=c,e.onStatus?.(c,g)},u=e.prefetch?oo(t,e.prefetch,()=>Ve(s)):Tt,p=oo(t,e.loading,()=>{u();let c=r?T.get(s):void 0;if(c){T.delete(s),i=c,i.on=l,no(t,i.box),i.slot.update(o),Ct(i.box,"vitral:activate"),l(i.slot.status,null);return}let g=t;r&&(g=t.appendChild(document.createElement("div")),g.style.display="contents");let m={box:g,on:l,slot:null};m.slot=eo(g,{...e,name:s,src:void 0,props:o,onStatus:(y,x)=>m.on(y,x)}),i=m});return{update(c){o=c,i?.slot.update(c)},set(c){(c.src||c.name!==void 0)&&(s=n(c)),i?.slot.set({...c,src:void 0,name:s})},retry:()=>i?.slot.retry(),destroy(){p(),u(),i&&(r&&a==="ready"?Yo(s,i,r===!0?5:r):(i.slot.destroy(),i.box!==t&&i.box.remove()),i=null)},get status(){return a}}}H();var Wo=typeof HTMLElement>"u"?class{}:HTMLElement,At=class extends Wo{static{this.observedAttributes=["name","src","props","isolate"]}#t=null;#e={};get props(){return this.#e}set props(e){this.#e=e??{},this.#t?.update(this.#e)}get status(){return this.#t?.status??"loading"}retry(){this.#t?.retry()}connectedCallback(){if(this.#t)return;let e=this.#r();if(!e)return;this.hasAttribute("props")&&!Object.keys(this.#e).length&&(this.#e=io(this.getAttribute("props")));let o=this.getAttribute("keep-alive"),r={name:e,props:this.#e,isolate:this.getAttribute("isolate")||void 0,loading:this.getAttribute("loading"),prefetch:this.getAttribute("prefetch"),priority:this.getAttribute("priority")||void 0,keepAlive:o===null?!1:Number(o)||!0,styles:{inherit:this.getAttribute("inherit-styles")?.split(/\s+/).filter(Boolean)},onStatus:(s,a)=>{this.setAttribute("data-vitral-status",s),s==="loading"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");let i=l=>{let u=this.querySelectorAll(`:scope > [slot="${l}"]`);for(let p of u)p.hidden=s!==(l==="fallback"?"loading":"error");return u.length>0};queueMicrotask(()=>{if(this.#t?.status!==s)return;let l={loading:i("fallback"),error:i("error"),ready:!0};this.#n(l[s]?null:s)}),s==="ready"&&this.dispatchEvent(new CustomEvent("vitral-ready",{bubbles:!0,detail:{timings:ro(e)}})),s==="error"&&this.dispatchEvent(new CustomEvent("vitral-error",{bubbles:!0,detail:{error:a}}))}},n=null;this.#t=so(this,r)}#r(){let e=this.getAttribute("src"),o=this.getAttribute("name");return e?A(e,o??void 0,!1):o}#o=null;#n(e){if(this.#o?.remove(),this.#o=null,!e)return;let o=document.createElement("div");if(o.setAttribute("data-vitral-default",e),e==="loading")o.setAttribute("role","status"),o.textContent="Carregando\u2026";else{o.setAttribute("role","alert");let r=document.createElement("button");r.type="button",r.textContent="Tentar de novo",r.onclick=()=>this.retry(),o.append("N\xE3o foi poss\xEDvel carregar. ",r)}this.prepend(this.#o=o)}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||(this.#t?.destroy(),this.#t=null,this.#n(null))})}attributeChangedCallback(e,o,r){if(e==="props")return void(this.props=io(r));if(!this.#t)return void(this.isConnected&&this.connectedCallback());if(e==="name"||e==="src"){let n=this.#r();n&&this.#t.set({name:n})}e==="isolate"&&this.#t.set({isolate:r||void 0})}};function io(t){if(!t)return{};try{return JSON.parse(t)}catch{return console.error("[vitral] atributo props n\xE3o \xE9 JSON v\xE1lido:",t),{}}}function ao(t="vitral-remote"){typeof customElements<"u"&&!customElements.get(t)&&customElements.define(t,class extends At{})}R();k();var lo="data-vitral-embed";function co(t){let e=t.dataset;if(!e.remote||t.hasAttribute(lo))return null;let o=e.target?document.querySelector(e.target):t.closest("body")?t:document.body;if(!o)return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>co(t),{once:!0}):console.error(`[vitral] data-target n\xE3o encontrado: ${e.target}`),null;t.setAttribute(lo,"");let r=S(e.remote);zo([new URL(r).origin,...e.origins?.split(/\s+/).filter(Boolean)??[]]),ao();let n=document.createElement("vitral-remote");return n.setAttribute("isolate",e.isolate||"shadow"),e.loading&&n.setAttribute("loading",e.loading),e.props&&n.setAttribute("props",e.props),e.name&&n.setAttribute("name",e.name),n.setAttribute("src",r),o===t?t.after(n):o.appendChild(n),n}function zo(t){let e=d(),o=e.settings().allowedOrigins??[B(),...e.origins()].filter(Boolean);ut({allowedOrigins:[...new Set([...o,...t])]})}var Xo=Symbol.for("vitral:embed"),Zo=globalThis[Xo]??=co;typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&Zo(document.currentScript);})();
|
|
1
|
+
"use strict";(()=>{var uo=Object.defineProperty;var h=(t,e)=>()=>(t&&(e=t(t=0)),e);var L=(t,e)=>{for(var o in e)uo(t,o,{get:e[o],enumerable:!0})};var O,W=h(()=>{"use strict";O={}});function Dt(){let t=new Map,e=new Map;return{emit(o,r){e.set(o,r);for(let n of[...t.get(o)??[]])try{n(r)}catch(s){console.error(`[vitral] handler de "${o}" falhou`,s)}},on(o,r){let n=t.get(o);return n||t.set(o,n=new Set),n.add(r),()=>n.delete(r)},last(o){return e.get(o)}}}var Ht=h(()=>{"use strict"});function po(){let t={timeout:15e3,retries:1,isolate:"none",allowedOrigins:null},e=new Map,o=new Map,r=Promise.resolve();return{protocol:Nt,events:Dt(),settings:()=>t,configure(n){Object.assign(t,n)},register(n,s){e.set(n,s),o.delete(n)},entry:n=>e.get(n),origins:()=>[...e.values()].filter(n=>n.url).map(n=>new URL(n.url).origin),pending(n){return n&&(r=Promise.all([r,n])),r.then(()=>{})},load(n,s){let a=o.get(n);if(!a){a=s();let i=a;i.catch(()=>o.get(n)===i&&o.delete(n)),o.set(n,a)}return a}}}function d(){let t=Ut[_t];return t&&typeof t.protocol=="number"&&t.protocol>=Nt?t:Ut[_t]=po()}var Nt,_t,Ut,R=h(()=>{"use strict";Ht();Nt=1,_t=Symbol.for("vitral"),Ut=globalThis});function M(t,e){if(S(t)&&!j.has(t)){j.add(t),t.cause instanceof Object&&j.add(t.cause),t.entry??=e?.entry??d().entry(t.remote)?.url,t.version??=e?.version;try{d().settings().onError?.(t)}catch{}O.watch?.(t.remote,t)}return t}var jt,f,S,$,j,z,w=h(()=>{"use strict";W();R();jt="https://joaogabriel15.github.io/vitral/erros/",f=class extends Error{constructor(o,r,n,s){super(`[vitral] ${r}: ${n} (${jt}${o})`);this.code=o;this.remote=r;this.cause=s;this.name="RemoteError",this.docs=`${jt}${o}`,typeof location<"u"&&(this.route=location.pathname)}},S=t=>t?.name==="RemoteError",$=new Map,j=new WeakSet;z=t=>{throw M(t)}});function B(){return typeof location<"u"?location.origin:null}function b(t,e){return new URL(t,e??(typeof location<"u"?location.href:void 0)).href}async function Bt(t,e){for(let o=0;;o++)try{return await e()}catch(r){if(!(S(r)&&(r.code==="LOAD_FAILED"||r.code==="TIMEOUT"))||o>=t)throw r;await new Promise(s=>setTimeout(s,200*2**o))}}function V(t,e,o){return new Promise((r,n)=>{let s=setTimeout(()=>n(new f("TIMEOUT",e,`n\xE3o respondeu em ${t}ms`)),t);o.then(r,n).finally(()=>clearTimeout(s))})}function q(t,e,o,r){let n=new AbortController,s=fetch(t,{signal:n.signal,credentials:"omit",...r}).then(a=>{if(!a.ok)throw new f("LOAD_FAILED",o,`HTTP ${a.status} em ${t}`);return a.arrayBuffer()},a=>{throw new f("LOAD_FAILED",o,`falha ao baixar ${t}`,a)});return V(e,o,s).catch(a=>{throw n.abort(),a})}async function X(t,e,o,r){let n=new TextDecoder().decode(await q(t,e,o,r));try{return JSON.parse(n)}catch(s){throw new f("INVALID_MODULE",o,`JSON inv\xE1lido em ${t}`,s)}}function C(t,e,o={},r=document.head){return r.appendChild(Object.assign(document.createElement("link"),{rel:t,crossOrigin:"anonymous",href:e},o))}function D(t,e,o){try{let r=`vitral:${t}:${e}`;performance.clearMeasures(r),performance.measure(r,{start:o}),d().settings().onMetric?.({name:t,stage:e,start:o,duration:performance.now()-o})}catch{}}var k=h(()=>{"use strict";w();R()});var Kt={};L(Kt,{capture:()=>mo,owner:()=>Ft});function mo(){Vt||typeof addEventListener>"u"||(Vt=!0,addEventListener("error",t=>qt(t.error,t.filename)),addEventListener("unhandledrejection",t=>qt(t.reason)))}function Ft(t,e){let o=e||String(t?.stack??"").match(/(?:https?|file):\/\/[^\s)'"]+/)?.[0];if(!o)return;let r=[...document.querySelectorAll("script[src],link[rel=modulepreload]")].map(a=>a.src||a.href),n,s=0;for(let[a,{entry:i}]of $){let l=new URL(".",i).href;l.length>s&&o.startsWith(l)&&!r.some(u=>u.startsWith(l))&&(n=a,s=l.length)}return n}function qt(t,e){if(!d().settings().captureGlobalErrors||S(t)||t instanceof Object&&j.has(t))return;let o=Ft(t,e);o&&M(new f("RENDER_FAILED",o,String(t?.message??t),t),$.get(o))}var Vt,Gt=h(()=>{"use strict";w();R();Vt=!1});function ct(t,e){if(e==="*")return!0;let[,o="",r=""]=/^(\^|~|>=|=)?(.*)$/.exec(e.trim());if(!o||o==="="||t.includes("-"))return t===r;let[n,s]=[t,r].map(i=>(i+".0.0").split(".",3).map(Number));for(let i=0;i<3;i++)if(n[i]!==s[i]){if(!(n[i]>s[i]))return!1;break}if(o===">=")return!0;let a=Math.min(r.split(".").length,o==="~"?2:s[0]?1:s[1]?2:3);return n.slice(0,a).join(".")===s.slice(0,a).join(".")}var Jt=h(()=>{"use strict"});var Z={};L(Z,{offer:()=>ho,satisfies:()=>ct,shared:()=>Wt});function Wt(t){if(!t.dedupe){let e=new Map,o=new Map,r=(s,a)=>s.includes(a)&&s.splice(s.indexOf(a),1),n=(s,a,i)=>(i.p||((i.p=i.load()).catch(()=>r(a,i)),i.url&&i.p.then(()=>go(`${s}@${i.version}`,i.url),()=>{})),i.p);t.dedupe=(s,a,i)=>{let l=i,u=e.get(s)??[];e.set(s,u),l?.url&&o.get(s+l.url)?.(l);let p=u.find(c=>ct(c.version,a));if(!p&&l){p=u[u.push(l)-1];let c=l.url&&fo(`${s}@${l.version}`);c&&c!==l.url&&(l.p=new Promise(g=>{o.set(s+c,g),setTimeout(g,300,l)}).then(g=>(o.delete(s+c),g===l&&(l.p=void 0),n(s,u,g))),l.p.catch(()=>r(u,l)))}return p&&n(s,u,p)}}return t.dedupe}function ho(t,e){for(let o in e){let{version:r,modules:n}=e[o];Wt(t)(o,r,{version:r,load:async()=>n}),t.configure({offered:{...t.settings().offered,[o]:r}})}}var Yt,fo,go,Q=h(()=>{"use strict";Jt();Yt="vitral:dedupe:",fo=t=>{try{return localStorage.getItem(Yt+t)}catch{return null}},go=(t,e)=>{try{localStorage.setItem(Yt+t,e)}catch{}}});function ut(t){let e=d(),{remotes:o,dedupe:r,...n}=t;if(e.configure(n),n.captureGlobalErrors&&Promise.resolve().then(()=>(Gt(),Kt)).then(s=>s.capture()),r&&e.pending(Promise.resolve().then(()=>(Q(),Z)).then(s=>s.offer(e,r)).catch(()=>{})),typeof o=="string"){let s=b(o);e.pending(X(s,e.settings().timeout,"remotes",{cache:"no-cache"}).then(a=>zt(a,s))).catch(()=>{})}else o&&zt(o)}function Xt(t,e){let o=typeof e=="string"?{url:e}:e;if(!o.url&&!o.module)throw new f("NOT_REGISTERED",t,"informe url ou module");if(!o.url)return d().register(t,o);let r=b(o.url);d().register(t,{...o,url:r});let{origin:n}=new URL(r);typeof document<"u"&&n!==B()&&n!=="null"&&!document.querySelector(`link[href="${n}"]`)&&C("preconnect",n)}function A(t,e,o=!0){let r=d(),n=b(t),s=e||n;r.entry(s)?.url!==n&&r.register(s,{url:n});let a=new URL(n).origin,i=r.settings().trusted??[];return o&&!i.includes(a)&&r.configure({trusted:[...i,a]}),s}function zt(t,e){for(let[o,r]of Object.entries(t)){let n=typeof r=="string"?{url:r}:r;Xt(o,n.url?{...n,url:b(n.url,e)}:n)}}function tt(t,e){let o=d(),r=new URL(e).origin,{allowedOrigins:n,trusted:s=[]}=o.settings(),a=[...n??[B(),...o.origins()].filter(Boolean),...s];if(!(a.includes("*")||a.includes(r)||e.startsWith("blob:")))throw new f("ORIGIN_BLOCKED",t,`origem ${r} n\xE3o est\xE1 em allowedOrigins`)}var H=h(()=>{"use strict";w();R();k()});var gt={};L(gt,{attachShadowRoot:()=>wo,prefetch:()=>Ro,registryFor:()=>ft});function oe({css:t,shadow:e}){let o=n=>new URL(n,t[0]).href,r=e?e.css.map(o):[];return[e?[...(e.imports??[]).map(o),...r,...t.slice(r.length)]:t,r,(e?.global??[]).map(o)]}function Ro(t,e){let[o,,r]=oe(t);for(let n of o)yt(n,t.sri?.[n],e).catch(yo);F(r,null,t.sri)}async function wo(t,e,o,r={},n={}){let s=e().getAttribute("data-vitral-root"),a=ft(s),i=t.shadowRoot;if(!i&&!Qt(a))try{i=t.attachShadow({mode:"open",customElementRegistry:a})}catch{mt=!0,pt.delete(s),a=ft(s)}i??=t.attachShadow({mode:"open"});let l=i.customElementRegistry??a,u=e();if(!Qt(l))try{u=e({customElementRegistry:l})}catch{}return u.isConnected||i.appendChild(u),[...await bo(i,u,o,r,n),i,l,u]}function ft(t){let e=pt.get(t);if(e)return e;let o=customElements;if(!mt&&"initialize"in CustomElementRegistry.prototype)try{o=new CustomElementRegistry}catch{mt=!0}let r=o===customElements,n=e=r?Object.create(o):o;if(r)for(let a of["get","getName","upgrade","whenDefined"])a in o&&(n[a]=o[a].bind(o));let s=o.define;return n.define=(a,i,l)=>{let u=o.get(a),p=te.get(a);if(!u)return r&&te.set(a,t),s.call(o,a,i,l);r&&u!==i&&p!==t&&So()&&console.warn(`[vitral] ${t}: <${a}> j\xE1 foi definido por ${p??"outro c\xF3digo"}; fica essa defini\xE7\xE3o. Sem Scoped Custom Element Registries, os remotes dividem o registro global.`)},pt.set(t,e),e}function So(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}async function bo(t,e,o,r={},n={}){let s=o.sri??{},[a,i,l]=oe(o),u=e.cloneNode();u.setAttribute("data-vitral-portal",""),e.after(u);let p=[...r.inherit??[],...n.inherit??[]].map(m=>new URL(m,document.baseURI).href).concat(a),c=F(l,null,s);if(typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype){let m=await Promise.all(p.map(y=>re(y,[],s[y],i.includes(y)?!!o.shadow.rebase:void 0)));t.adoptedStyleSheets=[...new Set([...t.adoptedStyleSheets,...m.flat()])]}else await F(p,t,s);await c;let g=(n.mirrorTheme??r.mirrorTheme)===!1?[]:[ee(e),ee(u)];return[()=>(g.forEach(m=>m()),u.remove()),u]}function re(t,e,o,r){let n=dt.get(t);return n||(n=yt(t,o).then(s=>{let a=new CSSStyleSheet;if(r!==!1&&(s=s.replace(vo,(c,g,m)=>`url(${g}${new URL(m,t).href}${g})`)),r!=null)return a.replaceSync(s),[a];let i=[],l=[],u=s.replace(Eo,(c,g,m,y,x)=>{let v=y??x;return v?l.push(new URL(v,t).href):Zt.has(g??c)||(Zt.add(g??c),i.push(c)),""});if(i.length){let c=document.createElement("style");c.setAttribute("data-vitral-properties",""),c.textContent=i.join(`
|
|
2
|
+
`),document.head.appendChild(c)}a.replaceSync(u);let p=[...e,t];return Promise.all(l.filter(c=>!p.includes(c)).map(c=>re(c,p))).then(c=>[...c.flat(),a])}).catch(()=>(dt.delete(t),[])),dt.set(t,n)),n}function ee(t){let e=document.documentElement,o=[],r=()=>{t.classList.remove(...o),o=[...e.classList].filter(a=>!t.classList.contains(a)),t.classList.add(...o);let s=e.getAttribute("data-theme");s===null?t.removeAttribute("data-theme"):t.setAttribute("data-theme",s)};r();let n=new MutationObserver(r);return n.observe(e,{attributeFilter:["class","data-theme"]}),()=>n.disconnect()}var dt,yo,Zt,vo,Eo,pt,mt,Qt,te,ht=h(()=>{"use strict";et();dt=new Map,yo=()=>{},Zt=new Set,vo=/url\(\s*(['"]?)(?![a-z]+:|\/\/|#)([^'")]+)\1\s*\)/gi,Eo=/@property\s+(--[\w-]+)\s*\{[^}]*\}|@font-face\s*\{[^}]*\}|@import\s+(?:url\(\s*)?(?:(['"])(.*?)\2|([^'"\s);]+))\s*\)?[^;]*;/gi;pt=new Map,mt=!1,Qt=t=>Object.getPrototypeOf(t)===customElements,te=new Map});function yt(t,e,o){let r=`${t} ${e??""}`,n=vt.get(r);return n||(n=q(t,d().settings().timeout,t,{integrity:e,priority:o}).then(s=>new TextDecoder().decode(s)),n.catch(()=>vt.delete(r)),vt.set(r,n)),n}function ie(t,e,o="auto"){if(e&&Po())Promise.resolve().then(()=>(ht(),gt)).then(r=>r.prefetch(t,o),se);else for(let r of t.css)document.querySelector(`link[href="${r}"]`)||C("preload",r,{as:"style",integrity:t.sri?.[r]??"",fetchPriority:o})}function ae(t,e,o,r){return e?Promise.resolve().then(()=>(ht(),gt)).then(n=>n.attachShadowRoot(e,o,t,d().settings().styles,r)):F(t.css,null,t.sri).then(()=>[se])}function F(t,e,o={}){let r=e??document,n=ne.get(r);n||ne.set(r,n=new Map);let s=e??document.head,a=d().settings().timeout;return Promise.all(t.map(i=>{let l=n.get(i);return l||(l=new Promise(u=>{let p=C("stylesheet",i,{integrity:o[i]??""},s);setTimeout(u,a),p.onload=()=>u(),p.onerror=()=>{p.remove(),n.delete(i),u()}}),n.set(i,l)),l}))}var ne,vt,se,Po,et=h(()=>{"use strict";R();k();ne=new WeakMap,vt=new Map,se=()=>{},Po=()=>typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype});var ue={};L(ue,{resolveModule:()=>Lo,resolveTarget:()=>xo,splitName:()=>le});function le(t){let e=d(),o=t.length;if(!e.entry(t))for(;(o=t.lastIndexOf("/",o-1))>0&&!e.entry(t.slice(0,o)););return o>0&&o<t.length?[t.slice(0,o),"."+t.slice(o)]:[t,null]}function xo(t,e){return ce(t,e).then(o=>Et(t,o))}function ce(t,e){let o=d();return o.entry(t)||!t.includes("/")?e(t):o.pending().then(async()=>{let[r,n]=le(t);if(!n)return e(t);let s=await e(r),a=s.exports?.exposes;if(!a?.[n])throw new f("NOT_EXPOSED",t,`${r} n\xE3o exp\xF5e ${n}. Expostos: ${Object.keys(a??{}).join(", ")}`);try{let i=a[n],l=await(typeof i=="function"?i():i);return{...s,module:l?.default??l,exports:l}}catch(i){throw new f("LOAD_FAILED",t,String(i),i)}})}async function Lo(t,e){let o=await ce(t,e);if(!o.exports)throw new f("INVALID_MODULE",t,"o remote foi carregado por uma c\xF3pia antiga da lib, que n\xE3o guarda os exports");return o.exports}var de=h(()=>{"use strict";w();ot();R()});async function me(t,e,o){let r=o.split(/\s+/).map(i=>/^sha(256|384|512)-([\w+/=-]+)/.exec(i)).filter(i=>!!i);if(!r.length)throw new f("INTEGRITY",t,`formato de integrity inv\xE1lido: ${o}`);let n=Math.max(...r.map(i=>+i[1])),s=btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest("SHA-"+n,e)))),a=r.filter(i=>+i[1]===n).map(i=>i[2]);if(!a.some(i=>pe(i)===pe(s)))throw new f("INTEGRITY",t,`o hash n\xE3o confere: esperado sha${n}-${a.join(" ou ")}, obtido sha${n}-${s}`)}var pe,fe=h(()=>{"use strict";w();pe=t=>t.replace(/-/g,"+").replace(/_/g,"/").replace(/=/g,"")});var Pe={};L(Pe,{importVerified:()=>Oo,verified:()=>Se});async function Oo(t,e,o,r){let{entry:n,integrity:s,priority:a}=e;if(!Rt.has(n))try{let p=await V(r,t,(async()=>{let c=await Se(e.split??{entry:n,chunks:[],sri:{[n]:s},priority:a},o);return c&&{ns:await o(c)}})());if(p)return p.ns}catch(u){if(Rt.add(n),u instanceof f&&u.code==="TIMEOUT")throw u}let i=await q(n,r,t,Rt.has(n)?{priority:a,cache:"reload"}:{priority:a});await me(t,i,s);let l=URL.createObjectURL(new Blob([i],{type:"text/javascript"}));try{return await o(l)}finally{URL.revokeObjectURL(l)}}async function To(t){if(wt)return await wt&&Re(t,!1);let e=!1;try{e=localStorage[ve]===navigator.userAgent}catch{}let o=await(wt=Re(t,!e));if(o&&!e)try{localStorage[ve]=navigator.userAgent}catch{}return o}async function Se(t,e){let{entry:o,chunks:r,sri:n,priority:s="auto",dedupe:a=[]}=t,i=a.flatMap(p=>[...p.chunks??[],p.file]);if(![o,...r,...i].every(p=>Mo.test(n[p]??"")))return;let l=globalThis[Symbol.for("vitral")],u=async p=>{if(!e||!a.length)return;let{shared:c}=await Promise.resolve().then(()=>(Q(),Z));for(let g of a)c(l)(g.name,g.range,{version:g.version,url:g.file,load:async()=>(p&&await Promise.all([...g.chunks??[],g.file].map(m=>St(m,n[m],s))),(await e(g.file)).default)})};if(he!==!1&&(he=await To(n))){await u();for(let p of r)fetch(p,{priority:s}).catch(()=>{});return o}if(await(ko??=Co()))return l.sri={...l.sri,...n},await u(!0),await Promise.all([...r,o].map(p=>St(p,n[p],s))),o}async function Re(t,e){if(!HTMLScriptElement.supports?.("importmap"))return!1;let o={};for(let s in t)!/\.css([?#]|$)/.test(s)&&!ye.has(s)&&(ye.add(s),o[s]=t[s]);let r=e?["export{}","export{}//"].map(s=>URL.createObjectURL(new Blob([s],{type:"text/javascript"}))):[];for(let s of r)o[s]=we;let n=!0;try{let s=document.createElement("script");s.type="importmap",s.nonce=document.querySelector("script[nonce]")?.nonce??"",s.onerror=()=>n=!1,s.addEventListener("securitypolicyviolation",()=>n=!1),s.textContent=JSON.stringify({integrity:o}),document.head.append(s),await Ee(),await Ee(),n&&e&&(n=await be(a=>import(a),r[0],r[1]))}catch{n=!1}for(let s of r)URL.revokeObjectURL(s);return n}function St(t,e,o="auto"){return new Promise((r,n)=>{let s=C("modulepreload",t,{integrity:e,fetchPriority:o});s.onload=r,s.onerror=n})}function Co(){return document.createElement("link").relList.supports("modulepreload")?be(t=>St(t,we),ge,ge+"//"):Promise.resolve(!1)}function be(t,e,o){return Promise.race([Promise.all([t(e).then(()=>!0,()=>!1),t(o).then(()=>!1,()=>!0)]).then(([r,n])=>r&&n),new Promise(r=>setTimeout(r,3e3,!1))])}var Rt,Mo,ge,we,he,ye,wt,ko,ve,Ee,xe=h(()=>{"use strict";fe();w();k();Rt=new Set;Mo=/^(sha(256|384|512)-[A-Za-z0-9+/]+={0,2}( +|$))+$/,ge="data:text/javascript,export{}",we="sha256-d3bjIZdvLjBurwdLwkSVOnEBPFFly+T1SR9r3VVHBGg=",ye=new Set,ve="vitral:sri-map";Ee=()=>new Promise(t=>{let e=new MessageChannel;e.port1.onmessage=()=>t(),e.port2.postMessage(0)})});var Ce={};L(Ce,{OVERRIDES_KEY:()=>rt,activeOverrides:()=>Te,clearOverrides:()=>Me,dropOverride:()=>$o,isRef:()=>bt,manifestUrl:()=>nt,overrideFor:()=>Do,overridesEnabled:()=>Oe,resolveOverride:()=>ke,storeOverride:()=>Ao,storedOverrides:()=>xt});function Oe(){return!!d().settings().devOverrides||typeof location<"u"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname)}function Ao(t,e){let o=xt();e?o[t]=bt(e)?e:nt(e):delete o[t],K(it,o)}function Io(){let t=Pt(st),e=new URLSearchParams(location.search).getAll("vitral").join(",").split(",");if(!e.some(Boolean))return t;for(let o of e){let r=o.indexOf("@");o==="off"?(Me(),Object.keys(t).forEach(n=>delete t[n])):r>0&&o.slice(r+1)==="off"?delete t[o.slice(0,r)]:r>0&&(t[o.slice(0,r)]=o.slice(r+1))}return K(st,t),t}function Me(){K(st,{}),K(it,{})}function $o(t){for(let e of[st,it]){let o=Pt(e);delete o[t],K(e,o)}}function ke(t,e){if(!bt(e))return new URL(nt(e),location.href).href;let o=d().settings().devOverrides,r=typeof o=="object"?o.preview:void 0;if(!r)return;let n=r.replace(/\{name\}/g,encodeURIComponent(t)).replace(/\{ref\}/g,encodeURIComponent(e));return new URL(nt(n),location.href).href}function Te(){let t=Io(),e={};for(let[o,r]of[["navegador",xt()],["aba",t]])for(let[n,s]of Object.entries(r))e[n]={name:n,value:s,url:ke(n,s),source:o};return Object.values(e)}function Do(t){if(!Oe())return;let e=Te().find(a=>a.name===t);if(!e)return;let o=!Le.has(t)&&Le.add(t);if(!e.url){o&&console.warn(`[vitral] override ${t}@${e.value} ignorado: falta configure({ devOverrides: { preview } })`);return}let r=d(),n=r.settings().trusted??[],s=new URL(e.url).origin;return n.includes(s)||r.configure({trusted:[...n,s]}),o&&console.warn(`[vitral] override ativo: ${t} \u2192 ${e.url} (${e.source}). Para limpar: ?vitral=off`),{url:e.url}}var rt,nt,bt,Pt,K,it,st,xt,Le,Ae=h(()=>{"use strict";R();rt="vitral:overrides";nt=t=>/\.(json|m?js)(\?|$)/.test(t)?t:t.replace(/\/?$/,"/vitral.json"),bt=t=>/^[\w.-]+$/.test(t),Pt=t=>{try{return JSON.parse(t().getItem(rt)??"{}")??{}}catch{return{}}},K=(t,e)=>{try{Object.keys(e).length?t().setItem(rt,JSON.stringify(e)):t().removeItem(rt)}catch{}},it=()=>localStorage,st=()=>sessionStorage,xt=()=>Pt(it);Le=new Set});var Ue={};L(Ue,{bucket:()=>He,pick:()=>Ho,resetChannels:()=>jo,versionUrl:()=>De});async function Ho(t,e,o){if(typeof o.stable!="string")throw new f("INVALID_MODULE",t,`canal inv\xE1lido em ${e.url}: falta "stable"`);O.watch=Uo;let r={name:t,bucket:He(t)},{canary:n,stable:s}=o,a=await e.resolve?.(o,r)??(n&&r.bucket<n.percent?n.version:s);return a!==s&&_e()[t]===a&&(a=s),a===s||e.rollback===!1?U.delete(t):U.get(t)?.from!==a&&U.set(t,{from:a,to:s,errors:0,mounts:0,max:{errors:3,mounts:20,...e.rollback}}),{...e,url:De(a,e.url),integrity:void 0,manifest:void 0}}function He(t){let e=d().settings().canaryKey??_o(),o=2166136261;for(let r of`${e}:${t}`)o=Math.imul(o^r.charCodeAt(0),16777619);return(o>>>0)%100}function _o(){try{_??=localStorage.getItem(Ie)??void 0}catch{}if(!_){_=Math.random().toString(36).slice(2);try{localStorage.setItem(Ie,_)}catch{}}return _}function _e(){try{return{...JSON.parse(sessionStorage.getItem($e)||"{}"),...G}}catch{return G}}function Uo(t,e){for(let[o,r]of U)t!==o&&!t.startsWith(o+"/")||(e?++r.errors>=r.max.errors&&No(o,r):++r.mounts>r.max.mounts&&(r.mounts=1,r.errors=0))}function No(t,e){U.delete(t),G={..._e(),[t]:e.from};try{sessionStorage.setItem($e,JSON.stringify(G))}catch{}console.warn(`[vitral] ${t}: ${e.errors} erros em ${e.mounts} montagens da vers\xE3o ${e.from}; voltando para ${e.to}`);try{d().settings().onRollback?.({name:t,from:e.from,to:e.to,errors:e.errors,mounts:e.mounts})}catch{}let o=d();o.register(t,o.entry(t)),o.events.emit("vitral:refresh",t)}function jo(){U.clear(),G={},_=void 0}var $e,Ie,U,G,_,De,Ne=h(()=>{"use strict";w();W();R();k();$e="vitral:rollback",Ie="vitral:id",U=new Map,G={};De=(t,e)=>b(/[/:]|\.(m?js|json)$/.test(t)?t:`${t}/vitral.json`,e)});var je={};L(je,{checkContract:()=>Bo});async function Bo(t,e=d().settings().contract){let{satisfies:o}=await Promise.resolve().then(()=>(Q(),Z));if(t.version&&!o(t.version,e))return`o host aceita contrato ${e}, o remote publica ${t.version}`;let r=d().settings().offered??{};for(let n in t.peers){let s=r[n];if(s&&!o(s,t.peers[n]))return`o remote espera ${n} ${t.peers[n]}, o host oferece ${s}`}}var Be=h(()=>{"use strict";R()});function Ve(t){Ot(t).catch(()=>{})}function Ot(t,e,o){let r=n=>Vo(n,e,o);return(d().entry(t)||!t.includes("/")?r(t).then(n=>Et(t,n)):Promise.resolve().then(()=>(de(),ue)).then(n=>n.resolveTarget(t,r))).catch(z)}function Vo(t,e,o){let r=d();return r.load(t,async()=>{qe??=Promise.resolve().then(()=>(xe(),Pe)).catch(()=>null);let n;try{await r.pending();let s=await Fe(t),a=s?{isolate:r.entry(t)?.isolate,...s}:r.entry(t);if(!a)throw new f("NOT_REGISTERED",t,"remote n\xE3o registrado. Use configure({ remotes }).");if(a.module)return await qo(t,a);let i=performance.now();n=await Lt(t,a,o),D(t,"manifest",i),ie(n,(e??n.isolate??r.settings().isolate)==="shadow",o),i=performance.now();let l=await Bt(r.settings().retries,()=>Fo(t,n));return D(t,"js",i),{...n,module:l?.default??l,exports:l}}catch(s){throw M(S(s)?s:new f("LOAD_FAILED",t,String(s?.message??s),s),n)}})}function Fe(t){try{let e="vitral:overrides";if(location.search.includes("vitral")||localStorage[e]||sessionStorage[e])return Promise.resolve().then(()=>(Ae(),Ce)).then(o=>o.overrideFor(t))}catch{}}async function qo(t,e){let o=e.module;return typeof o=="function"&&(o=await o()),{module:o?.default??o,exports:o,entry:typeof location<"u"?location.href:"http://localhost/",css:e.css??[],isolate:e.isolate}}async function Lt(t,e,o){tt(t,e.url);let r=e.manifest??(new URL(e.url).pathname.endsWith(".json")?await X(e.url,d().settings().timeout,t,{cache:"no-cache",priority:o}):{name:t,entry:e.url});if(r?.stable)return Lt(t,await(await Promise.resolve().then(()=>(Ne(),Ue))).pick(t,e,r),o);if(typeof r?.entry!="string")throw new f("INVALID_MODULE",t,`manifesto inv\xE1lido em ${e.url}`);if(r.contract&&(e.contract||d().settings().contract)){let i=await(await Promise.resolve().then(()=>(Be(),je))).checkContract(r.contract,e.contract);if(i)throw new f("CONTRACT_MISMATCH",t,i)}let n=i=>b(i,e.url),s={};for(let i in r.files??{})s[n(i)]=r.files[i];let a={entry:n(r.entry),css:[...r.css??[],...e.css??[]].map(n),shadow:r.shadow,integrity:e.integrity??r.integrity,isolate:e.isolate,scope:r.scope,version:r.version,sri:s,priority:o,split:r.split&&!e.integrity?{entry:n(r.split.entry),chunks:(r.split.chunks??[]).map(n),sri:s,priority:o,dedupe:r.dedupe?.map(i=>({...i,file:n(i.file),chunks:i.chunks?.map(n)}))}:void 0};tt(t,a.entry);for(let i of[a.split?.entry,...(a.split?.dedupe??[]).map(l=>l.file)])i&&tt(t,i);if(t===e.url&&r.name){let i=await Fe(r.name);if(i)return{...await Lt(t,i),name:r.name};a.name=r.name,d().entry(r.name)||d().register(r.name,e)}return a}async function Fo(t,e){let{timeout:o}=d().settings(),r=s=>V(o,t,import(s)).catch(a=>{throw S(a)?a:new f("LOAD_FAILED",t,`falha ao importar ${e.entry}`,a)});if(!e.integrity)return r(e.entry);let n=await qe;if(!n)throw new f("LOAD_FAILED",t,"n\xE3o foi poss\xEDvel carregar o verificador de integrity");return n.importVerified(t,e,r,o)}function Et(t,e){if(typeof e.module?.mount!="function")throw new f("INVALID_MODULE",t,"o m\xF3dulo n\xE3o exporta mount(). Use defineRemote(), ou loadModule() para m\xF3dulo sem UI.");return e}var qe,ot=h(()=>{"use strict";et();w();H();R();k()});var Mt={};L(Mt,{load:()=>Ze,noFrames:()=>Ko});function Ze(t){throw new f("MOUNT_FAILED",t,"isolate sem suporte no embed.js")}var Ko,kt=h(()=>{"use strict";w();Ko=(t,e)=>Ze(e)});H();et();w();R();var I={emit:(t,e)=>d().events.emit(t,e),on:(t,e)=>d().events.on(t,e),last:t=>d().events.last(t)};function Ke(){let t=new Set,e=o=>{let r=()=>(t.delete(r),o());return t.add(r),r};return{bus:{emit:(o,r)=>I.emit(o,r),last:o=>I.last(o),on:(o,r)=>e(I.on(o,r))},track:e,dispose(){for(let o of[...t])o()}}}W();ot();function Ge(t,e={}){let o=new URL(t,location.href);if(o.origin!==location.origin){location.assign(o.href);return}e.replace?history.replaceState(history.state,"",o.href):history.pushState(history.state,"",o.href),dispatchEvent(new PopStateEvent("popstate",{state:history.state})),I.emit("vitral:navigate",o.pathname+o.search+o.hash)}R();w();var Je=new Map,J=new Map;function ze(t,e){return Je.set(t,e.entry),$.set(t,e),J.set(t,(J.get(t)??0)+1),()=>{let o=J.get(t)-1;o?J.set(t,o):(J.delete(t),Je.delete(t),$.delete(t))}}var Ye=null;function Xe(t,e,o,r){let n=0,s=I.on("vitral:refresh",a=>{if(a!==e&&!e.startsWith(a+"/"))return;let i=++n,l=o,u=r(l).then(p=>{if(t.unmount===We||i!==n)return p.unmount();let c=t;t=p,c.unmount(),o!==l&&p.update?.(o)});Ye?Ye.push(u):u.catch(console.error)});return{update(a){o=a,t.update?.(a)},unmount(){s(),t.unmount(),t={unmount:We}}}}var We=()=>{};k();async function to(t,e,o,r={}){return Xe(await Qe(t,e,o,r),e,o,n=>Qe(t,e,n,r))}var Go;async function Qe(t,e,o,r){let n=d();await n.pending();let s=r.isolate??Jo(e)?.isolate??n.settings().isolate;if(s==="iframe")return(Go??(await Promise.resolve().then(()=>(kt(),Mt))).noFrames)(t,e,o,r).catch(z);let{module:a,...i}=await(s=="reframe"?(await Promise.resolve().then(()=>(kt(),Mt))).load:Ot)(e,s,r.priority),l=ze(e,i);O.watch?.(e);let u=i.name??e,p=E=>{let P=document.createElement("div",E);return P.setAttribute("data-vitral-root",u),i.scope&&P.setAttribute("data-vitral-scope",i.scope),P.style.display="contents",P},c=performance.now(),[g,m=document.body,y=null,x=customElements,v=t.appendChild(p())]=await ae(i,s>"q"&&t,p,r.styles);D(e,"css",c),c=performance.now();let Y=Ke(),It=E=>P=>(v.addEventListener(E,P),()=>v.removeEventListener(E,P)),$t={name:u,baseUrl:new URL(".",i.entry).href,events:Y.bus,shadowRoot:y,portalContainer:m,customElements:x,reportError(E){let P=M(S(E)?E:new f("RENDER_FAILED",u,String(E?.message??E),E),i);r.onError?r.onError(P):console.error(P)},navigate:Ge,protocol:n.protocol,onActivate:It("vitral:activate"),onDeactivate:It("vitral:deactivate")};O.shared&&($t.shared=O.shared(e,Y.track));let at;try{at=await a.mount(v,o,$t),D(e,"mount",c)}catch(E){throw l(),Y.dispose(),g(),v.remove(),M(new f("MOUNT_FAILED",u,"erro ao montar",E),i)}let lt=!0;return{update(E){lt&&at.update?.(E)},unmount(){if(lt){lt=!1;try{at.unmount()}finally{l(),Y.dispose(),g(),v.remove()}}}}}function Jo(t){let e=d(),o=t;for(;o&&!e.entry(o);)o=o.slice(0,Math.max(0,o.lastIndexOf("/")));return o?e.entry(o):void 0}w();H();function eo(t,e){let{isolate:o}=e,r=m=>m.src?A(m.src,m.name):m.name??"",n=r(e),s=e.props??{},a=null,i=null,l=0,u="loading",p=(m,y=null)=>{u=m,i&&(i.style.display=m==="error"?"none":""),e.onStatus?.(m,y)},c=()=>{a?.unmount(),a=null,i?.remove(),i=null},g=()=>{let m=++l;c(),i=document.createElement("div"),i.setAttribute("data-vitral-slot",n),t.appendChild(i),p("loading");let y=v=>{m===l&&p("error",S(v)?v:new f("MOUNT_FAILED",n,String(v),v))},x=s;to(i,n,s,{isolate:o,priority:e.priority,styles:e.styles,onError:y}).then(v=>{if(m!==l)return v.unmount();a=v,s!==x&&v.update?.(s),p("ready")},y)};return g(),{update(m){s=m,a?.update?.(m)},set(m){let y=m.src||m.name!==void 0?r(m):n,x=y!==n||"isolate"in m&&m.isolate!==o;n=y,"isolate"in m&&(o=m.isolate),x&&g()},retry:g,destroy(){l++,c()},get status(){return u}}}ot();H();var Tt=()=>{};function ro(t){let e={};if(typeof performance>"u"||!performance.getEntriesByName)return e;for(let o of["manifest","js","css","mount"]){let r=performance.getEntriesByName(`vitral:${t}:${o}`,"measure").pop();r&&(e[o]=Math.round(r.duration*10)/10)}return e}function oo(t,e,o){if(e==="lazy"||e==="visible"){if(typeof IntersectionObserver>"u")return o(),Tt;let r=new IntersectionObserver(n=>{n.some(s=>s.isIntersecting)&&(r.disconnect(),o())},{rootMargin:"200px"});return r.observe(t),()=>r.disconnect()}if(e==="idle"){if(typeof requestIdleCallback>"u"){let n=setTimeout(o,1);return()=>clearTimeout(n)}let r=requestIdleCallback(o,{timeout:2e3});return()=>cancelIdleCallback(r)}if(e==="hover"){let r=()=>(n(),o()),n=()=>{t.removeEventListener("pointerenter",r),t.removeEventListener("focusin",r)};return t.addEventListener("pointerenter",r),t.addEventListener("focusin",r),n}return o(),Tt}var T=new Map,N=null;function no(t,e){try{t.moveBefore(e,null)}catch{t.appendChild(e)}}function Ct(t,e){for(let o of t.querySelectorAll("*"))o.hasAttribute("data-vitral-root")&&o.dispatchEvent(new Event(e)),o.shadowRoot&&Ct(o.shadowRoot,e)}function Yo(t,e,o){T.get(t)?.slot.destroy(),T.delete(t),N?.isConnected||(N=document.createElement("div"),N.hidden=!0,N.setAttribute("data-vitral-keep-alive",""),document.body.appendChild(N)),no(N,e.box),Ct(e.box,"vitral:deactivate"),T.set(t,e);for(let[r,n]of T){if(T.size<=o)break;T.delete(r),n.slot.destroy(),n.box.remove()}}function so(t,e){let{props:o={},keepAlive:r}=e,n=c=>c.src?A(c.src,c.name):c.name??"",s=n(e),a="loading",i=null,l=(c,g)=>{a=c,e.onStatus?.(c,g)},u=e.prefetch?oo(t,e.prefetch,()=>Ve(s)):Tt,p=oo(t,e.loading,()=>{u();let c=r?T.get(s):void 0;if(c){T.delete(s),i=c,i.on=l,no(t,i.box),i.slot.update(o),Ct(i.box,"vitral:activate"),l(i.slot.status,null);return}let g=t;r&&(g=t.appendChild(document.createElement("div")),g.style.display="contents");let m={box:g,on:l,slot:null};m.slot=eo(g,{...e,name:s,src:void 0,props:o,onStatus:(y,x)=>m.on(y,x)}),i=m});return{update(c){o=c,i?.slot.update(c)},set(c){(c.src||c.name!==void 0)&&(s=n(c)),i?.slot.set({...c,src:void 0,name:s})},retry:()=>i?.slot.retry(),destroy(){p(),u(),i&&(r&&a==="ready"?Yo(s,i,r===!0?5:r):(i.slot.destroy(),i.box!==t&&i.box.remove()),i=null)},get status(){return a}}}H();var Wo=typeof HTMLElement>"u"?class{}:HTMLElement,At=class extends Wo{static{this.observedAttributes=["name","src","props","isolate"]}#t=null;#e={};get props(){return this.#e}set props(e){this.#e=e??{},this.#t?.update(this.#e)}get status(){return this.#t?.status??"loading"}retry(){this.#t?.retry()}connectedCallback(){if(this.#t)return;let e=this.#r();if(!e)return;this.hasAttribute("props")&&!Object.keys(this.#e).length&&(this.#e=io(this.getAttribute("props")));let o=this.getAttribute("keep-alive"),r={name:e,props:this.#e,isolate:this.getAttribute("isolate")||void 0,loading:this.getAttribute("loading"),prefetch:this.getAttribute("prefetch"),priority:this.getAttribute("priority")||void 0,keepAlive:o===null?!1:Number(o)||!0,styles:{inherit:this.getAttribute("inherit-styles")?.split(/\s+/).filter(Boolean)},onStatus:(s,a)=>{this.setAttribute("data-vitral-status",s),s==="loading"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");let i=l=>{let u=this.querySelectorAll(`:scope > [slot="${l}"]`);for(let p of u)p.hidden=s!==(l==="fallback"?"loading":"error");return u.length>0};queueMicrotask(()=>{if(this.#t?.status!==s)return;let l={loading:i("fallback"),error:i("error"),ready:!0};this.#n(l[s]?null:s)}),s==="ready"&&this.dispatchEvent(new CustomEvent("vitral-ready",{bubbles:!0,detail:{timings:ro(e)}})),s==="error"&&this.dispatchEvent(new CustomEvent("vitral-error",{bubbles:!0,detail:{error:a}}))}},n=null;this.#t=so(this,r)}#r(){let e=this.getAttribute("src"),o=this.getAttribute("name");return e?A(e,o??void 0,!1):o}#o=null;#n(e){if(this.#o?.remove(),this.#o=null,!e)return;let o=document.createElement("div");if(o.setAttribute("data-vitral-default",e),e==="loading")o.setAttribute("role","status"),o.textContent="Carregando\u2026";else{o.setAttribute("role","alert");let r=document.createElement("button");r.type="button",r.textContent="Tentar de novo",r.onclick=()=>this.retry(),o.append("N\xE3o foi poss\xEDvel carregar. ",r)}this.prepend(this.#o=o)}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||(this.#t?.destroy(),this.#t=null,this.#n(null))})}attributeChangedCallback(e,o,r){if(e==="props")return void(this.props=io(r));if(!this.#t)return void(this.isConnected&&this.connectedCallback());if(e==="name"||e==="src"){let n=this.#r();n&&this.#t.set({name:n})}e==="isolate"&&this.#t.set({isolate:r||void 0})}};function io(t){if(!t)return{};try{return JSON.parse(t)}catch{return console.error("[vitral] atributo props n\xE3o \xE9 JSON v\xE1lido:",t),{}}}function ao(t="vitral-remote"){typeof customElements<"u"&&!customElements.get(t)&&customElements.define(t,class extends At{})}R();k();var lo="data-vitral-embed";function co(t){let e=t.dataset;if(!e.remote||t.hasAttribute(lo))return null;let o=e.target?document.querySelector(e.target):t.closest("body")?t:document.body;if(!o)return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>co(t),{once:!0}):console.error(`[vitral] data-target n\xE3o encontrado: ${e.target}`),null;t.setAttribute(lo,"");let r=b(e.remote);zo([new URL(r).origin,...e.origins?.split(/\s+/).filter(Boolean)??[]]),ao();let n=document.createElement("vitral-remote");return n.setAttribute("isolate",e.isolate||"shadow"),e.loading&&n.setAttribute("loading",e.loading),e.props&&n.setAttribute("props",e.props),e.name&&n.setAttribute("name",e.name),n.setAttribute("src",r),o===t?t.after(n):o.appendChild(n),n}function zo(t){let e=d(),o=e.settings().allowedOrigins??[B(),...e.origins()].filter(Boolean);ut({allowedOrigins:[...new Set([...o,...t])]})}var Xo=Symbol.for("vitral:embed"),Zo=globalThis[Xo]??=co;typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&Zo(document.currentScript);})();
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
resolveModule,
|
|
3
3
|
resolveTarget,
|
|
4
4
|
splitName
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JBNITHPI.js";
|
|
6
|
+
import "./chunk-S7PIVPBX.js";
|
|
7
7
|
import "./chunk-KU6HF2EW.js";
|
|
8
8
|
import "./chunk-TW7KYJQ6.js";
|
|
9
9
|
import "./chunk-463H6B56.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXLKRSOM.js";
|
|
4
4
|
import {
|
|
5
5
|
mountOnce,
|
|
6
6
|
navigate,
|
|
@@ -8,14 +8,15 @@ import {
|
|
|
8
8
|
registered,
|
|
9
9
|
scopedEvents,
|
|
10
10
|
track
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HIVMSPGM.js";
|
|
12
12
|
import {
|
|
13
13
|
load
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-S7PIVPBX.js";
|
|
15
15
|
import {
|
|
16
16
|
injectStyles
|
|
17
17
|
} from "./chunk-KU6HF2EW.js";
|
|
18
18
|
import {
|
|
19
|
+
absolute,
|
|
19
20
|
metric
|
|
20
21
|
} from "./chunk-TW7KYJQ6.js";
|
|
21
22
|
import {
|
|
@@ -99,7 +100,10 @@ async function hydrateRemote(holder, name, props, options) {
|
|
|
99
100
|
await p.pending();
|
|
100
101
|
const isolate = options.isolate ?? registered(name)?.isolate ?? p.settings().isolate;
|
|
101
102
|
if (isolate === "iframe") return null;
|
|
102
|
-
const
|
|
103
|
+
const entry = p.entry(name);
|
|
104
|
+
const seed = entry?.url && !entry.manifest ? manifestFrom(holder, entry.url) : void 0;
|
|
105
|
+
if (seed) entry.manifest = seed;
|
|
106
|
+
const { module: mod, ...resolved } = await load(name, isolate, options.priority).finally(() => seed && entry.manifest === seed && delete entry.manifest);
|
|
103
107
|
const shadow = isolate === "shadow";
|
|
104
108
|
const el = [...(shadow ? holder.shadowRoot : holder)?.children ?? []].find((c) => c.hasAttribute("data-vitral-root"));
|
|
105
109
|
if (typeof mod.hydrate !== "function" || !el) return null;
|
|
@@ -162,6 +166,16 @@ async function hydrateRemote(holder, name, props, options) {
|
|
|
162
166
|
};
|
|
163
167
|
return refreshable(current, name, props, (latest) => mountOnce(holder, name, latest, options));
|
|
164
168
|
}
|
|
169
|
+
function manifestFrom(holder, url) {
|
|
170
|
+
for (const s of holder.querySelectorAll(":scope>script[data-vitral-manifest]")) {
|
|
171
|
+
if (absolute(s.getAttribute("data-vitral-manifest") ?? "") !== url) continue;
|
|
172
|
+
try {
|
|
173
|
+
const m = JSON.parse(s.textContent ?? "");
|
|
174
|
+
if (typeof m?.entry === "string") return m;
|
|
175
|
+
} catch {
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
165
179
|
export {
|
|
166
180
|
hydrateRemote,
|
|
167
181
|
hydrateSlot
|
package/dist/iframe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
splitName
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JBNITHPI.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyIntegrity
|
|
6
6
|
} from "./chunk-UYOPJ4XQ.js";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
navigate,
|
|
10
10
|
setFrameMounter,
|
|
11
11
|
track
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HIVMSPGM.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveEntry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-S7PIVPBX.js";
|
|
16
16
|
import "./chunk-KU6HF2EW.js";
|
|
17
17
|
import {
|
|
18
18
|
fetchBytes,
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
syncTabs,
|
|
18
18
|
unsafeHTML,
|
|
19
19
|
watchUpdates
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HIVMSPGM.js";
|
|
21
21
|
import {
|
|
22
22
|
configure,
|
|
23
23
|
loadModule,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
preload,
|
|
26
26
|
register,
|
|
27
27
|
registerSrc
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-S7PIVPBX.js";
|
|
29
29
|
import "./chunk-KU6HF2EW.js";
|
|
30
30
|
import "./chunk-TW7KYJQ6.js";
|
|
31
31
|
import {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rotas → remote, sem DOM: o `<vitral-outlet>` (`vitral/routes`) e o gateway
|
|
3
|
+
* (`vitral/edge`) usam o mesmo mapa e a mesma regra.
|
|
4
|
+
*/
|
|
5
|
+
/** Padrão de URL → nome do remote. A primeira rota que bate vence. */
|
|
6
|
+
type Routes = Record<string, string>;
|
|
7
|
+
interface RouteMatch {
|
|
8
|
+
/** Nome do remote. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Padrão que bateu. */
|
|
11
|
+
pattern: string;
|
|
12
|
+
/** Segmentos `:nome` do padrão. */
|
|
13
|
+
params: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { Routes as R, RouteMatch as a };
|
package/dist/preact.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXLKRSOM.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRemote,
|
|
6
6
|
events,
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
navigate,
|
|
9
9
|
same,
|
|
10
10
|
shared
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-HIVMSPGM.js";
|
|
12
|
+
import "./chunk-S7PIVPBX.js";
|
|
13
13
|
import "./chunk-KU6HF2EW.js";
|
|
14
14
|
import "./chunk-TW7KYJQ6.js";
|
|
15
15
|
import "./chunk-463H6B56.js";
|
package/dist/prefetch.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { P as Props } from './types-DUtcF3HO.js';
|
|
3
|
+
import './errors-kjBv6IH_.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SSR de um remote React, para o `render` do gateway (`vitral/edge`):
|
|
7
|
+
*
|
|
8
|
+
* // carrinho/src/server.ts
|
|
9
|
+
* import { reactRender } from 'vitral/react-server'
|
|
10
|
+
* import Carrinho from './Carrinho'
|
|
11
|
+
* export const render = reactRender(Carrinho)
|
|
12
|
+
*
|
|
13
|
+
* No navegador, `reactRemote` (ou o plugin, que embrulha sozinho) hidrata
|
|
14
|
+
* esse HTML. No servidor, `useVitral()` devolve `null`.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** `render(props)` do gateway para um componente React. */
|
|
18
|
+
declare function reactRender<P extends Props>(Component: ComponentType<P>): (props: P) => string;
|
|
19
|
+
|
|
20
|
+
export { reactRender };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RemoteTree
|
|
3
|
+
} from "./chunk-B2MPYF4M.js";
|
|
4
|
+
|
|
5
|
+
// src/react-server.tsx
|
|
6
|
+
import { renderToString } from "react-dom/server";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function reactRender(Component) {
|
|
9
|
+
return (props) => renderToString(/* @__PURE__ */ jsx(RemoteTree, { Component, props, ctx: null }));
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
reactRender
|
|
13
|
+
};
|
package/dist/react.d.ts
CHANGED
|
@@ -14,7 +14,10 @@ import './errors-kjBv6IH_.js';
|
|
|
14
14
|
* Remote: export default reactRemote(App)
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Transforma um componente React em um remote. Com o HTML do servidor
|
|
19
|
+
* (`reactRender` de `vitral/react-server`, no gateway), hidrata em vez de montar.
|
|
20
|
+
*/
|
|
18
21
|
declare function reactRemote<P extends Props>(Component: ComponentType<P>): RemoteModule<P>;
|
|
19
22
|
/** Dentro de um remote: dá acesso ao contexto (nome, eventos, baseUrl). */
|
|
20
23
|
declare function useVitral(): RemoteContext | null;
|
package/dist/react.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
RemoteTree,
|
|
4
|
+
VitralContext
|
|
5
|
+
} from "./chunk-B2MPYF4M.js";
|
|
2
6
|
import {
|
|
3
7
|
hostSlot
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UXLKRSOM.js";
|
|
5
9
|
import {
|
|
6
10
|
defineRemote,
|
|
7
11
|
events,
|
|
8
12
|
memoSelect,
|
|
9
13
|
same,
|
|
10
14
|
shared
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-HIVMSPGM.js";
|
|
16
|
+
import "./chunk-S7PIVPBX.js";
|
|
13
17
|
import "./chunk-KU6HF2EW.js";
|
|
14
18
|
import "./chunk-TW7KYJQ6.js";
|
|
15
19
|
import "./chunk-463H6B56.js";
|
|
@@ -19,8 +23,6 @@ import {
|
|
|
19
23
|
|
|
20
24
|
// src/react.tsx
|
|
21
25
|
import {
|
|
22
|
-
Component as ReactComponent,
|
|
23
|
-
createContext,
|
|
24
26
|
useContext,
|
|
25
27
|
useEffect,
|
|
26
28
|
useMemo,
|
|
@@ -28,39 +30,25 @@ import {
|
|
|
28
30
|
useState,
|
|
29
31
|
useSyncExternalStore
|
|
30
32
|
} from "react";
|
|
31
|
-
import { createRoot } from "react-dom/client";
|
|
33
|
+
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
32
34
|
import * as ReactAll from "react";
|
|
33
35
|
import * as ReactDOM from "react-dom";
|
|
34
36
|
import * as ReactDOMClient from "react-dom/client";
|
|
35
37
|
import * as JSXRuntime from "react/jsx-runtime";
|
|
36
38
|
import * as JSXDevRuntime from "react/jsx-dev-runtime";
|
|
37
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
|
-
var VitralContext = createContext(null);
|
|
39
|
-
var Boundary = class extends ReactComponent {
|
|
40
|
-
constructor() {
|
|
41
|
-
super(...arguments);
|
|
42
|
-
this.state = { failed: false };
|
|
43
|
-
}
|
|
44
|
-
static getDerivedStateFromError() {
|
|
45
|
-
return { failed: true };
|
|
46
|
-
}
|
|
47
|
-
componentDidCatch(error) {
|
|
48
|
-
this.props.ctx.reportError(error);
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
return this.state.failed ? null : this.props.children;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
40
|
function reactRemote(Component) {
|
|
41
|
+
const start = (el, props, ctx, hydrate) => {
|
|
42
|
+
const tree = (p) => /* @__PURE__ */ jsx(RemoteTree, { Component, props: p, ctx });
|
|
43
|
+
const options = { onUncaughtError: (e) => ctx.reportError(e) };
|
|
44
|
+
const root = hydrate ? hydrateRoot(el, tree(props), options) : createRoot(el, options);
|
|
45
|
+
const render = (p) => root.render(tree(p));
|
|
46
|
+
if (!hydrate) render(props);
|
|
47
|
+
return { update: render, unmount: () => root.unmount() };
|
|
48
|
+
};
|
|
55
49
|
return defineRemote({
|
|
56
|
-
mount(el, props, ctx)
|
|
57
|
-
|
|
58
|
-
const render = (p) => root.render(
|
|
59
|
-
/* @__PURE__ */ jsx(VitralContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(Boundary, { ctx, children: /* @__PURE__ */ jsx(Component, { ...p }) }) })
|
|
60
|
-
);
|
|
61
|
-
render(props);
|
|
62
|
-
return { update: render, unmount: () => root.unmount() };
|
|
63
|
-
}
|
|
50
|
+
mount: (el, props, ctx) => start(el, props, ctx, false),
|
|
51
|
+
hydrate: (el, props, ctx) => start(el, props, ctx, true)
|
|
64
52
|
});
|
|
65
53
|
}
|
|
66
54
|
function useVitral() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
splitName
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JBNITHPI.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyIntegrity
|
|
6
6
|
} from "./chunk-UYOPJ4XQ.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveEntry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S7PIVPBX.js";
|
|
10
10
|
import {
|
|
11
11
|
prefetchCss
|
|
12
12
|
} from "./chunk-KU6HF2EW.js";
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { R as Routes, a as RouteMatch } from './match-CMBM_jLW.js';
|
|
1
2
|
import { P as Props } from './types-DUtcF3HO.js';
|
|
2
3
|
import { S as SlotStatus } from './slot-D49L1rdU.js';
|
|
3
4
|
import './errors-kjBv6IH_.js';
|
|
4
5
|
|
|
5
|
-
/** Padrão de URL → nome do remote. A primeira rota que bate vence. */
|
|
6
|
-
type Routes = Record<string, string>;
|
|
7
6
|
interface RoutesOptions {
|
|
8
7
|
/**
|
|
9
8
|
* Links `<a href>` da mesma origem que batem com uma rota navegam sem
|
|
@@ -11,14 +10,6 @@ interface RoutesOptions {
|
|
|
11
10
|
*/
|
|
12
11
|
links?: boolean;
|
|
13
12
|
}
|
|
14
|
-
interface RouteMatch {
|
|
15
|
-
/** Nome do remote. */
|
|
16
|
-
name: string;
|
|
17
|
-
/** Padrão que bateu. */
|
|
18
|
-
pattern: string;
|
|
19
|
-
/** Segmentos `:nome` do padrão. */
|
|
20
|
-
params: Record<string, string>;
|
|
21
|
-
}
|
|
22
13
|
/**
|
|
23
14
|
* Remote da rota que bate com `path`, ou `null`. Padrões: `/conta` (exato),
|
|
24
15
|
* `/checkout/*` (o prefixo e tudo abaixo dele), `/produto/:id` e `*` (qualquer).
|
|
@@ -53,4 +44,4 @@ declare global {
|
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
export {
|
|
47
|
+
export { RouteMatch, Routes, type RoutesOptions, VitralOutletElement, defineVitralOutlet, matchRoute, routes };
|
package/dist/routes.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
matchRoute
|
|
3
|
+
} from "./chunk-OVVGVPIV.js";
|
|
1
4
|
import {
|
|
2
5
|
createSlot,
|
|
3
6
|
navigate
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import
|
|
7
|
+
} from "./chunk-HIVMSPGM.js";
|
|
8
|
+
import {
|
|
9
|
+
warmSsr
|
|
10
|
+
} from "./chunk-S7PIVPBX.js";
|
|
6
11
|
import "./chunk-KU6HF2EW.js";
|
|
7
12
|
import "./chunk-TW7KYJQ6.js";
|
|
8
13
|
import "./chunk-463H6B56.js";
|
|
@@ -11,21 +16,8 @@ import "./chunk-GNPFWISJ.js";
|
|
|
11
16
|
// src/routes.ts
|
|
12
17
|
var table = {};
|
|
13
18
|
var outlets = /* @__PURE__ */ new Set();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let re = compiled.get(pattern);
|
|
17
|
-
if (!re) {
|
|
18
|
-
const body = pattern.replace(/\/\*$|^\*$/, "\0").replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/:(\w+)/g, "(?<$1>[^/]+)").replace(/\/$/, "").replace("\0", "(?:/.*)?");
|
|
19
|
-
compiled.set(pattern, re = new RegExp(`^${body}/?$`));
|
|
20
|
-
}
|
|
21
|
-
return re;
|
|
22
|
-
}
|
|
23
|
-
function matchRoute(path, routes2 = table) {
|
|
24
|
-
for (const [pattern, name] of Object.entries(routes2)) {
|
|
25
|
-
const m = compile(pattern).exec(path);
|
|
26
|
-
if (m) return { name, pattern, params: { ...m.groups } };
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
19
|
+
function matchRoute2(path, routes2 = table) {
|
|
20
|
+
return matchRoute(path, routes2);
|
|
29
21
|
}
|
|
30
22
|
function routes(map, options = {}) {
|
|
31
23
|
table = map;
|
|
@@ -44,7 +36,7 @@ function onClick(e) {
|
|
|
44
36
|
const a = e.composedPath().find((n) => n.localName === "a" && !!n.href);
|
|
45
37
|
if (!a || a.target && a.target !== "_self" || a.hasAttribute("download")) return;
|
|
46
38
|
const url = new URL(a.href);
|
|
47
|
-
if (url.origin !== location.origin || !
|
|
39
|
+
if (url.origin !== location.origin || !matchRoute2(url.pathname)) return;
|
|
48
40
|
e.preventDefault();
|
|
49
41
|
navigate(url.href);
|
|
50
42
|
}
|
|
@@ -99,7 +91,7 @@ var VitralOutletElement = class extends Base {
|
|
|
99
91
|
}
|
|
100
92
|
/** Confere a URL atual e troca de remote se a rota mudou. */
|
|
101
93
|
sync() {
|
|
102
|
-
if (this.isConnected) this.#show(
|
|
94
|
+
if (this.isConnected) this.#show(matchRoute2(location.pathname)?.name ?? null);
|
|
103
95
|
}
|
|
104
96
|
#show(name) {
|
|
105
97
|
if (name === this.#route) return;
|
|
@@ -113,12 +105,24 @@ var VitralOutletElement = class extends Base {
|
|
|
113
105
|
} else if (this.#slot) {
|
|
114
106
|
this.#slot.set({ name });
|
|
115
107
|
} else {
|
|
116
|
-
|
|
108
|
+
const options = {
|
|
117
109
|
name,
|
|
118
110
|
props: this.#props,
|
|
119
111
|
isolate: this.getAttribute("isolate") || void 0,
|
|
120
112
|
onStatus: (s, e) => this.#status(s, e)
|
|
121
|
-
}
|
|
113
|
+
};
|
|
114
|
+
const ssr = this.querySelector(":scope>[data-vitral-ssr]");
|
|
115
|
+
if (ssr?.getAttribute("data-vitral-slot") === name) {
|
|
116
|
+
this.#status("loading", null);
|
|
117
|
+
warmSsr(ssr);
|
|
118
|
+
import("./hydrate-R76V2I36.js").then((m) => {
|
|
119
|
+
if (this.#route === name && !this.#slot) this.#slot = m.hydrateSlot(this, ssr, { ...options, props: this.#props });
|
|
120
|
+
else ssr.remove();
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
ssr?.remove();
|
|
125
|
+
this.#slot = createSlot(this, options);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
128
|
#status(status, error) {
|
|
@@ -139,6 +143,6 @@ function defineVitralOutlet(tag = "vitral-outlet") {
|
|
|
139
143
|
export {
|
|
140
144
|
VitralOutletElement,
|
|
141
145
|
defineVitralOutlet,
|
|
142
|
-
matchRoute,
|
|
146
|
+
matchRoute2 as matchRoute,
|
|
143
147
|
routes
|
|
144
148
|
};
|
package/dist/solid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXLKRSOM.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRemote,
|
|
6
6
|
events,
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
navigate,
|
|
9
9
|
same,
|
|
10
10
|
shared
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-HIVMSPGM.js";
|
|
12
|
+
import "./chunk-S7PIVPBX.js";
|
|
13
13
|
import "./chunk-KU6HF2EW.js";
|
|
14
14
|
import "./chunk-TW7KYJQ6.js";
|
|
15
15
|
import "./chunk-463H6B56.js";
|
package/dist/svelte.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXLKRSOM.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRemote,
|
|
6
6
|
events,
|
|
7
7
|
navigate
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-HIVMSPGM.js";
|
|
9
|
+
import "./chunk-S7PIVPBX.js";
|
|
10
10
|
import "./chunk-KU6HF2EW.js";
|
|
11
11
|
import "./chunk-TW7KYJQ6.js";
|
|
12
12
|
import "./chunk-463H6B56.js";
|
package/dist/testing.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
harness,
|
|
5
5
|
verify
|
|
6
6
|
} from "./chunk-DAESKNQ6.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-HIVMSPGM.js";
|
|
8
8
|
import {
|
|
9
9
|
register
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-S7PIVPBX.js";
|
|
11
11
|
import "./chunk-KU6HF2EW.js";
|
|
12
12
|
import "./chunk-TW7KYJQ6.js";
|
|
13
13
|
import "./chunk-463H6B56.js";
|
package/dist/vue.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostSlot,
|
|
3
3
|
timings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UXLKRSOM.js";
|
|
5
5
|
import {
|
|
6
6
|
defineRemote,
|
|
7
7
|
events,
|
|
8
8
|
memoSelect,
|
|
9
9
|
same,
|
|
10
10
|
shared
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-HIVMSPGM.js";
|
|
12
|
+
import "./chunk-S7PIVPBX.js";
|
|
13
13
|
import "./chunk-KU6HF2EW.js";
|
|
14
14
|
import {
|
|
15
15
|
absolute
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitral",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Micro-frontends sem burocracia: um contrato mount/unmount, carregamento em runtime e adaptadores para React, Next, Vue, Nuxt, Angular, Svelte, Solid, Preact, Lit e JS/TS puro.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"micro-frontend",
|
|
@@ -84,6 +84,10 @@
|
|
|
84
84
|
"types": "./dist/react.d.ts",
|
|
85
85
|
"import": "./dist/react.js"
|
|
86
86
|
},
|
|
87
|
+
"./react-server": {
|
|
88
|
+
"types": "./dist/react-server.d.ts",
|
|
89
|
+
"import": "./dist/react-server.js"
|
|
90
|
+
},
|
|
87
91
|
"./vue": {
|
|
88
92
|
"types": "./dist/vue.d.ts",
|
|
89
93
|
"import": "./dist/vue.js"
|
|
@@ -417,7 +421,7 @@
|
|
|
417
421
|
{
|
|
418
422
|
"name": "auto",
|
|
419
423
|
"path": "dist/auto.js",
|
|
420
|
-
"limit": "6.
|
|
424
|
+
"limit": "6.25 kB",
|
|
421
425
|
"ignore": [
|
|
422
426
|
"./shadow-*",
|
|
423
427
|
"./reframe-*",
|
|
@@ -435,7 +439,7 @@
|
|
|
435
439
|
"name": "routes",
|
|
436
440
|
"path": "dist/routes.js",
|
|
437
441
|
"import": "{ routes }",
|
|
438
|
-
"limit": "9.
|
|
442
|
+
"limit": "9.3 kB",
|
|
439
443
|
"ignore": [
|
|
440
444
|
"./overrides-*",
|
|
441
445
|
"./channel-*",
|