@atom.io/spa 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -25
- package/README.mdx +62 -15
- package/dist/astro-application.d.ts +1 -1
- package/dist/astro-client.d.ts +1 -1
- package/dist/astro-client.d.ts.map +1 -1
- package/dist/astro-client.js +5 -4
- package/dist/astro-client.js.map +1 -1
- package/dist/astro-resumability-client.d.ts +1 -1
- package/dist/astro-server.js +4 -4
- package/dist/astro-server.js.map +1 -1
- package/dist/{astro-shared-83hxw7-M.js → astro-shared-DBwINQav.js} +2 -2
- package/dist/{astro-shared-83hxw7-M.js.map → astro-shared-DBwINQav.js.map} +1 -1
- package/dist/{astro-shared-DZp1x8RQ.d.ts → astro-shared-KxK9OUSj.d.ts} +2 -2
- package/dist/{astro-shared-DZp1x8RQ.d.ts.map → astro-shared-KxK9OUSj.d.ts.map} +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +1 -1
- package/dist/{capabilities-DNcnGRv_.d.ts → capabilities-ChgSs6bp.d.ts} +34 -6
- package/dist/capabilities-ChgSs6bp.d.ts.map +1 -0
- package/dist/client.min.js +1 -1
- package/dist/core-DD2giR6E.js +451 -0
- package/dist/core-DD2giR6E.js.map +1 -0
- package/dist/development/astro-client.js +5 -4
- package/dist/development/astro-client.js.map +1 -1
- package/dist/development/astro-server.js +4 -4
- package/dist/development/astro-server.js.map +1 -1
- package/dist/development/{astro-shared-83hxw7-M.js → astro-shared-DBwINQav.js} +2 -2
- package/dist/development/{astro-shared-83hxw7-M.js.map → astro-shared-DBwINQav.js.map} +1 -1
- package/dist/development/astro.js +1 -1
- package/dist/development/core-DrUd8x25.js +465 -0
- package/dist/development/core-DrUd8x25.js.map +1 -0
- package/dist/development/{dom-DQ0M3rLL.js → dom-BRFv7FP_.js} +150 -35
- package/dist/development/dom-BRFv7FP_.js.map +1 -0
- package/dist/development/floating.js +2 -6
- package/dist/development/floating.js.map +1 -1
- package/dist/development/hot.js +164 -0
- package/dist/development/hot.js.map +1 -0
- package/dist/development/identity-DwB8MTM1.js +121 -0
- package/dist/development/identity-DwB8MTM1.js.map +1 -0
- package/dist/development/index.js +5 -5
- package/dist/development/jsx-runtime-BGDPK50B.js +49 -0
- package/dist/development/jsx-runtime-BGDPK50B.js.map +1 -0
- package/dist/development/jsx-runtime.js +1 -25
- package/dist/development/konva.js +12 -5
- package/dist/development/konva.js.map +1 -1
- package/dist/development/motion.js +3 -20
- package/dist/development/motion.js.map +1 -1
- package/dist/development/renderer.js +41 -40
- package/dist/development/renderer.js.map +1 -1
- package/dist/development/{server-renderer-DCLoMdOX.js → server-renderer-u1-c5PGd.js} +8 -18
- package/dist/development/server-renderer-u1-c5PGd.js.map +1 -0
- package/dist/development/server.js +1 -1
- package/dist/{src-Bme1kz2b.js → development/src-CB7ruwRs.js} +3 -3
- package/dist/development/src-CB7ruwRs.js.map +1 -0
- package/dist/development/three.js +20 -19
- package/dist/development/three.js.map +1 -1
- package/dist/development/vite-WUiz1ju6.js +545 -0
- package/dist/development/vite-WUiz1ju6.js.map +1 -0
- package/dist/development/vite.js +1 -1
- package/dist/{dom-D8g3roX9.js → dom--HZvmgqd.js} +139 -32
- package/dist/dom--HZvmgqd.js.map +1 -0
- package/dist/floating.d.ts +1 -1
- package/dist/floating.d.ts.map +1 -1
- package/dist/floating.js +2 -6
- package/dist/floating.js.map +1 -1
- package/dist/hot.d.ts +15 -0
- package/dist/hot.d.ts.map +1 -0
- package/dist/hot.js +19 -0
- package/dist/hot.js.map +1 -0
- package/dist/identity-oFU5p-Qj.js +121 -0
- package/dist/identity-oFU5p-Qj.js.map +1 -0
- package/dist/{index-BFnXIfOj.d.ts → index-DdA39aMv.d.ts} +4 -4
- package/dist/{index-BFnXIfOj.d.ts.map → index-DdA39aMv.d.ts.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/jsx-runtime-BGDPK50B.js +49 -0
- package/dist/jsx-runtime-BGDPK50B.js.map +1 -0
- package/dist/{jsx-runtime-DQnpyT_g.d.ts → jsx-runtime-CCvcEosg.d.ts} +14 -9
- package/dist/jsx-runtime-CCvcEosg.d.ts.map +1 -0
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -25
- package/dist/konva.d.ts +46 -9
- package/dist/konva.d.ts.map +1 -1
- package/dist/konva.js +12 -5
- package/dist/konva.js.map +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +3 -20
- package/dist/motion.js.map +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +39 -40
- package/dist/renderer.js.map +1 -1
- package/dist/{server-renderer-D0rsFL_-.js → server-renderer-BYFDmqnM.js} +8 -18
- package/dist/server-renderer-BYFDmqnM.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/size.json +12 -12
- package/dist/{development/src-DoQgCX-O.js → src-B2W_TA_X.js} +3 -3
- package/dist/src-B2W_TA_X.js.map +1 -0
- package/dist/three.d.ts +3 -3
- package/dist/three.d.ts.map +1 -1
- package/dist/three.js +20 -19
- package/dist/three.js.map +1 -1
- package/dist/vite-WUiz1ju6.js +545 -0
- package/dist/vite-WUiz1ju6.js.map +1 -0
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +1 -1
- package/package.json +16 -9
- package/src/astro-client.ts +3 -2
- package/src/astro-server.ts +2 -2
- package/src/capabilities.ts +48 -21
- package/src/compiler-hmr.ts +297 -0
- package/src/compiler.ts +127 -25
- package/src/core.ts +282 -33
- package/src/dom-forms.ts +127 -0
- package/src/dom.ts +116 -52
- package/src/floating.ts +2 -6
- package/src/hot.ts +190 -0
- package/src/identity.ts +39 -0
- package/src/index.ts +2 -0
- package/src/jsx-runtime.ts +6 -26
- package/src/jsx-types.d.ts +8 -3
- package/src/konva.ts +66 -10
- package/src/presence.ts +11 -23
- package/src/props.ts +55 -0
- package/src/renderer.ts +91 -71
- package/src/server-renderer.ts +18 -13
- package/src/three.ts +23 -24
- package/src/use-loadable.ts +2 -2
- package/src/vite.ts +44 -4
- package/dist/capabilities-DNcnGRv_.d.ts.map +0 -1
- package/dist/capabilities-nOIitQ-_.js +0 -65
- package/dist/capabilities-nOIitQ-_.js.map +0 -1
- package/dist/core-B4rJ0xdc.js +0 -268
- package/dist/core-B4rJ0xdc.js.map +0 -1
- package/dist/development/capabilities-nOIitQ-_.js +0 -65
- package/dist/development/capabilities-nOIitQ-_.js.map +0 -1
- package/dist/development/core-BHA7I1nf.js +0 -271
- package/dist/development/core-BHA7I1nf.js.map +0 -1
- package/dist/development/dom-DQ0M3rLL.js.map +0 -1
- package/dist/development/jsx-runtime.js.map +0 -1
- package/dist/development/server-renderer-DCLoMdOX.js.map +0 -1
- package/dist/development/src-DoQgCX-O.js.map +0 -1
- package/dist/development/vite-Bmyb6P5w.js +0 -265
- package/dist/development/vite-Bmyb6P5w.js.map +0 -1
- package/dist/dom-D8g3roX9.js.map +0 -1
- package/dist/jsx-runtime-DQnpyT_g.d.ts.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/server-renderer-D0rsFL_-.js.map +0 -1
- package/dist/src-Bme1kz2b.js.map +0 -1
- package/dist/vite-Bmyb6P5w.js +0 -265
- package/dist/vite-Bmyb6P5w.js.map +0 -1
package/dist/astro-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as failPreparation, r as storeContext } from "./astro-context-OdlexHR4.js";
|
|
2
2
|
import { t as requestApplication } from "./astro-request-DRKvDjsO.js";
|
|
3
|
-
import { n as islandStore, t as island } from "./astro-shared-
|
|
4
|
-
import { t as renderToStringWithReads } from "./server-renderer-
|
|
3
|
+
import { n as islandStore, t as island } from "./astro-shared-DBwINQav.js";
|
|
4
|
+
import { t as renderToStringWithReads } from "./server-renderer-BYFDmqnM.js";
|
|
5
5
|
// src/astro-server.ts
|
|
6
6
|
const createRenderer = (awaitState = false) => ({
|
|
7
7
|
name: `spa`,
|
|
@@ -27,8 +27,8 @@ const createRenderer = (awaitState = false) => ({
|
|
|
27
27
|
lifetime.context.signal.throwIfAborted();
|
|
28
28
|
const reads = /* @__PURE__ */ new Map();
|
|
29
29
|
const pending = /* @__PURE__ */ new Set();
|
|
30
|
-
const html = renderToStringWithReads(() => () => island(component, props, slots), options, awaitState ? (value, token) => {
|
|
31
|
-
reads.set(token.key, token);
|
|
30
|
+
const html = renderToStringWithReads(() => () => island(component, props, slots), options, awaitState ? (value, token, readStore) => {
|
|
31
|
+
if (readStore === store) reads.set(token.key, token);
|
|
32
32
|
if (value instanceof Promise) pending.add(value);
|
|
33
33
|
} : void 0);
|
|
34
34
|
if (!pending.size) return {
|
package/dist/astro-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-server.js","names":[],"sources":["../src/astro-server.ts"],"sourcesContent":["/* oxlint-disable typescript/require-await -- Astro requires async renderer callbacks, even for synchronous rendering. */\nimport type { NamedSSRLoadedRendererValue } from \"astro\"\nimport type { ReadableToken } from \"atom.io\"\n\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport { requestApplication } from \"./astro-request.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { renderToStringWithReads } from \"./server-renderer.ts\"\n\nexport const createRenderer = (\n\tawaitState = false,\n): NamedSSRLoadedRendererValue => ({\n\tname: `spa`,\n\tasync check(component: Island) {\n\t\treturn component?.spa === true\n\t},\n\tasync renderToStaticMarkup(component: Island, props, slots) {\n\t\tconst request = (this as unknown as { result?: { request: Request } }).result\n\t\t\t?.request\n\t\tconst requestOwner = request ? requestApplication(request) : undefined\n\t\tconst shared =\n\t\t\t!component.createStore && !component.isolate ? requestOwner : undefined\n\t\tconst lifetime = storeContext(undefined, shared?.application)\n\t\tif (requestOwner && !shared) {\n\t\t\tlifetime.context.onCleanup(\n\t\t\t\trequestOwner.application.onCleanup(lifetime.dispose),\n\t\t\t)\n\t\t}\n\t\ttry {\n\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\tconst store = await Promise.race([\n\t\t\t\tislandStore(component, props, lifetime.context, shared?.store),\n\t\t\t\tlifetime.cancelled,\n\t\t\t])\n\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\tconst options = {\n\t\t\t\tstore: store!,\n\t\t\t\tidPrefix: crypto.randomUUID(),\n\t\t\t\tcapabilities: component.capabilities ?? [],\n\t\t\t}\n\t\t\t// Retry only after reads made by this view settle. Each discarded render\n\t\t\t// releases its scopes; conditional branches can discover more async state.\n\t\t\tfor (;;) {\n\t\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\t\tconst reads = new Map<string, ReadableToken<unknown>>()\n\t\t\t\tconst pending = new Set<Promise<unknown>>()\n\t\t\t\tconst html = renderToStringWithReads(\n\t\t\t\t\t() => () => island(component, props, slots),\n\t\t\t\t\toptions,\n\t\t\t\t\tawaitState\n\t\t\t\t\t\t? (value, token) => {\n\t\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"astro-server.js","names":[],"sources":["../src/astro-server.ts"],"sourcesContent":["/* oxlint-disable typescript/require-await -- Astro requires async renderer callbacks, even for synchronous rendering. */\nimport type { NamedSSRLoadedRendererValue } from \"astro\"\nimport type { ReadableToken } from \"atom.io\"\n\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport { requestApplication } from \"./astro-request.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { renderToStringWithReads } from \"./server-renderer.ts\"\n\nexport const createRenderer = (\n\tawaitState = false,\n): NamedSSRLoadedRendererValue => ({\n\tname: `spa`,\n\tasync check(component: Island) {\n\t\treturn component?.spa === true\n\t},\n\tasync renderToStaticMarkup(component: Island, props, slots) {\n\t\tconst request = (this as unknown as { result?: { request: Request } }).result\n\t\t\t?.request\n\t\tconst requestOwner = request ? requestApplication(request) : undefined\n\t\tconst shared =\n\t\t\t!component.createStore && !component.isolate ? requestOwner : undefined\n\t\tconst lifetime = storeContext(undefined, shared?.application)\n\t\tif (requestOwner && !shared) {\n\t\t\tlifetime.context.onCleanup(\n\t\t\t\trequestOwner.application.onCleanup(lifetime.dispose),\n\t\t\t)\n\t\t}\n\t\ttry {\n\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\tconst store = await Promise.race([\n\t\t\t\tislandStore(component, props, lifetime.context, shared?.store),\n\t\t\t\tlifetime.cancelled,\n\t\t\t])\n\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\tconst options = {\n\t\t\t\tstore: store!,\n\t\t\t\tidPrefix: crypto.randomUUID(),\n\t\t\t\tcapabilities: component.capabilities ?? [],\n\t\t\t}\n\t\t\t// Retry only after reads made by this view settle. Each discarded render\n\t\t\t// releases its scopes; conditional branches can discover more async state.\n\t\t\tfor (;;) {\n\t\t\t\tlifetime.context.signal.throwIfAborted()\n\t\t\t\tconst reads = new Map<string, ReadableToken<unknown>>()\n\t\t\t\tconst pending = new Set<Promise<unknown>>()\n\t\t\t\tconst html = renderToStringWithReads(\n\t\t\t\t\t() => () => island(component, props, slots),\n\t\t\t\t\toptions,\n\t\t\t\t\tawaitState\n\t\t\t\t\t\t? (value, token, readStore) => {\n\t\t\t\t\t\t\t\tif (readStore === store) reads.set(token.key, token)\n\t\t\t\t\t\t\t\tif (value instanceof Promise) {\n\t\t\t\t\t\t\t\t\tpending.add(value)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t)\n\t\t\t\tif (!pending.size)\n\t\t\t\t\treturn {\n\t\t\t\t\t\thtml,\n\t\t\t\t\t\t// Even a cached synchronous server read can be async in the browser.\n\t\t\t\t\t\t...(reads.size\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\t\t\t\"data-spa-reads\": JSON.stringify([...reads.values()]),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}\n\t\t\t\t// Caught producer errors resolve as state values. An uncaught failure\n\t\t\t\t// must reject this render with its original error.\n\t\t\t\tawait Promise.race([Promise.all(pending), lifetime.cancelled])\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfailPreparation(error, lifetime.dispose)\n\t\t} finally {\n\t\t\tlifetime.dispose()\n\t\t}\n\t},\n})\nexport default createRenderer()\n"],"mappings":";;;;;AAUA,MAAa,kBACZ,aAAa,WACqB;CAClC,MAAM;CACN,MAAM,MAAM,WAAmB;EAC9B,OAAO,WAAW,QAAQ;CAC3B;CACA,MAAM,qBAAqB,WAAmB,OAAO,OAAO;EAC3D,MAAM,UAAW,KAAsD,QACpE;EACH,MAAM,eAAe,UAAU,mBAAmB,OAAO,IAAI,KAAA;EAC7D,MAAM,SACL,CAAC,UAAU,eAAe,CAAC,UAAU,UAAU,eAAe,KAAA;EAC/D,MAAM,WAAW,aAAa,KAAA,GAAW,QAAQ,WAAW;EAC5D,IAAI,gBAAgB,CAAC,QACpB,SAAS,QAAQ,UAChB,aAAa,YAAY,UAAU,SAAS,OAAO,CACpD;EAED,IAAI;GACH,SAAS,QAAQ,OAAO,eAAe;GACvC,MAAM,QAAQ,MAAM,QAAQ,KAAK,CAChC,YAAY,WAAW,OAAO,SAAS,SAAS,QAAQ,KAAK,GAC7D,SAAS,SACV,CAAC;GACD,SAAS,QAAQ,OAAO,eAAe;GACvC,MAAM,UAAU;IACR;IACP,UAAU,OAAO,WAAW;IAC5B,cAAc,UAAU,gBAAgB,CAAC;GAC1C;GAGA,SAAS;IACR,SAAS,QAAQ,OAAO,eAAe;IACvC,MAAM,wBAAQ,IAAI,IAAoC;IACtD,MAAM,0BAAU,IAAI,IAAsB;IAC1C,MAAM,OAAO,oCACA,OAAO,WAAW,OAAO,KAAK,GAC1C,SACA,cACI,OAAO,OAAO,cAAc;KAC7B,IAAI,cAAc,OAAO,MAAM,IAAI,MAAM,KAAK,KAAK;KACnD,IAAI,iBAAiB,SACpB,QAAQ,IAAI,KAAK;IAEnB,IACC,KAAA,CACJ;IACA,IAAI,CAAC,QAAQ,MACZ,OAAO;KACN;KAEA,GAAI,MAAM,OACP,EACA,OAAO,EACN,kBAAkB,KAAK,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,EACrD,EACD,IACC,CAAC;IACL;IAGD,MAAM,QAAQ,KAAK,CAAC,QAAQ,IAAI,OAAO,GAAG,SAAS,SAAS,CAAC;GAC9D;EACD,SAAS,OAAO;GACf,gBAAgB,OAAO,SAAS,OAAO;EACxC,UAAU;GACT,SAAS,QAAQ;EAClB;CACD;AACD;AACA,IAAA,uBAAe,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "./jsx-runtime.js";
|
|
1
|
+
import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
|
|
2
2
|
import { IMPLICIT, Store } from "atom.io/internal";
|
|
3
3
|
// src/astro-shared.ts
|
|
4
4
|
async function islandStore(component, props, context, shared, prepare) {
|
|
@@ -28,4 +28,4 @@ function island(component, props, slots) {
|
|
|
28
28
|
}
|
|
29
29
|
export { islandStore as n, island as t };
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=astro-shared-
|
|
31
|
+
//# sourceMappingURL=astro-shared-DBwINQav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-shared-
|
|
1
|
+
{"version":3,"file":"astro-shared-DBwINQav.js","names":[],"sources":["../src/astro-shared.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type { Component, SpaElement } from \"./core.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\n\nexport interface AstroApplicationContext {\n\t/** Whether the application still represents its initial server snapshot. */\n\treadonly canResume: boolean\n\treadonly signal: AbortSignal\n\tonCleanup(cleanup: () => void): void\n\t/** Initialize a resource once for this application lifetime. */\n\tget<T>(key: unknown, initialize: () => T): T\n}\nexport interface AstroStoreContext {\n\t/** Shared across default islands; private for explicitly isolated islands. */\n\tapplication: AstroApplicationContext\n\t/** The browser island host; undefined during server rendering. */\n\telement: HTMLElement | undefined\n\t/** Aborted when preparation is cancelled or the island is released. */\n\tsignal: AbortSignal\n\t/** Release resources even if preparation or rendering fails. */\n\tonCleanup(cleanup: () => void): void\n}\nexport type AstroStoreFactory<P = Record<string, any>> = (\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => RootStore | Promise<RootStore>\nexport type AstroStorePreparation<P = Record<string, any>> = (\n\tstore: RootStore,\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => void | Promise<void>\nexport type Island<P = any> = Component<P> & {\n\tspa?: boolean\n\t/** Capabilities are scoped to this island root on the server and client. */\n\tcapabilities?: readonly Capability[]\n\t/** Opt into a private island store instead of the shared application store. */\n\tisolate?: boolean\n\tcreateStore?: AstroStoreFactory<P>\n\tprepareStore?: AstroStorePreparation<P>\n}\nexport async function islandStore(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tcontext: AstroStoreContext,\n\tshared?: RootStore,\n\tprepare?: AstroStorePreparation,\n): Promise<RootStore> {\n\tconst store = await (component.createStore?.(props, context) ??\n\t\tshared ??\n\t\t(new Store(\n\t\t\t{ name: `spa-island`, lifespan: `ephemeral`, isProduction: true },\n\t\t\tIMPLICIT.STORE,\n\t\t) as RootStore))\n\tcontext.signal.throwIfAborted()\n\tawait prepare?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\tawait component.prepareStore?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\treturn store\n}\nexport function island(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tslots: Record<string, string>,\n): SpaElement {\n\tconst children = Object.fromEntries(\n\t\tObject.entries(slots).map(([name, html]) => [\n\t\t\tname,\n\t\t\tjsx(`astro-slot`, {\n\t\t\t\tkey: html,\n\t\t\t\tname: name === `default` ? undefined : name,\n\t\t\t\tinnerHTML: html,\n\t\t\t}),\n\t\t]),\n\t)\n\treturn jsx(component, {\n\t\t...props,\n\t\tslots: children,\n\t\tchildren: children[`default`],\n\t})\n}\n"],"mappings":";;;AA2CA,eAAsB,YACrB,WACA,OACA,SACA,QACA,SACqB;CACrB,MAAM,QAAQ,OAAO,UAAU,cAAc,OAAO,OAAO,KAC1D,UACC,IAAI,MACJ;EAAE,MAAM;EAAc,UAAU;EAAa,cAAc;CAAK,GAChE,SAAS,KACV;CACD,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,OAAO,OAAO,OAAO;CACrC,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACa;CACb,MAAM,WAAW,OAAO,YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAC3C,MACA,IAAI,cAAc;EACjB,KAAK;EACL,MAAM,SAAS,YAAY,KAAA,IAAY;EACvC,WAAW;CACZ,CAAC,CACF,CAAC,CACF;CACA,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,OAAO;EACP,UAAU,SAAS;CACpB,CAAC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Component, t as Capability } from "./capabilities-
|
|
1
|
+
import { o as Component, t as Capability } from "./capabilities-ChgSs6bp.js";
|
|
2
2
|
import { RootStore } from "atom.io/internal";
|
|
3
3
|
interface AstroApplicationContext {
|
|
4
4
|
/** Whether the application still represents its initial server snapshot. */
|
|
@@ -30,4 +30,4 @@ type Island<P = any> = Component<P> & {
|
|
|
30
30
|
prepareStore?: AstroStorePreparation<P>;
|
|
31
31
|
};
|
|
32
32
|
export { Island as a, AstroStorePreparation as i, AstroStoreContext as n, AstroStoreFactory as r, AstroApplicationContext as t };
|
|
33
|
-
//# sourceMappingURL=astro-shared-
|
|
33
|
+
//# sourceMappingURL=astro-shared-KxK9OUSj.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-shared-
|
|
1
|
+
{"version":3,"file":"astro-shared-KxK9OUSj.d.ts","names":[],"sources":["../src/astro-shared.ts"],"mappings":";;UAOiB;;WAEP;WACA,QAAQ;EACjB,UAAU;;EAEV,IAAI,GAAG,cAAc,kBAAkB,IAAI;;UAE3B;;EAEhB,aAAa;;EAEb,SAAS;;EAET,QAAQ;;EAER,UAAU;;KAEC,kBAAkB,IAAI,wBACjC,OAAO,GACP,SAAS,sBACL,YAAY,QAAQ;KACb,sBAAsB,IAAI,wBACrC,OAAO,WACP,OAAO,GACP,SAAS,6BACE;KACA,OAAO,WAAW,UAAU;EACvC;;EAEA,wBAAwB;;EAExB;EACA,cAAc,kBAAkB;EAChC,eAAe,sBAAsB"}
|
package/dist/astro.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpaPluginOptions } from "./vite.js";
|
|
2
|
-
import { a as Island, i as AstroStorePreparation, n as AstroStoreContext, r as AstroStoreFactory, t as AstroApplicationContext } from "./astro-shared-
|
|
2
|
+
import { a as Island, i as AstroStorePreparation, n as AstroStoreContext, r as AstroStoreFactory, t as AstroApplicationContext } from "./astro-shared-KxK9OUSj.js";
|
|
3
3
|
import { AstroIntegration } from "astro";
|
|
4
4
|
export default function integration(options?: SpaPluginOptions): AstroIntegration;
|
|
5
5
|
export type { AstroApplicationContext, AstroStoreContext, AstroStoreFactory, AstroStorePreparation, Island };
|
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootStore } from "atom.io/internal";
|
|
2
|
-
import { ReadableFamilyToken, ReadableToken, RegularAtomFamilyToken, RegularAtomToken, Setter, TimelineFamilyToken, TimelineManageable, TimelineToken, TransactionToken, ViewOf, WritableFamilyToken, WritableToken, disposeState } from "atom.io";
|
|
3
2
|
import { Canonical } from "atom.io/foundations/canonical";
|
|
3
|
+
import { ReadableFamilyToken, ReadableToken, RegularAtomFamilyToken, RegularAtomToken, Setter, TimelineFamilyToken, TimelineManageable, TimelineToken, TransactionToken, ViewOf, WritableFamilyToken, WritableToken, disposeState } from "atom.io";
|
|
4
4
|
interface ExitHandle {
|
|
5
5
|
finished: Promise<void>;
|
|
6
6
|
cancel(): void;
|
|
@@ -24,7 +24,6 @@ interface PresenceCoordinator {
|
|
|
24
24
|
target(scope: Scope, target: PresenceTarget): void;
|
|
25
25
|
bind(scope: Scope, binding: CapabilityBinding, read: () => Record<string, unknown>, namespace: string): void;
|
|
26
26
|
unbind(binding: CapabilityBinding): void;
|
|
27
|
-
event(scope: Scope, handler: Function): Function;
|
|
28
27
|
remove(scope: Scope, done: Cleanup): boolean;
|
|
29
28
|
resume(scope: Scope): void;
|
|
30
29
|
forget(scope: Scope): void;
|
|
@@ -47,34 +46,63 @@ interface RootOptions {
|
|
|
47
46
|
idPrefix?: string;
|
|
48
47
|
onError?: (error: unknown) => void;
|
|
49
48
|
}
|
|
49
|
+
interface BoundaryOptions extends Omit<RootOptions, `capabilities`> {
|
|
50
|
+
_capabilities?: Map<string, Capability>;
|
|
51
|
+
}
|
|
50
52
|
interface Scope {
|
|
51
53
|
_exiting?: boolean;
|
|
52
54
|
_exits?: Set<ExitParticipant>;
|
|
53
55
|
_targets?: Set<PresenceTarget>;
|
|
54
56
|
_root: Root;
|
|
55
57
|
_parent?: Scope | undefined;
|
|
58
|
+
_options?: BoundaryOptions | undefined;
|
|
59
|
+
_setupOrder: number;
|
|
56
60
|
_cleanups: Set<Cleanup | Scope>;
|
|
57
61
|
_updates: Cleanup[];
|
|
58
62
|
_dead: boolean;
|
|
59
63
|
}
|
|
60
64
|
interface Root extends Scope {
|
|
61
|
-
_onRead?: ((value: unknown, token: ReadableToken<unknown
|
|
65
|
+
_onRead?: ((value: unknown, token: ReadableToken<unknown>, store: RootStore) => void) | undefined;
|
|
62
66
|
_presence?: PresenceCoordinator;
|
|
67
|
+
_presenceFactory?: Capability[`presence`];
|
|
63
68
|
_capabilities: Map<string, Capability>;
|
|
69
|
+
_boundaryCapabilities?: Map<Capability, number>;
|
|
70
|
+
_prepareCapability?: ((capability: Capability) => void) | undefined;
|
|
71
|
+
_failure?: {
|
|
72
|
+
error: unknown;
|
|
73
|
+
report: Root[`error`];
|
|
74
|
+
} | undefined;
|
|
64
75
|
_store: RootStore;
|
|
65
76
|
_prefix: string;
|
|
66
77
|
_id: number;
|
|
67
78
|
_queue: Set<Cleanup>;
|
|
79
|
+
_enqueueCount?: number;
|
|
68
80
|
_mounts: Cleanup[] | undefined;
|
|
81
|
+
_commits?: Set<CommitJob>;
|
|
82
|
+
_flushing?: boolean;
|
|
83
|
+
_forms?: Set<() => boolean>;
|
|
84
|
+
_host?: Element;
|
|
69
85
|
flush: Cleanup;
|
|
70
86
|
error: (error: unknown) => void;
|
|
71
87
|
}
|
|
72
|
-
|
|
88
|
+
interface CommitJob {
|
|
89
|
+
scope: Scope;
|
|
90
|
+
order: number;
|
|
91
|
+
run: Cleanup;
|
|
92
|
+
loopError: Error | undefined;
|
|
93
|
+
}
|
|
94
|
+
/** Override root options for these children while sharing their parent's ownership. */
|
|
95
|
+
declare function RootBoundary(props: RootOptions & {
|
|
96
|
+
children?: Children;
|
|
97
|
+
}): Children;
|
|
98
|
+
/** Return the atom.io store selected by the current owner. */
|
|
73
99
|
declare function useStore(): RootStore;
|
|
74
100
|
/** Return atom.io disposal bound to the current root's store. */
|
|
75
101
|
declare function useDisposal(): typeof disposeState;
|
|
76
102
|
declare function onCleanup(cleanup: Cleanup): void;
|
|
77
103
|
declare function onMount(run: Cleanup): void;
|
|
104
|
+
/** Observe state during setup and apply changes after the root's writes. */
|
|
105
|
+
declare function onCommit<T>(read: Accessor<T>, apply: (value: T, previous: T | undefined) => void | Cleanup): void;
|
|
78
106
|
declare function useId(): string;
|
|
79
107
|
/** Capture a token for this instance. Change the component key to change its token. */
|
|
80
108
|
declare function useGetter<T, E = never>(token: ReadableToken<T, any, E>): Accessor<ViewOf<T | E>>;
|
|
@@ -122,5 +150,5 @@ interface Capability {
|
|
|
122
150
|
/** SPA supplies ownership for integrations that measure after mount or report async errors. */
|
|
123
151
|
attach(target: CapabilityTarget, scope?: Scope): CapabilityBinding;
|
|
124
152
|
}
|
|
125
|
-
export {
|
|
126
|
-
//# sourceMappingURL=capabilities-
|
|
153
|
+
export { useTransaction as S, useId as _, Children as a, useStore as b, RootBoundary as c, TimelineControls as d, onCleanup as f, useGetter as g, useDisposal as h, Accessor as i, RootOptions as l, onMount as m, CapabilityBinding as n, Component as o, onCommit as p, CapabilityTarget as r, Root as s, Capability as t, SpaElement as u, useRef as v, useTimeline as x, useSetter as y };
|
|
154
|
+
//# sourceMappingURL=capabilities-ChgSs6bp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities-ChgSs6bp.d.ts","names":[],"sources":["../src/presence.ts","../src/core.ts","../src/capabilities.ts"],"mappings":";;;UAUiB;EAChB,UAAU;EACV;;UAEgB;EAChB,QAAQ;EACR;;UAEgB;EAChB;EACA;EACA,YAAY;;UAEI,mBAAmB,GAAG;EACtC,KAAK,cAAc,OAAO,IAAI;EAC9B,OACC,QAAQ,GACR,cACA,mBACA,eACA,MAAM;EAEP,MAAM,SAAS,MAAM;;UAEL;EAChB,WAAW,GAAG,GACb,QAAQ,QAAQ,MAAM,OACtB,aAAa,QAAQ,GAAG,OAAO,gBAC7B,mBAAmB,GAAG;EACzB,OAAO,OAAO,OAAO,QAAQ;EAC7B,KACC,OAAO,OACP,SAAS,mBACT,YAAY,yBACZ;EAED,OAAO,SAAS;EAChB,OAAO,OAAO,OAAO,MAAM;EAC3B,OAAO,OAAO;EACd,OAAO,OAAO;;KCRH;UAGK,SAAS;MACrB;;KAGO,UAAU,YAAY,OAAO,MAAM;;UAE9B;EAChB,eAAe;EACf,OAAO;;;KAGI,WACT,8EAOS,aACT,SAAS;UACK;EAChB,wBAAwB;EACxB,QAAQ;EACR;EACA,WAAW;;UAEF,wBAAwB,KAAK;EACtC,gBAAgB,YAAY;;UAEZ;EAChB;EACA,SAAS,IAAI;EACb,WAAW,IAAI;EACf,OAAO;EACP,UAAU;EACV,WAAW;EACX;EACA,WAAW,IAAI,UAAU;EACzB,UAAU;EACV;;UAEgB,aAAa;EAC7B,YACK,gBAAgB,OAAO,wBAAwB,OAAO;EAE3D,YAAY;EACZ,mBAAmB;EACnB,eAAe,YAAY;EAC3B,wBAAwB,IAAI;EAC5B,uBAAuB,YAAY;EACnC;IAAa;IAAgB,QAAQ;;EACrC,QAAQ;EACR;EACA;EACA,QAAQ,IAAI;EACZ;EACA,SAAS;EACT,WAAW,IAAI;EACf;EACA,SAAS;EACT,QAAQ;EACR,OAAO;EACP,QAAQ;;UAGC;EACT,OAAO;EACP;EACA,KAAK;EACL,WAAW;;;iBAkMI,aACf,OAAO;EAAgB,WAAW;IAChC;;iBAkHa,YAAY;;iBAIZ,sBAAsB;iBAGtB,UAAU,SAAS;iBAGnB,QAAQ,KAAK;;iBAUb,SAAS,GACxB,MAAM,SAAS,IACf,QAAQ,OAAO,GAAG,UAAU,yBAAyB;iBA8CtC;;iBAyDA,UAAU,GAAG,WAC5B,OAAO,cAAc,QAAQ,KAC3B,SAAS,OAAO,IAAI;iBACP,UAAU,GAAG,UAAU,WAAW,WACjD,QAAQ,oBAAoB,GAAG,GAAG,IAClC,KAAK,QAAQ,KACX,SAAS,OAAO,IAAI;iBAcP,UAAU,GACzB,OAAO,cAAc,gBAClB,OAAO,IAAI,OAAO;iBACN,UAAU,GAAG,UAAU,WACtC,QAAQ,oBAAoB,GAAG,SAC/B,KAAK,QAAQ,MACV,OAAO,IAAI,OAAO;iBAQN,eAAe,cAAc,qBAC5C,OAAO,iBAAiB,SAClB,MAAM,WAAW,OAAO,WAAW;iBAK1B,OAAO,UAAU,SAChC,OAAO,iBAAiB,aACrB,SAAS;iBACG,OAAO,UAAU,SAAS,UAAU,WACnD,QAAQ,uBAAuB,UAAU,IACzC,KAAK,QAAQ,MACV,SAAS;UAuBI;EAChB;EACA;EACA;EACA;EACA;EACA;IAAoB,OAAO;IAAS,OAAO;;;iBAE5B,YAAY,UAAU,oBACrC,OAAO,cAAc,KACnB;iBACa,YAAY,UAAU,WAAW,UAAU,oBAC1D,QAAQ,oBAAoB,GAAG,IAC/B,KAAK,QAAQ,KACX;;UCpnBc;EAChB;EACA;EACA,YAAY;EACZ,MAAM;EACN,OAAO,aAAa;EACpB,QAAQ,eAAe,uBAAuB;;UAE9B;EAChB,MAAM,OAAO,0BAA0B;EACvC;;EAEA,OAAO,OAAO,yBAAyB;EACvC;;UAEgB;EAChB;;EAEA,cAAc,MAAM,OAAO;EAC3B,UAAU,MAAM,OAAO;EACvB,eAAe,WAAW,wBAAwB;;EAElD,OAAO,QAAQ,kBAAkB,QAAQ,QAAQ"}
|
package/dist/client.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IMPLICIT as e,actUponStore as t,clearTimelineInStore as n,disposeFromStore as r,findInStore as i,findTimelineInStore as a,getFromStore as o,getTimelineTransactionAtHead as s,setIntoStore as c,subscribeToState as l,subscribeToTimeline as u,timeTravel as d,timeTravelTransactionGroupInStore as f,withdraw as p,withdraw as m}from"atom.io/internal";var h,g,_=0;function v(e,t){let n=h;h=e;try{return t()}finally{h=n}}function y(e){let t=g;g=void 0;try{return e()}finally{g=t}}function b(e){let t={_root:e?._root,_parent:e,_cleanups:new Set,_updates:[],_dead:!1};return e?._cleanups.add(t),t}function x(e,t){try{S(e)}catch(e){throw AggregateError([t,e])}throw t}function S(e){if(e._dead)return;e._dead=!0;let t=[];try{e._root._presence?.forget(e)}catch(e){t.push(e)}for(let n of[...e._cleanups].reverse())try{typeof n==`function`?n():S(n)}catch(e){t.push(e)}if(e._parent?._cleanups.delete(e),e._cleanups.clear(),e._updates.length=0,t.length)throw AggregateError(t)}function C(e){for(let t of e._updates)w(e,t);for(let t of e._cleanups)typeof t!=`function`&&C(t)}function w(e,t){if(!z(e))return;let n=e._root;n._queue.size||queueMicrotask(()=>{try{n.flush()}catch(e){n.error(e)}}),n._queue.add(t)}function T(t={},n=!1){let r=new Map;for(let e of t.capabilities??[]){if(r.has(e.namespace))throw Error(`spa: duplicate capability ${e.namespace}`);r.set(e.namespace,e)}let i={_capabilities:r,_store:t.store??e.STORE,_prefix:t.idPrefix??`w${_++}`,_id:0,...b(),_queue:new Set,_mounts:n?void 0:[]};i._root=i,i.error=t.onError??(e=>{throw e});for(let e of r.values())if(e.presence){if(i._presence)throw Error(`spa: multiple presence coordinators`);i._presence=e.presence(i)}return i.flush=()=>{if(i._queue.size||i._mounts.length)try{let e=[...r.values()].map(e=>e.beforeUpdate?.(i));try{for(;i._queue.size||i._mounts.length;){for(let e of[...i._queue])i._queue.delete(e)&&e();for(let e of i._mounts.splice(0))e()}}finally{for(let t of e)t?.()}}catch(e){x(i,e)}},i}function E(){return h._root._store}function D(){return r.bind(null,E())}function O(e){h._cleanups.add(e)}function k(e){let t=h;t._root._mounts?.push(()=>{t._dead||v(t,()=>{y(e)})})}function A(){let e=h._root;return`${e._prefix}-${e._id++}`}function j(e,t,n){let r=new Map,i=()=>{if(!z(e))return;let a=new Set,o=g;g=t=>{a.add(t),r.has(t)||r.set(t,t(()=>{w(e,i)}))};let s;try{s=v(e,t)}finally{g=o;for(let[e,t]of r)a.has(e)||(t(),r.delete(e))}y(()=>{n(s)})};e._updates.push(i),e._cleanups.add(()=>{e._root._queue.delete(i);for(let e of r.values())e()}),i()}function M(e,t){let n=E();return e.type.endsWith(`_family`)?i(n,e,t):e}function N(e,t){e=M(e,t);let n=h._root,r=E(),i=t=>l(r,e,`spa:${_++}`,t);return()=>{let t=o(r,e);return n._onRead?.(t,e),g?.(i),t}}function P(e,t){e=M(e,t);let n=E();return t=>{c(n,e,t)}}function F(e){return t(E(),e,`spa:${_++}`)}var I=new WeakMap;function ee(e,t){e=M(e,t);let n=E(),r=I.get(n)??new Map;I.set(n,r);let i={},a=null;return t=>{t?(a=t,r.set(e.key,i),c(n,e,t)):r.get(e.key)===i&&(r.delete(e.key),o(n,e)===a&&c(n,e,null),a=null)}}function L(e,t){let r=E(),i=e.type===`timeline_family`?a(r,e,t):e,o=e=>u(r,i,`spa:${_++}`,e),c=()=>{let e=p(r,i);return g?.(o),e};return{getCursor:()=>c().at,getLength:()=>c().history.length,undo:()=>{d(r,`undo`,i)},redo:()=>{d(r,`redo`,i)},clear:()=>{n(r,i)},getTransaction:()=>{let e=c(),t={};for(let n of[`undo`,`redo`]){let i=s(e,n);i&&(t[n]=()=>{f(r,n,i)})}return t}}}function R(e){return typeof e==`function`?R(e()):Array.isArray(e)?e.map(R).join(``):e==null||typeof e==`boolean`?``:String(e)}function z(e){for(let t=e;t;t=t._parent)if(t._dead||t._exiting)return!1;return!0}var B=e=>e.children;function V(e,t,n){return{type:e,props:n===void 0?t??{}:H(t??{},{key:n})}}var te=V,ne=V;function H(...e){let t=()=>e.map(e=>(typeof e==`function`?e():e)??{});return new Proxy({},{get:(e,n)=>t().reverse().find(e=>Object.hasOwn(e,n))?.[n],ownKeys:()=>[...new Set(t().flatMap(Object.keys))],getOwnPropertyDescriptor:(e,n)=>t().some(e=>Object.hasOwn(e,n))?{enumerable:!0,configurable:!0}:void 0})}function U(e){let t=e.indexOf(`:`);if(t<0)return;let n=e.slice(0,t);return/^(xml|xmlns|xlink)$/.test(n)?void 0:n}function W(e,t){for(let n of Object.keys(t)){let t=U(n);if(t&&!e._root._capabilities.has(t))throw Error(`spa: capability "${t}" is not registered for this root`)}}function G(e,t,n,r){let i=new Map;return e._root._presence?.target(e,t),e._cleanups.add(()=>{let e=[];for(let t of[...i.values()].reverse())try{t.dispose()}catch(t){e.push(t)}if(i.clear(),e.length)throw AggregateError(e)}),a=>{W(e,a);let o={},s=new Map;for(let t of Object.keys(a)){let n=U(t);if(!n){let n=a[t];o[t]=t.startsWith(`on`)&&typeof n==`function`?e._root._presence?.event(e,n)??n:n;continue}let r=s.get(n)??{};r[t.slice(n.length+1)]=a[t],s.set(n,r)}let c=r?.(o);for(let[r,o]of s){let s=i.get(r);s||(s=e._root._capabilities.get(r).attach(t,e),i.set(r,s),e._root._presence?.bind(e,s,n??(()=>a),r)),c===void 0?s.update(o):s.update(o,c)}for(let[t,n]of i)s.has(t)||(i.delete(t),e._root._presence?.unbind(n),n.dispose());return o}}var K=`http://www.w3.org/1999/xhtml`,q=`http://www.w3.org/2000/svg`;function J(e){if(e?.node)for(e.report(null,e.node);e.node;){let t=e.node;e.node=t.nextSibling,t.remove()}}function Y(e,t,n,r,i){if(i&&(e.nodeType!==3||e.nodeValue||i.node?.nodeType===3)){let n=i.node;!n||n.nodeType!==e.nodeType||n.nodeName!==e.nodeName||n.namespaceURI!==e.namespaceURI||e.nodeType!==1&&n.nodeValue!==e.nodeValue?(i.report(e,n),t.insertBefore(e,n),i.node=n?.nextSibling??null,n?.remove()):(e=n,i.node=n.nextSibling)}else t.insertBefore(e,i?i.node:n);return r._cleanups.add(()=>{e.remove()}),e}function X(e,t,n,r,i){return Y(t.ownerDocument.createComment(e),t,n,r,i)}function Z(e,t,n,r){if(!/^(key|children|ref)$/.test(t)&&(t!==`innerHTML`||e.localName!==`astro-slot`)){if(/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(t))throw Error(void 0);if(t.startsWith(`on`)){let i=/(?<!Pointer)Capture$/.test(t),a=t.slice(2,i?-7:void 0).toLowerCase().replace(`doubleclick`,`dblclick`);r&&e.removeEventListener(a,r,i),n!=null&&e.addEventListener(a,n,i)}else if(t===`className`&&(t=`class`),t===`htmlFor`&&(t=`for`),e.namespaceURI===K&&t in e&&!/^(style|form|list)$/.test(t)){let r=e;r[t]=n??(typeof r[t]!=`boolean`&&``)}else n==null||n===!1&&!/^(aria-|data-)/.test(t)?e.removeAttribute(t):e.setAttribute(t,n===!0&&!/^(aria-|data-)/.test(t)?``:String(n))}}function Q(e,t,n,r,i,a,o=()=>e){if(typeof e==`function`){X(`{`,t,n,r,a);let e=null,s=new Map,c=r._root._presence?.collection(e=>e._scope,(e,t)=>typeof e._value==typeof t&&e._value?.type===t?.type),l=(e,t,n,r)=>{c?c.remove(e,t,n,r,()=>{}):S(e._scope)},u=a;j(r,()=>o()(),a=>{let o=[a].flat(1/0),d=new Map,f=t.ownerDocument.activeElement;for(let a=0;a<o.length;a++){let f=o[a],p=f,m=p?.props?.key,h=m==null?a:String(m),g=s.get(h);if(g&&(typeof g._value!=typeof f||g._value?.type!==p?.type)&&(l(g,h,f==null||typeof f==`boolean`,[...s.keys()].indexOf(h)),g=void 0),g??=c?.take(h,f),g)g._value=f,r._root._presence?.resume(g._scope),C(g._scope);else{let a=b(r);g={_value:f,_scope:a,_start:X(`[`,t,e??n,a,u),_end:null};let o=g;Q(f,t,e??n,a,i,u,()=>o._value),g._end=X(`]`,t,e??n,a,u)}d.set(h,g)}for(let[e,t]of s)d.has(e)||l(t,e,!0,[...s.keys()].indexOf(e));if(!u){let r=e??n,i=c?.merge([...d.values()])??[...d.values()];for(let e of i.reverse()){if(e._end.nextSibling!==r){let n=t.ownerDocument.createRange();n.setStartBefore(e._start),n.setEndAfter(e._end),t.insertBefore(n.extractContents(),r)}r=e._start}f?.isConnected&&!f.closest(`[inert]`)&&f!==t.ownerDocument.activeElement&&f.focus({preventScroll:!0})}u=void 0,s=d}),e=X(`}`,t,n,r,a);return}if(Array.isArray(e)){for(let o of e)Q(o,t,n,r,i,a);return}if(e==null||typeof e==`boolean`)return;if(typeof e!=`object`){X(`t`,t,n,r,a);let i=Y(t.ownerDocument.createTextNode(String(e)),t,n,r,a);j(r,o,e=>{let t=String(e);i.nodeValue!==t&&(i.nodeValue=t)});return}let s=e,c=H(()=>o().props);if(!s.type||s.type===B){Q(()=>c.children,t,n,r,i,a);return}if(typeof s.type==`function`){let e=b(r);Q(v(e,()=>y(()=>s.type(c))),t,n,e,i,a);return}let l=s.type===`svg`?q:i,u=Y(t.ownerDocument.createElementNS(l,s.type),t,n,r,a);if(s.type===`astro-slot`)a||(u.innerHTML=c.innerHTML??``);else if(l===K&&/^(textarea|title|style|script)$/.test(s.type))j(r,()=>R(s.type===`textarea`?c.value??c.children:c.children),e=>{u.textContent!==e&&(u.textContent=e)});else{let e=a?{node:u.firstChild,report:a.report}:void 0;/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/.test(s.type)&&l===K||Q(()=>c.children,u,null,r,s.type===`foreignObject`?K:l,e),J(e)}let d={},f=G(r,{kind:`dom`,node:u},()=>({...c}),e=>{let t=d.style===e.style?void 0:u.getAttribute(`style`)??``;for(let t in{...d,...e})Object.is(d[t],e[t])&&typeof e[t]!=`object`||(Z(u,t,e[t],d[t]),d[t]=e[t]);return d=e,t});r._cleanups.add(()=>{for(let e in d)e.startsWith(`on`)&&Z(u,e,null,d[e])}),j(r,()=>({...c}),f);let p=y(()=>c.ref);p&&r._root._mounts.unshift(()=>{r._dead||(r._cleanups.add(()=>p(null)),p(u))})}function $(e,t,n,r){let i=!1,a=r?{node:t.firstChild,report(e,n){i||(i=!0,console.warn(`spa: hydration mismatch. Repairing server HTML to match the browser view; replaced nodes may lose focus or unsaved input.`,{host:t,expected:e,found:n}))}}:void 0,o=a?.node,s=o?.nodeType===8&&o.nodeValue?.startsWith(`w:`)?o.nodeValue.slice(2):void 0,c=T(n);s!==void 0&&n.idPrefix===void 0&&(c._prefix=s);try{X(`w:${c._prefix}`,t,null,c,a),v(c,()=>{Q(y(e),t,null,c,t.namespaceURI===q?q:K,a)}),X(`/w`,t,null,c,a),J(a),c.flush()}catch(e){x(c,e)}return{dispose:()=>{S(c)},flush:c.flush}}function re(e,t,n={}){return $(e,t,n,!1)}function ie(e,t,n={}){return $(e,t,n,!0)}function ae(...e){let t=h._root._store,[n]=e,r=n.type.endsWith(`_family`),i=M(n,e[1]),a=N(i),o=r?2:1,s=e[o],c=e.length>o,l=c,u=s,d;return()=>{let e=a(),n=e instanceof Promise;if(!n){u=e,l=!0;let n=m(t,i);d=c&&`catch`in n&&n.catch.some(t=>e instanceof t)?e:void 0}return l?d?{loading:n,value:s,error:d}:{loading:n,value:u}:`LOADING`}}export{B as Fragment,ie as hydrate,V as jsx,ne as jsxDEV,te as jsxs,H as merge,O as onCleanup,k as onMount,re as render,D as useDisposal,N as useGetter,A as useId,ae as useLoadable,ee as useRef,P as useSetter,E as useStore,L as useTimeline,F as useTransaction};
|
|
1
|
+
import{IMPLICIT as e,actUponStore as t,clearTimelineInStore as n,disposeFromStore as r,findInStore as i,findTimelineInStore as a,getFromStore as o,getTimelineTransactionAtHead as s,setIntoStore as c,subscribeToState as l,subscribeToTimeline as u,timeTravel as d,timeTravelTransactionGroupInStore as f,withdraw as p,withdraw as m}from"atom.io/internal";var h,g,_=0,v=0;function y(e,t){let n=e._root._failure;return n&&Object.is(n.error,t)?n.report:e._options?.onError}function b(e,t,n=y(e,t)){throw n&&(e._root._failure={error:t,report:n}),t}function x(e,t){let n=h;h=e;try{return t()}catch(t){b(e,t)}finally{h=n}}function S(e){let t=g;g=void 0;try{return e()}finally{g=t}}function C(e){let t={_root:e?._root,_parent:e,_options:e?._options,_setupOrder:v++,_cleanups:new Set,_updates:[],_dead:!1};return e?._cleanups.add(t),t}function w(e,t){let n=y(e,t);try{T(e)}catch(r){b(e,AggregateError([t,r]),n)}throw t}function T(e){if(e._dead)return;e._dead=!0;let t=[],n,r=r=>{t.push(r),n??=y(e,r)};try{e._root._presence?.forget(e)}catch(e){r(e)}for(let t of[...e._cleanups].reverse())try{typeof t==`function`?t():T(t)}catch(e){r(e)}e._parent?._cleanups.delete(e),e._cleanups.clear(),e._targets?.clear(),e._updates.length=0,t.length&&b(e,AggregateError(t),n)}function E(e){for(let t of e._updates)D(e,t);for(let t of e._cleanups)typeof t!=`function`&&E(t)}function D(e,t){if(!F(e))return;let n=e._root;!n._queue.size&&!n._flushing&&queueMicrotask(()=>{try{n.flush()}catch(e){let t=y(n,e)??n.error;n._failure=void 0,t(e)}}),n._queue.add(t)}function ee(e,t){let n={order:e._setupOrder,children:[],jobs:[]},r=new Map([[e,n]]),i=e=>{let t=r.get(e);return t||(t={order:e._setupOrder,children:[],jobs:[]},r.set(e,t),i(e._parent).children.push(t)),t};for(let e of[...t].sort((e,t)=>e.order-t.order))i(e.scope).jobs.push(e);let a=e=>{for(let t of e.children.sort((e,t)=>e.order-t.order))a(t);for(let n of e.jobs)t.delete(n)&&F(n.scope)&&n.run()};a(n)}function O(e){let t=new Map;for(let n of e??[]){if(t.has(n.namespace))throw Error(`spa: duplicate capability ${n.namespace}`);t.set(n.namespace,n)}return t}function te(e,t,n=!1){let r=t.presence;if(r){if(e._presence){if(!n||e._presenceFactory!==r)throw Error(`spa: multiple presence coordinators`)}else e._presence=r(e),e._presenceFactory=r}}function ne(e){return e._options?._capabilities??e._root._capabilities}function re(e){let t=h,{store:n,idPrefix:r,onError:i,capabilities:a}=e,o={...t._options};if(n!==void 0&&(o.store=n),r!==void 0&&(o.idPrefix=r),i!==void 0&&(o.onError=i),a!==void 0){o._capabilities=O(a);let e=t._root,n=e._boundaryCapabilities??=new Map;for(let r of o._capabilities.values())te(e,r,!0),n.set(r,(n.get(r)??0)+1),t._cleanups.add(()=>{let e=n.get(r)-1;e?n.set(r,e):n.delete(r)}),e._prepareCapability?.(r)}return t._options=o,()=>e.children}function ie(t={},n=!1){let r=O(t.capabilities),i={_capabilities:r,_store:t.store??e.STORE,_prefix:t.idPrefix??`w${_++}`,_id:0,...C(),_queue:new Set,_mounts:n?void 0:[]};i._root=i,i.error=t.onError??(e=>{throw e});for(let e of r.values())te(i,e);let a=()=>i._queue.size||i._mounts.length,o=()=>a()||i._commits?.size,s;return i.flush=()=>{let e=i._flushing;if((e?a():o())||i._forms?.size){i._flushing=!0;try{if(e){s?.();return}i._failure=void 0;let t,n=()=>{let e=new Map,t=t=>{e.has(t)||e.set(t,t.beforeUpdate?.(i))},n=i._prepareCapability;i._prepareCapability=t;let o=!0;try{for(let e of r.values())t(e);for(let e of i._boundaryCapabilities?.keys()??[])t(e);for(;a();){for(let e of[...i._queue])i._queue.delete(e)&&e();for(let e of i._mounts.splice(0))e()}for(let e of i._forms??[])S(e)||(o=!1)}finally{i._prepareCapability=n;for(let t of e.values())t?.()}return o};do{s=n;let e=n();if(s=void 0,!a()){if(!e||!i._commits?.size)break;t=ee(i,i._commits)??t}}while(o());i._failure=void 0}catch(e){s=void 0,w(i,e)}finally{e||(i._flushing=!1)}}},i}function k(){return h._options?.store??h._root._store}function ae(){return r.bind(null,k())}function oe(e){h._cleanups.add(e)}function se(e){let t=h;t._root._mounts?.push(()=>{t._dead||x(t,()=>{S(e)})})}function ce(e,t){let n=h,r=n._root;if(!r._mounts)return;let i=r._commits??=new Set,a=!1,o,s,c,l=()=>{let e=c;c=void 0,e&&S(e)},u={scope:n,order:v++,loopError:void 0,run(){x(n,()=>{S(()=>{if(l(),!F(n))return;let e=s;s=o,a=!0,c=t(o,e),n._dead&&l()})})}};n._cleanups.add(()=>{i.delete(u),l()}),A(n,e,e=>{o=e,!a||!Object.is(e,s)?i.add(u):i.delete(u)})}function le(){let e=h._root;return`${h._options?.idPrefix??e._prefix}-${e._id++}`}function A(e,t,n){let r=new Map,i=()=>{if(!F(e))return;let a=new Set,o=g;g=t=>{a.add(t),r.has(t)||r.set(t,t(()=>{D(e,i)}))};let s;try{s=x(e,t)}finally{g=o;for(let[e,t]of r)a.has(e)||(t(),r.delete(e))}x(e,()=>{S(()=>{n(s)})})};e._updates.push(i),e._cleanups.add(()=>{e._root._queue.delete(i);for(let e of r.values())e()}),i()}function j(e,t){let n=k();return e.type.endsWith(`_family`)?i(n,e,t):e}function M(e,t){e=j(e,t);let n=h._root,r=k(),i=t=>l(r,e,`spa:${_++}`,t);return()=>{let t=o(r,e);return n._onRead?.(t,e,r),g?.(i),t}}function ue(e,t){e=j(e,t);let n=k();return t=>{c(n,e,t)}}function de(e){return t(k(),e,`spa:${_++}`)}var N=new WeakMap;function fe(e,t){e=j(e,t);let n=k(),r=N.get(n)??new Map;N.set(n,r);let i={},a=null;return t=>{t?(a=t,r.set(e.key,i),c(n,e,t)):r.get(e.key)===i&&(r.delete(e.key),o(n,e)===a&&c(n,e,null),a=null)}}function pe(e,t){let r=k(),i=e.type===`timeline_family`?a(r,e,t):e,o=e=>u(r,i,`spa:${_++}`,e),c=()=>{let e=p(r,i);return g?.(o),e};return{getCursor:()=>c().at,getLength:()=>c().history.length,undo:()=>{d(r,`undo`,i)},redo:()=>{d(r,`redo`,i)},clear:()=>{n(r,i)},getTransaction:()=>{let e=c(),t={};for(let n of[`undo`,`redo`]){let i=s(e,n);i&&(t[n]=()=>{f(r,n,i)})}return t}}}function P(e){return typeof e==`function`?P(e()):Array.isArray(e)?e.map(P).join(``):e==null||typeof e==`boolean`?``:String(e)}function F(e){for(let t=e;t;t=t._parent)if(t._dead||t._exiting)return!1;return!0}import{packCanonical as me}from"atom.io/foundations/canonical";function he(e){let t=e.indexOf(`:`);if(t<0)return;let n=e.slice(0,t);return/^(xml|xmlns|xlink)$/.test(n)?void 0:n}function ge(e,t){let n=e.get(t);if(!n)throw Error(`spa: capability "${t}" is not registered for this root`);return n}function _e(e,t,n,r){let i=e._root,a=new Map,o,s=t=>{let n=o??=new WeakMap,r=n.get(t);return r||(r=function(...n){if(!i._presence||F(e))return t.apply(this,n)},n.set(t,r)),r};return i._presence?i._presence.target(e,t):(e._targets??=new Set).add(t),e._cleanups.add(()=>{let e=[];for(let t of[...a.values()].reverse())try{t.dispose()}catch(t){e.push(t)}if(a.clear(),e.length)throw AggregateError(e)}),o=>{let c=ne(e),l={},u=new Map;for(let e of Object.keys(o)){let t=he(e);if(!t){let t=o[e];l[e]=e.startsWith(`on`)&&typeof t==`function`?s(t):t;continue}let n=ge(c,t),r=u.get(n)??{};r[e.slice(t.length+1)]=o[e],u.set(n,r)}let d=r?.(l);for(let[r,s]of u){let c=a.get(r);c||(c=r.attach(t,e),a.set(r,c),i._presence?.bind(e,c,n??(()=>o),r.namespace)),d===void 0?c.update(s):c.update(s,d)}for(let[e,t]of a)u.has(e)||(a.delete(e),i._presence?.unbind(t),t.dispose());return l}}function I(e){return e?.props}function L(e){if(Array.isArray(e))return e.some(L);let t=I(e);return t!==void 0&&Object.hasOwn(t,`key`)}function R(e){return L(e)?()=>e:e}function ve(e,t=`spa: duplicate key`){let n=[e].flat(1/0),r=new Set;return n.map((e,n)=>{let i=I(e)?.key;if(i===void 0)return{value:e,key:i,id:n};let a=me(i);if(r.has(a))throw Error(t);return r.add(a),{value:e,key:i,id:a}})}function z(e,t){let n=t=>e().reverse().find(e=>Object.hasOwn(e,t)),r=(e,r)=>t&&r===`key`?t.present:n(r)!==void 0;return new Proxy({},{has:r,get(e,r){if(t&&r===`key`)return t.value;let i=n(r);return i&&Reflect.get(i,r)},ownKeys(){let n=new Set(e().flatMap(Object.keys));return t?.present?n.add(`key`):t&&n.delete(`key`),[...n]},getOwnPropertyDescriptor(e,t){if(r(e,t))return{enumerable:!0,configurable:!0}}})}function B(...e){return z(()=>e.map(e=>(typeof e==`function`?e():e)??{}))}function ye(e,t){return z(()=>[e()],{value:t,present:t!==void 0||Object.hasOwn(e(),`key`)})}var V=e=>e.children;function H(e,t,n){return{type:e,props:n===void 0?t??{}:B(t??{},{key:n})}}var be=H,xe=H,U=new WeakMap,W=new WeakMap,G=[`input`,`change`,`click`],Se=()=>{};function K(e){let t=U.get(e);return t||(t=t=>{let n=t.target,r=n?.localName===`textarea`||n?.localName===`input`&&!/^(checkbox|radio|file)$/.test(n.type);t.type===(r?`input`:`change`)&&e.call(t.currentTarget,t)},U.set(e,t)),t}function q(e,t){if((e.localName!==`input`||e.type!==`number`||typeof t!=`number`||e.value===``||Number(e.value)!==t)&&(e.value!==String(t)&&(e.value=String(t)),e.localName===`select`)){let t=e;if(t.selectedIndex<0){let e=[...t.options].find(e=>!e.disabled);e&&(e.selected=!0)}}}function J(e){if(W.get(e)?.(),e.localName!==`input`||e.type!==`radio`)return;let t=e;for(let e of t.getRootNode().querySelectorAll(`input`))e!==t&&e.type===`radio`&&e.name===t.name&&e.form===t.form&&W.get(e)?.()}function Ce(e,t,n){let r,i,a=()=>{if(!F(n))return!0;let i=t.value,a=e.localName===`input`?t.checked:void 0;if(r?.eventPhase)return i==null&&a==null;if(i!=null&&q(e,i),a!=null){let t=e;t.checked!==!!a&&(t.checked=!!a)}return!0},o=()=>{r=void 0,clearTimeout(i),D(n,Se)},s=t=>{(t.type!==`click`||/^(checkbox|radio)$/.test(e.type))&&(r=t,clearTimeout(i),i=setTimeout(()=>{J(e)},0))},c=n._root;if(!c._forms){c._forms=new Set;let e=e=>{let t=e.target;e.type===`click`||e.type===`input`&&/^(checkbox|radio)$/.test(t.type)||J(t)};for(let t of G)c._host.addEventListener(t,e);c._cleanups.add(()=>{for(let t of G)c._host.removeEventListener(t,e)})}let l=c._forms;l.add(a),W.set(e,o);for(let t of G)e.addEventListener(t,s,!0);n._cleanups.add(()=>{clearTimeout(i),l.delete(a),W.delete(e);for(let t of G)e.removeEventListener(t,s,!0)})}var Y=`http://www.w3.org/1999/xhtml`,X=`http://www.w3.org/2000/svg`;function we(e,t){return typeof e._value==typeof t&&e._value?.type===t?.type}function Te(e){if(e?.node)for(e.report(null,e.node);e.node;){let t=e.node;e.node=t.nextSibling,t.remove()}}function Z(e,t,n,r,i){if(i&&(e.nodeType!==3||e.nodeValue||i.node?.nodeType===3)){let n=i.node;!n||n.nodeType!==e.nodeType||n.nodeName!==e.nodeName||n.namespaceURI!==e.namespaceURI||e.nodeType!==1&&n.nodeValue!==e.nodeValue?(i.report(e,n),t.insertBefore(e,n),i.node=n?.nextSibling??null,n?.remove()):(e=n,i.node=n.nextSibling)}else t.insertBefore(e,i?i.node:n);return r._cleanups.add(()=>{e.remove()}),e}function Q(e,t,n,r,i){return Z(t.ownerDocument.createComment(e),t,n,r,i)}function Ee(e,t,n,r){if(!/^(key|children|ref)$/.test(t)&&(t!==`innerHTML`||e.localName!==`astro-slot`)){if(/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(t))throw Error(void 0);if(t.startsWith(`on`)){let i=/(?<!Pointer)Capture$/.test(t),a=t.slice(2,i?-7:void 0).toLowerCase().replace(`doubleclick`,`dblclick`),o=a===`change`?[`input`,`change`]:[a===`focus`?`focusin`:a===`blur`?`focusout`:a];if(r)for(let t of o)e.removeEventListener(t,a===`change`?K(r):r,i);if(n!=null)for(let t of o)e.addEventListener(t,a===`change`?K(n):n,i)}else if(t===`className`&&(t=`class`),t===`htmlFor`&&(t=`for`),e.namespaceURI===X&&t===`focusable`&&typeof n==`boolean`&&(n=String(n)),e.namespaceURI===Y&&t in e&&!/^(style|form|list)$/.test(t)){let r=e;t===`value`&&/^(input|textarea|select)$/.test(e.localName)&&n!=null?q(r,n):r[t]=n??(typeof r[t]!=`boolean`&&``),n??e.removeAttribute(t)}else n==null||n===!1&&!/^(aria-|data-)/.test(t)?e.removeAttribute(t):e.setAttribute(t,n===!0&&!/^(aria-|data-)/.test(t)?``:String(n))}}function $(e,t,n,r,i,a,o=()=>e,s){if(typeof e==`function`){let e=Q(`{`,t,n,r,a),s=null,c=new Map,l,u=(e,t,n,r)=>{l?l.remove(e,t,n,r,()=>{}):T(e._scope)},d=a;A(r,()=>ve(o()()),a=>{l??=r._root._presence?.collection(e=>e._scope,we);let o=new Map,f,p=t.ownerDocument.activeElement;for(let n=0;n<a.length;n++){let{value:s,key:p,id:m}=a[n],h=c.get(m);if(h&&!we(h,s)&&(u(h,m,s==null||typeof s==`boolean`,h._index),h=void 0),h??=l?.take(m,s),h)h._value=s,r._root._presence?.resume(h._scope),E(h._scope);else{let a=f?f._end.nextSibling:e.nextSibling,o=C(r);h={_index:n,_value:s,_scope:o,_start:Q(`[`,t,a,o,d),_end:null};let c=h;$(s,t,a,o,i,d,()=>c._value,p),h._end=Q(`]`,t,a,o,d)}h._index=n,f=h,o.set(m,h)}for(let[e,t]of c)o.has(e)||u(t,e,!0,t._index);if(!d){let e=s??n,r=l?.merge([...o.values()])??[...o.values()];for(let n of r.reverse()){if(n._end.nextSibling!==e){let r=t.ownerDocument.createRange();r.setStartBefore(n._start),r.setEndAfter(n._end),t.insertBefore(r.extractContents(),e)}e=n._start}p?.isConnected&&!p.closest(`[inert]`)&&p!==t.ownerDocument.activeElement&&p.focus({preventScroll:!0})}d=void 0,c=o}),s=Q(`}`,t,n,r,a);return}if(Array.isArray(e)){for(let o of e)$(o,t,n,r,i,a);return}if(e==null||typeof e==`boolean`)return;if(typeof e!=`object`){Q(`t`,t,n,r,a);let i=Z(t.ownerDocument.createTextNode(String(e)),t,n,r,a);A(r,o,e=>{let t=String(e);i.nodeValue!==t&&(i.nodeValue=t)});return}let c=e,l=ye(()=>o().props,s);if(!c.type||c.type===V){$(()=>l.children,t,n,r,i,a);return}if(typeof c.type==`function`){let e=C(r);$(R(x(e,()=>S(()=>c.type(l)))),t,n,e,i,a);return}let u=c.type===`svg`?X:i,d=Z(t.ownerDocument.createElementNS(u,c.type),t,n,r,a);if(u===Y&&/^(input|textarea|select)$/.test(c.type)&&Ce(d,l,r),u===Y&&(l.autoFocus||l.autofocus)&&r._root._mounts.push(()=>{r._dead||d.focus()}),c.type===`astro-slot`)a||(d.innerHTML=l.innerHTML??``);else if(u===Y&&/^(textarea|title|style|script)$/.test(c.type))A(r,()=>P(c.type===`textarea`?l.value??l.children:l.children),e=>{d.textContent!==e&&(d.textContent=e)});else{let e=a?{node:d.firstChild,report:a.report}:void 0;/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/.test(c.type)&&u===Y||$(()=>l.children,d,null,r,c.type===`foreignObject`?Y:u,e),Te(e)}let f={},p=_e(r,{kind:`dom`,node:d},()=>({...l}),e=>{let t=f.style===e.style?void 0:d.getAttribute(`style`)??``;for(let t in{...f,...e})Object.is(f[t],e[t])&&typeof e[t]!=`object`||(Ee(d,t,e[t],f[t]),f[t]=e[t]);return f=e,t});r._cleanups.add(()=>{for(let e in f)e.startsWith(`on`)&&Ee(d,e,null,f[e])}),A(r,()=>({...l}),p);let m=S(()=>l.ref);m&&r._root._mounts.unshift(()=>{r._dead||(r._cleanups.add(()=>m(null)),x(r,()=>m(d)))})}function De(e,t,n,r,i=null){let a=!1,o=r?{node:t.firstChild,report(e,n){a||(a=!0,console.warn(`spa: hydration mismatch. Repairing server HTML to match the browser view; replaced nodes may lose focus or unsaved input.`,{host:t,expected:e,found:n}))}}:void 0,s=o?.node,c=s?.nodeType===8&&s.nodeValue?.startsWith(`w:`)?s.nodeValue.slice(2):void 0,l=ie(n);l._host=t,c!==void 0&&n.idPrefix===void 0&&(l._prefix=c);try{Q(`w:${l._prefix}`,t,i,l,o),x(l,()=>{$(R(S(e)),t,i,l,t.namespaceURI===X?X:Y,o)}),Q(`/w`,t,i,l,o),Te(o),l.flush()}catch(e){w(l,e)}return{dispose:()=>{T(l)},flush:l.flush}}function Oe(e,t,n={}){return De(e,t,n,!1)}function ke(e,t,n={}){return De(e,t,n,!0)}function Ae(...e){let t=k(),[n]=e,r=n.type.endsWith(`_family`),i=j(n,e[1]),a=M(i),o=r?2:1,s=e[o],c=e.length>o,l=c,u=s,d;return()=>{let e=a(),n=e instanceof Promise;if(!n){u=e,l=!0;let n=m(t,i);d=c&&`catch`in n&&n.catch.some(t=>e instanceof t)?e:void 0}return l?d?{loading:n,value:s,error:d}:{loading:n,value:u}:`LOADING`}}export{V as Fragment,re as Root,ke as hydrate,H as jsx,xe as jsxDEV,be as jsxs,B as merge,oe as onCleanup,ce as onCommit,se as onMount,Oe as render,ae as useDisposal,M as useGetter,le as useId,Ae as useLoadable,fe as useRef,ue as useSetter,k as useStore,pe as useTimeline,de as useTransaction};
|