@absolutejs/absolute 0.20.0-beta.181 → 0.20.0-beta.183

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 (126) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/changelog.json +75 -0
  3. package/dist/angular/browser.js +2 -2
  4. package/dist/angular/browser.js.map +4 -4
  5. package/dist/angular/components/constants.js +4 -0
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  7. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  8. package/dist/angular/index.js +520 -84
  9. package/dist/angular/index.js.map +13 -12
  10. package/dist/angular/server.js +520 -84
  11. package/dist/angular/server.js.map +13 -12
  12. package/dist/build.js +452 -85
  13. package/dist/build.js.map +18 -18
  14. package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
  15. package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
  16. package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
  17. package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
  18. package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
  19. package/dist/cli/{build-ptx5a72p.js → build-df81wh71.js} +67 -6
  20. package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-01s87hnk.js → buildReactServerComponents-k6amghrj.js} +5 -5
  23. package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
  24. package/dist/cli/config/server.js +37 -18
  25. package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
  26. package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
  27. package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
  28. package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
  29. package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
  30. package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
  31. package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
  32. package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
  33. package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
  34. package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
  35. package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
  36. package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
  37. package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
  38. package/dist/cli/{index-jkg2h10c.js → index-3dz754hk.js} +3 -3
  39. package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
  40. package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
  41. package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
  42. package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
  43. package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
  44. package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
  45. package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
  46. package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
  47. package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
  48. package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
  49. package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
  50. package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
  51. package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
  52. package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
  53. package/dist/cli/{index-5w8arh3m.js → index-pq4qqz0r.js} +2 -2
  54. package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
  55. package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
  56. package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
  57. package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
  58. package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
  59. package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
  60. package/dist/cli/index.js +32 -32
  61. package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
  62. package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
  63. package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
  64. package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
  65. package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
  66. package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
  67. package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
  68. package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
  69. package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
  70. package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
  71. package/dist/cli/prerender-26pzynh4.js +13 -0
  72. package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
  73. package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
  74. package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
  75. package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
  76. package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
  77. package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
  78. package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
  79. package/dist/cli/{typecheck-ynzw2eep.js → typecheck-bvm0ndq4.js} +188 -75
  80. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  81. package/dist/dev/serverBootstrap.js +8 -2
  82. package/dist/index.js +469 -99
  83. package/dist/index.js.map +20 -20
  84. package/dist/islands/index.js +312 -23
  85. package/dist/islands/index.js.map +5 -5
  86. package/dist/mobile/index.js +2 -2
  87. package/dist/mobile/index.js.map +3 -3
  88. package/dist/react/browser.js +18 -1
  89. package/dist/react/browser.js.map +6 -4
  90. package/dist/react/components/index.js +2 -2
  91. package/dist/react/components/index.js.map +3 -3
  92. package/dist/react/index.js +370 -62
  93. package/dist/react/index.js.map +14 -13
  94. package/dist/react/server.js +51 -36
  95. package/dist/react/server.js.map +10 -10
  96. package/dist/src/angular/colocatedRouteMatch.d.ts +23 -0
  97. package/dist/src/angular/components/constants.d.ts +1 -0
  98. package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
  99. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  100. package/dist/src/cli/scripts/typecheck.d.ts +1 -0
  101. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +41 -0
  102. package/dist/src/constants.d.ts +1 -0
  103. package/dist/src/core/prerender.d.ts +10 -0
  104. package/dist/src/dev/hot/analyze.d.ts +1 -1
  105. package/dist/src/react/browser.d.ts +1 -0
  106. package/dist/src/react/index.d.ts +1 -0
  107. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
  108. package/dist/src/utils/pageCspNonce.d.ts +14 -0
  109. package/dist/src/utils/spaRouteManifest.d.ts +1 -0
  110. package/dist/svelte/index.js +372 -69
  111. package/dist/svelte/index.js.map +11 -11
  112. package/dist/svelte/server.js +363 -60
  113. package/dist/svelte/server.js.map +11 -11
  114. package/dist/types/manifest.d.ts +3 -2
  115. package/dist/types/svelte.d.ts +3 -0
  116. package/dist/vue/components/Image.js +2 -2
  117. package/dist/vue/components/Image.js.map +3 -3
  118. package/dist/vue/components/index.js +2 -2
  119. package/dist/vue/components/index.js.map +3 -3
  120. package/dist/vue/index.js +364 -61
  121. package/dist/vue/index.js.map +11 -11
  122. package/dist/vue/server.js +54 -40
  123. package/dist/vue/server.js.map +9 -9
  124. package/package.json +1 -1
  125. package/dist/cli/prerender-w65xp6h8.js +0 -11
  126. /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
package/dist/build.js CHANGED
@@ -73,7 +73,7 @@ var __esm = (fn, res, err) => () => {
73
73
  var __require = import.meta.require;
74
74
 
75
75
  // src/constants.ts
76
- var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
76
+ var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTML_CONTENT_TYPE = "text/html; charset=utf-8", HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
77
77
  var init_constants = __esm(() => {
78
78
  TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
79
79
  IMAGE_DEFAULT_DEVICE_SIZES = [
@@ -4002,9 +4002,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
4002
4002
  tail: ""
4003
4003
  };
4004
4004
  };
4005
- const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
4005
+ const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
4006
4006
  if (winner.kind !== "base") {
4007
- return { baseDone: false, baseRead, footer, handled: false, tail };
4007
+ return { baseDone, baseRead, footer, handled: false, tail };
4008
4008
  }
4009
4009
  if (winner.done) {
4010
4010
  return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
@@ -4047,7 +4047,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
4047
4047
  return footer;
4048
4048
  }
4049
4049
  const winner = await Promise.race(racers);
4050
- const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
4050
+ const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
4051
4051
  handleResolvedSlot(controller, slotWinner);
4052
4052
  });
4053
4053
  ({ baseDone, baseRead, footer, tail } = baseWinnerState);
@@ -5543,23 +5543,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
5543
5543
  index = markup.indexOf("{", end);
5544
5544
  }
5545
5545
  return tags;
5546
- }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), markupToTemplateLiteral = (markup) => {
5547
- const parts = topLevelTags(markup.trim());
5548
- const trimmed = markup.trim();
5549
- let cursor = 0;
5550
- let literal = "";
5551
- for (const { end, start, text } of parts) {
5552
- literal += escapeTemplateLiteral(trimmed.slice(cursor, start));
5553
- literal += `\${${text.slice(1, -1).trim()}}`;
5554
- cursor = end;
5546
+ }, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), HTML_HELPERS = "__absoluteAwaitHtml", AWAIT_SCOPE_CLASS_PLACEHOLDER = "__absoluteAwaitScopeClass__", AWAIT_HTML_HELPERS_SOURCE, applyAwaitScopeClass = (code, scopeClass) => code.replaceAll(AWAIT_SCOPE_CLASS_PLACEHOLDER, scopeClass), createAwaitScopeClassCapture = () => {
5547
+ let scopeClass = "";
5548
+ const cssHash = ({ css, filename, hash }) => {
5549
+ scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
5550
+ return scopeClass;
5551
+ };
5552
+ const apply = (code) => applyAwaitScopeClass(code, scopeClass);
5553
+ return { apply, cssHash };
5554
+ }, BOOLEAN_ATTRIBUTES, DIRECTIVE_ATTRIBUTE_RE, ATTRIBUTE_NAME_END_RE, RAW_TEXT_ELEMENTS, helperCall = (name, ...args) => `\${${HTML_HELPERS}.${name}(${args.join(", ")})}`, SHADOW_VALUE, END_TAG_RE, isShadowAttribute = (name) => !DIRECTIVE_ATTRIBUTE_RE.test(name) && !/^on/i.test(name), pushText = (scan, text) => {
5555
+ scan.literal += escapeTemplateLiteral(text);
5556
+ }, readExpressionTag = (scan) => {
5557
+ const end = findTagEnd(scan.source, scan.index);
5558
+ if (end === -1) {
5559
+ fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
5560
+ }
5561
+ const inner = scan.source.slice(scan.index + 1, end - 1).trim();
5562
+ scan.index = end;
5563
+ return inner;
5564
+ }, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
5565
+ const char = scan.source[scan.index] ?? "";
5566
+ if (quote)
5567
+ return char === quote;
5568
+ return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
5569
+ }, readValueText = (scan, quote) => {
5570
+ const start = scan.index;
5571
+ while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
5572
+ scan.index += 1;
5573
+ }
5574
+ return scan.source.slice(start, scan.index);
5575
+ }, readAttributeValue = (scan) => {
5576
+ const { source } = scan;
5577
+ const quote = source[scan.index];
5578
+ const chunks = [];
5579
+ const isQuoted = quote === '"' || quote === "'";
5580
+ if (isQuoted)
5581
+ scan.index += 1;
5582
+ if (!isQuoted && source[scan.index] === "{") {
5583
+ chunks.push({ code: readExpressionTag(scan) });
5584
+ return chunks;
5585
+ }
5586
+ const valueQuote = isQuoted ? quote : undefined;
5587
+ while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
5588
+ chunks.push({ text: readValueText(scan, valueQuote) });
5589
+ if (source[scan.index] === "{")
5590
+ chunks.push({ code: readExpressionTag(scan) });
5591
+ }
5592
+ if (isQuoted)
5593
+ scan.index += 1;
5594
+ return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
5595
+ }, pushDynamicAttribute = (scan, name, chunks) => {
5596
+ if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
5597
+ failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
5598
+ }
5599
+ const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
5600
+ if (tag && "code" in tag) {
5601
+ failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
5602
+ }
5603
+ if (isShadowAttribute(name))
5604
+ scan.shadow += ` ${name}=${SHADOW_VALUE}`;
5605
+ const isClass = name === "class";
5606
+ if (isClass)
5607
+ scan.hasClass = true;
5608
+ const [only] = chunks;
5609
+ const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
5610
+ if (isClass && chunks.length > 1 && codes.length === chunks.length) {
5611
+ scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
5612
+ return;
5613
+ }
5614
+ if (chunks.length === 1 && only && "code" in only) {
5615
+ const value = `(${only.code})`;
5616
+ if (name === "class")
5617
+ scan.literal += helperCall("class", value);
5618
+ else if (name === "style")
5619
+ scan.literal += helperCall("style", value);
5620
+ else
5621
+ scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
5622
+ return;
5623
+ }
5624
+ pushText(scan, ` ${name}="`);
5625
+ for (const chunk of chunks) {
5626
+ if ("code" in chunk)
5627
+ scan.literal += helperCall("part", `(${chunk.code})`);
5628
+ else
5629
+ pushText(scan, chunk.text.replaceAll('"', "&quot;"));
5630
+ }
5631
+ if (isClass)
5632
+ scan.literal += helperCall("scoped");
5633
+ pushText(scan, '"');
5634
+ }, pushStaticAttribute = (scan, whitespace, name, value) => {
5635
+ if (isShadowAttribute(name))
5636
+ scan.shadow += `${whitespace}${name}=${value}`;
5637
+ if (name !== "class") {
5638
+ pushText(scan, `${whitespace}${name}=${value}`);
5639
+ return;
5640
+ }
5641
+ scan.hasClass = true;
5642
+ const [first = ""] = value;
5643
+ const isQuoted = first === '"' || first === "'";
5644
+ const quote = isQuoted ? first : '"';
5645
+ const classes = isQuoted ? value.slice(1, -1) : value;
5646
+ if (classes === "") {
5647
+ scan.literal += helperCall("class", "''");
5648
+ return;
5649
+ }
5650
+ pushText(scan, `${whitespace}${name}=${quote}${classes}`);
5651
+ scan.literal += helperCall("scoped");
5652
+ pushText(scan, quote);
5653
+ }, readAttributeName = (scan) => {
5654
+ const { source } = scan;
5655
+ const start = scan.index;
5656
+ while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
5657
+ scan.index += 1;
5658
+ }
5659
+ return source.slice(start, scan.index);
5660
+ }, skipWhitespace = (scan) => {
5661
+ const start = scan.index;
5662
+ while (/\s/.test(scan.source[scan.index] ?? ""))
5663
+ scan.index += 1;
5664
+ return scan.source.slice(start, scan.index);
5665
+ }, pushTagExpression = (scan) => {
5666
+ const inner = readExpressionTag(scan);
5667
+ if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
5668
+ failAttribute(scan, `{${inner}} in a start tag`);
5669
+ }
5670
+ pushDynamicAttribute(scan, inner, [{ code: inner }]);
5671
+ }, pushAttribute = (scan) => {
5672
+ const { source } = scan;
5673
+ const whitespace = skipWhitespace(scan);
5674
+ const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
5675
+ const isEnd = scan.index >= source.length;
5676
+ if (isEnd || source.startsWith(closing, scan.index)) {
5677
+ if (!scan.hasClass)
5678
+ scan.literal += helperCall("scope");
5679
+ const tagEnd = isEnd ? "" : closing;
5680
+ pushText(scan, whitespace + tagEnd);
5681
+ scan.shadow += whitespace + (isEnd ? ">" : closing);
5682
+ scan.index += tagEnd.length;
5683
+ return false;
5684
+ }
5685
+ if (source[scan.index] === "{") {
5686
+ pushTagExpression(scan);
5687
+ return true;
5688
+ }
5689
+ const name = readAttributeName(scan);
5690
+ if (!name) {
5691
+ pushText(scan, whitespace + (source[scan.index] ?? ""));
5692
+ scan.index += 1;
5693
+ return true;
5694
+ }
5695
+ const beforeEquals = scan.index;
5696
+ skipWhitespace(scan);
5697
+ if (source[scan.index] !== "=") {
5698
+ scan.index = beforeEquals;
5699
+ pushText(scan, whitespace + name);
5700
+ if (isShadowAttribute(name))
5701
+ scan.shadow += whitespace + name;
5702
+ return true;
5555
5703
  }
5556
- literal += escapeTemplateLiteral(trimmed.slice(cursor));
5557
- return `\`${literal}\``;
5704
+ scan.index += 1;
5705
+ skipWhitespace(scan);
5706
+ const valueStart = scan.index;
5707
+ const chunks = readAttributeValue(scan);
5708
+ if (chunks.some((chunk) => ("code" in chunk))) {
5709
+ pushDynamicAttribute(scan, name, chunks);
5710
+ return true;
5711
+ }
5712
+ pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
5713
+ return true;
5714
+ }, pushStartTag = (scan) => {
5715
+ const { source } = scan;
5716
+ const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
5717
+ const tagName = nameMatch?.[0] ?? "";
5718
+ pushText(scan, `<${tagName}`);
5719
+ scan.shadow += `<${tagName}`;
5720
+ scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
5721
+ scan.index += 1 + tagName.length;
5722
+ while (pushAttribute(scan))
5723
+ ;
5724
+ return tagName.toLowerCase();
5725
+ }, pushRawText = (scan, tagName, shadowStart) => {
5726
+ const { source } = scan;
5727
+ const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
5728
+ const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
5729
+ const end = closeEnd === -1 ? source.length : closeEnd + 1;
5730
+ pushText(scan, source.slice(scan.index, end));
5731
+ scan.shadow = scan.shadow.slice(0, shadowStart);
5732
+ scan.index = end;
5733
+ }, pushTextExpression = (scan) => {
5734
+ const inner = readExpressionTag(scan);
5735
+ const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
5736
+ if (rawHtml) {
5737
+ scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
5738
+ return;
5739
+ }
5740
+ scan.literal += helperCall("text", `(${inner})`);
5741
+ }, pushComment = (scan) => {
5742
+ const close = scan.source.indexOf("-->", scan.index + "<!--".length);
5743
+ const end = close === -1 ? scan.source.length : close + "-->".length;
5744
+ pushText(scan, scan.source.slice(scan.index, end));
5745
+ scan.index = end;
5746
+ }, scanTextPosition = (scan) => {
5747
+ const { index, source } = scan;
5748
+ if (source.startsWith("<!--", index)) {
5749
+ pushComment(scan);
5750
+ return;
5751
+ }
5752
+ if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
5753
+ const shadowStart = scan.shadow.length;
5754
+ const tagName = pushStartTag(scan);
5755
+ if (RAW_TEXT_ELEMENTS.has(tagName))
5756
+ pushRawText(scan, tagName, shadowStart);
5757
+ return;
5758
+ }
5759
+ if (source[index] === "{") {
5760
+ pushTextExpression(scan);
5761
+ return;
5762
+ }
5763
+ const next = source.slice(index + 1).search(/[<{]/);
5764
+ const end = next === -1 ? source.length : index + 1 + next;
5765
+ const text = source.slice(index, end);
5766
+ pushText(scan, text);
5767
+ scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
5768
+ scan.index = end;
5769
+ }, lowerBranch = (markup, branch, filePath) => {
5770
+ const scan = {
5771
+ branch,
5772
+ filePath,
5773
+ hasClass: false,
5774
+ index: 0,
5775
+ literal: "",
5776
+ shadow: "",
5777
+ source: markup.trim()
5778
+ };
5779
+ while (scan.index < scan.source.length)
5780
+ scanTextPosition(scan);
5781
+ return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
5558
5782
  }, fail = (filePath, message) => {
5559
5783
  throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
5560
5784
  }, assertPlainHtml = (markup, branch, filePath) => {
5561
5785
  const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
5562
- const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[#:/@]/.test(text));
5786
+ const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
5563
5787
  if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
5564
5788
  fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
5565
5789
  }
@@ -5603,12 +5827,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
5603
5827
  thenIdentifier: thenMatch?.[2],
5604
5828
  thenMarkup
5605
5829
  };
5606
- }, renderSlot = (block, slotId, dynamic) => {
5830
+ }, renderSlot = (block, slotId, dynamic, filePath) => {
5607
5831
  const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
5608
5832
  const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
5609
- const catchBranch = block.catchMarkup === undefined ? "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }" : `catch (${catchValueIdentifier}) { return ${markupToTemplateLiteral(block.catchMarkup)}; }`;
5610
- return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${markupToTemplateLiteral(block.pendingMarkup)}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${markupToTemplateLiteral(block.thenMarkup)}; } ${catchBranch} }} />`;
5611
- }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', lowerSvelteAwaitSlotSyntax = (source, filePath) => {
5833
+ const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
5834
+ const then = lowerBranch(block.thenMarkup, "then", filePath);
5835
+ const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
5836
+ const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
5837
+ const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
5838
+ return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${pending.literal}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${then.literal}; } ${catchBranch} }} />{#if ${HTML_HELPERS}.shadow}${shadows}{/if}`;
5839
+ }, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
5612
5840
  if (!source.includes("absolute:stream")) {
5613
5841
  return { code: source, transformed: false };
5614
5842
  }
@@ -5623,7 +5851,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
5623
5851
  const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
5624
5852
  awaitIndex += 1;
5625
5853
  lowered += source.slice(cursor, directive.index);
5626
- lowered += renderSlot(block, slotId, directive[1] !== undefined);
5854
+ lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
5627
5855
  cursor = block.end;
5628
5856
  }
5629
5857
  if (awaitIndex === 0) {
@@ -5633,14 +5861,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
5633
5861
  if (lowered.includes("<script")) {
5634
5862
  return {
5635
5863
  code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
5636
- ${IMPORT_LINE}
5864
+ ${INJECTED_SCRIPT}
5637
5865
  `),
5638
5866
  transformed: true
5639
5867
  };
5640
5868
  }
5641
5869
  return {
5642
5870
  code: `<script lang="ts">
5643
- ${IMPORT_LINE}
5871
+ ${INJECTED_SCRIPT}
5644
5872
  </script>
5645
5873
  ${lowered}`,
5646
5874
  transformed: true
@@ -5652,6 +5880,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
5652
5880
  BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
5653
5881
  SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
5654
5882
  QUOTES = new Set(['"', "'", "`"]);
5883
+ AWAIT_HTML_HELPERS_SOURCE = [
5884
+ `const ${HTML_HELPERS} = (() => {`,
5885
+ ` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
5886
+ ` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&amp;' : char === '"' ? '&quot;' : '&lt;');`,
5887
+ "\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
5888
+ "\tconst classNames = (value) => { if (Array.isArray(value)) return value.filter(Boolean).map(classNames).filter(Boolean).join(' '); if (value && typeof value === 'object') return Object.keys(value).filter((key) => value[key]).join(' '); return typeof value === 'string' || typeof value === 'number' ? String(value) : ''; };",
5889
+ "\treturn {",
5890
+ ` attr: (name, value, isBoolean) => { const boolean = isBoolean || (name === 'hidden' && value !== 'until-found'); if (value == null || (!value && boolean)) return ''; const normalized = name === 'translate' && typeof value === 'boolean' ? (value ? 'yes' : 'no') : value; return boolean ? ' ' + name + '=""' : ' ' + name + '="' + escape(normalized, true) + '"'; },`,
5891
+ ` class: (value) => { const resolved = typeof value === 'object' ? classNames(value) : value ?? ''; let name = '' + resolved; if (scope) name = name ? name + ' ' + scope : scope; return name ? ' class="' + escape(name, true) + '"' : ''; },`,
5892
+ "\t\thtml: (value) => String(value ?? ''),",
5893
+ "\t\tjoin: (...values) => values.map(stringify).join(''),",
5894
+ "\t\tpart: (value) => escape(stringify(value), true),",
5895
+ ` scope: () => scope ? ' class="' + scope + '"' : '',`,
5896
+ "\t\tscoped: () => scope ? ' ' + scope : '',",
5897
+ "\t\tshadow: false,",
5898
+ ` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
5899
+ "\t\ttext: (value) => escape(value, false)",
5900
+ "\t};",
5901
+ "})();"
5902
+ ].join(`
5903
+ `);
5904
+ BOOLEAN_ATTRIBUTES = new Set([
5905
+ "allowfullscreen",
5906
+ "async",
5907
+ "autofocus",
5908
+ "autoplay",
5909
+ "checked",
5910
+ "controls",
5911
+ "default",
5912
+ "defer",
5913
+ "disabled",
5914
+ "disablepictureinpicture",
5915
+ "disableremoteplayback",
5916
+ "formnovalidate",
5917
+ "indeterminate",
5918
+ "inert",
5919
+ "ismap",
5920
+ "loop",
5921
+ "multiple",
5922
+ "muted",
5923
+ "nomodule",
5924
+ "novalidate",
5925
+ "open",
5926
+ "playsinline",
5927
+ "readonly",
5928
+ "required",
5929
+ "reversed",
5930
+ "seamless",
5931
+ "selected",
5932
+ "webkitdirectory"
5933
+ ]);
5934
+ DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
5935
+ ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
5936
+ RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
5937
+ SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
5938
+ END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
5939
+ INJECTED_SCRIPT = `${IMPORT_LINE}
5940
+ ${AWAIT_HTML_HELPERS_SOURCE}`;
5655
5941
  });
5656
5942
 
5657
5943
  // src/svelte/router/lazyModule.ts
@@ -5847,15 +6133,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
5847
6133
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
5848
6134
  transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
5849
6135
  }
5850
- let compiledCode = compile(transpiled, {
6136
+ const scopeClass = createAwaitScopeClassCapture();
6137
+ const compiledServer = compile(transpiled, {
5851
6138
  css: "injected",
6139
+ cssHash: scopeClass.cssHash,
5852
6140
  experimental: {
5853
6141
  async: loweredAwaitSource.transformed || loweredSource.transformed
5854
6142
  },
5855
6143
  filename: resolutionSourcePath,
5856
6144
  generate: "server",
5857
6145
  hmr: isDevelopmentRuntime()
5858
- }).js.code;
6146
+ });
6147
+ let compiledCode = scopeClass.apply(compiledServer.js.code);
5859
6148
  for (const [spec, compiledChildPath] of childModulePaths) {
5860
6149
  compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
5861
6150
  }
@@ -6559,43 +6848,91 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
6559
6848
  include chain: ${context.chain.map((path) => describe(path, context.root)).join(" \u2192 ")}`), findTagClose = (html, start) => {
6560
6849
  const match = /^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(html.slice(start));
6561
6850
  return match ? start + match[0].length : -1;
6562
- }, findElement = (html, tag, from) => {
6563
- const opening = new RegExp(`<${tag}(?=[\\s/>])`, "gi");
6564
- opening.lastIndex = from;
6565
- const first = opening.exec(html);
6566
- if (!first)
6851
+ }, readOpeningTag = (html, tag, start) => {
6852
+ const end = findTagClose(html, start);
6853
+ const raw = html.slice(start + tag.length + 1, end === -1 ? html.length : end - 1);
6854
+ const selfClosing = end !== -1 && raw.trimEnd().endsWith("/");
6855
+ const opening = {
6856
+ attributes: selfClosing ? raw.trimEnd().slice(0, -1) : raw,
6857
+ closing: false,
6858
+ end,
6859
+ selfClosing,
6860
+ start
6861
+ };
6862
+ return opening;
6863
+ }, nextTag = (html, tag, from) => {
6864
+ const tokens = new RegExp(`<${tag}(?=[\\s/>])|</${tag}\\s*>`, "gi");
6865
+ tokens.lastIndex = from;
6866
+ const token = tokens.exec(html);
6867
+ if (!token)
6567
6868
  return null;
6568
- const tagEnd = findTagClose(html, first.index);
6569
- if (tagEnd === -1)
6869
+ if (!token[0].startsWith("</"))
6870
+ return readOpeningTag(html, tag, token.index);
6871
+ const closing = {
6872
+ attributes: "",
6873
+ closing: true,
6874
+ end: token.index + token[0].length,
6875
+ selfClosing: false,
6876
+ start: token.index
6877
+ };
6878
+ return closing;
6879
+ }, depthChange = (token) => {
6880
+ if (token.selfClosing)
6881
+ return 0;
6882
+ return token.closing ? -1 : 1;
6883
+ }, findElement = (html, tag, from) => {
6884
+ let open = nextTag(html, tag, from);
6885
+ while (open?.closing)
6886
+ open = nextTag(html, tag, open.end);
6887
+ if (!open || open.end === -1)
6570
6888
  return null;
6571
- const attributes = html.slice(first.index + tag.length + 1, tagEnd - 1);
6572
- if (attributes.trimEnd().endsWith("/")) {
6573
- const selfClosing = {
6574
- attributes: attributes.trimEnd().slice(0, -1),
6575
- end: tagEnd,
6889
+ if (open.selfClosing) {
6890
+ const empty = {
6891
+ attributes: open.attributes,
6892
+ end: open.end,
6576
6893
  inner: "",
6577
- start: first.index
6894
+ start: open.start
6578
6895
  };
6579
- return selfClosing;
6896
+ return empty;
6580
6897
  }
6581
- const tokens = new RegExp(`<${tag}(?=[\\s/>])|</${tag}\\s*>`, "gi");
6582
- tokens.lastIndex = tagEnd;
6583
6898
  let depth = 1;
6584
- let token = tokens.exec(html);
6585
- while (token && depth > 0) {
6586
- depth += token[0].startsWith("</") ? -1 : 1;
6587
- if (depth > 0)
6588
- token = tokens.exec(html);
6899
+ let token = nextTag(html, tag, open.end);
6900
+ while (token && token.end !== -1) {
6901
+ depth += depthChange(token);
6902
+ if (depth === 0)
6903
+ break;
6904
+ token = nextTag(html, tag, token.end);
6589
6905
  }
6590
- if (!token)
6906
+ if (!token || token.end === -1)
6591
6907
  return null;
6592
6908
  const element = {
6593
- attributes,
6594
- end: token.index + token[0].length,
6595
- inner: html.slice(tagEnd, token.index),
6596
- start: first.index
6909
+ attributes: open.attributes,
6910
+ end: token.end,
6911
+ inner: html.slice(open.end, token.start),
6912
+ start: open.start
6597
6913
  };
6598
6914
  return element;
6915
+ }, lineOf = (html, index) => html.slice(0, index).split(`
6916
+ `).length, assertBalanced = (html, tag, file, context) => {
6917
+ const open = [];
6918
+ let token = nextTag(html, tag, 0);
6919
+ while (token) {
6920
+ const where = `${describe(file, context.root)}:${lineOf(html, token.start)}`;
6921
+ if (token.end === -1)
6922
+ throw includeError(context, `Unterminated <${tag}> tag in ${where}`);
6923
+ if (token.closing && !open.pop())
6924
+ throw includeError(context, `</${tag}> without a matching <${tag}> in ${where}`);
6925
+ if (!token.closing && !token.selfClosing)
6926
+ open.push(token);
6927
+ token = nextTag(html, tag, token.end);
6928
+ }
6929
+ const [unclosed] = open;
6930
+ if (!unclosed)
6931
+ return;
6932
+ throw includeError(context, `Unclosed <${tag}${unclosed.attributes.trimEnd()}> in ${describe(file, context.root)}:${lineOf(html, unclosed.start)}: close it with </${tag}> or make it self-closing (<${tag} \u2026 />)`);
6933
+ }, INCLUDE_TAGS, assertIncludeTagsBalanced = (html, file, context) => {
6934
+ for (const tag of INCLUDE_TAGS)
6935
+ assertBalanced(html, tag, file, context);
6599
6936
  }, readAttribute = (attributes, name) => new RegExp(`(?:^|\\s)${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i").exec(attributes)?.slice(1).find((value) => value !== undefined), replaceElements = (html, tag, replace) => {
6600
6937
  let output = "";
6601
6938
  let cursor = 0;
@@ -6637,6 +6974,7 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
6637
6974
  throw includeError({ ...context, chain }, `<abs-include src="${src}"> in ${describe(file, context.root)}: file not found (${target})`);
6638
6975
  }
6639
6976
  context.dependencies.add(target);
6977
+ assertIncludeTagsBalanced(source, target, { ...context, chain });
6640
6978
  const values = new Map([...collectSlotValues(element.inner)].map(([name, value]) => [
6641
6979
  name,
6642
6980
  expandWithin(value, file, context)
@@ -6661,10 +6999,13 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
6661
6999
  readFile: options.readFile ?? readUtf8,
6662
7000
  root: options.root ?? process.cwd()
6663
7001
  };
7002
+ assertIncludeTagsBalanced(html, file, context);
6664
7003
  const expanded = expandWithin(html, file, context);
6665
7004
  return { dependencies: [...context.dependencies], html: expanded };
6666
7005
  };
6667
- var init_htmlIncludes = () => {};
7006
+ var init_htmlIncludes = __esm(() => {
7007
+ INCLUDE_TAGS = ["abs-include", "abs-slot"];
7008
+ });
6668
7009
 
6669
7010
  // src/build/spaSideManifests.ts
6670
7011
  import { writeFile as writeFile4 } from "fs/promises";
@@ -15698,7 +16039,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15698
16039
  nonce: readCspNonce()
15699
16040
  });
15700
16041
  return new Response(stream, {
15701
- headers: { "Content-Type": "text/html" },
16042
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15702
16043
  status: 500
15703
16044
  });
15704
16045
  }, renderSvelteError = async (conventionPath, errorProps) => {
@@ -15714,7 +16055,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15714
16055
  });
15715
16056
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
15716
16057
  return new Response(html, {
15717
- headers: { "Content-Type": "text/html" },
16058
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15718
16059
  status: 500
15719
16060
  });
15720
16061
  }, unescapeVueStyles = (ssrBody) => {
@@ -15738,7 +16079,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15738
16079
  const { styles, body } = unescapeVueStyles(rawBody);
15739
16080
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
15740
16081
  return new Response(html, {
15741
- headers: { "Content-Type": "text/html" },
16082
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15742
16083
  status: 500
15743
16084
  });
15744
16085
  }, renderAngularError = async (conventionPath, errorProps) => {
@@ -15748,14 +16089,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15748
16089
  return null;
15749
16090
  const html = renderFn(errorProps);
15750
16091
  return new Response(html, {
15751
- headers: { "Content-Type": "text/html" },
16092
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15752
16093
  status: 500
15753
16094
  });
15754
16095
  }, escapeHtml = (value) => value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : ""), renderHtmlError = async (conventionPath, errorProps) => {
15755
16096
  const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
15756
16097
  const html = replaceErrorTokens(template, errorProps);
15757
16098
  return new Response(html, {
15758
- headers: { "Content-Type": "text/html" },
16099
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15759
16100
  status: 500
15760
16101
  });
15761
16102
  }, logConventionRenderError = (framework, label, renderError) => {
@@ -15834,7 +16175,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15834
16175
  nonce: readCspNonce()
15835
16176
  });
15836
16177
  return new Response(stream, {
15837
- headers: { "Content-Type": "text/html" },
16178
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15838
16179
  status: 404
15839
16180
  });
15840
16181
  }, renderSvelteNotFound = async (conventionPath) => {
@@ -15847,7 +16188,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15847
16188
  const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
15848
16189
  const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
15849
16190
  return new Response(html, {
15850
- headers: { "Content-Type": "text/html" },
16191
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15851
16192
  status: 404
15852
16193
  });
15853
16194
  }, renderVueNotFound = async (conventionPath) => {
@@ -15864,7 +16205,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15864
16205
  const { styles, body } = unescapeVueStyles(rawBody);
15865
16206
  const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
15866
16207
  return new Response(html, {
15867
- headers: { "Content-Type": "text/html" },
16208
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15868
16209
  status: 404
15869
16210
  });
15870
16211
  }, renderAngularNotFound = async (conventionPath) => {
@@ -15874,13 +16215,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15874
16215
  return null;
15875
16216
  const html = renderFn();
15876
16217
  return new Response(html, {
15877
- headers: { "Content-Type": "text/html" },
16218
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15878
16219
  status: 404
15879
16220
  });
15880
16221
  }, renderHtmlNotFound = async (conventionPath) => {
15881
16222
  const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
15882
16223
  return new Response(html, {
15883
- headers: { "Content-Type": "text/html" },
16224
+ headers: { "Content-Type": HTML_CONTENT_TYPE },
15884
16225
  status: 404
15885
16226
  });
15886
16227
  }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
@@ -15914,6 +16255,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15914
16255
  return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
15915
16256
  };
15916
16257
  var init_resolveConvention = __esm(() => {
16258
+ init_constants();
15917
16259
  init_cspNonceRef();
15918
16260
  init_staticHtmlNonce();
15919
16261
  init_ssrErrorPage();
@@ -15946,6 +16288,7 @@ var init_resolveConvention = __esm(() => {
15946
16288
  });
15947
16289
 
15948
16290
  // src/utils/spaRouteManifest.ts
16291
+ import { NotFound } from "elysia";
15949
16292
  import { basename as basename15 } from "path";
15950
16293
  var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
15951
16294
  Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
@@ -16010,7 +16353,14 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
16010
16353
  }, renderSpaNotFound = async (framework, pageName, request) => {
16011
16354
  if (isKnownSpaRoute(framework, pageName, request))
16012
16355
  return null;
16013
- return await renderFirstNotFound() ?? new Response("Not found", {
16356
+ return renderSpaNotFoundResponse(request);
16357
+ }, renderSpaNotFoundResponse = async (request) => {
16358
+ if (request && !isPageRequest(request)) {
16359
+ return new NotFound().toResponse();
16360
+ }
16361
+ return await renderFirstNotFound({
16362
+ preferHtmx: request?.headers.get("hx-request") === "true"
16363
+ }) ?? new Response("Not found", {
16014
16364
  headers: { "Content-Type": "text/plain" },
16015
16365
  status: 404
16016
16366
  });
@@ -20839,6 +21189,7 @@ var withResolvedSources = (map, sourceFile) => {
20839
21189
  };
20840
21190
  const generate = (mode) => {
20841
21191
  const transpiled = mode === "server" ? transpiledServer : transpiledClient;
21192
+ const scopeClass = createAwaitScopeClassCapture();
20842
21193
  const compiled = isModule ? compileModule(transpiled, {
20843
21194
  dev: mode === "client" && dev,
20844
21195
  experimental: {
@@ -20847,6 +21198,7 @@ var withResolvedSources = (map, sourceFile) => {
20847
21198
  filename: src
20848
21199
  }) : compile(transpiled, {
20849
21200
  css: externalCss && mode === "client" ? "external" : "injected",
21201
+ cssHash: scopeClass.cssHash,
20850
21202
  dev: mode === "client" && dev,
20851
21203
  experimental: {
20852
21204
  async: transformedByLowering
@@ -20856,7 +21208,7 @@ var withResolvedSources = (map, sourceFile) => {
20856
21208
  hmr: isDev
20857
21209
  });
20858
21210
  const compiledJs = compiled.js;
20859
- let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
21211
+ let code = scopeClass.apply(compiledJs.code).replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
20860
21212
  if (mode === "client" && isDev) {
20861
21213
  const moduleKey = `/@src/${relative23(process.cwd(), src).replace(/\\/g, "/")}`;
20862
21214
  code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
@@ -23135,10 +23487,10 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
23135
23487
  }
23136
23488
  return {
23137
23489
  content: parsedBlock.content.trim(),
23138
- nextIndex: input.keyword === "@placeholder" ? skipWhitespace(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
23490
+ nextIndex: input.keyword === "@placeholder" ? skipWhitespace2(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
23139
23491
  };
23140
23492
  }, resolveDeferSlotStart = (template, deferIndex, markerCursor) => {
23141
- const nextMarkerCursor = skipWhitespace(template, markerCursor);
23493
+ const nextMarkerCursor = skipWhitespace2(template, markerCursor);
23142
23494
  if (template[nextMarkerCursor] === "{") {
23143
23495
  return {
23144
23496
  changed: false,
@@ -23363,7 +23715,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
23363
23715
  template: resolvedBlockState.template
23364
23716
  };
23365
23717
  }
23366
- const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace(template, resolvedBlock.nextIndex));
23718
+ const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace2(template, resolvedBlock.nextIndex));
23367
23719
  const builtSlot = buildDeferredSlot({
23368
23720
  cursorAfterResolved: blockContent.cursorAfterResolved,
23369
23721
  errorHtml: blockContent.errorHtml,
@@ -23393,14 +23745,14 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
23393
23745
  ({ cursor, depth } = consumed);
23394
23746
  }
23395
23747
  return { content: value.slice(start + 1), nextIndex: value.length };
23396
- }, skipWhitespace = (value, index) => {
23748
+ }, skipWhitespace2 = (value, index) => {
23397
23749
  let cursor = index;
23398
23750
  while (cursor < value.length && /\s/.test(value[cursor] ?? "")) {
23399
23751
  cursor += 1;
23400
23752
  }
23401
23753
  return cursor;
23402
23754
  }, parseOptionalParenthesizedBlock = (value, index) => {
23403
- let cursor = skipWhitespace(value, index);
23755
+ let cursor = skipWhitespace2(value, index);
23404
23756
  if (value[cursor] !== "(") {
23405
23757
  return null;
23406
23758
  }
@@ -23464,7 +23816,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
23464
23816
  return null;
23465
23817
  }
23466
23818
  const blockKeywordCursor = cursorAfterResolved + keyword.length;
23467
- const blockStart = skipWhitespace(template, blockKeywordCursor);
23819
+ const blockStart = skipWhitespace2(template, blockKeywordCursor);
23468
23820
  if (template[blockStart] !== "{") {
23469
23821
  return null;
23470
23822
  }
@@ -24126,7 +24478,7 @@ ${importLine}${source.slice(insertAt)}`;
24126
24478
  const rawExpression = value.slice(interpolationStart + 2, nextCursor - 2).trim();
24127
24479
  const expression = rawExpression.length === 0 ? "''" : rawExpression;
24128
24480
  const expressionLiteral = JSON.stringify(expression);
24129
- parts.push(`\${this.__absoluteDeferResolveTemplateExpression(${expressionLiteral})}`);
24481
+ parts.push(`\${this.__absoluteDeferEscapeHtml(this.__absoluteDeferResolveTemplateExpression(${expressionLiteral}))}`);
24130
24482
  cursor = nextCursor;
24131
24483
  }
24132
24484
  return parts.join("");
@@ -24157,6 +24509,10 @@ ${importLine}${source.slice(insertAt)}`;
24157
24509
  ` + ` return value;
24158
24510
  ` + ` }
24159
24511
 
24512
+ ` + ` __absoluteDeferEscapeHtml(value: string) {
24513
+ ` + ` return value.replace(/[&<>"']/g, (char) => char === '&' ? '&amp;' : char === '<' ? '&lt;' : char === '>' ? '&gt;' : char === '"' ? '&quot;' : '&#39;');
24514
+ ` + ` }
24515
+
24160
24516
  `, buildDeferSlotFields = (slots) => [
24161
24517
  buildDeferSlotTemplateResolver(),
24162
24518
  ...slots.map((slot, index) => {
@@ -29806,7 +30162,7 @@ var init_assetStore = __esm(() => {
29806
30162
  ".css": "text/css",
29807
30163
  ".eot": "application/vnd.ms-fontobject",
29808
30164
  ".gif": "image/gif",
29809
- ".html": "text/html",
30165
+ ".html": "text/html; charset=utf-8",
29810
30166
  ".ico": "image/x-icon",
29811
30167
  ".jpeg": "image/jpeg",
29812
30168
  ".jpg": "image/jpeg",
@@ -35844,7 +36200,7 @@ var init_partialPrerenderServe = __esm(() => {
35844
36200
  import { createHash as createHash11 } from "crypto";
35845
36201
  import { existsSync as existsSync58, readdirSync as readdirSync13, readFileSync as readFileSync53 } from "fs";
35846
36202
  import { basename as basename23, join as join75, relative as relative32, resolve as resolvePath3 } from "path";
35847
- import { Elysia as Elysia15, ElysiaError, InternalServerError, NotFound } from "elysia";
36203
+ import { Elysia as Elysia15, ElysiaError, InternalServerError, NotFound as NotFound2 } from "elysia";
35848
36204
  var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
35849
36205
  setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
35850
36206
  }), retryStaticPlugin = async (createStaticPlugin, options) => {
@@ -36151,7 +36507,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
36151
36507
  return new Elysia15({ name: "absolutejs-vitals-disabled" });
36152
36508
  const { endpoint } = resolveVitalsConfig(config.vitals);
36153
36509
  return endpoint.startsWith("/") ? createVitalsPlugin(endpoint) : new Elysia15({ name: "absolutejs-vitals-remote" });
36154
- }, createNotFoundPlugin = () => new Elysia15({ name: "absolutejs-not-found" }).onError("global", NotFound, async ({ request }) => {
36510
+ }, createNotFoundPlugin = () => new Elysia15({ name: "absolutejs-not-found" }).onError("global", NotFound2, async ({ request }) => {
36155
36511
  if (!isPageRequest(request))
36156
36512
  return;
36157
36513
  const response = await renderFirstNotFound({
@@ -36804,8 +37160,10 @@ ${code}`;
36804
37160
  }).js.code;
36805
37161
  }, compileSvelteComponent = (raw, filePath, projectRoot, enableAsync = false) => {
36806
37162
  const compiler = getLoadedSvelteCompiler();
37163
+ const scopeClass = createAwaitScopeClassCapture();
36807
37164
  const compiled = compiler.compile(raw, {
36808
37165
  css: "external",
37166
+ cssHash: scopeClass.cssHash,
36809
37167
  dev: true,
36810
37168
  experimental: {
36811
37169
  async: enableAsync
@@ -36814,7 +37172,7 @@ ${code}`;
36814
37172
  generate: "client",
36815
37173
  hmr: true
36816
37174
  });
36817
- let { code } = compiled.js;
37175
+ let code = scopeClass.apply(compiled.js.code);
36818
37176
  if (compiled.css?.code) {
36819
37177
  const cssPath = `${filePath}.css`;
36820
37178
  svelteExternalCss.set(cssPath, compiled.css.code);
@@ -37486,14 +37844,14 @@ var init_rewriteImports = __esm(() => {
37486
37844
 
37487
37845
  // src/core/pageResponseCache.ts
37488
37846
  import { createHash as createHash12 } from "crypto";
37489
- var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
37847
+ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
37490
37848
  const headers = new Headers(extra);
37491
37849
  headers.set("content-type", HTML_CONTENT_TYPE);
37492
37850
  headers.set(STREAMING_PAGE_HEADER, "1");
37493
37851
  return headers;
37494
37852
  }, computeEtag = (html) => `W/"${createHash12("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
37495
37853
  const contentType = response.headers.get("content-type") ?? "";
37496
- if (!contentType.includes(HTML_CONTENT_TYPE))
37854
+ if (!contentType.includes(HTML_MEDIA_TYPE))
37497
37855
  return response;
37498
37856
  const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
37499
37857
  if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
@@ -37519,7 +37877,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
37519
37877
  statusText: response.statusText
37520
37878
  });
37521
37879
  };
37522
- var init_pageResponseCache = () => {};
37880
+ var init_pageResponseCache = __esm(() => {
37881
+ init_constants();
37882
+ });
37523
37883
 
37524
37884
  // src/core/routeAssets.ts
37525
37885
  var LINK_TAG_RE, REL_STYLESHEET_RE, HREF_RE, TITLE_RE, ENTITIES, ENTITY_RE, decodeEntities = (value) => value.replace(ENTITY_RE, (match) => ENTITIES[match] ?? match), readHeadStylesheets = (head) => {
@@ -37563,6 +37923,7 @@ var emberCacheBuster = 0, invalidateEmberSsrCache = () => {
37563
37923
  emberCacheBuster = Date.now();
37564
37924
  };
37565
37925
  var init_pageHandler = __esm(() => {
37926
+ init_constants();
37566
37927
  init_escapeScriptContent();
37567
37928
  init_cspNonceRef();
37568
37929
  init_pageResponseCache();
@@ -37718,7 +38079,7 @@ var init_backendGraph = __esm(() => {
37718
38079
 
37719
38080
  // src/dev/hot/analyze.ts
37720
38081
  import { dirname as dirname46, extname as extname23 } from "path";
37721
- var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
38082
+ var ANALYZER_VERSION = 3, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
37722
38083
  switch (extname23(path)) {
37723
38084
  case ".tsx":
37724
38085
  return tsc.ScriptKind.TSX;
@@ -38224,6 +38585,12 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
38224
38585
  return statement.declares.map((name) => `${statement.id}:${name}`);
38225
38586
  return [statement.id];
38226
38587
  };
38588
+ const bindingsOf = (statement) => [...new Set(statement.refs.map((reference) => reference.name))].sort().map((name) => {
38589
+ const imported = imports.get(name);
38590
+ if (!imported)
38591
+ return `${name}=local`;
38592
+ return `${name}=${imported.module ?? imported.specifier ?? ""}#${imported.name}`;
38593
+ }).join("\x00");
38227
38594
  const plan = planned.map((statement) => {
38228
38595
  const deps = new Set;
38229
38596
  for (const reference of statement.refs) {
@@ -38236,7 +38603,7 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
38236
38603
  always: statement.kind === "untouched",
38237
38604
  cell: statement.kind === "let",
38238
38605
  deps: [...deps].sort((left, right) => left - right),
38239
- hash: statement.ownHash,
38606
+ hash: hashText(`${statement.ownHash}\x00${bindingsOf(statement)}`),
38240
38607
  ids: idsOf(statement),
38241
38608
  imports: evalImports(statement).map((use) => [
38242
38609
  use.module,
@@ -38544,7 +38911,7 @@ var records, recordFor = (path) => {
38544
38911
  for (const update of updates)
38545
38912
  update(value);
38546
38913
  }
38547
- }, managedModulePaths = () => [...records.keys()], moduleRecord = (path) => records.get(path), nextTag = (path) => {
38914
+ }, managedModulePaths = () => [...records.keys()], moduleRecord = (path) => records.get(path), nextTag2 = (path) => {
38548
38915
  const record = recordFor(path);
38549
38916
  record.tag += 1;
38550
38917
  return record.tag;
@@ -38679,7 +39046,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
38679
39046
  return call === 1 || meta[name]?.kind !== "function";
38680
39047
  }));
38681
39048
  }, importNextVersion = async (path) => {
38682
- const namespace = await import(`${path}?absolute-hot=${nextTag(path)}`);
39049
+ const namespace = await import(`${path}?absolute-hot=${nextTag2(path)}`);
38683
39050
  if (typeof namespace !== "object" || namespace === null)
38684
39051
  throw new Error(`${path} did not evaluate to a module`);
38685
39052
  return Object.fromEntries(Object.entries(namespace));
@@ -39190,6 +39557,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39190
39557
  state.fileHashes.set(normalizePath(filePath), currentHash);
39191
39558
  return;
39192
39559
  }
39560
+ if (framework === "react" && globalThis.__absoluteBackendHmr === true)
39561
+ applyBackendEdit(resolvePath4(filePath)).catch((error) => console.error("[hmr] server update for a React file failed:", error));
39193
39562
  if (!hasFileChanged(filePath, currentHash, state.fileHashes)) {
39194
39563
  return;
39195
39564
  }
@@ -39236,8 +39605,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39236
39605
  return;
39237
39606
  if (await rebuildReactServerComponents(state, config, filePath, currentHash))
39238
39607
  return;
39239
- if (framework === "react" && globalThis.__absoluteBackendHmr === true)
39240
- applyBackendEdit(resolvePath4(filePath)).catch((error) => console.error("[hmr] server update for a React file failed:", error));
39241
39608
  if (framework === "unknown") {
39242
39609
  invalidate(resolvePath4(filePath));
39243
39610
  const relPath = relative36(process.cwd(), filePath);
@@ -42787,5 +43154,5 @@ export {
42787
43154
  devBuild
42788
43155
  };
42789
43156
 
42790
- //# debugId=09C80D2AE135A40164756E2164756E21
43157
+ //# debugId=81988C8D5824060B64756E2164756E21
42791
43158
  //# sourceMappingURL=build.js.map