brumate 0.4.4 → 0.5.1

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.
Files changed (63) hide show
  1. package/dist/{boot-D3NjfyUX.d.ts → boot-Difa0qdg.d.ts} +2 -8
  2. package/dist/cli.js +2 -2
  3. package/dist/{client-iZ9a1Nut.js → client-BYHGusTe.js} +990 -369
  4. package/dist/client-BYHGusTe.js.map +1 -0
  5. package/dist/{client-DNva05jp.d.ts → client-DvsU9qxG.d.ts} +107 -23
  6. package/dist/{defer-DP7dMS2y.js → defer-B63oF5Oa.js} +2 -2
  7. package/dist/{defer-DP7dMS2y.js.map → defer-B63oF5Oa.js.map} +1 -1
  8. package/dist/{devtools-BJB_MMeL.js → devtools-D_SQpXTg.js} +4 -4
  9. package/dist/{devtools-BJB_MMeL.js.map → devtools-D_SQpXTg.js.map} +1 -1
  10. package/dist/{devtools-panel-CUV6A4ZE.js → devtools-panel-B9yokst5.js} +2 -2
  11. package/dist/{devtools-panel-CUV6A4ZE.js.map → devtools-panel-B9yokst5.js.map} +1 -1
  12. package/dist/{features-CHY5Ekku.js → features-D5kLyihb.js} +19 -2
  13. package/dist/features-D5kLyihb.js.map +1 -0
  14. package/dist/{files-BZRjz9Mx.js → files-s4wmjcZV.js} +2 -2
  15. package/dist/{files-BZRjz9Mx.js.map → files-s4wmjcZV.js.map} +1 -1
  16. package/dist/index.d.ts +1 -8
  17. package/dist/index.js +1 -1
  18. package/dist/{inspect-BLOdfj7o.js → inspect-BLPt-dZZ.js} +891 -142
  19. package/dist/inspect-BLPt-dZZ.js.map +1 -0
  20. package/dist/{loader-CheV6t0N.js → loader-DKxhLjJw.js} +4 -4
  21. package/dist/{loader-CheV6t0N.js.map → loader-DKxhLjJw.js.map} +1 -1
  22. package/dist/{navigate-CfOr-TRF.js → navigate-BcV1qkkx.js} +2 -2
  23. package/dist/navigate-BcV1qkkx.js.map +1 -0
  24. package/dist/{produce-DS-dQaUX.js → produce-Cq6KKi7b.js} +2 -2
  25. package/dist/{produce-DS-dQaUX.js.map → produce-Cq6KKi7b.js.map} +1 -1
  26. package/dist/{rpc-DvTwGfL_.js → rpc-CIVU4Ktx.js} +5 -5
  27. package/dist/rpc-CIVU4Ktx.js.map +1 -0
  28. package/dist/runtime/bundles.d.ts +9 -0
  29. package/dist/runtime/bundles.js +60 -0
  30. package/dist/runtime/bundles.js.map +1 -0
  31. package/dist/runtime/client.d.ts +2 -2
  32. package/dist/runtime/client.js +3 -3
  33. package/dist/runtime/devtools.d.ts +1 -1
  34. package/dist/runtime/devtools.js +1 -1
  35. package/dist/runtime/hot.d.ts +1 -1
  36. package/dist/runtime/loader.d.ts +2 -2
  37. package/dist/runtime/loader.js +2 -2
  38. package/dist/runtime/server.d.ts +3 -3
  39. package/dist/runtime/server.js +4 -4
  40. package/dist/runtime/static-loader.d.ts +2 -2
  41. package/dist/runtime/static-loader.js +1 -1
  42. package/dist/runtime/testing.d.ts +2 -2
  43. package/dist/runtime/testing.js +2 -2
  44. package/dist/{server-BXMH3Z9T.d.ts → server-CAwIqrXl.d.ts} +44 -5
  45. package/dist/{server-O_rC-RRL.js → server-Doy5HR7r.js} +106 -17
  46. package/dist/server-Doy5HR7r.js.map +1 -0
  47. package/dist/{static-loader-BiUaZaag.d.ts → static-loader-9Nc1GvF0.d.ts} +2 -2
  48. package/dist/{static-loader-BLJYvTKc.js → static-loader-Bdet7g76.js} +3 -26
  49. package/dist/static-loader-Bdet7g76.js.map +1 -0
  50. package/dist/{stream-JGRPr7u5.js → stream-BdhzvPQO.js} +2 -2
  51. package/dist/{stream-JGRPr7u5.js.map → stream-BdhzvPQO.js.map} +1 -1
  52. package/dist/vite.d.ts +1 -1
  53. package/dist/vite.js +129 -51
  54. package/dist/vite.js.map +1 -1
  55. package/package.json +5 -1
  56. package/skills/brumate/references/errors.md +19 -5
  57. package/dist/client-iZ9a1Nut.js.map +0 -1
  58. package/dist/features-CHY5Ekku.js.map +0 -1
  59. package/dist/inspect-BLOdfj7o.js.map +0 -1
  60. package/dist/navigate-CfOr-TRF.js.map +0 -1
  61. package/dist/rpc-DvTwGfL_.js.map +0 -1
  62. package/dist/server-O_rC-RRL.js.map +0 -1
  63. package/dist/static-loader-BLJYvTKc.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { E as vars, _ as mergeAttributes, a as attribute, c as classAttribute, i as affix, m as internal, u as escape, v as onAttribute, x as raw } from "../html-t1JpkODI.js";
2
- import { S as unbind, t as produce, u as SCOPE_IDS } from "../produce-DS-dQaUX.js";
2
+ import { S as unbind, t as produce, u as SCOPE_IDS } from "../produce-Cq6KKi7b.js";
3
3
  import { a as routeContext, i as navigationContext, r as createContext } from "../context-CTiSzQRc.js";
4
- import { $ as dispose, $t as scopes, A as branchNodes, At as timed, B as putText, Bt as descendants, C as dynamicNodes, Ct as effect, D as setItem, Dt as pending, E as place, Et as memo, F as keep, Ft as children, G as setSpread, Gt as sink, H as setAttrText, Ht as makeId, I as keepText, It as insert, J as fill, Jt as nameComment, K as template, Kt as loadModule, L as listNodes, Lt as title, M as fillBranch, Mt as update, N as fillList, Nt as updated, O as setSlots, Ot as resolve, P as fillSettled, Pt as fail, Q as retag, Qt as rpcPrefix, R as markBlock, Rt as afterInsert, S as dynamic, St as cells, T as foreignNodes, Tt as isBound, U as setContent, Ut as removeScope, V as setAttr, Vt as getScope, W as setOn, Wt as setOwner, X as rekey, Xt as build, Y as offscreen, Yt as DEVTOOLS, Z as reset, Zt as hooks, _ as writeText, _t as updateContext, a as deferInBrowser, at as removeRoot, b as component, bt as binding, c as toList, ct as handlerProp, d as attr, dt as submitAction, en as skew, et as forget, f as attrs, ft as guess, g as text, gt as setGlobal, h as restRef, ht as provideValue, i as addStyle, it as remount, j as clone, jt as unreadMemo, k as appendText, kt as set, l as windowList, lt as rpc, m as portalTo, mt as consumeContext, n as addHead, nt as leavePage, o as setVar, ot as action, p as content, pt as track, q as branch, qt as loadPart, r as addPortal, rt as leaveRoutes, s as list, st as handle, t as loader, tt as init, u as windowStart, ut as spread, v as prop, vt as updateRoute, w as elementAt, wt as get, x as componentNodes, xt as bindings, y as spreadProps, yt as asyncMemo, z as nodes, zt as createScope } from "../client-iZ9a1Nut.js";
5
- export { DEVTOOLS, action, addHead, addPortal, addStyle, affix, afterInsert, appendText, asyncMemo, attr, attribute, attrs, binding, bindings, branch, branchNodes, build, cells, children, classAttribute, clone, component, componentNodes, consumeContext, content, createContext, createScope, deferInBrowser, descendants, dispose, dynamic, dynamicNodes, effect, elementAt, escape, fail, fill, fillBranch, fillList, fillSettled, foreignNodes, forget, get, getScope, guess, handle, handlerProp, hooks, init, insert, internal, isBound, keep, keepText, leavePage, leaveRoutes, list, listNodes, loadModule, loadPart, loader, makeId, markBlock, memo, mergeAttributes, nameComment, navigationContext, nodes, offscreen, onAttribute, pending, place, portalTo, produce, prop, provideValue, putText, raw, rekey, remount, removeRoot, removeScope, reset, resolve, restRef, retag, routeContext, rpc, rpcPrefix, SCOPE_IDS as scopeIds, scopes, set, setAttr, setAttrText, setContent, setGlobal, setItem, setOn, setOwner, setSlots, setSpread, setVar, sink, skew, spread, spreadProps, submitAction, template, text, timed, title, toList, track, unbind, unreadMemo, update, updateContext, updateRoute, updated, vars, windowList, windowStart, writeText };
4
+ import { $ as keep, $t as getScope, A as attr, At as updateRoute, B as componentNodes, Bt as resolve, C as fillSpread, Ct as submitAction, D as reveal, Dt as provideValue, E as loading, Et as consumeContext, F as text, Ft as effect, G as place, Gt as updated, H as dynamicNodes, Ht as timed, I as writeText, It as get, J as appendText, Jt as insert, K as setItem, Kt as fail, L as prop, Lt as isBound, M as content, Mt as binding, N as portalTo, Nt as bindings, O as started, Ot as setGlobal, P as restRef, Pt as cells, Q as fillList, Qt as descendants, R as spreadProps, Rt as memo, S as fillSettled, St as spread, T as keepValue, Tt as track, U as elementAt, Ut as unreadMemo, V as dynamic, Vt as set, W as foreignNodes, Wt as update, X as clone, Xt as afterInsert, Y as branchNodes, Yt as title, Z as fillBranch, Zt as createScope, _ as retag, _t as removeRoot, a as deferInBrowser, an as nameComment, at as setAttr, b as countLoads, bt as handlerProp, c as toList, cn as hooks, ct as setOn, d as branch, dn as skew, dt as dispose, en as makeId, et as keepText, f as fill, ft as forget, g as reset, gt as remount, h as rekey, ht as leaveRoutes, i as addStyle, in as loadModule, it as putText, j as attrs, jt as asyncMemo, k as wait, kt as updateContext, l as windowList, ln as rpcPrefix, lt as setSpread, m as offscreen, mt as leavePage, n as addHead, nn as setOwner, nt as markBlock, o as setVar, on as DEVTOOLS, ot as setAttrText, p as held, pt as init, q as setSlots, qt as children, r as addPortal, rn as sink, rt as nodes, s as list, sn as build, st as setContent, t as loader, tn as removeScope, tt as listNodes, u as windowStart, un as scopes, ut as template, v as after, vt as action, w as fillValue, wt as guess, x as fillAttrs, xt as rpc, y as attempt, yt as handle, z as component, zt as pending } from "../client-BYHGusTe.js";
5
+ export { DEVTOOLS, action, addHead, addPortal, addStyle, affix, after, afterInsert, appendText, asyncMemo, attempt, attr, attribute, attrs, binding, bindings, branch, branchNodes, build, cells, children, classAttribute, clone, component, componentNodes, consumeContext, content, countLoads, createContext, createScope, deferInBrowser, descendants, dispose, dynamic, dynamicNodes, effect, elementAt, escape, fail, fill, fillAttrs, fillBranch, fillList, fillSettled, fillSpread, fillValue, foreignNodes, forget, get, getScope, guess, handle, handlerProp, held, hooks, init, insert, internal, isBound, keep, keepText, keepValue, leavePage, leaveRoutes, list, listNodes, loadModule, loader, loading, makeId, markBlock, memo, mergeAttributes, nameComment, navigationContext, nodes, offscreen, onAttribute, pending, place, portalTo, produce, prop, provideValue, putText, raw, rekey, remount, removeRoot, removeScope, reset, resolve, restRef, retag, reveal, routeContext, rpc, rpcPrefix, SCOPE_IDS as scopeIds, scopes, set, setAttr, setAttrText, setContent, setGlobal, setItem, setOn, setOwner, setSlots, setSpread, setVar, sink, skew, spread, spreadProps, started, submitAction, template, text, timed, title, toList, track, unbind, unreadMemo, update, updateContext, updateRoute, updated, vars, wait, windowList, windowStart, writeText };
@@ -1,5 +1,5 @@
1
1
  import { c as ScopeId } from "../shared-CzbnWkVA.js";
2
- import { Lt as Scope, cn as NavigationReport } from "../client-DNva05jp.js";
2
+ import { Kt as Scope, vn as NavigationReport } from "../client-DvsU9qxG.js";
3
3
  //#region src/runtime/logo.d.ts
4
4
  /**
5
5
  * The logo of brumate: the pole and the bowl of a b, in outline, where the
@@ -1,3 +1,3 @@
1
1
  import { t as LOGO } from "../logo-DQ_OYhBi.js";
2
- import { a as scanBlocks, i as reportError, n as installDevtools, r as preview, t as findRootScope } from "../devtools-BJB_MMeL.js";
2
+ import { a as scanBlocks, i as reportError, n as installDevtools, r as preview, t as findRootScope } from "../devtools-D_SQpXTg.js";
3
3
  export { LOGO, findRootScope, installDevtools, preview, reportError, scanBlocks };
@@ -1,4 +1,4 @@
1
- import { Mt as ClientModule } from "../client-DNva05jp.js";
1
+ import { Ht as ClientModule } from "../client-DvsU9qxG.js";
2
2
  //#region src/runtime/hot.d.ts
3
3
  /** What `brumate:update` holds for each component that changed. */
4
4
  export interface HotUpdate {
@@ -1,5 +1,5 @@
1
- import { n as NavigateOptions, t as LoaderOptions } from "../boot-D3NjfyUX.js";
2
- import { t as startWithoutNavigation } from "../static-loader-BiUaZaag.js";
1
+ import { n as NavigateOptions, t as LoaderOptions } from "../boot-Difa0qdg.js";
2
+ import { t as startWithoutNavigation } from "../static-loader-9Nc1GvF0.js";
3
3
  //#region src/runtime/loader.d.ts
4
4
  /**
5
5
  * Starts resuming the page. Listens to the events in `b-on` attributes
@@ -1,3 +1,3 @@
1
- import { t as startWithoutNavigation } from "../static-loader-BLJYvTKc.js";
2
- import { t as start } from "../loader-CheV6t0N.js";
1
+ import { t as startWithoutNavigation } from "../static-loader-Bdet7g76.js";
2
+ import { t as start } from "../loader-DKxhLjJw.js";
3
3
  export { start, startWithoutNavigation };
@@ -1,7 +1,7 @@
1
1
  import { a as Route, c as routeContext, o as createContext, r as NavigationState, s as navigationContext } from "../context-btHuB01Z.js";
2
- import { A as onAttribute, C as escapeAttribute, E as internal, N as raw, R as vars, S as escape, _ as attribute, a as PageState, b as classAttribute, c as ScopeId, d as useSerialEntry, g as affix, k as mergeAttributes, l as ScopeState, n as ElementReference, p as Raw, r as FunctionReference, u as unbind } from "../shared-CzbnWkVA.js";
2
+ import { A as onAttribute, C as escapeAttribute, E as internal, N as raw, R as vars, S as escape, a as PageState, b as classAttribute, c as ScopeId, d as useSerialEntry, g as affix, k as mergeAttributes, l as ScopeState, n as ElementReference, p as Raw, r as FunctionReference, u as unbind } from "../shared-CzbnWkVA.js";
3
3
  import { t as produce } from "../produce-CLABZ8k2.js";
4
4
  import { t as StandardSchemaV1 } from "../standard-schema-BNY82yX3.js";
5
5
  import { f as Intent, v as SubmissionResult } from "../forms-j1xPAR14.js";
6
- import { $ as memoryStore, $t as createSession, A as insert, At as Middleware, B as spacerTag, Bt as RequestEvent, C as caught, Ct as fieldErrors, D as handleRequest, Dt as EndpointLoader, E as dynamic, Et as safeParse, F as read, Ft as matchRoute, G as streamState, Gt as defineMiddleware, H as stateScript, Ht as RequestKind, I as ready, It as EntryMiddleware, J as IdempotentOptions, Jt as redirect, K as wait, Kt as getEvent, L as render, Lt as Locals, M as lazy, Mt as RouteMatch, N as memo, Nt as RouteNode, O as handleRoute, Ot as Handler, P as packState, Pt as RouteView, Q as cached, Qt as SessionOptions, R as renderToStream, Rt as Redirect, S as binding, St as ValidationIssue, T as component, Tt as parseForm, U as stateValue, Ut as ServerError, V as spread, Vt as RequestEventOptions, W as streamParts, Wt as dedupe, X as CacheStore, Xt as CookieOptions, Y as idempotent, Yt as withEvent, Z as CachedOptions, Zt as Session, _ as StateAttributes, _t as SubmissionOptions, a as ItemSource, at as RateLimitError, b as action, bt as ParseResult, c as Memo, ct as RateLimitStore, d as RenderOptions, dt as configureRateLimit, en as parseCookies, et as revalidate, f as RenderResult, ft as rateLimit, g as ScopeEntry, gt as Submission, h as RouteOptions, ht as ReplyOptions, i as DocumentOptions, it as RateLimitConfig, j as isCrossSite, jt as MiddlewareLoader, k as inlineBodies, kt as Loader, l as NotReady, lt as Window, m as RevealOrder, mt as IntentSubmission, n as Context, nn as toNodeHeaders, nt as storageStore, o as Lazy, ot as RateLimitMiddleware, p as RequestOptions, pt as FailedSubmission, q as waitAll, qt as isRedirect, r as DeferTarget, rt as RateLimit, s as Mark, st as RateLimitOptions, t as Component, tn as serializeCookie, tt as setCacheStore, u as PageCache, ut as clientAddress, v as StateMap, vt as SuccessfulSubmission, w as children, wt as parse, x as actionResult, xt as ValidationError, y as StreamOptions, yt as parseSubmission, z as settled, zt as RequestCall } from "../server-BXMH3Z9T.js";
7
- export { type CacheStore, type CachedOptions, Component, Context, type CookieOptions, DeferTarget, DocumentOptions, ElementReference, type EndpointLoader, type EntryMiddleware, type FailedSubmission, FunctionReference, type Handler, type IdempotentOptions, type Intent, type IntentSubmission, ItemSource, Lazy, type Loader, type Locals, Mark, Memo, type Middleware, type MiddlewareLoader, type NavigationState, NotReady, PageCache, type PageState, type ParseResult, type RateLimit, type RateLimitConfig, RateLimitError, type RateLimitMiddleware, type RateLimitOptions, type RateLimitStore, type Raw, type Redirect, RenderOptions, RenderResult, type ReplyOptions, type RequestCall, RequestEvent, type RequestEventOptions, type RequestKind, RequestOptions, RevealOrder, type Route, type RouteMatch, type RouteNode, RouteOptions, type RouteView, ScopeEntry, type ScopeId, type ScopeState, ServerError, type Session, type SessionOptions, type StandardSchemaV1, StateAttributes, StateMap, StreamOptions, type Submission, type SubmissionOptions, type SubmissionResult, type SuccessfulSubmission, ValidationError, type ValidationIssue, type Window, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, settled, spacerTag, spread, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
6
+ import { $ as idempotent, $t as withEvent, A as handleRoute, At as safeParse, B as renderToStream, Bt as EntryMiddleware, C as attribute, Ct as parseSubmission, D as component, Dt as fieldErrors, E as children, Et as ValidationIssue, F as memo, Ft as MiddlewareLoader, G as start, Gt as RequestEventOptions, H as settled, Ht as Redirect, I as packState, It as RouteMatch, J as streamParts, Jt as dedupe, K as stateScript, Kt as RequestKind, L as read, Lt as RouteNode, M as insert, Mt as Handler, N as isCrossSite, Nt as Loader, O as dynamic, Ot as parse, P as lazy, Pt as Middleware, Q as IdempotentOptions, Qt as redirect, R as ready, Rt as RouteView, S as actionResult, St as SuccessfulSubmission, T as caught, Tt as ValidationError, U as spacerTag, Ut as RequestCall, V as setClientBundles, Vt as Locals, W as spread, Wt as RequestEvent, X as wait, Xt as getEvent, Y as streamState, Yt as defineMiddleware, Z as waitAll, Zt as isRedirect, _ as ScopeEntry, _t as FailedSubmission, a as DocumentOptions, an as serializeCookie, at as setCacheStore, b as StreamOptions, bt as Submission, c as Mark, ct as RateLimitConfig, d as PageCache, dt as RateLimitOptions, en as CookieOptions, et as CacheStore, f as RenderOptions, ft as RateLimitStore, g as RouteOptions, gt as rateLimit, h as RevealOrder, ht as configureRateLimit, i as DeferTarget, in as parseCookies, it as revalidate, j as inlineBodies, jt as EndpointLoader, k as handleRequest, kt as parseForm, l as Memo, lt as RateLimitError, m as RequestOptions, mt as clientAddress, n as Component, nn as SessionOptions, nt as cached, o as ItemSource, on as toNodeHeaders, ot as storageStore, p as RenderResult, pt as Window, q as stateValue, qt as ServerError, r as Context, rn as createSession, rt as memoryStore, s as Lazy, st as RateLimit, t as ClientBundles, tn as Session, tt as CachedOptions, u as NotReady, ut as RateLimitMiddleware, v as StateAttributes, vt as IntentSubmission, w as binding, wt as ParseResult, x as action, xt as SubmissionOptions, y as StateMap, yt as ReplyOptions, z as render, zt as matchRoute } from "../server-CAwIqrXl.js";
7
+ export { type CacheStore, type CachedOptions, ClientBundles, Component, Context, type CookieOptions, DeferTarget, DocumentOptions, ElementReference, type EndpointLoader, type EntryMiddleware, type FailedSubmission, FunctionReference, type Handler, type IdempotentOptions, type Intent, type IntentSubmission, ItemSource, Lazy, type Loader, type Locals, Mark, Memo, type Middleware, type MiddlewareLoader, type NavigationState, NotReady, PageCache, type PageState, type ParseResult, type RateLimit, type RateLimitConfig, RateLimitError, type RateLimitMiddleware, type RateLimitOptions, type RateLimitStore, type Raw, type Redirect, RenderOptions, RenderResult, type ReplyOptions, type RequestCall, RequestEvent, type RequestEventOptions, type RequestKind, RequestOptions, RevealOrder, type Route, type RouteMatch, type RouteNode, RouteOptions, type RouteView, ScopeEntry, type ScopeId, type ScopeState, ServerError, type Session, type SessionOptions, type StandardSchemaV1, StateAttributes, StateMap, StreamOptions, type Submission, type SubmissionOptions, type SubmissionResult, type SuccessfulSubmission, ValidationError, type ValidationIssue, type Window, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, setClientBundles, settled, spacerTag, spread, start, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
@@ -1,6 +1,6 @@
1
- import { E as vars, _ as mergeAttributes, a as attribute, c as classAttribute, d as escapeAttribute, i as affix, m as internal, u as escape, v as onAttribute, x as raw } from "../html-t1JpkODI.js";
1
+ import { E as vars, _ as mergeAttributes, c as classAttribute, d as escapeAttribute, i as affix, m as internal, u as escape, v as onAttribute, x as raw } from "../html-t1JpkODI.js";
2
2
  import { a as serializeCookie, i as parseCookies, s as toNodeHeaders, t as createSession } from "../cookies-Cnbf4w-S.js";
3
- import { C as useSerialEntry, S as unbind, a as ElementReference, o as FunctionReference, t as produce } from "../produce-DS-dQaUX.js";
4
- import { $ as isRedirect, A as waitAll, B as parseForm, C as spacerTag, D as streamParts, E as stateValue, F as rateLimit, G as revalidate, H as matchRoute, I as parseSubmission, J as RequestEvent, K as setCacheStore, L as ValidationError, M as RateLimitError, N as clientAddress, O as streamState, P as configureRateLimit, Q as getEvent, R as fieldErrors, S as settled, T as stateScript, U as cached, V as safeParse, W as memoryStore, X as dedupe, Y as ServerError, Z as defineMiddleware, _ as packState, a as binding, b as render, c as component, d as handleRoute, et as redirect, f as inlineBodies, g as memo, h as lazy, i as actionResult, j as idempotent, k as wait, l as dynamic, m as isCrossSite, n as NotReady, o as caught, p as insert, q as storageStore, r as action, s as children, t as Context, tt as withEvent, u as handleRequest, v as read, w as spread, x as renderToStream, y as ready, z as parse } from "../server-O_rC-RRL.js";
3
+ import { C as useSerialEntry, S as unbind, a as ElementReference, o as FunctionReference, t as produce } from "../produce-Cq6KKi7b.js";
4
+ import { $ as dedupe, A as streamParts, B as ValidationError, C as setClientBundles, D as start, E as spread, F as RateLimitError, G as matchRoute, H as parse, I as clientAddress, J as revalidate, K as cached, L as configureRateLimit, M as wait, N as waitAll, O as stateScript, P as idempotent, Q as ServerError, R as rateLimit, S as renderToStream, T as spacerTag, U as parseForm, V as fieldErrors, W as safeParse, X as storageStore, Y as setCacheStore, Z as RequestEvent, _ as memo, a as attribute, b as ready, c as children, d as handleRequest, et as defineMiddleware, f as handleRoute, g as lazy, h as isCrossSite, i as actionResult, it as withEvent, j as streamState, k as stateValue, l as component, m as insert, n as NotReady, nt as isRedirect, o as binding, p as inlineBodies, q as memoryStore, r as action, rt as redirect, s as caught, t as Context, tt as getEvent, u as dynamic, v as packState, w as settled, x as render, y as read, z as parseSubmission } from "../server-Doy5HR7r.js";
5
5
  import { a as routeContext, i as navigationContext, r as createContext } from "../context-CTiSzQRc.js";
6
- export { Context, ElementReference, FunctionReference, NotReady, RateLimitError, RequestEvent, ServerError, ValidationError, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, settled, spacerTag, spread, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
6
+ export { Context, ElementReference, FunctionReference, NotReady, RateLimitError, RequestEvent, ServerError, ValidationError, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, setClientBundles, settled, spacerTag, spread, start, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
@@ -1,3 +1,3 @@
1
- import { t as LoaderOptions } from "../boot-D3NjfyUX.js";
2
- import { t as startWithoutNavigation } from "../static-loader-BiUaZaag.js";
1
+ import { t as LoaderOptions } from "../boot-Difa0qdg.js";
2
+ import { t as startWithoutNavigation } from "../static-loader-9Nc1GvF0.js";
3
3
  export { type LoaderOptions, startWithoutNavigation };
@@ -1 +1 @@
1
- export { t as startWithoutNavigation } from "../static-loader-BLJYvTKc.js";
1
+ export { t as startWithoutNavigation } from "../static-loader-Bdet7g76.js";
@@ -1,5 +1,5 @@
1
- import { Mt as ClientModule } from "../client-DNva05jp.js";
2
- import { It as EntryMiddleware, d as RenderOptions, t as Component } from "../server-BXMH3Z9T.js";
1
+ import { Ht as ClientModule } from "../client-DvsU9qxG.js";
2
+ import { Bt as EntryMiddleware, f as RenderOptions, n as Component } from "../server-CAwIqrXl.js";
3
3
  //#region src/runtime/testing.d.ts
4
4
  /** The middleware of files of server functions, by function ID. */
5
5
  type FileMiddleware = Record<string, EntryMiddleware>;
@@ -1,5 +1,5 @@
1
- import { b as render, u as handleRequest } from "../server-O_rC-RRL.js";
2
- import { t as start } from "../loader-CheV6t0N.js";
1
+ import { d as handleRequest, x as render } from "../server-Doy5HR7r.js";
2
+ import { t as start } from "../loader-DKxhLjJw.js";
3
3
  //#region src/runtime/nodes.ts
4
4
  const VOID = /* @__PURE__ */ new Set([
5
5
  "area",
@@ -1163,6 +1163,13 @@ declare function ready(node: Memo): unknown;
1163
1163
  * browser throws the error as a memo that failed there.
1164
1164
  */
1165
1165
  declare function stateValue(node: Memo): unknown;
1166
+ /**
1167
+ * Starts the load of an awaited memo before the statements that it does not
1168
+ * read, where the compiler moves its declaration. It keeps a synchronous
1169
+ * throw of the compute and a rejection in the memo, so the `await` where the
1170
+ * source has it throws them, not the start.
1171
+ */
1172
+ declare function start(node: Memo): void;
1166
1173
  /**
1167
1174
  * Starts every memo of a run of declarations that the render waits for,
1168
1175
  * so they load at the same time. Returns a promise that settles when all
@@ -1209,6 +1216,11 @@ declare function actionResult(ctx: Context, fn: unknown): unknown;
1209
1216
  */
1210
1217
  declare function insert(value: unknown, ctx?: Context, scope?: ScopeId, tag?: string, anchor?: number): string | Promise<string>;
1211
1218
  type Component<P = any> = (props: P, ctx: Context) => Promise<string | object>;
1219
+ /**
1220
+ * Renders an attribute of an element. A promise renders once it settles, so the element is sent
1221
+ * with its final attributes: the render waits for it, as for a promise in text.
1222
+ */
1223
+ declare function attribute(name: string, value: unknown): string | Promise<string>;
1212
1224
  /**
1213
1225
  * Renders a child component. With `scope` and `anchor`, records the child's
1214
1226
  * scope so the parent can update its props on the client.
@@ -1246,6 +1258,8 @@ interface StateAttributes {
1246
1258
  params?: Record<string, string>;
1247
1259
  /** The ID of the build that rendered the page, on its first record, for skew protection. */
1248
1260
  build?: string;
1261
+ /** The URLs of the bundles that the components of the record need, which the browser imports. */
1262
+ load?: string[];
1249
1263
  /** The ID of a `#loading` boundary whose body failed. The record is the error. */
1250
1264
  fail?: ScopeId;
1251
1265
  /** The marker of a `#try` whose `#catch` body replaces its body, from the template `b-c`. */
@@ -1359,6 +1373,30 @@ interface RenderOptions {
1359
1373
  boundary: ScopeId;
1360
1374
  at: string;
1361
1375
  };
1376
+ /**
1377
+ * The bundles of the client build. Each state record with scopes names, in `b-load`, the
1378
+ * URLs of the bundles that hold the code of its components, so the browser loads only the
1379
+ * code of the page. In a build, those of the client build are the default (see
1380
+ * `setClientBundles`), so only a render that wants others passes them.
1381
+ */
1382
+ bundles?: ClientBundles;
1383
+ }
1384
+ /**
1385
+ * Sets the bundles that a render names when its options name none. The Vite plugin calls it in
1386
+ * a server build with those of the client build, so a server that calls `render()` itself gets
1387
+ * pages whose code loads. The dev server loads each component by its module and sets none.
1388
+ */
1389
+ declare function setClientBundles(bundles: ClientBundles | undefined): void;
1390
+ /** The bundles of a client build, by the ID of their root component, such as a route. */
1391
+ interface ClientBundles {
1392
+ /** The URL of the chunk of each bundle. */
1393
+ chunks: Record<string, string>;
1394
+ /** The URLs of the stylesheets that the modules of each bundle import. */
1395
+ styles?: Record<string, string[]>;
1396
+ /** The IDs of the components whose code each bundle holds. */
1397
+ members: Record<string, string[]>;
1398
+ /** The roots whose bundles the browser has, such as those of a page that asks for a `#defer` body. */
1399
+ loaded?: string[];
1362
1400
  }
1363
1401
  /**
1364
1402
  * Renders the parts of a page. It returns as soon as the markup is rendered.
@@ -1503,8 +1541,9 @@ interface RouteOptions extends DocumentOptions, RequestOptions {
1503
1541
  hints?: string[];
1504
1542
  /**
1505
1543
  * The URLs of the bundle of each root component, such as a route or a layout, by component ID:
1506
- * its chunk and the chunks that it imports. A page adds those of its views to `hints`, so the
1507
- * code of the page loads with the HTML. `virtual:brumate/routes` passes them.
1544
+ * its chunk, the chunks that it imports and its stylesheets. A page adds the scripts of its
1545
+ * views to `hints`, so the code of the page loads with the HTML, and links to their
1546
+ * stylesheets in its head. `virtual:brumate/routes` passes them.
1508
1547
  */
1509
1548
  bundleHints?: Record<string, string[]>;
1510
1549
  /**
@@ -1536,7 +1575,7 @@ declare function handleRoute(tree: RouteNode, request: Request, options?: RouteO
1536
1575
  * function belongs to and the modifiers of its wrappers. A function that
1537
1576
  * refers to nothing in the browser is left out.
1538
1577
  */
1539
- declare function spread(attributes: Record<string, unknown>, on?: string[], names?: boolean): string;
1578
+ declare function spread(attributes: Record<string, unknown>, on?: string[], names?: boolean): string | Promise<string>;
1540
1579
  //#endregion
1541
- export { memoryStore as $, createSession as $t, insert as A, Middleware as At, spacerTag as B, RequestEvent as Bt, caught as C, fieldErrors as Ct, handleRequest as D, EndpointLoader as Dt, dynamic as E, safeParse as Et, read as F, matchRoute as Ft, streamState as G, defineMiddleware as Gt, stateScript as H, RequestKind as Ht, ready as I, EntryMiddleware as It, IdempotentOptions as J, redirect as Jt, wait as K, getEvent as Kt, render as L, Locals as Lt, lazy as M, RouteMatch as Mt, memo as N, RouteNode as Nt, handleRoute as O, Handler as Ot, packState as P, RouteView as Pt, cached as Q, SessionOptions as Qt, renderToStream as R, Redirect as Rt, binding as S, ValidationIssue as St, component as T, parseForm as Tt, stateValue as U, ServerError as Ut, spread as V, RequestEventOptions as Vt, streamParts as W, dedupe as Wt, CacheStore as X, CookieOptions as Xt, idempotent as Y, withEvent as Yt, CachedOptions as Z, Session as Zt, StateAttributes as _, SubmissionOptions as _t, ItemSource as a, RateLimitError as at, action as b, ParseResult as bt, Memo as c, RateLimitStore as ct, RenderOptions as d, configureRateLimit as dt, parseCookies as en, revalidate as et, RenderResult as f, rateLimit as ft, ScopeEntry as g, Submission as gt, RouteOptions as h, ReplyOptions as ht, DocumentOptions as i, RateLimitConfig as it, isCrossSite as j, MiddlewareLoader as jt, inlineBodies as k, Loader as kt, NotReady as l, Window as lt, RevealOrder as m, IntentSubmission as mt, Context as n, toNodeHeaders as nn, storageStore as nt, Lazy as o, RateLimitMiddleware as ot, RequestOptions as p, FailedSubmission as pt, waitAll as q, isRedirect as qt, DeferTarget as r, RateLimit as rt, Mark as s, RateLimitOptions as st, Component as t, serializeCookie as tn, setCacheStore as tt, PageCache as u, clientAddress as ut, StateMap as v, SuccessfulSubmission as vt, children as w, parse as wt, actionResult as x, ValidationError as xt, StreamOptions as y, parseSubmission as yt, settled as z, RequestCall as zt };
1542
- //# sourceMappingURL=server-BXMH3Z9T.d.ts.map
1580
+ export { idempotent as $, withEvent as $t, handleRoute as A, safeParse as At, renderToStream as B, EntryMiddleware as Bt, attribute as C, parseSubmission as Ct, component as D, fieldErrors as Dt, children as E, ValidationIssue as Et, memo as F, MiddlewareLoader as Ft, start as G, RequestEventOptions as Gt, settled as H, Redirect as Ht, packState as I, RouteMatch as It, streamParts as J, dedupe as Jt, stateScript as K, RequestKind as Kt, read as L, RouteNode as Lt, insert as M, Handler as Mt, isCrossSite as N, Loader as Nt, dynamic as O, parse as Ot, lazy as P, Middleware as Pt, IdempotentOptions as Q, redirect as Qt, ready as R, RouteView as Rt, actionResult as S, SuccessfulSubmission as St, caught as T, ValidationError as Tt, spacerTag as U, RequestCall as Ut, setClientBundles as V, Locals as Vt, spread as W, RequestEvent as Wt, wait as X, getEvent as Xt, streamState as Y, defineMiddleware as Yt, waitAll as Z, isRedirect as Zt, ScopeEntry as _, FailedSubmission as _t, DocumentOptions as a, serializeCookie as an, setCacheStore as at, StreamOptions as b, Submission as bt, Mark as c, RateLimitConfig as ct, PageCache as d, RateLimitOptions as dt, CookieOptions as en, CacheStore as et, RenderOptions as f, RateLimitStore as ft, RouteOptions as g, rateLimit as gt, RevealOrder as h, configureRateLimit as ht, DeferTarget as i, parseCookies as in, revalidate as it, inlineBodies as j, EndpointLoader as jt, handleRequest as k, parseForm as kt, Memo as l, RateLimitError as lt, RequestOptions as m, clientAddress as mt, Component as n, SessionOptions as nn, cached as nt, ItemSource as o, toNodeHeaders as on, storageStore as ot, RenderResult as p, Window as pt, stateValue as q, ServerError as qt, Context as r, createSession as rn, memoryStore as rt, Lazy as s, RateLimit as st, ClientBundles as t, Session as tn, CachedOptions as tt, NotReady as u, RateLimitMiddleware as ut, StateAttributes as v, IntentSubmission as vt, binding as w, ParseResult as wt, action as x, SubmissionOptions as xt, StateMap as y, ReplyOptions as yt, render as z, matchRoute as zt };
1581
+ //# sourceMappingURL=server-CAwIqrXl.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { n as closesParagraph, r as firstTag } from "./nesting-DA5vJw9X.js";
2
2
  import { n as MODIFIERS } from "./events-LgLdp1R7.js";
3
- import { C as spread$1, S as rawHTML, b as ownValue, d as escapeAttribute, f as handlerEntry, g as isRaw, n as VOID_ELEMENTS, p as insertValue, r as actionAttributes, s as bindEntry, u as escape, v as onAttribute, w as styleElement } from "./html-t1JpkODI.js";
3
+ import { C as spread$1, S as rawHTML, a as attribute$1, b as ownValue, d as escapeAttribute, f as handlerEntry, g as isRaw, n as VOID_ELEMENTS, p as insertValue, r as actionAttributes, s as bindEntry, u as escape, v as onAttribute, w as styleElement } from "./html-t1JpkODI.js";
4
4
  import { n as deleteCookie, o as setCookie, r as getCookies } from "./cookies-Cnbf4w-S.js";
5
- import { a as plugins, c as functionReferences, i as callPlugins, o as serialOptions, r as toChunkStream, s as syncPlugins, t as STREAM_TYPE } from "./stream-JGRPr7u5.js";
6
- import { a as ElementReference, b as parseId, c as PARTS, d as SlotReference, f as addEntryHandlers, g as isSlotReference, i as ChildrenReference, l as PropPromise, m as isBinding, n as Binding, o as FunctionReference, p as isAsyncIterable, r as CHILDREN_REF, s as MemoError } from "./produce-DS-dQaUX.js";
5
+ import { a as plugins, c as functionReferences, i as callPlugins, o as serialOptions, r as toChunkStream, s as syncPlugins, t as STREAM_TYPE } from "./stream-BdhzvPQO.js";
6
+ import { a as ElementReference, b as parseId, c as PARTS, d as SlotReference, f as addEntryHandlers, g as isSlotReference, i as ChildrenReference, l as PropPromise, m as isBinding, n as Binding, o as FunctionReference, p as isAsyncIterable, r as CHILDREN_REF, s as MemoError } from "./produce-Cq6KKi7b.js";
7
7
  import { n as serverSecrets } from "./secrets-BxagsJxJ.js";
8
8
  import "./context-CTiSzQRc.js";
9
9
  import { a as applyIntent, d as formatPath, f as getAt, m as groupIssues, r as INTENT, u as formValues, v as parseIntent, y as parsePath } from "./forms-nXK7-Lv_.js";
@@ -2156,6 +2156,18 @@ function heldError(error, ctx) {
2156
2156
  return Object.assign(new MemoError(sent), { [Symbol.for("brumate.held")]: true });
2157
2157
  }
2158
2158
  /**
2159
+ * Starts the load of an awaited memo before the statements that it does not
2160
+ * read, where the compiler moves its declaration. It keeps a synchronous
2161
+ * throw of the compute and a rejection in the memo, so the `await` where the
2162
+ * source has it throws them, not the start.
2163
+ */
2164
+ function start(node) {
2165
+ try {
2166
+ const value = ready(node);
2167
+ if (value instanceof Promise) value.catch(() => {});
2168
+ } catch {}
2169
+ }
2170
+ /**
2159
2171
  * Starts every memo of a run of declarations that the render waits for,
2160
2172
  * so they load at the same time. Returns a promise that settles when all
2161
2173
  * of them have, or undefined when none is loading. A memo that fails
@@ -2275,6 +2287,17 @@ function insert(value, ctx, scope, tag, anchor) {
2275
2287
  }
2276
2288
  return insertValue(value);
2277
2289
  }
2290
+ /** True for a promise, or any object with a `then` function, which markup waits for. */
2291
+ function isThenable(value) {
2292
+ return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
2293
+ }
2294
+ /**
2295
+ * Renders an attribute of an element. A promise renders once it settles, so the element is sent
2296
+ * with its final attributes: the render waits for it, as for a promise in text.
2297
+ */
2298
+ function attribute(name, value) {
2299
+ return isThenable(value) ? Promise.resolve(value).then((resolved) => attribute$1(name, resolved)) : attribute$1(name, value);
2300
+ }
2278
2301
  /**
2279
2302
  * Renders a child component. With `scope` and `anchor`, records the child's
2280
2303
  * scope so the parent can update its props on the client.
@@ -2323,7 +2346,13 @@ function dynamic(tag, attributes, content, ctx, scope, ref) {
2323
2346
  } : passed, ctx, scope, bound === void 0 ? void 0 : Number(ownValue("b-b", bound).split(":")[1]));
2324
2347
  }
2325
2348
  const on = [];
2326
- const open = `<${tag}${spread(attributes, on)}${onAttribute(on, "")}>`;
2349
+ const written = spread(attributes, on);
2350
+ if (typeof written !== "string") return written.then((text) => dynamicElement(tag, text, on, content, ctx, scope));
2351
+ return dynamicElement(tag, written, on, content, ctx, scope);
2352
+ }
2353
+ /** Renders a dynamic tag that names an element, with its attributes written. */
2354
+ function dynamicElement(tag, attributes, on, content, ctx, scope) {
2355
+ const open = `<${tag}${attributes}${onAttribute(on, "")}>`;
2327
2356
  if (VOID_ELEMENTS.has(tag)) return open;
2328
2357
  if (isLazy(content)) return Promise.resolve(content[LAZY](ctx, scope)).then((html) => `${open}${html}</${tag}>`);
2329
2358
  return `${open}${content && isRaw(content) ? rawHTML(content) : ""}</${tag}>`;
@@ -2642,6 +2671,7 @@ function stateScript(code, scopes = false, attributes = {}) {
2642
2671
  extra += " b-state";
2643
2672
  if (scopes) extra += " b-scopes";
2644
2673
  if (attributes.next !== void 0) extra += ` b-next="${attributes.next}"`;
2674
+ if (attributes.load !== void 0 && attributes.load.length > 0) extra += ` b-load="${escapeAttribute(attributes.load.join(" "))}"`;
2645
2675
  if (attributes.root) extra += ` b-root="${attributes.root}"`;
2646
2676
  if (attributes.route !== void 0) extra += ` b-route="${escapeAttribute(attributes.route)}"`;
2647
2677
  if (attributes.params !== void 0) extra += ` b-params="${escapeAttribute(JSON.stringify(attributes.params))}"`;
@@ -2717,6 +2747,43 @@ function createQueue() {
2717
2747
  } }
2718
2748
  };
2719
2749
  }
2750
+ /** The bundles of the client build, for a render whose options name none. */
2751
+ let clientBundles;
2752
+ /**
2753
+ * Sets the bundles that a render names when its options name none. The Vite plugin calls it in
2754
+ * a server build with those of the client build, so a server that calls `render()` itself gets
2755
+ * pages whose code loads. The dev server loads each component by its module and sets none.
2756
+ */
2757
+ function setClientBundles(bundles) {
2758
+ clientBundles = bundles;
2759
+ }
2760
+ /** The first bundle that holds each component, for each table of members. */
2761
+ const bundleOwners = /* @__PURE__ */ new WeakMap();
2762
+ /**
2763
+ * Returns the URLs of the bundles that hold the code of the components of `scopes`, other than
2764
+ * those in `sent`. A root loads its own bundle, and another component the first bundle that
2765
+ * holds it, unless a bundle in `sent` holds it. `sent` and `covered` keep the bundles and the
2766
+ * components of the render so far.
2767
+ */
2768
+ function bundleUrls(bundles, scopes, sent, covered) {
2769
+ let owners = bundleOwners.get(bundles.members);
2770
+ if (!owners) {
2771
+ owners = /* @__PURE__ */ new Map();
2772
+ for (const [root, ids] of Object.entries(bundles.members)) for (const id of ids) if (!owners.has(id)) owners.set(id, root);
2773
+ bundleOwners.set(bundles.members, owners);
2774
+ }
2775
+ const urls = [];
2776
+ for (const id of scopes) {
2777
+ if (id === void 0 || covered.has(id)) continue;
2778
+ covered.add(id);
2779
+ const root = bundles.chunks[id] === void 0 ? owners.get(id) : id;
2780
+ if (root === void 0 || sent.has(root)) continue;
2781
+ sent.add(root);
2782
+ urls.push(bundles.chunks[root], ...bundles.styles?.[root] ?? []);
2783
+ for (const member of bundles.members[root] ?? []) covered.add(member);
2784
+ }
2785
+ return urls;
2786
+ }
2720
2787
  /**
2721
2788
  * Renders the parts of a page. It returns as soon as the markup is rendered.
2722
2789
  * `#loading` bodies and promises in the state do not hold it up: they come
@@ -2766,12 +2833,19 @@ async function render(Root, props, options = {}) {
2766
2833
  fallbackDefined = true;
2767
2834
  return `${SHOW_FALLBACK};`;
2768
2835
  }
2836
+ const bundles = options.bundles ?? clientBundles;
2837
+ const sentBundles = /* @__PURE__ */ new Set();
2838
+ const coveredComponents = /* @__PURE__ */ new Set();
2839
+ if (bundles?.loaded) bundleUrls(bundles, bundles.loaded, sentBundles, coveredComponents);
2769
2840
  function serialize(target, onScopes, route, onError = (error) => pending().fail(unsendable(error, target)), last = false) {
2770
2841
  open++;
2771
2842
  serializeState(target, refs, (code, initial) => {
2772
2843
  if (initial) {
2844
+ const ids = [];
2845
+ for (const entry of target.scopes) ids.push(entry.record.m);
2773
2846
  onScopes(stateScript(code, true, {
2774
2847
  next: ctx.next(),
2848
+ load: bundles && bundleUrls(bundles, ids, sentBundles, coveredComponents),
2775
2849
  route,
2776
2850
  root,
2777
2851
  nonce,
@@ -2958,15 +3032,15 @@ function rendersInOrder(option, request) {
2958
3032
  */
2959
3033
  function replaceBlock(html, key, inner) {
2960
3034
  const open = `<!--b${key}-->`;
2961
- const start = html.indexOf(open);
2962
- if (start === -1) return html;
3035
+ const at = html.indexOf(open);
3036
+ if (at === -1) return html;
2963
3037
  const comments = /<!--([^>]*?)-->/g;
2964
- comments.lastIndex = start + open.length;
3038
+ comments.lastIndex = at + open.length;
2965
3039
  let depth = 0;
2966
3040
  for (let found = comments.exec(html); found; found = comments.exec(html)) {
2967
3041
  const data = found[1];
2968
3042
  if (data[0] === "/") {
2969
- if (depth === 0) return html.slice(0, start + open.length) + inner + html.slice(found.index);
3043
+ if (depth === 0) return html.slice(0, at + open.length) + inner + html.slice(found.index);
2970
3044
  depth--;
2971
3045
  } else if (/^[btilP]-?\d/.test(data)) depth++;
2972
3046
  }
@@ -3546,18 +3620,20 @@ async function renderPage(view, props, request, options, extra) {
3546
3620
  }
3547
3621
  const path = new URL(request.url).pathname;
3548
3622
  const endRender = event?.traced("render", path) ?? (() => {});
3549
- let hints = [];
3550
- if (!request.headers.has("x-brumate-base")) {
3551
- const wanted = [...options.hints ?? []];
3552
- for (const id of viewIds(view)) wanted.push(...options.bundleHints?.[id] ?? []);
3553
- hints = [...new Set(wanted)];
3554
- }
3623
+ const navigation = request.headers.has("x-brumate-base");
3624
+ const wanted = navigation ? [] : [...options.hints ?? []];
3625
+ const styles = /* @__PURE__ */ new Set();
3626
+ for (const id of viewIds(view)) for (const url of options.bundleHints?.[id] ?? []) if (url.endsWith(".css")) {
3627
+ if (!url.startsWith(".")) styles.add(url);
3628
+ } else if (!navigation) wanted.push(url);
3629
+ const hints = [...new Set(wanted)];
3555
3630
  const nonce = options.nonce === void 0 ? "" : ` nonce="${escapeAttribute(options.nonce)}"`;
3556
3631
  const links = [];
3557
3632
  if (!nonce) for (const url of hints) links.push(`<${url}>; rel=modulepreload`);
3558
3633
  if (links.length > 0) options.earlyHints?.(links);
3559
3634
  let preload = "";
3560
3635
  for (const url of hints) preload += `<link rel="modulepreload"${nonce} href="${escapeAttribute(url)}">`;
3636
+ for (const url of styles) preload += `<link rel="stylesheet"${nonce} href="${escapeAttribute(url)}">`;
3561
3637
  const parts = await render(viewComponent(view, props), {}, {
3562
3638
  ...options,
3563
3639
  request,
@@ -3629,13 +3705,18 @@ function deferTarget(request) {
3629
3705
  * data of the page changed, the answer is 409 and the fallback stays.
3630
3706
  */
3631
3707
  async function renderDeferred(view, props, request, options, defer, base) {
3708
+ const bundles = options.bundles ?? clientBundles;
3632
3709
  const parts = await render(viewComponent(view, props), {}, {
3633
3710
  ...options,
3634
3711
  request,
3635
3712
  route: view.key,
3636
3713
  params: props.params,
3637
3714
  base: Number.isSafeInteger(base) && base > 0 ? base : void 0,
3638
- defer
3715
+ defer,
3716
+ bundles: bundles && {
3717
+ ...bundles,
3718
+ loaded: viewIds(view)
3719
+ }
3639
3720
  });
3640
3721
  const headers = new Headers(parts.headers);
3641
3722
  headers.append("vary", "x-brumate-defer");
@@ -3861,6 +3942,14 @@ async function renderRoute(match, request, url, options) {
3861
3942
  * refers to nothing in the browser is left out.
3862
3943
  */
3863
3944
  function spread(attributes, on, names) {
3945
+ for (const value of Object.values(attributes)) if (isThenable(value)) {
3946
+ const keys = Object.keys(attributes);
3947
+ return Promise.all(Object.values(attributes)).then((values) => {
3948
+ const resolved = {};
3949
+ for (const [index, name] of keys.entries()) resolved[name] = values[index];
3950
+ return spread(resolved, on, names);
3951
+ });
3952
+ }
3864
3953
  const entries = on && ownValue("b-on", attributes["b-on"]);
3865
3954
  if (typeof entries === "string") {
3866
3955
  on.unshift(entries);
@@ -3884,6 +3973,6 @@ function spread(attributes, on, names) {
3884
3973
  return spread$1(attributes, names);
3885
3974
  }
3886
3975
  //#endregion
3887
- export { isRedirect as $, waitAll as A, parseForm as B, spacerTag as C, streamParts as D, stateValue as E, rateLimit as F, revalidate as G, matchRoute as H, parseSubmission as I, RequestEvent as J, setCacheStore as K, ValidationError as L, RateLimitError as M, clientAddress as N, streamState as O, configureRateLimit as P, getEvent as Q, fieldErrors as R, settled as S, stateScript as T, cached as U, safeParse as V, memoryStore as W, dedupe as X, ServerError as Y, defineMiddleware as Z, packState as _, binding as a, render as b, component as c, handleRoute as d, redirect as et, inlineBodies as f, memo as g, lazy as h, actionResult as i, idempotent as j, wait as k, dynamic as l, isCrossSite as m, NotReady as n, caught as o, insert as p, storageStore as q, action as r, children as s, Context as t, withEvent as tt, handleRequest as u, read as v, spread as w, renderToStream as x, ready as y, parse as z };
3976
+ export { dedupe as $, streamParts as A, ValidationError as B, setClientBundles as C, start as D, spread as E, RateLimitError as F, matchRoute as G, parse as H, clientAddress as I, revalidate as J, cached as K, configureRateLimit as L, wait as M, waitAll as N, stateScript as O, idempotent as P, ServerError as Q, rateLimit as R, renderToStream as S, spacerTag as T, parseForm as U, fieldErrors as V, safeParse as W, storageStore as X, setCacheStore as Y, RequestEvent as Z, memo as _, attribute as a, ready as b, children as c, handleRequest as d, defineMiddleware as et, handleRoute as f, lazy as g, isCrossSite as h, actionResult as i, withEvent as it, streamState as j, stateValue as k, component as l, insert as m, NotReady as n, isRedirect as nt, binding as o, inlineBodies as p, memoryStore as q, action as r, redirect as rt, caught as s, Context as t, getEvent as tt, dynamic as u, packState as v, settled as w, render as x, read as y, parseSubmission as z };
3888
3977
 
3889
- //# sourceMappingURL=server-O_rC-RRL.js.map
3978
+ //# sourceMappingURL=server-Doy5HR7r.js.map