@absolutejs/absolute 0.20.0-beta.2 → 0.20.0-beta.20

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 (72) hide show
  1. package/README.md +135 -0
  2. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  3. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  4. package/dist/angular/index.js +341 -22
  5. package/dist/angular/index.js.map +8 -5
  6. package/dist/angular/server.js +341 -22
  7. package/dist/angular/server.js.map +8 -5
  8. package/dist/build.js +1254 -598
  9. package/dist/build.js.map +16 -13
  10. package/dist/cli/index.js +4995 -1614
  11. package/dist/dev/client/cssUtils.ts +16 -2
  12. package/dist/dev/client/handlers/rebuild.ts +11 -1
  13. package/dist/dev/client/hmrClient.ts +9 -3
  14. package/dist/dev/client/hmrTiming.ts +14 -7
  15. package/dist/dev/client/syncDevtools.ts +237 -0
  16. package/dist/index.js +1628 -862
  17. package/dist/index.js.map +24 -21
  18. package/dist/mobile/browser.js +123 -1
  19. package/dist/mobile/browser.js.map +6 -4
  20. package/dist/mobile/index.js +3361 -298
  21. package/dist/mobile/index.js.map +27 -13
  22. package/dist/mobile/remoteMacAgentEntry.js +29 -0
  23. package/dist/mobile/shellAuth.js +35 -0
  24. package/dist/mobile/shellBootstrap.js +585 -0
  25. package/dist/mobile/shellSync.js +123 -0
  26. package/dist/src/angular/pageHandler.d.ts +3 -0
  27. package/dist/src/build/pwa.d.ts +16 -0
  28. package/dist/src/cli/config/server.d.ts +1 -1
  29. package/dist/src/core/pageHandlers.d.ts +11 -2
  30. package/dist/src/core/prepare.d.ts +6 -0
  31. package/dist/src/dev/clientManager.d.ts +2 -0
  32. package/dist/src/mobile/androidEmulatorController.d.ts +6 -1
  33. package/dist/src/mobile/browser.d.ts +1 -0
  34. package/dist/src/mobile/buildPipeline.d.ts +1 -0
  35. package/dist/src/mobile/capacitorBundle.d.ts +22 -1
  36. package/dist/src/mobile/client.d.ts +4 -0
  37. package/dist/src/mobile/deviceCapabilities.d.ts +33 -0
  38. package/dist/src/mobile/index.d.ts +9 -0
  39. package/dist/src/mobile/iosConformance.d.ts +15 -0
  40. package/dist/src/mobile/iosNativeWatcher.d.ts +19 -0
  41. package/dist/src/mobile/iosRelease.d.ts +2 -2
  42. package/dist/src/mobile/iosSimulatorController.d.ts +89 -0
  43. package/dist/src/mobile/nativeAuth.d.ts +17 -0
  44. package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
  45. package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
  46. package/dist/src/mobile/releaseArtifact.d.ts +2 -0
  47. package/dist/src/mobile/remoteMacAgent.d.ts +2 -0
  48. package/dist/src/mobile/remoteMacAgentEntry.d.ts +1 -0
  49. package/dist/src/mobile/remoteMacProtocol.d.ts +114 -0
  50. package/dist/src/mobile/remoteMacWire.d.ts +2 -0
  51. package/dist/src/mobile/shellAuth.d.ts +13 -0
  52. package/dist/src/mobile/shellBootstrap.d.ts +18 -1
  53. package/dist/src/mobile/shellSync.d.ts +19 -0
  54. package/dist/src/mobile/staticDocument.d.ts +5 -0
  55. package/dist/src/mobile/syncRemediation.d.ts +10 -0
  56. package/dist/src/mobile/syncSchema.d.ts +9 -0
  57. package/dist/src/mobile/transport.d.ts +16 -1
  58. package/dist/src/plugins/hmr.d.ts +3 -0
  59. package/dist/src/plugins/imageOptimizer.d.ts +1 -1
  60. package/dist/src/svelte/pageHandler.d.ts +3 -0
  61. package/dist/src/utils/loadConfig.d.ts +1 -0
  62. package/dist/src/vue/pageHandler.d.ts +3 -0
  63. package/dist/svelte/index.js +312 -23
  64. package/dist/svelte/index.js.map +7 -4
  65. package/dist/svelte/server.js +307 -18
  66. package/dist/svelte/server.js.map +7 -4
  67. package/dist/types/build.d.ts +14 -0
  68. package/dist/vue/index.js +312 -23
  69. package/dist/vue/index.js.map +7 -4
  70. package/dist/vue/server.js +307 -18
  71. package/dist/vue/server.js.map +7 -4
  72. package/package.json +29 -9
package/dist/build.js CHANGED
@@ -969,9 +969,10 @@ var indexContentCache, resolveDevClientDir = () => {
969
969
  `}
970
970
  `,
971
971
  `// Attempt hydration with error handling`,
972
+ `const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
972
973
  `// Use document (not document.body) when the page renders <html><head><body>`,
973
974
  `// to avoid "In HTML, <html> cannot be a child of <body>" hydration error`,
974
- `const container = typeof document !== 'undefined' ? document : null;`,
975
+ `const container = typeof document !== 'undefined' ? (shouldClientRender ? document.getElementById('root') : document) : null;`,
975
976
  `if (!container) {`,
976
977
  ` throw new Error('React root container not found: document is null');`,
977
978
  `}
@@ -997,7 +998,6 @@ var indexContentCache, resolveDevClientDir = () => {
997
998
  `if (!window.__REACT_ROOT__) {`,
998
999
  ` let root;`,
999
1000
  ` // Mobile data envelopes and dirty HMR pages have no matching SSR markup.`,
1000
- ` const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
1001
1001
  ` if (window.__SSR_DIRTY__ || shouldClientRender) {`,
1002
1002
  ` root = createRoot(container);`,
1003
1003
  ` root.render(${isDev ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
@@ -1077,6 +1077,15 @@ var indexContentCache, resolveDevClientDir = () => {
1077
1077
  ` };`,
1078
1078
  ` }`,
1079
1079
  `}`,
1080
+ `if (typeof window !== 'undefined') {`,
1081
+ ` window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();`,
1082
+ ` window.__ABSOLUTE_PAGE_DISPOSE__ = function() {`,
1083
+ ` if (window.__REACT_ROOT__ && typeof window.__REACT_ROOT__.unmount === 'function') {`,
1084
+ ` window.__REACT_ROOT__.unmount();`,
1085
+ ` }`,
1086
+ ` window.__REACT_ROOT__ = null;`,
1087
+ ` };`,
1088
+ `}`,
1080
1089
  ...isDev ? [
1081
1090
  `
1082
1091
  // Pre-warm: import the page module from the module server`,
@@ -12355,7 +12364,8 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
12355
12364
  });
12356
12365
  process.on("uncaughtException", (err) => {
12357
12366
  releaseAllSync();
12358
- throw err;
12367
+ console.error(err);
12368
+ process.exit(1);
12359
12369
  });
12360
12370
  }, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join23(dirname12(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
12361
12371
  `).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
@@ -12849,13 +12859,566 @@ var isTestSourcePath = (file) => {
12849
12859
  return normalized.includes("/__tests__/") || /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(normalized);
12850
12860
  };
12851
12861
 
12862
+ // node_modules/@absolutejs/sync/dist/client/index.js
12863
+ var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")) && Array.isArray(Reflect.get(value, "clients")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
12864
+ if (!Number.isSafeInteger(value) || value < 1)
12865
+ throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
12866
+ return value;
12867
+ }, isSchemaBundle = (schema) => ("components" in schema), validatePolicyMatch = (match, label) => {
12868
+ if (match.length === 0 || match.trim() !== match || /^\*+$/.test(match) || match.includes("**"))
12869
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.match must be an exact name or a non-empty glob without adjacent wildcards.`);
12870
+ }, validateSyncLocalDataPolicy = (policy, label = "localData") => {
12871
+ if (policy.maxBytesPerNamespace !== undefined && (!Number.isSafeInteger(policy.maxBytesPerNamespace) || policy.maxBytesPerNamespace < 1))
12872
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.maxBytesPerNamespace must be a positive safe integer.`);
12873
+ for (const [index, rule] of (policy.collections ?? []).entries()) {
12874
+ validatePolicyMatch(rule.match, `${label}.collections[${index}]`);
12875
+ if (rule.maxAgeMs !== undefined && (!Number.isSafeInteger(rule.maxAgeMs) || rule.maxAgeMs < 1))
12876
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}].maxAgeMs must be a positive safe integer.`);
12877
+ if (rule.persistence === "memory-only" && rule.protection === "required")
12878
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] cannot require at-rest protection when it is memory-only.`);
12879
+ if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
12880
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.collections[${index}] declares ${rule.sensitivity} data without required protection or memory-only persistence.`);
12881
+ }
12882
+ for (const [index, rule] of (policy.mutations ?? []).entries()) {
12883
+ validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
12884
+ if (rule.conflict !== undefined && rule.conflict.strategy !== "client-wins" && rule.conflict.strategy !== "manual" && rule.conflict.strategy !== "server-wins")
12885
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.strategy is invalid.`);
12886
+ if (rule.conflict?.maxAttempts !== undefined && (!Number.isSafeInteger(rule.conflict.maxAttempts) || rule.conflict.maxAttempts < 1))
12887
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts must be a positive safe integer.`);
12888
+ if (rule.conflict?.maxAttempts !== undefined && rule.conflict.strategy !== "client-wins")
12889
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts is only valid for client-wins.`);
12890
+ if (rule.persistence === "memory-only" && rule.protection === "required")
12891
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] cannot require at-rest protection when it is memory-only.`);
12892
+ if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
12893
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] declares ${rule.sensitivity} arguments without required protection.`);
12894
+ }
12895
+ return policy;
12896
+ }, normalizeSyncLocalSchemaComponents = (schema = { version: 1 }) => {
12897
+ const components = isSchemaBundle(schema) ? [...schema.components] : [{ ...schema, id: "@absolutejs/app" }];
12898
+ const ids = new Set;
12899
+ for (const component of components) {
12900
+ if (typeof component.id !== "string" || component.id.trim() !== component.id || component.id.length === 0)
12901
+ throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Sync schema component id must be non-empty and trimmed");
12902
+ if (ids.has(component.id))
12903
+ throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync schema component "${component.id}" is declared more than once`);
12904
+ ids.add(component.id);
12905
+ if (component.localData)
12906
+ validateSyncLocalDataPolicy(component.localData, `${component.id}.localData`);
12907
+ }
12908
+ return components.sort((a, b2) => a.id.localeCompare(b2.id));
12909
+ }, resolveSyncLocalSchemaComponents = (storedVersions, schema = { version: 1 }) => {
12910
+ const components = normalizeSyncLocalSchemaComponents(schema).map((component) => {
12911
+ const current = resolveSyncLocalMigrations(component.version, component);
12912
+ return {
12913
+ id: component.id,
12914
+ ...resolveSyncLocalMigrations(storedVersions[component.id] ?? current.minimumCompatibleVersion, component)
12915
+ };
12916
+ });
12917
+ const active = new Set(components.map((component) => component.id));
12918
+ const orphanedComponents = Object.keys(storedVersions).filter((id) => !active.has(id)).sort();
12919
+ return { components, orphanedComponents };
12920
+ }, resolveSyncLocalMigrations = (storedVersion, schema = { version: 1 }) => {
12921
+ positiveVersion(storedVersion, "Stored Sync schema version");
12922
+ const targetVersion = positiveVersion(schema.version, "Target Sync schema version");
12923
+ const migrations = [...schema.migrations ?? []].sort((a, b2) => a.toVersion - b2.toVersion);
12924
+ const versions = new Set;
12925
+ for (const migration of migrations) {
12926
+ positiveVersion(migration.toVersion, "Sync migration toVersion");
12927
+ if (versions.has(migration.toVersion))
12928
+ throw new SyncLocalStoreSchemaError("INVALID_PLAN", `Sync migration ${migration.toVersion} is declared more than once`);
12929
+ versions.add(migration.toVersion);
12930
+ }
12931
+ const inferredMinimum = migrations[0] ? migrations[0].toVersion - 1 : targetVersion;
12932
+ const minimumCompatibleVersion = positiveVersion(schema.minimumCompatibleVersion ?? inferredMinimum, "Minimum compatible Sync schema version");
12933
+ if (minimumCompatibleVersion > targetVersion)
12934
+ throw new SyncLocalStoreSchemaError("INVALID_PLAN", "Minimum compatible Sync schema version cannot exceed its target");
12935
+ if (storedVersion > targetVersion)
12936
+ throw new SyncLocalStoreSchemaError("SCHEMA_TOO_NEW", `Stored Sync schema ${storedVersion} is newer than this runtime's schema ${targetVersion}`, { storedVersion, targetVersion });
12937
+ if (storedVersion < minimumCompatibleVersion)
12938
+ throw new SyncLocalStoreSchemaError("SCHEMA_TOO_OLD", `Stored Sync schema ${storedVersion} is older than the minimum compatible schema ${minimumCompatibleVersion}`, { storedVersion, targetVersion });
12939
+ const steps = [];
12940
+ for (let version = storedVersion + 1;version <= targetVersion; version++) {
12941
+ const migration = migrations.find((candidate) => candidate.toVersion === version);
12942
+ if (migration === undefined)
12943
+ throw new SyncLocalStoreSchemaError("MIGRATION_MISSING", `Sync migration ${version - 1} -> ${version} is missing`, { storedVersion, targetVersion });
12944
+ steps.push(migration);
12945
+ }
12946
+ return { minimumCompatibleVersion, steps, targetVersion };
12947
+ };
12948
+ var init_client = __esm(() => {
12949
+ RUNTIME_TRANSPORT = Symbol.for("@absolutejs/sync/client-runtime-transport");
12950
+ host = globalThis;
12951
+ registry = (() => {
12952
+ const existing = host[RUNTIME_TRANSPORT];
12953
+ if (isRegistry(existing))
12954
+ return existing;
12955
+ if (typeof existing === "object" && existing !== null && Array.isArray(Reflect.get(existing, "installations"))) {
12956
+ Reflect.set(existing, "clients", []);
12957
+ return existing;
12958
+ }
12959
+ const created = { clients: [], installations: [] };
12960
+ Object.defineProperty(host, RUNTIME_TRANSPORT, {
12961
+ configurable: false,
12962
+ enumerable: false,
12963
+ value: created,
12964
+ writable: false
12965
+ });
12966
+ return created;
12967
+ })();
12968
+ SyncLocalDataPolicyError = class SyncLocalDataPolicyError extends Error {
12969
+ code;
12970
+ constructor(code, message) {
12971
+ super(message);
12972
+ this.name = "SyncLocalDataPolicyError";
12973
+ this.code = code;
12974
+ }
12975
+ };
12976
+ SyncLocalStoreSchemaError = class SyncLocalStoreSchemaError extends Error {
12977
+ code;
12978
+ storedVersion;
12979
+ targetVersion;
12980
+ constructor(code, message, versions = {}) {
12981
+ super(message);
12982
+ this.name = "SyncLocalStoreSchemaError";
12983
+ this.code = code;
12984
+ this.storedVersion = versions.storedVersion;
12985
+ this.targetVersion = versions.targetVersion;
12986
+ }
12987
+ };
12988
+ });
12989
+
12990
+ // src/mobile/syncSchema.ts
12991
+ import { readFileSync as readFileSync13 } from "fs";
12992
+ import { dirname as dirname13, join as join24, resolve as resolve20 } from "path";
12993
+ var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
12994
+ try {
12995
+ const value = JSON.parse(readFileSync13(path, "utf8"));
12996
+ return object(value) ? value : undefined;
12997
+ } catch {
12998
+ return;
12999
+ }
13000
+ }, localSchemaMetadata = (manifest) => {
13001
+ const absolutejs = Reflect.get(manifest, "absolutejs");
13002
+ if (!object(absolutejs))
13003
+ return;
13004
+ const sync = Reflect.get(absolutejs, "sync");
13005
+ if (!object(sync))
13006
+ return;
13007
+ return Reflect.get(sync, "localSchema");
13008
+ }, packageManifestPath = (projectRoot, packageName) => {
13009
+ let directory = resolve20(projectRoot);
13010
+ while (true) {
13011
+ const candidate = join24(directory, "node_modules", packageName, "package.json");
13012
+ const manifest = manifestAt(candidate);
13013
+ if (manifest && Reflect.get(manifest, "name") === packageName)
13014
+ return candidate;
13015
+ const parent = dirname13(directory);
13016
+ if (parent === directory)
13017
+ return;
13018
+ directory = parent;
13019
+ }
13020
+ }, metadataError = (id, detail) => new TypeError(`Invalid AbsoluteJS Sync schema metadata for ${id}: ${detail}`), positiveVersion2 = (value, id, field) => {
13021
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
13022
+ throw metadataError(id, `${field} must be a positive safe integer.`);
13023
+ return value;
13024
+ }, nonEmpty = (value, id, field) => {
13025
+ if (typeof value !== "string" || value.trim() !== value || value.length === 0)
13026
+ throw metadataError(id, `${field} must be a non-empty trimmed string.`);
13027
+ return value;
13028
+ }, requireObject = (value, id, detail) => {
13029
+ if (!object(value))
13030
+ throw metadataError(id, detail);
13031
+ return value;
13032
+ }, unknownField = (record, key) => record[key], normalizeJsonValue = (value, id, field) => {
13033
+ if (value === null || typeof value === "string" || typeof value === "boolean")
13034
+ return value;
13035
+ if (typeof value === "number" && Number.isFinite(value))
13036
+ return value;
13037
+ if (Array.isArray(value))
13038
+ return value.map((entry) => normalizeJsonValue(entry, id, field));
13039
+ if (object(value))
13040
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
13041
+ key,
13042
+ normalizeJsonValue(entry, id, field)
13043
+ ]));
13044
+ throw metadataError(id, `${field} must be JSON-safe.`);
13045
+ }, operation = (value, id, index) => {
13046
+ const record = requireObject(value, id, `migration operation ${index} must be an object.`);
13047
+ const type = Reflect.get(record, "type");
13048
+ const collection = nonEmpty(Reflect.get(record, "collection"), id, `operation ${index}.collection`);
13049
+ if (type === "delete-collection")
13050
+ return { collection, type };
13051
+ if (type === "rename-field")
13052
+ return {
13053
+ collection,
13054
+ from: nonEmpty(Reflect.get(record, "from"), id, `operation ${index}.from`),
13055
+ to: nonEmpty(Reflect.get(record, "to"), id, `operation ${index}.to`),
13056
+ type
13057
+ };
13058
+ const field = nonEmpty(Reflect.get(record, "field"), id, `operation ${index}.field`);
13059
+ if (type === "remove-field")
13060
+ return { collection, field, type };
13061
+ if (type === "set-default")
13062
+ return {
13063
+ collection,
13064
+ field,
13065
+ type,
13066
+ value: normalizeJsonValue(Reflect.get(record, "value"), id, `operation ${index}.value`)
13067
+ };
13068
+ throw metadataError(id, `operation ${index}.type is not supported.`);
13069
+ }, migration = (value, id, index) => {
13070
+ const record = requireObject(value, id, `migration ${index} must be an object.`);
13071
+ const allowed = new Set(["operations", "toVersion"]);
13072
+ const unsupported = Object.keys(record).find((key) => !allowed.has(key));
13073
+ if (unsupported)
13074
+ throw metadataError(id, `migration ${index}.${unsupported} is not declarative metadata.`);
13075
+ const declaredOperations = Reflect.get(record, "operations");
13076
+ if (declaredOperations !== undefined && !Array.isArray(declaredOperations))
13077
+ throw metadataError(id, `migration ${index}.operations must be an array.`);
13078
+ const operations = Array.isArray(declaredOperations) ? declaredOperations : [];
13079
+ return {
13080
+ operations: operations.map((entry, operationIndex) => operation(entry, id, operationIndex)),
13081
+ toVersion: positiveVersion2(Reflect.get(record, "toVersion"), id, `migration ${index}.toVersion`)
13082
+ };
13083
+ }, localDataPolicy = (value, id) => {
13084
+ const record = requireObject(value, id, "localData must be an object.");
13085
+ const allowed = new Set([
13086
+ "collections",
13087
+ "maxBytesPerNamespace",
13088
+ "mutations"
13089
+ ]);
13090
+ const unsupported = Object.keys(record).find((key) => !allowed.has(key));
13091
+ if (unsupported)
13092
+ throw metadataError(id, `localData.${unsupported} is not supported.`);
13093
+ const collectionRules = Reflect.get(record, "collections");
13094
+ const mutationRules = Reflect.get(record, "mutations");
13095
+ if (collectionRules !== undefined && !Array.isArray(collectionRules))
13096
+ throw metadataError(id, "localData.collections must be an array.");
13097
+ if (mutationRules !== undefined && !Array.isArray(mutationRules))
13098
+ throw metadataError(id, "localData.mutations must be an array.");
13099
+ const collections = Array.isArray(collectionRules) ? collectionRules.map((entry, index) => {
13100
+ const rule = requireObject(entry, id, `localData.collections[${index}] must be an object.`);
13101
+ const allowedRuleKeys = new Set([
13102
+ "evictionPriority",
13103
+ "match",
13104
+ "maxAgeMs",
13105
+ "onProtectionUnavailable",
13106
+ "persistence",
13107
+ "protection",
13108
+ "sensitivity"
13109
+ ]);
13110
+ const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
13111
+ if (unsupportedRuleKey)
13112
+ throw metadataError(id, `localData.collections[${index}].${unsupportedRuleKey} is not supported.`);
13113
+ const match = nonEmpty(Reflect.get(rule, "match"), id, `localData.collections[${index}].match`);
13114
+ const persistence = unknownField(rule, "persistence");
13115
+ const sensitivity = unknownField(rule, "sensitivity");
13116
+ const protection = unknownField(rule, "protection");
13117
+ const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
13118
+ const evictionPriority = unknownField(rule, "evictionPriority");
13119
+ const maxAge = unknownField(rule, "maxAgeMs");
13120
+ if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
13121
+ throw metadataError(id, `localData.collections[${index}].persistence is invalid.`);
13122
+ if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
13123
+ throw metadataError(id, `localData.collections[${index}].sensitivity is invalid.`);
13124
+ if (protection !== undefined && protection !== "none" && protection !== "required")
13125
+ throw metadataError(id, `localData.collections[${index}].protection is invalid.`);
13126
+ if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
13127
+ throw metadataError(id, `localData.collections[${index}].onProtectionUnavailable is invalid.`);
13128
+ if (evictionPriority !== undefined && evictionPriority !== "critical" && evictionPriority !== "normal" && evictionPriority !== "disposable")
13129
+ throw metadataError(id, `localData.collections[${index}].evictionPriority is invalid.`);
13130
+ return {
13131
+ match,
13132
+ ...sensitivity ? { sensitivity } : {},
13133
+ ...persistence ? { persistence } : {},
13134
+ ...protection ? { protection } : {},
13135
+ ...onProtectionUnavailable ? {
13136
+ onProtectionUnavailable
13137
+ } : {},
13138
+ ...evictionPriority ? { evictionPriority } : {},
13139
+ ...maxAge === undefined ? {} : {
13140
+ maxAgeMs: positiveVersion2(maxAge, id, `localData.collections[${index}].maxAgeMs`)
13141
+ }
13142
+ };
13143
+ }) : undefined;
13144
+ const mutations = Array.isArray(mutationRules) ? mutationRules.map((entry, index) => {
13145
+ const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
13146
+ const allowedRuleKeys = new Set([
13147
+ "conflict",
13148
+ "match",
13149
+ "onProtectionUnavailable",
13150
+ "persistence",
13151
+ "protection",
13152
+ "sensitivity"
13153
+ ]);
13154
+ const unsupportedRuleKey = Object.keys(rule).find((key) => !allowedRuleKeys.has(key));
13155
+ if (unsupportedRuleKey)
13156
+ throw metadataError(id, `localData.mutations[${index}].${unsupportedRuleKey} is not supported.`);
13157
+ const protection = unknownField(rule, "protection");
13158
+ const sensitivity = unknownField(rule, "sensitivity");
13159
+ const persistence = unknownField(rule, "persistence");
13160
+ const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
13161
+ const declaredConflict = unknownField(rule, "conflict");
13162
+ let conflict;
13163
+ if (declaredConflict !== undefined) {
13164
+ const conflictRecord = requireObject(declaredConflict, id, `localData.mutations[${index}].conflict must be an object.`);
13165
+ const unsupportedConflictKey = Object.keys(conflictRecord).find((key) => key !== "maxAttempts" && key !== "strategy");
13166
+ if (unsupportedConflictKey)
13167
+ throw metadataError(id, `localData.mutations[${index}].conflict.${unsupportedConflictKey} is not supported.`);
13168
+ const strategy = unknownField(conflictRecord, "strategy");
13169
+ if (strategy !== "client-wins" && strategy !== "manual" && strategy !== "server-wins")
13170
+ throw metadataError(id, `localData.mutations[${index}].conflict.strategy is invalid.`);
13171
+ const maxAttempts = unknownField(conflictRecord, "maxAttempts");
13172
+ if (maxAttempts !== undefined && strategy !== "client-wins")
13173
+ throw metadataError(id, `localData.mutations[${index}].conflict.maxAttempts requires client-wins.`);
13174
+ conflict = {
13175
+ strategy,
13176
+ ...maxAttempts === undefined ? {} : {
13177
+ maxAttempts: positiveVersion2(maxAttempts, id, `localData.mutations[${index}].conflict.maxAttempts`)
13178
+ }
13179
+ };
13180
+ }
13181
+ if (protection !== undefined && protection !== "none" && protection !== "required")
13182
+ throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
13183
+ if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
13184
+ throw metadataError(id, `localData.mutations[${index}].sensitivity is invalid.`);
13185
+ if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
13186
+ throw metadataError(id, `localData.mutations[${index}].onProtectionUnavailable is invalid.`);
13187
+ if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
13188
+ throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
13189
+ return {
13190
+ match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
13191
+ ...conflict ? { conflict } : {},
13192
+ ...sensitivity ? { sensitivity } : {},
13193
+ ...onProtectionUnavailable ? { onProtectionUnavailable } : {},
13194
+ ...persistence ? {
13195
+ persistence
13196
+ } : {},
13197
+ ...protection ? { protection } : {}
13198
+ };
13199
+ }) : undefined;
13200
+ const quota = Reflect.get(record, "maxBytesPerNamespace");
13201
+ return {
13202
+ ...collections ? { collections } : {},
13203
+ ...mutations ? { mutations } : {},
13204
+ ...quota === undefined ? {} : {
13205
+ maxBytesPerNamespace: positiveVersion2(quota, id, "localData.maxBytesPerNamespace")
13206
+ }
13207
+ };
13208
+ }, component = (id, value) => {
13209
+ const record = requireObject(value, id, "localSchema must be an object.");
13210
+ const allowed = new Set([
13211
+ "localData",
13212
+ "migrations",
13213
+ "minimumCompatibleVersion",
13214
+ "version"
13215
+ ]);
13216
+ const unsupported = Object.keys(record).find((key) => !allowed.has(key));
13217
+ if (unsupported)
13218
+ throw metadataError(id, `${unsupported} is not supported.`);
13219
+ const version = positiveVersion2(Reflect.get(record, "version"), id, "version");
13220
+ const declaredMinimum = Reflect.get(record, "minimumCompatibleVersion");
13221
+ const minimumCompatibleVersion = declaredMinimum === undefined ? Math.max(1, version - 2) : positiveVersion2(declaredMinimum, id, "minimumCompatibleVersion");
13222
+ const declaredMigrations = Reflect.get(record, "migrations");
13223
+ const declaredLocalData = Reflect.get(record, "localData");
13224
+ if (declaredMigrations !== undefined && !Array.isArray(declaredMigrations))
13225
+ throw metadataError(id, "migrations must be an array.");
13226
+ const migrations = Array.isArray(declaredMigrations) ? declaredMigrations : undefined;
13227
+ return {
13228
+ id,
13229
+ ...declaredLocalData === undefined ? {} : { localData: localDataPolicy(declaredLocalData, id) },
13230
+ minimumCompatibleVersion,
13231
+ ...Array.isArray(migrations) ? {
13232
+ migrations: migrations.map((entry, index) => migration(entry, id, index))
13233
+ } : {},
13234
+ version
13235
+ };
13236
+ }, dependencyNames = (manifest) => [
13237
+ Reflect.get(manifest, "dependencies"),
13238
+ Reflect.get(manifest, "optionalDependencies"),
13239
+ Reflect.get(manifest, "devDependencies"),
13240
+ Reflect.get(manifest, "peerDependencies")
13241
+ ].flatMap((dependencies) => object(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
13242
+ const appManifestPath = join24(resolve20(projectRoot), "package.json");
13243
+ const appManifest = manifestAt(appManifestPath);
13244
+ if (!appManifest)
13245
+ return {
13246
+ components: [
13247
+ {
13248
+ id: "@absolutejs/app",
13249
+ minimumCompatibleVersion: 1,
13250
+ version: 1
13251
+ }
13252
+ ],
13253
+ sources: []
13254
+ };
13255
+ const appMetadata = localSchemaMetadata(appManifest);
13256
+ const components = [
13257
+ appMetadata === undefined ? { id: "@absolutejs/app", minimumCompatibleVersion: 1, version: 1 } : component("@absolutejs/app", appMetadata)
13258
+ ];
13259
+ const sources = [
13260
+ { id: "@absolutejs/app", manifestPath: appManifestPath }
13261
+ ];
13262
+ for (const name of dependencyNames(appManifest)) {
13263
+ const manifestPath = packageManifestPath(projectRoot, name);
13264
+ if (!manifestPath)
13265
+ continue;
13266
+ const manifest = manifestAt(manifestPath);
13267
+ if (!manifest)
13268
+ continue;
13269
+ const metadata = localSchemaMetadata(manifest);
13270
+ if (metadata === undefined)
13271
+ continue;
13272
+ components.push(component(name, metadata));
13273
+ sources.push({ id: name, manifestPath });
13274
+ }
13275
+ components.sort((left, right) => left.id.localeCompare(right.id));
13276
+ sources.sort((left, right) => left.id.localeCompare(right.id));
13277
+ resolveSyncLocalSchemaComponents({}, { components });
13278
+ return { components, sources };
13279
+ };
13280
+ var init_syncSchema = __esm(() => {
13281
+ init_client();
13282
+ });
13283
+
13284
+ // src/build/pwa.ts
13285
+ import { mkdir as mkdir5, rm as rm4, writeFile as writeFile5 } from "fs/promises";
13286
+ import { dirname as dirname14, join as join25 } from "path";
13287
+ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
13288
+ const input = value ?? fallback;
13289
+ if (!input.startsWith("/") || input.startsWith("//")) {
13290
+ throw new TypeError(`${field} must be an absolute same-origin path.`);
13291
+ }
13292
+ let url;
13293
+ try {
13294
+ url = new URL(input, "https://absolute.invalid");
13295
+ } catch {
13296
+ throw new TypeError(`${field} must be an absolute same-origin path.`);
13297
+ }
13298
+ if (url.origin !== "https://absolute.invalid" || url.search || url.hash || url.pathname === "/") {
13299
+ throw new TypeError(`${field} must be a file path without query or hash.`);
13300
+ }
13301
+ for (const part of input.split("/")) {
13302
+ let decoded;
13303
+ try {
13304
+ decoded = decodeURIComponent(part);
13305
+ } catch {
13306
+ throw new TypeError(`${field} contains invalid URL encoding.`);
13307
+ }
13308
+ if (decoded === "." || decoded === ".." || decoded.includes("\\")) {
13309
+ throw new TypeError(`${field} must not contain traversal segments.`);
13310
+ }
13311
+ }
13312
+ return url.pathname;
13313
+ }, destinationFor = (buildPath, publicPath) => join25(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
13314
+ clientModule,
13315
+ manifestPath,
13316
+ serviceWorkerPath,
13317
+ sync
13318
+ }) => `import { registerServiceWorker } from ${JSON.stringify(clientModule)};
13319
+ ${manifestPath ? `const manifest = document.querySelector('link[rel="manifest"]') ?? document.createElement('link');
13320
+ manifest.setAttribute('rel', 'manifest');
13321
+ manifest.setAttribute('href', ${JSON.stringify(manifestPath)});
13322
+ if (!manifest.isConnected) document.head.append(manifest);
13323
+ ` : ""}await registerServiceWorker(${JSON.stringify(serviceWorkerPath)}, {
13324
+ deferUntilLoad: false${sync ? `,
13325
+ sync: ${JSON.stringify(sync)}` : ""}
13326
+ });
13327
+ `, injectionSource = () => `if (typeof window !== 'undefined') {
13328
+ await import(new URL(${JSON.stringify(BOOTSTRAP_PUBLIC_PATH)}, window.location.origin).href);
13329
+ }
13330
+ `, injectPwaBootstrapHtml = (html) => {
13331
+ if (html.includes(BOOTSTRAP_MARKER))
13332
+ return html;
13333
+ const script = `<script type="module" src="${BOOTSTRAP_PUBLIC_PATH}" ${BOOTSTRAP_MARKER}></script>`;
13334
+ const closingHead = html.toLowerCase().indexOf("</head>");
13335
+ if (closingHead >= 0) {
13336
+ return `${html.slice(0, closingHead)}${script}${html.slice(closingHead)}`;
13337
+ }
13338
+ return `${script}${html}`;
13339
+ }, materializeAbsolutePwa = async ({
13340
+ buildPath,
13341
+ config,
13342
+ generatedRoot,
13343
+ projectRoot,
13344
+ write: write2 = true
13345
+ }) => {
13346
+ const serviceWorkerPath = publicFilePath(config.serviceWorkerPath, "/sw.js", "pwa.serviceWorkerPath");
13347
+ if (serviceWorkerPath.slice(1).includes("/")) {
13348
+ throw new TypeError("pwa.serviceWorkerPath must be a root-level file so its default service-worker scope covers the application.");
13349
+ }
13350
+ const manifestPath = config.manifest ? publicFilePath(config.manifest.path, "/manifest.webmanifest", "pwa.manifest.path") : undefined;
13351
+ const artifacts = {
13352
+ bootstrapBanner: injectionSource(),
13353
+ bootstrapPublicPath: BOOTSTRAP_PUBLIC_PATH,
13354
+ manifestPath,
13355
+ serviceWorkerPath
13356
+ };
13357
+ if (!write2)
13358
+ return artifacts;
13359
+ const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
13360
+ const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
13361
+ const workerDestination = destinationFor(buildPath, serviceWorkerPath);
13362
+ await mkdir5(dirname14(workerDestination), { recursive: true });
13363
+ await writeFile5(workerDestination, `${pushServiceWorker({
13364
+ ...config.serviceWorker ?? {},
13365
+ sync: Boolean(config.sync)
13366
+ })}
13367
+ `);
13368
+ if (config.manifest && manifestPath) {
13369
+ const { path: _path, ...manifestConfig } = config.manifest;
13370
+ const manifestDestination = destinationFor(buildPath, manifestPath);
13371
+ await mkdir5(dirname14(manifestDestination), { recursive: true });
13372
+ await writeFile5(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
13373
+ `);
13374
+ }
13375
+ const generatedDirectory = join25(generatedRoot, "pwa");
13376
+ const bootstrapEntry = join25(generatedDirectory, "bootstrap.ts");
13377
+ const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
13378
+ await mkdir5(generatedDirectory, { recursive: true });
13379
+ await writeFile5(bootstrapEntry, bootstrapEntrySource({
13380
+ clientModule,
13381
+ manifestPath,
13382
+ serviceWorkerPath,
13383
+ sync: config.sync ? {
13384
+ ...config.sync === true ? {} : config.sync,
13385
+ storageSchema: {
13386
+ components: syncSchema?.components ?? []
13387
+ }
13388
+ } : config.sync
13389
+ }));
13390
+ const browserDirectory = destinationFor(buildPath, "/__absolute/pwa");
13391
+ await rm4(browserDirectory, { force: true, recursive: true });
13392
+ await mkdir5(browserDirectory, { recursive: true });
13393
+ const result = await Bun.build({
13394
+ entrypoints: [bootstrapEntry],
13395
+ format: "esm",
13396
+ minify: true,
13397
+ naming: {
13398
+ asset: "asset-[hash].[ext]",
13399
+ chunk: "chunk-[hash].[ext]",
13400
+ entry: "bootstrap.js"
13401
+ },
13402
+ outdir: browserDirectory,
13403
+ splitting: true,
13404
+ target: "browser"
13405
+ });
13406
+ if (!result.success) {
13407
+ throw new AggregateError(result.logs, "Failed to build the AbsoluteJS PWA bootstrap.");
13408
+ }
13409
+ return artifacts;
13410
+ };
13411
+ var init_pwa = __esm(() => {
13412
+ init_syncSchema();
13413
+ });
13414
+
12852
13415
  // src/build/scanVueSsrOnlyPages.ts
12853
13416
  var exports_scanVueSsrOnlyPages = {};
12854
13417
  __export(exports_scanVueSsrOnlyPages, {
12855
13418
  scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
12856
13419
  });
12857
- import { readdirSync as readdirSync2, readFileSync as readFileSync13 } from "fs";
12858
- import { join as join24 } from "path";
13420
+ import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
13421
+ import { join as join26 } from "path";
12859
13422
  import ts8 from "typescript";
12860
13423
  var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
12861
13424
  if (filePath.endsWith(".tsx"))
@@ -12888,9 +13451,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
12888
13451
  continue;
12889
13452
  if (entry.name.startsWith("."))
12890
13453
  continue;
12891
- stack.push(join24(dir, entry.name));
13454
+ stack.push(join26(dir, entry.name));
12892
13455
  } else if (entry.isFile() && hasSourceExtension2(entry.name)) {
12893
- out.push(join24(dir, entry.name));
13456
+ out.push(join26(dir, entry.name));
12894
13457
  }
12895
13458
  }
12896
13459
  }
@@ -12957,7 +13520,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind3 = (filePath) => {
12957
13520
  }, extractFromFile = (filePath, out) => {
12958
13521
  let source;
12959
13522
  try {
12960
- source = readFileSync13(filePath, "utf-8");
13523
+ source = readFileSync14(filePath, "utf-8");
12961
13524
  } catch {
12962
13525
  return;
12963
13526
  }
@@ -13001,8 +13564,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
13001
13564
  });
13002
13565
 
13003
13566
  // src/build/scanAngularHandlerCalls.ts
13004
- import { readdirSync as readdirSync3, readFileSync as readFileSync14 } from "fs";
13005
- import { join as join25 } from "path";
13567
+ import { readdirSync as readdirSync3, readFileSync as readFileSync15 } from "fs";
13568
+ import { join as join27 } from "path";
13006
13569
  import ts9 from "typescript";
13007
13570
  var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
13008
13571
  if (filePath.endsWith(".tsx"))
@@ -13035,9 +13598,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
13035
13598
  continue;
13036
13599
  if (entry.name.startsWith("."))
13037
13600
  continue;
13038
- stack.push(join25(dir, entry.name));
13601
+ stack.push(join27(dir, entry.name));
13039
13602
  } else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
13040
- out.push(join25(dir, entry.name));
13603
+ out.push(join27(dir, entry.name));
13041
13604
  }
13042
13605
  }
13043
13606
  }
@@ -13072,7 +13635,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, SERVER_ENTRY_COPY_PRE
13072
13635
  }, extractCallsFromFile = (filePath, out) => {
13073
13636
  let source;
13074
13637
  try {
13075
- source = readFileSync14(filePath, "utf-8");
13638
+ source = readFileSync15(filePath, "utf-8");
13076
13639
  } catch {
13077
13640
  return;
13078
13641
  }
@@ -13151,8 +13714,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
13151
13714
  });
13152
13715
 
13153
13716
  // src/build/scanAngularPageRoutes.ts
13154
- import { readdirSync as readdirSync4, readFileSync as readFileSync15 } from "fs";
13155
- import { basename as basename9, join as join26 } from "path";
13717
+ import { readdirSync as readdirSync4, readFileSync as readFileSync16 } from "fs";
13718
+ import { basename as basename9, join as join28 } from "path";
13156
13719
  import ts10 from "typescript";
13157
13720
  var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13158
13721
  const idx = filePath.lastIndexOf(".");
@@ -13192,9 +13755,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13192
13755
  continue;
13193
13756
  if (entry.name.startsWith("."))
13194
13757
  continue;
13195
- stack.push(join26(dir, entry.name));
13758
+ stack.push(join28(dir, entry.name));
13196
13759
  } else if (entry.isFile() && isPageFile(entry.name)) {
13197
- out.push(join26(dir, entry.name));
13760
+ out.push(join28(dir, entry.name));
13198
13761
  }
13199
13762
  }
13200
13763
  }
@@ -13223,7 +13786,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13223
13786
  for (const file of files) {
13224
13787
  let source;
13225
13788
  try {
13226
- source = readFileSync15(file, "utf-8");
13789
+ source = readFileSync16(file, "utf-8");
13227
13790
  } catch {
13228
13791
  continue;
13229
13792
  }
@@ -13270,8 +13833,8 @@ var exports_parseAngularConfigImports = {};
13270
13833
  __export(exports_parseAngularConfigImports, {
13271
13834
  parseAngularProvidersImport: () => parseAngularProvidersImport
13272
13835
  });
13273
- import { existsSync as existsSync20, readFileSync as readFileSync16 } from "fs";
13274
- import { dirname as dirname13, isAbsolute as isAbsolute3, join as join27 } from "path";
13836
+ import { existsSync as existsSync20, readFileSync as readFileSync17 } from "fs";
13837
+ import { dirname as dirname15, isAbsolute as isAbsolute3, join as join29 } from "path";
13275
13838
  import ts11 from "typescript";
13276
13839
  var findDefineConfigCall = (sf) => {
13277
13840
  let result = null;
@@ -13289,8 +13852,8 @@ var findDefineConfigCall = (sf) => {
13289
13852
  };
13290
13853
  ts11.forEachChild(sf, visit);
13291
13854
  return result;
13292
- }, findPropertyInitializer = (object, name) => {
13293
- for (const prop of object.properties) {
13855
+ }, findPropertyInitializer = (object2, name) => {
13856
+ for (const prop of object2.properties) {
13294
13857
  if (!ts11.isPropertyAssignment(prop))
13295
13858
  continue;
13296
13859
  if (!prop.name)
@@ -13326,15 +13889,15 @@ var findDefineConfigCall = (sf) => {
13326
13889
  }, resolveConfigPath = (projectRoot) => {
13327
13890
  const envOverride = process.env.ABSOLUTE_CONFIG;
13328
13891
  if (envOverride) {
13329
- const resolved = isAbsolute3(envOverride) ? envOverride : join27(projectRoot, envOverride);
13892
+ const resolved = isAbsolute3(envOverride) ? envOverride : join29(projectRoot, envOverride);
13330
13893
  if (existsSync20(resolved))
13331
13894
  return resolved;
13332
13895
  }
13333
13896
  const candidates = [
13334
- join27(projectRoot, "absolute.config.ts"),
13335
- join27(projectRoot, "absolute.config.mts"),
13336
- join27(projectRoot, "absolute.config.js"),
13337
- join27(projectRoot, "absolute.config.mjs")
13897
+ join29(projectRoot, "absolute.config.ts"),
13898
+ join29(projectRoot, "absolute.config.mts"),
13899
+ join29(projectRoot, "absolute.config.js"),
13900
+ join29(projectRoot, "absolute.config.mjs")
13338
13901
  ];
13339
13902
  for (const candidate of candidates) {
13340
13903
  if (existsSync20(candidate))
@@ -13345,7 +13908,7 @@ var findDefineConfigCall = (sf) => {
13345
13908
  const configPath2 = resolveConfigPath(projectRoot);
13346
13909
  if (!configPath2)
13347
13910
  return null;
13348
- const source = readFileSync16(configPath2, "utf-8");
13911
+ const source = readFileSync17(configPath2, "utf-8");
13349
13912
  if (!source.includes("angular"))
13350
13913
  return null;
13351
13914
  if (!source.includes("providers"))
@@ -13366,8 +13929,8 @@ var findDefineConfigCall = (sf) => {
13366
13929
  const importInfo = findImportForBinding(sf, binding);
13367
13930
  if (!importInfo)
13368
13931
  return null;
13369
- const configDir2 = dirname13(configPath2);
13370
- const absolutePath = importInfo.source.startsWith(".") ? join27(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
13932
+ const configDir2 = dirname15(configPath2);
13933
+ const absolutePath = importInfo.source.startsWith(".") ? join29(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
13371
13934
  return {
13372
13935
  absolutePath,
13373
13936
  bindingName: binding,
@@ -13382,8 +13945,8 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
13382
13945
  const componentMatch = attributeString.match(/\bcomponent\s*=\s*["']([^"']+)["']/);
13383
13946
  const hydrateMatch = attributeString.match(/\bhydrate\s*=\s*["']([^"']+)["']/);
13384
13947
  const framework = frameworkMatch?.[1];
13385
- const component = componentMatch?.[1];
13386
- if (!framework || !component) {
13948
+ const component2 = componentMatch?.[1];
13949
+ if (!framework || !component2) {
13387
13950
  return null;
13388
13951
  }
13389
13952
  if (!isIslandFramework2(framework)) {
@@ -13391,7 +13954,7 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
13391
13954
  }
13392
13955
  const hydrateCandidate = hydrateMatch?.[1];
13393
13956
  return {
13394
- component,
13957
+ component: component2,
13395
13958
  framework,
13396
13959
  hydrate: hydrateCandidate && isIslandHydrate(hydrateCandidate) ? hydrateCandidate : undefined
13397
13960
  };
@@ -13400,12 +13963,12 @@ var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => is
13400
13963
  return;
13401
13964
  usageMap.set(normalizeUsage(usage), usage);
13402
13965
  }, addRenderCallUsage = (usageMap, match) => {
13403
- const [, framework, component, hydrate] = match;
13404
- if (!framework || !component || !isIslandFramework2(framework)) {
13966
+ const [, framework, component2, hydrate] = match;
13967
+ if (!framework || !component2 || !isIslandFramework2(framework)) {
13405
13968
  return;
13406
13969
  }
13407
13970
  addUsage(usageMap, {
13408
- component,
13971
+ component: component2,
13409
13972
  framework,
13410
13973
  hydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined
13411
13974
  });
@@ -13459,7 +14022,7 @@ __export(exports_renderToReadableStream, {
13459
14022
  renderToReadableStream: () => renderToReadableStream,
13460
14023
  SVELTE_PAGE_ROOT_ID: () => SVELTE_PAGE_ROOT_ID
13461
14024
  });
13462
- var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component, props, {
14025
+ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = async (component2, props, {
13463
14026
  bootstrapScriptContent,
13464
14027
  bootstrapScripts = [],
13465
14028
  bootstrapModules = [],
@@ -13473,7 +14036,7 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
13473
14036
  try {
13474
14037
  const { render } = await import("svelte/server");
13475
14038
  const renderComponent = render;
13476
- const rendered = typeof props === "undefined" ? await renderComponent(component) : await renderComponent(component, { props });
14039
+ const rendered = typeof props === "undefined" ? await renderComponent(component2) : await renderComponent(component2, { props });
13477
14040
  const { head, body } = rendered;
13478
14041
  const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
13479
14042
  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("");
@@ -13516,13 +14079,13 @@ __export(exports_compileSvelte, {
13516
14079
  clearSvelteCompilerCache: () => clearSvelteCompilerCache
13517
14080
  });
13518
14081
  import { existsSync as existsSync21 } from "fs";
13519
- import { mkdir as mkdir5, stat as stat2 } from "fs/promises";
14082
+ import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
13520
14083
  import {
13521
- dirname as dirname14,
13522
- join as join28,
14084
+ dirname as dirname16,
14085
+ join as join30,
13523
14086
  basename as basename10,
13524
14087
  extname as extname7,
13525
- resolve as resolve20,
14088
+ resolve as resolve21,
13526
14089
  relative as relative11,
13527
14090
  sep as sep2
13528
14091
  } from "path";
@@ -13530,14 +14093,14 @@ import { env } from "process";
13530
14093
  var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
13531
14094
  var resolveDevClientDir2 = () => {
13532
14095
  const projectRoot = process.cwd();
13533
- const fromSource = resolve20(import.meta.dir, "../dev/client");
14096
+ const fromSource = resolve21(import.meta.dir, "../dev/client");
13534
14097
  if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
13535
14098
  return fromSource;
13536
14099
  }
13537
- const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
14100
+ const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
13538
14101
  if (existsSync21(fromNodeModules))
13539
14102
  return fromNodeModules;
13540
- return resolve20(import.meta.dir, "./dev/client");
14103
+ return resolve21(import.meta.dir, "./dev/client");
13541
14104
  }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
13542
14105
  persistentCache.clear();
13543
14106
  sourceHashCache.clear();
@@ -13567,7 +14130,7 @@ var resolveDevClientDir2 = () => {
13567
14130
  }, resolveRelativeModule2 = async (spec, from) => {
13568
14131
  if (!spec.startsWith("."))
13569
14132
  return null;
13570
- const basePath = resolve20(dirname14(from), spec);
14133
+ const basePath = resolve21(dirname16(from), spec);
13571
14134
  const candidates = [
13572
14135
  basePath,
13573
14136
  `${basePath}.ts`,
@@ -13578,14 +14141,14 @@ var resolveDevClientDir2 = () => {
13578
14141
  `${basePath}.svelte`,
13579
14142
  `${basePath}.svelte.ts`,
13580
14143
  `${basePath}.svelte.js`,
13581
- join28(basePath, "index.ts"),
13582
- join28(basePath, "index.js"),
13583
- join28(basePath, "index.mjs"),
13584
- join28(basePath, "index.cjs"),
13585
- join28(basePath, "index.json"),
13586
- join28(basePath, "index.svelte"),
13587
- join28(basePath, "index.svelte.ts"),
13588
- join28(basePath, "index.svelte.js")
14144
+ join30(basePath, "index.ts"),
14145
+ join30(basePath, "index.js"),
14146
+ join30(basePath, "index.mjs"),
14147
+ join30(basePath, "index.cjs"),
14148
+ join30(basePath, "index.json"),
14149
+ join30(basePath, "index.svelte"),
14150
+ join30(basePath, "index.svelte.ts"),
14151
+ join30(basePath, "index.svelte.js")
13589
14152
  ];
13590
14153
  const checks = await Promise.all(candidates.map(exists));
13591
14154
  return candidates.find((_2, index) => checks[index]) ?? null;
@@ -13594,7 +14157,7 @@ var resolveDevClientDir2 = () => {
13594
14157
  const resolved = resolvePackageImport(spec);
13595
14158
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
13596
14159
  }
13597
- const basePath = resolve20(dirname14(from), spec);
14160
+ const basePath = resolve21(dirname16(from), spec);
13598
14161
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
13599
14162
  if (!explicit) {
13600
14163
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -13624,10 +14187,10 @@ var resolveDevClientDir2 = () => {
13624
14187
  }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
13625
14188
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
13626
14189
  const generatedDir = getFrameworkGeneratedDir("svelte");
13627
- const clientDir = join28(generatedDir, "client");
13628
- const indexDir = join28(generatedDir, "indexes");
13629
- const serverDir = join28(generatedDir, "server");
13630
- await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir5(dir, { recursive: true })));
14190
+ const clientDir = join30(generatedDir, "client");
14191
+ const indexDir = join30(generatedDir, "indexes");
14192
+ const serverDir = join30(generatedDir, "server");
14193
+ await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir6(dir, { recursive: true })));
13631
14194
  const dev = env.NODE_ENV !== "production";
13632
14195
  const build = async (src) => {
13633
14196
  const memoized = cache.get(src);
@@ -13654,8 +14217,8 @@ var resolveDevClientDir2 = () => {
13654
14217
  const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
13655
14218
  const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
13656
14219
  const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
13657
- const rawRel = dirname14(relative11(svelteRoot, src)).replace(/\\/g, "/");
13658
- const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname14(src)).replace(/\\/g, "/")}` : rawRel;
14220
+ const rawRel = dirname16(relative11(svelteRoot, src)).replace(/\\/g, "/");
14221
+ const relDir = rawRel.startsWith("..") ? `_ext/${relative11(process.cwd(), dirname16(src)).replace(/\\/g, "/")}` : rawRel;
13659
14222
  const baseName = basename10(src).replace(/\.svelte(\.(ts|js))?$/, "");
13660
14223
  const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
13661
14224
  const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
@@ -13664,8 +14227,8 @@ var resolveDevClientDir2 = () => {
13664
14227
  const childBuilt = await Promise.all(childSources.map((child) => build(child)));
13665
14228
  const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
13666
14229
  const externalRewrites = new Map;
13667
- const ssrOutputDir = dirname14(join28(serverDir, relDir, `${baseName}.js`));
13668
- const clientOutputDir = dirname14(join28(clientDir, relDir, `${baseName}.js`));
14230
+ const ssrOutputDir = dirname16(join30(serverDir, relDir, `${baseName}.js`));
14231
+ const clientOutputDir = dirname16(join30(clientDir, relDir, `${baseName}.js`));
13669
14232
  for (let idx = 0;idx < importPaths.length; idx++) {
13670
14233
  const rawSpec = importPaths[idx];
13671
14234
  if (!rawSpec)
@@ -13730,11 +14293,11 @@ var resolveDevClientDir2 = () => {
13730
14293
  code += islandMetadataExports;
13731
14294
  return { code, map: compiledJs.map };
13732
14295
  };
13733
- const ssrPath = join28(serverDir, relDir, `${baseName}.js`);
13734
- const clientPath = join28(clientDir, relDir, `${baseName}.js`);
14296
+ const ssrPath = join30(serverDir, relDir, `${baseName}.js`);
14297
+ const clientPath = join30(clientDir, relDir, `${baseName}.js`);
13735
14298
  await Promise.all([
13736
- mkdir5(dirname14(ssrPath), { recursive: true }),
13737
- mkdir5(dirname14(clientPath), { recursive: true })
14299
+ mkdir6(dirname16(ssrPath), { recursive: true }),
14300
+ mkdir6(dirname16(clientPath), { recursive: true })
13738
14301
  ]);
13739
14302
  const inlineMap = (map) => map ? `
13740
14303
  //# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
@@ -13769,10 +14332,10 @@ var resolveDevClientDir2 = () => {
13769
14332
  const roots = await Promise.all(entryPoints.map(build));
13770
14333
  const componentRoots = roots.filter((root) => !root.isModule);
13771
14334
  await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
13772
- const relClientDir = dirname14(relative11(clientDir, client));
14335
+ const relClientDir = dirname16(relative11(clientDir, client));
13773
14336
  const name = basename10(client, extname7(client));
13774
- const indexPath = join28(indexDir, relClientDir, `${name}.js`);
13775
- const importRaw = relative11(dirname14(indexPath), client).split(sep2).join("/");
14337
+ const indexPath = join30(indexDir, relClientDir, `${name}.js`);
14338
+ const importRaw = relative11(dirname16(indexPath), client).split(sep2).join("/");
13776
14339
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
13777
14340
  const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
13778
14341
  import "${hmrClientPath3}";
@@ -13783,8 +14346,9 @@ import { hydrate, mount, unmount } from "svelte";
13783
14346
  var initialProps = (typeof window !== "undefined" && window.__INITIAL_PROPS__) ? window.__INITIAL_PROPS__ : {};
13784
14347
  var isHMR = typeof window !== "undefined" && window.__SVELTE_COMPONENT__ !== undefined;
13785
14348
  var isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;
14349
+ var isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";
13786
14350
  var hasIslandHtml = false;
13787
- var shouldHydrate = typeof window === "undefined" ? false : ${hasAwaitSlot ? "false" : "true"};
14351
+ var shouldHydrate = typeof window === "undefined" || isClientRender ? false : ${hasAwaitSlot ? "false" : "true"};
13788
14352
  var component;
13789
14353
  var target = document.getElementById(${JSON.stringify(SVELTE_PAGE_ROOT_ID)}) || document.body;
13790
14354
 
@@ -13815,6 +14379,8 @@ if (isHMR) {
13815
14379
  }
13816
14380
  component = mount(Component, { target, props: mergedProps });
13817
14381
  window.__HMR_PRESERVED_STATE__ = undefined;
14382
+ } else if (isClientRender) {
14383
+ component = mount(Component, { target, props: initialProps });
13818
14384
  } else if (!shouldHydrate) {
13819
14385
  component = undefined;
13820
14386
  } else if (isSsrDirty || hasIslandHtml) {
@@ -13826,6 +14392,13 @@ if (isHMR) {
13826
14392
  if (typeof window !== "undefined") {
13827
14393
  window.__SVELTE_COMPONENT__ = component;
13828
14394
  window.__SVELTE_UNMOUNT__ = function() { if (component) { unmount(component); } };
14395
+ window.__ABSOLUTE_PAGE_READY__ = Promise.resolve();
14396
+ window.__ABSOLUTE_PAGE_DISPOSE__ = function() {
14397
+ if (component) { unmount(component); }
14398
+ component = undefined;
14399
+ window.__SVELTE_COMPONENT__ = undefined;
14400
+ window.__SVELTE_UNMOUNT__ = undefined;
14401
+ };
13829
14402
  window.__SVELTE_REMOUNT__ = function(props) {
13830
14403
  if (typeof window.__SVELTE_UNMOUNT__ === "function") {
13831
14404
  try { window.__SVELTE_UNMOUNT__(); } catch (err) { /* ignore */ }
@@ -13851,14 +14424,14 @@ if (typeof window !== "undefined") {
13851
14424
  setTimeout(releaseStreamingSlots, 0);
13852
14425
  }
13853
14426
  }`;
13854
- await mkdir5(dirname14(indexPath), { recursive: true });
14427
+ await mkdir6(dirname16(indexPath), { recursive: true });
13855
14428
  return write2(indexPath, bootstrap);
13856
14429
  }));
13857
14430
  return {
13858
14431
  svelteClientPaths: roots.map(({ client }) => client),
13859
14432
  svelteIndexPaths: componentRoots.map(({ client }) => {
13860
- const rel = dirname14(relative11(clientDir, client));
13861
- return join28(indexDir, rel, basename10(client));
14433
+ const rel = dirname16(relative11(clientDir, client));
14434
+ return join30(indexDir, rel, basename10(client));
13862
14435
  }),
13863
14436
  svelteServerPaths: roots.map(({ ssr }) => ssr)
13864
14437
  };
@@ -13873,7 +14446,7 @@ var init_compileSvelte = __esm(() => {
13873
14446
  init_lowerAwaitSlotSyntax();
13874
14447
  init_renderToReadableStream();
13875
14448
  devClientDir2 = resolveDevClientDir2();
13876
- hmrClientPath3 = join28(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
14449
+ hmrClientPath3 = join30(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
13877
14450
  persistentCache = new Map;
13878
14451
  sourceHashCache = new Map;
13879
14452
  transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
@@ -13940,7 +14513,7 @@ __export(exports_chainInlineSourcemaps, {
13940
14513
  chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
13941
14514
  buildLineRemap: () => buildLineRemap
13942
14515
  });
13943
- import { readFileSync as readFileSync17, writeFileSync as writeFileSync7 } from "fs";
14516
+ import { readFileSync as readFileSync18, writeFileSync as writeFileSync7 } from "fs";
13944
14517
  var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
13945
14518
  let result = 0;
13946
14519
  let shift = 0;
@@ -14231,7 +14804,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
14231
14804
  version: 3
14232
14805
  };
14233
14806
  }, chainBundleInlineSourcemap = (bundleFilePath) => {
14234
- const text = readFileSync17(bundleFilePath, "utf-8");
14807
+ const text = readFileSync18(bundleFilePath, "utf-8");
14235
14808
  const outerMap = extractInlineMap(text);
14236
14809
  if (!outerMap)
14237
14810
  return;
@@ -14251,7 +14824,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
14251
14824
  }, chainExternalSourcemap = (mapFilePath) => {
14252
14825
  let outerMap;
14253
14826
  try {
14254
- outerMap = JSON.parse(readFileSync17(mapFilePath, "utf-8"));
14827
+ outerMap = JSON.parse(readFileSync18(mapFilePath, "utf-8"));
14255
14828
  } catch {
14256
14829
  return;
14257
14830
  }
@@ -14350,27 +14923,27 @@ __export(exports_compileVue, {
14350
14923
  compileVue: () => compileVue,
14351
14924
  clearVueHmrCaches: () => clearVueHmrCaches
14352
14925
  });
14353
- import { existsSync as existsSync22, readFileSync as readFileSync18, realpathSync as realpathSync2 } from "fs";
14354
- import { mkdir as mkdir6 } from "fs/promises";
14926
+ import { existsSync as existsSync22, readFileSync as readFileSync19, realpathSync as realpathSync2 } from "fs";
14927
+ import { mkdir as mkdir7 } from "fs/promises";
14355
14928
  import {
14356
14929
  basename as basename11,
14357
- dirname as dirname15,
14930
+ dirname as dirname17,
14358
14931
  isAbsolute as isAbsolute4,
14359
- join as join29,
14932
+ join as join31,
14360
14933
  relative as relative12,
14361
- resolve as resolve21
14934
+ resolve as resolve22
14362
14935
  } from "path";
14363
14936
  var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
14364
14937
  var resolveDevClientDir3 = () => {
14365
14938
  const projectRoot = process.cwd();
14366
- const fromSource = resolve21(import.meta.dir, "../dev/client");
14939
+ const fromSource = resolve22(import.meta.dir, "../dev/client");
14367
14940
  if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
14368
14941
  return fromSource;
14369
14942
  }
14370
- const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
14943
+ const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
14371
14944
  if (existsSync22(fromNodeModules))
14372
14945
  return fromNodeModules;
14373
- return resolve21(import.meta.dir, "./dev/client");
14946
+ return resolve22(import.meta.dir, "./dev/client");
14374
14947
  }, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
14375
14948
  scriptCache.clear();
14376
14949
  scriptSetupCache.clear();
@@ -14420,19 +14993,19 @@ var resolveDevClientDir3 = () => {
14420
14993
  visited.add(resolved);
14421
14994
  const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
14422
14995
  return cssContent.replace(importRegex, (match, _quote, relPath) => {
14423
- const importedPath = resolve21(dirname15(cssFilePath), relPath);
14996
+ const importedPath = resolve22(dirname17(cssFilePath), relPath);
14424
14997
  if (!existsSync22(importedPath))
14425
14998
  return match;
14426
- const importedContent = readFileSync18(importedPath, "utf-8");
14999
+ const importedContent = readFileSync19(importedPath, "utf-8");
14427
15000
  return inlineCssImports(importedContent, importedPath, visited);
14428
15001
  });
14429
15002
  }, resolveHelperTsPath = (sourceDir, helper) => {
14430
15003
  if (helper.endsWith(".ts"))
14431
- return resolve21(sourceDir, helper);
14432
- const direct = resolve21(sourceDir, `${helper}.ts`);
15004
+ return resolve22(sourceDir, helper);
15005
+ const direct = resolve22(sourceDir, `${helper}.ts`);
14433
15006
  if (existsSync22(direct))
14434
15007
  return direct;
14435
- const indexed = resolve21(sourceDir, helper, "index.ts");
15008
+ const indexed = resolve22(sourceDir, helper, "index.ts");
14436
15009
  if (existsSync22(indexed))
14437
15010
  return indexed;
14438
15011
  return direct;
@@ -14443,15 +15016,15 @@ var resolveDevClientDir3 = () => {
14443
15016
  return filePath.replace(/\.ts$/, ".js");
14444
15017
  if (isStylePath(filePath)) {
14445
15018
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
14446
- return resolve21(sourceDir, filePath);
15019
+ return resolve22(sourceDir, filePath);
14447
15020
  }
14448
15021
  return filePath;
14449
15022
  }
14450
15023
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
14451
- const directTs = resolve21(sourceDir, `${filePath}.ts`);
15024
+ const directTs = resolve22(sourceDir, `${filePath}.ts`);
14452
15025
  if (existsSync22(directTs))
14453
15026
  return `${filePath}.js`;
14454
- const indexedTs = resolve21(sourceDir, filePath, "index.ts");
15027
+ const indexedTs = resolve22(sourceDir, filePath, "index.ts");
14455
15028
  if (existsSync22(indexedTs))
14456
15029
  return `${filePath}/index.js`;
14457
15030
  }
@@ -14542,19 +15115,19 @@ const ${localName} = (source) => ${importedName}(
14542
15115
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
14543
15116
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
14544
15117
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
14545
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve21(dirname15(sourceFilePath), path));
15118
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve22(dirname17(sourceFilePath), path));
14546
15119
  for (const stylePath of stylePathsImported) {
14547
15120
  addStyleImporter(sourceFilePath, stylePath);
14548
15121
  }
14549
15122
  const childBuildResults = await Promise.all([
14550
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(dirname15(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
15123
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname17(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
14551
15124
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
14552
15125
  ]);
14553
15126
  const hasScript = descriptor.script || descriptor.scriptSetup;
14554
15127
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
14555
15128
  fs: {
14556
15129
  fileExists: existsSync22,
14557
- readFile: (file3) => existsSync22(file3) ? readFileSync18(file3, "utf-8") : undefined,
15130
+ readFile: (file3) => existsSync22(file3) ? readFileSync19(file3, "utf-8") : undefined,
14558
15131
  realpath: realpathSync2
14559
15132
  },
14560
15133
  id: componentId,
@@ -14562,7 +15135,7 @@ const ${localName} = (source) => ${importedName}(
14562
15135
  sourceMap: true
14563
15136
  }) : { bindings: {}, content: "export default {};", map: undefined };
14564
15137
  const strippedScript = stripExports2(compiledScript.content);
14565
- const sourceDir = dirname15(sourceFilePath);
15138
+ const sourceDir = dirname17(sourceFilePath);
14566
15139
  const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
14567
15140
  const packageImportRewrites = new Map;
14568
15141
  for (const [bareImport, absolutePath] of packageComponentPaths) {
@@ -14607,8 +15180,8 @@ const ${localName} = (source) => ${importedName}(
14607
15180
  ];
14608
15181
  let cssOutputPaths = [];
14609
15182
  if (isEntryPoint && allCss.length) {
14610
- const cssOutputFile = join29(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
14611
- await mkdir6(dirname15(cssOutputFile), { recursive: true });
15183
+ const cssOutputFile = join31(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
15184
+ await mkdir7(dirname17(cssOutputFile), { recursive: true });
14612
15185
  await write3(cssOutputFile, allCss.join(`
14613
15186
  `));
14614
15187
  cssOutputPaths = [cssOutputFile];
@@ -14638,21 +15211,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14638
15211
  };
14639
15212
  const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
14640
15213
  const serverCode = wrapServerAsyncComponentLoader(assembleModule(generateRenderFunction(true), "ssrRender", false)) + islandMetadataExports;
14641
- const clientOutputPath = join29(outputDirs.client, `${relativeWithoutExtension}.js`);
14642
- const serverOutputPath = join29(outputDirs.server, `${relativeWithoutExtension}.js`);
15214
+ const clientOutputPath = join31(outputDirs.client, `${relativeWithoutExtension}.js`);
15215
+ const serverOutputPath = join31(outputDirs.server, `${relativeWithoutExtension}.js`);
14643
15216
  const rewritePackageImports = (code, outputPath, mode) => {
14644
15217
  let result2 = code;
14645
15218
  for (const [bareImport, paths] of packageImportRewrites) {
14646
15219
  const targetPath = mode === "server" ? paths.server : paths.client;
14647
- let rel = relative12(dirname15(outputPath), targetPath).replace(/\\/g, "/");
15220
+ let rel = relative12(dirname17(outputPath), targetPath).replace(/\\/g, "/");
14648
15221
  if (!rel.startsWith("."))
14649
15222
  rel = `./${rel}`;
14650
15223
  result2 = result2.replaceAll(bareImport, rel);
14651
15224
  }
14652
15225
  return result2;
14653
15226
  };
14654
- await mkdir6(dirname15(clientOutputPath), { recursive: true });
14655
- await mkdir6(dirname15(serverOutputPath), { recursive: true });
15227
+ await mkdir7(dirname17(clientOutputPath), { recursive: true });
15228
+ await mkdir7(dirname17(serverOutputPath), { recursive: true });
14656
15229
  const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
14657
15230
  const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
14658
15231
  const inlineSourceMapFor = (finalContent) => {
@@ -14675,7 +15248,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14675
15248
  serverPath: serverOutputPath,
14676
15249
  spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
14677
15250
  tsHelperPaths: [
14678
- ...helperModulePaths.map((helper) => resolveHelperTsPath(dirname15(sourceFilePath), helper)),
15251
+ ...helperModulePaths.map((helper) => resolveHelperTsPath(dirname17(sourceFilePath), helper)),
14679
15252
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
14680
15253
  ]
14681
15254
  };
@@ -14685,20 +15258,20 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14685
15258
  }, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
14686
15259
  const compiler = await loadVueCompiler();
14687
15260
  const generatedDir = getFrameworkGeneratedDir("vue");
14688
- const clientOutputDir = join29(generatedDir, "client");
14689
- const indexOutputDir = join29(generatedDir, "indexes");
14690
- const serverOutputDir = join29(generatedDir, "server");
14691
- const cssOutputDir = join29(generatedDir, "compiled");
15261
+ const clientOutputDir = join31(generatedDir, "client");
15262
+ const indexOutputDir = join31(generatedDir, "indexes");
15263
+ const serverOutputDir = join31(generatedDir, "server");
15264
+ const cssOutputDir = join31(generatedDir, "compiled");
14692
15265
  await Promise.all([
14693
- mkdir6(clientOutputDir, { recursive: true }),
14694
- mkdir6(indexOutputDir, { recursive: true }),
14695
- mkdir6(serverOutputDir, { recursive: true }),
14696
- mkdir6(cssOutputDir, { recursive: true })
15266
+ mkdir7(clientOutputDir, { recursive: true }),
15267
+ mkdir7(indexOutputDir, { recursive: true }),
15268
+ mkdir7(serverOutputDir, { recursive: true }),
15269
+ mkdir7(cssOutputDir, { recursive: true })
14697
15270
  ]);
14698
15271
  const buildCache = new Map;
14699
15272
  const allTsHelperPaths = new Set;
14700
15273
  const expandSpaRouteChildren = async (entries) => {
14701
- const expanded = new Set(entries.map((entry) => resolve21(entry)));
15274
+ const expanded = new Set(entries.map((entry) => resolve22(entry)));
14702
15275
  const queue2 = [...expanded];
14703
15276
  while (queue2.length > 0) {
14704
15277
  const entryPath = queue2.pop();
@@ -14715,7 +15288,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14715
15288
  });
14716
15289
  const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
14717
15290
  for (const { importPath } of routes) {
14718
- const childPath = resolve21(dirname15(entryPath), importPath);
15291
+ const childPath = resolve22(dirname17(entryPath), importPath);
14719
15292
  if (expanded.has(childPath) || !existsSync22(childPath)) {
14720
15293
  continue;
14721
15294
  }
@@ -14727,7 +15300,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14727
15300
  };
14728
15301
  const expandedEntryPoints = await expandSpaRouteChildren(entryPoints);
14729
15302
  const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
14730
- const resolvedEntryPath = resolve21(entryPath);
15303
+ const resolvedEntryPath = resolve22(entryPath);
14731
15304
  const result = await compileVueFile(resolvedEntryPath, {
14732
15305
  client: clientOutputDir,
14733
15306
  css: cssOutputDir,
@@ -14745,16 +15318,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14745
15318
  };
14746
15319
  }
14747
15320
  const entryBaseName = basename11(entryPath, ".vue");
14748
- const indexOutputFile = join29(indexOutputDir, `${entryBaseName}.js`);
14749
- const clientOutputFile = join29(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
14750
- await mkdir6(dirname15(indexOutputFile), { recursive: true });
15321
+ const indexOutputFile = join31(indexOutputDir, `${entryBaseName}.js`);
15322
+ const clientOutputFile = join31(clientOutputDir, relative12(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
15323
+ await mkdir7(dirname17(indexOutputFile), { recursive: true });
14751
15324
  const vueHmrImports = isDev2 ? [
14752
15325
  `window.__HMR_FRAMEWORK__ = "vue";`,
14753
15326
  `import "${hmrClientPath4}";`
14754
15327
  ] : [];
14755
15328
  await write3(indexOutputFile, [
14756
15329
  ...vueHmrImports,
14757
- `import Comp, * as PageModule from "${relative12(dirname15(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
15330
+ `import Comp, * as PageModule from "${relative12(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
14758
15331
  'import { createSSRApp, createApp } from "vue";',
14759
15332
  "",
14760
15333
  "// HMR State Preservation: Check for preserved state from HMR",
@@ -14801,7 +15374,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14801
15374
  "// client-side navigation after mount.",
14802
15375
  'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
14803
15376
  'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
14804
- 'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty || hasSpaRoutes);',
15377
+ 'const isClientRender = typeof window !== "undefined" && window.__ABSOLUTE_PAGE_RENDER_MODE__ === "client";',
15378
+ 'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty || hasSpaRoutes || isClientRender);',
14805
15379
  "const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
14806
15380
  "",
14807
15381
  "async function bootstrapApp() {",
@@ -14819,11 +15393,17 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14819
15393
  " }",
14820
15394
  ' app.mount("#root");',
14821
15395
  "}",
14822
- "bootstrapApp();",
15396
+ "const absolutePageReady = bootstrapApp();",
14823
15397
  "",
14824
15398
  "// Store app instance for HMR - used for manual component updates",
14825
15399
  'if (typeof window !== "undefined") {',
14826
15400
  " window.__VUE_APP__ = app;",
15401
+ " window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;",
15402
+ " window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {",
15403
+ " await absolutePageReady;",
15404
+ " app.unmount();",
15405
+ " window.__VUE_APP__ = undefined;",
15406
+ " };",
14827
15407
  "}",
14828
15408
  "",
14829
15409
  "// Post-mount: Apply preserved state to reactive refs in component tree",
@@ -14909,7 +15489,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14909
15489
  if (!tsPath)
14910
15490
  continue;
14911
15491
  const sourceCode = await file2(tsPath).text();
14912
- const helperDir = dirname15(tsPath);
15492
+ const helperDir = dirname17(tsPath);
14913
15493
  for (const dep of extractImports(sourceCode)) {
14914
15494
  if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
14915
15495
  continue;
@@ -14928,10 +15508,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14928
15508
  const transpiledCode = transpiler4.transformSync(sourceCode);
14929
15509
  const withMap = transpiledCode + inlineLineMapComment(tsPath, sourceCode, transpiledCode);
14930
15510
  const relativeJsPath = relative12(vueRootDir, tsPath).replace(/\.ts$/, ".js");
14931
- const outClientPath = join29(clientOutputDir, relativeJsPath);
14932
- const outServerPath = join29(serverOutputDir, relativeJsPath);
14933
- await mkdir6(dirname15(outClientPath), { recursive: true });
14934
- await mkdir6(dirname15(outServerPath), { recursive: true });
15511
+ const outClientPath = join31(clientOutputDir, relativeJsPath);
15512
+ const outServerPath = join31(serverOutputDir, relativeJsPath);
15513
+ await mkdir7(dirname17(outClientPath), { recursive: true });
15514
+ await mkdir7(dirname17(outServerPath), { recursive: true });
14935
15515
  await write3(outClientPath, withMap);
14936
15516
  await write3(outServerPath, withMap);
14937
15517
  }));
@@ -14961,7 +15541,7 @@ var init_compileVue = __esm(() => {
14961
15541
  init_vueAutoRouterTransform();
14962
15542
  init_stylePreprocessor();
14963
15543
  devClientDir3 = resolveDevClientDir3();
14964
- hmrClientPath4 = join29(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
15544
+ hmrClientPath4 = join31(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
14965
15545
  transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
14966
15546
  scriptCache = new Map;
14967
15547
  scriptSetupCache = new Map;
@@ -15442,8 +16022,8 @@ __export(exports_compileAngular, {
15442
16022
  compileAngularFile: () => compileAngularFile,
15443
16023
  compileAngular: () => compileAngular
15444
16024
  });
15445
- import { existsSync as existsSync23, readFileSync as readFileSync19, promises as fs5 } from "fs";
15446
- import { join as join30, basename as basename12, sep as sep3, dirname as dirname16, resolve as resolve22, relative as relative13 } from "path";
16025
+ import { existsSync as existsSync23, readFileSync as readFileSync20, promises as fs5 } from "fs";
16026
+ import { join as join32, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve23, relative as relative13 } from "path";
15447
16027
  var {Glob: Glob6 } = globalThis.Bun;
15448
16028
  import ts13 from "typescript";
15449
16029
  var traceAngularPhase = async (name, fn2, metadata) => {
@@ -15451,10 +16031,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15451
16031
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
15452
16032
  }, readTsconfigPathAliases = () => {
15453
16033
  try {
15454
- const configPath2 = resolve22(process.cwd(), "tsconfig.json");
16034
+ const configPath2 = resolve23(process.cwd(), "tsconfig.json");
15455
16035
  const config = ts13.readConfigFile(configPath2, ts13.sys.readFile).config;
15456
16036
  const compilerOptions = config?.compilerOptions ?? {};
15457
- const baseUrl = resolve22(process.cwd(), compilerOptions.baseUrl ?? ".");
16037
+ const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
15458
16038
  const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
15459
16039
  return { aliases, baseUrl };
15460
16040
  } catch {
@@ -15474,7 +16054,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15474
16054
  const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
15475
16055
  for (const replacement of alias.replacements) {
15476
16056
  const candidate = replacement.replace("*", wildcardValue);
15477
- const resolved = resolveSourceFile(resolve22(baseUrl, candidate));
16057
+ const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
15478
16058
  if (resolved)
15479
16059
  return resolved;
15480
16060
  }
@@ -15486,20 +16066,20 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15486
16066
  `${candidate}.tsx`,
15487
16067
  `${candidate}.js`,
15488
16068
  `${candidate}.jsx`,
15489
- join30(candidate, "index.ts"),
15490
- join30(candidate, "index.tsx"),
15491
- join30(candidate, "index.js"),
15492
- join30(candidate, "index.jsx")
16069
+ join32(candidate, "index.ts"),
16070
+ join32(candidate, "index.tsx"),
16071
+ join32(candidate, "index.js"),
16072
+ join32(candidate, "index.jsx")
15493
16073
  ];
15494
16074
  return candidates.find((file3) => existsSync23(file3));
15495
16075
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
15496
- const baseDir = resolve22(rootDir);
16076
+ const baseDir = resolve23(rootDir);
15497
16077
  const tsconfigAliases = readTsconfigPathAliases();
15498
16078
  const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
15499
16079
  const scanCache = new Map;
15500
16080
  const resolveLocalImport = (specifier, fromDir) => {
15501
16081
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
15502
- return resolveSourceFile(resolve22(fromDir, specifier));
16082
+ return resolveSourceFile(resolve23(fromDir, specifier));
15503
16083
  }
15504
16084
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
15505
16085
  if (aliased)
@@ -15508,7 +16088,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15508
16088
  const resolved = Bun.resolveSync(specifier, fromDir);
15509
16089
  if (resolved.includes("/node_modules/"))
15510
16090
  return;
15511
- const absolute = resolve22(resolved);
16091
+ const absolute = resolve23(resolved);
15512
16092
  if (!absolute.startsWith(baseDir))
15513
16093
  return;
15514
16094
  return resolveSourceFile(absolute);
@@ -15524,7 +16104,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15524
16104
  usesLegacyAnimations: false
15525
16105
  });
15526
16106
  }
15527
- const resolved = resolve22(actualPath);
16107
+ const resolved = resolve23(actualPath);
15528
16108
  const cached = scanCache.get(resolved);
15529
16109
  if (cached)
15530
16110
  return cached;
@@ -15553,7 +16133,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15553
16133
  const actualPath = resolveSourceFile(filePath);
15554
16134
  if (!actualPath)
15555
16135
  return false;
15556
- const resolved = resolve22(actualPath);
16136
+ const resolved = resolve23(actualPath);
15557
16137
  if (visited.has(resolved))
15558
16138
  return false;
15559
16139
  visited.add(resolved);
@@ -15561,7 +16141,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15561
16141
  if (scan.usesLegacyAnimations)
15562
16142
  return true;
15563
16143
  for (const specifier of scan.imports) {
15564
- const importedPath = resolveLocalImport(specifier, dirname16(resolved));
16144
+ const importedPath = resolveLocalImport(specifier, dirname18(resolved));
15565
16145
  if (importedPath && await visit(importedPath, visited)) {
15566
16146
  return true;
15567
16147
  }
@@ -15571,14 +16151,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15571
16151
  return (entryPath) => visit(entryPath);
15572
16152
  }, resolveDevClientDir4 = () => {
15573
16153
  const projectRoot = process.cwd();
15574
- const fromSource = resolve22(import.meta.dir, "../dev/client");
16154
+ const fromSource = resolve23(import.meta.dir, "../dev/client");
15575
16155
  if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
15576
16156
  return fromSource;
15577
16157
  }
15578
- const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
16158
+ const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
15579
16159
  if (existsSync23(fromNodeModules))
15580
16160
  return fromNodeModules;
15581
- return resolve22(import.meta.dir, "./dev/client");
16161
+ return resolve23(import.meta.dir, "./dev/client");
15582
16162
  }, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
15583
16163
  try {
15584
16164
  return ts13.flattenDiagnosticMessageText(diagnostic.messageText, `
@@ -15620,12 +16200,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15620
16200
  return `${path.replace(/\.ts$/, ".js")}${query}`;
15621
16201
  if (hasJsLikeExtension(path))
15622
16202
  return `${path}${query}`;
15623
- const importerDir = dirname16(importerOutputPath);
15624
- const fileCandidate = resolve22(importerDir, `${path}.js`);
16203
+ const importerDir = dirname18(importerOutputPath);
16204
+ const fileCandidate = resolve23(importerDir, `${path}.js`);
15625
16205
  if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
15626
16206
  return `${path}.js${query}`;
15627
16207
  }
15628
- const indexCandidate = resolve22(importerDir, path, "index.js");
16208
+ const indexCandidate = resolve23(importerDir, path, "index.js");
15629
16209
  if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
15630
16210
  return `${path}/index.js${query}`;
15631
16211
  }
@@ -15653,18 +16233,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15653
16233
  }, resolveLocalTsImport = (fromFile, specifier) => {
15654
16234
  if (!isRelativeModuleSpecifier(specifier))
15655
16235
  return null;
15656
- const basePath = resolve22(dirname16(fromFile), specifier);
16236
+ const basePath = resolve23(dirname18(fromFile), specifier);
15657
16237
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
15658
16238
  `${basePath}.ts`,
15659
16239
  `${basePath}.tsx`,
15660
16240
  `${basePath}.mts`,
15661
16241
  `${basePath}.cts`,
15662
- join30(basePath, "index.ts"),
15663
- join30(basePath, "index.tsx"),
15664
- join30(basePath, "index.mts"),
15665
- join30(basePath, "index.cts")
16242
+ join32(basePath, "index.ts"),
16243
+ join32(basePath, "index.tsx"),
16244
+ join32(basePath, "index.mts"),
16245
+ join32(basePath, "index.cts")
15666
16246
  ];
15667
- return candidates.map((candidate) => resolve22(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
16247
+ return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
15668
16248
  }, readFileForAotTransform = async (fileName, readFile6) => {
15669
16249
  const hostSource = readFile6?.(fileName);
15670
16250
  if (typeof hostSource === "string")
@@ -15688,18 +16268,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15688
16268
  const paths = [];
15689
16269
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
15690
16270
  if (templateUrlMatch?.[1])
15691
- paths.push(join30(fileDir, templateUrlMatch[1]));
16271
+ paths.push(join32(fileDir, templateUrlMatch[1]));
15692
16272
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
15693
16273
  if (styleUrlMatch?.[1])
15694
- paths.push(join30(fileDir, styleUrlMatch[1]));
16274
+ paths.push(join32(fileDir, styleUrlMatch[1]));
15695
16275
  const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
15696
16276
  const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
15697
16277
  if (urlMatches) {
15698
16278
  for (const urlMatch of urlMatches) {
15699
- paths.push(join30(fileDir, urlMatch.replace(/['"]/g, "")));
16279
+ paths.push(join32(fileDir, urlMatch.replace(/['"]/g, "")));
15700
16280
  }
15701
16281
  }
15702
- return paths.map((path) => resolve22(path));
16282
+ return paths.map((path) => resolve23(path));
15703
16283
  }, readResourceCacheFile = async (cachePath) => {
15704
16284
  try {
15705
16285
  const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
@@ -15711,13 +16291,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15711
16291
  return null;
15712
16292
  }
15713
16293
  }, writeResourceCacheFile = async (cachePath, source) => {
15714
- await fs5.mkdir(dirname16(cachePath), { recursive: true });
16294
+ await fs5.mkdir(dirname18(cachePath), { recursive: true });
15715
16295
  await fs5.writeFile(cachePath, JSON.stringify({
15716
16296
  source,
15717
16297
  version: 1
15718
16298
  }), "utf-8");
15719
16299
  }, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
15720
- const resourcePaths = collectAngularResourcePaths(source, dirname16(filePath));
16300
+ const resourcePaths = collectAngularResourcePaths(source, dirname18(filePath));
15721
16301
  const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
15722
16302
  const content = await fs5.readFile(resourcePath, "utf-8");
15723
16303
  return `${resourcePath}\x00${content}`;
@@ -15730,7 +16310,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15730
16310
  safeStableStringify(stylePreprocessors ?? null)
15731
16311
  ].join("\x00");
15732
16312
  const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
15733
- return join30(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
16313
+ return join32(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
15734
16314
  }, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
15735
16315
  const transformedSources = new Map;
15736
16316
  const visited = new Set;
@@ -15741,7 +16321,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15741
16321
  transformedFiles: 0
15742
16322
  };
15743
16323
  const transformFile = async (filePath) => {
15744
- const resolvedPath = resolve22(filePath);
16324
+ const resolvedPath = resolve23(filePath);
15745
16325
  if (visited.has(resolvedPath))
15746
16326
  return;
15747
16327
  visited.add(resolvedPath);
@@ -15757,7 +16337,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15757
16337
  transformedSource = cached.source;
15758
16338
  } else {
15759
16339
  stats.cacheMisses += 1;
15760
- const transformed = await inlineResources(source, dirname16(resolvedPath), stylePreprocessors);
16340
+ const transformed = await inlineResources(source, dirname18(resolvedPath), stylePreprocessors);
15761
16341
  transformedSource = transformed.source;
15762
16342
  await writeResourceCacheFile(cachePath, transformedSource);
15763
16343
  }
@@ -15776,18 +16356,18 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15776
16356
  return { stats, transformedSources };
15777
16357
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
15778
16358
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
15779
- const outputPath = resolve22(join30(outDir, relative13(process.cwd(), resolve22(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
16359
+ const outputPath = resolve23(join32(outDir, relative13(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
15780
16360
  return [
15781
16361
  outputPath,
15782
- buildIslandMetadataExports(readFileSync19(inputPath, "utf-8"))
16362
+ buildIslandMetadataExports(readFileSync20(inputPath, "utf-8"))
15783
16363
  ];
15784
16364
  })), { entries: inputPaths.length });
15785
16365
  await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
15786
16366
  const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
15787
16367
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
15788
16368
  const tsPath = __require.resolve("typescript");
15789
- const tsRootDir = dirname16(tsPath);
15790
- return tsRootDir.endsWith("lib") ? tsRootDir : resolve22(tsRootDir, "lib");
16369
+ const tsRootDir = dirname18(tsPath);
16370
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
15791
16371
  });
15792
16372
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
15793
16373
  const options = {
@@ -15812,30 +16392,30 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15812
16392
  options.incremental = false;
15813
16393
  options.tsBuildInfoFile = undefined;
15814
16394
  options.rootDir = process.cwd();
15815
- const host = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
15816
- const originalGetDefaultLibLocation = host.getDefaultLibLocation;
15817
- host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
15818
- const originalGetDefaultLibFileName = host.getDefaultLibFileName;
15819
- host.getDefaultLibFileName = (opts) => {
16395
+ const host2 = await traceAngularPhase("aot/create-compiler-host", () => ts13.createCompilerHost(options));
16396
+ const originalGetDefaultLibLocation = host2.getDefaultLibLocation;
16397
+ host2.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
16398
+ const originalGetDefaultLibFileName = host2.getDefaultLibFileName;
16399
+ host2.getDefaultLibFileName = (opts) => {
15820
16400
  const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
15821
16401
  return basename12(fileName);
15822
16402
  };
15823
- const originalGetSourceFile = host.getSourceFile;
15824
- host.getSourceFile = (fileName, languageVersion, onError) => {
16403
+ const originalGetSourceFile = host2.getSourceFile;
16404
+ host2.getSourceFile = (fileName, languageVersion, onError) => {
15825
16405
  if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
15826
- const resolvedPath = join30(tsLibDir, fileName);
15827
- return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
16406
+ const resolvedPath = join32(tsLibDir, fileName);
16407
+ return originalGetSourceFile?.call(host2, resolvedPath, languageVersion, onError);
15828
16408
  }
15829
- return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
16409
+ return originalGetSourceFile?.call(host2, fileName, languageVersion, onError);
15830
16410
  };
15831
16411
  const emitted = {};
15832
- const resolvedOutDir = resolve22(outDir);
15833
- host.writeFile = (fileName, text) => {
16412
+ const resolvedOutDir = resolve23(outDir);
16413
+ host2.writeFile = (fileName, text) => {
15834
16414
  const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
15835
16415
  emitted[relativePath] = text;
15836
16416
  };
15837
- const originalReadFile = host.readFile;
15838
- const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors), { entries: inputPaths.length });
16417
+ const originalReadFile = host2.readFile;
16418
+ const { stats: aotResourceTransformStats, transformedSources } = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host2), stylePreprocessors), { entries: inputPaths.length });
15839
16419
  await traceAngularPhase("aot/resource-cache-summary", () => {
15840
16420
  return;
15841
16421
  }, {
@@ -15844,43 +16424,43 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15844
16424
  filesVisited: aotResourceTransformStats.filesVisited,
15845
16425
  transformedFiles: aotResourceTransformStats.transformedFiles
15846
16426
  });
15847
- host.readFile = (fileName) => {
15848
- const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
16427
+ host2.readFile = (fileName) => {
16428
+ const source = originalReadFile ? originalReadFile.call(host2, fileName) : undefined;
15849
16429
  if (typeof source !== "string")
15850
16430
  return source;
15851
16431
  if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
15852
16432
  return source;
15853
16433
  }
15854
- const resolvedPath = resolve22(fileName);
16434
+ const resolvedPath = resolve23(fileName);
15855
16435
  return transformedSources.get(resolvedPath) ?? source;
15856
16436
  };
15857
- const originalGetSourceFileForCompile = host.getSourceFile;
15858
- host.getSourceFile = (fileName, languageVersion, onError) => {
15859
- const source = transformedSources.get(resolve22(fileName));
16437
+ const originalGetSourceFileForCompile = host2.getSourceFile;
16438
+ host2.getSourceFile = (fileName, languageVersion, onError) => {
16439
+ const source = transformedSources.get(resolve23(fileName));
15860
16440
  if (source) {
15861
16441
  return ts13.createSourceFile(fileName, source, languageVersion, true);
15862
16442
  }
15863
- return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
16443
+ return originalGetSourceFileForCompile?.call(host2, fileName, languageVersion, onError);
15864
16444
  };
15865
16445
  let diagnostics;
15866
16446
  try {
15867
16447
  ({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
15868
16448
  emitFlags: EmitFlags.Default,
15869
- host,
16449
+ host: host2,
15870
16450
  options,
15871
16451
  rootNames: inputPaths
15872
16452
  }), { entries: inputPaths.length }));
15873
16453
  } finally {
15874
- host.readFile = originalReadFile;
15875
- host.getSourceFile = originalGetSourceFileForCompile;
16454
+ host2.readFile = originalReadFile;
16455
+ host2.getSourceFile = originalGetSourceFileForCompile;
15876
16456
  }
15877
16457
  await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
15878
16458
  const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
15879
16459
  const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
15880
16460
  content,
15881
- target: join30(outDir, fileName)
16461
+ target: join32(outDir, fileName)
15882
16462
  }));
15883
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve22(target)));
16463
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
15884
16464
  return rawEntries.map(({ content, target }) => {
15885
16465
  let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
15886
16466
  const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
@@ -15895,17 +16475,17 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15895
16475
  return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
15896
16476
  });
15897
16477
  processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
15898
- processedContent += islandMetadataByOutputPath.get(resolve22(target)) ?? "";
16478
+ processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
15899
16479
  return { content: processedContent, target };
15900
16480
  });
15901
16481
  });
15902
16482
  await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
15903
- await fs5.mkdir(dirname16(target), { recursive: true });
16483
+ await fs5.mkdir(dirname18(target), { recursive: true });
15904
16484
  await fs5.writeFile(target, content, "utf-8");
15905
16485
  })), { outputs: entries.length });
15906
16486
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
15907
16487
  }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
15908
- jitContentCache.delete(resolve22(filePath));
16488
+ jitContentCache.delete(resolve23(filePath));
15909
16489
  }, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
15910
16490
  const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
15911
16491
  let match;
@@ -15918,7 +16498,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15918
16498
  }
15919
16499
  return null;
15920
16500
  }, resolveAngularDeferImportSpecifier = () => {
15921
- const sourceEntry = resolve22(import.meta.dir, "../angular/components/index.ts");
16501
+ const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
15922
16502
  if (existsSync23(sourceEntry)) {
15923
16503
  return sourceEntry.replace(/\\/g, "/");
15924
16504
  }
@@ -16055,7 +16635,7 @@ ${fields}
16055
16635
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
16056
16636
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
16057
16637
  if (templateUrlMatch?.[1]) {
16058
- const templatePath = join30(fileDir, templateUrlMatch[1]);
16638
+ const templatePath = join32(fileDir, templateUrlMatch[1]);
16059
16639
  if (!existsSync23(templatePath)) {
16060
16640
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
16061
16641
  }
@@ -16086,11 +16666,11 @@ ${fields}
16086
16666
  }, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
16087
16667
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
16088
16668
  if (templateUrlMatch?.[1]) {
16089
- const templatePath = join30(fileDir, templateUrlMatch[1]);
16669
+ const templatePath = join32(fileDir, templateUrlMatch[1]);
16090
16670
  if (!existsSync23(templatePath)) {
16091
16671
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
16092
16672
  }
16093
- const templateRaw2 = readFileSync19(templatePath, "utf-8");
16673
+ const templateRaw2 = readFileSync20(templatePath, "utf-8");
16094
16674
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
16095
16675
  const escaped2 = escapeTemplateContent(lowered2.template);
16096
16676
  const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
@@ -16123,7 +16703,7 @@ ${fields}
16123
16703
  return source;
16124
16704
  const stylePromises = urlMatches.map((urlMatch) => {
16125
16705
  const styleUrl = urlMatch.replace(/['"]/g, "");
16126
- return readAndEscapeFile(join30(fileDir, styleUrl), stylePreprocessors);
16706
+ return readAndEscapeFile(join32(fileDir, styleUrl), stylePreprocessors);
16127
16707
  });
16128
16708
  const results = await Promise.all(stylePromises);
16129
16709
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
@@ -16134,7 +16714,7 @@ ${fields}
16134
16714
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
16135
16715
  if (!styleUrlMatch?.[1])
16136
16716
  return source;
16137
- const escaped = await readAndEscapeFile(join30(fileDir, styleUrlMatch[1]), stylePreprocessors);
16717
+ const escaped = await readAndEscapeFile(join32(fileDir, styleUrlMatch[1]), stylePreprocessors);
16138
16718
  if (!escaped)
16139
16719
  return source;
16140
16720
  return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
@@ -16208,10 +16788,10 @@ ${fields}
16208
16788
  return "";
16209
16789
  }
16210
16790
  }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
16211
- const entryPath = resolve22(inputPath);
16791
+ const entryPath = resolve23(inputPath);
16212
16792
  const allOutputs = [];
16213
16793
  const visited = new Set;
16214
- const baseDir = resolve22(rootDir ?? process.cwd());
16794
+ const baseDir = resolve23(rootDir ?? process.cwd());
16215
16795
  let usesLegacyAnimations = false;
16216
16796
  const angularTranspiler = new Bun.Transpiler({
16217
16797
  loader: "ts",
@@ -16230,16 +16810,16 @@ ${fields}
16230
16810
  `${candidate}.js`,
16231
16811
  `${candidate}.jsx`,
16232
16812
  `${candidate}.json`,
16233
- join30(candidate, "index.ts"),
16234
- join30(candidate, "index.tsx"),
16235
- join30(candidate, "index.js"),
16236
- join30(candidate, "index.jsx")
16813
+ join32(candidate, "index.ts"),
16814
+ join32(candidate, "index.tsx"),
16815
+ join32(candidate, "index.js"),
16816
+ join32(candidate, "index.jsx")
16237
16817
  ];
16238
16818
  return candidates.find((file3) => existsSync23(file3));
16239
16819
  };
16240
16820
  const resolveLocalImport = (specifier, fromDir) => {
16241
16821
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
16242
- return resolveSourceFile2(resolve22(fromDir, specifier));
16822
+ return resolveSourceFile2(resolve23(fromDir, specifier));
16243
16823
  }
16244
16824
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
16245
16825
  if (aliased)
@@ -16248,7 +16828,7 @@ ${fields}
16248
16828
  const resolved = Bun.resolveSync(specifier, fromDir);
16249
16829
  if (resolved.includes("/node_modules/"))
16250
16830
  return;
16251
- const absolute = resolve22(resolved);
16831
+ const absolute = resolve23(resolved);
16252
16832
  if (!absolute.startsWith(baseDir))
16253
16833
  return;
16254
16834
  return resolveSourceFile2(absolute);
@@ -16257,13 +16837,13 @@ ${fields}
16257
16837
  }
16258
16838
  };
16259
16839
  const toOutputPath = (sourcePath) => {
16260
- const inputDir = dirname16(sourcePath);
16840
+ const inputDir = dirname18(sourcePath);
16261
16841
  const fileBase = basename12(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
16262
16842
  if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
16263
- return join30(inputDir, fileBase);
16843
+ return join32(inputDir, fileBase);
16264
16844
  }
16265
16845
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
16266
- return join30(outDir, relativeDir, fileBase);
16846
+ return join32(outDir, relativeDir, fileBase);
16267
16847
  };
16268
16848
  const withCacheBuster = (specifier) => {
16269
16849
  if (!cacheBuster)
@@ -16300,21 +16880,21 @@ ${fields}
16300
16880
  return `${prefix}${dots}`;
16301
16881
  return `${prefix}../${dots}`;
16302
16882
  });
16303
- if (resolve22(actualPath) === entryPath) {
16883
+ if (resolve23(actualPath) === entryPath) {
16304
16884
  processedContent += buildIslandMetadataExports(sourceCode);
16305
16885
  }
16306
16886
  return processedContent;
16307
16887
  };
16308
16888
  const transpileFile = async (filePath) => {
16309
- const resolved = resolve22(filePath);
16889
+ const resolved = resolve23(filePath);
16310
16890
  if (visited.has(resolved))
16311
16891
  return;
16312
16892
  visited.add(resolved);
16313
16893
  if (resolved.endsWith(".json") && existsSync23(resolved)) {
16314
- const inputDir2 = dirname16(resolved);
16894
+ const inputDir2 = dirname18(resolved);
16315
16895
  const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
16316
- const targetDir2 = join30(outDir, relativeDir2);
16317
- const targetPath2 = join30(targetDir2, basename12(resolved));
16896
+ const targetDir2 = join32(outDir, relativeDir2);
16897
+ const targetPath2 = join32(targetDir2, basename12(resolved));
16318
16898
  await fs5.mkdir(targetDir2, { recursive: true });
16319
16899
  await fs5.copyFile(resolved, targetPath2);
16320
16900
  allOutputs.push(targetPath2);
@@ -16326,12 +16906,12 @@ ${fields}
16326
16906
  if (!existsSync23(actualPath))
16327
16907
  return;
16328
16908
  let sourceCode = await fs5.readFile(actualPath, "utf-8");
16329
- const inlined = await inlineResources(sourceCode, dirname16(actualPath), stylePreprocessors);
16330
- sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname16(actualPath)).source;
16331
- const inputDir = dirname16(actualPath);
16909
+ const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
16910
+ sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname18(actualPath)).source;
16911
+ const inputDir = dirname18(actualPath);
16332
16912
  const fileBase = basename12(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
16333
16913
  const targetPath = toOutputPath(actualPath);
16334
- const targetDir = dirname16(targetPath);
16914
+ const targetDir = dirname18(targetPath);
16335
16915
  const relativeDir = relative13(outDir, targetDir).replace(/\\/g, "/");
16336
16916
  const localImports = [];
16337
16917
  const importRewrites = new Map;
@@ -16358,7 +16938,7 @@ ${fields}
16358
16938
  importRewrites.set(specifier, relativeRewrite);
16359
16939
  return resolved2;
16360
16940
  }).filter((path) => Boolean(path));
16361
- const isEntry = resolve22(actualPath) === resolve22(entryPath);
16941
+ const isEntry = resolve23(actualPath) === resolve23(entryPath);
16362
16942
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
16363
16943
  const cacheKey2 = actualPath;
16364
16944
  const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
@@ -16393,13 +16973,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16393
16973
  return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
16394
16974
  }
16395
16975
  const compiledRoot = compiledParent;
16396
- const indexesDir = join30(compiledParent, "indexes");
16976
+ const indexesDir = join32(compiledParent, "indexes");
16397
16977
  await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
16398
- const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve22(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
16978
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
16399
16979
  if (!hmr) {
16400
16980
  await traceAngularPhase("aot/copy-json-resources", async () => {
16401
16981
  const cwd = process.cwd();
16402
- const angularSrcDir = resolve22(outRoot);
16982
+ const angularSrcDir = resolve23(outRoot);
16403
16983
  if (!existsSync23(angularSrcDir))
16404
16984
  return;
16405
16985
  const jsonGlob = new Glob6("**/*.json");
@@ -16407,17 +16987,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16407
16987
  absolute: false,
16408
16988
  cwd: angularSrcDir
16409
16989
  })) {
16410
- const sourcePath = join30(angularSrcDir, rel);
16990
+ const sourcePath = join32(angularSrcDir, rel);
16411
16991
  const cwdRel = relative13(cwd, sourcePath);
16412
- const targetPath = join30(compiledRoot, cwdRel);
16413
- await fs5.mkdir(dirname16(targetPath), { recursive: true });
16992
+ const targetPath = join32(compiledRoot, cwdRel);
16993
+ await fs5.mkdir(dirname18(targetPath), { recursive: true });
16414
16994
  await fs5.copyFile(sourcePath, targetPath);
16415
16995
  }
16416
16996
  });
16417
16997
  }
16418
16998
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
16419
16999
  const compileTasks = entryPoints.map(async (entry) => {
16420
- const resolvedEntry = resolve22(entry);
17000
+ const resolvedEntry = resolve23(entry);
16421
17001
  const relativeEntry = relative13(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
16422
17002
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
16423
17003
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
@@ -16426,13 +17006,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16426
17006
  const fileBase = basename12(resolvedEntry).replace(/\.[tj]s$/, "");
16427
17007
  const jsName = `${fileBase}.js`;
16428
17008
  const compiledFallbackPaths = [
16429
- join30(compiledRoot, relativeEntry),
16430
- join30(compiledRoot, "pages", jsName),
16431
- join30(compiledRoot, jsName)
16432
- ].map((file3) => resolve22(file3));
17009
+ join32(compiledRoot, relativeEntry),
17010
+ join32(compiledRoot, "pages", jsName),
17011
+ join32(compiledRoot, jsName)
17012
+ ].map((file3) => resolve23(file3));
16433
17013
  const resolveRawServerFile = (candidatePaths) => {
16434
17014
  const normalizedCandidates = [
16435
- ...candidatePaths.map((file3) => resolve22(file3)),
17015
+ ...candidatePaths.map((file3) => resolve23(file3)),
16436
17016
  ...compiledFallbackPaths
16437
17017
  ];
16438
17018
  let candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
@@ -16479,7 +17059,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16479
17059
  let providersSourceContent = "";
16480
17060
  if (providersInjection.appProvidersSource) {
16481
17061
  try {
16482
- providersSourceContent = readFileSync19(providersInjection.appProvidersSource, "utf-8");
17062
+ providersSourceContent = readFileSync20(providersInjection.appProvidersSource, "utf-8");
16483
17063
  } catch {}
16484
17064
  }
16485
17065
  return JSON.stringify({
@@ -16490,7 +17070,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16490
17070
  })() : "no-providers";
16491
17071
  const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
16492
17072
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
16493
- const clientFile = join30(indexesDir, jsName);
17073
+ const clientFile = join32(indexesDir, jsName);
16494
17074
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
16495
17075
  return {
16496
17076
  clientPath: clientFile,
@@ -16522,13 +17102,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16522
17102
  const fragments = [];
16523
17103
  if (providersInjection.appProvidersSource) {
16524
17104
  const compiledAppProvidersPath = (() => {
16525
- const angularDirAbs = resolve22(outRoot);
16526
- const appSourceAbs = resolve22(providersInjection.appProvidersSource);
17105
+ const angularDirAbs = resolve23(outRoot);
17106
+ const appSourceAbs = resolve23(providersInjection.appProvidersSource);
16527
17107
  const rel = relative13(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
16528
- return join30(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
17108
+ return join32(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
16529
17109
  })();
16530
17110
  const appProvidersSpec = (() => {
16531
- const rel = relative13(dirname16(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
17111
+ const rel = relative13(dirname18(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
16532
17112
  return rel.startsWith(".") ? rel : `./${rel}`;
16533
17113
  })();
16534
17114
  importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
@@ -16576,6 +17156,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
16576
17156
  var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
16577
17157
  var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
16578
17158
  var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
17159
+ var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
16579
17160
  var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
16580
17161
  // Page-level providers are injected directly into the page module's
16581
17162
  // server output by \`compileAngular\`'s providers-injection step
@@ -16626,13 +17207,14 @@ if (!document.querySelector(_sel)) {
16626
17207
  }
16627
17208
 
16628
17209
  var providers = [provideZonelessChangeDetection()];
16629
- if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
17210
+ if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
16630
17211
  providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
16631
17212
  }
16632
17213
  delete window.__HMR_SKIP_HYDRATION__;
16633
17214
  providers.push.apply(providers, pageProviders);
16634
17215
  providers.push.apply(providers, contextProviders);
16635
17216
  window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
17217
+ var absolutePageReady = Promise.resolve();
16636
17218
 
16637
17219
  if (pageHasRawStreamingSlots) {
16638
17220
  window.__ABS_SLOT_HYDRATION_PENDING__ = false;
@@ -16642,7 +17224,7 @@ if (pageHasRawStreamingSlots) {
16642
17224
  });
16643
17225
  }
16644
17226
  } else {
16645
- bootstrapApplication(${componentClassName}, {
17227
+ absolutePageReady = bootstrapApplication(${componentClassName}, {
16646
17228
  providers: providers
16647
17229
  }).then(function (appRef) {
16648
17230
  window.__ANGULAR_APP__ = appRef;
@@ -16652,8 +17234,17 @@ if (pageHasRawStreamingSlots) {
16652
17234
  window.__ABS_SLOT_FLUSH__();
16653
17235
  });
16654
17236
  }
17237
+ return appRef;
16655
17238
  });
16656
17239
  }
17240
+ window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
17241
+ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
17242
+ await absolutePageReady;
17243
+ if (window.__ANGULAR_APP__) {
17244
+ window.__ANGULAR_APP__.destroy();
17245
+ window.__ANGULAR_APP__ = null;
17246
+ }
17247
+ };
16657
17248
  `.trim() : `
16658
17249
  import '@angular/compiler';
16659
17250
  import { bootstrapApplication } from '@angular/platform-browser';
@@ -16672,6 +17263,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
16672
17263
  var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
16673
17264
  var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
16674
17265
  var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
17266
+ var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
16675
17267
  var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
16676
17268
  // Page-level providers are injected directly into the page module's
16677
17269
  // server output by \`compileAngular\`'s providers-injection step
@@ -16691,11 +17283,21 @@ var absoluteHttpTransferCacheOptions = {
16691
17283
 
16692
17284
  enableProdMode();
16693
17285
 
17286
+ // Production mobile/client-only activation starts from AbsoluteJS's empty
17287
+ // #root shell rather than server-rendered Angular markup. Create the page's
17288
+ // actual Angular host from its compiled selector so application authors do
17289
+ // not need framework-specific mobile configuration.
17290
+ var _sel = ${componentClassName}.\u0275cmp?.selectors?.[0]?.[0] || 'ng-app';
17291
+ if (!document.querySelector(_sel)) {
17292
+ (document.getElementById('root') || document.body).appendChild(document.createElement(_sel));
17293
+ }
17294
+
16694
17295
  var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
16695
- if (!pageHasIslands) {
17296
+ if (!isClientRender && !pageHasIslands) {
16696
17297
  providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
16697
17298
  }
16698
17299
  window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
17300
+ var absolutePageReady = Promise.resolve();
16699
17301
 
16700
17302
  if (pageHasRawStreamingSlots) {
16701
17303
  window.__ABS_SLOT_HYDRATION_PENDING__ = false;
@@ -16705,7 +17307,7 @@ if (pageHasRawStreamingSlots) {
16705
17307
  });
16706
17308
  }
16707
17309
  } else {
16708
- bootstrapApplication(${componentClassName}, {
17310
+ absolutePageReady = bootstrapApplication(${componentClassName}, {
16709
17311
  providers: providers
16710
17312
  }).then(function (appRef) {
16711
17313
  window.__ANGULAR_APP__ = appRef;
@@ -16715,8 +17317,17 @@ if (pageHasRawStreamingSlots) {
16715
17317
  window.__ABS_SLOT_FLUSH__();
16716
17318
  });
16717
17319
  }
17320
+ return appRef;
16718
17321
  });
16719
17322
  }
17323
+ window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
17324
+ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
17325
+ await absolutePageReady;
17326
+ if (window.__ANGULAR_APP__) {
17327
+ window.__ANGULAR_APP__.destroy();
17328
+ window.__ANGULAR_APP__ = null;
17329
+ }
17330
+ };
16720
17331
  `.trim();
16721
17332
  const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
16722
17333
  const indexUnchanged = cachedWrapper?.indexHash === indexHash;
@@ -16749,7 +17360,7 @@ var init_compileAngular = __esm(() => {
16749
17360
  init_stylePreprocessor();
16750
17361
  init_generatedDir();
16751
17362
  devClientDir4 = resolveDevClientDir4();
16752
- hmrClientPath5 = join30(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
17363
+ hmrClientPath5 = join32(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
16753
17364
  jitContentCache = new Map;
16754
17365
  wrapperOutputCache = new Map;
16755
17366
  PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
@@ -17473,8 +18084,8 @@ __export(exports_fastHmrCompiler, {
17473
18084
  primeComponentFingerprint: () => primeComponentFingerprint,
17474
18085
  invalidateFingerprintCache: () => invalidateFingerprintCache
17475
18086
  });
17476
- import { existsSync as existsSync24, readFileSync as readFileSync20, statSync as statSync2 } from "fs";
17477
- import { dirname as dirname17, extname as extname8, relative as relative14, resolve as resolve23 } from "path";
18087
+ import { existsSync as existsSync24, readFileSync as readFileSync21, statSync as statSync2 } from "fs";
18088
+ import { dirname as dirname19, extname as extname8, relative as relative14, resolve as resolve24 } from "path";
17478
18089
  import ts17 from "typescript";
17479
18090
  var fail = (reason, detail, location) => ({
17480
18091
  detail,
@@ -17604,7 +18215,7 @@ var fail = (reason, detail, location) => ({
17604
18215
  continue;
17605
18216
  const decoratorMeta = readDecoratorMeta(args);
17606
18217
  const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
17607
- const componentDir = dirname17(componentFilePath);
18218
+ const componentDir = dirname19(componentFilePath);
17608
18219
  const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
17609
18220
  fingerprintCache.set(id, fingerprint);
17610
18221
  } else {
@@ -17789,7 +18400,7 @@ var fail = (reason, detail, location) => ({
17789
18400
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
17790
18401
  return true;
17791
18402
  }
17792
- const base = resolve23(componentDir, spec);
18403
+ const base = resolve24(componentDir, spec);
17793
18404
  const candidates = [
17794
18405
  `${base}.ts`,
17795
18406
  `${base}.tsx`,
@@ -17801,7 +18412,7 @@ var fail = (reason, detail, location) => ({
17801
18412
  continue;
17802
18413
  let content;
17803
18414
  try {
17804
- content = readFileSync20(candidate, "utf-8");
18415
+ content = readFileSync21(candidate, "utf-8");
17805
18416
  } catch {
17806
18417
  continue;
17807
18418
  }
@@ -18087,7 +18698,7 @@ var fail = (reason, detail, location) => ({
18087
18698
  listeners: {},
18088
18699
  properties: {},
18089
18700
  specialAttributes: {}
18090
- }), parseHostObjectInto = (host, args, hostExprNode, compiler) => {
18701
+ }), parseHostObjectInto = (host2, args, hostExprNode, compiler) => {
18091
18702
  const hostNode = getProperty(args, "host");
18092
18703
  if (!hostNode || !ts17.isObjectLiteralExpression(hostNode)) {
18093
18704
  if (!hostExprNode)
@@ -18111,14 +18722,14 @@ var fail = (reason, detail, location) => ({
18111
18722
  const propMatch = ATTR_BINDING_RE.exec(key);
18112
18723
  const evtMatch = EVENT_BINDING_RE.exec(key);
18113
18724
  if (propMatch) {
18114
- host.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
18725
+ host2.properties[propMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
18115
18726
  } else if (evtMatch) {
18116
- host.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
18727
+ host2.listeners[evtMatch[1] ?? ""] = prop.initializer.getText().replace(/^['"]|['"]$/g, "");
18117
18728
  } else {
18118
- host.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
18729
+ host2.attributes[key] = new compiler.WrappedNodeExpr(prop.initializer);
18119
18730
  }
18120
18731
  }
18121
- }, mergeMemberHostDecorators = (host, cls) => {
18732
+ }, mergeMemberHostDecorators = (host2, cls) => {
18122
18733
  for (const member of cls.members) {
18123
18734
  if (!ts17.canHaveDecorators(member))
18124
18735
  continue;
@@ -18138,7 +18749,7 @@ var fail = (reason, detail, location) => ({
18138
18749
  const propertyName2 = member.name.text;
18139
18750
  const [target] = expr.arguments;
18140
18751
  const key = target && ts17.isStringLiteral(target) ? target.text : propertyName2;
18141
- host.properties[key] = propertyName2;
18752
+ host2.properties[key] = propertyName2;
18142
18753
  } else if (functionNode.text === "HostListener") {
18143
18754
  if (!ts17.isMethodDeclaration(member))
18144
18755
  continue;
@@ -18156,7 +18767,7 @@ var fail = (reason, detail, location) => ({
18156
18767
  argsList.push(element.text);
18157
18768
  }
18158
18769
  }
18159
- host.listeners[event] = `${methodName}(${argsList.join(", ")})`;
18770
+ host2.listeners[event] = `${methodName}(${argsList.join(", ")})`;
18160
18771
  }
18161
18772
  }
18162
18773
  }
@@ -18347,9 +18958,9 @@ var fail = (reason, detail, location) => ({
18347
18958
  }
18348
18959
  return out.length > 0 ? out : null;
18349
18960
  }, extractAdvancedMetadata = (cls, decoratorArgs, compiler) => {
18350
- const host = emptyHost();
18351
- parseHostObjectInto(host, decoratorArgs, null, compiler);
18352
- mergeMemberHostDecorators(host, cls);
18961
+ const host2 = emptyHost();
18962
+ parseHostObjectInto(host2, decoratorArgs, null, compiler);
18963
+ mergeMemberHostDecorators(host2, cls);
18353
18964
  const decoratorQueries = extractDecoratorQueries(cls, compiler);
18354
18965
  const signalQueries = extractSignalQueries(cls, compiler);
18355
18966
  const contentQueries = [
@@ -18370,7 +18981,7 @@ var fail = (reason, detail, location) => ({
18370
18981
  animations,
18371
18982
  contentQueries,
18372
18983
  exportAs: extractExportAs(decoratorArgs),
18373
- host,
18984
+ host: host2,
18374
18985
  hostDirectives: extractHostDirectives(decoratorArgs, compiler),
18375
18986
  providers,
18376
18987
  viewProviders,
@@ -18389,7 +19000,7 @@ var fail = (reason, detail, location) => ({
18389
19000
  return cached.info;
18390
19001
  let source;
18391
19002
  try {
18392
- source = readFileSync20(filePath, "utf-8");
19003
+ source = readFileSync21(filePath, "utf-8");
18393
19004
  } catch {
18394
19005
  childComponentInfoCache.set(cacheKey2, {
18395
19006
  info: null,
@@ -18443,7 +19054,7 @@ var fail = (reason, detail, location) => ({
18443
19054
  return cached.info;
18444
19055
  let content;
18445
19056
  try {
18446
- content = readFileSync20(dtsPath, "utf-8");
19057
+ content = readFileSync21(dtsPath, "utf-8");
18447
19058
  } catch {
18448
19059
  childComponentInfoCache.set(cacheKey2, {
18449
19060
  info: null,
@@ -18566,7 +19177,7 @@ var fail = (reason, detail, location) => ({
18566
19177
  return null;
18567
19178
  let content;
18568
19179
  try {
18569
- content = readFileSync20(startDtsPath, "utf-8");
19180
+ content = readFileSync21(startDtsPath, "utf-8");
18570
19181
  } catch {
18571
19182
  return null;
18572
19183
  }
@@ -18585,7 +19196,7 @@ var fail = (reason, detail, location) => ({
18585
19196
  });
18586
19197
  if (!names.includes(className))
18587
19198
  continue;
18588
- const nextDts = resolveDtsFromSpec(fromPath, dirname17(startDtsPath));
19199
+ const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
18589
19200
  if (!nextDts)
18590
19201
  continue;
18591
19202
  const found = findDtsContainingClass(nextDts, className, visited);
@@ -18595,7 +19206,7 @@ var fail = (reason, detail, location) => ({
18595
19206
  const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
18596
19207
  while ((item = starReExportRe.exec(content)) !== null) {
18597
19208
  const fromPath = item[1] || "";
18598
- const nextDts = resolveDtsFromSpec(fromPath, dirname17(startDtsPath));
19209
+ const nextDts = resolveDtsFromSpec(fromPath, dirname19(startDtsPath));
18599
19210
  if (!nextDts)
18600
19211
  continue;
18601
19212
  const found = findDtsContainingClass(nextDts, className, visited);
@@ -18605,7 +19216,7 @@ var fail = (reason, detail, location) => ({
18605
19216
  return null;
18606
19217
  }, resolveDtsFromSpec = (spec, fromDir) => {
18607
19218
  const stripped = spec.replace(/\.[mc]?js$/, "");
18608
- const base = resolve23(fromDir, stripped);
19219
+ const base = resolve24(fromDir, stripped);
18609
19220
  const candidates = [
18610
19221
  `${base}.d.ts`,
18611
19222
  `${base}.d.mts`,
@@ -18629,7 +19240,7 @@ var fail = (reason, detail, location) => ({
18629
19240
  return null;
18630
19241
  }, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
18631
19242
  if (spec.startsWith(".") || spec.startsWith("/")) {
18632
- const base = resolve23(componentDir, spec);
19243
+ const base = resolve24(componentDir, spec);
18633
19244
  const candidates = [
18634
19245
  `${base}.ts`,
18635
19246
  `${base}.tsx`,
@@ -18784,7 +19395,7 @@ var fail = (reason, detail, location) => ({
18784
19395
  return cached.hasProviders;
18785
19396
  let source;
18786
19397
  try {
18787
- source = readFileSync20(filePath, "utf8");
19398
+ source = readFileSync21(filePath, "utf8");
18788
19399
  } catch {
18789
19400
  return true;
18790
19401
  }
@@ -18848,13 +19459,13 @@ var fail = (reason, detail, location) => ({
18848
19459
  }
18849
19460
  if (!matches)
18850
19461
  continue;
18851
- const resolved = resolve23(componentDir, spec);
19462
+ const resolved = resolve24(componentDir, spec);
18852
19463
  for (const ext of TS_EXTENSIONS) {
18853
19464
  const candidate = resolved + ext;
18854
19465
  if (existsSync24(candidate))
18855
19466
  return candidate;
18856
19467
  }
18857
- const indexCandidate = resolve23(resolved, "index.ts");
19468
+ const indexCandidate = resolve24(resolved, "index.ts");
18858
19469
  if (existsSync24(indexCandidate))
18859
19470
  return indexCandidate;
18860
19471
  }
@@ -19092,12 +19703,12 @@ ${transpiled}
19092
19703
  }
19093
19704
  }${staticPatch}`;
19094
19705
  }, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
19095
- const abs = resolve23(componentDir, url);
19706
+ const abs = resolve24(componentDir, url);
19096
19707
  if (!existsSync24(abs))
19097
19708
  return null;
19098
19709
  const ext = extname8(abs).toLowerCase();
19099
19710
  if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
19100
- return readFileSync20(abs, "utf8");
19711
+ return readFileSync21(abs, "utf8");
19101
19712
  }
19102
19713
  try {
19103
19714
  return compileStyleFileIfNeededSync(abs);
@@ -19131,11 +19742,11 @@ ${block}
19131
19742
  const cached = projectOptionsCache.get(projectRoot);
19132
19743
  if (cached !== undefined)
19133
19744
  return cached;
19134
- const tsconfigPath = resolve23(projectRoot, "tsconfig.json");
19745
+ const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
19135
19746
  const opts = {};
19136
19747
  if (existsSync24(tsconfigPath)) {
19137
19748
  try {
19138
- const text = readFileSync20(tsconfigPath, "utf8");
19749
+ const text = readFileSync21(tsconfigPath, "utf8");
19139
19750
  const parsed = ts17.parseConfigFileTextToJson(tsconfigPath, text);
19140
19751
  if (!parsed.error && parsed.config) {
19141
19752
  const cfg = parsed.config;
@@ -19169,7 +19780,7 @@ ${block}
19169
19780
  } catch (err) {
19170
19781
  return fail("unexpected-error", `import @angular/compiler: ${err}`);
19171
19782
  }
19172
- const tsSource = readFileSync20(componentFilePath, "utf8");
19783
+ const tsSource = readFileSync21(componentFilePath, "utf8");
19173
19784
  const sourceFile = ts17.createSourceFile(componentFilePath, tsSource, ts17.ScriptTarget.ES2022, true, ts17.ScriptKind.TS);
19174
19785
  const classNode = findClassDeclaration(sourceFile, className);
19175
19786
  if (!classNode) {
@@ -19196,7 +19807,7 @@ ${block}
19196
19807
  rebootstrapRequired: false
19197
19808
  };
19198
19809
  }
19199
- if (inheritsDecoratedClass(classNode, sourceFile, dirname17(componentFilePath), projectRoot)) {
19810
+ if (inheritsDecoratedClass(classNode, sourceFile, dirname19(componentFilePath), projectRoot)) {
19200
19811
  return fail("inherits-decorated-class");
19201
19812
  }
19202
19813
  const decorator = findComponentDecorator(classNode);
@@ -19208,18 +19819,18 @@ ${block}
19208
19819
  const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
19209
19820
  const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
19210
19821
  const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
19211
- const componentDir = dirname17(componentFilePath);
19822
+ const componentDir = dirname19(componentFilePath);
19212
19823
  let templateText;
19213
19824
  let templatePath;
19214
19825
  if (decoratorMeta.template !== null) {
19215
19826
  templateText = decoratorMeta.template;
19216
19827
  templatePath = componentFilePath;
19217
19828
  } else if (decoratorMeta.templateUrl) {
19218
- const tplAbs = resolve23(componentDir, decoratorMeta.templateUrl);
19829
+ const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
19219
19830
  if (!existsSync24(tplAbs)) {
19220
19831
  return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
19221
19832
  }
19222
- templateText = readFileSync20(tplAbs, "utf8");
19833
+ templateText = readFileSync21(tplAbs, "utf8");
19223
19834
  templatePath = tplAbs;
19224
19835
  } else {
19225
19836
  return fail("unsupported-decorator-args", "missing template/templateUrl");
@@ -19978,7 +20589,7 @@ __export(exports_compileEmber, {
19978
20589
  getEmberServerCompiledDir: () => getEmberServerCompiledDir,
19979
20590
  getEmberCompiledRoot: () => getEmberCompiledRoot,
19980
20591
  getEmberClientCompiledDir: () => getEmberClientCompiledDir,
19981
- dirname: () => dirname18,
20592
+ dirname: () => dirname20,
19982
20593
  compileEmberFileSource: () => compileEmberFileSource,
19983
20594
  compileEmberFile: () => compileEmberFile,
19984
20595
  compileEmber: () => compileEmber,
@@ -19986,8 +20597,8 @@ __export(exports_compileEmber, {
19986
20597
  basename: () => basename13
19987
20598
  });
19988
20599
  import { existsSync as existsSync25 } from "fs";
19989
- import { mkdir as mkdir7, rm as rm4 } from "fs/promises";
19990
- import { basename as basename13, dirname as dirname18, extname as extname9, join as join31, resolve as resolve24 } from "path";
20600
+ import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
20601
+ import { basename as basename13, dirname as dirname20, extname as extname9, join as join33, resolve as resolve25 } from "path";
19991
20602
  var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
19992
20603
  var cachedPreprocessor = null, getPreprocessor = async () => {
19993
20604
  if (cachedPreprocessor)
@@ -20083,7 +20694,7 @@ export const importSync = (specifier) => {
20083
20694
  const originalImporter = stagedSourceMap.get(args.importer);
20084
20695
  if (!originalImporter)
20085
20696
  return;
20086
- const candidateBase = resolve24(dirname18(originalImporter), args.path);
20697
+ const candidateBase = resolve25(dirname20(originalImporter), args.path);
20087
20698
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
20088
20699
  for (const ext of extensionsToTry) {
20089
20700
  const candidate = candidateBase + ext;
@@ -20106,7 +20717,7 @@ export const importSync = (specifier) => {
20106
20717
  build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
20107
20718
  if (standalonePackages.has(args.path))
20108
20719
  return;
20109
- const internal = join31(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
20720
+ const internal = join33(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
20110
20721
  if (existsSync25(internal))
20111
20722
  return { path: internal };
20112
20723
  return;
@@ -20142,7 +20753,7 @@ export const renderToHTML = (props = {}) => {
20142
20753
  export { PageComponent };
20143
20754
  export default PageComponent;
20144
20755
  `, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
20145
- const resolvedEntry = resolve24(entry);
20756
+ const resolvedEntry = resolve25(entry);
20146
20757
  const source = await file3(resolvedEntry).text();
20147
20758
  let preprocessed = source;
20148
20759
  if (isTemplateTagFile(resolvedEntry)) {
@@ -20154,16 +20765,16 @@ export default PageComponent;
20154
20765
  }
20155
20766
  const transpiled = transpiler5.transformSync(preprocessed);
20156
20767
  const baseName = basename13(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
20157
- const tmpDir = join31(compiledRoot, "_tmp");
20158
- const serverDir = join31(compiledRoot, "server");
20159
- const clientDir = join31(compiledRoot, "client");
20768
+ const tmpDir = join33(compiledRoot, "_tmp");
20769
+ const serverDir = join33(compiledRoot, "server");
20770
+ const clientDir = join33(compiledRoot, "client");
20160
20771
  await Promise.all([
20161
- mkdir7(tmpDir, { recursive: true }),
20162
- mkdir7(serverDir, { recursive: true }),
20163
- mkdir7(clientDir, { recursive: true })
20772
+ mkdir8(tmpDir, { recursive: true }),
20773
+ mkdir8(serverDir, { recursive: true }),
20774
+ mkdir8(clientDir, { recursive: true })
20164
20775
  ]);
20165
- const tmpPagePath = resolve24(join31(tmpDir, `${baseName}.module.js`));
20166
- const tmpHarnessPath = resolve24(join31(tmpDir, `${baseName}.harness.js`));
20776
+ const tmpPagePath = resolve25(join33(tmpDir, `${baseName}.module.js`));
20777
+ const tmpHarnessPath = resolve25(join33(tmpDir, `${baseName}.harness.js`));
20167
20778
  await Promise.all([
20168
20779
  write4(tmpPagePath, transpiled),
20169
20780
  write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
@@ -20171,7 +20782,7 @@ export default PageComponent;
20171
20782
  const stagedSourceMap = new Map([
20172
20783
  [tmpPagePath, resolvedEntry]
20173
20784
  ]);
20174
- const serverPath = join31(serverDir, `${baseName}.js`);
20785
+ const serverPath = join33(serverDir, `${baseName}.js`);
20175
20786
  const buildResult = await bunBuild2({
20176
20787
  entrypoints: [tmpHarnessPath],
20177
20788
  format: "esm",
@@ -20187,8 +20798,8 @@ export default PageComponent;
20187
20798
  if (!buildResult.success) {
20188
20799
  console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
20189
20800
  }
20190
- await rm4(tmpDir, { force: true, recursive: true });
20191
- const clientPath = join31(clientDir, `${baseName}.js`);
20801
+ await rm5(tmpDir, { force: true, recursive: true });
20802
+ const clientPath = join33(clientDir, `${baseName}.js`);
20192
20803
  await write4(clientPath, transpiled);
20193
20804
  return { clientPath, serverPath };
20194
20805
  }, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
@@ -20205,7 +20816,7 @@ export default PageComponent;
20205
20816
  serverPaths: outputs.map((o3) => o3.serverPath)
20206
20817
  };
20207
20818
  }, compileEmberFileSource = async (entry) => {
20208
- const resolvedEntry = resolve24(entry);
20819
+ const resolvedEntry = resolve25(entry);
20209
20820
  const source = await file3(resolvedEntry).text();
20210
20821
  let preprocessed = source;
20211
20822
  if (isTemplateTagFile(resolvedEntry)) {
@@ -20216,7 +20827,7 @@ export default PageComponent;
20216
20827
  preprocessed = rewriteTemplateEvalToScope(result.code);
20217
20828
  }
20218
20829
  return transpiler5.transformSync(preprocessed);
20219
- }, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join31(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join31(getEmberCompiledRoot(emberDir), "client");
20830
+ }, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join33(getEmberCompiledRoot(emberDir), "client");
20220
20831
  var init_compileEmber = __esm(() => {
20221
20832
  init_generatedDir();
20222
20833
  transpiler5 = new Transpiler4({
@@ -20238,24 +20849,24 @@ __export(exports_buildReactVendor, {
20238
20849
  buildReactVendor: () => buildReactVendor
20239
20850
  });
20240
20851
  import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
20241
- import { join as join32, resolve as resolve25 } from "path";
20242
- import { rm as rm5 } from "fs/promises";
20852
+ import { join as join34, resolve as resolve26 } from "path";
20853
+ import { rm as rm6 } from "fs/promises";
20243
20854
  var {build: bunBuild3 } = globalThis.Bun;
20244
20855
  var resolveJsxDevRuntimeCompatPath = () => {
20245
20856
  const candidates = [
20246
- resolve25(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
20247
- resolve25(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
20248
- resolve25(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
20249
- resolve25(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
20250
- resolve25(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
20251
- resolve25(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
20857
+ resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
20858
+ resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
20859
+ resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
20860
+ resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
20861
+ resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
20862
+ resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
20252
20863
  ];
20253
20864
  for (const candidate of candidates) {
20254
20865
  if (existsSync26(candidate)) {
20255
20866
  return candidate.replace(/\\/g, "/");
20256
20867
  }
20257
20868
  }
20258
- return (candidates[0] ?? resolve25(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
20869
+ return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
20259
20870
  }, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
20260
20871
  const paths = {};
20261
20872
  for (const specifier of reactSpecifiers) {
@@ -20288,14 +20899,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
20288
20899
  `)}
20289
20900
  `;
20290
20901
  }, buildReactVendor = async (buildDir) => {
20291
- const vendorDir = join32(buildDir, "react", "vendor");
20902
+ const vendorDir = join34(buildDir, "react", "vendor");
20292
20903
  mkdirSync8(vendorDir, { recursive: true });
20293
- const tmpDir = join32(buildDir, "_vendor_tmp");
20904
+ const tmpDir = join34(buildDir, "_vendor_tmp");
20294
20905
  mkdirSync8(tmpDir, { recursive: true });
20295
20906
  const specifiers = reactSpecifiers;
20296
20907
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
20297
20908
  const safeName = toSafeFileName(specifier);
20298
- const entryPath = join32(tmpDir, `${safeName}.ts`);
20909
+ const entryPath = join34(tmpDir, `${safeName}.ts`);
20299
20910
  const source = await generateEntrySource(specifier);
20300
20911
  await Bun.write(entryPath, source);
20301
20912
  return entryPath;
@@ -20310,7 +20921,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
20310
20921
  target: "browser",
20311
20922
  throw: false
20312
20923
  });
20313
- await rm5(tmpDir, { force: true, recursive: true });
20924
+ await rm6(tmpDir, { force: true, recursive: true });
20314
20925
  if (!result.success) {
20315
20926
  console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
20316
20927
  }
@@ -20363,8 +20974,8 @@ __export(exports_buildAngularVendor, {
20363
20974
  buildAngularServerVendor: () => buildAngularServerVendor
20364
20975
  });
20365
20976
  import { mkdirSync as mkdirSync9 } from "fs";
20366
- import { join as join33 } from "path";
20367
- import { rm as rm6 } from "fs/promises";
20977
+ import { join as join35 } from "path";
20978
+ import { rm as rm7 } from "fs/promises";
20368
20979
  var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
20369
20980
  var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
20370
20981
  try {
@@ -20400,7 +21011,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20400
21011
  }
20401
21012
  return { angular, transitiveRoots };
20402
21013
  }, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
20403
- const { readFileSync: readFileSync21 } = await import("fs");
21014
+ const { readFileSync: readFileSync22 } = await import("fs");
20404
21015
  const transpiler6 = new Bun.Transpiler({ loader: "js" });
20405
21016
  const visited = new Set;
20406
21017
  const frontier = [];
@@ -20421,7 +21032,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20421
21032
  }
20422
21033
  let content;
20423
21034
  try {
20424
- content = readFileSync21(resolved, "utf-8");
21035
+ content = readFileSync22(resolved, "utf-8");
20425
21036
  } catch {
20426
21037
  continue;
20427
21038
  }
@@ -20460,14 +21071,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20460
21071
  await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
20461
21072
  return Array.from(angular).filter(isResolvable);
20462
21073
  }, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
20463
- const vendorDir = join33(buildDir, "angular", "vendor");
21074
+ const vendorDir = join35(buildDir, "angular", "vendor");
20464
21075
  mkdirSync9(vendorDir, { recursive: true });
20465
- const tmpDir = join33(buildDir, "_angular_vendor_tmp");
21076
+ const tmpDir = join35(buildDir, "_angular_vendor_tmp");
20466
21077
  mkdirSync9(tmpDir, { recursive: true });
20467
21078
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
20468
21079
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
20469
21080
  const safeName = toSafeFileName2(specifier);
20470
- const entryPath = join33(tmpDir, `${safeName}.ts`);
21081
+ const entryPath = join35(tmpDir, `${safeName}.ts`);
20471
21082
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
20472
21083
  return entryPath;
20473
21084
  }));
@@ -20483,7 +21094,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20483
21094
  target: "browser",
20484
21095
  throw: false
20485
21096
  });
20486
- await rm6(tmpDir, { force: true, recursive: true });
21097
+ await rm7(tmpDir, { force: true, recursive: true });
20487
21098
  if (!result.success) {
20488
21099
  console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
20489
21100
  }
@@ -20498,9 +21109,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20498
21109
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
20499
21110
  return computeAngularVendorPaths(specifiers);
20500
21111
  }, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
20501
- const vendorDir = join33(buildDir, "angular", "vendor", "server");
21112
+ const vendorDir = join35(buildDir, "angular", "vendor", "server");
20502
21113
  mkdirSync9(vendorDir, { recursive: true });
20503
- const tmpDir = join33(buildDir, "_angular_server_vendor_tmp");
21114
+ const tmpDir = join35(buildDir, "_angular_server_vendor_tmp");
20504
21115
  mkdirSync9(tmpDir, { recursive: true });
20505
21116
  const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
20506
21117
  const allSpecs = new Set(browserSpecs);
@@ -20511,7 +21122,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20511
21122
  const specifiers = Array.from(allSpecs);
20512
21123
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
20513
21124
  const safeName = toSafeFileName2(specifier);
20514
- const entryPath = join33(tmpDir, `${safeName}.ts`);
21125
+ const entryPath = join35(tmpDir, `${safeName}.ts`);
20515
21126
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
20516
21127
  return entryPath;
20517
21128
  }));
@@ -20526,16 +21137,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
20526
21137
  target: "bun",
20527
21138
  throw: false
20528
21139
  });
20529
- await rm6(tmpDir, { force: true, recursive: true });
21140
+ await rm7(tmpDir, { force: true, recursive: true });
20530
21141
  if (!result.success) {
20531
21142
  console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
20532
21143
  }
20533
21144
  return specifiers;
20534
21145
  }, computeAngularServerVendorPaths = (buildDir, specifiers) => {
20535
21146
  const paths = {};
20536
- const vendorDir = join33(buildDir, "angular", "vendor", "server");
21147
+ const vendorDir = join35(buildDir, "angular", "vendor", "server");
20537
21148
  for (const specifier of specifiers) {
20538
- paths[specifier] = join33(vendorDir, `${toSafeFileName2(specifier)}.js`);
21149
+ paths[specifier] = join35(vendorDir, `${toSafeFileName2(specifier)}.js`);
20539
21150
  }
20540
21151
  return paths;
20541
21152
  }, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
@@ -20591,17 +21202,17 @@ __export(exports_buildVueVendor, {
20591
21202
  buildVueVendor: () => buildVueVendor
20592
21203
  });
20593
21204
  import { mkdirSync as mkdirSync10 } from "fs";
20594
- import { join as join34 } from "path";
20595
- import { rm as rm7 } from "fs/promises";
21205
+ import { join as join36 } from "path";
21206
+ import { rm as rm8 } from "fs/promises";
20596
21207
  var {build: bunBuild5 } = globalThis.Bun;
20597
21208
  var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
20598
- const vendorDir = join34(buildDir, "vue", "vendor");
21209
+ const vendorDir = join36(buildDir, "vue", "vendor");
20599
21210
  mkdirSync10(vendorDir, { recursive: true });
20600
- const tmpDir = join34(buildDir, "_vue_vendor_tmp");
21211
+ const tmpDir = join36(buildDir, "_vue_vendor_tmp");
20601
21212
  mkdirSync10(tmpDir, { recursive: true });
20602
21213
  const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
20603
21214
  const safeName = toSafeFileName3(specifier);
20604
- const entryPath = join34(tmpDir, `${safeName}.ts`);
21215
+ const entryPath = join36(tmpDir, `${safeName}.ts`);
20605
21216
  await Bun.write(entryPath, `export * from '${specifier}';
20606
21217
  `);
20607
21218
  return entryPath;
@@ -20621,16 +21232,16 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
20621
21232
  target: "browser",
20622
21233
  throw: false
20623
21234
  });
20624
- await rm7(tmpDir, { force: true, recursive: true });
21235
+ await rm8(tmpDir, { force: true, recursive: true });
20625
21236
  if (!result.success) {
20626
21237
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
20627
21238
  return;
20628
21239
  }
20629
- const { readFileSync: readFileSync21, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
21240
+ const { readFileSync: readFileSync22, writeFileSync: writeFileSync8, readdirSync: readdirSync5 } = await import("fs");
20630
21241
  const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
20631
21242
  for (const file4 of files) {
20632
- const filePath = join34(vendorDir, file4);
20633
- const content = readFileSync21(filePath, "utf-8");
21243
+ const filePath = join36(vendorDir, file4);
21244
+ const content = readFileSync22(filePath, "utf-8");
20634
21245
  if (!content.includes("__VUE_HMR_RUNTIME__"))
20635
21246
  continue;
20636
21247
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -20656,8 +21267,8 @@ __export(exports_buildSvelteVendor, {
20656
21267
  buildSvelteVendor: () => buildSvelteVendor
20657
21268
  });
20658
21269
  import { mkdirSync as mkdirSync11 } from "fs";
20659
- import { join as join35 } from "path";
20660
- import { rm as rm8 } from "fs/promises";
21270
+ import { join as join37 } from "path";
21271
+ import { rm as rm9 } from "fs/promises";
20661
21272
  var {build: bunBuild6 } = globalThis.Bun;
20662
21273
  var svelteSpecifiers, isResolvable2 = (specifier) => {
20663
21274
  try {
@@ -20670,13 +21281,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
20670
21281
  const specifiers = resolveVendorSpecifiers();
20671
21282
  if (specifiers.length === 0)
20672
21283
  return;
20673
- const vendorDir = join35(buildDir, "svelte", "vendor");
21284
+ const vendorDir = join37(buildDir, "svelte", "vendor");
20674
21285
  mkdirSync11(vendorDir, { recursive: true });
20675
- const tmpDir = join35(buildDir, "_svelte_vendor_tmp");
21286
+ const tmpDir = join37(buildDir, "_svelte_vendor_tmp");
20676
21287
  mkdirSync11(tmpDir, { recursive: true });
20677
21288
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
20678
21289
  const safeName = toSafeFileName4(specifier);
20679
- const entryPath = join35(tmpDir, `${safeName}.ts`);
21290
+ const entryPath = join37(tmpDir, `${safeName}.ts`);
20680
21291
  await Bun.write(entryPath, `export * from '${specifier}';
20681
21292
  `);
20682
21293
  return entryPath;
@@ -20691,7 +21302,7 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
20691
21302
  target: "browser",
20692
21303
  throw: false
20693
21304
  });
20694
- await rm8(tmpDir, { force: true, recursive: true });
21305
+ await rm9(tmpDir, { force: true, recursive: true });
20695
21306
  if (!result.success) {
20696
21307
  console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
20697
21308
  }
@@ -20721,13 +21332,13 @@ import {
20721
21332
  existsSync as existsSync27,
20722
21333
  mkdirSync as mkdirSync12,
20723
21334
  readdirSync as readdirSync5,
20724
- readFileSync as readFileSync21,
21335
+ readFileSync as readFileSync22,
20725
21336
  renameSync,
20726
21337
  rmSync as rmSync2,
20727
21338
  statSync as statSync3,
20728
21339
  writeFileSync as writeFileSync8
20729
21340
  } from "fs";
20730
- import { basename as basename14, dirname as dirname19, extname as extname10, join as join36, relative as relative15, resolve as resolve26 } from "path";
21341
+ import { basename as basename14, dirname as dirname21, extname as extname10, join as join38, relative as relative15, resolve as resolve27 } from "path";
20731
21342
  import { cwd, env as env2, exit } from "process";
20732
21343
  var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
20733
21344
  var isBuildTraceEnabled = () => {
@@ -20810,7 +21421,7 @@ var isBuildTraceEnabled = () => {
20810
21421
  }, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
20811
21422
  let content;
20812
21423
  try {
20813
- content = readFileSync21(path, "utf-8");
21424
+ content = readFileSync22(path, "utf-8");
20814
21425
  } catch {
20815
21426
  return [];
20816
21427
  }
@@ -20861,8 +21472,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20861
21472
  mkdirSync12(htmxDestDir, { recursive: true });
20862
21473
  const glob = new Glob8("htmx*.min.js");
20863
21474
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
20864
- const src = join36(htmxDir, relPath);
20865
- const dest = join36(htmxDestDir, "htmx.min.js");
21475
+ const src = join38(htmxDir, relPath);
21476
+ const dest = join38(htmxDestDir, "htmx.min.js");
20866
21477
  copyFileSync2(src, dest);
20867
21478
  return;
20868
21479
  }
@@ -20874,8 +21485,8 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20874
21485
  }
20875
21486
  }, resolveAbsoluteVersion = async () => {
20876
21487
  const candidates = [
20877
- resolve26(import.meta.dir, "..", "..", "package.json"),
20878
- resolve26(import.meta.dir, "..", "package.json")
21488
+ resolve27(import.meta.dir, "..", "..", "package.json"),
21489
+ resolve27(import.meta.dir, "..", "package.json")
20879
21490
  ];
20880
21491
  const resolveCandidate = async (remaining) => {
20881
21492
  const [candidate, ...rest] = remaining;
@@ -20891,7 +21502,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20891
21502
  };
20892
21503
  await resolveCandidate(candidates);
20893
21504
  }, SKIP_DIRS5, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
20894
- const absPath = resolve26(file4, "..", relPath);
21505
+ const absPath = resolve27(file4, "..", relPath);
20895
21506
  try {
20896
21507
  statSync3(absPath);
20897
21508
  workerPaths.add(absPath);
@@ -20906,7 +21517,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20906
21517
  addWorkerPathIfExists(file4, relPath, workerPaths);
20907
21518
  }
20908
21519
  }, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
20909
- const content = readFileSync21(file4, "utf-8");
21520
+ const content = readFileSync22(file4, "utf-8");
20910
21521
  for (const pattern of patterns) {
20911
21522
  collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
20912
21523
  }
@@ -20939,7 +21550,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20939
21550
  vuePagesPath
20940
21551
  }) => {
20941
21552
  const { readdirSync: readDir } = await import("fs");
20942
- const devIndexDir = join36(buildPath, "_src_indexes");
21553
+ const devIndexDir = join38(buildPath, "_src_indexes");
20943
21554
  mkdirSync12(devIndexDir, { recursive: true });
20944
21555
  if (reactIndexesPath && reactPagesPath) {
20945
21556
  copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
@@ -20955,37 +21566,37 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20955
21566
  return;
20956
21567
  }
20957
21568
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
20958
- const pagesRel = relative15(process.cwd(), resolve26(reactPagesPath)).replace(/\\/g, "/");
21569
+ const pagesRel = relative15(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
20959
21570
  for (const file4 of indexFiles) {
20960
- let content = readFileSync21(join36(reactIndexesPath, file4), "utf-8");
21571
+ let content = readFileSync22(join38(reactIndexesPath, file4), "utf-8");
20961
21572
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
20962
- writeFileSync8(join36(devIndexDir, file4), content);
21573
+ writeFileSync8(join38(devIndexDir, file4), content);
20963
21574
  }
20964
21575
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
20965
- const svelteIndexDir = join36(getFrameworkGeneratedDir("svelte"), "indexes");
20966
- const sveltePageEntries = svelteEntries.filter((file4) => resolve26(file4).startsWith(resolve26(sveltePagesPath)));
21576
+ const svelteIndexDir = join38(getFrameworkGeneratedDir("svelte"), "indexes");
21577
+ const sveltePageEntries = svelteEntries.filter((file4) => resolve27(file4).startsWith(resolve27(sveltePagesPath)));
20967
21578
  for (const entry of sveltePageEntries) {
20968
21579
  const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
20969
- const indexFile = join36(svelteIndexDir, "pages", `${name}.js`);
21580
+ const indexFile = join38(svelteIndexDir, "pages", `${name}.js`);
20970
21581
  if (!existsSync27(indexFile))
20971
21582
  continue;
20972
- let content = readFileSync21(indexFile, "utf-8");
20973
- const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
21583
+ let content = readFileSync22(indexFile, "utf-8");
21584
+ const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
20974
21585
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
20975
- writeFileSync8(join36(devIndexDir, `${name}.svelte.js`), content);
21586
+ writeFileSync8(join38(devIndexDir, `${name}.svelte.js`), content);
20976
21587
  }
20977
21588
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
20978
- const vueIndexDir = join36(getFrameworkGeneratedDir("vue"), "indexes");
20979
- const vuePageEntries = vueEntries.filter((file4) => resolve26(file4).startsWith(resolve26(vuePagesPath)));
21589
+ const vueIndexDir = join38(getFrameworkGeneratedDir("vue"), "indexes");
21590
+ const vuePageEntries = vueEntries.filter((file4) => resolve27(file4).startsWith(resolve27(vuePagesPath)));
20980
21591
  for (const entry of vuePageEntries) {
20981
21592
  const name = basename14(entry, ".vue");
20982
- const indexFile = join36(vueIndexDir, `${name}.js`);
21593
+ const indexFile = join38(vueIndexDir, `${name}.js`);
20983
21594
  if (!existsSync27(indexFile))
20984
21595
  continue;
20985
- let content = readFileSync21(indexFile, "utf-8");
20986
- const srcRel = relative15(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
21596
+ let content = readFileSync22(indexFile, "utf-8");
21597
+ const srcRel = relative15(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
20987
21598
  content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
20988
- writeFileSync8(join36(devIndexDir, `${name}.vue.js`), content);
21599
+ writeFileSync8(join38(devIndexDir, `${name}.vue.js`), content);
20989
21600
  }
20990
21601
  }, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
20991
21602
  const varIdx = content.indexOf(`var ${firstUseName} =`);
@@ -20996,7 +21607,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
20996
21607
  const last = allComments[allComments.length - 1];
20997
21608
  if (!last?.[1])
20998
21609
  return JSON.stringify(outputPath);
20999
- const srcPath = resolve26(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
21610
+ const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
21000
21611
  return JSON.stringify(srcPath);
21001
21612
  }, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
21002
21613
  let depth = 0;
@@ -21033,7 +21644,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
21033
21644
  }
21034
21645
  return result;
21035
21646
  }, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
21036
- let content = readFileSync21(outputPath, "utf-8");
21647
+ let content = readFileSync22(outputPath, "utf-8");
21037
21648
  const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
21038
21649
  const useNames = [];
21039
21650
  let match;
@@ -21083,7 +21694,7 @@ ${content.slice(firstUseIdx)}`;
21083
21694
  }, rewriteUrlReferences = (outputPaths, urlFileMap) => {
21084
21695
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
21085
21696
  for (const outputPath of outputPaths) {
21086
- let content = readFileSync21(outputPath, "utf-8");
21697
+ let content = readFileSync22(outputPath, "utf-8");
21087
21698
  let changed = false;
21088
21699
  content = content.replace(urlPattern, (_match, relPath) => {
21089
21700
  const targetName = basename14(relPath);
@@ -21134,6 +21745,8 @@ ${content.slice(firstUseIdx)}`;
21134
21745
  };
21135
21746
  const result = {
21136
21747
  ...merged,
21748
+ banner: [base.banner, sanitized.banner].filter(Boolean).join(`
21749
+ `) || undefined,
21137
21750
  define: base.define || sanitized.define ? {
21138
21751
  ...sanitized.define ?? {},
21139
21752
  ...base.define ?? {}
@@ -21155,6 +21768,7 @@ ${content.slice(firstUseIdx)}`;
21155
21768
  htmxDirectory,
21156
21769
  angularDirectory,
21157
21770
  emberDirectory,
21771
+ pwa,
21158
21772
  svelteDirectory,
21159
21773
  vueDirectory,
21160
21774
  stylesConfig,
@@ -21220,10 +21834,10 @@ ${content.slice(firstUseIdx)}`;
21220
21834
  restoreTracePhase();
21221
21835
  return;
21222
21836
  }
21223
- const traceDir = join36(buildPath2, ".absolute-trace");
21837
+ const traceDir = join38(buildPath2, ".absolute-trace");
21224
21838
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
21225
21839
  mkdirSync12(traceDir, { recursive: true });
21226
- writeFileSync8(join36(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
21840
+ writeFileSync8(join38(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
21227
21841
  events: traceEvents,
21228
21842
  frameworks: traceFrameworkNames,
21229
21843
  generatedAt: new Date().toISOString(),
@@ -21254,16 +21868,16 @@ ${content.slice(firstUseIdx)}`;
21254
21868
  const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
21255
21869
  const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
21256
21870
  const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
21257
- const reactIndexesPath = reactDir && join36(getFrameworkGeneratedDir("react"), "indexes");
21258
- const reactPagesPath = reactDir && join36(reactDir, "pages");
21259
- const htmlPagesPath = htmlDir && join36(htmlDir, "pages");
21260
- const htmlScriptsPath = htmlDir && join36(htmlDir, "scripts");
21261
- const sveltePagesPath = svelteDir && join36(svelteDir, "pages");
21262
- const vuePagesPath = vueDir && join36(vueDir, "pages");
21263
- const htmxPagesPath = htmxDir && join36(htmxDir, "pages");
21264
- const htmxScriptsPath = htmxDir && join36(htmxDir, "scripts");
21265
- const angularPagesPath = angularDir && join36(angularDir, "pages");
21266
- const emberPagesPath = emberDir && join36(emberDir, "pages");
21871
+ const reactIndexesPath = reactDir && join38(getFrameworkGeneratedDir("react"), "indexes");
21872
+ const reactPagesPath = reactDir && join38(reactDir, "pages");
21873
+ const htmlPagesPath = htmlDir && join38(htmlDir, "pages");
21874
+ const htmlScriptsPath = htmlDir && join38(htmlDir, "scripts");
21875
+ const sveltePagesPath = svelteDir && join38(svelteDir, "pages");
21876
+ const vuePagesPath = vueDir && join38(vueDir, "pages");
21877
+ const htmxPagesPath = htmxDir && join38(htmxDir, "pages");
21878
+ const htmxScriptsPath = htmxDir && join38(htmxDir, "scripts");
21879
+ const angularPagesPath = angularDir && join38(angularDir, "pages");
21880
+ const emberPagesPath = emberDir && join38(emberDir, "pages");
21267
21881
  const frontends = [
21268
21882
  reactDir,
21269
21883
  htmlDir,
@@ -21288,13 +21902,15 @@ ${content.slice(firstUseIdx)}`;
21288
21902
  framework: frameworkNames[0],
21289
21903
  frameworks: frameworkNames,
21290
21904
  mode: mode ?? (isDev2 ? "development" : "production"),
21905
+ pwa: Boolean(pwa),
21906
+ pwaSync: Boolean(pwa?.sync),
21291
21907
  tailwind: Boolean(tailwind)
21292
21908
  });
21293
21909
  const generatedRoot = getGeneratedRoot(projectRoot);
21294
21910
  const sourceClientRoots = [
21295
21911
  htmlDir,
21296
21912
  htmxDir,
21297
- islandBootstrapPath && dirname19(islandBootstrapPath)
21913
+ islandBootstrapPath && dirname21(islandBootstrapPath)
21298
21914
  ].filter((dir) => Boolean(dir));
21299
21915
  const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
21300
21916
  if (usesGenerated)
@@ -21322,8 +21938,8 @@ ${content.slice(firstUseIdx)}`;
21322
21938
  const [firstEntry] = serverDirMap;
21323
21939
  if (!firstEntry)
21324
21940
  throw new Error("Expected at least one server directory entry");
21325
- serverRoot = join36(firstEntry.dir, firstEntry.subdir);
21326
- serverOutDir = join36(buildPath, basename14(firstEntry.dir));
21941
+ serverRoot = join38(firstEntry.dir, firstEntry.subdir);
21942
+ serverOutDir = join38(buildPath, basename14(firstEntry.dir));
21327
21943
  } else if (serverDirMap.length > 1) {
21328
21944
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
21329
21945
  serverOutDir = buildPath;
@@ -21332,16 +21948,23 @@ ${content.slice(firstUseIdx)}`;
21332
21948
  await tracePhase("build-dir/create", () => mkdirSync12(buildPath, { recursive: true }));
21333
21949
  if (publicPath)
21334
21950
  await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
21951
+ const pwaArtifacts = pwa ? await tracePhase("pwa/materialize", () => materializeAbsolutePwa({
21952
+ buildPath,
21953
+ config: pwa,
21954
+ generatedRoot,
21955
+ projectRoot,
21956
+ write: !isIncremental
21957
+ })) : undefined;
21335
21958
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
21336
21959
  if (!isIncremental || !incrementalFiles)
21337
21960
  return entryPoints;
21338
- const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve26(f2)));
21961
+ const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
21339
21962
  const matchingEntries = [];
21340
21963
  for (const entry of entryPoints) {
21341
21964
  const sourceFile = mapToSource(entry);
21342
21965
  if (!sourceFile)
21343
21966
  continue;
21344
- if (!normalizedIncremental.has(resolve26(sourceFile)))
21967
+ if (!normalizedIncremental.has(resolve27(sourceFile)))
21345
21968
  continue;
21346
21969
  matchingEntries.push(entry);
21347
21970
  }
@@ -21351,7 +21974,7 @@ ${content.slice(firstUseIdx)}`;
21351
21974
  await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
21352
21975
  }
21353
21976
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
21354
- await tracePhase("assets/copy", () => cpSync(assetsPath, join36(buildPath, "assets"), {
21977
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join38(buildPath, "assets"), {
21355
21978
  force: true,
21356
21979
  recursive: true
21357
21980
  }));
@@ -21465,11 +22088,11 @@ ${content.slice(firstUseIdx)}`;
21465
22088
  }
21466
22089
  }
21467
22090
  if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
21468
- const htmlConventionsOutDir = join36(buildPath, "conventions", "html");
22091
+ const htmlConventionsOutDir = join38(buildPath, "conventions", "html");
21469
22092
  mkdirSync12(htmlConventionsOutDir, { recursive: true });
21470
22093
  const htmlPathRemap = new Map;
21471
22094
  for (const sourcePath of htmlConventionSources) {
21472
- const dest = join36(htmlConventionsOutDir, basename14(sourcePath));
22095
+ const dest = join38(htmlConventionsOutDir, basename14(sourcePath));
21473
22096
  cpSync(sourcePath, dest, { force: true });
21474
22097
  htmlPathRemap.set(sourcePath, dest);
21475
22098
  }
@@ -21510,9 +22133,9 @@ ${content.slice(firstUseIdx)}`;
21510
22133
  }
21511
22134
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
21512
22135
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
21513
- if (entry.startsWith(resolve26(reactIndexesPath))) {
22136
+ if (entry.startsWith(resolve27(reactIndexesPath))) {
21514
22137
  const pageName = basename14(entry, ".tsx");
21515
- return join36(reactPagesPath, `${pageName}.tsx`);
22138
+ return join38(reactPagesPath, `${pageName}.tsx`);
21516
22139
  }
21517
22140
  return null;
21518
22141
  }) : allReactEntries;
@@ -21544,7 +22167,7 @@ ${content.slice(firstUseIdx)}`;
21544
22167
  for (const entry of vueEntries) {
21545
22168
  const name = basename14(entry, ".vue");
21546
22169
  if (ssrOnlyPageNames.has(name)) {
21547
- resolved.add(resolve26(entry));
22170
+ resolved.add(resolve27(entry));
21548
22171
  }
21549
22172
  }
21550
22173
  return resolved;
@@ -21681,7 +22304,7 @@ ${content.slice(firstUseIdx)}`;
21681
22304
  const clientPath = islandSvelteClientPaths[idx];
21682
22305
  if (!sourcePath || !clientPath)
21683
22306
  continue;
21684
- islandSvelteClientPathMap.set(resolve26(sourcePath), clientPath);
22307
+ islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
21685
22308
  }
21686
22309
  const islandVueClientPathMap = new Map;
21687
22310
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -21689,7 +22312,7 @@ ${content.slice(firstUseIdx)}`;
21689
22312
  const clientPath = islandVueClientPaths[idx];
21690
22313
  if (!sourcePath || !clientPath)
21691
22314
  continue;
21692
- islandVueClientPathMap.set(resolve26(sourcePath), clientPath);
22315
+ islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
21693
22316
  }
21694
22317
  const islandAngularClientPathMap = new Map;
21695
22318
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -21697,7 +22320,7 @@ ${content.slice(firstUseIdx)}`;
21697
22320
  const clientPath = islandAngularClientPaths[idx];
21698
22321
  if (!sourcePath || !clientPath)
21699
22322
  continue;
21700
- islandAngularClientPathMap.set(resolve26(sourcePath), clientPath);
22323
+ islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
21701
22324
  }
21702
22325
  const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
21703
22326
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
@@ -21708,7 +22331,7 @@ ${content.slice(firstUseIdx)}`;
21708
22331
  const compileReactConventions = async () => {
21709
22332
  if (reactConventionSources.length === 0)
21710
22333
  return emptyStringArray;
21711
- const destDir = join36(buildPath, "conventions", "react");
22334
+ const destDir = join38(buildPath, "conventions", "react");
21712
22335
  rmSync2(destDir, { force: true, recursive: true });
21713
22336
  mkdirSync12(destDir, { recursive: true });
21714
22337
  const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
@@ -21723,7 +22346,7 @@ ${content.slice(firstUseIdx)}`;
21723
22346
  stylePreprocessorPlugin2,
21724
22347
  createBunStringRawUnicodePlugin()
21725
22348
  ],
21726
- root: dirname19(source),
22349
+ root: dirname21(source),
21727
22350
  target: "bun",
21728
22351
  throw: false,
21729
22352
  tsconfig: "./tsconfig.json"
@@ -21751,7 +22374,7 @@ ${content.slice(firstUseIdx)}`;
21751
22374
  angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
21752
22375
  ]);
21753
22376
  const bundleConventionFiles = async (framework, compiledPaths) => {
21754
- const destDir = join36(buildPath, "conventions", framework);
22377
+ const destDir = join38(buildPath, "conventions", framework);
21755
22378
  rmSync2(destDir, { force: true, recursive: true });
21756
22379
  mkdirSync12(destDir, { recursive: true });
21757
22380
  const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
@@ -21812,7 +22435,7 @@ ${content.slice(firstUseIdx)}`;
21812
22435
  ...islandBootstrapPath ? [islandBootstrapPath] : []
21813
22436
  ];
21814
22437
  const [onlyWorkerClientEntry] = urlReferencedFiles;
21815
- const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname19(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname19(file4)), projectRoot);
22438
+ const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname21(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file4) => dirname21(file4)), projectRoot);
21816
22439
  const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
21817
22440
  buildInfo: islandBuildInfo,
21818
22441
  buildPath,
@@ -21823,7 +22446,7 @@ ${content.slice(firstUseIdx)}`;
21823
22446
  }
21824
22447
  })) : {
21825
22448
  entries: [],
21826
- generatedRoot: join36(buildPath, "_island_entries")
22449
+ generatedRoot: join38(buildPath, "_island_entries")
21827
22450
  };
21828
22451
  const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
21829
22452
  if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
@@ -21859,7 +22482,7 @@ ${content.slice(firstUseIdx)}`;
21859
22482
  return {};
21860
22483
  }
21861
22484
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
21862
- const refreshEntry = join36(reactIndexesPath, "_refresh.tsx");
22485
+ const refreshEntry = join38(reactIndexesPath, "_refresh.tsx");
21863
22486
  if (!reactClientEntryPoints.includes(refreshEntry))
21864
22487
  reactClientEntryPoints.push(refreshEntry);
21865
22488
  }
@@ -21948,6 +22571,7 @@ ${content.slice(firstUseIdx)}`;
21948
22571
  const svelteResolveConditions = svelteDir ? ["svelte", "main"] : undefined;
21949
22572
  const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
21950
22573
  const reactBuildConfig = reactClientEntryPoints.length > 0 ? mergeBunBuildConfig({
22574
+ banner: pwaArtifacts?.bootstrapBanner,
21951
22575
  entrypoints: reactClientEntryPoints,
21952
22576
  ...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
21953
22577
  format: "esm",
@@ -21969,19 +22593,19 @@ ${content.slice(firstUseIdx)}`;
21969
22593
  throw: false
21970
22594
  }, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
21971
22595
  if (reactDir && reactClientEntryPoints.length > 0) {
21972
- rmSync2(join36(buildPath, "react", "generated", "indexes"), {
22596
+ rmSync2(join38(buildPath, "react", "generated", "indexes"), {
21973
22597
  force: true,
21974
22598
  recursive: true
21975
22599
  });
21976
22600
  }
21977
22601
  if (angularDir && angularClientPaths.length > 0) {
21978
- rmSync2(join36(buildPath, "angular", "indexes"), {
22602
+ rmSync2(join38(buildPath, "angular", "indexes"), {
21979
22603
  force: true,
21980
22604
  recursive: true
21981
22605
  });
21982
22606
  }
21983
22607
  if (islandClientEntryPoints.length > 0) {
21984
- rmSync2(join36(buildPath, "islands"), {
22608
+ rmSync2(join38(buildPath, "islands"), {
21985
22609
  force: true,
21986
22610
  recursive: true
21987
22611
  });
@@ -22018,6 +22642,7 @@ ${content.slice(firstUseIdx)}`;
22018
22642
  }, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
22019
22643
  reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
22020
22644
  nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
22645
+ banner: pwaArtifacts?.bootstrapBanner,
22021
22646
  conditions: svelteResolveConditions,
22022
22647
  define: vueDirectory ? vueFeatureFlags : undefined,
22023
22648
  entrypoints: nonReactClientEntryPoints,
@@ -22063,6 +22688,7 @@ ${content.slice(firstUseIdx)}`;
22063
22688
  tsconfig: "./tsconfig.json"
22064
22689
  }, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
22065
22690
  islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
22691
+ banner: pwaArtifacts?.bootstrapBanner,
22066
22692
  conditions: svelteResolveConditions,
22067
22693
  define: vueDirectory ? vueFeatureFlags : undefined,
22068
22694
  entrypoints: islandClientEntryPoints,
@@ -22093,7 +22719,7 @@ ${content.slice(firstUseIdx)}`;
22093
22719
  globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
22094
22720
  entrypoints: globalCssEntries,
22095
22721
  naming: `[dir]/[name].[hash].[ext]`,
22096
- outdir: stylesDir ? join36(buildPath, basename14(stylesDir)) : buildPath,
22722
+ outdir: stylesDir ? join38(buildPath, basename14(stylesDir)) : buildPath,
22097
22723
  plugins: [stylePreprocessorPlugin2],
22098
22724
  root: stylesDir || clientRoot,
22099
22725
  target: "browser",
@@ -22102,7 +22728,7 @@ ${content.slice(firstUseIdx)}`;
22102
22728
  vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
22103
22729
  entrypoints: vueCssPaths,
22104
22730
  naming: `[name].[hash].[ext]`,
22105
- outdir: join36(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
22731
+ outdir: join38(buildPath, assetsPath ? basename14(assetsPath) : "assets", "css"),
22106
22732
  target: "browser",
22107
22733
  throw: false
22108
22734
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
@@ -22126,18 +22752,18 @@ ${content.slice(firstUseIdx)}`;
22126
22752
  }
22127
22753
  if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
22128
22754
  const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
22129
- const sourcemapDir = join36(projectRoot, "sourcemaps");
22755
+ const sourcemapDir = join38(projectRoot, "sourcemaps");
22130
22756
  mkdirSync12(sourcemapDir, { recursive: true });
22131
22757
  const mapFiles = readdirSync5(buildPath, {
22132
22758
  encoding: "utf8",
22133
22759
  recursive: true
22134
- }).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join36(buildPath, entry));
22760
+ }).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join38(buildPath, entry));
22135
22761
  for (const mapPath of mapFiles) {
22136
22762
  chainExternalSourcemap2(mapPath);
22137
- renameSync(mapPath, join36(sourcemapDir, basename14(mapPath)));
22763
+ renameSync(mapPath, join38(sourcemapDir, basename14(mapPath)));
22138
22764
  const jsPath = mapPath.slice(0, -4);
22139
22765
  try {
22140
- const javascript = readFileSync21(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
22766
+ const javascript = readFileSync22(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
22141
22767
  `);
22142
22768
  writeFileSync8(jsPath, javascript);
22143
22769
  } catch {}
@@ -22208,7 +22834,7 @@ ${content.slice(firstUseIdx)}`;
22208
22834
  await tracePhase("postprocess/island-vendor-imports", () => rewriteBuildOutputs2(islandClientOutputs, allIslandVendorPaths));
22209
22835
  }
22210
22836
  if (!hmr) {
22211
- const reactVendorDir = join36(buildPath, "react", "vendor");
22837
+ const reactVendorDir = join38(buildPath, "react", "vendor");
22212
22838
  const vendorChunkPaths = existsSync27(reactVendorDir) ? [
22213
22839
  ...new Glob8("**/*.js").scanSync({
22214
22840
  absolute: true,
@@ -22225,7 +22851,7 @@ ${content.slice(firstUseIdx)}`;
22225
22851
  if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
22226
22852
  const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
22227
22853
  await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
22228
- const fileDir = dirname19(artifact.path);
22854
+ const fileDir = dirname21(artifact.path);
22229
22855
  const relativePaths = {};
22230
22856
  for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
22231
22857
  const rel = relative15(fileDir, absolute);
@@ -22353,7 +22979,7 @@ ${content.slice(firstUseIdx)}`;
22353
22979
  const injectHMRIntoHTMLFile = (filePath, framework) => {
22354
22980
  if (!hmrClientBundle)
22355
22981
  return;
22356
- let html = readFileSync21(filePath, "utf-8");
22982
+ let html = readFileSync22(filePath, "utf-8");
22357
22983
  if (html.includes("data-hmr-client"))
22358
22984
  return;
22359
22985
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -22364,7 +22990,7 @@ ${content.slice(firstUseIdx)}`;
22364
22990
  const processHtmlPages = async () => {
22365
22991
  if (!(htmlDir && htmlPagesPath))
22366
22992
  return;
22367
- const outputHtmlPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename14(htmlDir), "pages");
22993
+ const outputHtmlPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmlDir), "pages");
22368
22994
  mkdirSync12(outputHtmlPages, { recursive: true });
22369
22995
  cpSync(htmlPagesPath, outputHtmlPages, {
22370
22996
  force: true,
@@ -22379,6 +23005,10 @@ ${content.slice(firstUseIdx)}`;
22379
23005
  for (const htmlFile of htmlPageFiles) {
22380
23006
  if (hmr)
22381
23007
  injectHMRIntoHTMLFile(htmlFile, "html");
23008
+ if (pwaArtifacts) {
23009
+ const source = readFileSync22(htmlFile, "utf8");
23010
+ writeFileSync8(htmlFile, injectPwaBootstrapHtml(source));
23011
+ }
22382
23012
  const fileName = basename14(htmlFile, ".html");
22383
23013
  if (manifest[fileName] && manifest[fileName] !== htmlFile) {
22384
23014
  warnManifestKeyCollision(fileName, manifest[fileName], htmlFile);
@@ -22389,14 +23019,14 @@ ${content.slice(firstUseIdx)}`;
22389
23019
  const processHtmxPages = async () => {
22390
23020
  if (!(htmxDir && htmxPagesPath))
22391
23021
  return;
22392
- const outputHtmxPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename14(htmxDir), "pages");
23022
+ const outputHtmxPages = isSingle ? join38(buildPath, "pages") : join38(buildPath, basename14(htmxDir), "pages");
22393
23023
  mkdirSync12(outputHtmxPages, { recursive: true });
22394
23024
  cpSync(htmxPagesPath, outputHtmxPages, {
22395
23025
  force: true,
22396
23026
  recursive: true
22397
23027
  });
22398
23028
  if (shouldCopyHtmx) {
22399
- const htmxDestDir = isSingle ? buildPath : join36(buildPath, basename14(htmxDir));
23029
+ const htmxDestDir = isSingle ? buildPath : join38(buildPath, basename14(htmxDir));
22400
23030
  copyHtmxVendor(htmxDir, htmxDestDir);
22401
23031
  }
22402
23032
  if (shouldUpdateHtmxAssetPaths) {
@@ -22408,6 +23038,10 @@ ${content.slice(firstUseIdx)}`;
22408
23038
  for (const htmxFile of htmxPageFiles) {
22409
23039
  if (hmr)
22410
23040
  injectHMRIntoHTMLFile(htmxFile, "htmx");
23041
+ if (pwaArtifacts) {
23042
+ const source = readFileSync22(htmxFile, "utf8");
23043
+ writeFileSync8(htmxFile, injectPwaBootstrapHtml(source));
23044
+ }
22411
23045
  const fileName = basename14(htmxFile, ".html");
22412
23046
  if (manifest[fileName] && manifest[fileName] !== htmxFile) {
22413
23047
  warnManifestKeyCollision(fileName, manifest[fileName], htmxFile);
@@ -22457,7 +23091,9 @@ ${content.slice(firstUseIdx)}`;
22457
23091
  sendTelemetryEvent("build:complete", {
22458
23092
  durationMs: Math.round(performance.now() - buildStart),
22459
23093
  frameworks: frameworkNames,
22460
- mode: mode ?? (isDev2 ? "development" : "production")
23094
+ mode: mode ?? (isDev2 ? "development" : "production"),
23095
+ pwa: Boolean(pwa),
23096
+ pwaSync: Boolean(pwa?.sync)
22461
23097
  });
22462
23098
  const [reactSpaHosts, svelteSpaHosts, vueSpaHosts, angularSpaHosts] = await Promise.all([
22463
23099
  reactDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes2(), exports_staticAnalyzeSpaRoutes2)).then((module) => module.analyzeReactSpaRoutes(reactDir)) : [],
@@ -22466,22 +23102,22 @@ ${content.slice(firstUseIdx)}`;
22466
23102
  angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
22467
23103
  ]);
22468
23104
  const spaRouteHosts = [
22469
- ...reactSpaHosts.map((host) => ({
22470
- ...host,
23105
+ ...reactSpaHosts.map((host2) => ({
23106
+ ...host2,
22471
23107
  framework: "react"
22472
23108
  })),
22473
- ...svelteSpaHosts.map((host) => ({
22474
- ...host,
23109
+ ...svelteSpaHosts.map((host2) => ({
23110
+ ...host2,
22475
23111
  framework: "svelte"
22476
23112
  })),
22477
- ...vueSpaHosts.map((host) => ({ ...host, framework: "vue" })),
22478
- ...angularSpaHosts.map((host) => ({
22479
- ...host,
23113
+ ...vueSpaHosts.map((host2) => ({ ...host2, framework: "vue" })),
23114
+ ...angularSpaHosts.map((host2) => ({
23115
+ ...host2,
22480
23116
  framework: "angular"
22481
23117
  }))
22482
23118
  ];
22483
23119
  setSpaRouteManifest(spaRouteHosts);
22484
- writeFileSync8(join36(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
23120
+ writeFileSync8(join38(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
22485
23121
  if (isIncremental) {
22486
23122
  writeBuildTrace(buildPath);
22487
23123
  return {
@@ -22490,9 +23126,9 @@ ${content.slice(firstUseIdx)}`;
22490
23126
  manifest
22491
23127
  };
22492
23128
  }
22493
- writeFileSync8(join36(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
23129
+ writeFileSync8(join38(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
22494
23130
  if (Object.keys(conventionsMap).length > 0) {
22495
- writeFileSync8(join36(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
23131
+ writeFileSync8(join38(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
22496
23132
  }
22497
23133
  writeBuildTrace(buildPath);
22498
23134
  if (mode === "production") {
@@ -22563,6 +23199,7 @@ var init_build = __esm(() => {
22563
23199
  init_logger();
22564
23200
  init_validateSafePath();
22565
23201
  init_spaRouteManifest();
23202
+ init_pwa();
22566
23203
  REACT_VENDOR_SPECIFIERS = [
22567
23204
  "react-dom/client",
22568
23205
  "react-refresh/runtime",
@@ -22625,8 +23262,8 @@ var init_build = __esm(() => {
22625
23262
 
22626
23263
  // src/build/buildEmberVendor.ts
22627
23264
  import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
22628
- import { join as join37 } from "path";
22629
- import { rm as rm9 } from "fs/promises";
23265
+ import { join as join39 } from "path";
23266
+ import { rm as rm10 } from "fs/promises";
22630
23267
  var {build: bunBuild8 } = globalThis.Bun;
22631
23268
  var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
22632
23269
  // implementations for macros that would normally be replaced at
@@ -22677,7 +23314,7 @@ export const importSync = (specifier) => {
22677
23314
  if (standaloneSpecifiers.has(specifier)) {
22678
23315
  return { resolveTo: specifier, specifier };
22679
23316
  }
22680
- const emberInternalPath = join37(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
23317
+ const emberInternalPath = join39(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
22681
23318
  if (!existsSync28(emberInternalPath)) {
22682
23319
  throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
22683
23320
  }
@@ -22709,7 +23346,7 @@ export const importSync = (specifier) => {
22709
23346
  if (standalonePackages.has(args.path)) {
22710
23347
  return;
22711
23348
  }
22712
- const internal = join37(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
23349
+ const internal = join39(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
22713
23350
  if (existsSync28(internal)) {
22714
23351
  return { path: internal };
22715
23352
  }
@@ -22717,16 +23354,16 @@ export const importSync = (specifier) => {
22717
23354
  });
22718
23355
  }
22719
23356
  }), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
22720
- const vendorDir = join37(buildDir, "ember", "vendor");
23357
+ const vendorDir = join39(buildDir, "ember", "vendor");
22721
23358
  mkdirSync13(vendorDir, { recursive: true });
22722
- const tmpDir = join37(buildDir, "_ember_vendor_tmp");
23359
+ const tmpDir = join39(buildDir, "_ember_vendor_tmp");
22723
23360
  mkdirSync13(tmpDir, { recursive: true });
22724
- const macrosShimPath = join37(tmpDir, "embroider_macros_shim.js");
23361
+ const macrosShimPath = join39(tmpDir, "embroider_macros_shim.js");
22725
23362
  await Bun.write(macrosShimPath, generateMacrosShim());
22726
23363
  const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
22727
23364
  const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
22728
23365
  const safeName = toSafeFileName5(resolution.specifier);
22729
- const entryPath = join37(tmpDir, `${safeName}.js`);
23366
+ const entryPath = join39(tmpDir, `${safeName}.js`);
22730
23367
  const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
22731
23368
  ` : generateVendorEntrySource2(resolution);
22732
23369
  await Bun.write(entryPath, source);
@@ -22743,7 +23380,7 @@ export const importSync = (specifier) => {
22743
23380
  target: "browser",
22744
23381
  throw: false
22745
23382
  });
22746
- await rm9(tmpDir, { force: true, recursive: true });
23383
+ await rm10(tmpDir, { force: true, recursive: true });
22747
23384
  if (!result.success) {
22748
23385
  console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
22749
23386
  }
@@ -22882,9 +23519,9 @@ __export(exports_dependencyGraph, {
22882
23519
  buildInitialDependencyGraph: () => buildInitialDependencyGraph,
22883
23520
  addFileToGraph: () => addFileToGraph
22884
23521
  });
22885
- import { existsSync as existsSync29, readFileSync as readFileSync22 } from "fs";
23522
+ import { existsSync as existsSync29, readFileSync as readFileSync23 } from "fs";
22886
23523
  var {Glob: Glob9 } = globalThis.Bun;
22887
- import { resolve as resolve27 } from "path";
23524
+ import { resolve as resolve28 } from "path";
22888
23525
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
22889
23526
  const lower = filePath.toLowerCase();
22890
23527
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -22898,8 +23535,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
22898
23535
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
22899
23536
  return null;
22900
23537
  }
22901
- const fromDir = resolve27(fromFile, "..");
22902
- const normalized = resolve27(fromDir, importPath);
23538
+ const fromDir = resolve28(fromFile, "..");
23539
+ const normalized = resolve28(fromDir, importPath);
22903
23540
  const extensions = [
22904
23541
  ".ts",
22905
23542
  ".tsx",
@@ -22929,7 +23566,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
22929
23566
  dependents.delete(normalizedPath);
22930
23567
  }
22931
23568
  }, addFileToGraph = (graph, filePath) => {
22932
- const normalizedPath = resolve27(filePath);
23569
+ const normalizedPath = resolve28(filePath);
22933
23570
  if (!existsSync29(normalizedPath))
22934
23571
  return;
22935
23572
  const dependencies = extractDependencies(normalizedPath);
@@ -22956,10 +23593,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
22956
23593
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
22957
23594
  const processedFiles = new Set;
22958
23595
  const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
22959
- const resolvedDirs = directories.map((dir) => resolve27(dir)).filter((dir) => existsSync29(dir));
23596
+ const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync29(dir));
22960
23597
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
22961
23598
  for (const file4 of allFiles) {
22962
- const fullPath = resolve27(file4);
23599
+ const fullPath = resolve28(file4);
22963
23600
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
22964
23601
  continue;
22965
23602
  if (processedFiles.has(fullPath))
@@ -23053,15 +23690,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23053
23690
  const lowerPath = filePath.toLowerCase();
23054
23691
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
23055
23692
  if (loader === "html") {
23056
- const content = readFileSync22(filePath, "utf-8");
23693
+ const content = readFileSync23(filePath, "utf-8");
23057
23694
  return extractHtmlDependencies(filePath, content);
23058
23695
  }
23059
23696
  if (loader === "tsx" || loader === "js") {
23060
- const content = readFileSync22(filePath, "utf-8");
23697
+ const content = readFileSync23(filePath, "utf-8");
23061
23698
  return extractJsDependencies(filePath, content, loader);
23062
23699
  }
23063
23700
  if (isSvelteOrVue) {
23064
- const content = readFileSync22(filePath, "utf-8");
23701
+ const content = readFileSync23(filePath, "utf-8");
23065
23702
  return extractSvelteVueDependencies(filePath, content);
23066
23703
  }
23067
23704
  return [];
@@ -23072,7 +23709,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23072
23709
  return [];
23073
23710
  }
23074
23711
  }, getAffectedFiles = (graph, changedFile) => {
23075
- const normalizedPath = resolve27(changedFile);
23712
+ const normalizedPath = resolve28(changedFile);
23076
23713
  const affected = new Set;
23077
23714
  const toProcess = [normalizedPath];
23078
23715
  const processNode = (current) => {
@@ -23103,7 +23740,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23103
23740
  }, removeDependentsForFile = (graph, normalizedPath) => {
23104
23741
  graph.dependents.delete(normalizedPath);
23105
23742
  }, removeFileFromGraph = (graph, filePath) => {
23106
- const normalizedPath = resolve27(filePath);
23743
+ const normalizedPath = resolve28(filePath);
23107
23744
  removeDepsForFile(graph, normalizedPath);
23108
23745
  removeDependentsForFile(graph, normalizedPath);
23109
23746
  };
@@ -23146,12 +23783,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
23146
23783
  };
23147
23784
 
23148
23785
  // src/dev/configResolver.ts
23149
- import { resolve as resolve28 } from "path";
23786
+ import { resolve as resolve29 } from "path";
23150
23787
  var resolveBuildPaths = (config) => {
23151
23788
  const cwd2 = process.cwd();
23152
23789
  const normalize = (path) => path.replace(/\\/g, "/");
23153
- const withDefault = (value, fallback) => normalize(resolve28(cwd2, value ?? fallback));
23154
- const optional = (value) => value ? normalize(resolve28(cwd2, value)) : undefined;
23790
+ const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
23791
+ const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
23155
23792
  return {
23156
23793
  angularDir: optional(config.angularDirectory),
23157
23794
  assetsDir: optional(config.assetsDirectory),
@@ -23174,6 +23811,7 @@ var init_configResolver = () => {};
23174
23811
  var createHMRState = (config) => ({
23175
23812
  activeFrameworks: new Set,
23176
23813
  assetStore: new Map,
23814
+ clientTargets: new Map,
23177
23815
  config,
23178
23816
  connectedClients: new Set,
23179
23817
  debounceTimeout: null,
@@ -23208,8 +23846,8 @@ var init_clientManager = __esm(() => {
23208
23846
  });
23209
23847
 
23210
23848
  // src/dev/pathUtils.ts
23211
- import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync23 } from "fs";
23212
- import { dirname as dirname20, resolve as resolve29 } from "path";
23849
+ import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync24 } from "fs";
23850
+ import { dirname as dirname22, resolve as resolve30 } from "path";
23213
23851
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23214
23852
  if (shouldIgnorePath(filePath, resolved)) {
23215
23853
  return "ignored";
@@ -23285,7 +23923,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23285
23923
  return "unknown";
23286
23924
  }, collectAngularResourceDirs = (angularDir) => {
23287
23925
  const out = new Set;
23288
- const angularRoot = resolve29(angularDir);
23926
+ const angularRoot = resolve30(angularDir);
23289
23927
  const angularRootNormalized = normalizePath(angularRoot);
23290
23928
  const walk = (dir) => {
23291
23929
  let entries;
@@ -23298,7 +23936,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23298
23936
  if (entry.name.startsWith(".") || entry.name === "node_modules") {
23299
23937
  continue;
23300
23938
  }
23301
- const full = resolve29(dir, entry.name);
23939
+ const full = resolve30(dir, entry.name);
23302
23940
  if (entry.isDirectory()) {
23303
23941
  walk(full);
23304
23942
  continue;
@@ -23308,7 +23946,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23308
23946
  }
23309
23947
  let source;
23310
23948
  try {
23311
- source = readFileSync23(full, "utf8");
23949
+ source = readFileSync24(full, "utf8");
23312
23950
  } catch {
23313
23951
  continue;
23314
23952
  }
@@ -23337,10 +23975,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23337
23975
  refs.push(strMatch[1]);
23338
23976
  }
23339
23977
  }
23340
- const componentDir = dirname20(full);
23978
+ const componentDir = dirname22(full);
23341
23979
  for (const ref of refs) {
23342
- const refAbs = normalizePath(resolve29(componentDir, ref));
23343
- const refDir = normalizePath(dirname20(refAbs));
23980
+ const refAbs = normalizePath(resolve30(componentDir, ref));
23981
+ const refDir = normalizePath(dirname22(refAbs));
23344
23982
  if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
23345
23983
  continue;
23346
23984
  }
@@ -23356,7 +23994,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23356
23994
  const push = (path) => {
23357
23995
  if (!path)
23358
23996
  return;
23359
- const abs = normalizePath(resolve29(cwd2, path));
23997
+ const abs = normalizePath(resolve30(cwd2, path));
23360
23998
  if (!roots.includes(abs))
23361
23999
  roots.push(abs);
23362
24000
  };
@@ -23381,7 +24019,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23381
24019
  push(cfg.assetsDir);
23382
24020
  push(cfg.stylesDir);
23383
24021
  for (const candidate of ["src", "db", "assets", "styles"]) {
23384
- const abs = normalizePath(resolve29(cwd2, candidate));
24022
+ const abs = normalizePath(resolve30(cwd2, candidate));
23385
24023
  if (existsSync30(abs) && !roots.includes(abs))
23386
24024
  roots.push(abs);
23387
24025
  }
@@ -23392,7 +24030,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
23392
24030
  continue;
23393
24031
  if (entry.name.startsWith("."))
23394
24032
  continue;
23395
- const abs = normalizePath(resolve29(cwd2, entry.name));
24033
+ const abs = normalizePath(resolve30(cwd2, entry.name));
23396
24034
  if (roots.includes(abs))
23397
24035
  continue;
23398
24036
  if (shouldIgnorePath(abs, resolved))
@@ -23476,7 +24114,7 @@ var init_pathUtils = __esm(() => {
23476
24114
  // src/dev/fileWatcher.ts
23477
24115
  import { watch } from "fs";
23478
24116
  import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
23479
- import { dirname as dirname21, join as join38, resolve as resolve30 } from "path";
24117
+ import { dirname as dirname23, join as join40, resolve as resolve31 } from "path";
23480
24118
  var safeRemoveFromGraph = (graph, fullPath) => {
23481
24119
  try {
23482
24120
  removeFileFromGraph(graph, fullPath);
@@ -23508,7 +24146,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
23508
24146
  for (const name of entries) {
23509
24147
  if (shouldSkipFilename(name, isStylesDir))
23510
24148
  continue;
23511
- const child = join38(eventDir, name).replace(/\\/g, "/");
24149
+ const child = join40(eventDir, name).replace(/\\/g, "/");
23512
24150
  let st2;
23513
24151
  try {
23514
24152
  st2 = statSync4(child);
@@ -23529,7 +24167,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
23529
24167
  return;
23530
24168
  if (shouldSkipFilename(filename, isStylesDir)) {
23531
24169
  if (event === "rename") {
23532
- const eventDir = dirname21(join38(absolutePath, filename)).replace(/\\/g, "/");
24170
+ const eventDir = dirname23(join40(absolutePath, filename)).replace(/\\/g, "/");
23533
24171
  atomicRecoveryScan(eventDir);
23534
24172
  for (const delay of [25, 100]) {
23535
24173
  const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
@@ -23538,7 +24176,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
23538
24176
  }
23539
24177
  return;
23540
24178
  }
23541
- const fullPath = join38(absolutePath, filename).replace(/\\/g, "/");
24179
+ const fullPath = join40(absolutePath, filename).replace(/\\/g, "/");
23542
24180
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
23543
24181
  return;
23544
24182
  }
@@ -23556,7 +24194,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
23556
24194
  }, addFileWatchers = (state, paths, onFileChange) => {
23557
24195
  const stylesDir = state.resolvedPaths?.stylesDir;
23558
24196
  paths.forEach((path) => {
23559
- const absolutePath = resolve30(path).replace(/\\/g, "/");
24197
+ const absolutePath = resolve31(path).replace(/\\/g, "/");
23560
24198
  if (!existsSync31(absolutePath)) {
23561
24199
  return;
23562
24200
  }
@@ -23567,7 +24205,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
23567
24205
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
23568
24206
  const stylesDir = state.resolvedPaths?.stylesDir;
23569
24207
  watchPaths.forEach((path) => {
23570
- const absolutePath = resolve30(path).replace(/\\/g, "/");
24208
+ const absolutePath = resolve31(path).replace(/\\/g, "/");
23571
24209
  if (!existsSync31(absolutePath)) {
23572
24210
  return;
23573
24211
  }
@@ -23586,13 +24224,13 @@ var init_fileWatcher = __esm(() => {
23586
24224
  });
23587
24225
 
23588
24226
  // src/dev/assetStore.ts
23589
- import { resolve as resolve31 } from "path";
24227
+ import { resolve as resolve32 } from "path";
23590
24228
  import { readdir as readdir4, unlink } from "fs/promises";
23591
24229
  var mimeTypes, getMimeType = (filePath) => {
23592
24230
  const ext = filePath.slice(filePath.lastIndexOf("."));
23593
24231
  return mimeTypes[ext] ?? "application/octet-stream";
23594
24232
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
23595
- const fullPath = resolve31(dir, entry.name);
24233
+ const fullPath = resolve32(dir, entry.name);
23596
24234
  if (entry.isDirectory()) {
23597
24235
  return walkAndClean(fullPath);
23598
24236
  }
@@ -23608,10 +24246,10 @@ var mimeTypes, getMimeType = (filePath) => {
23608
24246
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
23609
24247
  const liveByIdentity = new Map;
23610
24248
  for (const webPath of store.keys()) {
23611
- const diskPath = resolve31(buildDir, webPath.slice(1));
24249
+ const diskPath = resolve32(buildDir, webPath.slice(1));
23612
24250
  liveByIdentity.set(stripHash(diskPath), diskPath);
23613
24251
  }
23614
- const absBuildDir = resolve31(buildDir);
24252
+ const absBuildDir = resolve32(buildDir);
23615
24253
  Object.values(manifest).forEach((val) => {
23616
24254
  if (!HASHED_FILE_RE.test(val))
23617
24255
  return;
@@ -23629,7 +24267,7 @@ var mimeTypes, getMimeType = (filePath) => {
23629
24267
  } catch {}
23630
24268
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
23631
24269
  if (entry.isDirectory()) {
23632
- return scanDir(resolve31(dir, entry.name), `${prefix}${entry.name}/`);
24270
+ return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
23633
24271
  }
23634
24272
  if (!entry.name.startsWith("chunk-")) {
23635
24273
  return null;
@@ -23638,7 +24276,7 @@ var mimeTypes, getMimeType = (filePath) => {
23638
24276
  if (store.has(webPath)) {
23639
24277
  return null;
23640
24278
  }
23641
- return Bun.file(resolve31(dir, entry.name)).bytes().then((bytes) => {
24279
+ return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
23642
24280
  store.set(webPath, bytes);
23643
24281
  return;
23644
24282
  }).catch(() => {});
@@ -23660,7 +24298,7 @@ var mimeTypes, getMimeType = (filePath) => {
23660
24298
  for (const webPath of newIdentities.values()) {
23661
24299
  if (store.has(webPath))
23662
24300
  continue;
23663
- loadPromises.push(Bun.file(resolve31(buildDir, webPath.slice(1))).bytes().then((bytes) => {
24301
+ loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
23664
24302
  store.set(webPath, bytes);
23665
24303
  return;
23666
24304
  }).catch(() => {}));
@@ -23705,8 +24343,8 @@ var init_assetStore = __esm(() => {
23705
24343
  });
23706
24344
 
23707
24345
  // src/islands/pageMetadata.ts
23708
- import { readFileSync as readFileSync24 } from "fs";
23709
- import { dirname as dirname22, resolve as resolve32 } from "path";
24346
+ import { readFileSync as readFileSync25 } from "fs";
24347
+ import { dirname as dirname24, resolve as resolve33 } from "path";
23710
24348
  var pagePatterns, getPageDirs = (config) => [
23711
24349
  { dir: config.angularDirectory, framework: "angular" },
23712
24350
  { dir: config.emberDirectory, framework: "ember" },
@@ -23726,15 +24364,15 @@ var pagePatterns, getPageDirs = (config) => [
23726
24364
  const source = definition.buildReference?.source;
23727
24365
  if (!source)
23728
24366
  continue;
23729
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve32(dirname22(buildInfo.resolvedRegistryPath), source);
23730
- lookup.set(`${definition.framework}:${definition.component}`, resolve32(resolvedSource));
24367
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve33(dirname24(buildInfo.resolvedRegistryPath), source);
24368
+ lookup.set(`${definition.framework}:${definition.component}`, resolve33(resolvedSource));
23731
24369
  }
23732
24370
  return lookup;
23733
24371
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
23734
24372
  const candidate = usage.source;
23735
- return candidate ? resolve32(candidate) === target : false;
24373
+ return candidate ? resolve33(candidate) === target : false;
23736
24374
  }), getPagesUsingIslandSource = (sourcePath) => {
23737
- const target = resolve32(sourcePath);
24375
+ const target = resolve33(sourcePath);
23738
24376
  return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
23739
24377
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
23740
24378
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
@@ -23746,13 +24384,13 @@ var pagePatterns, getPageDirs = (config) => [
23746
24384
  const pattern = pagePatterns[entry.framework];
23747
24385
  if (!pattern)
23748
24386
  return;
23749
- const files = await scanEntryPoints(resolve32(entry.dir), pattern);
24387
+ const files = await scanEntryPoints(resolve33(entry.dir), pattern);
23750
24388
  for (const filePath of files) {
23751
- const source = readFileSync24(filePath, "utf-8");
24389
+ const source = readFileSync25(filePath, "utf-8");
23752
24390
  const islands = extractIslandUsagesFromSource(source);
23753
- pageMetadata.set(resolve32(filePath), {
24391
+ pageMetadata.set(resolve33(filePath), {
23754
24392
  islands: resolveIslandUsages(islands, islandSourceLookup),
23755
- pagePath: resolve32(filePath)
24393
+ pagePath: resolve33(filePath)
23756
24394
  });
23757
24395
  }
23758
24396
  }, loadPageIslandMetadata = async (config) => {
@@ -23779,10 +24417,10 @@ var init_pageMetadata = __esm(() => {
23779
24417
  });
23780
24418
 
23781
24419
  // src/dev/fileHashTracker.ts
23782
- import { readFileSync as readFileSync25 } from "fs";
24420
+ import { readFileSync as readFileSync26 } from "fs";
23783
24421
  var computeFileHash = (filePath) => {
23784
24422
  try {
23785
- const fileContent = readFileSync25(filePath);
24423
+ const fileContent = readFileSync26(filePath);
23786
24424
  return Number(Bun.hash(fileContent));
23787
24425
  } catch {
23788
24426
  return UNFOUND_INDEX;
@@ -23818,9 +24456,9 @@ var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.conten
23818
24456
  set.add(filePath);
23819
24457
  }
23820
24458
  }, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
23821
- const component = [...parents].find(isComponentFile);
23822
- if (component !== undefined)
23823
- return component;
24459
+ const component2 = [...parents].find(isComponentFile);
24460
+ if (component2 !== undefined)
24461
+ return component2;
23824
24462
  for (const parent of parents)
23825
24463
  queue.push(parent);
23826
24464
  return;
@@ -23875,9 +24513,9 @@ var init_transformCache = __esm(() => {
23875
24513
  });
23876
24514
 
23877
24515
  // src/dev/reactComponentClassifier.ts
23878
- import { resolve as resolve33 } from "path";
24516
+ import { resolve as resolve34 } from "path";
23879
24517
  var classifyComponent = (filePath) => {
23880
- const normalizedPath = resolve33(filePath);
24518
+ const normalizedPath = resolve34(filePath);
23881
24519
  if (normalizedPath.includes("/react/pages/")) {
23882
24520
  return "server";
23883
24521
  }
@@ -23889,7 +24527,7 @@ var classifyComponent = (filePath) => {
23889
24527
  var init_reactComponentClassifier = () => {};
23890
24528
 
23891
24529
  // src/dev/moduleMapper.ts
23892
- import { basename as basename15, resolve as resolve34 } from "path";
24530
+ import { basename as basename15, resolve as resolve35 } from "path";
23893
24531
  var buildModulePaths = (moduleKeys, manifest) => {
23894
24532
  const modulePaths = {};
23895
24533
  moduleKeys.forEach((key) => {
@@ -23899,7 +24537,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
23899
24537
  });
23900
24538
  return modulePaths;
23901
24539
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
23902
- const normalizedFile = resolve34(sourceFile);
24540
+ const normalizedFile = resolve35(sourceFile);
23903
24541
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
23904
24542
  if (processedFiles.has(normalizedFile)) {
23905
24543
  return null;
@@ -23935,7 +24573,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
23935
24573
  });
23936
24574
  return grouped;
23937
24575
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
23938
- const normalizedFile = resolve34(sourceFile);
24576
+ const normalizedFile = resolve35(sourceFile);
23939
24577
  const fileName = basename15(normalizedFile);
23940
24578
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
23941
24579
  const pascalName = toPascal(baseName);
@@ -23991,7 +24629,7 @@ var init_moduleMapper = __esm(() => {
23991
24629
 
23992
24630
  // src/utils/spaRouteCss.ts
23993
24631
  import { readFile as readFile6 } from "fs/promises";
23994
- import { dirname as dirname23, isAbsolute as isAbsolute5, resolve as resolve35 } from "path";
24632
+ import { dirname as dirname25, isAbsolute as isAbsolute5, resolve as resolve36 } from "path";
23995
24633
  var sideManifestCache, readSideManifest = async (sideManifestPath) => {
23996
24634
  const cached = sideManifestCache.get(sideManifestPath);
23997
24635
  if (cached !== undefined)
@@ -24029,7 +24667,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
24029
24667
  }, readChildCss = async (cssPath, sideManifestPath) => {
24030
24668
  if (!cssPath)
24031
24669
  return "";
24032
- const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve35(dirname23(sideManifestPath), cssPath);
24670
+ const resolvedCssPath = isAbsolute5(cssPath) ? cssPath : resolve36(dirname25(sideManifestPath), cssPath);
24033
24671
  const cached = childCssCache.get(resolvedCssPath);
24034
24672
  if (cached !== undefined)
24035
24673
  return cached;
@@ -24112,8 +24750,8 @@ __export(exports_resolveOwningComponents, {
24112
24750
  resolveDescendantsOfParent: () => resolveDescendantsOfParent,
24113
24751
  invalidateResourceIndex: () => invalidateResourceIndex
24114
24752
  });
24115
- import { readdirSync as readdirSync8, readFileSync as readFileSync26, statSync as statSync5 } from "fs";
24116
- import { dirname as dirname24, extname as extname11, join as join39, resolve as resolve36 } from "path";
24753
+ import { readdirSync as readdirSync8, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
24754
+ import { dirname as dirname26, extname as extname11, join as join41, resolve as resolve37 } from "path";
24117
24755
  import ts18 from "typescript";
24118
24756
  var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
24119
24757
  const out = [];
@@ -24128,7 +24766,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24128
24766
  if (entry.name.startsWith(".") || entry.name === "node_modules") {
24129
24767
  continue;
24130
24768
  }
24131
- const full = join39(dir, entry.name);
24769
+ const full = join41(dir, entry.name);
24132
24770
  if (entry.isDirectory()) {
24133
24771
  visit(full);
24134
24772
  } else if (entry.isFile() && isAngularSourceFile(entry.name)) {
@@ -24172,7 +24810,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24172
24810
  }, parseDecoratedClasses = (filePath) => {
24173
24811
  let source;
24174
24812
  try {
24175
- source = readFileSync26(filePath, "utf8");
24813
+ source = readFileSync27(filePath, "utf8");
24176
24814
  } catch {
24177
24815
  return [];
24178
24816
  }
@@ -24226,7 +24864,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24226
24864
  };
24227
24865
  visit(sourceFile);
24228
24866
  return out;
24229
- }, safeNormalize = (path) => resolve36(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
24867
+ }, safeNormalize = (path) => resolve37(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
24230
24868
  const { changedFilePath, userAngularRoot } = params;
24231
24869
  const changedAbs = safeNormalize(changedFilePath);
24232
24870
  const out = [];
@@ -24262,12 +24900,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24262
24900
  }, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
24263
24901
  let source;
24264
24902
  try {
24265
- source = readFileSync26(childFilePath, "utf8");
24903
+ source = readFileSync27(childFilePath, "utf8");
24266
24904
  } catch {
24267
24905
  return null;
24268
24906
  }
24269
24907
  const sourceFile = ts18.createSourceFile(childFilePath, source, ts18.ScriptTarget.ES2022, true, ts18.ScriptKind.TS);
24270
- const childDir = dirname24(childFilePath);
24908
+ const childDir = dirname26(childFilePath);
24271
24909
  for (const stmt of sourceFile.statements) {
24272
24910
  if (!ts18.isImportDeclaration(stmt))
24273
24911
  continue;
@@ -24295,7 +24933,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24295
24933
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
24296
24934
  return null;
24297
24935
  }
24298
- const base = resolve36(childDir, spec);
24936
+ const base = resolve37(childDir, spec);
24299
24937
  const candidates = [
24300
24938
  `${base}.ts`,
24301
24939
  `${base}.tsx`,
@@ -24324,7 +24962,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24324
24962
  const parentFile = new Map;
24325
24963
  for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
24326
24964
  const classes = parseDecoratedClasses(tsPath);
24327
- const componentDir = dirname24(tsPath);
24965
+ const componentDir = dirname26(tsPath);
24328
24966
  for (const cls of classes) {
24329
24967
  const entity = {
24330
24968
  className: cls.className,
@@ -24333,7 +24971,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
24333
24971
  };
24334
24972
  if (cls.kind === "component") {
24335
24973
  for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
24336
- const abs = safeNormalize(resolve36(componentDir, url));
24974
+ const abs = safeNormalize(resolve37(componentDir, url));
24337
24975
  const existing = resource.get(abs);
24338
24976
  if (existing)
24339
24977
  existing.push(entity);
@@ -24460,6 +25098,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
24460
25098
  });
24461
25099
  clientsToRemove.forEach((client) => {
24462
25100
  state.connectedClients.delete(client);
25101
+ state.clientTargets.delete(client);
24463
25102
  });
24464
25103
  }, handleClientConnect = (state, client, manifest) => {
24465
25104
  state.connectedClients.add(client);
@@ -24500,6 +25139,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
24500
25139
  }
24501
25140
  }, handleClientDisconnect = (state, client) => {
24502
25141
  state.connectedClients.delete(client);
25142
+ state.clientTargets.delete(client);
24503
25143
  }, parseJsonSafe = (raw) => JSON.parse(raw), parseMessage = (message) => {
24504
25144
  if (typeof message === "string") {
24505
25145
  return parseJsonSafe(message);
@@ -24529,11 +25169,13 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
24529
25169
  case "request-rebuild":
24530
25170
  break;
24531
25171
  case "ready":
25172
+ state.clientTargets.set(client, normalizedHmrTarget(data.target));
24532
25173
  if (data.framework) {
24533
25174
  state.activeFrameworks.add(data.framework);
24534
25175
  }
24535
25176
  break;
24536
25177
  case "hmr-timing": {
25178
+ state.clientTargets.set(client, normalizedHmrTarget(data.target));
24537
25179
  const update = typeof data.updateId === "number" ? state.hmrUpdates.get(data.updateId) : undefined;
24538
25180
  logHmrClientUpdate(update?.path ?? state.lastHmrPath ?? "", update?.framework ?? state.lastHmrFramework, data.duration, normalizedHmrTarget(data.target), data.serverMs, data.clientMs, data.outcome, data.kind);
24539
25181
  sendTelemetryEvent("hmr:client-applied", {
@@ -24589,7 +25231,7 @@ __export(exports_loadConfig, {
24589
25231
  isWorkspaceConfig: () => isWorkspaceConfig,
24590
25232
  getWorkspaceServices: () => getWorkspaceServices
24591
25233
  });
24592
- import { resolve as resolve37 } from "path";
25234
+ import { resolve as resolve38 } from "path";
24593
25235
  var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
24594
25236
  if (!isObject2(config)) {
24595
25237
  return false;
@@ -24640,7 +25282,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
24640
25282
  }
24641
25283
  return config;
24642
25284
  }, loadRawConfig = async (configPath2) => {
24643
- const resolved = resolve37(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
25285
+ const resolved = resolve38(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
24644
25286
  const mod = await import(resolved);
24645
25287
  const config = mod.default ?? mod.config;
24646
25288
  if (!config) {
@@ -24702,8 +25344,8 @@ __export(exports_moduleServer, {
24702
25344
  createModuleServer: () => createModuleServer,
24703
25345
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
24704
25346
  });
24705
- import { existsSync as existsSync32, readFileSync as readFileSync27, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
24706
- import { basename as basename16, dirname as dirname25, extname as extname12, join as join40, resolve as resolve38, relative as relative16 } from "path";
25347
+ import { existsSync as existsSync32, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
25348
+ import { basename as basename16, dirname as dirname27, extname as extname12, join as join42, resolve as resolve39, relative as relative16 } from "path";
24707
25349
  var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
24708
25350
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
24709
25351
  const allExports = [];
@@ -24723,10 +25365,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
24723
25365
  ${stubs}
24724
25366
  `;
24725
25367
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
24726
- const directHit = extensions.find((ext) => existsSync32(resolve38(projectRoot, srcPath + ext)));
25368
+ const directHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath + ext)));
24727
25369
  if (directHit)
24728
25370
  return srcPath + directHit;
24729
- const indexHit = extensions.find((ext) => existsSync32(resolve38(projectRoot, srcPath, `index${ext}`)));
25371
+ const indexHit = extensions.find((ext) => existsSync32(resolve39(projectRoot, srcPath, `index${ext}`)));
24730
25372
  if (indexHit)
24731
25373
  return `${srcPath}/index${indexHit}`;
24732
25374
  return srcPath;
@@ -24749,7 +25391,7 @@ ${stubs}
24749
25391
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
24750
25392
  }, srcUrl = (relPath, projectRoot) => {
24751
25393
  const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
24752
- const absPath = resolve38(projectRoot, relPath);
25394
+ const absPath = resolve39(projectRoot, relPath);
24753
25395
  const cached = mtimeCache.get(absPath);
24754
25396
  if (cached !== undefined)
24755
25397
  return `${base}?v=${buildVersion(cached, absPath)}`;
@@ -24761,12 +25403,12 @@ ${stubs}
24761
25403
  return base;
24762
25404
  }
24763
25405
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
24764
- const absPath = resolve38(fileDir, relPath);
25406
+ const absPath = resolve39(fileDir, relPath);
24765
25407
  const rel = relative16(projectRoot, absPath);
24766
25408
  const extension = extname12(rel);
24767
25409
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
24768
25410
  if (extname12(srcPath) === ".svelte") {
24769
- srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve38(projectRoot, srcPath)));
25411
+ srcPath = relative16(projectRoot, resolveSvelteModulePath(resolve39(projectRoot, srcPath)));
24770
25412
  }
24771
25413
  return srcUrl(srcPath, projectRoot);
24772
25414
  }, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -24785,13 +25427,13 @@ ${stubs}
24785
25427
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
24786
25428
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
24787
25429
  if (!subpath) {
24788
- const pkgDir = resolve38(projectRoot, "node_modules", packageName ?? "");
24789
- const pkgJsonPath = join40(pkgDir, "package.json");
25430
+ const pkgDir = resolve39(projectRoot, "node_modules", packageName ?? "");
25431
+ const pkgJsonPath = join42(pkgDir, "package.json");
24790
25432
  if (existsSync32(pkgJsonPath)) {
24791
- const pkg = JSON.parse(readFileSync27(pkgJsonPath, "utf-8"));
25433
+ const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
24792
25434
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
24793
25435
  if (esmEntry) {
24794
- const resolved = resolve38(pkgDir, esmEntry);
25436
+ const resolved = resolve39(pkgDir, esmEntry);
24795
25437
  if (existsSync32(resolved))
24796
25438
  return relative16(projectRoot, resolved);
24797
25439
  }
@@ -24829,7 +25471,7 @@ ${stubs}
24829
25471
  };
24830
25472
  result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
24831
25473
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
24832
- const fileDir = dirname25(filePath);
25474
+ const fileDir = dirname27(filePath);
24833
25475
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
24834
25476
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
24835
25477
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
@@ -24844,12 +25486,12 @@ ${stubs}
24844
25486
  result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
24845
25487
  result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
24846
25488
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
24847
- const absPath = resolve38(fileDir, relPath);
25489
+ const absPath = resolve39(fileDir, relPath);
24848
25490
  const rel = relative16(projectRoot, absPath);
24849
25491
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
24850
25492
  });
24851
25493
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
24852
- const absPath = resolve38(fileDir, relPath);
25494
+ const absPath = resolve39(fileDir, relPath);
24853
25495
  const rel = relative16(projectRoot, absPath);
24854
25496
  return `'${srcUrl(rel, projectRoot)}'`;
24855
25497
  });
@@ -24895,7 +25537,7 @@ ${code}`;
24895
25537
  reactFastRefreshWarningEmitted = true;
24896
25538
  logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a targeted " + "page remount instead of a state-preserving fast refresh.");
24897
25539
  }, transformReactFile = (filePath, projectRoot, rewriter) => {
24898
- const raw = readFileSync27(filePath, "utf-8");
25540
+ const raw = readFileSync28(filePath, "utf-8");
24899
25541
  const valueExports = tsxTranspiler.scan(raw).exports;
24900
25542
  let transpiled = reactTranspiler.transformSync(raw);
24901
25543
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -24911,7 +25553,7 @@ ${transpiled}`;
24911
25553
  transpiled += buildIslandMetadataExports(raw);
24912
25554
  return rewriteImports(transpiled, filePath, projectRoot, rewriter);
24913
25555
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
24914
- const raw = readFileSync27(filePath, "utf-8");
25556
+ const raw = readFileSync28(filePath, "utf-8");
24915
25557
  const ext = extname12(filePath);
24916
25558
  const isTS = ext === ".ts" || ext === ".tsx";
24917
25559
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -25077,7 +25719,7 @@ ${code}`;
25077
25719
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
25078
25720
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
25079
25721
  }, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
25080
- const raw = readFileSync27(filePath, "utf-8");
25722
+ const raw = readFileSync28(filePath, "utf-8");
25081
25723
  if (!svelteCompiler) {
25082
25724
  svelteCompiler = await import("svelte/compiler");
25083
25725
  }
@@ -25143,7 +25785,7 @@ export default __script__;`;
25143
25785
  return `${cssInjection}
25144
25786
  ${code}`;
25145
25787
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
25146
- const rawSource = readFileSync27(filePath, "utf-8");
25788
+ const rawSource = readFileSync28(filePath, "utf-8");
25147
25789
  const raw = addAutoRouterSetupApp(rawSource);
25148
25790
  if (!vueCompiler) {
25149
25791
  vueCompiler = await loadVueCompiler();
@@ -25156,7 +25798,7 @@ ${code}`;
25156
25798
  fs: {
25157
25799
  fileExists: existsSync32,
25158
25800
  realpath: realpathSync3,
25159
- readFile: (file4) => existsSync32(file4) ? readFileSync27(file4, "utf-8") : undefined
25801
+ readFile: (file4) => existsSync32(file4) ? readFileSync28(file4, "utf-8") : undefined
25160
25802
  },
25161
25803
  id: componentId,
25162
25804
  inlineTemplate: false
@@ -25171,7 +25813,7 @@ ${code}`;
25171
25813
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
25172
25814
  return rewriteImports(code, filePath, projectRoot, rewriter);
25173
25815
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
25174
- const hmrBase = vueDir ? resolve38(vueDir) : projectRoot;
25816
+ const hmrBase = vueDir ? resolve39(vueDir) : projectRoot;
25175
25817
  const hmrId = relative16(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
25176
25818
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
25177
25819
  result += [
@@ -25203,7 +25845,7 @@ ${code}`;
25203
25845
  }
25204
25846
  });
25205
25847
  }, handleCssRequest = (filePath) => {
25206
- const raw = readFileSync27(filePath, "utf-8");
25848
+ const raw = readFileSync28(filePath, "utf-8");
25207
25849
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
25208
25850
  return [
25209
25851
  `const style = document.createElement('style');`,
@@ -25335,7 +25977,7 @@ export default {};
25335
25977
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
25336
25978
  return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
25337
25979
  }, resolveSourcePath = (relPath, projectRoot) => {
25338
- const filePath = resolve38(projectRoot, relPath);
25980
+ const filePath = resolve39(projectRoot, relPath);
25339
25981
  const ext = extname12(filePath);
25340
25982
  if (ext === ".svelte")
25341
25983
  return { ext, filePath: resolveSvelteModulePath(filePath) };
@@ -25372,14 +26014,14 @@ export default {};
25372
26014
  const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
25373
26015
  const candidates = [
25374
26016
  absoluteCandidate,
25375
- resolve38(projectRoot, tail)
26017
+ resolve39(projectRoot, tail)
25376
26018
  ];
25377
26019
  try {
25378
26020
  const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
25379
26021
  const cfg = await loadConfig2();
25380
- const angularDir = cfg.angularDirectory && resolve38(projectRoot, cfg.angularDirectory);
26022
+ const angularDir = cfg.angularDirectory && resolve39(projectRoot, cfg.angularDirectory);
25381
26023
  if (angularDir)
25382
- candidates.push(resolve38(angularDir, tail));
26024
+ candidates.push(resolve39(angularDir, tail));
25383
26025
  } catch {}
25384
26026
  for (const candidate of candidates) {
25385
26027
  if (await fileExists(candidate)) {
@@ -25410,7 +26052,7 @@ export default {};
25410
26052
  if (!TRANSPILABLE.has(ext))
25411
26053
  return;
25412
26054
  const stat3 = statSync6(filePath);
25413
- const resolvedVueDir = vueDir ? resolve38(vueDir) : undefined;
26055
+ const resolvedVueDir = vueDir ? resolve39(vueDir) : undefined;
25414
26056
  let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
25415
26057
  const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
25416
26058
  if (isAngularGeneratedJs) {
@@ -25469,7 +26111,7 @@ export default {};
25469
26111
  const relPath = pathname.slice(SRC_PREFIX.length);
25470
26112
  if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
25471
26113
  return handleBunWrapRequest();
25472
- const virtualCssResponse = handleVirtualSvelteCss(resolve38(projectRoot, relPath));
26114
+ const virtualCssResponse = handleVirtualSvelteCss(resolve39(projectRoot, relPath));
25473
26115
  if (virtualCssResponse)
25474
26116
  return virtualCssResponse;
25475
26117
  const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
@@ -25485,11 +26127,11 @@ export default {};
25485
26127
  SRC_IMPORT_RE.lastIndex = 0;
25486
26128
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
25487
26129
  if (match[1])
25488
- files.push(resolve38(projectRoot, match[1]));
26130
+ files.push(resolve39(projectRoot, match[1]));
25489
26131
  }
25490
26132
  return files;
25491
26133
  }, invalidateModule = (filePath) => {
25492
- const resolved = resolve38(filePath);
26134
+ const resolved = resolve39(filePath);
25493
26135
  invalidate(filePath);
25494
26136
  if (resolved !== filePath)
25495
26137
  invalidate(resolved);
@@ -25652,7 +26294,7 @@ __export(exports_hmrCompiler, {
25652
26294
  getApplyMetadataModule: () => getApplyMetadataModule,
25653
26295
  encodeHmrComponentId: () => encodeHmrComponentId
25654
26296
  });
25655
- import { dirname as dirname26, relative as relative17, resolve as resolve39 } from "path";
26297
+ import { dirname as dirname28, relative as relative17, resolve as resolve40 } from "path";
25656
26298
  import { performance as performance2 } from "perf_hooks";
25657
26299
  var encodeHmrComponentId = (absoluteFilePath, className) => {
25658
26300
  const projectRel = relative17(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
@@ -25664,7 +26306,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
25664
26306
  return null;
25665
26307
  const filePathRel = decoded.slice(0, separatorIndex);
25666
26308
  const className = decoded.slice(separatorIndex + 1);
25667
- const componentFilePath = resolve39(process.cwd(), filePathRel);
26309
+ const componentFilePath = resolve40(process.cwd(), filePathRel);
25668
26310
  const projectRelPath = relative17(process.cwd(), componentFilePath).replace(/\\/g, "/");
25669
26311
  const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
25670
26312
  const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
@@ -25675,7 +26317,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
25675
26317
  const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
25676
26318
  const owners = resolveOwningComponents2({
25677
26319
  changedFilePath: componentFilePath,
25678
- userAngularRoot: dirname26(componentFilePath)
26320
+ userAngularRoot: dirname28(componentFilePath)
25679
26321
  });
25680
26322
  const owner = owners.find((o3) => o3.className === className);
25681
26323
  const kind = owner?.kind ?? "component";
@@ -25870,11 +26512,11 @@ var exports_simpleHTMLHMR = {};
25870
26512
  __export(exports_simpleHTMLHMR, {
25871
26513
  handleHTMLUpdate: () => handleHTMLUpdate
25872
26514
  });
25873
- import { resolve as resolve40 } from "path";
26515
+ import { resolve as resolve41 } from "path";
25874
26516
  var handleHTMLUpdate = async (htmlFilePath) => {
25875
26517
  let htmlContent;
25876
26518
  try {
25877
- const resolvedPath = resolve40(htmlFilePath);
26519
+ const resolvedPath = resolve41(htmlFilePath);
25878
26520
  const file4 = Bun.file(resolvedPath);
25879
26521
  if (!await file4.exists()) {
25880
26522
  return null;
@@ -25900,11 +26542,11 @@ var exports_simpleHTMXHMR = {};
25900
26542
  __export(exports_simpleHTMXHMR, {
25901
26543
  handleHTMXUpdate: () => handleHTMXUpdate
25902
26544
  });
25903
- import { resolve as resolve41 } from "path";
26545
+ import { resolve as resolve42 } from "path";
25904
26546
  var handleHTMXUpdate = async (htmxFilePath) => {
25905
26547
  let htmlContent;
25906
26548
  try {
25907
- const resolvedPath = resolve41(htmxFilePath);
26549
+ const resolvedPath = resolve42(htmxFilePath);
25908
26550
  const file4 = Bun.file(resolvedPath);
25909
26551
  if (!await file4.exists()) {
25910
26552
  return null;
@@ -25929,9 +26571,9 @@ var init_simpleHTMXHMR = () => {};
25929
26571
  import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
25930
26572
  import {
25931
26573
  basename as basename17,
25932
- dirname as dirname27,
26574
+ dirname as dirname29,
25933
26575
  isAbsolute as isAbsolute6,
25934
- join as join41,
26576
+ join as join43,
25935
26577
  relative as relative18,
25936
26578
  resolve as resolvePath,
25937
26579
  sep as sep4
@@ -26058,8 +26700,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26058
26700
  const relJs = `${rel.slice(0, -ext[0].length)}.js`;
26059
26701
  const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
26060
26702
  for (const candidate of [
26061
- join41(generatedDir, relJs),
26062
- `${join41(generatedDir, relJs)}.map`
26703
+ join43(generatedDir, relJs),
26704
+ `${join43(generatedDir, relJs)}.map`
26063
26705
  ]) {
26064
26706
  try {
26065
26707
  rmSync3(candidate, { force: true });
@@ -26293,8 +26935,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26293
26935
  const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
26294
26936
  const { buildDir } = state.resolvedPaths;
26295
26937
  const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
26296
- const { mkdir: mkdir8, copyFile, readFile: readFile7 } = await import("fs/promises");
26297
- await mkdir8(dirname27(destPath), { recursive: true });
26938
+ const { mkdir: mkdir9, copyFile, readFile: readFile7 } = await import("fs/promises");
26939
+ await mkdir9(dirname29(destPath), { recursive: true });
26298
26940
  await copyFile(absSource, destPath);
26299
26941
  const bytes = await readFile7(destPath);
26300
26942
  const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
@@ -26475,7 +27117,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26475
27117
  const keepStemsByDir = new Map;
26476
27118
  const prefixByDir = new Map;
26477
27119
  for (const artifact of freshOutputs) {
26478
- const dir = dirname27(artifact.path);
27120
+ const dir = dirname29(artifact.path);
26479
27121
  const name = basename17(artifact.path);
26480
27122
  const [prefix] = name.split(".");
26481
27123
  if (!prefix)
@@ -26838,8 +27480,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26838
27480
  };
26839
27481
  return ({ immediate = false } = {}) => {
26840
27482
  if (!ctx.debouncedPromise) {
26841
- ctx.debouncedPromise = new Promise((resolve42) => {
26842
- ctx.debouncedResolve = resolve42;
27483
+ ctx.debouncedPromise = new Promise((resolve43) => {
27484
+ ctx.debouncedResolve = resolve43;
26843
27485
  });
26844
27486
  }
26845
27487
  const scheduled = ctx.debouncedPromise;
@@ -26961,7 +27603,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26961
27603
  const entries = await readdir5(dir, { withFileTypes: true });
26962
27604
  const files = [];
26963
27605
  for (const entry of entries) {
26964
- const full = join41(dir, entry.name);
27606
+ const full = join43(dir, entry.name);
26965
27607
  if (entry.isDirectory()) {
26966
27608
  files.push(...await walk(full));
26967
27609
  } else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
@@ -27371,8 +28013,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27371
28013
  };
27372
28014
  return () => {
27373
28015
  if (!ctx.debouncedPromise) {
27374
- ctx.debouncedPromise = new Promise((resolve42) => {
27375
- ctx.debouncedResolve = resolve42;
28016
+ ctx.debouncedPromise = new Promise((resolve43) => {
28017
+ ctx.debouncedResolve = resolve43;
27376
28018
  });
27377
28019
  }
27378
28020
  if (ctx.debounceTimer)
@@ -27521,7 +28163,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27521
28163
  } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
27522
28164
  const serverEntries = [...vueServerPaths];
27523
28165
  const clientEntries = [...vueIndexPaths, ...vueClientPaths];
27524
- const cssOutDir = join41(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
28166
+ const cssOutDir = join43(buildDir, state.resolvedPaths.assetsDir ? basename17(state.resolvedPaths.assetsDir) : "assets", "css");
27525
28167
  const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
27526
28168
  const serverExternals = await getServerBundleExternals();
27527
28169
  const clientVendorPaths = await getClientVendorPaths();
@@ -27646,8 +28288,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27646
28288
  };
27647
28289
  return () => {
27648
28290
  if (!ctx.debouncedPromise) {
27649
- ctx.debouncedPromise = new Promise((resolve42) => {
27650
- ctx.debouncedResolve = resolve42;
28291
+ ctx.debouncedPromise = new Promise((resolve43) => {
28292
+ ctx.debouncedResolve = resolve43;
27651
28293
  });
27652
28294
  }
27653
28295
  if (ctx.debounceTimer)
@@ -27733,7 +28375,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27733
28375
  });
27734
28376
  });
27735
28377
  return allModuleUpdates;
27736
- }, handleReactHMR = (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
28378
+ }, handleReactHMR = async (state, affectedFrameworks, filesToRebuild, manifest, duration) => {
27737
28379
  if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
27738
28380
  return;
27739
28381
  }
@@ -27745,14 +28387,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27745
28387
  const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
27746
28388
  const [primarySource] = sourceFiles;
27747
28389
  try {
27748
- const hasComponentChanges = reactFiles.some((file4) => file4.endsWith(".tsx") || file4.endsWith(".ts") || file4.endsWith(".jsx"));
27749
- const hasCSSChanges = reactFiles.some(isStylePath);
28390
+ const {
28391
+ isReactFastRefreshSupported: isReactFastRefreshSupported2,
28392
+ warnIfReactFastRefreshUnsupported: warnIfReactFastRefreshUnsupported2
28393
+ } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
28394
+ warnIfReactFastRefreshUnsupported2();
28395
+ await handleReactModuleServerPath(state, reactFiles, Date.now() - duration, isReactFastRefreshSupported2(), () => {
28396
+ return;
28397
+ });
28398
+ } catch (err) {
27750
28399
  logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
27751
28400
  broadcastToClients(state, {
27752
28401
  data: {
27753
28402
  framework: "react",
27754
- hasComponentChanges,
27755
- hasCSSChanges,
28403
+ hasComponentChanges: true,
28404
+ hasCSSChanges: reactFiles.some(isStylePath),
27756
28405
  manifest,
27757
28406
  primarySource,
27758
28407
  serverDuration: duration,
@@ -27760,7 +28409,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27760
28409
  },
27761
28410
  type: "react-update"
27762
28411
  });
27763
- } catch (err) {
27764
28412
  console.error("[hmr] react live update failed:", err instanceof Error ? err.message : err);
27765
28413
  sendTelemetryEvent("hmr:error", {
27766
28414
  framework: "react",
@@ -27791,7 +28439,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27791
28439
  if (!buildReference?.source) {
27792
28440
  return;
27793
28441
  }
27794
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname27(buildInfo.resolvedRegistryPath), buildReference.source);
28442
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname29(buildInfo.resolvedRegistryPath), buildReference.source);
27795
28443
  islandFiles.add(resolvePath(sourcePath));
27796
28444
  }, resolveIslandSourceFiles = async (config) => {
27797
28445
  const registryPath = config.islands?.registry;
@@ -27819,8 +28467,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27819
28467
  }
27820
28468
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
27821
28469
  const affectedPages = filesToRebuild.flatMap((file4) => getPagesUsingIslandSource(file4));
28470
+ if (affectedPages.length === 0)
28471
+ return true;
28472
+ const affectedFrameworks = [
28473
+ ...new Set(affectedPages.map((page) => detectFramework(page, state.resolvedPaths)).filter((framework) => framework !== "ignored"))
28474
+ ];
27822
28475
  broadcastToClients(state, {
27823
28476
  data: {
28477
+ affectedFrameworks,
27824
28478
  affectedPages,
27825
28479
  framework: "islands",
27826
28480
  manifest,
@@ -28212,7 +28866,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
28212
28866
  }
28213
28867
  }, handleFullBuildHMR = async (state, config, affectedFrameworks, filesToRebuild, manifest, duration) => {
28214
28868
  const allModuleUpdates = collectAllModuleUpdates(affectedFrameworks, filesToRebuild, manifest, state);
28215
- handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
28869
+ await handleReactHMR(state, affectedFrameworks, filesToRebuild, manifest, duration);
28216
28870
  handleHTMLScriptHMR(state, filesToRebuild, manifest, duration);
28217
28871
  await handleHTMLPageHMR(state, config, filesToRebuild, manifest, duration);
28218
28872
  await handleVueHMR(state, config, filesToRebuild, manifest, duration);
@@ -28439,7 +29093,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
28439
29093
  message: "Rebuild completed successfully",
28440
29094
  type: "rebuild-complete"
28441
29095
  });
28442
- if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
29096
+ const hasDedicatedStyleUpdate = affectedFrameworks.some((framework) => framework === "styles" || framework === "assets");
29097
+ if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate) && !hasDedicatedStyleUpdate) {
28443
29098
  try {
28444
29099
  const outputPath = resolvePath(state.resolvedPaths.buildDir, config.tailwind.output);
28445
29100
  const bytes = await Bun.file(outputPath).bytes();
@@ -28460,6 +29115,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
28460
29115
  const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
28461
29116
  const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
28462
29117
  if (didReloadForIslandChange) {
29118
+ await runFrameworkFastPaths(state, config, affectedFrameworks, filesToRebuild ?? [], startTime, onRebuildComplete);
28463
29119
  onRebuildComplete({ hmrState: state, manifest });
28464
29120
  return manifest;
28465
29121
  }
@@ -28616,8 +29272,8 @@ __export(exports_buildDepVendor, {
28616
29272
  });
28617
29273
  import { mkdirSync as mkdirSync14 } from "fs";
28618
29274
  import { isBuiltin } from "module";
28619
- import { join as join42 } from "path";
28620
- import { rm as rm10 } from "fs/promises";
29275
+ import { join as join44 } from "path";
29276
+ import { rm as rm11 } from "fs/promises";
28621
29277
  var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
28622
29278
  var toSafeFileName6 = (specifier) => {
28623
29279
  const prefix = specifier.startsWith("@") ? "_" : "";
@@ -28675,8 +29331,8 @@ var toSafeFileName6 = (specifier) => {
28675
29331
  framework: Array.from(framework).filter(isResolvable3)
28676
29332
  };
28677
29333
  }, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
28678
- const { readFileSync: readFileSync28 } = await import("fs");
28679
- const { dirname: dirname28 } = await import("path");
29334
+ const { readFileSync: readFileSync29 } = await import("fs");
29335
+ const { dirname: dirname30 } = await import("path");
28680
29336
  const seenFiles = new Set;
28681
29337
  const bareOut = new Set;
28682
29338
  const queue = [
@@ -28691,7 +29347,7 @@ var toSafeFileName6 = (specifier) => {
28691
29347
  continue;
28692
29348
  let content;
28693
29349
  try {
28694
- content = readFileSync28(path, "utf-8");
29350
+ content = readFileSync29(path, "utf-8");
28695
29351
  } catch {
28696
29352
  continue;
28697
29353
  }
@@ -28701,7 +29357,7 @@ var toSafeFileName6 = (specifier) => {
28701
29357
  } catch {
28702
29358
  continue;
28703
29359
  }
28704
- const fromDir = dirname28(path);
29360
+ const fromDir = dirname30(path);
28705
29361
  for (const imp of imports) {
28706
29362
  const child = imp.path;
28707
29363
  if (child.startsWith(".") || child.startsWith("/")) {
@@ -28765,7 +29421,7 @@ var toSafeFileName6 = (specifier) => {
28765
29421
  }), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
28766
29422
  const entries = await Promise.all(specifiers.map(async (specifier) => {
28767
29423
  const safeName = toSafeFileName6(specifier);
28768
- const entryPath = join42(tmpDir, `${safeName}.ts`);
29424
+ const entryPath = join44(tmpDir, `${safeName}.ts`);
28769
29425
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
28770
29426
  return { entryPath, specifier };
28771
29427
  }));
@@ -28856,9 +29512,9 @@ var toSafeFileName6 = (specifier) => {
28856
29512
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
28857
29513
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
28858
29514
  return {};
28859
- const vendorDir = join42(buildDir, "vendor");
29515
+ const vendorDir = join44(buildDir, "vendor");
28860
29516
  mkdirSync14(vendorDir, { recursive: true });
28861
- const tmpDir = join42(buildDir, "_dep_vendor_tmp");
29517
+ const tmpDir = join44(buildDir, "_dep_vendor_tmp");
28862
29518
  mkdirSync14(tmpDir, { recursive: true });
28863
29519
  const allSpecs = new Set(initialSpecs);
28864
29520
  const alreadyScanned = new Set;
@@ -28878,7 +29534,7 @@ var toSafeFileName6 = (specifier) => {
28878
29534
  if (!success) {
28879
29535
  console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
28880
29536
  }
28881
- await rm10(tmpDir, { force: true, recursive: true });
29537
+ await rm11(tmpDir, { force: true, recursive: true });
28882
29538
  const paths = {};
28883
29539
  for (const specifier of allSpecs) {
28884
29540
  paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
@@ -28941,7 +29597,7 @@ __export(exports_devBuild, {
28941
29597
  });
28942
29598
  import { readdir as readdir5 } from "fs/promises";
28943
29599
  import { statSync as statSync7 } from "fs";
28944
- import { resolve as resolve42 } from "path";
29600
+ import { resolve as resolve43 } from "path";
28945
29601
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
28946
29602
  const configuredDirs = [
28947
29603
  config.reactDirectory,
@@ -28964,7 +29620,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
28964
29620
  return Object.keys(config).length > 0 ? config : null;
28965
29621
  }, reloadConfig = async () => {
28966
29622
  try {
28967
- const configPath2 = resolve42(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
29623
+ const configPath2 = resolve43(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
28968
29624
  const source = await Bun.file(configPath2).text();
28969
29625
  return parseDirectoryConfig(source);
28970
29626
  } catch {
@@ -29076,7 +29732,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29076
29732
  });
29077
29733
  }
29078
29734
  }, handleCachedReload = async () => {
29079
- const serverMtime = statSync7(resolve42(Bun.main)).mtimeMs;
29735
+ const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
29080
29736
  const lastMtime = globalThis.__hmrServerMtime;
29081
29737
  globalThis.__hmrServerMtime = serverMtime;
29082
29738
  const cached = globalThis.__hmrDevResult;
@@ -29113,8 +29769,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29113
29769
  return true;
29114
29770
  }, resolveAbsoluteVersion2 = async () => {
29115
29771
  const candidates = [
29116
- resolve42(import.meta.dir, "..", "..", "package.json"),
29117
- resolve42(import.meta.dir, "..", "package.json")
29772
+ resolve43(import.meta.dir, "..", "..", "package.json"),
29773
+ resolve43(import.meta.dir, "..", "package.json")
29118
29774
  ];
29119
29775
  const [candidate, ...remaining] = candidates;
29120
29776
  if (!candidate) {
@@ -29140,7 +29796,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29140
29796
  const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
29141
29797
  await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
29142
29798
  const webPath = `/${framework}/vendor/${entry}`;
29143
- const bytes = await Bun.file(resolve42(vendorDir, entry)).bytes();
29799
+ const bytes = await Bun.file(resolve43(vendorDir, entry)).bytes();
29144
29800
  assetStore.set(webPath, bytes);
29145
29801
  }));
29146
29802
  }, devBuild = async (config) => {
@@ -29149,6 +29805,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29149
29805
  await handleCachedReload();
29150
29806
  return cached;
29151
29807
  }
29808
+ if (config.reactDirectory && !globalThis.__reactModuleRef) {
29809
+ globalThis.__reactModuleRef = await import("react");
29810
+ }
29152
29811
  const startupSteps = [];
29153
29812
  const recordStep = (label, startedAt) => {
29154
29813
  const durationMs = performance.now() - startedAt;
@@ -29276,11 +29935,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29276
29935
  cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
29277
29936
  recordStep("populate asset store", stepStartedAt);
29278
29937
  stepStartedAt = performance.now();
29279
- const reactVendorDir = resolve42(state.resolvedPaths.buildDir, "react", "vendor");
29280
- const angularVendorDir = resolve42(state.resolvedPaths.buildDir, "angular", "vendor");
29281
- const svelteVendorDir = resolve42(state.resolvedPaths.buildDir, "svelte", "vendor");
29282
- const vueVendorDir = resolve42(state.resolvedPaths.buildDir, "vue", "vendor");
29283
- const depVendorDir = resolve42(state.resolvedPaths.buildDir, "vendor");
29938
+ const reactVendorDir = resolve43(state.resolvedPaths.buildDir, "react", "vendor");
29939
+ const angularVendorDir = resolve43(state.resolvedPaths.buildDir, "angular", "vendor");
29940
+ const svelteVendorDir = resolve43(state.resolvedPaths.buildDir, "svelte", "vendor");
29941
+ const vueVendorDir = resolve43(state.resolvedPaths.buildDir, "vue", "vendor");
29942
+ const depVendorDir = resolve43(state.resolvedPaths.buildDir, "vendor");
29284
29943
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
29285
29944
  const [, angularSpecs, , , , , depPaths] = await Promise.all([
29286
29945
  config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
@@ -29324,9 +29983,6 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29324
29983
  config.vueDirectory ? loadVendorFiles(state.assetStore, vueVendorDir, "vue") : Promise.resolve(),
29325
29984
  loadVendorFiles(state.assetStore, depVendorDir, "vendor")
29326
29985
  ]);
29327
- if (config.reactDirectory && !globalThis.__reactModuleRef) {
29328
- globalThis.__reactModuleRef = await import("react");
29329
- }
29330
29986
  recordStep("load vendor files", stepStartedAt);
29331
29987
  stepStartedAt = performance.now();
29332
29988
  const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
@@ -29361,7 +30017,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29361
30017
  manifest
29362
30018
  };
29363
30019
  globalThis.__hmrDevResult = result;
29364
- globalThis.__hmrServerMtime = statSync7(resolve42(Bun.main)).mtimeMs;
30020
+ globalThis.__hmrServerMtime = statSync7(resolve43(Bun.main)).mtimeMs;
29365
30021
  return result;
29366
30022
  };
29367
30023
  var init_devBuild = __esm(() => {
@@ -29398,5 +30054,5 @@ export {
29398
30054
  build
29399
30055
  };
29400
30056
 
29401
- //# debugId=AEC5AC744032F0A464756E2164756E21
30057
+ //# debugId=97F7FEF3814DEF7D64756E2164756E21
29402
30058
  //# sourceMappingURL=build.js.map