@absolutejs/absolute 0.19.0-beta.707 → 0.19.0-beta.709

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 (67) hide show
  1. package/dist/angular/browser.js +26 -32
  2. package/dist/angular/browser.js.map +5 -4
  3. package/dist/angular/components/constants.js +6 -0
  4. package/dist/angular/index.js +117 -29
  5. package/dist/angular/index.js.map +5 -5
  6. package/dist/angular/server.js +117 -29
  7. package/dist/angular/server.js.map +5 -5
  8. package/dist/build.js +264 -152
  9. package/dist/build.js.map +12 -12
  10. package/dist/cli/index.js +44 -25
  11. package/dist/client/index.js +105 -28
  12. package/dist/client/index.js.map +4 -4
  13. package/dist/core/streamingSlotRegistrar.js +1 -19
  14. package/dist/core/streamingSlotRegistrar.js.map +2 -2
  15. package/dist/core/streamingSlotRegistry.js +1 -19
  16. package/dist/core/streamingSlotRegistry.js.map +2 -2
  17. package/dist/dev/client/cssUtils.ts +6 -2
  18. package/dist/dev/client/handlers/angular.ts +41 -35
  19. package/dist/dev/client/handlers/angularRuntime.ts +8 -3
  20. package/dist/dev/client/hmrClient.ts +1 -1
  21. package/dist/dev/client/reactRefreshSetup.ts +0 -1
  22. package/dist/image-client/imageClient.js +16 -4
  23. package/dist/index.js +298 -170
  24. package/dist/index.js.map +15 -15
  25. package/dist/islands/browser.js +1 -19
  26. package/dist/islands/browser.js.map +2 -2
  27. package/dist/islands/index.js +107 -20
  28. package/dist/islands/index.js.map +4 -4
  29. package/dist/react/browser.js +1 -19
  30. package/dist/react/browser.js.map +2 -2
  31. package/dist/react/components/browser/index.js +16 -4
  32. package/dist/react/components/index.js +24 -31
  33. package/dist/react/components/index.js.map +5 -4
  34. package/dist/react/hooks/index.js +1 -19
  35. package/dist/react/hooks/index.js.map +2 -2
  36. package/dist/react/index.js +117 -29
  37. package/dist/react/index.js.map +5 -5
  38. package/dist/react/jsxDevRuntimeCompat.js +1 -19
  39. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  40. package/dist/react/server.js +23 -29
  41. package/dist/react/server.js.map +4 -4
  42. package/dist/src/angular/components/constants.d.ts +4 -0
  43. package/dist/src/client/streamSwap.d.ts +0 -10
  44. package/dist/src/constants.d.ts +4 -0
  45. package/dist/src/dev/rebuildTrigger.d.ts +1 -1
  46. package/dist/src/svelte/renderToPipeableStream.d.ts +2 -2
  47. package/dist/src/svelte/renderToReadableStream.d.ts +2 -2
  48. package/dist/src/svelte/renderToString.d.ts +2 -2
  49. package/dist/src/vue/components/Image.d.ts +3 -3
  50. package/dist/svelte/browser.js +1 -19
  51. package/dist/svelte/browser.js.map +2 -2
  52. package/dist/svelte/index.js +119 -30
  53. package/dist/svelte/index.js.map +6 -6
  54. package/dist/svelte/server.js +25 -30
  55. package/dist/svelte/server.js.map +5 -5
  56. package/dist/types/globals.d.ts +10 -2
  57. package/dist/vue/browser.js +1 -19
  58. package/dist/vue/browser.js.map +2 -2
  59. package/dist/vue/components/Image.js +24 -31
  60. package/dist/vue/components/Image.js.map +5 -4
  61. package/dist/vue/components/index.js +24 -31
  62. package/dist/vue/components/index.js.map +5 -4
  63. package/dist/vue/index.js +121 -41
  64. package/dist/vue/index.js.map +6 -6
  65. package/dist/vue/server.js +23 -29
  66. package/dist/vue/server.js.map +4 -4
  67. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ var __create = Object.create;
3
3
  var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
7
  function __accessProp(key) {
9
8
  return this[key];
@@ -30,23 +29,6 @@ var __toESM = (mod, isNodeMode, target) => {
30
29
  cache.set(mod, to);
31
30
  return to;
32
31
  };
33
- var __toCommonJS = (from) => {
34
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
35
- if (entry)
36
- return entry;
37
- entry = __defProp({}, "__esModule", { value: true });
38
- if (from && typeof from === "object" || typeof from === "function") {
39
- for (var key of __getOwnPropNames(from))
40
- if (!__hasOwnProp.call(entry, key))
41
- __defProp(entry, key, {
42
- get: __accessProp.bind(from, key),
43
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44
- });
45
- }
46
- __moduleCache.set(from, entry);
47
- return entry;
48
- };
49
- var __moduleCache;
50
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
51
33
  var __returnValue = (v) => v;
52
34
  function __exportSetter(name, newValue) {
@@ -102,8 +84,19 @@ var isValidHMRClientMessage = (data) => {
102
84
  var WS_READY_STATE_OPEN = 1;
103
85
 
104
86
  // src/constants.ts
105
- 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", 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_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, 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, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, 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, 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, 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;
87
+ 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", 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_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, 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, 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, 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, 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, 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;
106
88
  var init_constants = __esm(() => {
89
+ IMAGE_DEFAULT_DEVICE_SIZES = [
90
+ 640,
91
+ 750,
92
+ 828,
93
+ 1080,
94
+ 1200,
95
+ 1920,
96
+ 2048,
97
+ 3840
98
+ ];
99
+ IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
107
100
  MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
108
101
  MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
109
102
  TWO_THIRDS = 2 / 3;
@@ -162,14 +155,15 @@ var init_islands = () => {};
162
155
 
163
156
  // src/client/streamSwap.ts
164
157
  var streamSwapRuntime = () => {
158
+ const absoluteWindow = window;
165
159
  const SLOT_PATCH_EVENT = "absolutejs:slot-patch";
166
- if (window.__ABS_SLOT_RUNTIME__ === true)
160
+ if (absoluteWindow.__ABS_SLOT_RUNTIME__ === true)
167
161
  return;
168
- window.__ABS_SLOT_RUNTIME__ = true;
169
- window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
170
- window.__ABS_SLOT_PENDING__ = window.__ABS_SLOT_PENDING__ ?? {};
171
- const consumers = window.__ABS_SLOT_CONSUMERS__;
172
- const pending = window.__ABS_SLOT_PENDING__;
162
+ absoluteWindow.__ABS_SLOT_RUNTIME__ = true;
163
+ absoluteWindow.__ABS_SLOT_CONSUMERS__ = absoluteWindow.__ABS_SLOT_CONSUMERS__ ?? {};
164
+ absoluteWindow.__ABS_SLOT_PENDING__ = absoluteWindow.__ABS_SLOT_PENDING__ ?? {};
165
+ const consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;
166
+ const pending = absoluteWindow.__ABS_SLOT_PENDING__;
173
167
  const isObjectRecord3 = (value) => Boolean(value) && typeof value === "object";
174
168
  const isPatchedPendingEntry = (value) => {
175
169
  if (!isObjectRecord3(value))
@@ -177,7 +171,7 @@ var streamSwapRuntime = () => {
177
171
  return value.domPatched === true && "payload" in value;
178
172
  };
179
173
  const unwrapPendingPayload = (value) => isPatchedPendingEntry(value) ? value.payload : value;
180
- const canApplyImmediately = () => window.__ABS_SLOT_HYDRATION_PENDING__ !== true;
174
+ const canApplyImmediately = () => absoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;
181
175
  const isAngularDeferPayload = (payload) => {
182
176
  if (!isObjectRecord3(payload))
183
177
  return false;
@@ -247,8 +241,8 @@ var streamSwapRuntime = () => {
247
241
  apply(id, pending[id] ?? "");
248
242
  }
249
243
  };
250
- window.__ABS_SLOT_FLUSH__ = flush;
251
- window.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
244
+ absoluteWindow.__ABS_SLOT_FLUSH__ = flush;
245
+ absoluteWindow.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
252
246
  apply(id, payload);
253
247
  };
254
248
  if (typeof MutationObserver === "function") {
@@ -914,12 +908,91 @@ var ensureHead = (doc) => {
914
908
  }
915
909
  const head = doc.createElement("head");
916
910
  doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
911
+ }, SSR_LAYOUT_RECT, layoutPatchApplied = false, collectPrototypeChain = (instance) => {
912
+ const protos = [];
913
+ let current = instance ? Object.getPrototypeOf(instance) : null;
914
+ while (current && current !== Object.prototype) {
915
+ protos.push(current);
916
+ current = Object.getPrototypeOf(current);
917
+ }
918
+ return protos;
919
+ }, patchElementLayout = (doc) => {
920
+ if (layoutPatchApplied || !doc) {
921
+ return;
922
+ }
923
+ let element;
924
+ try {
925
+ element = doc.createElement("div");
926
+ } catch {
927
+ return;
928
+ }
929
+ const protos = collectPrototypeChain(element);
930
+ if (protos.length === 0)
931
+ return;
932
+ const copyLayoutRect = (rect) => ({ ...rect });
933
+ const createLayoutRect = () => copyLayoutRect(SSR_LAYOUT_RECT);
934
+ const getClientRects = () => [];
935
+ const noop = () => {
936
+ return;
937
+ };
938
+ const numericProps = [
939
+ "clientWidth",
940
+ "clientHeight",
941
+ "clientLeft",
942
+ "clientTop",
943
+ "offsetWidth",
944
+ "offsetHeight",
945
+ "offsetLeft",
946
+ "offsetTop",
947
+ "scrollWidth",
948
+ "scrollHeight",
949
+ "scrollLeft",
950
+ "scrollTop"
951
+ ];
952
+ for (const proto of protos) {
953
+ const define = (name, value) => {
954
+ const descriptor = Object.getOwnPropertyDescriptor(proto, name);
955
+ if (typeof descriptor?.value === "function")
956
+ return;
957
+ Object.defineProperty(proto, name, {
958
+ configurable: true,
959
+ value,
960
+ writable: true
961
+ });
962
+ };
963
+ define("getBoundingClientRect", createLayoutRect);
964
+ define("getClientRects", getClientRects);
965
+ define("scrollTo", noop);
966
+ define("scrollBy", noop);
967
+ define("scrollIntoView", noop);
968
+ define("focus", noop);
969
+ define("blur", noop);
970
+ for (const prop of numericProps) {
971
+ const desc = Object.getOwnPropertyDescriptor(proto, prop);
972
+ if (desc)
973
+ continue;
974
+ Object.defineProperty(proto, prop, {
975
+ configurable: true,
976
+ get: () => 0
977
+ });
978
+ }
979
+ }
980
+ layoutPatchApplied = true;
917
981
  }, applyPatches = async () => {
918
982
  const { \u{275}DominoAdapter } = await import(resolveAngularPackage("@angular/platform-server"));
919
983
  if (!\u{275}DominoAdapter?.prototype) {
920
984
  console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
921
985
  return false;
922
986
  }
987
+ try {
988
+ const adapter = new \u{275}DominoAdapter;
989
+ const seedDoc = typeof adapter.createHtmlDocument === "function" ? adapter.createHtmlDocument() : typeof adapter.getDefaultDocument === "function" ? adapter.getDefaultDocument() : null;
990
+ if (seedDoc) {
991
+ patchElementLayout(seedDoc);
992
+ }
993
+ } catch (error) {
994
+ console.warn("[Angular Patch] Could not eagerly patch Element prototypes:", error);
995
+ }
923
996
  const proto = \u{275}DominoAdapter.prototype;
924
997
  const origGetBaseHref = proto.getBaseHref;
925
998
  proto.getBaseHref = function(doc) {
@@ -932,18 +1005,33 @@ var ensureHead = (doc) => {
932
1005
  proto.createHtmlDocument = function() {
933
1006
  const doc = origCreateHtmlDocument.call(this);
934
1007
  ensureHead(doc);
1008
+ patchElementLayout(doc);
935
1009
  return doc;
936
1010
  };
937
1011
  const origGetDefaultDocument = proto.getDefaultDocument;
938
1012
  proto.getDefaultDocument = function() {
939
1013
  const doc = origGetDefaultDocument.call(this);
940
1014
  ensureHead(doc);
1015
+ patchElementLayout(doc);
941
1016
  return doc;
942
1017
  };
943
1018
  return true;
944
1019
  };
945
1020
  var init_angularPatch = __esm(() => {
946
1021
  init_resolveAngularPackage();
1022
+ SSR_LAYOUT_RECT = Object.freeze({
1023
+ bottom: 0,
1024
+ height: 0,
1025
+ left: 0,
1026
+ right: 0,
1027
+ top: 0,
1028
+ width: 0,
1029
+ x: 0,
1030
+ y: 0,
1031
+ toJSON() {
1032
+ return this;
1033
+ }
1034
+ });
947
1035
  });
948
1036
 
949
1037
  // src/angular/angularDeps.ts
@@ -22817,7 +22905,7 @@ function isPotentialCssRootFile(id) {
22817
22905
  function idToPath(id) {
22818
22906
  return path.resolve(id.replace(/\?.*$/, ""));
22819
22907
  }
22820
- var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind", __filename = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind/index.mjs", __create2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name), __typeError = (msg) => {
22908
+ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind", __filename = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind/index.mjs", __create2, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name), __typeError = (msg) => {
22821
22909
  throw TypeError(msg);
22822
22910
  }, __require2, __esm2 = (fn, res) => function __init() {
22823
22911
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
@@ -22830,10 +22918,10 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
22830
22918
  if (from && typeof from === "object" || typeof from === "function") {
22831
22919
  for (let key of __getOwnPropNames2(from))
22832
22920
  if (!__hasOwnProp2.call(to, key) && key !== except)
22833
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
22921
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22834
22922
  }
22835
22923
  return to;
22836
- }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), __toCommonJS2 = (mod) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod), __using = (stack, value2, async) => {
22924
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), __toCommonJS = (mod) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod), __using = (stack, value2, async) => {
22837
22925
  if (value2 != null) {
22838
22926
  if (typeof value2 !== "object" && typeof value2 !== "function")
22839
22927
  __typeError("Object expected");
@@ -23420,7 +23508,7 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
23420
23508
  var init_bun_plugin_tailwind = __esm(() => {
23421
23509
  __create2 = Object.create;
23422
23510
  __defProp2 = Object.defineProperty;
23423
- __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23511
+ __getOwnPropDesc = Object.getOwnPropertyDescriptor;
23424
23512
  __getOwnPropNames2 = Object.getOwnPropertyNames;
23425
23513
  __getProtoOf2 = Object.getPrototypeOf;
23426
23514
  __hasOwnProp2 = Object.prototype.hasOwnProperty;
@@ -38341,9 +38429,9 @@ It schedules the call as a new task in the event loop.`);
38341
38429
  });
38342
38430
  require_runtime = __commonJS2({
38343
38431
  "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/runtime.cjs"(exports, module) {
38344
- var { MessageHandler: MessageHandler2, instantiateNapiModuleSync: instantiateNapiModuleSync2, instantiateNapiModule: instantiateNapiModule2 } = (init_emnapi_core_esm_bundler(), __toCommonJS2(emnapi_core_esm_bundler_exports));
38345
- var { getDefaultContext: getDefaultContext2 } = (init_emnapi_esm_bundler(), __toCommonJS2(emnapi_esm_bundler_exports));
38346
- var { WASI: WASI2 } = (init_wasm_util_esm_bundler(), __toCommonJS2(wasm_util_esm_bundler_exports));
38432
+ var { MessageHandler: MessageHandler2, instantiateNapiModuleSync: instantiateNapiModuleSync2, instantiateNapiModule: instantiateNapiModule2 } = (init_emnapi_core_esm_bundler(), __toCommonJS(emnapi_core_esm_bundler_exports));
38433
+ var { getDefaultContext: getDefaultContext2 } = (init_emnapi_esm_bundler(), __toCommonJS(emnapi_esm_bundler_exports));
38434
+ var { WASI: WASI2 } = (init_wasm_util_esm_bundler(), __toCommonJS(wasm_util_esm_bundler_exports));
38347
38435
  var { createFsProxy, createOnMessage } = require_fs_proxy();
38348
38436
  module.exports = {
38349
38437
  MessageHandler: MessageHandler2,
@@ -41545,7 +41633,7 @@ var init_compileTailwind = __esm(() => {
41545
41633
  // src/utils/imageProcessing.ts
41546
41634
  import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
41547
41635
  import { join as join8, resolve as resolve11 } from "path";
41548
- var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
41636
+ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
41549
41637
  for (const size of sizes) {
41550
41638
  if (size >= target)
41551
41639
  return size;
@@ -41561,7 +41649,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
41561
41649
  return false;
41562
41650
  }, matchPathname = (actual, pattern) => {
41563
41651
  if (pattern.endsWith("/**")) {
41564
- const prefix = pattern.slice(0, -2);
41652
+ const prefix = pattern.slice(0, -IMAGE_GLOB_SUFFIX_LENGTH);
41565
41653
  return actual.startsWith(prefix);
41566
41654
  }
41567
41655
  return actual === pattern;
@@ -41690,17 +41778,10 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
41690
41778
  writeFileSync4(metaPath, JSON.stringify(meta));
41691
41779
  };
41692
41780
  var init_imageProcessing = __esm(() => {
41693
- DEFAULT_DEVICE_SIZES = [
41694
- 640,
41695
- 750,
41696
- 828,
41697
- 1080,
41698
- 1200,
41699
- 1920,
41700
- 2048,
41701
- 3840
41702
- ];
41703
- DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
41781
+ init_constants();
41782
+ DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;
41783
+ DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;
41784
+ DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;
41704
41785
  MIME_MAP = {
41705
41786
  avif: "image/avif",
41706
41787
  jpeg: "image/jpeg",
@@ -41740,7 +41821,7 @@ var IMG_REGEX, getAttr = (attrs, name) => {
41740
41821
  const w2x = snapUp(width * 2, allSizes);
41741
41822
  srcset = `${buildOptimizedUrl(src, w1x, quality, basePath)} 1x, ${buildOptimizedUrl(src, w2x, quality, basePath)} 2x`;
41742
41823
  } else {
41743
- const deviceSizes = config?.deviceSizes ?? [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
41824
+ const deviceSizes = config?.deviceSizes ?? IMAGE_DEFAULT_DEVICE_SIZES;
41744
41825
  srcset = deviceSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality, basePath)} ${sizeWidth}w`).join(", ");
41745
41826
  }
41746
41827
  let cleanAttrs = removeAttr(attrs, "data-optimized");
@@ -41773,6 +41854,7 @@ var IMG_REGEX, getAttr = (attrs, name) => {
41773
41854
  var init_optimizeHtmlImages = __esm(() => {
41774
41855
  init_imageProcessing();
41775
41856
  init_scanEntryPoints();
41857
+ init_constants();
41776
41858
  IMG_REGEX = /<img\s+([^>]*?)data-optimized([^>]*?)\/?>/gi;
41777
41859
  });
41778
41860
 
@@ -42289,7 +42371,8 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
42289
42371
  } = {}) => {
42290
42372
  try {
42291
42373
  const { render } = await import("svelte/server");
42292
- const rendered = typeof props === "undefined" ? await render(component) : await render(component, { props });
42374
+ const renderComponent = render;
42375
+ const rendered = typeof props === "undefined" ? await renderComponent(component) : await renderComponent(component, { props });
42293
42376
  const { head, body } = rendered;
42294
42377
  const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
42295
42378
  const scripts = (bootstrapScriptContent ? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>` : "") + bootstrapScripts.map((src) => `<script${nonceAttr} src="${src}"></script>`).join("") + bootstrapModules.map((src) => `<script${nonceAttr} type="module" src="${src}"></script>`).join("");
@@ -46596,6 +46679,68 @@ var init_fileHashTracker = __esm(() => {
46596
46679
  init_constants();
46597
46680
  });
46598
46681
 
46682
+ // src/dev/transformCache.ts
46683
+ var exports_transformCache = {};
46684
+ __export(exports_transformCache, {
46685
+ setTransformed: () => setTransformed,
46686
+ invalidateAll: () => invalidateAll,
46687
+ invalidate: () => invalidate,
46688
+ getTransformed: () => getTransformed,
46689
+ getInvalidationVersion: () => getInvalidationVersion,
46690
+ findNearestComponent: () => findNearestComponent
46691
+ });
46692
+ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
46693
+ const resolvedImports = imports ?? [];
46694
+ cache.set(filePath, { content, imports: resolvedImports, mtime });
46695
+ for (const imp of resolvedImports) {
46696
+ const set2 = importers.get(imp) ?? new Set;
46697
+ importers.set(imp, set2);
46698
+ set2.add(filePath);
46699
+ }
46700
+ }, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
46701
+ const component = [...parents].find(isComponentFile);
46702
+ if (component !== undefined)
46703
+ return component;
46704
+ for (const parent of parents)
46705
+ queue.push(parent);
46706
+ return;
46707
+ }, findNearestComponent = (filePath) => {
46708
+ const visited = new Set;
46709
+ const queue = [filePath];
46710
+ while (queue.length > 0) {
46711
+ const current = queue.shift();
46712
+ if (!current)
46713
+ break;
46714
+ if (visited.has(current))
46715
+ continue;
46716
+ visited.add(current);
46717
+ const parents = importers.get(current);
46718
+ if (!parents)
46719
+ continue;
46720
+ const found = processParents(parents, queue);
46721
+ if (found !== undefined)
46722
+ return found;
46723
+ }
46724
+ return;
46725
+ }, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
46726
+ cache.delete(filePath);
46727
+ invalidationVersions.set(filePath, (invalidationVersions.get(filePath) ?? 0) + 1);
46728
+ for (const parent of importers.get(filePath) ?? []) {
46729
+ cache.delete(parent);
46730
+ }
46731
+ }, invalidateAll = () => {
46732
+ cache.clear();
46733
+ importers.clear();
46734
+ };
46735
+ var init_transformCache = __esm(() => {
46736
+ cache = globalThis.__transformCache ?? new Map;
46737
+ globalThis.__transformCache = cache;
46738
+ importers = globalThis.__transformImporters ?? new Map;
46739
+ globalThis.__transformImporters = importers;
46740
+ invalidationVersions = globalThis.__transformInvalidationVersions ?? new Map;
46741
+ globalThis.__transformInvalidationVersions = invalidationVersions;
46742
+ });
46743
+
46599
46744
  // src/dev/reactComponentClassifier.ts
46600
46745
  import { resolve as resolve28 } from "path";
46601
46746
  var classifyComponent = (filePath) => {
@@ -46816,68 +46961,6 @@ var init_ssrCache = __esm(() => {
46816
46961
  dirtyFrameworks = new Set;
46817
46962
  });
46818
46963
 
46819
- // src/dev/transformCache.ts
46820
- var exports_transformCache = {};
46821
- __export(exports_transformCache, {
46822
- setTransformed: () => setTransformed,
46823
- invalidateAll: () => invalidateAll,
46824
- invalidate: () => invalidate,
46825
- getTransformed: () => getTransformed,
46826
- getInvalidationVersion: () => getInvalidationVersion,
46827
- findNearestComponent: () => findNearestComponent
46828
- });
46829
- var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
46830
- const resolvedImports = imports ?? [];
46831
- cache.set(filePath, { content, imports: resolvedImports, mtime });
46832
- for (const imp of resolvedImports) {
46833
- const set2 = importers.get(imp) ?? new Set;
46834
- importers.set(imp, set2);
46835
- set2.add(filePath);
46836
- }
46837
- }, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
46838
- const component = [...parents].find(isComponentFile);
46839
- if (component !== undefined)
46840
- return component;
46841
- for (const parent of parents)
46842
- queue.push(parent);
46843
- return;
46844
- }, findNearestComponent = (filePath) => {
46845
- const visited = new Set;
46846
- const queue = [filePath];
46847
- while (queue.length > 0) {
46848
- const current = queue.shift();
46849
- if (!current)
46850
- break;
46851
- if (visited.has(current))
46852
- continue;
46853
- visited.add(current);
46854
- const parents = importers.get(current);
46855
- if (!parents)
46856
- continue;
46857
- const found = processParents(parents, queue);
46858
- if (found !== undefined)
46859
- return found;
46860
- }
46861
- return;
46862
- }, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
46863
- cache.delete(filePath);
46864
- invalidationVersions.set(filePath, (invalidationVersions.get(filePath) ?? 0) + 1);
46865
- for (const parent of importers.get(filePath) ?? []) {
46866
- cache.delete(parent);
46867
- }
46868
- }, invalidateAll = () => {
46869
- cache.clear();
46870
- importers.clear();
46871
- };
46872
- var init_transformCache = __esm(() => {
46873
- cache = globalThis.__transformCache ?? new Map;
46874
- globalThis.__transformCache = cache;
46875
- importers = globalThis.__transformImporters ?? new Map;
46876
- globalThis.__transformImporters = importers;
46877
- invalidationVersions = globalThis.__transformInvalidationVersions ?? new Map;
46878
- globalThis.__transformInvalidationVersions = invalidationVersions;
46879
- });
46880
-
46881
46964
  // src/dev/moduleServer.ts
46882
46965
  var exports_moduleServer = {};
46883
46966
  __export(exports_moduleServer, {
@@ -47135,7 +47218,15 @@ ${code}`;
47135
47218
  const endPos = findFunctionEnd(source, insertPos);
47136
47219
  const funcBody = source.slice(insertPos, endPos);
47137
47220
  return `${source.slice(0, insertPos)}__hmr_wrap(${JSON.stringify(name)}, ${funcBody})${source.slice(endPos)}`;
47138
- }, svelteExternalCss, svelteCompiler = null, vueCompiler = null, warmCompilers = async (frameworks2) => {
47221
+ }, svelteExternalCss, svelteCompiler = null, vueCompiler = null, getLoadedSvelteCompiler = () => {
47222
+ if (!svelteCompiler)
47223
+ throw new Error("Svelte compiler is not loaded.");
47224
+ return svelteCompiler;
47225
+ }, getLoadedVueCompiler = () => {
47226
+ if (!vueCompiler)
47227
+ throw new Error("Vue compiler is not loaded.");
47228
+ return vueCompiler;
47229
+ }, warmCompilers = async (frameworks2) => {
47139
47230
  const [svelteModule, vueModule] = await Promise.all([
47140
47231
  frameworks2.svelte ? import("svelte/compiler") : undefined,
47141
47232
  frameworks2.vue ? import("@vue/compiler-sfc") : undefined
@@ -47163,13 +47254,15 @@ ${code}`;
47163
47254
  source: descriptor.template.content
47164
47255
  });
47165
47256
  }, compileSvelteModule = (raw, filePath) => {
47257
+ const compiler = getLoadedSvelteCompiler();
47166
47258
  const source = tsTranspiler2.transformSync(raw);
47167
- return svelteCompiler.compileModule(source, {
47259
+ return compiler.compileModule(source, {
47168
47260
  dev: true,
47169
47261
  filename: filePath
47170
47262
  }).js.code;
47171
47263
  }, compileSvelteComponent = (raw, filePath, projectRoot, enableAsync = false) => {
47172
- const compiled = svelteCompiler.compile(raw, {
47264
+ const compiler = getLoadedSvelteCompiler();
47265
+ const compiled = compiler.compile(raw, {
47173
47266
  css: "external",
47174
47267
  dev: true,
47175
47268
  experimental: {
@@ -47205,11 +47298,12 @@ ${code}`;
47205
47298
  const code = isModule ? compileSvelteModule(source, filePath) : compileSvelteComponent(source, filePath, projectRoot, enableAsync);
47206
47299
  return rewriteImports2(code, filePath, projectRoot, rewriter);
47207
47300
  }, compileVueTemplate = (descriptor, compiledScript, filePath, componentId) => {
47301
+ const compiler = getLoadedVueCompiler();
47208
47302
  const scriptContent = compiledScript.content;
47209
47303
  if (!descriptor.template)
47210
47304
  return scriptContent;
47211
47305
  const isScoped = descriptor.styles.some((style) => style.scoped);
47212
- const templateResult = vueCompiler.compileTemplate({
47306
+ const templateResult = compiler.compileTemplate({
47213
47307
  compilerOptions: {
47214
47308
  bindingMetadata: compiledScript.bindings,
47215
47309
  prefixIdentifiers: true
@@ -47230,10 +47324,11 @@ export default __script__;`;
47230
47324
  }, compileVueStyles = async (descriptor, filePath, componentId, code, stylePreprocessors) => {
47231
47325
  if (descriptor.styles.length === 0)
47232
47326
  return code;
47233
- const cssCode = (await Promise.all(descriptor.styles.map(async (style) => vueCompiler.compileStyle({
47327
+ const compiler = getLoadedVueCompiler();
47328
+ const cssCode = (await Promise.all(descriptor.styles.map(async (style) => compiler.compileStyle({
47234
47329
  filename: filePath,
47235
47330
  id: `data-v-${componentId}`,
47236
- scoped: style.scoped,
47331
+ scoped: Boolean(style.scoped),
47237
47332
  source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
47238
47333
  trim: true
47239
47334
  }).code))).join(`
@@ -47262,7 +47357,11 @@ ${code}`;
47262
47357
  id: componentId,
47263
47358
  inlineTemplate: false
47264
47359
  });
47265
- let code = compileVueTemplate(descriptor, compiledScript, filePath, componentId);
47360
+ const compiledSfcScript = {
47361
+ bindings: compiledScript.bindings ?? {},
47362
+ content: compiledScript.content
47363
+ };
47364
+ let code = compileVueTemplate(descriptor, compiledSfcScript, filePath, componentId);
47266
47365
  code = await compileVueStyles(descriptor, filePath, componentId, code, stylePreprocessors);
47267
47366
  code = tsTranspiler2.transformSync(code);
47268
47367
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
@@ -47640,7 +47739,7 @@ var init_simpleHTMXHMR = () => {};
47640
47739
  // src/dev/rebuildTrigger.ts
47641
47740
  import { existsSync as existsSync22 } from "fs";
47642
47741
  import { basename as basename11, dirname as dirname14, relative as relative12, resolve as resolve33 } from "path";
47643
- var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), parseErrorLocationFromMessage = (msg) => {
47742
+ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), parseErrorLocationFromMessage = (msg) => {
47644
47743
  const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
47645
47744
  if (pathLineCol) {
47646
47745
  const [, file4, lineStr, colStr] = pathLineCol;
@@ -47810,19 +47909,31 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
47810
47909
  return allFiles;
47811
47910
  }, areAllQueuedFilesStable = async (fileChangeQueue) => {
47812
47911
  const allFiles = collectAllQueuedFiles(fileChangeQueue);
47813
- for (const file4 of allFiles) {
47912
+ const checkFile = async (files) => {
47913
+ const [file4, ...remaining] = files;
47914
+ if (!file4) {
47915
+ return true;
47916
+ }
47814
47917
  const stable = await isFileStable(file4);
47815
- if (!stable)
47918
+ if (!stable) {
47816
47919
  return false;
47817
- }
47818
- return true;
47920
+ }
47921
+ return checkFile(remaining);
47922
+ };
47923
+ return checkFile(allFiles);
47819
47924
  }, waitForStableWrites = async (state) => {
47820
- for (let round = 0;round < STABILITY_CHECK_ROUNDS; round++) {
47925
+ const waitRound = async (round) => {
47926
+ if (round >= STABILITY_CHECK_ROUNDS) {
47927
+ return;
47928
+ }
47821
47929
  const stable = await areAllQueuedFilesStable(state.fileChangeQueue);
47822
- if (stable)
47823
- break;
47824
- }
47825
- }, queueFileChange = (state, filePath, config, onRebuildComplete) => {
47930
+ if (stable) {
47931
+ return;
47932
+ }
47933
+ await waitRound(round + 1);
47934
+ };
47935
+ await waitRound(0);
47936
+ }, queueFileChange = async (state, filePath, config, onRebuildComplete) => {
47826
47937
  const framework = detectFramework(filePath, state.resolvedPaths);
47827
47938
  if (framework === "ignored") {
47828
47939
  return;
@@ -47832,8 +47943,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
47832
47943
  return;
47833
47944
  }
47834
47945
  if (framework === "unknown") {
47835
- const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
47836
- invalidate2(resolve33(filePath));
47946
+ invalidate(resolve33(filePath));
47837
47947
  const relPath = relative12(process.cwd(), filePath);
47838
47948
  logHmrUpdate(relPath);
47839
47949
  return;
@@ -48238,9 +48348,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48238
48348
  }
48239
48349
  markSsrCacheDirty("svelte");
48240
48350
  const serverDuration = Date.now() - startTime;
48241
- for (const changedFile of svelteFiles) {
48242
- await broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration);
48243
- }
48351
+ await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
48244
48352
  onRebuildComplete({
48245
48353
  hmrState: state,
48246
48354
  manifest: state.manifest
@@ -48364,9 +48472,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48364
48472
  await invalidateNonVueModules(nonVueFiles);
48365
48473
  const serverDuration = Date.now() - startTime;
48366
48474
  const forceReload = nonVueFiles.length > 0;
48367
- for (const changedFile of vueFiles) {
48368
- await broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration);
48369
- }
48475
+ await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
48370
48476
  onRebuildComplete({
48371
48477
  hmrState: state,
48372
48478
  manifest: state.manifest
@@ -48548,11 +48654,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48548
48654
  const outputHtmlPages = computeOutputPagesDir(state, config, "html");
48549
48655
  const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
48550
48656
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
48551
- for (const pageFile of pageFilesToUpdate) {
48657
+ await runSequentially(pageFilesToUpdate, async (pageFile) => {
48552
48658
  const htmlPageName = basename11(pageFile);
48553
48659
  const builtHtmlPagePath = resolve33(outputHtmlPages, htmlPageName);
48554
48660
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
48555
- }
48661
+ });
48556
48662
  }, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
48557
48663
  const [cssFile] = vueCssFiles;
48558
48664
  if (!cssFile) {
@@ -48647,9 +48753,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48647
48753
  if (isCssOnlyChange && vueCssFiles.length > 0) {
48648
48754
  handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
48649
48755
  }
48650
- for (const vuePagePath of pagesToUpdate) {
48651
- await processVuePageUpdate(state, config, vuePagePath, manifest, duration);
48652
- }
48756
+ await runSequentially(pagesToUpdate, (vuePagePath) => processVuePageUpdate(state, config, vuePagePath, manifest, duration));
48653
48757
  }, handleSvelteCssOnlyUpdate = (state, svelteCssFiles, manifest, duration) => {
48654
48758
  const [cssFile] = svelteCssFiles;
48655
48759
  if (!cssFile) {
@@ -48850,11 +48954,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48850
48954
  const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
48851
48955
  const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
48852
48956
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
48853
- for (const htmxPageFile of pageFilesToUpdate) {
48957
+ await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
48854
48958
  const htmxPageName = basename11(htmxPageFile);
48855
48959
  const builtHtmxPagePath = resolve33(outputHtmxPages, htmxPageName);
48856
48960
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
48857
- }
48961
+ });
48858
48962
  }, collectUpdatedModulePaths = (allModuleUpdates) => {
48859
48963
  const paths = [];
48860
48964
  allModuleUpdates.forEach((update) => {
@@ -48998,11 +49102,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
48998
49102
  const { updateAssetPaths: updateAssetPaths2 } = await Promise.resolve().then(() => (init_updateAssetPaths(), exports_updateAssetPaths));
48999
49103
  const handleUpdate = framework === "html" ? (await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR))).handleHTMLUpdate : (await Promise.resolve().then(() => (init_simpleHTMXHMR(), exports_simpleHTMXHMR))).handleHTMXUpdate;
49000
49104
  const { readFileSync: readFs, writeFileSync: writeFs } = await import("fs");
49001
- for (const markupFile of markupFiles) {
49105
+ const processMarkupFiles = async (files) => {
49106
+ const [markupFile, ...remaining] = files;
49107
+ if (!markupFile) {
49108
+ return;
49109
+ }
49002
49110
  const success = await tryProcessMarkupFile(state, markupFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs);
49003
- if (!success)
49004
- break;
49005
- }
49111
+ if (!success) {
49112
+ return;
49113
+ }
49114
+ await processMarkupFiles(remaining);
49115
+ };
49116
+ await processMarkupFiles(markupFiles);
49006
49117
  }, runHtmlFastPath = async (state, config, filesToRebuild, startTime) => runMarkupFastPath(state, config, filesToRebuild, startTime, "html"), runHtmxFastPath = async (state, config, filesToRebuild, startTime) => runMarkupFastPath(state, config, filesToRebuild, startTime, "htmx"), markHandledFiles = (files, framework, resolvedPaths, handled) => {
49007
49118
  files.filter((f) => detectFramework(f, resolvedPaths) === framework).forEach((f) => handled.add(f));
49008
49119
  }, runFrameworkFastPaths = async (state, config, affectedFrameworks, files, startTime, onRebuildComplete) => {
@@ -49029,12 +49140,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
49029
49140
  handler: handleVueFastPath
49030
49141
  }
49031
49142
  ];
49032
- for (const fastPath of fastPaths) {
49143
+ await runSequentially(fastPaths, async (fastPath) => {
49033
49144
  if (!fastPath.directory || !affectedFrameworks.includes(fastPath.framework))
49034
- continue;
49145
+ return;
49035
49146
  await fastPath.handler(state, config, files, startTime, onRebuildComplete);
49036
49147
  markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
49037
- }
49148
+ });
49038
49149
  return files.every((f) => handled.has(f));
49039
49150
  }, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete) => {
49040
49151
  const hasManifest = Object.keys(state.manifest).length > 0;
@@ -49177,6 +49288,7 @@ var init_rebuildTrigger = __esm(() => {
49177
49288
  init_dependencyGraph();
49178
49289
  init_constants();
49179
49290
  init_fileHashTracker();
49291
+ init_transformCache();
49180
49292
  init_moduleMapper();
49181
49293
  init_telemetryEvent();
49182
49294
  init_assetStore();
@@ -49663,13 +49775,13 @@ var INTERNALS_KEYS, isRecord7 = (val) => typeof val === "object" && val !== null
49663
49775
  }
49664
49776
  return;
49665
49777
  }, bridgeReactInternals = async () => {
49666
- const pinned = globalThis.__reactModuleRef;
49667
- if (!pinned)
49778
+ const pinnedRef = globalThis.__reactModuleRef;
49779
+ if (!isRecord7(pinnedRef))
49668
49780
  return;
49669
49781
  const react = await import("react");
49670
- if (pinned === react)
49782
+ if (pinnedRef === react)
49671
49783
  return;
49672
- const pinnedInternals = findInternals(pinned);
49784
+ const pinnedInternals = findInternals(pinnedRef);
49673
49785
  const currentInternals = findInternals(react);
49674
49786
  if (!pinnedInternals || !currentInternals || pinnedInternals === currentInternals)
49675
49787
  return;
@@ -50178,17 +50290,26 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
50178
50290
  const visited = new Set;
50179
50291
  const queue = ["/"];
50180
50292
  const routes = [];
50181
- while (queue.length > 0) {
50293
+ const crawlNextRoute = async () => {
50182
50294
  const path2 = queue.shift();
50183
- if (!path2 || visited.has(path2))
50184
- continue;
50295
+ if (!path2) {
50296
+ return;
50297
+ }
50298
+ if (visited.has(path2)) {
50299
+ await crawlNextRoute();
50300
+ return;
50301
+ }
50185
50302
  visited.add(path2);
50186
50303
  const html = await fetchRoute(baseUrl, path2).catch(() => null);
50187
- if (!html)
50188
- continue;
50304
+ if (!html) {
50305
+ await crawlNextRoute();
50306
+ return;
50307
+ }
50189
50308
  routes.push(path2);
50190
50309
  queue.push(...extractLinks(html, visited));
50191
- }
50310
+ await crawlNextRoute();
50311
+ };
50312
+ await crawlNextRoute();
50192
50313
  return routes;
50193
50314
  }, rerenderRoute = async (route, port, prerenderDir) => {
50194
50315
  try {
@@ -50238,9 +50359,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
50238
50359
  dir: prerenderDir,
50239
50360
  routes: new Map
50240
50361
  };
50241
- for (const route of routes) {
50242
- await prerenderRoute(baseUrl, route, prerenderDir, result, log2);
50243
- }
50362
+ await routes.reduce((chain, route) => chain.then(() => prerenderRoute(baseUrl, route, prerenderDir, result, log2)), Promise.resolve());
50244
50363
  return result;
50245
50364
  }, getStartupTimeoutMs = () => {
50246
50365
  const rawTimeout = Bun.env.ABSOLUTE_PRERENDER_STARTUP_TIMEOUT_MS;
@@ -50248,13 +50367,17 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
50248
50367
  return Number.isFinite(parsedTimeout) && parsedTimeout > 0 ? parsedTimeout : DEFAULT_STARTUP_TIMEOUT_MS;
50249
50368
  }, waitForServerReady = async (port) => {
50250
50369
  const deadline = performance.now() + getStartupTimeoutMs();
50251
- while (performance.now() < deadline) {
50370
+ const pollServer = async () => {
50371
+ if (performance.now() >= deadline) {
50372
+ return false;
50373
+ }
50252
50374
  if (await probePrerenderServer(port)) {
50253
50375
  return true;
50254
50376
  }
50255
50377
  await Bun.sleep(STARTUP_POLL_INTERVAL_MS);
50256
- }
50257
- return false;
50378
+ return pollServer();
50379
+ };
50380
+ return pollServer();
50258
50381
  }, probePrerenderServer = async (port) => {
50259
50382
  const res = await fetch(`http://localhost:${port}/`).catch(() => null);
50260
50383
  if (!res) {
@@ -50271,10 +50394,11 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
50271
50394
  const decoder2 = new TextDecoder;
50272
50395
  const read = () => {
50273
50396
  reader.read().then(({ done, value: value2 }) => {
50274
- if (done)
50397
+ if (done) {
50275
50398
  return;
50399
+ }
50276
50400
  output.push(decoder2.decode(value2, { stream: true }));
50277
- read();
50401
+ return read();
50278
50402
  }).catch(() => {});
50279
50403
  };
50280
50404
  read();
@@ -57997,6 +58121,10 @@ export {
57997
58121
  MILLISECONDS_IN_A_DAY,
57998
58122
  MAX_RECONNECT_ATTEMPTS,
57999
58123
  MAX_ERROR_LENGTH,
58124
+ IMAGE_GLOB_SUFFIX_LENGTH,
58125
+ IMAGE_DEFAULT_QUALITY,
58126
+ IMAGE_DEFAULT_IMAGE_SIZES,
58127
+ IMAGE_DEFAULT_DEVICE_SIZES,
58000
58128
  HTTP_STATUS_OK,
58001
58129
  HTTP_STATUS_NOT_FOUND,
58002
58130
  HTTP_STATUS_BAD_REQUEST,
@@ -58029,5 +58157,5 @@ export {
58029
58157
  ANGULAR_INIT_TIMEOUT_MS
58030
58158
  };
58031
58159
 
58032
- //# debugId=00ECB0441FCD5AB464756E2164756E21
58160
+ //# debugId=72C1E81EF3F0D00364756E2164756E21
58033
58161
  //# sourceMappingURL=index.js.map