peachsim 0.1.2777 → 0.1.2779

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 (154) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +669 -840
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-M5O633NZ.mjs → acorn-SCZ56W4Q.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-NJHTAVEI.mjs → chunk-6BNEOOBT.mjs} +124 -18
  28. package/dist-lib/esm-chunks/{chunk-LB2X5KYV.mjs → chunk-7VWBLM73.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-V2I633CU.mjs → chunk-DX5V3733.mjs} +4 -4
  30. package/dist-lib/esm-chunks/{chunk-THHP5XKD.mjs → chunk-E56EZ3QT.mjs} +3 -3
  31. package/dist-lib/esm-chunks/{chunk-TRSHEQVJ.mjs → chunk-FNQXQNQK.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-WSHBJUCP.mjs → chunk-H2V3ZZTO.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-OVCIWUV2.mjs → chunk-H6JAFCAZ.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-ZKPBT6FD.mjs → chunk-HMFIO57I.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-DPL3I4WY.mjs → chunk-HWK2V6R4.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-OSESKVWT.mjs → chunk-KAMO4C4X.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-TONCJKKR.mjs → chunk-KFDP4372.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-FHYWKCOZ.mjs → chunk-KOULWLTF.mjs} +2 -2
  39. package/dist-lib/esm-chunks/{chunk-Q42OLP7O.mjs → chunk-LVEDBGWX.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-RX3WDTYI.mjs → chunk-MJXJYVF5.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-GISUEYXO.mjs → chunk-MK4VAM4G.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-AGWZKA24.mjs → chunk-Q6XMYYNV.mjs} +168 -421
  43. package/dist-lib/esm-chunks/{chunk-KCSUAVJQ.mjs → chunk-SFTGQN5D.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-Q53QPYEU.mjs → chunk-SM5MJSQP.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-3UJO4NG3.mjs → chunk-SNMGOZXQ.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-OLCLLGZF.mjs → chunk-SZI5IZ76.mjs} +5 -5
  47. package/dist-lib/esm-chunks/{chunk-FB27T2JY.mjs → chunk-T7DTXCV5.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-IPX66HMP.mjs → chunk-UBM772FD.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-GMN43CNC.mjs → chunk-VJSHIZ7J.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-GSTVX33B.mjs → chunk-Z42YJEC4.mjs} +36 -14
  51. package/dist-lib/esm-chunks/{metro-layout-parser-PFRFHGDY.mjs → metro-layout-parser-7S5M3EG6.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-NUAEDMSQ.mjs → swift-package-prebuilt-MJSFHIOP.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-P3BARE2W.mjs → swift-sdk-app-module-ZIN3LFLS.mjs} +47 -69
  54. package/dist-lib/esm-chunks/{swift-sdk-image-Y6XT7KI4.mjs → swift-sdk-image-MIWPBZEN.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-DYR47O6H.mjs → swift-sdk-image-producer-OTH543HF.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +592 -763
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +735 -901
  61. package/dist-lib/host/fetch-proxy-handler.cjs +117 -93
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +20 -15
  75. package/dist-lib/native-app-identity-project.mjs +27 -32
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +87 -86
  87. package/dist-lib/public-origins-lib.json +77 -70
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +774 -940
  95. package/dist-lib/swift-compile.cjs +376 -525
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/core-abi/web/sceneClientContract.d.ts +0 -6
  123. package/dist-types/packages/peach-engine/src/components/native-ui/webview-frame-bridge.d.ts +0 -3
  124. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +15 -2
  125. package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +10 -1
  126. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +0 -4
  127. package/package.json +1 -1
  128. package/src/bazel-project.ts +2 -6
  129. package/src/build-cache.ts +3 -2
  130. package/src/sha256.ts +8 -0
  131. package/src/swift-compiler-digest.ts +1 -0
  132. package/src/swift-coverage/indexing.ts +3 -4
  133. package/src/swift-coverage/package.ts +1 -4
  134. package/src/swift-coverage/reader.ts +1 -4
  135. package/src/swift-coverage/source.ts +1 -4
  136. package/src/swift-coverage/xcode-assets.ts +1 -4
  137. package/src/swift-coverage/xcode-bridging.ts +1 -4
  138. package/src/swift-coverage/xcode-packages.ts +1 -4
  139. package/src/swift-coverage/xcode-strings.ts +1 -4
  140. package/src/swift-coverage/xcode.ts +1 -4
  141. package/src/swift-guest-dyld-functions.ts +1 -11
  142. package/src/swift-guest-dyld-table.ts +3 -15
  143. package/src/swift-guest-image-ledger.ts +9 -35
  144. package/src/swift-guest-source-inputs.ts +8 -37
  145. package/src/swift-icu.ts +15 -28
  146. package/src/swift-link-roots.ts +4 -8
  147. package/src/swift-objc-compile.ts +2 -7
  148. package/src/swift-sdk-app-module.ts +5 -27
  149. package/src/swift-sdk-image-wasm.ts +12 -41
  150. package/src/swift-sdk-image.ts +50 -12
  151. package/src/swift-shared-sdk.ts +1 -13
  152. package/src/swift-wasm-archive.ts +6 -11
  153. package/src/swift-wasm-prune.ts +25 -109
  154. package/src/wasm-binary-sections.ts +61 -7
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2777 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2779 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -3062,11 +3062,11 @@ async function installPack(runtimeRoot, prefix, destDir, allowDownload) {
3062
3062
  await install;
3063
3063
  return import_node_fs14.default.existsSync(marker);
3064
3064
  }
3065
- function desktopPackPath(sha2565) {
3065
+ function desktopPackPath(sha2564) {
3066
3066
  if (process.platform !== "darwin") return;
3067
3067
  const cliDir = import_node_path11.default.dirname(process.execPath);
3068
3068
  const resources = cliDir.endsWith("/Contents/Resources/bin") ? import_node_path11.default.dirname(cliDir) : import_node_path11.default.join(MAC_HOST_APP, "Contents/Resources");
3069
- const file = import_node_path11.default.join(resources, DESKTOP_RUNTIME_PACKS_DIR, `${sha2565}.tar.zst`);
3069
+ const file = import_node_path11.default.join(resources, DESKTOP_RUNTIME_PACKS_DIR, `${sha2564}.tar.zst`);
3070
3070
  if (import_node_fs14.default.existsSync(file)) return file;
3071
3071
  }
3072
3072
  var import_node_fs14, import_node_path11, import_node_timers, inflight, packsByRoot, listedByRoot, WARM_DELAY_MS, warming;
@@ -6177,7 +6177,7 @@ var init_swift_objc_sdk_tree = __esm({
6177
6177
 
6178
6178
  // src/swift-compiler-digest.ts
6179
6179
  function swiftArchiveCompilerDigestValue() {
6180
- return true ? "dafa6520c0bcd0e852437835ad9626e824b1e758db5c163a7de2f7fc70ac67ee" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
6180
+ return true ? "b4b2fc7face997792991900efb229414642f042031ba789c00a1d17e542756e3" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
6181
6181
  }
6182
6182
  var import_node_crypto10, import_node_fs25, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
6183
6183
  var init_swift_compiler_digest = __esm({
@@ -6206,6 +6206,7 @@ var init_swift_compiler_digest = __esm({
6206
6206
  "swift-objc-prebuilt-catalog.ts",
6207
6207
  "swift-toolchain.ts",
6208
6208
  "swift-shared-sdk.ts",
6209
+ "wasm-binary-sections.ts",
6209
6210
  "swift-distribution-mirror.ts",
6210
6211
  "swift-design-time.ts",
6211
6212
  "binaryen.lock.json",
@@ -6323,13 +6324,13 @@ var init_swift_standin_digest = __esm({
6323
6324
  ];
6324
6325
  RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
6325
6326
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
6326
- STANDIN_SOURCE_DIGEST = true ? "c2d1c024e059538977fdd0666278d52ec2116aafae79fe0e8b1cda82a5981f3b" : standinSourceDigest();
6327
+ STANDIN_SOURCE_DIGEST = true ? "6f991ca933bc6ae43f06c18cb2029ff3209de583afa4457105e7452437c20f01" : standinSourceDigest();
6327
6328
  }
6328
6329
  });
6329
6330
 
6330
6331
  // src/expo-native-compiler-digest.ts
6331
6332
  function expoNativeCompilerDigestValue() {
6332
- return true ? "c9950c3dbdb6ca5891145f8c4133c9b62e89b35f62d9343e8d7ef410cda838f5" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
6333
+ return true ? "5217c97f9f40e75420d8af715a312e49984d9ec52582e3c5d6209439c3cb70f4" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
6333
6334
  }
6334
6335
  var import_node_crypto12;
6335
6336
  var init_expo_native_compiler_digest = __esm({
@@ -9022,9 +9023,9 @@ async function ensureCompose(toolchain) {
9022
9023
  const downloads = [...toolchain.composeLibraries, toolchain.composeLoader];
9023
9024
  const root = import_node_path29.default.join(kotlinHome(), "compose", toolchain.composeArchive.sha256);
9024
9025
  const verify = (dir) => {
9025
- for (const { name: name3, sha256: sha2565 } of downloads) {
9026
+ for (const { name: name3, sha256: sha2564 } of downloads) {
9026
9027
  const actual = (0, import_node_crypto14.createHash)("sha256").update(import_node_fs28.default.readFileSync(import_node_path29.default.join(dir, name3))).digest("hex");
9027
- if (actual !== sha2565)
9028
+ if (actual !== sha2564)
9028
9029
  throw new Error(`Compose input differs from its pin: ${name3}`);
9029
9030
  }
9030
9031
  };
@@ -9313,15 +9314,15 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
9313
9314
  if (!Buffer.from(text7).equals(bytes))
9314
9315
  throw new Error(`Nitro dependency header is not UTF-8: ${source}`);
9315
9316
  const backport = dependency.backport?.file === relative7 ? dependency.backport : void 0;
9316
- let sha2565 = original;
9317
+ let sha2564 = original;
9317
9318
  if (backport) {
9318
9319
  if (original !== backport.originalSha256)
9319
9320
  throw new Error(`${dependency.name} backport original differs: ${relative7}`);
9320
9321
  if (!text7.includes(backport.before))
9321
9322
  throw new Error(`${dependency.name} backport anchor missing: ${relative7}`);
9322
9323
  text7 = text7.replace(backport.before, backport.after);
9323
- sha2565 = (0, import_node_crypto15.createHash)("sha256").update(text7).digest("hex");
9324
- if (sha2565 !== backport.derivedSha256)
9324
+ sha2564 = (0, import_node_crypto15.createHash)("sha256").update(text7).digest("hex");
9325
+ if (sha2564 !== backport.derivedSha256)
9325
9326
  throw new Error(`${dependency.name} backport derived source differs: ${relative7}`);
9326
9327
  }
9327
9328
  return {
@@ -9329,7 +9330,7 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
9329
9330
  name: dependency.name,
9330
9331
  source,
9331
9332
  text: text7,
9332
- sha256: sha2565,
9333
+ sha256: sha2564,
9333
9334
  ...backport && {
9334
9335
  derivation: {
9335
9336
  upstreamCommit: backport.upstreamCommit,
@@ -17259,10 +17260,10 @@ function swiftNativePin() {
17259
17260
  }
17260
17261
  return pin;
17261
17262
  }
17262
- function publishedSwiftSdk(sha2565) {
17263
+ function publishedSwiftSdk(sha2564) {
17263
17264
  const { sdkRuntime, sdkGuestRuntime } = swiftNativePin().distribution;
17264
17265
  return [sdkRuntime, sdkGuestRuntime].find(
17265
- (publication) => publication?.source === sha2565
17266
+ (publication) => publication?.source === sha2564
17266
17267
  );
17267
17268
  }
17268
17269
  var pin;
@@ -27972,6 +27973,111 @@ var init_swift_objc_runtime = __esm({
27972
27973
  }
27973
27974
  });
27974
27975
 
27976
+ // src/wasm-binary-sections.ts
27977
+ function encodeWasmNumber(value) {
27978
+ const bytes = [];
27979
+ for (let rest = value; ; ) {
27980
+ const byte = rest % 128;
27981
+ rest = Math.floor(rest / 128);
27982
+ if (rest === 0) return [...bytes, byte];
27983
+ bytes.push(byte | 128);
27984
+ }
27985
+ }
27986
+ function encodeWasmSigned(value) {
27987
+ const out = [];
27988
+ for (; ; ) {
27989
+ const byte = Number(value & 127n);
27990
+ value >>= 7n;
27991
+ if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
27992
+ out.push(byte);
27993
+ return out;
27994
+ }
27995
+ out.push(byte | 128);
27996
+ }
27997
+ }
27998
+ function encodeWasmName(name3) {
27999
+ const bytes = new TextEncoder().encode(name3);
28000
+ return [...encodeWasmNumber(bytes.length), ...bytes];
28001
+ }
28002
+ function readULEB(bytes, offset, end = bytes.length) {
28003
+ if (offset < end) {
28004
+ const first = bytes[offset];
28005
+ if (first < 128) return [first, offset + 1];
28006
+ }
28007
+ let value = 0;
28008
+ for (let shift = 0; ; shift += 7) {
28009
+ if (offset >= end || shift > 63) throw new Error("invalid wasm integer");
28010
+ const byte = bytes[offset++];
28011
+ value += (byte & 127) * 2 ** shift;
28012
+ if (!(byte & 128)) return [value, offset];
28013
+ }
28014
+ }
28015
+ function readSLEB(bytes, offset, end = bytes.length) {
28016
+ let value = 0n;
28017
+ let shift = 0n;
28018
+ let byte = 0;
28019
+ do {
28020
+ if (offset >= end || shift > 70n) throw new Error("invalid wasm integer");
28021
+ byte = bytes[offset++];
28022
+ value |= BigInt(byte & 127) << shift;
28023
+ shift += 7n;
28024
+ } while (byte & 128);
28025
+ if (byte & 64) value -= 1n << shift;
28026
+ return [value, offset];
28027
+ }
28028
+ function skipLEB(bytes, offset) {
28029
+ while ((bytes[offset++] & 128) !== 0) {
28030
+ }
28031
+ return offset;
28032
+ }
28033
+ function readWasmSection(bytes, start, end) {
28034
+ let at = start;
28035
+ const number4 = () => {
28036
+ const [value, next] = readULEB(bytes, at, end);
28037
+ at = next;
28038
+ return value;
28039
+ };
28040
+ return {
28041
+ number: number4,
28042
+ byte: () => {
28043
+ if (at >= end) throw new Error("truncated wasm section");
28044
+ return bytes[at++];
28045
+ },
28046
+ name: () => {
28047
+ const length = number4();
28048
+ at += length;
28049
+ if (at > end) throw new Error("truncated wasm name");
28050
+ return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
28051
+ },
28052
+ skip: (length) => {
28053
+ at += length;
28054
+ if (at > end) throw new Error("truncated wasm section");
28055
+ },
28056
+ position: () => at,
28057
+ done: () => at === end
28058
+ };
28059
+ }
28060
+ function wasmSections(bytes) {
28061
+ if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
28062
+ throw new Error("not a wasm module");
28063
+ const found2 = [];
28064
+ for (let at = 8; at < bytes.length; ) {
28065
+ const header = readWasmSection(bytes, at, bytes.length);
28066
+ const id = header.byte();
28067
+ const size2 = header.number();
28068
+ const start = header.position();
28069
+ if (start + size2 > bytes.length) throw new Error("truncated wasm section");
28070
+ found2.push({ id, offset: at, start, end: start + size2 });
28071
+ at = start + size2;
28072
+ }
28073
+ return found2;
28074
+ }
28075
+ var init_wasm_binary_sections = __esm({
28076
+ "src/wasm-binary-sections.ts"() {
28077
+ "use strict";
28078
+ }
28079
+ });
28080
+
27975
28081
  // src/swift-shared-sdk.ts
27976
28082
  function swiftSharedSdkSourceRoot(moduleRoot, distribution) {
27977
28083
  return import_node_path53.default.resolve(moduleRoot, distribution ? "sdk/ios" : "../peachsim/sdk/ios");
@@ -28022,18 +28128,6 @@ function swiftSharedSdkFlags(moduleRoot, distribution) {
28022
28128
  import_node_path53.default.join(root, "usr/include")
28023
28129
  ];
28024
28130
  }
28025
- function readULEB(b, o) {
28026
- let res = 0;
28027
- let shift = 0;
28028
- let p = o;
28029
- while (true) {
28030
- const byte = b[p++];
28031
- res |= (byte & 127) << shift;
28032
- if ((byte & 128) === 0) break;
28033
- shift += 7;
28034
- }
28035
- return [res, p];
28036
- }
28037
28131
  function weakenFoundationSymbolsInWasmObj(buf) {
28038
28132
  let pos = 8;
28039
28133
  while (pos < buf.length) {
@@ -28398,6 +28492,7 @@ var init_swift_shared_sdk = __esm({
28398
28492
  import_node_path53 = __toESM(require("node:path"), 1);
28399
28493
  init_swift_toolchain();
28400
28494
  init_swiftTargetContract();
28495
+ init_wasm_binary_sections();
28401
28496
  SWIFT_DISTRIBUTION_MIRROR_RECORD = ".peach-mirror.json";
28402
28497
  distributionHeaderRoots = /* @__PURE__ */ new Map();
28403
28498
  WEAKEN_FOUNDATION_SYMS = /* @__PURE__ */ new Set([
@@ -29379,6 +29474,21 @@ var init_swift_foundation = __esm({
29379
29474
  }
29380
29475
  });
29381
29476
 
29477
+ // src/sha256.ts
29478
+ function sha256Hex2(input) {
29479
+ if (typeof Bun !== "undefined") {
29480
+ return new Bun.CryptoHasher("sha256").update(input).digest("hex");
29481
+ }
29482
+ return (0, import_node_crypto30.createHash)("sha256").update(input).digest("hex");
29483
+ }
29484
+ var import_node_crypto30;
29485
+ var init_sha256 = __esm({
29486
+ "src/sha256.ts"() {
29487
+ "use strict";
29488
+ import_node_crypto30 = require("node:crypto");
29489
+ }
29490
+ });
29491
+
29382
29492
  // src/swift-guest-source-plan.ts
29383
29493
  function swiftPackageLinkage(target) {
29384
29494
  const linkage = target.machOType === "staticlib" ? "static" : target.machOType === "mh_dylib" ? "dynamic" : null;
@@ -29789,16 +29899,12 @@ var init_swift_link_roots = __esm({
29789
29899
  "use strict";
29790
29900
  import_node_fs56 = __toESM(require("node:fs"), 1);
29791
29901
  import_node_path57 = __toESM(require("node:path"), 1);
29902
+ init_wasm_binary_sections();
29792
29903
  OBJC_RUNTIME_LOOKUP_SECTION = "peach_objc_runtime_lookup";
29793
29904
  leb = (bytes, at) => {
29794
- let value = 0;
29795
- let scale = 1;
29796
- for (; ; ) {
29797
- const byte = bytes[at.offset++];
29798
- value += (byte & 127) * scale;
29799
- if (!(byte & 128)) return value;
29800
- scale *= 128;
29801
- }
29905
+ const [value, next] = readULEB(bytes, at.offset);
29906
+ at.offset = next;
29907
+ return value;
29802
29908
  };
29803
29909
  rootsByDistribution = /* @__PURE__ */ new Map();
29804
29910
  }
@@ -30627,68 +30733,6 @@ var init_swift_guest_linked_spans = __esm({
30627
30733
  }
30628
30734
  });
30629
30735
 
30630
- // src/wasm-binary-sections.ts
30631
- function encodeWasmNumber(value) {
30632
- const bytes = [];
30633
- for (let rest = value; ; ) {
30634
- const byte = rest % 128;
30635
- rest = Math.floor(rest / 128);
30636
- if (rest === 0) return [...bytes, byte];
30637
- bytes.push(byte | 128);
30638
- }
30639
- }
30640
- function encodeWasmName(name3) {
30641
- const bytes = new TextEncoder().encode(name3);
30642
- return [...encodeWasmNumber(bytes.length), ...bytes];
30643
- }
30644
- function readWasmSection(bytes, start, end) {
30645
- let at = start;
30646
- const number4 = () => {
30647
- let value = 0;
30648
- for (let shift = 0; ; shift += 7) {
30649
- if (at >= end || shift > 63) throw new Error("invalid wasm integer");
30650
- const byte = bytes[at++];
30651
- value += (byte & 127) * 2 ** shift;
30652
- if (!(byte & 128)) return value;
30653
- }
30654
- };
30655
- return {
30656
- number: number4,
30657
- byte: () => {
30658
- if (at >= end) throw new Error("truncated wasm section");
30659
- return bytes[at++];
30660
- },
30661
- name: () => {
30662
- const length = number4();
30663
- at += length;
30664
- if (at > end) throw new Error("truncated wasm name");
30665
- return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
30666
- },
30667
- position: () => at,
30668
- done: () => at === end
30669
- };
30670
- }
30671
- function wasmSections(bytes) {
30672
- if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
30673
- throw new Error("not a wasm module");
30674
- const found2 = [];
30675
- for (let at = 8; at < bytes.length; ) {
30676
- const header = readWasmSection(bytes, at, bytes.length);
30677
- const id = header.byte();
30678
- const size2 = header.number();
30679
- const start = header.position();
30680
- if (start + size2 > bytes.length) throw new Error("truncated wasm section");
30681
- found2.push({ id, offset: at, start, end: start + size2 });
30682
- at = start + size2;
30683
- }
30684
- return found2;
30685
- }
30686
- var init_wasm_binary_sections = __esm({
30687
- "src/wasm-binary-sections.ts"() {
30688
- "use strict";
30689
- }
30690
- });
30691
-
30692
30736
  // src/wasm-imports.ts
30693
30737
  function readWasmImports(bytes, section2, visit3) {
30694
30738
  const input = readWasmSection(bytes, section2.start, section2.end);
@@ -30972,23 +31016,13 @@ function wasmReader(bytes, start) {
30972
31016
  const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
30973
31017
  let at = start;
30974
31018
  const u = () => {
30975
- let value = 0;
30976
- for (let shift = 0; ; shift += 7) {
30977
- const byte = bytes[at++];
30978
- value += (byte & 127) * 2 ** shift;
30979
- if (!(byte & 128)) return value;
30980
- }
31019
+ const [value, next] = readULEB(bytes, at);
31020
+ at = next;
31021
+ return value;
30981
31022
  };
30982
31023
  const s = () => {
30983
- let value = 0n;
30984
- let shift = 0n;
30985
- let byte = 0;
30986
- do {
30987
- byte = bytes[at++];
30988
- value |= BigInt(byte & 127) << shift;
30989
- shift += 7n;
30990
- } while (byte & 128);
30991
- if (byte & 64) value -= 1n << shift;
31024
+ const [value, next] = readSLEB(bytes, at);
31025
+ at = next;
30992
31026
  return value;
30993
31027
  };
30994
31028
  return {
@@ -31293,7 +31327,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
31293
31327
  else data[entry.name] = value;
31294
31328
  }
31295
31329
  if (entry.kind !== 0 && entry.kind !== 3 || host2.has(entry.name))
31296
- kept.push([...encodedName(entry.name), entry.kind, ...uleb(entry.index)]);
31330
+ kept.push([...encodeWasmName(entry.name), entry.kind, ...encodeWasmNumber(entry.index)]);
31297
31331
  }
31298
31332
  if (guestMap) {
31299
31333
  if (guestMap.code.length !== m.bodies.length)
@@ -31308,19 +31342,19 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
31308
31342
  const er = wasmReader(bytes, elements.start);
31309
31343
  const segments = er.u();
31310
31344
  const replaced = /* @__PURE__ */ new Map([
31311
- [4, [1, 112, 4, ...uleb(tableEnd + added.length)]],
31312
- [7, [...uleb(kept.length), ...kept.flat()]],
31345
+ [4, [1, 112, 4, ...encodeWasmNumber(tableEnd + added.length)]],
31346
+ [7, [...encodeWasmNumber(kept.length), ...kept.flat()]],
31313
31347
  [
31314
31348
  9,
31315
31349
  [
31316
- ...uleb(segments + 1),
31350
+ ...encodeWasmNumber(segments + 1),
31317
31351
  ...bytes.subarray(er.at, elements.end),
31318
31352
  0,
31319
31353
  66,
31320
- ...sleb(BigInt(tableEnd)),
31354
+ ...encodeWasmSigned(BigInt(tableEnd)),
31321
31355
  11,
31322
- ...uleb(added.length),
31323
- ...added.flatMap(uleb)
31356
+ ...encodeWasmNumber(added.length),
31357
+ ...added.flatMap(encodeWasmNumber)
31324
31358
  ]
31325
31359
  ]
31326
31360
  ]);
@@ -31426,33 +31460,33 @@ function codeOnlySdkImage(bytes, constructorMask) {
31426
31460
  if (drop) r.skip(1);
31427
31461
  gated.push(
31428
31462
  66,
31429
- ...sleb(BigInt(constructorMask + index++)),
31463
+ ...encodeWasmSigned(BigInt(constructorMask + index++)),
31430
31464
  45,
31431
31465
  0,
31432
31466
  0,
31433
31467
  4,
31434
31468
  64,
31435
31469
  16,
31436
- ...uleb(callee),
31470
+ ...encodeWasmNumber(callee),
31437
31471
  ...drop ? [26] : [],
31438
31472
  11
31439
31473
  );
31440
31474
  }
31441
31475
  if (index > SWIFT_SDK_CONSTRUCTOR_LIMIT)
31442
31476
  throw new Error(`${index} sdk constructors exceed the mask`);
31443
- gated.push(16, ...uleb(functionIndex("__peach_sdk_register")), 11);
31477
+ gated.push(16, ...encodeWasmNumber(functionIndex("__peach_sdk_register")), 11);
31444
31478
  bodies[constructors] = Uint8Array.from(gated);
31445
31479
  }
31446
- const codeParts = [Uint8Array.from(uleb(bodies.length))];
31447
- for (const body of bodies) codeParts.push(Uint8Array.from(uleb(body.length)), body);
31480
+ const codeParts = [Uint8Array.from(encodeWasmNumber(bodies.length))];
31481
+ for (const body of bodies) codeParts.push(Uint8Array.from(encodeWasmNumber(body.length)), body);
31448
31482
  const codeSize = codeParts.reduce((sum, part) => sum + part.length, 0);
31449
31483
  const tls = passiveSegments(bytes)[0];
31450
31484
  const out = [bytes.subarray(0, 8)];
31451
31485
  for (const s of m.sections) {
31452
31486
  if (s.id === 10) {
31453
- out.push(Uint8Array.from([10, ...uleb(codeSize)]));
31487
+ out.push(Uint8Array.from([10, ...encodeWasmNumber(codeSize)]));
31454
31488
  for (const part of codeParts) out.push(part);
31455
- } else if (s.id === 11) out.push(section(11, [1, 1, ...uleb(tls.length), ...tls]));
31489
+ } else if (s.id === 11) out.push(section(11, [1, 1, ...encodeWasmNumber(tls.length), ...tls]));
31456
31490
  else if (s.id === 12) out.push(section(12, [1]));
31457
31491
  else out.push(bytes.subarray(s.offset, s.end));
31458
31492
  }
@@ -31769,39 +31803,14 @@ function unslottedFunctions(bytes) {
31769
31803
  }
31770
31804
  return definedFuncs - slotted.size;
31771
31805
  }
31772
- var uleb, sleb, encodedName, section, PROCESS_EXPORTS, SWIFT_SDK_CONSTRUCTOR_LIMIT, FUNCTION_RELOCATIONS, MEMORY_RELOCATIONS, ADDEND_RELOCATIONS, FUNCTION_RELOC_MASK, MEMORY_RELOC_MASK, ADDEND_RELOC_MASK;
31806
+ var section, PROCESS_EXPORTS, SWIFT_SDK_CONSTRUCTOR_LIMIT, FUNCTION_RELOCATIONS, MEMORY_RELOCATIONS, ADDEND_RELOCATIONS, FUNCTION_RELOC_MASK, MEMORY_RELOC_MASK, ADDEND_RELOC_MASK;
31773
31807
  var init_swift_sdk_image_wasm = __esm({
31774
31808
  "src/swift-sdk-image-wasm.ts"() {
31775
31809
  "use strict";
31776
31810
  init_swift_sdk_image_map();
31777
31811
  init_swiftSdkLinkContract();
31778
- uleb = (value) => {
31779
- const out = [];
31780
- do {
31781
- let byte = value % 128;
31782
- value = Math.floor(value / 128);
31783
- if (value) byte |= 128;
31784
- out.push(byte);
31785
- } while (value);
31786
- return out;
31787
- };
31788
- sleb = (value) => {
31789
- const out = [];
31790
- for (; ; ) {
31791
- const byte = Number(value & 127n);
31792
- value >>= 7n;
31793
- if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
31794
- out.push(byte);
31795
- return out;
31796
- }
31797
- out.push(byte | 128);
31798
- }
31799
- };
31800
- encodedName = (name3) => {
31801
- const bytes = [...Buffer.from(name3)];
31802
- return [...uleb(bytes.length), ...bytes];
31803
- };
31804
- section = (id, payload) => Uint8Array.from([id, ...uleb(payload.length), ...payload]);
31812
+ init_wasm_binary_sections();
31813
+ section = (id, payload) => Uint8Array.from([id, ...encodeWasmNumber(payload.length), ...payload]);
31805
31814
  PROCESS_EXPORTS = [
31806
31815
  "_initialize",
31807
31816
  "__wasm_call_ctors",
@@ -31906,20 +31915,12 @@ function localizeDefinedWasmSymbols(bytes, names) {
31906
31915
  const output = new Uint8Array(bytes);
31907
31916
  let cur = 8;
31908
31917
  const readU = () => {
31909
- const b0 = bytes[cur++];
31910
- if (b0 < 128) return b0;
31911
- let res = b0 & 127;
31912
- let shift = 7;
31913
- while (true) {
31914
- const byte = bytes[cur++];
31915
- res |= (byte & 127) << shift;
31916
- if ((byte & 128) === 0) return res;
31917
- shift += 7;
31918
- }
31918
+ const [res, next] = readULEB(bytes, cur);
31919
+ cur = next;
31920
+ return res;
31919
31921
  };
31920
31922
  const skipU = () => {
31921
- while ((bytes[cur++] & 128) !== 0) {
31922
- }
31923
+ cur = skipLEB(bytes, cur);
31923
31924
  };
31924
31925
  const importFuncNames = [];
31925
31926
  const importGlobalNames = [];
@@ -32026,50 +32027,11 @@ function localizeDefinedWasmSymbols(bytes, names) {
32026
32027
  var init_swift_wasm_archive = __esm({
32027
32028
  "src/swift-wasm-archive.ts"() {
32028
32029
  "use strict";
32030
+ init_wasm_binary_sections();
32029
32031
  }
32030
32032
  });
32031
32033
 
32032
32034
  // src/swift-wasm-prune.ts
32033
- function sha256Hex2(bytes) {
32034
- if (typeof Bun !== "undefined")
32035
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
32036
- return (0, import_node_crypto30.createHash)("sha256").update(bytes).digest("hex");
32037
- }
32038
- function readULEB2(b, o) {
32039
- let res = 0;
32040
- let shift = 0;
32041
- let p = o;
32042
- while (true) {
32043
- const byte = b[p++];
32044
- res |= (byte & 127) << shift;
32045
- if ((byte & 128) === 0) break;
32046
- shift += 7;
32047
- }
32048
- return [res, p];
32049
- }
32050
- function readSLEB(b, o) {
32051
- let res = 0;
32052
- let shift = 0;
32053
- let p = o;
32054
- let byte = 0;
32055
- do {
32056
- byte = b[p++];
32057
- res |= (byte & 127) << shift;
32058
- shift += 7;
32059
- } while (byte & 128);
32060
- if (shift < 32 && byte & 64) res |= ~0 << shift;
32061
- return [res, p];
32062
- }
32063
- function encodeULEB(val) {
32064
- const out = [];
32065
- do {
32066
- let byte = val & 127;
32067
- val >>>= 7;
32068
- if (val !== 0) byte |= 128;
32069
- out.push(byte);
32070
- } while (val !== 0);
32071
- return out;
32072
- }
32073
32035
  function isRootSegName(name3) {
32074
32036
  for (const pref of ROOT_SEG_PREFIXES) {
32075
32037
  if (name3 === pref || name3.startsWith(`${pref}.`)) return true;
@@ -32095,39 +32057,14 @@ function decodeRelocations(buf, sections) {
32095
32057
  for (let k = 0; k < sectionCount; k++, i++) {
32096
32058
  start[i] = length + cur - baseAt;
32097
32059
  const rType = buf[cur++];
32098
- let offset = buf[cur++];
32099
- if (offset >= 128) {
32100
- offset &= 127;
32101
- let shift = 7;
32102
- while (true) {
32103
- const byte = buf[cur++];
32104
- offset |= (byte & 127) << shift;
32105
- if (byte < 128) break;
32106
- shift += 7;
32107
- }
32108
- }
32109
- let symbol2 = buf[cur++];
32110
- if (symbol2 >= 128) {
32111
- symbol2 &= 127;
32112
- let shift = 7;
32113
- while (true) {
32114
- const byte = buf[cur++];
32115
- symbol2 |= (byte & 127) << shift;
32116
- if (byte < 128) break;
32117
- shift += 7;
32118
- }
32119
- }
32060
+ let offset;
32061
+ [offset, cur] = readULEB(buf, cur);
32062
+ let symbol2;
32063
+ [symbol2, cur] = readULEB(buf, cur);
32120
32064
  if (rType < 32 && (ADDEND_RELOC_MASK2 & 1 << rType) !== 0) {
32121
- let byte = buf[cur++];
32122
- let value = byte & 127;
32123
- let shift = 7;
32124
- while (byte >= 128) {
32125
- byte = buf[cur++];
32126
- value |= (byte & 127) << shift;
32127
- shift += 7;
32128
- }
32129
- if (shift < 32 && (byte & 64) !== 0) value |= ~0 << shift;
32130
- addend[i] = value;
32065
+ let value;
32066
+ [value, cur] = readSLEB(buf, cur);
32067
+ addend[i] = Number(BigInt.asIntN(32, value));
32131
32068
  }
32132
32069
  ro[i] = offset;
32133
32070
  rs[i] = symbol2;
@@ -32162,36 +32099,36 @@ function patchSwiftrtObject(src) {
32162
32099
  let pos = 8;
32163
32100
  while (pos < buf.length) {
32164
32101
  const id = buf[pos++];
32165
- const [sz, p] = readULEB2(buf, pos);
32102
+ const [sz, p] = readULEB(buf, pos);
32166
32103
  const end = p + sz;
32167
32104
  if (id === 0) {
32168
- const [nLen, np] = readULEB2(buf, p);
32105
+ const [nLen, np] = readULEB(buf, p);
32169
32106
  const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
32170
32107
  const cp = np + nLen;
32171
32108
  if (name3 === "linking") {
32172
- let [, lp] = readULEB2(buf, cp);
32109
+ let [, lp] = readULEB(buf, cp);
32173
32110
  while (lp < end) {
32174
32111
  const subId = buf[lp++];
32175
- const [subLen, sp] = readULEB2(buf, lp);
32112
+ const [subLen, sp] = readULEB(buf, lp);
32176
32113
  const subEnd = sp + subLen;
32177
32114
  if (subId === 8) {
32178
- let [cnt, cur] = readULEB2(buf, sp);
32115
+ let [cnt, cur] = readULEB(buf, sp);
32179
32116
  for (let i = 0; i < cnt; i++) {
32180
32117
  const kind = buf[cur++];
32181
32118
  const flPos = cur;
32182
- const [fl, c2] = readULEB2(buf, cur);
32119
+ const [fl, c2] = readULEB(buf, cur);
32183
32120
  cur = c2;
32184
32121
  const isUndef = (fl & 16) !== 0;
32185
32122
  const isExplicitName = (fl & 64) !== 0;
32186
32123
  if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
32187
- const [, c3] = readULEB2(buf, cur);
32124
+ const [, c3] = readULEB(buf, cur);
32188
32125
  cur = c3;
32189
32126
  if (!isUndef || isExplicitName) {
32190
- const [sLen, c4] = readULEB2(buf, cur);
32127
+ const [sLen, c4] = readULEB(buf, cur);
32191
32128
  cur = c4 + sLen;
32192
32129
  }
32193
32130
  } else if (kind === 1) {
32194
- const [sLen, c3] = readULEB2(buf, cur);
32131
+ const [sLen, c3] = readULEB(buf, cur);
32195
32132
  const sName = Buffer.from(buf.subarray(c3, c3 + sLen)).toString("utf8");
32196
32133
  if (sName === "_ZN12_GLOBAL__N_18sectionsE") fallbackSymIdx = i;
32197
32134
  for (const prefix of ["__start_", "__stop_"]) {
@@ -32203,13 +32140,13 @@ function patchSwiftrtObject(src) {
32203
32140
  }
32204
32141
  cur = c3 + sLen;
32205
32142
  if (!isUndef) {
32206
- const [, c4] = readULEB2(buf, cur);
32207
- const [, c5] = readULEB2(buf, c4);
32208
- const [, c6] = readULEB2(buf, c5);
32143
+ const [, c4] = readULEB(buf, cur);
32144
+ const [, c5] = readULEB(buf, c4);
32145
+ const [, c6] = readULEB(buf, c5);
32209
32146
  cur = c6;
32210
32147
  }
32211
32148
  } else if (kind === 3) {
32212
- const [, c3] = readULEB2(buf, cur);
32149
+ const [, c3] = readULEB(buf, cur);
32213
32150
  cur = c3;
32214
32151
  }
32215
32152
  }
@@ -32223,26 +32160,25 @@ function patchSwiftrtObject(src) {
32223
32160
  pos = 8;
32224
32161
  while (pos < buf.length) {
32225
32162
  const id = buf[pos++];
32226
- const [sz, p] = readULEB2(buf, pos);
32163
+ const [sz, p] = readULEB(buf, pos);
32227
32164
  const end = p + sz;
32228
32165
  if (id === 0) {
32229
- const [nLen, np] = readULEB2(buf, p);
32166
+ const [nLen, np] = readULEB(buf, p);
32230
32167
  const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
32231
32168
  const cp = np + nLen;
32232
32169
  if (name3 === "reloc.CODE") {
32233
- const [, r1] = readULEB2(buf, cp);
32234
- let [cnt, cur] = readULEB2(buf, r1);
32170
+ const [, r1] = readULEB(buf, cp);
32171
+ let [cnt, cur] = readULEB(buf, r1);
32235
32172
  for (let i = 0; i < cnt; i++) {
32236
32173
  const rType = buf[cur++];
32237
- const [, c2] = readULEB2(buf, cur);
32238
- const [rs, c3] = readULEB2(buf, c2);
32174
+ const [, c2] = readULEB(buf, cur);
32175
+ const [rs, c3] = readULEB(buf, c2);
32239
32176
  if (neutralizedSyms.has(rs) && c3 - c2 === 1) {
32240
32177
  buf[c2] = fallbackSymIdx;
32241
32178
  }
32242
32179
  cur = c3;
32243
32180
  if (ADDEND_RELOCATIONS.has(rType)) {
32244
- const [, c4] = readSLEB(buf, cur);
32245
- cur = c4;
32181
+ cur = skipLEB(buf, cur);
32246
32182
  }
32247
32183
  }
32248
32184
  }
@@ -32256,25 +32192,14 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
32256
32192
  let pos = 8;
32257
32193
  let cur = 8;
32258
32194
  const readU = () => {
32259
- const b0 = buf[cur++];
32260
- if (b0 < 128) return b0;
32261
- let res = b0 & 127;
32262
- let shift = 7;
32263
- while (true) {
32264
- const byte = buf[cur++];
32265
- res |= (byte & 127) << shift;
32266
- if (byte < 128) return res;
32267
- shift += 7;
32268
- }
32195
+ const [res, next] = readULEB(buf, cur);
32196
+ cur = next;
32197
+ return res;
32269
32198
  };
32270
32199
  const skipU = () => {
32271
- while (buf[cur++] >= 128) {
32272
- }
32273
- };
32274
- const skipS = () => {
32275
- while (buf[cur++] >= 128) {
32276
- }
32200
+ cur = skipLEB(buf, cur);
32277
32201
  };
32202
+ const skipS = skipU;
32278
32203
  let numImportFuncs = 0;
32279
32204
  let importsDlsym = false;
32280
32205
  const importFuncNames = [];
@@ -32872,16 +32797,9 @@ function guestWasmSymbols(bytes) {
32872
32797
  const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
32873
32798
  let cur = 8;
32874
32799
  const readU = () => {
32875
- const b0 = bytes[cur++];
32876
- if (b0 < 128) return b0;
32877
- let res = b0 & 127;
32878
- let shift = 7;
32879
- while (true) {
32880
- const byte = bytes[cur++];
32881
- res |= (byte & 127) << shift;
32882
- if ((byte & 128) === 0) return res;
32883
- shift += 7;
32884
- }
32800
+ const [res, next] = readULEB(bytes, cur);
32801
+ cur = next;
32802
+ return res;
32885
32803
  };
32886
32804
  let importsDlsym = false;
32887
32805
  const importFuncNames = [];
@@ -33071,7 +32989,7 @@ function swiftPrunedSdkObjectOrigins(sdk2, args, rewritten) {
33071
32989
  }
33072
32990
  function ensureUnpackedSdkObjects(sdkWasiDir) {
33073
32991
  const archives = import_node_fs58.default.readdirSync(sdkWasiDir).filter((file) => file.endsWith(".a")).sort();
33074
- const hash = (0, import_node_crypto30.createHash)("sha256");
32992
+ const hash = (0, import_node_crypto31.createHash)("sha256");
33075
32993
  for (const archive of archives) {
33076
32994
  hash.update(archive + "\0");
33077
32995
  hash.update(swiftFileChecksum(import_node_path59.default.join(sdkWasiDir, archive)));
@@ -34022,7 +33940,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34022
33940
  if (!deadSpecialSegs.has(sIdx)) continue;
34023
33941
  if (!isSpecialSegRelocLive(obj, obj.segNames[sIdx], data.rs[i])) continue;
34024
33942
  const first = relocationBytes(data, i);
34025
- const [, afterRoOff] = readULEB2(first, 1);
33943
+ const [, afterRoOff] = readULEB(first, 1);
34026
33944
  firstLiveInSpecialSeg.set(sIdx, {
34027
33945
  rType: first[0],
34028
33946
  afterRo: first.subarray(afterRoOff)
@@ -34052,7 +33970,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34052
33970
  zeroDataReloc(i);
34053
33971
  } else {
34054
33972
  const repl = firstLiveInSpecialSeg.get(segIdx);
34055
- const roBytes = encodeULEB(data.ro[i]);
33973
+ const roBytes = encodeWasmNumber(data.ro[i]);
34056
33974
  const out = new Uint8Array(1 + roBytes.length + repl.afterRo.length);
34057
33975
  out[0] = repl.rType;
34058
33976
  out.set(roBytes, 1);
@@ -34091,34 +34009,34 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34091
34009
  while (pos < buf.length) {
34092
34010
  const secStart = pos;
34093
34011
  const id = buf[pos++];
34094
- const [sz, p] = readULEB2(buf, pos);
34012
+ const [sz, p] = readULEB(buf, pos);
34095
34013
  const end = p + sz;
34096
34014
  if (id === 0) {
34097
- const [nLen, np] = readULEB2(buf, p);
34015
+ const [nLen, np] = readULEB(buf, p);
34098
34016
  const name3 = rawBuf.toString("utf8", np, np + nLen);
34099
34017
  const cp = np + nLen;
34100
34018
  if (name3 === "linking") {
34101
- const [, lpStart] = readULEB2(buf, cp);
34019
+ const [, lpStart] = readULEB(buf, cp);
34102
34020
  const subChunks = [buf.subarray(p, lpStart)];
34103
34021
  let lp = lpStart;
34104
34022
  while (lp < end) {
34105
34023
  const subStart = lp;
34106
34024
  const subId = buf[lp++];
34107
- const [subLen, sp] = readULEB2(buf, lp);
34025
+ const [subLen, sp] = readULEB(buf, lp);
34108
34026
  const subEnd = sp + subLen;
34109
34027
  if (subId === 5) {
34110
34028
  const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
34111
- let [cnt, cur] = readULEB2(buf, sp);
34029
+ let [cnt, cur] = readULEB(buf, sp);
34112
34030
  for (let i = 0; i < cnt; i++) {
34113
- const [sLen, s2] = readULEB2(buf, cur);
34031
+ const [sLen, s2] = readULEB(buf, cur);
34114
34032
  const segName = obj.segNames[i];
34115
34033
  const repl = RECORD_SEGS.get(segName);
34116
34034
  const isSpecial = repl !== void 0;
34117
34035
  if (deadSpecialSegs.has(i) && repl !== void 0)
34118
34036
  subCopy.set(Buffer.from(repl, "utf8"), s2 - subStart);
34119
34037
  cur = s2 + sLen;
34120
- const [, s3] = readULEB2(buf, cur);
34121
- const [segFl, s4] = readULEB2(buf, s3);
34038
+ const [, s3] = readULEB(buf, cur);
34039
+ const [segFl, s4] = readULEB(buf, s3);
34122
34040
  const sFlLen = s4 - s3;
34123
34041
  const keepRetain = isSpecial ? !deadSpecialSegs.has(i) : isRootSegName(segName) && !segName.startsWith(".init_array") && sLive[i] === 1;
34124
34042
  const newSegFl = keepRetain ? segFl | 4 : segFl & ~4;
@@ -34132,12 +34050,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34132
34050
  }
34133
34051
  subChunks.push(subCopy);
34134
34052
  } else if (subId === 6) {
34135
- let [cnt, cur] = readULEB2(buf, sp);
34053
+ let [cnt, cur] = readULEB(buf, sp);
34136
34054
  const entrySlices = [];
34137
34055
  for (let i = 0; i < cnt; i++) {
34138
34056
  const eStart = cur;
34139
- const [, s2] = readULEB2(buf, cur);
34140
- const [symIdx, s3] = readULEB2(buf, s2);
34057
+ const [, s2] = readULEB(buf, cur);
34058
+ const [symIdx, s3] = readULEB(buf, s2);
34141
34059
  cur = s3;
34142
34060
  if (obj.symKind[symIdx] === 0 && obj.symElemIdx[symIdx] >= obj.numImportFuncs) {
34143
34061
  if (fLive[obj.symElemIdx[symIdx] - obj.numImportFuncs] === 1) {
@@ -34148,19 +34066,19 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34148
34066
  }
34149
34067
  }
34150
34068
  if (entrySlices.length > 0) {
34151
- const cntBytes = Uint8Array.from(encodeULEB(entrySlices.length));
34069
+ const cntBytes = Uint8Array.from(encodeWasmNumber(entrySlices.length));
34152
34070
  const bodyLen = cntBytes.length + entrySlices.reduce((a, b) => a + b.length, 0);
34153
- const lenBytes = Uint8Array.from(encodeULEB(bodyLen));
34071
+ const lenBytes = Uint8Array.from(encodeWasmNumber(bodyLen));
34154
34072
  subChunks.push(Uint8Array.of(6), lenBytes, cntBytes);
34155
34073
  for (const entry of entrySlices) subChunks.push(entry);
34156
34074
  }
34157
34075
  } else if (subId === 8) {
34158
34076
  const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
34159
- let [cnt, cur] = readULEB2(buf, sp);
34077
+ let [cnt, cur] = readULEB(buf, sp);
34160
34078
  for (let i = 0; i < cnt; i++) {
34161
34079
  const kind = buf[cur++];
34162
34080
  const flOffset = cur - subStart;
34163
- const [fl, c2] = readULEB2(buf, cur);
34081
+ const [fl, c2] = readULEB(buf, cur);
34164
34082
  cur = c2;
34165
34083
  const isUndef = (fl & 16) !== 0;
34166
34084
  const isExplicitName = (fl & 64) !== 0;
@@ -34180,23 +34098,23 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34180
34098
  subCopy[flOffset + 1] = 0;
34181
34099
  }
34182
34100
  if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
34183
- const [, c3] = readULEB2(buf, cur);
34101
+ const [, c3] = readULEB(buf, cur);
34184
34102
  cur = c3;
34185
34103
  if (!isUndef || isExplicitName) {
34186
- const [sLen, c4] = readULEB2(buf, cur);
34104
+ const [sLen, c4] = readULEB(buf, cur);
34187
34105
  cur = c4 + sLen;
34188
34106
  }
34189
34107
  } else if (kind === 1) {
34190
- const [sLen, c3] = readULEB2(buf, cur);
34108
+ const [sLen, c3] = readULEB(buf, cur);
34191
34109
  cur = c3 + sLen;
34192
34110
  if (!isUndef) {
34193
- const [, c4] = readULEB2(buf, cur);
34194
- const [, c5] = readULEB2(buf, c4);
34195
- const [, c6] = readULEB2(buf, c5);
34111
+ const [, c4] = readULEB(buf, cur);
34112
+ const [, c5] = readULEB(buf, c4);
34113
+ const [, c6] = readULEB(buf, c5);
34196
34114
  cur = c6;
34197
34115
  }
34198
34116
  } else if (kind === 3) {
34199
- const [, c3] = readULEB2(buf, cur);
34117
+ const [, c3] = readULEB(buf, cur);
34200
34118
  cur = c3;
34201
34119
  }
34202
34120
  }
@@ -34207,29 +34125,29 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34207
34125
  lp = subEnd;
34208
34126
  }
34209
34127
  const totalSubLen = subChunks.reduce((a, b) => a + b.length, 0);
34210
- outChunks.push(Uint8Array.of(0), Uint8Array.from(encodeULEB(totalSubLen)));
34128
+ outChunks.push(Uint8Array.of(0), Uint8Array.from(encodeWasmNumber(totalSubLen)));
34211
34129
  for (const chunk of subChunks) outChunks.push(chunk);
34212
34130
  } else if (name3 === "reloc.CODE") {
34213
- const [, r1] = readULEB2(buf, cp);
34131
+ const [, r1] = readULEB(buf, cp);
34214
34132
  const headerSlice = buf.subarray(p, r1);
34215
- const cntBytes = Uint8Array.from(encodeULEB(keptCodeRelocs.length));
34133
+ const cntBytes = Uint8Array.from(encodeWasmNumber(keptCodeRelocs.length));
34216
34134
  const relSlices = keptCodeRelocs.map((i) => relocationBytes(code, i));
34217
34135
  const totalLen = headerSlice.length + cntBytes.length + relSlices.reduce((a, b) => a + b.length, 0);
34218
34136
  outChunks.push(
34219
34137
  Uint8Array.of(0),
34220
- Uint8Array.from(encodeULEB(totalLen)),
34138
+ Uint8Array.from(encodeWasmNumber(totalLen)),
34221
34139
  headerSlice,
34222
34140
  cntBytes
34223
34141
  );
34224
34142
  for (const relocation of relSlices) outChunks.push(relocation);
34225
34143
  } else if (name3 === "reloc.DATA") {
34226
- const [, r1] = readULEB2(buf, cp);
34144
+ const [, r1] = readULEB(buf, cp);
34227
34145
  const headerSlice = buf.subarray(p, r1);
34228
- const cntBytes = Uint8Array.from(encodeULEB(keptDataRelocBytes.length));
34146
+ const cntBytes = Uint8Array.from(encodeWasmNumber(keptDataRelocBytes.length));
34229
34147
  const totalLen = headerSlice.length + cntBytes.length + keptDataRelocBytes.reduce((a, b) => a + b.length, 0);
34230
34148
  outChunks.push(
34231
34149
  Uint8Array.of(0),
34232
- Uint8Array.from(encodeULEB(totalLen)),
34150
+ Uint8Array.from(encodeWasmNumber(totalLen)),
34233
34151
  headerSlice,
34234
34152
  cntBytes
34235
34153
  );
@@ -34239,15 +34157,15 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34239
34157
  const nameBytes = buf.subarray(p, cp);
34240
34158
  outChunks.push(
34241
34159
  Uint8Array.of(0),
34242
- Uint8Array.from(encodeULEB(nameBytes.length)),
34160
+ Uint8Array.from(encodeWasmNumber(nameBytes.length)),
34243
34161
  nameBytes
34244
34162
  );
34245
34163
  } else if (name3.startsWith("reloc..debug_")) {
34246
- const [, r1] = readULEB2(buf, cp);
34164
+ const [, r1] = readULEB(buf, cp);
34247
34165
  const headerSlice = buf.subarray(p, r1);
34248
34166
  outChunks.push(
34249
34167
  Uint8Array.of(0),
34250
- Uint8Array.from(encodeULEB(headerSlice.length + 1)),
34168
+ Uint8Array.from(encodeWasmNumber(headerSlice.length + 1)),
34251
34169
  headerSlice,
34252
34170
  Uint8Array.of(0)
34253
34171
  );
@@ -34360,15 +34278,16 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
34360
34278
  );
34361
34279
  import_node_fs58.default.rmSync(rspPath, { force: true });
34362
34280
  }
34363
- var import_node_child_process25, import_node_crypto30, import_node_fs58, import_node_path59, v3, WIDE_DATA_RELOCS, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, ADDEND_RELOC_MASK2, relocationBytes, parsedObjectCache, PARSED_ROOTS, SWIFTUI_WRAPPER_HOST_PROTOCOLS, SWIFT_PRUNED_LINK_MAP, SWIFT_PRUNED_LINK_RESPONSE;
34281
+ var import_node_child_process25, import_node_crypto31, import_node_fs58, import_node_path59, v3, WIDE_DATA_RELOCS, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, ADDEND_RELOC_MASK2, relocationBytes, parsedObjectCache, PARSED_ROOTS, SWIFTUI_WRAPPER_HOST_PROTOCOLS, SWIFT_PRUNED_LINK_MAP, SWIFT_PRUNED_LINK_RESPONSE;
34364
34282
  var init_swift_wasm_prune = __esm({
34365
34283
  "src/swift-wasm-prune.ts"() {
34366
34284
  "use strict";
34367
34285
  import_node_child_process25 = require("node:child_process");
34368
- import_node_crypto30 = require("node:crypto");
34286
+ import_node_crypto31 = require("node:crypto");
34369
34287
  import_node_fs58 = __toESM(require("node:fs"), 1);
34370
34288
  import_node_path59 = __toESM(require("node:path"), 1);
34371
34289
  v3 = __toESM(require("peachsim/vendor/valibot"), 1);
34290
+ init_sha256();
34372
34291
  init_swift_guest_source_plan();
34373
34292
  init_swift_link_roots();
34374
34293
  init_swift_resource_class_names();
@@ -34376,6 +34295,7 @@ var init_swift_wasm_prune = __esm({
34376
34295
  init_swift_toolchain();
34377
34296
  init_swift_wasm_archive();
34378
34297
  init_swiftRuntimeProductContract();
34298
+ init_wasm_binary_sections();
34379
34299
  WIDE_DATA_RELOCS = /* @__PURE__ */ new Set([16, 19, 22, 27]);
34380
34300
  ROOT_SEG_PREFIXES = [
34381
34301
  ".init_array",
@@ -34482,7 +34402,7 @@ function aliasGuestArchive(options2) {
34482
34402
  alias,
34483
34403
  name: member.name,
34484
34404
  ordinal,
34485
- sha256: (0, import_node_crypto31.createHash)("sha256").update(member.bytes).digest("hex")
34405
+ sha256: (0, import_node_crypto32.createHash)("sha256").update(member.bytes).digest("hex")
34486
34406
  };
34487
34407
  });
34488
34408
  const response = import_node_path60.default.join(options2.directory, "members.rsp");
@@ -34495,7 +34415,7 @@ function aliasGuestArchive(options2) {
34495
34415
  (0, import_node_child_process26.execFileSync)(options2.llvmAr, ["rcsD", archive, `@${response}`], { stdio: "pipe" });
34496
34416
  const rewritten = readArMembers((0, import_node_fs59.readFileSync)(archive));
34497
34417
  if (rewritten.length !== members2.length || rewritten.some(
34498
- (member, index) => member.name !== members2[index].alias || (0, import_node_crypto31.createHash)("sha256").update(member.bytes).digest("hex") !== members2[index].sha256
34418
+ (member, index) => member.name !== members2[index].alias || (0, import_node_crypto32.createHash)("sha256").update(member.bytes).digest("hex") !== members2[index].sha256
34499
34419
  ))
34500
34420
  throw new Error(`guest archive changed members ${options2.archive}`);
34501
34421
  return { source: options2.archive, archive, members: members2 };
@@ -34555,12 +34475,12 @@ function aliasGuestLinkIdentities(identities, archives) {
34555
34475
  }
34556
34476
  return result;
34557
34477
  }
34558
- var import_node_child_process26, import_node_crypto31, import_node_fs59, import_node_path60;
34478
+ var import_node_child_process26, import_node_crypto32, import_node_fs59, import_node_path60;
34559
34479
  var init_swift_guest_archive = __esm({
34560
34480
  "src/swift-guest-archive.ts"() {
34561
34481
  "use strict";
34562
34482
  import_node_child_process26 = require("node:child_process");
34563
- import_node_crypto31 = require("node:crypto");
34483
+ import_node_crypto32 = require("node:crypto");
34564
34484
  import_node_fs59 = require("node:fs");
34565
34485
  import_node_path60 = __toESM(require("node:path"), 1);
34566
34486
  init_swift_wasm_prune();
@@ -34574,15 +34494,15 @@ function nativeDyldName(bytes) {
34574
34494
  name3 += String.fromCharCode(...bytes.subarray(start, start + 4096));
34575
34495
  return name3;
34576
34496
  }
34577
- function nativeDyldTablePath(primary, sha2565) {
34497
+ function nativeDyldTablePath(primary, sha2564) {
34578
34498
  const prefix = primary.slice(0, primary.lastIndexOf("/") + 1);
34579
- return prefix + sha2565 + (primary.endsWith(".wasm") ? ".dyld" : "");
34499
+ return prefix + sha2564 + (primary.endsWith(".wasm") ? ".dyld" : "");
34580
34500
  }
34581
34501
  function readNativeDyldTableIndex(section2) {
34582
34502
  const bytes = new Uint8Array(section2);
34583
34503
  const view = new DataView(section2);
34584
34504
  if (bytes.length < 40) throw new Error("native dyld table index is truncated");
34585
- const sha2565 = Array.from(
34505
+ const sha2564 = Array.from(
34586
34506
  bytes.subarray(0, 32),
34587
34507
  (byte) => byte.toString(16).padStart(2, "0")
34588
34508
  ).join("");
@@ -34606,7 +34526,7 @@ function readNativeDyldTableIndex(section2) {
34606
34526
  at = end + 1;
34607
34527
  }
34608
34528
  if (at !== bytes.length) throw new Error("native dyld table index has trailing bytes");
34609
- return { sha256: sha2565, byteLength, packs, firsts };
34529
+ return { sha256: sha2564, byteLength, packs, firsts };
34610
34530
  }
34611
34531
  var NATIVE_DYLD_TABLE_SECTION, NATIVE_DYLD_PACKS_SECTION;
34612
34532
  var init_nativeDyldTableContract = __esm({
@@ -34630,12 +34550,12 @@ function readNativeLazyParts(section2) {
34630
34550
  for (let id = 0; id < count; id++) {
34631
34551
  const offset = 4 + id * NATIVE_LAZY_PART_BYTES;
34632
34552
  const digest3 = new Uint8Array(section2, offset, NATIVE_LAZY_DIGEST_BYTES);
34633
- const sha2565 = Array.from(digest3, (byte) => byte.toString(16).padStart(2, "0")).join(
34553
+ const sha2564 = Array.from(digest3, (byte) => byte.toString(16).padStart(2, "0")).join(
34634
34554
  ""
34635
34555
  );
34636
34556
  const byteLength = view.getUint32(offset + NATIVE_LAZY_DIGEST_BYTES, true);
34637
34557
  if (!byteLength) throw new Error("native code part has no bytes");
34638
- parts2.push({ sha256: sha2565, byteLength });
34558
+ parts2.push({ sha256: sha2564, byteLength });
34639
34559
  }
34640
34560
  return { parts: parts2, slotOffset, slotBytes };
34641
34561
  }
@@ -34669,34 +34589,11 @@ var init_nativeWasmContract = __esm({
34669
34589
  });
34670
34590
 
34671
34591
  // src/swift-guest-image-ledger.ts
34672
- function readNumber(bytes, position) {
34673
- if (position < bytes.length) {
34674
- const first = bytes[position];
34675
- if (first < 128) return [first, position + 1];
34676
- }
34677
- let value = 0;
34678
- let shift = 0;
34679
- for (; ; ) {
34680
- if (position >= bytes.length || shift > 63) throw new Error("invalid wasm integer");
34681
- const byte = bytes[position++];
34682
- value += (byte & 127) * 2 ** shift;
34683
- if (!(byte & 128)) return [value, position];
34684
- shift += 7;
34685
- }
34686
- }
34687
34592
  function encodeNumber(value) {
34688
- if (value < 128) return Buffer.from([value]);
34689
- const bytes = [];
34690
- do {
34691
- let byte = value % 128;
34692
- value = Math.floor(value / 128);
34693
- if (value) byte |= 128;
34694
- bytes.push(byte);
34695
- } while (value);
34696
- return Buffer.from(bytes);
34593
+ return Buffer.from(encodeWasmNumber(value));
34697
34594
  }
34698
34595
  function readString(bytes, position) {
34699
- const [length, start] = readNumber(bytes, position);
34596
+ const [length, start] = readULEB(bytes, position);
34700
34597
  if (start + length > bytes.length) throw new Error("invalid wasm string");
34701
34598
  return [
34702
34599
  Buffer.from(bytes.buffer, bytes.byteOffset + start, length).toString("utf8"),
@@ -35022,13 +34919,13 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
35022
34919
  for (const subsection of subsections) {
35023
34920
  if (subsection.kind === 6 && objcLoader !== void 0) {
35024
34921
  const content = subsection.parts[0];
35025
- const [count, entriesStart] = readNumber(content, 0);
34922
+ const [count, entriesStart] = readULEB(content, 0);
35026
34923
  const initWriter = new ByteWriter(content.length + 16);
35027
34924
  initWriter.bytes(content, 0, entriesStart);
35028
34925
  let entryStart = entriesStart;
35029
34926
  for (let i = 0; i < count; i++) {
35030
- const [, symbolStart] = readNumber(content, entryStart);
35031
- const [symbol2, entryEnd] = readNumber(content, symbolStart);
34927
+ const [, symbolStart] = readULEB(content, entryStart);
34928
+ const [symbol2, entryEnd] = readULEB(content, symbolStart);
35032
34929
  if (symbol2 === objcLoader) {
35033
34930
  initWriter.uleb(1);
35034
34931
  initWriter.bytes(content, symbolStart, entryEnd);
@@ -35098,7 +34995,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
35098
34995
  if (position < bytes.length && bytes[position] < 128) {
35099
34996
  size2 = bytes[position++];
35100
34997
  } else {
35101
- const [val, next] = readNumber(bytes, position);
34998
+ const [val, next] = readULEB(bytes, position);
35102
34999
  size2 = val;
35103
35000
  position = next;
35104
35001
  }
@@ -35598,7 +35495,7 @@ function createGuestImageLedger(input) {
35598
35495
  const digest3 = ({ object: object9 }) => {
35599
35496
  let value = digests2.get(object9);
35600
35497
  if (value === void 0) {
35601
- value = (0, import_node_crypto32.createHash)("sha256").update(objects2.get(object9).bytes).digest("hex");
35498
+ value = (0, import_node_crypto33.createHash)("sha256").update(objects2.get(object9).bytes).digest("hex");
35602
35499
  digests2.set(object9, value);
35603
35500
  }
35604
35501
  return value;
@@ -35813,7 +35710,7 @@ done:
35813
35710
  attributes #0 = { "wasm-import-module"="${NATIVE_TABLE_IMPORT_MODULE}" "wasm-import-name"="${NATIVE_DYLD_FUNCTION_IMPORT}" }`;
35814
35711
  }
35815
35712
  function sdkGuestCallerId(product) {
35816
- const hash = (0, import_node_crypto32.createHash)("sha256").update(product).digest().readUInt32LE(0);
35713
+ const hash = (0, import_node_crypto33.createHash)("sha256").update(product).digest().readUInt32LE(0);
35817
35714
  return (hash | 2147483648) >>> 0;
35818
35715
  }
35819
35716
  function sdkGuestSymbolName(product, name3) {
@@ -35854,7 +35751,7 @@ function nameGuestImageAliases(wasm, symbols) {
35854
35751
  const parts2 = [wasm.subarray(0, 8)];
35855
35752
  let position = 8;
35856
35753
  while (position < wasm.length) {
35857
- const [size2, start] = readNumber(wasm, position + 1);
35754
+ const [size2, start] = readULEB(wasm, position + 1);
35858
35755
  const end = start + size2;
35859
35756
  const custom = wasm[position] === 0 ? readString(wasm, start) : void 0;
35860
35757
  if (custom?.[0] !== "name") {
@@ -35865,17 +35762,17 @@ function nameGuestImageAliases(wasm, symbols) {
35865
35762
  const subsections = [encodedString("name")];
35866
35763
  let at = custom[1];
35867
35764
  while (at < end) {
35868
- const [subSize, subStart] = readNumber(wasm, at + 1);
35765
+ const [subSize, subStart] = readULEB(wasm, at + 1);
35869
35766
  const subEnd = subStart + subSize;
35870
35767
  if (wasm[at] !== 1) {
35871
35768
  subsections.push(wasm.subarray(at, subEnd));
35872
35769
  at = subEnd;
35873
35770
  continue;
35874
35771
  }
35875
- let [count, cursor] = readNumber(wasm, subStart);
35772
+ let [count, cursor] = readULEB(wasm, subStart);
35876
35773
  const entries2 = [encodeNumber(count)];
35877
35774
  for (; count > 0; count--) {
35878
- const [index, next] = readNumber(wasm, cursor);
35775
+ const [index, next] = readULEB(wasm, cursor);
35879
35776
  const [name3, after] = readString(wasm, next);
35880
35777
  cursor = after;
35881
35778
  const symbol2 = symbols[Number(alias.exec(name3)?.[1] ?? -1)];
@@ -35891,14 +35788,15 @@ function nameGuestImageAliases(wasm, symbols) {
35891
35788
  }
35892
35789
  return Buffer.concat(parts2);
35893
35790
  }
35894
- var import_node_crypto32, ByteWriter, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, sha256PairHex, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
35791
+ var import_node_crypto33, ByteWriter, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, sha256PairHex, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
35895
35792
  var init_swift_guest_image_ledger = __esm({
35896
35793
  "src/swift-guest-image-ledger.ts"() {
35897
35794
  "use strict";
35898
- import_node_crypto32 = require("node:crypto");
35795
+ import_node_crypto33 = require("node:crypto");
35899
35796
  init_nativeWasmContract();
35900
35797
  init_swift_sdk_image_wasm();
35901
35798
  init_swiftSdkLinkContract();
35799
+ init_wasm_binary_sections();
35902
35800
  ByteWriter = class {
35903
35801
  buf;
35904
35802
  pos = 0;
@@ -35919,16 +35817,13 @@ var init_swift_guest_image_ledger = __esm({
35919
35817
  this.buf[this.pos++] = value;
35920
35818
  }
35921
35819
  uleb(value) {
35922
- this.ensure(10);
35923
- let pos = this.pos;
35924
- const buf = this.buf;
35925
- do {
35926
- let byte = value % 128;
35927
- value = Math.floor(value / 128);
35928
- if (value) byte |= 128;
35929
- buf[pos++] = byte;
35930
- } while (value);
35931
- this.pos = pos;
35820
+ if (value < 128) {
35821
+ this.byte(value);
35822
+ return;
35823
+ }
35824
+ const encoded = encodeWasmNumber(value);
35825
+ this.ensure(encoded.length);
35826
+ for (let i = 0; i < encoded.length; i++) this.buf[this.pos++] = encoded[i];
35932
35827
  }
35933
35828
  bytes(source, start = 0, end = source.length) {
35934
35829
  const len = end - start;
@@ -35952,7 +35847,7 @@ var init_swift_guest_image_ledger = __esm({
35952
35847
  };
35953
35848
  OBJC_INIT_RECORD = ".objc_init";
35954
35849
  TABLE_INDEX_RELOCATIONS = /* @__PURE__ */ new Set([1, 2, 12, 18, 19, 24]);
35955
- sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0, import_node_crypto32.createHash)("sha256").update(first).update("\0").update(second).digest("hex");
35850
+ sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0, import_node_crypto33.createHash)("sha256").update(first).update("\0").update(second).digest("hex");
35956
35851
  GUEST_DYLD_VALUES_SECTION = "peach_dyld_values";
35957
35852
  GUEST_LAZY_FUNCTION_BASE = 2 ** 32;
35958
35853
  SDK_DYLD_RESOLVER = "__peach_sdk_dyld_resolve";
@@ -36444,19 +36339,7 @@ var init_wasm_narrow_boundary = __esm({
36444
36339
  function sha256Buffer(bytes) {
36445
36340
  if (typeof Bun !== "undefined")
36446
36341
  return Buffer.from(new Bun.CryptoHasher("sha256").update(bytes).digest());
36447
- return (0, import_node_crypto33.createHash)("sha256").update(bytes).digest();
36448
- }
36449
- function sha256Hex3(bytes) {
36450
- if (typeof Bun !== "undefined")
36451
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
36452
- return (0, import_node_crypto33.createHash)("sha256").update(bytes).digest("hex");
36453
- }
36454
- function uleb2(value) {
36455
- const bytes = [];
36456
- for (let rest = value; ; rest = Math.floor(rest / 128)) {
36457
- if (rest < 128) return [...bytes, rest];
36458
- bytes.push(rest % 128 | 128);
36459
- }
36342
+ return (0, import_node_crypto34.createHash)("sha256").update(bytes).digest();
36460
36343
  }
36461
36344
  function encodeGuestDyldTable(rows) {
36462
36345
  const encoded = rows.map((row) => ({ ...row, bytes: Buffer.from(row.name) })).sort((a, b) => Buffer.compare(a.bytes, b.bytes));
@@ -36470,7 +36353,7 @@ function encodeGuestDyldTable(rows) {
36470
36353
  value.writeBigUInt64LE(row.value);
36471
36354
  const bytes = Buffer.concat([
36472
36355
  row.bytes,
36473
- Buffer.from([0, ...uleb2(row.image), row.kind]),
36356
+ Buffer.from([0, ...encodeWasmNumber(row.image), row.kind]),
36474
36357
  value
36475
36358
  ]);
36476
36359
  if (!current2.length) firsts.push(row.bytes);
@@ -36540,8 +36423,8 @@ function guestDyldValueRange(map2) {
36540
36423
  function swiftDyldTableReference(modulePath, module2) {
36541
36424
  const section2 = readWasmCustomSection(module2, NATIVE_DYLD_TABLE_SECTION);
36542
36425
  if (!section2 || readWasmCustomSection(module2, NATIVE_DYLD_PACKS_SECTION)) return;
36543
- const { sha256: sha2565, byteLength } = readNativeDyldTableIndex(Uint8Array.from(section2).buffer);
36544
- return { path: nativeDyldTablePath(modulePath, sha2565), sha256: sha2565, byteLength };
36426
+ const { sha256: sha2564, byteLength } = readNativeDyldTableIndex(Uint8Array.from(section2).buffer);
36427
+ return { path: nativeDyldTablePath(modulePath, sha2564), sha256: sha2564, byteLength };
36545
36428
  }
36546
36429
  function splitSwiftDyldTable(wasm) {
36547
36430
  const packs = readWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION);
@@ -36549,18 +36432,20 @@ function splitSwiftDyldTable(wasm) {
36549
36432
  const bytes = Buffer.from(packs);
36550
36433
  return {
36551
36434
  module: dropWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION),
36552
- table: { sha256: sha256Hex3(bytes), bytes }
36435
+ table: { sha256: sha256Hex2(bytes), bytes }
36553
36436
  };
36554
36437
  }
36555
- var import_node_crypto33, import_node_zlib4, PACK_BYTES;
36438
+ var import_node_crypto34, import_node_zlib4, PACK_BYTES;
36556
36439
  var init_swift_guest_dyld_table = __esm({
36557
36440
  "src/swift-guest-dyld-table.ts"() {
36558
36441
  "use strict";
36559
- import_node_crypto33 = require("node:crypto");
36442
+ import_node_crypto34 = require("node:crypto");
36560
36443
  import_node_zlib4 = require("node:zlib");
36561
36444
  init_nativeDyldTableContract();
36445
+ init_sha256();
36562
36446
  init_swift_guest_image_ledger();
36563
36447
  init_swift_guest_linked_spans();
36448
+ init_wasm_binary_sections();
36564
36449
  init_wasm_narrow_boundary();
36565
36450
  PACK_BYTES = 64 * 1024;
36566
36451
  }
@@ -36655,8 +36540,8 @@ function primaryFunctionTable(bytes) {
36655
36540
  return { name: wasmReader(exported, 0).name(), table64 };
36656
36541
  }
36657
36542
  function vectorSection(id, count, parts2) {
36658
- const body = Buffer.concat([Buffer.from(uleb3(count)), ...parts2]);
36659
- return Buffer.concat([Buffer.from([id, ...uleb3(body.length)]), body]);
36543
+ const body = Buffer.concat([Buffer.from(encodeWasmNumber(count)), ...parts2]);
36544
+ return Buffer.concat([Buffer.from([id, ...encodeWasmNumber(body.length)]), body]);
36660
36545
  }
36661
36546
  function rewriteSections(bytes, sections, changes) {
36662
36547
  const out = [bytes.subarray(0, 8)];
@@ -36712,9 +36597,9 @@ function appendLazyPlacement(bytes, functions, table) {
36712
36597
  vectorSection(2, count + 1, [
36713
36598
  found2 && header ? bytes.subarray(header.at, found2.end) : new Uint8Array(),
36714
36599
  Buffer.from([
36715
- ...uleb3(module2.length),
36600
+ ...encodeWasmNumber(module2.length),
36716
36601
  ...module2,
36717
- ...uleb3(name4.length),
36602
+ ...encodeWasmNumber(name4.length),
36718
36603
  ...name4,
36719
36604
  1,
36720
36605
  112,
@@ -36736,7 +36621,7 @@ function appendLazyPlacement(bytes, functions, table) {
36736
36621
  elements.splice(
36737
36622
  placementIndex,
36738
36623
  0,
36739
- Buffer.from([1, 0, ...uleb3(functions.length), ...functions.flatMap(uleb3)])
36624
+ Buffer.from([1, 0, ...encodeWasmNumber(functions.length), ...functions.flatMap(encodeWasmNumber)])
36740
36625
  );
36741
36626
  const place2 = imports2.functions + declared.length;
36742
36627
  const instructions = [
@@ -36750,7 +36635,7 @@ function appendLazyPlacement(bytes, functions, table) {
36750
36635
  1,
36751
36636
  252,
36752
36637
  12,
36753
- ...uleb3(placementIndex),
36638
+ ...encodeWasmNumber(placementIndex),
36754
36639
  0,
36755
36640
  11
36756
36641
  ];
@@ -36771,14 +36656,14 @@ function appendLazyPlacement(bytes, functions, table) {
36771
36656
  3,
36772
36657
  vectorSection(3, declared.length + 1, [
36773
36658
  ...declared,
36774
- Buffer.from(uleb3(types2.length))
36659
+ Buffer.from(encodeWasmNumber(types2.length))
36775
36660
  ])
36776
36661
  ],
36777
36662
  [
36778
36663
  7,
36779
36664
  vectorSection(7, exports2.length + 1, [
36780
36665
  ...exports2,
36781
- Buffer.from([...uleb3(name3.length), ...name3, 0, ...uleb3(place2)])
36666
+ Buffer.from([...encodeWasmNumber(name3.length), ...name3, 0, ...encodeWasmNumber(place2)])
36782
36667
  ])
36783
36668
  ],
36784
36669
  [9, vectorSection(9, elements.length, elements)],
@@ -36786,7 +36671,7 @@ function appendLazyPlacement(bytes, functions, table) {
36786
36671
  10,
36787
36672
  vectorSection(10, bodies.length + 1, [
36788
36673
  ...bodies,
36789
- Buffer.from([...uleb3(instructions.length), ...instructions])
36674
+ Buffer.from([...encodeWasmNumber(instructions.length), ...instructions])
36790
36675
  ])
36791
36676
  ]
36792
36677
  ])
@@ -36908,40 +36793,31 @@ function nameLazyFunctions(bytes, functions) {
36908
36793
  for (const index of functions) {
36909
36794
  if (names.has(index)) continue;
36910
36795
  const name3 = Buffer.from(String(index - imported));
36911
- names.set(index, Buffer.from([...uleb3(name3.length), ...name3]));
36796
+ names.set(index, Buffer.from([...encodeWasmNumber(name3.length), ...name3]));
36912
36797
  }
36913
36798
  const ordered = [...names].sort(([a], [b]) => a - b);
36914
36799
  const functionNames = Buffer.concat([
36915
- Buffer.from(uleb3(ordered.length)),
36916
- ...ordered.flatMap(([index, name3]) => [Buffer.from(uleb3(index)), name3])
36800
+ Buffer.from(encodeWasmNumber(ordered.length)),
36801
+ ...ordered.flatMap(([index, name3]) => [Buffer.from(encodeWasmNumber(index)), name3])
36917
36802
  ]);
36918
- const content = [...subsections, { id: 1, body: functionNames }].sort((a, b) => a.id - b.id).flatMap(({ id, body }) => [Buffer.from([id, ...uleb3(body.length)]), body]);
36803
+ const content = [...subsections, { id: 1, body: functionNames }].sort((a, b) => a.id - b.id).flatMap(({ id, body }) => [Buffer.from([id, ...encodeWasmNumber(body.length)]), body]);
36919
36804
  const label = Buffer.from("name");
36920
36805
  const payload = Buffer.concat([
36921
- Buffer.from([...uleb3(label.length), ...label]),
36806
+ Buffer.from([...encodeWasmNumber(label.length), ...label]),
36922
36807
  ...content
36923
36808
  ]);
36924
36809
  const out = [bytes.subarray(0, 8)];
36925
36810
  for (const s of sections) if (s !== custom) out.push(bytes.subarray(s.offset, s.end));
36926
- out.push(Buffer.from([0, ...uleb3(payload.length)]), payload);
36811
+ out.push(Buffer.from([0, ...encodeWasmNumber(payload.length)]), payload);
36927
36812
  return Buffer.concat(out);
36928
36813
  }
36929
- var uleb3, SECTION_ORDER, readExport, lastTableElement, exportName;
36814
+ var SECTION_ORDER, readExport, lastTableElement, exportName;
36930
36815
  var init_swift_guest_dyld_functions = __esm({
36931
36816
  "src/swift-guest-dyld-functions.ts"() {
36932
36817
  "use strict";
36933
36818
  init_nativeWasmContract();
36934
36819
  init_swift_sdk_image_wasm();
36935
- uleb3 = (value) => {
36936
- const out = [];
36937
- do {
36938
- let byte = value % 128;
36939
- value = Math.floor(value / 128);
36940
- if (value) byte |= 128;
36941
- out.push(byte);
36942
- } while (value);
36943
- return out;
36944
- };
36820
+ init_wasm_binary_sections();
36945
36821
  SECTION_ORDER = [1, 2, 3, 4, 5, 13, 6, 7, 8, 9, 12, 10, 11];
36946
36822
  readExport = (r) => {
36947
36823
  r.name();
@@ -37008,7 +36884,7 @@ function selectedGuestManifestInputs(plan, selection, identities, readSelected)
37008
36884
  throw new Error(
37009
36885
  `selected member has no original identity: ${item.artifact}(${item.member})`
37010
36886
  );
37011
- if (origin && (0, import_node_crypto34.createHash)("sha256").update(bytes).digest("hex") !== origin.sha256)
36887
+ if (origin && (0, import_node_crypto35.createHash)("sha256").update(bytes).digest("hex") !== origin.sha256)
37012
36888
  throw new Error(
37013
36889
  `selected member differs from original: ${item.artifact}(${item.member})`
37014
36890
  );
@@ -37055,7 +36931,7 @@ function createGuestImageManifest(image) {
37055
36931
  cpuType: -1,
37056
36932
  cpuSubtype: 0
37057
36933
  };
37058
- const digest3 = (0, import_node_crypto34.createHash)("sha256");
36934
+ const digest3 = (0, import_node_crypto35.createHash)("sha256");
37059
36935
  const sizeBuf = Buffer.allocUnsafe(8);
37060
36936
  const add = (bytes) => {
37061
36937
  sizeBuf.writeBigUInt64BE(BigInt(bytes.byteLength));
@@ -37097,11 +36973,11 @@ function createGuestImageManifest(image) {
37097
36973
  regions: image.regions
37098
36974
  };
37099
36975
  }
37100
- var import_node_crypto34, import_node_fs60, framedLinkOptionsCache;
36976
+ var import_node_crypto35, import_node_fs60, framedLinkOptionsCache;
37101
36977
  var init_swift_guest_manifest = __esm({
37102
36978
  "src/swift-guest-manifest.ts"() {
37103
36979
  "use strict";
37104
- import_node_crypto34 = require("node:crypto");
36980
+ import_node_crypto35 = require("node:crypto");
37105
36981
  import_node_fs60 = require("node:fs");
37106
36982
  init_swift_guest_link_plan();
37107
36983
  init_swift_wasm_prune();
@@ -37567,11 +37443,11 @@ var init_swift_guest_projection_storage = __esm({
37567
37443
  function frameworkRuntimeProductId(product) {
37568
37444
  return `swift-package/${product.packageName}/${product.product.name}`;
37569
37445
  }
37570
- var import_node_crypto35, v4, packageSchema;
37446
+ var import_node_crypto36, v4, packageSchema;
37571
37447
  var init_swift_runtime_products = __esm({
37572
37448
  "src/swift-runtime-products.ts"() {
37573
37449
  "use strict";
37574
- import_node_crypto35 = require("node:crypto");
37450
+ import_node_crypto36 = require("node:crypto");
37575
37451
  v4 = __toESM(require("peachsim/vendor/valibot"), 1);
37576
37452
  init_is_record();
37577
37453
  packageSchema = v4.object({
@@ -37602,7 +37478,7 @@ function canonicalArchivePath(file) {
37602
37478
  function sdkArtifactBytes(root, artifact) {
37603
37479
  const file = import_node_path61.default.resolve(root, artifact.path);
37604
37480
  const linked = (0, import_node_fs61.readFileSync)(file);
37605
- const hash = (bytes) => (0, import_node_crypto36.createHash)("sha256").update(bytes).digest("hex");
37481
+ const hash = (bytes) => (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex");
37606
37482
  if (hash(linked) === artifact.sha256) return { source: linked, linked };
37607
37483
  if (artifact.kind !== "archive" || artifact.path !== `${SWIFT_SDK_PRODUCT_DIRECTORY}/libFoundation.a`)
37608
37484
  throw new Error(`SDK product artifact changed ${file}`);
@@ -37628,9 +37504,9 @@ function indexSdkMembers(bytes) {
37628
37504
  );
37629
37505
  }
37630
37506
  function verifySdkObjectTransform(source, linked, sourceSha256, transformation) {
37631
- if ((0, import_node_crypto36.createHash)("sha256").update(source).digest("hex") !== sourceSha256 || transformation.inputSha256 !== sourceSha256)
37507
+ if ((0, import_node_crypto37.createHash)("sha256").update(source).digest("hex") !== sourceSha256 || transformation.inputSha256 !== sourceSha256)
37632
37508
  throw new Error("SDK object transform input changed");
37633
- if ((0, import_node_crypto36.createHash)("sha256").update(linked).digest("hex") !== transformation.outputSha256 || transformation.kind === "swiftrt" && !Buffer.from(patchSwiftrtObject(source)).equals(linked))
37509
+ if ((0, import_node_crypto37.createHash)("sha256").update(linked).digest("hex") !== transformation.outputSha256 || transformation.kind === "swiftrt" && !Buffer.from(patchSwiftrtObject(source)).equals(linked))
37634
37510
  throw new Error("SDK object transform output changed");
37635
37511
  }
37636
37512
  function readGuestRuntimeCatalogs(sdkRoot, distributionRoot) {
@@ -37910,7 +37786,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
37910
37786
  const digest3 = (file) => {
37911
37787
  let value = hashes.get(file);
37912
37788
  if (!value) {
37913
- value = (0, import_node_crypto36.createHash)("sha256").update((0, import_node_fs61.readFileSync)(file)).digest("hex");
37789
+ value = (0, import_node_crypto37.createHash)("sha256").update((0, import_node_fs61.readFileSync)(file)).digest("hex");
37914
37790
  hashes.set(file, value);
37915
37791
  }
37916
37792
  return value;
@@ -37978,9 +37854,9 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
37978
37854
  if (input.member) {
37979
37855
  if (original.kind !== "archive")
37980
37856
  throw new Error(`SDK input member has no archive ${originalFile}`);
37981
- const { name: name3, ordinal, sha256: sha2565 } = input.member;
37857
+ const { name: name3, ordinal, sha256: sha2564 } = input.member;
37982
37858
  const member = original.members.find(
37983
- (entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 === sha2565
37859
+ (entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 === sha2564
37984
37860
  );
37985
37861
  let records = archiveMembers.get(originalFile);
37986
37862
  if (!records) {
@@ -37988,7 +37864,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
37988
37864
  archiveMembers.set(originalFile, records);
37989
37865
  }
37990
37866
  const bytes = records.filter((entry) => entry.name === name3)[ordinal - 1]?.bytes;
37991
- if (!member || !bytes || (0, import_node_crypto36.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
37867
+ if (!member || !bytes || (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
37992
37868
  throw new Error(`SDK input member changed ${originalFile}(${name3})`);
37993
37869
  } else if (original.kind !== "object")
37994
37870
  throw new Error(`SDK object input has no member ${originalFile}`);
@@ -38017,7 +37893,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
38017
37893
  const member = members2.get(key2);
38018
37894
  const source = indexed.source.get(key2);
38019
37895
  const linked2 = indexed.linked.get(key2);
38020
- if (!member || !source || !linked2 || (0, import_node_crypto36.createHash)("sha256").update(source).digest("hex") !== member.sha256 || (0, import_node_crypto36.createHash)("sha256").update(linked2).digest("hex") !== digest3(origin.original))
37896
+ if (!member || !source || !linked2 || (0, import_node_crypto37.createHash)("sha256").update(source).digest("hex") !== member.sha256 || (0, import_node_crypto37.createHash)("sha256").update(linked2).digest("hex") !== digest3(origin.original))
38021
37897
  throw new Error(`SDK member differs from source product ${origin.original}`);
38022
37898
  add({
38023
37899
  path: origin.original,
@@ -38082,7 +37958,7 @@ function guestAliasedSdkArchiveArtifacts(options2) {
38082
37958
  const key2 = JSON.stringify([member.name, member.ordinal]);
38083
37959
  const bytes = sourceMembers[index].get(key2);
38084
37960
  const linked = viewMembers[index].get(key2);
38085
- return bytes !== void 0 && linked !== void 0 && (0, import_node_crypto36.createHash)("sha256").update(bytes).digest("hex") === entry.sha256 && (0, import_node_crypto36.createHash)("sha256").update(linked).digest("hex") === member.sha256;
37961
+ return bytes !== void 0 && linked !== void 0 && (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex") === entry.sha256 && (0, import_node_crypto37.createHash)("sha256").update(linked).digest("hex") === member.sha256;
38086
37962
  }) ? [product2.id] : []
38087
37963
  )
38088
37964
  );
@@ -38115,11 +37991,11 @@ function guestAliasedSdkArchiveArtifacts(options2) {
38115
37991
  }
38116
37992
  return result;
38117
37993
  }
38118
- var import_node_crypto36, import_node_fs61, import_node_path61, v5, SDK_CONTAINING_IMAGE;
37994
+ var import_node_crypto37, import_node_fs61, import_node_path61, v5, SDK_CONTAINING_IMAGE;
38119
37995
  var init_swift_guest_runtime_plan = __esm({
38120
37996
  "src/swift-guest-runtime-plan.ts"() {
38121
37997
  "use strict";
38122
- import_node_crypto36 = require("node:crypto");
37998
+ import_node_crypto37 = require("node:crypto");
38123
37999
  import_node_fs61 = require("node:fs");
38124
38000
  import_node_path61 = __toESM(require("node:path"), 1);
38125
38001
  v5 = __toESM(require("peachsim/vendor/valibot"), 1);
@@ -39955,13 +39831,8 @@ function clangBinaryStamp(file) {
39955
39831
  const stat2 = (0, import_node_fs64.statSync)(file, { bigint: true });
39956
39832
  return [file, stat2.size, stat2.mtimeNs].join(":");
39957
39833
  }
39958
- function sha256Hex4(bytes) {
39959
- if (typeof Bun !== "undefined")
39960
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
39961
- return (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex");
39962
- }
39963
39834
  function clangWrapperStamp(file) {
39964
- return sha256Hex4((0, import_node_fs64.readFileSync)(file));
39835
+ return sha256Hex2((0, import_node_fs64.readFileSync)(file));
39965
39836
  }
39966
39837
  function clangArgsNeedCwd(args) {
39967
39838
  const pathFlags = /* @__PURE__ */ new Set([
@@ -40139,7 +40010,7 @@ function sourceGuestClangLinkOptions(options2) {
40139
40010
  import_node_path64.default.join(options2.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)
40140
40011
  )))
40141
40012
  throw new Error(`unsupported source object producer ${file}`);
40142
- const key2 = sha256Hex4(
40013
+ const key2 = sha256Hex2(
40143
40014
  JSON.stringify([
40144
40015
  "clang-link-options/v2",
40145
40016
  clangArgsNeedCwd(command.args) ? process.cwd() : null,
@@ -40150,7 +40021,7 @@ function sourceGuestClangLinkOptions(options2) {
40150
40021
  clangProducerStamp(file)
40151
40022
  ])
40152
40023
  );
40153
- const cacheFile = import_node_path64.default.join(cacheDirectory, sha256Hex4(file) + ".json");
40024
+ const cacheFile = import_node_path64.default.join(cacheDirectory, sha256Hex2(file) + ".json");
40154
40025
  const cached4 = readClangLinkOptions(cacheFile, key2);
40155
40026
  if (cached4) {
40156
40027
  validateClangLinkOptions(cached4);
@@ -40272,30 +40143,12 @@ function wasmAutolinkEntries(bytes, out) {
40272
40143
  const len = bytes.length;
40273
40144
  while (pos < len) {
40274
40145
  const id = bytes[pos++];
40275
- let sz = bytes[pos++];
40276
- if (sz >= 128) {
40277
- sz &= 127;
40278
- let shift = 7;
40279
- while (true) {
40280
- const b = bytes[pos++];
40281
- sz |= (b & 127) << shift;
40282
- if (b < 128) break;
40283
- shift += 7;
40284
- }
40285
- }
40146
+ let sz;
40147
+ [sz, pos] = readULEB(bytes, pos, len);
40286
40148
  const end = pos + sz;
40287
40149
  if (id === 0) {
40288
- let nLen = bytes[pos++];
40289
- if (nLen >= 128) {
40290
- nLen &= 127;
40291
- let shift = 7;
40292
- while (true) {
40293
- const b = bytes[pos++];
40294
- nLen |= (b & 127) << shift;
40295
- if (b < 128) break;
40296
- shift += 7;
40297
- }
40298
- }
40150
+ let nLen;
40151
+ [nLen, pos] = readULEB(bytes, pos, end);
40299
40152
  if (nLen === 24 && raw2.toString("ascii", pos, pos + 24) === ".swift1_autolink_entries") {
40300
40153
  const payload = raw2.toString("utf8", pos + 24, end);
40301
40154
  for (const entry of payload.split("\0")) {
@@ -40363,7 +40216,7 @@ function sourceGuestRuntimeLinks(options2) {
40363
40216
  const file = import_node_path64.default.resolve(directory2, alias.moduleMap);
40364
40217
  if (!file.startsWith(directory2 + import_node_path64.default.sep))
40365
40218
  throw new Error(`invalid framework module map ${alias.moduleMap}`);
40366
- if ((0, import_node_crypto37.createHash)("sha256").update((0, import_node_fs64.readFileSync)(file)).digest("hex") !== alias.moduleMapSha256)
40219
+ if (sha256Hex2((0, import_node_fs64.readFileSync)(file)) !== alias.moduleMapSha256)
40367
40220
  throw new Error(`framework module map changed ${alias.moduleMap}`);
40368
40221
  sdkAliases.set(alias.name, {
40369
40222
  product: product.id,
@@ -40419,7 +40272,7 @@ function sourceGuestRuntimeLinks(options2) {
40419
40272
  const map2 = import_node_path64.default.resolve(root, alias.moduleMap);
40420
40273
  if (!map2.startsWith(root + import_node_path64.default.sep))
40421
40274
  throw new Error(`invalid framework module map ${alias.moduleMap}`);
40422
- if ((0, import_node_crypto37.createHash)("sha256").update((0, import_node_fs64.readFileSync)(map2)).digest("hex") !== alias.moduleMapSha256)
40275
+ if (sha256Hex2((0, import_node_fs64.readFileSync)(map2)) !== alias.moduleMapSha256)
40423
40276
  throw new Error(`framework module map changed ${alias.moduleMap}`);
40424
40277
  frameworkAliases.set(alias.name, { kind: "package", targets: closure(alias.targets) });
40425
40278
  }
@@ -40520,18 +40373,19 @@ function logicalGuestLinkOptions(args, identities, roots) {
40520
40373
  }
40521
40374
  return output;
40522
40375
  }
40523
- var import_node_child_process29, import_node_crypto37, import_node_fs64, import_node_path64, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
40376
+ var import_node_child_process29, import_node_fs64, import_node_path64, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
40524
40377
  var init_swift_guest_source_inputs = __esm({
40525
40378
  "src/swift-guest-source-inputs.ts"() {
40526
40379
  "use strict";
40527
40380
  import_node_child_process29 = require("node:child_process");
40528
- import_node_crypto37 = require("node:crypto");
40529
40381
  import_node_fs64 = require("node:fs");
40530
40382
  import_node_path64 = __toESM(require("node:path"), 1);
40531
40383
  init_forked_script_contract();
40384
+ init_sha256();
40532
40385
  init_swift_guest_source_plan();
40533
40386
  init_swift_runtime_products();
40534
40387
  init_swift_wasm_prune();
40388
+ init_wasm_binary_sections();
40535
40389
  CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
40536
40390
  PARALLEL_REPLAY = `
40537
40391
  const { spawn } = require('node:child_process')
@@ -45502,6 +45356,10 @@ ${SWIFT_SDK_IMAGE_VERSION}
45502
45356
  `).update(inputs2).update(products.length === 0 ? "" : `
45503
45357
  products ${products.join(" ")}`).digest("hex").slice(0, 32);
45504
45358
  }
45359
+ function swiftSdkImageVariantKey(baseKey, required) {
45360
+ if (!required.length) return baseKey;
45361
+ return (0, import_node_crypto44.createHash)("sha256").update(baseKey).update(JSON.stringify(required)).digest("hex").slice(0, 32);
45362
+ }
45505
45363
  function swiftSdkImageEntry(key2, scopedLookups) {
45506
45364
  const inputs2 = { image: key2 };
45507
45365
  return {
@@ -45531,15 +45389,15 @@ function cached3(directory2, key2) {
45531
45389
  return void 0;
45532
45390
  }
45533
45391
  }
45534
- function sdkImageAt(directory2, key2, sha2565) {
45392
+ function sdkImageAt(directory2, key2, sha2564) {
45535
45393
  refreshSwiftCacheHold(directory2);
45536
- const cacheKey = `${directory2}\0${sha2565}`;
45394
+ const cacheKey = `${directory2}\0${sha2564}`;
45537
45395
  let loadedInterface;
45538
45396
  return {
45539
45397
  key: key2,
45540
45398
  directory: directory2,
45541
45399
  image: import_node_path73.default.join(directory2, IMAGE_FILE),
45542
- sha256: sha2565,
45400
+ sha256: sha2564,
45543
45401
  get sdkInterface() {
45544
45402
  if (loadedInterface) return loadedInterface;
45545
45403
  const memo2 = cachedSdkInterfaces.get(cacheKey);
@@ -45553,11 +45411,24 @@ function sdkImageAt(directory2, key2, sha2565) {
45553
45411
  }
45554
45412
  async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkImports2 = [], options2) {
45555
45413
  const { imports: imports2, products } = swiftSdkImageProducts(moduleRoot, frameworkImports2);
45556
- const key2 = swiftSdkImageKey(moduleRoot, scopedLookups, products);
45557
- const directory2 = import_node_path73.default.join(swiftCacheDir(), "swift-sdk-images", key2);
45414
+ const images = import_node_path73.default.join(swiftCacheDir(), "swift-sdk-images");
45415
+ const baseKey = swiftSdkImageKey(moduleRoot, scopedLookups, products);
45416
+ const required = [...new Set(options2?.requiredGuestSymbols)].sort();
45417
+ const base2 = cached3(import_node_path73.default.join(images, baseKey), baseKey);
45418
+ if (base2) {
45419
+ if (!required.length) return base2;
45420
+ const { functions, data, tls } = base2.sdkInterface;
45421
+ if (required.every(
45422
+ (name3) => functions[name3] !== void 0 || data[name3] !== void 0 || tls[name3] !== void 0
45423
+ ))
45424
+ return base2;
45425
+ }
45426
+ const key2 = swiftSdkImageVariantKey(baseKey, required);
45427
+ const directory2 = import_node_path73.default.join(images, key2);
45558
45428
  const existing = cached3(directory2, key2);
45559
45429
  if (existing) return existing;
45560
- if (!options2?.producer && !swiftDistributionAt(moduleRoot) && import_node_path73.default.resolve(moduleRoot) === sourceSwiftCheckout() && process.platform === "linux" && process.env.TM_SESSION) {
45430
+ const distribution = swiftDistributionAt(moduleRoot);
45431
+ if (!options2?.producer && !required.length && !distribution && import_node_path73.default.resolve(moduleRoot) === sourceSwiftCheckout() && process.platform === "linux" && process.env.TM_SESSION) {
45561
45432
  const { produceSwiftSdkImage: produceSwiftSdkImage2 } = await Promise.resolve().then(() => (init_swift_sdk_image_producer(), swift_sdk_image_producer_exports));
45562
45433
  await produceSwiftSdkImage2({
45563
45434
  moduleRoot,
@@ -45578,7 +45449,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
45578
45449
  return cached3(directory2, key2) ?? withSwiftRootLock(directory2, async () => {
45579
45450
  const previous = cached3(directory2, key2);
45580
45451
  if (previous) return previous;
45581
- if (swiftDistributionAt(moduleRoot)) {
45452
+ if (distribution && !required.length) {
45582
45453
  const entry = swiftSdkImageEntry(key2, scopedLookups);
45583
45454
  const fetched = fetchNativeEntry("sdk-image", entry.name, entry.key);
45584
45455
  if (fetched) {
@@ -45615,6 +45486,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
45615
45486
  work,
45616
45487
  scopedLookups,
45617
45488
  imports2,
45489
+ required,
45618
45490
  releaseFrameworks
45619
45491
  )
45620
45492
  );
@@ -45623,7 +45495,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
45623
45495
  }
45624
45496
  });
45625
45497
  }
45626
- async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, releaseFrameworks) {
45498
+ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, required, releaseFrameworks) {
45627
45499
  (0, import_node_fs73.rmSync)(work, { recursive: true, force: true });
45628
45500
  (0, import_node_fs73.mkdirSync)(work, { recursive: true });
45629
45501
  const toolchain = swiftModuleToolchain(moduleRoot);
@@ -45784,7 +45656,10 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
45784
45656
  const quote3 = (value) => JSON.stringify(value);
45785
45657
  (0, import_node_fs73.writeFileSync)(
45786
45658
  import_node_path73.default.join(work, "exports.rsp"),
45787
- [...defined].map((name3) => quote3(`--export-if-defined=${name3}`)).join("\n")
45659
+ [
45660
+ ...[...defined].map((name3) => quote3(`--export-if-defined=${name3}`)),
45661
+ ...required.filter((name3) => !defined.has(name3)).map((name3) => quote3(`--export=${name3}`))
45662
+ ].join("\n")
45788
45663
  );
45789
45664
  const guestServices = import_node_path73.default.join(work, "peach-guest-services.allow");
45790
45665
  (0, import_node_fs73.writeFileSync)(guestServices, peachGuestServiceAllowlist);
@@ -45875,11 +45750,12 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
45875
45750
  import_node_path73.default.join(work, IMAGE_DIGEST),
45876
45751
  typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(image).digest("hex") : (0, import_node_crypto44.createHash)("sha256").update(image).digest("hex")
45877
45752
  );
45878
- if (swiftSdkImageKey(
45753
+ const baseKey = swiftSdkImageKey(
45879
45754
  moduleRoot,
45880
45755
  scopedLookups,
45881
45756
  swiftSdkImageProducts(moduleRoot, imports2).products
45882
- ) !== key2)
45757
+ );
45758
+ if (swiftSdkImageVariantKey(baseKey, required) !== key2)
45883
45759
  throw new Error("Swift SDK image inputs changed during compilation");
45884
45760
  for (const name3 of (0, import_node_fs73.readdirSync)(work))
45885
45761
  if (!SWIFT_SDK_IMAGE_FILES.includes(name3))
@@ -46290,12 +46166,12 @@ function encodeNativeSdkLater(later) {
46290
46166
  const view = new DataView(bytes.buffer);
46291
46167
  view.setUint32(0, files2.length, true);
46292
46168
  let at = 4;
46293
- for (const { sha256: sha2565, byteLength } of files2) {
46294
- if (!/^[a-f0-9]{64}$/.test(sha2565))
46169
+ for (const { sha256: sha2564, byteLength } of files2) {
46170
+ if (!/^[a-f0-9]{64}$/.test(sha2564))
46295
46171
  throw new Error("Swift SDK later data needs a sha256 digest");
46296
46172
  if (!byteLength) throw new Error("Swift SDK later data file is empty");
46297
46173
  for (let i = 0; i < LATER_DIGEST_BYTES; i++)
46298
- bytes[at + i] = Number.parseInt(sha2565.slice(i * 2, i * 2 + 2), 16);
46174
+ bytes[at + i] = Number.parseInt(sha2564.slice(i * 2, i * 2 + 2), 16);
46299
46175
  view.setUint32(at + LATER_DIGEST_BYTES, byteLength, true);
46300
46176
  at += LATER_DIGEST_BYTES + 4;
46301
46177
  }
@@ -46320,13 +46196,13 @@ function decodeNativeSdkLater(trailer) {
46320
46196
  const files2 = [];
46321
46197
  for (let file = 0; file < count; file++) {
46322
46198
  if (at + LATER_DIGEST_BYTES + 4 > trailer.byteLength) throw truncated();
46323
- const sha2565 = Array.from(
46199
+ const sha2564 = Array.from(
46324
46200
  trailer.subarray(at, at + LATER_DIGEST_BYTES),
46325
46201
  (byte) => byte.toString(16).padStart(2, "0")
46326
46202
  ).join("");
46327
46203
  const byteLength = view.getUint32(at + LATER_DIGEST_BYTES, true);
46328
46204
  if (!byteLength) throw new Error("Swift SDK binding names empty later data");
46329
- files2.push({ sha256: sha2565, byteLength });
46205
+ files2.push({ sha256: sha2564, byteLength });
46330
46206
  at += LATER_DIGEST_BYTES + 4;
46331
46207
  }
46332
46208
  if (!files2.length || at + 4 > trailer.byteLength) throw truncated();
@@ -46561,8 +46437,8 @@ function finishSwiftAppModuleFile(file) {
46561
46437
  return;
46562
46438
  }
46563
46439
  const thunks = sdkImportThunks(prefix);
46564
- const nameBytes = Buffer.from(encodedName2(NATIVE_SDK_THUNK_SECTION));
46565
- const header = Buffer.from([0, ...uleb4(nameBytes.length + thunks.length)]);
46440
+ const nameBytes = Buffer.from(encodeWasmName(NATIVE_SDK_THUNK_SECTION));
46441
+ const header = Buffer.from([0, ...encodeWasmNumber(nameBytes.length + thunks.length)]);
46566
46442
  (0, import_node_fs74.appendFileSync)(file, Buffer.concat([header, nameBytes, thunks]));
46567
46443
  }
46568
46444
  function swiftAppModuleInputs(tokens3, buildRoot, sdkLibraries) {
@@ -46914,17 +46790,17 @@ function sdkImportThunks(bytes) {
46914
46790
  for (const { type } of imports2)
46915
46791
  if (!typeIndex.has(type)) typeIndex.set(type, typeIndex.size + 1);
46916
46792
  const loaderType = [96, 1, 127, 0];
46917
- const vector = (items2) => [...uleb4(items2.length), ...items2.flat()];
46918
- const sectionBytes = (id, body) => [id, ...uleb4(body.length), ...body];
46793
+ const vector = (items2) => [...encodeWasmNumber(items2.length), ...items2.flat()];
46794
+ const sectionBytes = (id, body) => [id, ...encodeWasmNumber(body.length), ...body];
46919
46795
  const slotGlobals = imports2.map(({ slot }) => [
46920
- ...encodedName2(NATIVE_SDK_IMPORT_MODULE),
46921
- ...encodedName2(String(slot)),
46796
+ ...encodeWasmName(NATIVE_SDK_IMPORT_MODULE),
46797
+ ...encodeWasmName(String(slot)),
46922
46798
  3,
46923
46799
  127,
46924
46800
  0
46925
46801
  ]);
46926
46802
  const bodies = imports2.map(({ type }, index) => {
46927
- const slotValue = [35, ...uleb4(index)];
46803
+ const slotValue = [35, ...encodeWasmNumber(index)];
46928
46804
  const code = [
46929
46805
  0,
46930
46806
  ...slotValue,
@@ -46937,14 +46813,14 @@ function sdkImportThunks(bytes) {
46937
46813
  16,
46938
46814
  0,
46939
46815
  11,
46940
- ...Array.from({ length: params[type] }, (_, i) => [32, ...uleb4(i)]).flat(),
46816
+ ...Array.from({ length: params[type] }, (_, i) => [32, ...encodeWasmNumber(i)]).flat(),
46941
46817
  ...slotValue,
46942
46818
  17,
46943
- ...uleb4(typeIndex.get(type)),
46819
+ ...encodeWasmNumber(typeIndex.get(type)),
46944
46820
  0,
46945
46821
  11
46946
46822
  ];
46947
- return [...uleb4(code.length), ...code];
46823
+ return [...encodeWasmNumber(code.length), ...code];
46948
46824
  });
46949
46825
  return Uint8Array.from([
46950
46826
  0,
@@ -46962,21 +46838,21 @@ function sdkImportThunks(bytes) {
46962
46838
  ...sectionBytes(
46963
46839
  2,
46964
46840
  vector([
46965
- [...encodedName2("env"), ...encodedName2("__indirect_function_table"), 1, ...table],
46841
+ [...encodeWasmName("env"), ...encodeWasmName("__indirect_function_table"), 1, ...table],
46966
46842
  [
46967
- ...encodedName2(NATIVE_LAZY_IMPORT_MODULE),
46968
- ...encodedName2(NATIVE_LAZY_SLOT_IMPORT),
46843
+ ...encodeWasmName(NATIVE_LAZY_IMPORT_MODULE),
46844
+ ...encodeWasmName(NATIVE_LAZY_SLOT_IMPORT),
46969
46845
  0,
46970
46846
  0
46971
46847
  ],
46972
46848
  ...slotGlobals
46973
46849
  ])
46974
46850
  ),
46975
- ...sectionBytes(3, vector(imports2.map(({ type }) => uleb4(typeIndex.get(type))))),
46851
+ ...sectionBytes(3, vector(imports2.map(({ type }) => encodeWasmNumber(typeIndex.get(type))))),
46976
46852
  ...sectionBytes(
46977
46853
  7,
46978
46854
  vector(
46979
- imports2.map(({ slot }, i) => [...encodedName2(String(slot)), 0, ...uleb4(i + 1)])
46855
+ imports2.map(({ slot }, i) => [...encodeWasmName(String(slot)), 0, ...encodeWasmNumber(i + 1)])
46980
46856
  )
46981
46857
  ),
46982
46858
  ...sectionBytes(10, vector(bodies))
@@ -47096,7 +46972,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47096
46972
  syntheticGlobals.push(type);
47097
46973
  got.set(index, value);
47098
46974
  }
47099
- return [35, ...uleb4(index)];
46975
+ return [35, ...encodeWasmNumber(index)];
47100
46976
  };
47101
46977
  const tlsHelpers = new Map(
47102
46978
  symbols.filter((symbol2) => symbol2.kind === 0 && symbol2.name.startsWith(SDK_TLS_HELPER)).map((symbol2) => [symbol2.name.slice(SDK_TLS_HELPER.length), symbol2.index])
@@ -47148,7 +47024,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47148
47024
  const code = [16];
47149
47025
  for (let i = 0, rest = helper; i < 5; i++, rest >>>= 7)
47150
47026
  code.push(i < 4 ? rest & 127 | 128 : rest & 127);
47151
- if (addend) code.push(66, ...sleb2(addend), 124);
47027
+ if (addend) code.push(66, ...encodeWasmSigned(addend), 124);
47152
47028
  patchCode(at2, 11, code);
47153
47029
  continue;
47154
47030
  }
@@ -47222,7 +47098,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47222
47098
  syntheticGlobals.push(valueType);
47223
47099
  scratchGlobals.set(valueType, scratch2);
47224
47100
  }
47225
- const index = uleb4(scratch2);
47101
+ const index = encodeWasmNumber(scratch2);
47226
47102
  patchCode(at - 2, 12, [
47227
47103
  36,
47228
47104
  ...index,
@@ -47238,7 +47114,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47238
47114
  }
47239
47115
  const encodedNameBuf = (name3) => {
47240
47116
  const raw2 = Buffer.from(name3, "utf8");
47241
- const len = uleb4(raw2.length);
47117
+ const len = encodeWasmNumber(raw2.length);
47242
47118
  const out = Buffer.allocUnsafe(len.length + raw2.length);
47243
47119
  for (let i = 0; i < len.length; i++) out[i] = len[i];
47244
47120
  raw2.copy(out, len.length);
@@ -47283,7 +47159,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47283
47159
  }
47284
47160
  }
47285
47161
  const globalParts = [
47286
- Buffer.from(uleb4(globalCount - 1 + syntheticGlobals.length))
47162
+ Buffer.from(encodeWasmNumber(globalCount - 1 + syntheticGlobals.length))
47287
47163
  ];
47288
47164
  for (let index = 0; index < globalCount; index++) {
47289
47165
  const start = gr.at;
@@ -47328,18 +47204,18 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47328
47204
  }
47329
47205
  }
47330
47206
  const exportParts = [
47331
- Buffer.from(uleb4(exportCount + 1 + got.size)),
47207
+ Buffer.from(encodeWasmNumber(exportCount + 1 + got.size)),
47332
47208
  bytes.subarray(originalExportsStart, exportSection.end)
47333
47209
  ];
47334
47210
  for (const [index, value] of got) {
47335
47211
  exportParts.push(
47336
47212
  encodedNameBuf(`${NATIVE_SDK_GLOBAL_PREFIX}${value}.${index}`),
47337
- Buffer.from([3, ...uleb4(index)])
47213
+ Buffer.from([3, ...encodeWasmNumber(index)])
47338
47214
  );
47339
47215
  }
47340
47216
  exportParts.push(encodedNameBuf("__indirect_function_table"), Buffer.from([1, 0]));
47341
47217
  const replaced = /* @__PURE__ */ new Map([
47342
- [2, Buffer.concat([Buffer.from(uleb4(importEntryCount)), ...importParts])],
47218
+ [2, Buffer.concat([Buffer.from(encodeWasmNumber(importEntryCount)), ...importParts])],
47343
47219
  [6, Buffer.concat(globalParts)],
47344
47220
  [7, Buffer.concat(exportParts)]
47345
47221
  ]);
@@ -47356,7 +47232,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
47356
47232
  if (s.id === 10 && rebuiltCode) {
47357
47233
  parts2.push(rebuiltCode);
47358
47234
  } else if (payload) {
47359
- parts2.push(Buffer.from([s.id, ...uleb4(payload.length)]), payload);
47235
+ parts2.push(Buffer.from([s.id, ...encodeWasmNumber(payload.length)]), payload);
47360
47236
  } else {
47361
47237
  parts2.push(bytes.subarray(s.offset, s.end));
47362
47238
  }
@@ -47372,7 +47248,7 @@ function expandSdkRelocations(bytes, section2, patches) {
47372
47248
  patches.sort((a, b) => a.at - b.at);
47373
47249
  const r = wasmReader(bytes, section2.start);
47374
47250
  const count = r.u();
47375
- const payload = [Uint8Array.from(uleb4(count))];
47251
+ const payload = [Uint8Array.from(encodeWasmNumber(count))];
47376
47252
  let next = 0;
47377
47253
  for (let i = 0; i < count; i++) {
47378
47254
  const start = r.at;
@@ -47392,7 +47268,7 @@ function expandSdkRelocations(bytes, section2, patches) {
47392
47268
  }
47393
47269
  parts2.push(bytes.subarray(at, end));
47394
47270
  payload.push(
47395
- Uint8Array.from(uleb4(parts2.reduce((size3, part) => size3 + part.length, 0))),
47271
+ Uint8Array.from(encodeWasmNumber(parts2.reduce((size3, part) => size3 + part.length, 0))),
47396
47272
  ...parts2
47397
47273
  );
47398
47274
  }
@@ -47401,7 +47277,7 @@ function expandSdkRelocations(bytes, section2, patches) {
47401
47277
  if (next !== patches.length || r.at !== section2.end)
47402
47278
  throw new Error("Swift SDK code relocations exceed the code section");
47403
47279
  return Buffer.concat([
47404
- Uint8Array.from([10, ...uleb4(payload.reduce((size2, part) => size2 + part.length, 0))]),
47280
+ Uint8Array.from([10, ...encodeWasmNumber(payload.reduce((size2, part) => size2 + part.length, 0))]),
47405
47281
  ...payload
47406
47282
  ]);
47407
47283
  }
@@ -47513,8 +47389,8 @@ function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
47513
47389
  const binding = bindSwiftAppModule(linkage, sdk2);
47514
47390
  const { data, liveSlots } = selectSwiftSdkData(sdk2, usage, linkage, projection);
47515
47391
  const bytes = Buffer.concat([binding, data]);
47516
- const sha2565 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(bytes).digest("hex");
47517
- return { bytes, sha256: sha2565, liveSlots };
47392
+ const sha2564 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(bytes).digest("hex");
47393
+ return { bytes, sha256: sha2564, liveSlots };
47518
47394
  }
47519
47395
  function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
47520
47396
  const map2 = readWasmLinkMap(mapFile, false);
@@ -48093,7 +47969,7 @@ function partitionParent(section2) {
48093
47969
  "__objc_class_refs"
48094
47970
  ].find((name3) => section2 === name3 || section2.startsWith(`${name3}.`));
48095
47971
  }
48096
- var import_node_child_process38, import_node_crypto45, import_node_fs74, import_node_path74, import_node_util11, import_node_zlib5, run5, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, uleb4, sleb2, encodedName2, SCANNED, RUN_GAP;
47972
+ var import_node_child_process38, import_node_crypto45, import_node_fs74, import_node_path74, import_node_util11, import_node_zlib5, run5, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, SCANNED, RUN_GAP;
48097
47973
  var init_swift_sdk_app_module = __esm({
48098
47974
  "src/swift-sdk-app-module.ts"() {
48099
47975
  "use strict";
@@ -48116,6 +47992,7 @@ var init_swift_sdk_app_module = __esm({
48116
47992
  init_swift_wasm_prune();
48117
47993
  init_swiftSdkLinkContract();
48118
47994
  init_swiftTargetContract();
47995
+ init_wasm_binary_sections();
48119
47996
  init_wasm_narrow_boundary();
48120
47997
  init_wasm_optimize();
48121
47998
  run5 = (0, import_node_util11.promisify)(import_node_child_process38.execFile);
@@ -48136,32 +48013,6 @@ var init_swift_sdk_app_module = __esm({
48136
48013
  SDK_TLS_HELPER = "__peach_sdk_tls.";
48137
48014
  SDK_TLS_DELTA = "__peach_sdk_tls_delta.";
48138
48015
  OBJC_SECTION_BOUNDARY = /^__(?:start|stop)_(__objc_(?:selectors|classes|class_refs|cats|protocols|protocol_refs|class_aliases|constant_string))$/;
48139
- uleb4 = (value) => {
48140
- const out = [];
48141
- do {
48142
- let byte = value % 128;
48143
- value = Math.floor(value / 128);
48144
- if (value) byte |= 128;
48145
- out.push(byte);
48146
- } while (value);
48147
- return out;
48148
- };
48149
- sleb2 = (value) => {
48150
- const out = [];
48151
- for (; ; ) {
48152
- const byte = Number(value & 127n);
48153
- value >>= 7n;
48154
- if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
48155
- out.push(byte);
48156
- return out;
48157
- }
48158
- out.push(byte | 128);
48159
- }
48160
- };
48161
- encodedName2 = (name3) => {
48162
- const bytes = [...Buffer.from(name3)];
48163
- return [...uleb4(bytes.length), ...bytes];
48164
- };
48165
48016
  SCANNED = /* @__PURE__ */ new Set([
48166
48017
  "swift5_protocols",
48167
48018
  "swift5_protocol_conformances",
@@ -49219,8 +49070,8 @@ function brotliCompressQ4(bytes, cacheKey) {
49219
49070
  function brotliCompressQ6(bytes, cacheKey) {
49220
49071
  return cachedBrotli(bytes, 6, cacheKey);
49221
49072
  }
49222
- function brotliCompressSwiftSdkBinding(bytes, sha2565) {
49223
- return cachedBrotli(bytes, 5, sha2565);
49073
+ function brotliCompressSwiftSdkBinding(bytes, sha2564) {
49074
+ return cachedBrotli(bytes, 5, sha2564);
49224
49075
  }
49225
49076
  async function memo(cache, key2, load2) {
49226
49077
  const cached4 = cache.get(key2);
@@ -49289,36 +49140,22 @@ function archiveMember(archive, name3) {
49289
49140
  throw new Error(`swift-icu: ${name3} is not in the sdk's icu archive`);
49290
49141
  }
49291
49142
  function icuSegment(object9) {
49292
- let at = 8;
49293
- const leb2 = () => {
49294
- let result = 0;
49295
- let shift = 0;
49296
- let byte;
49297
- do {
49298
- byte = object9[at++];
49299
- result += (byte & 127) * 2 ** shift;
49300
- shift += 7;
49301
- } while (byte & 128);
49302
- return result;
49303
- };
49304
49143
  const found2 = [];
49305
- while (at < object9.length) {
49306
- const id = object9[at++];
49307
- const size2 = leb2();
49308
- const end = at + size2;
49309
- if (id === 11) {
49310
- for (let count = leb2(); count > 0; count--) {
49311
- if (leb2() !== 0) throw new Error("swift-icu: unexpected data segment kind");
49312
- at++;
49313
- leb2();
49314
- at++;
49315
- const length = leb2();
49316
- const bytes = object9.subarray(at, at + length);
49317
- if (bytes[2] === 218 && bytes[3] === 39) found2.push(bytes);
49318
- at += length;
49319
- }
49144
+ for (const section2 of wasmSections(object9)) {
49145
+ if (section2.id !== 11) continue;
49146
+ const reader = readWasmSection(object9, section2.start, section2.end);
49147
+ for (let count = reader.number(); count > 0; count--) {
49148
+ if (reader.number() !== 0)
49149
+ throw new Error("swift-icu: unexpected data segment kind");
49150
+ reader.byte();
49151
+ reader.number();
49152
+ reader.byte();
49153
+ const length = reader.number();
49154
+ const start = reader.position();
49155
+ const bytes = object9.subarray(start, start + length);
49156
+ if (bytes[2] === 218 && bytes[3] === 39) found2.push(bytes);
49157
+ reader.skip(length);
49320
49158
  }
49321
- at = end;
49322
49159
  }
49323
49160
  if (found2.length !== 1)
49324
49161
  throw new Error(`swift-icu: expected one icu data segment, found ${found2.length}`);
@@ -49372,6 +49209,7 @@ var init_swift_icu = __esm({
49372
49209
  init_icuData();
49373
49210
  init_swift_toolchain();
49374
49211
  init_swiftTargetContract();
49212
+ init_wasm_binary_sections();
49375
49213
  run6 = (0, import_node_util12.promisify)(import_node_child_process40.execFile);
49376
49214
  deflate = (0, import_node_util12.promisify)(import_node_zlib6.gzip);
49377
49215
  compressBrotli = (0, import_node_util12.promisify)(import_node_zlib6.brotliCompress);
@@ -56028,7 +55866,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
56028
55866
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
56029
55867
  MULTI_MANIFEST_VERSION = 76;
56030
55868
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
56031
- compilerSourceDigest = true ? "1803ba36803a88ceeca92ee7b13baa39dde72fbb72df14659f0414084afaf5d7" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
55869
+ compilerSourceDigest = true ? "816651f27c8e6bad4746f2f90d840446903e3c4a2384095dcdf1c9ceb69ceba8" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
56032
55870
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
56033
55871
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
56034
55872
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -73991,11 +73829,6 @@ end
73991
73829
  });
73992
73830
 
73993
73831
  // src/bazel-project.ts
73994
- function sha256Hex5(bytes) {
73995
- if (typeof Bun !== "undefined")
73996
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
73997
- return (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex");
73998
- }
73999
73832
  function isBazelPackage(input) {
74000
73833
  return /^BUILD(?:\.bazel)?$/.test(import_node_path97.default.basename(input)) && import_node_fs94.default.statSync(input).isFile();
74001
73834
  }
@@ -74025,7 +73858,7 @@ function bazelBinary(root) {
74025
73858
  const expected = (0, import_node_child_process46.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
74026
73859
  encoding: "utf8"
74027
73860
  }).split(/\s/)[0];
74028
- const actual = (0, import_node_crypto54.createHash)("sha256").update(import_node_fs94.default.readFileSync(partial)).digest("hex");
73861
+ const actual = sha256Hex2(import_node_fs94.default.readFileSync(partial));
74029
73862
  if (actual !== expected) {
74030
73863
  import_node_fs94.default.rmSync(partial, { force: true });
74031
73864
  throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
@@ -74750,8 +74583,8 @@ ${published4.map(
74750
74583
  ]
74751
74584
  )
74752
74585
  ]);
74753
- const digest3 = sha256Hex5(
74754
- JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex5(bytes)]))
74586
+ const digest3 = sha256Hex2(
74587
+ JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex2(bytes)]))
74755
74588
  );
74756
74589
  const stamp = import_node_path97.default.join(bundle, ".peach-digest");
74757
74590
  if (!import_node_fs94.default.existsSync(stamp) || import_node_fs94.default.readFileSync(stamp, "utf8") !== digest3) {
@@ -74923,6 +74756,7 @@ var init_bazel_project = __esm({
74923
74756
  import_node_path97 = __toESM(require("node:path"), 1);
74924
74757
  init_is_record();
74925
74758
  init_plist();
74759
+ init_sha256();
74926
74760
  LIBRARY_RULES = /* @__PURE__ */ new Set(["swift_library", "objc_library", "cc_library"]);
74927
74761
  QUERIED_RULES = [
74928
74762
  "swift_library",
@@ -75411,7 +75245,7 @@ var init_provenance = __esm({
75411
75245
  import_node_crypto56 = require("node:crypto");
75412
75246
  import_node_fs96 = require("node:fs");
75413
75247
  import_node_path99 = require("node:path");
75414
- swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"cc32d16a0a3539e97447f853dd876b6b9240d544f5e0f21852c5a8333968e8a5","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"d140088a94d032e28788e18bf11499965e0c626255fd904538764ededcf1d751","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path99.join)(__sootsim_import_meta_dirname, ".."));
75248
+ swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"839661007eb801f3e3ec055a1f00c0e8b7a3d3be7f4bf1fc389ee6b5c2a290a6","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"2c235d7947d94c8a9f84b305f5453da8647c5c9f8180a38c59631868685b8723","swift-coverage/package.ts":"0f595bd55bcbd22bb337395f175d2aba23624d60f44d3309a61929629cc9b200","swift-coverage/xcode.ts":"059dd3b47d1ce4fe43acef97277c64b57507399866725a2144289eaa6ef8c1d4","swift-coverage/xcode-assets.ts":"a9314d1de1df0ce639a4402b66f89f8b20537f3fdadf0b7cf7355e6ac5b09f54","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"b7f31dd9c3c554bd69bff75cc9985a11032a394b405acc4b82be8f140a2a8676","swift-coverage/xcode-packages.ts":"d6b3d7fb1f5e32b4b08727927b794030d2f1285c7e3c41d7e8ab2e244a3d8c36","swift-coverage/xcode-strings.ts":"ef711d2a9039a08eb7d407546018ab22aafb0e883a65fc838bf864f5c5c9f85b","swift-coverage/reader.ts":"2562d668fd959c4ae3d24b765d3281b8d03251e8de65ec62bda305ba79f7d8c3","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"cc32d16a0a3539e97447f853dd876b6b9240d544f5e0f21852c5a8333968e8a5","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"d140088a94d032e28788e18bf11499965e0c626255fd904538764ededcf1d751","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path99.join)(__sootsim_import_meta_dirname, ".."));
75415
75249
  }
75416
75250
  });
75417
75251
 
@@ -76403,12 +76237,12 @@ function catalogDigest(directory2) {
76403
76237
  const path168 = (0, import_node_path101.join)(dir, entry.name);
76404
76238
  if (entry.isDirectory()) walk4(path168);
76405
76239
  else if (entry.isFile() && (0, import_node_fs98.statSync)(path168).size <= 64 * 1024 * 1024)
76406
- hashes.push([(0, import_node_path101.relative)(directory2, path168), sha2562((0, import_node_fs98.readFileSync)(path168))]);
76240
+ hashes.push([(0, import_node_path101.relative)(directory2, path168), sha256Hex2((0, import_node_fs98.readFileSync)(path168))]);
76407
76241
  else throw new Error(`Unsupported asset catalog entry: ${path168}`);
76408
76242
  }
76409
76243
  };
76410
76244
  walk4(directory2);
76411
- return sha2562(JSON.stringify(hashes));
76245
+ return sha256Hex2(JSON.stringify(hashes));
76412
76246
  }
76413
76247
  function symbolSource(plan, root) {
76414
76248
  const key2 = JSON.stringify([root, plan]);
@@ -76505,16 +76339,15 @@ function assetSymbolText(plan, root) {
76505
76339
  if (source.status === "unknown") throw new Error(source.reason);
76506
76340
  return source.text;
76507
76341
  }
76508
- var import_node_crypto57, import_node_fs98, import_node_path101, sha2562, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
76342
+ var import_node_fs98, import_node_path101, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
76509
76343
  var init_xcode_assets = __esm({
76510
76344
  "src/swift-coverage/xcode-assets.ts"() {
76511
76345
  "use strict";
76512
- import_node_crypto57 = require("node:crypto");
76513
76346
  import_node_fs98 = require("node:fs");
76514
76347
  import_node_path101 = require("node:path");
76348
+ init_sha256();
76515
76349
  init_provenance();
76516
76350
  init_xcode_asset_symbols();
76517
- sha2562 = (bytes) => (0, import_node_crypto57.createHash)("sha256").update(bytes).digest("hex");
76518
76351
  unprovenAssetSettings = [
76519
76352
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
76520
76353
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
@@ -77196,7 +77029,7 @@ function normalizedEnums(input) {
77196
77029
  }
77197
77030
  function localizationIdentifier(field, key2) {
77198
77031
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
77199
- const digest3 = (0, import_node_crypto58.createHash)("sha256").update(JSON.stringify([...field, key2])).digest();
77032
+ const digest3 = (0, import_node_crypto57.createHash)("sha256").update(JSON.stringify([...field, key2])).digest();
77200
77033
  return Array.from(
77201
77034
  digest3.subarray(0, 6),
77202
77035
  (byte) => alphabet[byte % alphabet.length]
@@ -77521,12 +77354,12 @@ function writeIntentDefinition(input, prefix) {
77521
77354
  lines.push("</plist>", "");
77522
77355
  return lines.join("\n");
77523
77356
  }
77524
- var import_strict4, import_node_crypto58, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
77357
+ var import_strict4, import_node_crypto57, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
77525
77358
  var init_metadata = __esm({
77526
77359
  "src/intent-definition/metadata.ts"() {
77527
77360
  "use strict";
77528
77361
  import_strict4 = __toESM(require("node:assert/strict"), 1);
77529
- import_node_crypto58 = require("node:crypto");
77362
+ import_node_crypto57 = require("node:crypto");
77530
77363
  init_fields();
77531
77364
  init_hash_input();
77532
77365
  init_siphash();
@@ -78235,7 +78068,7 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
78235
78068
  if (prefix) identifier(prefix);
78236
78069
  if (module2) identifier(module2);
78237
78070
  const source = import_node_fs100.default.readFileSync(definition2);
78238
- const key2 = (0, import_node_crypto59.createHash)("sha256").update(
78071
+ const key2 = (0, import_node_crypto58.createHash)("sha256").update(
78239
78072
  JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
78240
78073
  ).update("\0").update(source).digest("hex");
78241
78074
  const cache = import_node_path103.default.join(derivedDirectory, "IntentDefinitions");
@@ -78275,11 +78108,11 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
78275
78108
  import_node_fs100.default.rmSync(stage, { recursive: true, force: true });
78276
78109
  }
78277
78110
  }
78278
- var import_node_crypto59, import_node_fs100, import_node_path103, intentCompilerRevision;
78111
+ var import_node_crypto58, import_node_fs100, import_node_path103, intentCompilerRevision;
78279
78112
  var init_xcode_intents = __esm({
78280
78113
  "src/xcode-intents.ts"() {
78281
78114
  "use strict";
78282
- import_node_crypto59 = require("node:crypto");
78115
+ import_node_crypto58 = require("node:crypto");
78283
78116
  import_node_fs100 = __toESM(require("node:fs"), 1);
78284
78117
  import_node_path103 = __toESM(require("node:path"), 1);
78285
78118
  init_fields();
@@ -78981,7 +78814,7 @@ function loadProject(xcodeproj) {
78981
78814
  if (!projectFile)
78982
78815
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
78983
78816
  const source = import_node_fs101.default.readFileSync(projectFile, "utf8");
78984
- const digest3 = (0, import_node_crypto60.createHash)("sha256").update(source).digest("hex");
78817
+ const digest3 = (0, import_node_crypto59.createHash)("sha256").update(source).digest("hex");
78985
78818
  const cached4 = loaded3.get(projectFile);
78986
78819
  if (cached4?.digest === digest3) return cached4.project;
78987
78820
  const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
@@ -79033,7 +78866,7 @@ function xcodeInstallationIdentity() {
79033
78866
  if (!selected) return null;
79034
78867
  const directory2 = import_node_path105.default.extname(selected) === ".app" ? import_node_path105.default.join(selected, "Contents", "Developer") : selected;
79035
78868
  const versionFile = `${directory2}/../version.plist`;
79036
- const version2 = import_node_fs101.default.existsSync(versionFile) ? (0, import_node_crypto60.createHash)("sha256").update(import_node_fs101.default.readFileSync(versionFile)).digest("hex") : null;
78869
+ const version2 = import_node_fs101.default.existsSync(versionFile) ? (0, import_node_crypto59.createHash)("sha256").update(import_node_fs101.default.readFileSync(versionFile)).digest("hex") : null;
79037
78870
  return { directory: directory2, version: version2 };
79038
78871
  }
79039
78872
  function defaultConfiguration(project2) {
@@ -79517,7 +79350,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
79517
79350
  );
79518
79351
  });
79519
79352
  }
79520
- const signature2 = (0, import_node_crypto60.createHash)("sha256").update(
79353
+ const signature2 = (0, import_node_crypto59.createHash)("sha256").update(
79521
79354
  JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
79522
79355
  );
79523
79356
  for (const file of inputFiles) {
@@ -79672,7 +79505,7 @@ ${output}`
79672
79505
  const inputs2 = JSON.stringify([
79673
79506
  1,
79674
79507
  args,
79675
- (0, import_node_crypto60.createHash)("sha256").update(import_node_fs101.default.readFileSync(file)).digest("hex")
79508
+ (0, import_node_crypto59.createHash)("sha256").update(import_node_fs101.default.readFileSync(file)).digest("hex")
79676
79509
  ]);
79677
79510
  const developer = settings("DEVELOPER_DIR");
79678
79511
  const cached4 = import_node_fs101.default.existsSync(output) && import_node_fs101.default.existsSync(stamp) ? import_node_fs101.default.readFileSync(stamp, "utf8").split("\n") : [];
@@ -81222,12 +81055,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
81222
81055
  cocoapods
81223
81056
  };
81224
81057
  }
81225
- var import_node_child_process47, import_node_crypto60, import_node_fs101, import_node_module9, import_node_path105, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory3, loaded3, developerDir, preparedSourcePhases, isPodsProject, targetRefs, NativeAppTargetSelectionError, workspaceResolvedFile, SwiftPackageResolutionRequired;
81058
+ var import_node_child_process47, import_node_crypto59, import_node_fs101, import_node_module9, import_node_path105, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory3, loaded3, developerDir, preparedSourcePhases, isPodsProject, targetRefs, NativeAppTargetSelectionError, workspaceResolvedFile, SwiftPackageResolutionRequired;
81226
81059
  var init_xcode_project = __esm({
81227
81060
  "src/xcode-project.ts"() {
81228
81061
  "use strict";
81229
81062
  import_node_child_process47 = require("node:child_process");
81230
- import_node_crypto60 = require("node:crypto");
81063
+ import_node_crypto59 = require("node:crypto");
81231
81064
  import_node_fs101 = __toESM(require("node:fs"), 1);
81232
81065
  import_node_module9 = require("node:module");
81233
81066
  import_node_path105 = __toESM(require("node:path"), 1);
@@ -81436,8 +81269,8 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
81436
81269
  );
81437
81270
  const appRelative = import_node_path106.default.relative(root, app);
81438
81271
  const manifest = JSON.parse(import_node_fs102.default.readFileSync(import_node_path106.default.join(root, "package.json"), "utf8"));
81439
- const hash = (0, import_node_crypto61.createHash)("sha256");
81440
- const native = (0, import_node_crypto61.createHash)("sha256");
81272
+ const hash = (0, import_node_crypto60.createHash)("sha256");
81273
+ const native = (0, import_node_crypto60.createHash)("sha256");
81441
81274
  const nativeDirectories = localPackageDirectories(root, app);
81442
81275
  const versionFree = new Set(
81443
81276
  nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
@@ -81521,7 +81354,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
81521
81354
  unread.slice(start, start + 32).map(async ({ file, content }) => {
81522
81355
  const bytes = await import_node_fs102.default.promises.readFile(file);
81523
81356
  content.size = bytes.length;
81524
- content.digest = (0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex");
81357
+ content.digest = (0, import_node_crypto60.createHash)("sha256").update(bytes).digest("hex");
81525
81358
  fileDigests.set(file, content);
81526
81359
  })
81527
81360
  );
@@ -82074,10 +81907,10 @@ function stageCachedQuickCryptoOpenSsl(app) {
82074
81907
  const opensslDir = import_node_path106.default.join(packageDir, "ios", "openssl");
82075
81908
  if (import_node_fs102.default.existsSync(import_node_path106.default.join(opensslDir, "quickcrypto_openssl_prefix.h"))) return;
82076
81909
  const podspec = import_node_fs102.default.readFileSync(import_node_path106.default.join(packageDir, "QuickCrypto.podspec"), "utf8");
82077
- const sha2565 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
82078
- if (!sha2565) return;
82079
- const archive = import_node_path106.default.join(cacheDir(), "pod-archives", `${sha2565}.zip`);
82080
- if (!import_node_fs102.default.existsSync(archive) || (0, import_node_crypto61.createHash)("sha256").update(import_node_fs102.default.readFileSync(archive)).digest("hex") !== sha2565)
81910
+ const sha2564 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
81911
+ if (!sha2564) return;
81912
+ const archive = import_node_path106.default.join(cacheDir(), "pod-archives", `${sha2564}.zip`);
81913
+ if (!import_node_fs102.default.existsSync(archive) || (0, import_node_crypto60.createHash)("sha256").update(import_node_fs102.default.readFileSync(archive)).digest("hex") !== sha2564)
82081
81914
  return;
82082
81915
  import_node_fs102.default.rmSync(opensslDir, { recursive: true, force: true });
82083
81916
  import_node_fs102.default.mkdirSync(opensslDir, { recursive: true });
@@ -82115,12 +81948,12 @@ ${failedOutputLine(command, cwd, bytes)}`
82115
81948
  });
82116
81949
  });
82117
81950
  }
82118
- var import_node_child_process48, import_node_crypto61, import_node_fs102, import_node_module10, import_node_os22, import_node_path106, import_node_util13, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE2, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
81951
+ var import_node_child_process48, import_node_crypto60, import_node_fs102, import_node_module10, import_node_os22, import_node_path106, import_node_util13, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE2, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
82119
81952
  var init_expo_native_workspace = __esm({
82120
81953
  "src/expo-native-workspace.ts"() {
82121
81954
  "use strict";
82122
81955
  import_node_child_process48 = require("node:child_process");
82123
- import_node_crypto61 = require("node:crypto");
81956
+ import_node_crypto60 = require("node:crypto");
82124
81957
  import_node_fs102 = __toESM(require("node:fs"), 1);
82125
81958
  import_node_module10 = require("node:module");
82126
81959
  import_node_os22 = __toESM(require("node:os"), 1);
@@ -82194,7 +82027,7 @@ function run() {
82194
82027
 
82195
82028
  // src/expo-discovery-cache.ts
82196
82029
  function peachPin() {
82197
- return (0, import_node_crypto62.createHash)("sha256").update(
82030
+ return (0, import_node_crypto61.createHash)("sha256").update(
82198
82031
  `${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
82199
82032
  ).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
82200
82033
  }
@@ -82208,7 +82041,7 @@ function stable(value) {
82208
82041
  }
82209
82042
  async function expoDiscoveryKey(options2) {
82210
82043
  const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
82211
- const key2 = (0, import_node_crypto62.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
82044
+ const key2 = (0, import_node_crypto61.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
82212
82045
  return { key: key2, root };
82213
82046
  }
82214
82047
  function expoDiscoveryCacheDir() {
@@ -82279,7 +82112,7 @@ function readExpoDiscovery(key2) {
82279
82112
  if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
82280
82113
  const archive = import_node_path107.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
82281
82114
  const bytes = import_node_fs103.default.readFileSync(archive);
82282
- if ((0, import_node_crypto62.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
82115
+ if ((0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
82283
82116
  return void 0;
82284
82117
  const bodies = (0, import_node_zlib7.zstdDecompressSync)(bytes);
82285
82118
  const decoded = /* @__PURE__ */ new Map();
@@ -82353,7 +82186,7 @@ function stampedFileHash(file) {
82353
82186
  const stamp = [stat2.dev, stat2.ino, stat2.size, stat2.mtimeNs, stat2.ctimeNs].join(":");
82354
82187
  const cached4 = fileHashes.get(file);
82355
82188
  if (cached4?.stamp === stamp) return cached4.checksum;
82356
- const checksum = (0, import_node_crypto62.createHash)("sha256").update(import_node_fs103.default.readFileSync(file)).digest("hex");
82189
+ const checksum = (0, import_node_crypto61.createHash)("sha256").update(import_node_fs103.default.readFileSync(file)).digest("hex");
82357
82190
  fileHashes.set(file, { stamp, checksum });
82358
82191
  fileHashesChanged = true;
82359
82192
  return checksum;
@@ -82362,7 +82195,7 @@ function saveFileHashes() {
82362
82195
  if (!fileHashesChanged) return;
82363
82196
  fileHashesChanged = false;
82364
82197
  const target = fileHashesPath();
82365
- const temporary = `${target}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`;
82198
+ const temporary = `${target}.${process.pid}.${(0, import_node_crypto61.randomUUID)()}.tmp`;
82366
82199
  try {
82367
82200
  import_node_fs103.default.mkdirSync(import_node_path107.default.dirname(target), { recursive: true });
82368
82201
  import_node_fs103.default.writeFileSync(
@@ -82417,7 +82250,7 @@ function frameworkDigest(directory2, signal) {
82417
82250
  if (target !== root && !target.startsWith(`${root}${import_node_path107.default.sep}`))
82418
82251
  throw new Error(`framework link escapes its tree: ${relative7}`);
82419
82252
  }
82420
- return (0, import_node_crypto62.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
82253
+ return (0, import_node_crypto61.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
82421
82254
  }
82422
82255
  function rewritePreparedPaths(options2) {
82423
82256
  const { units, sourceRoot, preparedRoot, signal } = options2;
@@ -82438,7 +82271,7 @@ function rewritePreparedPaths(options2) {
82438
82271
  return null;
82439
82272
  }
82440
82273
  if (!preparedBytes.equals(sourceBytes)) return null;
82441
- dependencies[sourceFile] = (0, import_node_crypto62.createHash)("sha256").update(sourceBytes).digest("hex");
82274
+ dependencies[sourceFile] = (0, import_node_crypto61.createHash)("sha256").update(sourceBytes).digest("hex");
82442
82275
  verifiedFiles.set(preparedFile, sourceFile);
82443
82276
  return sourceFile;
82444
82277
  };
@@ -82515,7 +82348,7 @@ function rewritePreparedPaths(options2) {
82515
82348
  portableDir = import_node_path107.default.join(parent, import_node_path107.default.basename(dir));
82516
82349
  if (!import_node_fs103.default.existsSync(portableDir)) {
82517
82350
  import_node_fs103.default.mkdirSync(parent, { recursive: true });
82518
- const tmp = import_node_path107.default.join(parent, `.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
82351
+ const tmp = import_node_path107.default.join(parent, `.${process.pid}.${(0, import_node_crypto61.randomUUID)()}.tmp`);
82519
82352
  try {
82520
82353
  import_node_fs103.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
82521
82354
  if (frameworkDigest(tmp, signal) !== preparedDigest)
@@ -82544,7 +82377,7 @@ function writeExpoDiscovery(options2) {
82544
82377
  try {
82545
82378
  const dir = expoDiscoveryCacheDir();
82546
82379
  import_node_fs103.default.mkdirSync(dir, { recursive: true });
82547
- const tmp = import_node_path107.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
82380
+ const tmp = import_node_path107.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto61.randomUUID)()}.tmp`);
82548
82381
  if (options2.units === null) {
82549
82382
  import_node_fs103.default.writeFileSync(
82550
82383
  tmp,
@@ -82607,8 +82440,8 @@ function writeExpoDiscovery(options2) {
82607
82440
  }
82608
82441
  );
82609
82442
  const contents2 = (0, import_node_zlib7.zstdCompressSync)(Buffer.concat(chunks, size2));
82610
- const archive = (0, import_node_crypto62.createHash)("sha256").update(contents2).digest("hex");
82611
- const temporary = import_node_path107.default.join(blobDir, "." + (0, import_node_crypto62.randomUUID)() + ".tmp");
82443
+ const archive = (0, import_node_crypto61.createHash)("sha256").update(contents2).digest("hex");
82444
+ const temporary = import_node_path107.default.join(blobDir, "." + (0, import_node_crypto61.randomUUID)() + ".tmp");
82612
82445
  try {
82613
82446
  import_node_fs103.default.writeFileSync(temporary, contents2);
82614
82447
  import_node_fs103.default.renameSync(temporary, import_node_path107.default.join(blobDir, `${archive}.zst`));
@@ -82635,11 +82468,11 @@ function writeExpoDiscovery(options2) {
82635
82468
  return error instanceof Error ? error.message : String(error);
82636
82469
  }
82637
82470
  }
82638
- var import_node_crypto62, import_node_fs103, import_node_path107, import_node_zlib7, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings3, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
82471
+ var import_node_crypto61, import_node_fs103, import_node_path107, import_node_zlib7, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings3, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
82639
82472
  var init_expo_discovery_cache = __esm({
82640
82473
  "src/expo-discovery-cache.ts"() {
82641
82474
  "use strict";
82642
- import_node_crypto62 = require("node:crypto");
82475
+ import_node_crypto61 = require("node:crypto");
82643
82476
  import_node_fs103 = __toESM(require("node:fs"), 1);
82644
82477
  import_node_path107 = __toESM(require("node:path"), 1);
82645
82478
  import_node_zlib7 = require("node:zlib");
@@ -83074,7 +82907,7 @@ function hashPackageTree(root, options2) {
83074
82907
  }
83075
82908
  };
83076
82909
  walk4(root, "");
83077
- const hash = (0, import_node_crypto63.createHash)("sha256");
82910
+ const hash = (0, import_node_crypto62.createHash)("sha256");
83078
82911
  return (async () => {
83079
82912
  for (let start = 0; start < files2.length; start += READ_AHEAD) {
83080
82913
  const batch = files2.slice(start, start + READ_AHEAD);
@@ -83095,11 +82928,11 @@ function nativePackageTreeDigest(root) {
83095
82928
  skipFile: (name3) => name3.endsWith(".d.ts") || name3.endsWith(".d.ts.map") || name3.endsWith(".js.map")
83096
82929
  });
83097
82930
  }
83098
- var import_node_crypto63, import_node_fs106, import_promises13, import_node_path110, READ_AHEAD;
82931
+ var import_node_crypto62, import_node_fs106, import_promises13, import_node_path110, READ_AHEAD;
83099
82932
  var init_package_tree_digest = __esm({
83100
82933
  "src/package-tree-digest.ts"() {
83101
82934
  "use strict";
83102
- import_node_crypto63 = require("node:crypto");
82935
+ import_node_crypto62 = require("node:crypto");
83103
82936
  import_node_fs106 = require("node:fs");
83104
82937
  import_promises13 = require("node:fs/promises");
83105
82938
  import_node_path110 = require("node:path");
@@ -83179,7 +83012,7 @@ async function expoNativeInputs(appRoot) {
83179
83012
  "swift-pin": JSON.stringify(swiftNativePin()),
83180
83013
  answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
83181
83014
  "pods-environment": JSON.stringify(reactNativePodsEnvironment()),
83182
- fingerprint: (0, import_node_crypto64.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
83015
+ fingerprint: (0, import_node_crypto63.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
83183
83016
  },
83184
83017
  packages
83185
83018
  };
@@ -83297,7 +83130,7 @@ async function managedExpoNativeAppIdentity(appRoot, iosTarget) {
83297
83130
  }
83298
83131
  function servedExpoSwift(appRoot, entry, app) {
83299
83132
  if (!entry.expoSwift) return null;
83300
- const rootId = `${(0, import_node_crypto64.createHash)("sha256").update(import_node_fs107.default.realpathSync(appRoot)).digest("hex")}/Expo`;
83133
+ const rootId = `${(0, import_node_crypto63.createHash)("sha256").update(import_node_fs107.default.realpathSync(appRoot)).digest("hex")}/Expo`;
83301
83134
  if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
83302
83135
  const installed2 = installedInfoPlist(app.infoPlist, entry.infoPlist);
83303
83136
  const infoPlist2 = Buffer.from(installed2).toString("base64");
@@ -83325,11 +83158,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
83325
83158
  await prebuiltAppTarget(appRoot, signal, "installed")
83326
83159
  );
83327
83160
  }
83328
- var import_node_crypto64, import_node_fs107, import_node_module13, import_node_path111, import_node_util14, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published, lookups, answers;
83161
+ var import_node_crypto63, import_node_fs107, import_node_module13, import_node_path111, import_node_util14, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published, lookups, answers;
83329
83162
  var init_expo_native_prebuilt = __esm({
83330
83163
  "src/expo-native-prebuilt.ts"() {
83331
83164
  "use strict";
83332
- import_node_crypto64 = require("node:crypto");
83165
+ import_node_crypto63 = require("node:crypto");
83333
83166
  import_node_fs107 = __toESM(require("node:fs"), 1);
83334
83167
  import_node_module13 = require("node:module");
83335
83168
  import_node_path111 = __toESM(require("node:path"), 1);
@@ -83381,7 +83214,7 @@ function watchNativeInputs(root) {
83381
83214
  (0, import_node_timers2.clearTimeout)(expiry);
83382
83215
  for (const watcher of watchers) watcher.close();
83383
83216
  }
83384
- const inputs2 = { expiry, revision: (0, import_node_crypto65.randomUUID)() };
83217
+ const inputs2 = { expiry, revision: (0, import_node_crypto64.randomUUID)() };
83385
83218
  const watch3 = (directory2, recursive, name3) => {
83386
83219
  const watcher = import_node_fs108.default.watch(
83387
83220
  directory2,
@@ -83426,11 +83259,11 @@ function nativeInputRevision(root) {
83426
83259
  const inputs2 = watchNativeInputs(root);
83427
83260
  if (inputs2) return JSON.stringify([inputs2.revision, resolveActiveRuntimeRoot()]);
83428
83261
  }
83429
- var import_node_crypto65, import_node_fs108, import_node_path112, import_node_timers2, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
83262
+ var import_node_crypto64, import_node_fs108, import_node_path112, import_node_timers2, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
83430
83263
  var init_native_preparation = __esm({
83431
83264
  "src/native-preparation.ts"() {
83432
83265
  "use strict";
83433
- import_node_crypto65 = require("node:crypto");
83266
+ import_node_crypto64 = require("node:crypto");
83434
83267
  import_node_fs108 = __toESM(require("node:fs"), 1);
83435
83268
  import_node_path112 = __toESM(require("node:path"), 1);
83436
83269
  import_node_timers2 = require("node:timers");
@@ -83529,7 +83362,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk2, distribution) {
83529
83362
  return { name: recipe2.name, inputs: inputs2, key: nativeEntryKey(inputs2) };
83530
83363
  }
83531
83364
  function nativeStaticLibraryRecipe(bytes) {
83532
- const digest3 = (0, import_node_crypto66.createHash)("sha256").update(bytes).digest("hex");
83365
+ const digest3 = (0, import_node_crypto65.createHash)("sha256").update(bytes).digest("hex");
83533
83366
  return NATIVE_STATIC_LIBRARY_RECIPES.find((item) => item.nativeSha256 === digest3);
83534
83367
  }
83535
83368
  function nativeStaticLibrary(file, recipe2, moduleRoot) {
@@ -83572,7 +83405,7 @@ function isRustSymbol(name3, demangled) {
83572
83405
  function rustStaticLibrary(file, moduleRoot) {
83573
83406
  const toolchain = swiftModuleToolchain(moduleRoot);
83574
83407
  const bytes = import_node_fs109.default.readFileSync(file);
83575
- const key2 = (0, import_node_crypto66.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
83408
+ const key2 = (0, import_node_crypto65.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
83576
83409
  const directory2 = import_node_path113.default.join(cacheDir(), "native-archives", key2);
83577
83410
  const archive = import_node_path113.default.join(directory2, "library.a");
83578
83411
  if (import_node_fs109.default.existsSync(archive)) return archive;
@@ -83601,7 +83434,7 @@ function rustStaticLibrary(file, moduleRoot) {
83601
83434
  const members2 = readArMembers(bytes, true);
83602
83435
  const seen = /* @__PURE__ */ new Set();
83603
83436
  const unique2 = members2.filter(({ name: name3, bytes: bytes2 }) => {
83604
- const identity2 = name3 + "\0" + (0, import_node_crypto66.createHash)("sha256").update(bytes2).digest("hex");
83437
+ const identity2 = name3 + "\0" + (0, import_node_crypto65.createHash)("sha256").update(bytes2).digest("hex");
83605
83438
  if (seen.has(identity2)) return false;
83606
83439
  seen.add(identity2);
83607
83440
  return true;
@@ -83648,14 +83481,14 @@ function rustStaticLibrary(file, moduleRoot) {
83648
83481
  function combineNativeStaticLibraries(files2, moduleRoot) {
83649
83482
  if (files2.length === 1) return files2[0];
83650
83483
  const toolchain = swiftModuleToolchain(moduleRoot);
83651
- const hash = (0, import_node_crypto66.createHash)("sha256").update(toolchain.release);
83484
+ const hash = (0, import_node_crypto65.createHash)("sha256").update(toolchain.release);
83652
83485
  for (const file of files2)
83653
83486
  hash.update("\0").update(import_node_path113.default.basename(file)).update("\0").update(import_node_fs109.default.readFileSync(file));
83654
83487
  const directory2 = import_node_path113.default.join(cacheDir(), "native-archives", hash.digest("hex"));
83655
83488
  const archive = import_node_path113.default.join(directory2, "combined.a");
83656
83489
  if (import_node_fs109.default.existsSync(archive)) return archive;
83657
83490
  import_node_fs109.default.mkdirSync(directory2, { recursive: true });
83658
- const temporary = import_node_path113.default.join(directory2, `combined-${(0, import_node_crypto66.randomUUID)()}.a`);
83491
+ const temporary = import_node_path113.default.join(directory2, `combined-${(0, import_node_crypto65.randomUUID)()}.a`);
83659
83492
  try {
83660
83493
  (0, import_node_child_process50.execFileSync)(import_node_path113.default.join(toolchain.toolchainBin, "llvm-ar"), [
83661
83494
  "qcsDL",
@@ -83668,12 +83501,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
83668
83501
  }
83669
83502
  return archive;
83670
83503
  }
83671
- var import_node_child_process50, import_node_crypto66, import_node_fs109, import_node_path113, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
83504
+ var import_node_child_process50, import_node_crypto65, import_node_fs109, import_node_path113, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
83672
83505
  var init_native_static_libraries = __esm({
83673
83506
  "src/native-static-libraries.ts"() {
83674
83507
  "use strict";
83675
83508
  import_node_child_process50 = require("node:child_process");
83676
- import_node_crypto66 = require("node:crypto");
83509
+ import_node_crypto65 = require("node:crypto");
83677
83510
  import_node_fs109 = __toESM(require("node:fs"), 1);
83678
83511
  import_node_path113 = __toESM(require("node:path"), 1);
83679
83512
  init_home_paths();
@@ -84285,13 +84118,13 @@ var init_swift_wasm64_wamr = __esm({
84285
84118
 
84286
84119
  // src/swift-wasm64-native-source.ts
84287
84120
  function deriveSource(file, bytes, backport) {
84288
- if (!backport || (0, import_node_crypto67.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
84121
+ if (!backport || (0, import_node_crypto66.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
84289
84122
  return null;
84290
84123
  const source = bytes.toString("utf8");
84291
84124
  const derived = Buffer.from(
84292
84125
  "rewrite" in backport ? backport.rewrite(source) : source.replace(backport.before, backport.after)
84293
84126
  );
84294
- if ((0, import_node_crypto67.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
84127
+ if ((0, import_node_crypto66.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
84295
84128
  throw new Error(`Native source derivation differs: ${file}`);
84296
84129
  return {
84297
84130
  bytes: derived,
@@ -84310,11 +84143,11 @@ function deriveWasm64NativeSource(file, bytes) {
84310
84143
  sourceDerivations.get(name3) ?? headerDerivations.get(name3)
84311
84144
  );
84312
84145
  }
84313
- var import_node_crypto67, import_node_path115, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
84146
+ var import_node_crypto66, import_node_path115, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
84314
84147
  var init_swift_wasm64_native_source = __esm({
84315
84148
  "src/swift-wasm64-native-source.ts"() {
84316
84149
  "use strict";
84317
- import_node_crypto67 = require("node:crypto");
84150
+ import_node_crypto66 = require("node:crypto");
84318
84151
  import_node_path115 = __toESM(require("node:path"), 1);
84319
84152
  init_swift_wasm64_wamr();
84320
84153
  init_swiftWasm64ConfigContract();
@@ -84774,7 +84607,7 @@ var init_genrule_library_builds = __esm({
84774
84607
  function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
84775
84608
  const distribution = swiftDistributionAt(moduleRoot);
84776
84609
  const sdk2 = swiftSdkPaths(moduleRoot, toolchainBin);
84777
- const identity2 = (0, import_node_crypto68.createHash)("sha256").update(
84610
+ const identity2 = (0, import_node_crypto67.createHash)("sha256").update(
84778
84611
  JSON.stringify([
84779
84612
  distribution?.id,
84780
84613
  distribution?.link,
@@ -84800,7 +84633,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
84800
84633
  for (const alias of product.frameworkAliases) {
84801
84634
  if (alias.wasmSdkId !== distribution.wasmSdkId || alias.wasmSdkChecksum !== distribution.wasmSdkChecksum)
84802
84635
  throw new Error(`framework SDK identity differs for ${alias.name}`);
84803
- if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs112.default.readFileSync(import_node_path117.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
84636
+ if ((0, import_node_crypto67.createHash)("sha256").update(import_node_fs112.default.readFileSync(import_node_path117.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
84804
84637
  throw new Error(`framework module map changed ${alias.moduleMap}`);
84805
84638
  const selected = /* @__PURE__ */ new Set();
84806
84639
  const reach = (name3) => {
@@ -84841,7 +84674,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
84841
84674
  for (const alias of owner.frameworkAliases) {
84842
84675
  if (frameworkResponses[alias.name])
84843
84676
  throw new Error(`ambiguous declared framework ${alias.name}`);
84844
- if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs112.default.readFileSync(import_node_path117.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
84677
+ if ((0, import_node_crypto67.createHash)("sha256").update(import_node_fs112.default.readFileSync(import_node_path117.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
84845
84678
  throw new Error(`framework module map changed ${alias.moduleMap}`);
84846
84679
  const file = import_node_path117.default.join(root, `${alias.name}.rsp`);
84847
84680
  import_node_fs112.default.writeFileSync(file, aliasArtifacts.map(quote3).join("\n") + "\n");
@@ -84935,11 +84768,11 @@ exec ${shellQuote2(configuration2.compiler)} "$@"
84935
84768
  };
84936
84769
  return { cc: compiler("clang"), cxx: compiler("clang++"), identity: identity2 };
84937
84770
  }
84938
- var import_node_crypto68, import_node_fs112, import_node_path117, v7;
84771
+ var import_node_crypto67, import_node_fs112, import_node_path117, v7;
84939
84772
  var init_native_framework_compiler = __esm({
84940
84773
  "src/native-framework-compiler.ts"() {
84941
84774
  "use strict";
84942
- import_node_crypto68 = require("node:crypto");
84775
+ import_node_crypto67 = require("node:crypto");
84943
84776
  import_node_fs112 = __toESM(require("node:fs"), 1);
84944
84777
  import_node_path117 = __toESM(require("node:path"), 1);
84945
84778
  v7 = __toESM(require("peachsim/vendor/valibot"), 1);
@@ -84960,7 +84793,7 @@ function processAlive(pid) {
84960
84793
  }
84961
84794
  function tryAcquireNumberedLock(directory2, detail = "") {
84962
84795
  (0, import_node_fs113.mkdirSync)(directory2, { recursive: true });
84963
- const claim = (0, import_node_path118.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto69.randomUUID)()}`);
84796
+ const claim = (0, import_node_path118.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto68.randomUUID)()}`);
84964
84797
  for (; ; ) {
84965
84798
  const numbers = (0, import_node_fs113.readdirSync)(directory2).filter((name3) => /^\d+$/.test(name3)).map(Number);
84966
84799
  const top = Math.max(-1, ...numbers);
@@ -84999,11 +84832,11 @@ ${detail}` : ""}`);
84999
84832
  };
85000
84833
  }
85001
84834
  }
85002
- var import_node_crypto69, import_node_fs113, import_node_path118, errorCode2;
84835
+ var import_node_crypto68, import_node_fs113, import_node_path118, errorCode2;
85003
84836
  var init_numbered_lock = __esm({
85004
84837
  "src/numbered-lock.ts"() {
85005
84838
  "use strict";
85006
- import_node_crypto69 = require("node:crypto");
84839
+ import_node_crypto68 = require("node:crypto");
85007
84840
  import_node_fs113 = require("node:fs");
85008
84841
  import_node_path118 = require("node:path");
85009
84842
  errorCode2 = (error) => error instanceof Error && "code" in error ? error.code : void 0;
@@ -85030,7 +84863,7 @@ function llvmIdentity(toolchainBin, release) {
85030
84863
  ] : ["clang", "wasm-ld", "llvm-ar", "llvm-nm", "llvm-strip"].map(
85031
84864
  (name3) => swiftFileChecksum(import_node_path119.default.join(toolchainBin, name3))
85032
84865
  );
85033
- const identity2 = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
84866
+ const identity2 = (0, import_node_crypto69.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
85034
84867
  toolIdentities.set(toolchainBin, identity2);
85035
84868
  return identity2;
85036
84869
  }
@@ -85038,7 +84871,7 @@ function cSdkIdentity(sysroot, resourceDir, frameworks) {
85038
84871
  const key2 = JSON.stringify([sysroot, resourceDir, frameworks]);
85039
84872
  const cached4 = sysrootIdentities.get(key2);
85040
84873
  if (cached4) return cached4;
85041
- const hash = (0, import_node_crypto70.createHash)("sha256");
84874
+ const hash = (0, import_node_crypto69.createHash)("sha256");
85042
84875
  const add = (root, relative7) => {
85043
84876
  const file = import_node_path119.default.join(root, relative7);
85044
84877
  const stat2 = import_node_fs114.default.statSync(file, { throwIfNoEntry: false });
@@ -85073,7 +84906,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
85073
84906
  import_node_fs114.default.readFileSync(import_node_path119.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
85074
84907
  )
85075
84908
  );
85076
- const hash = (0, import_node_crypto70.createHash)("sha256").update(
84909
+ const hash = (0, import_node_crypto69.createHash)("sha256").update(
85077
84910
  JSON.stringify([
85078
84911
  headers,
85079
84912
  distribution.link,
@@ -85083,7 +84916,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
85083
84916
  ])
85084
84917
  );
85085
84918
  const objects = distribution.objects.map((file) => [file, distribution.files[file]]);
85086
- const objectKey = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
84919
+ const objectKey = (0, import_node_crypto69.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
85087
84920
  const cache = import_node_path119.default.join(cacheDir4, "framework-symbols-by-object", objectKey);
85088
84921
  if (!import_node_fs114.default.existsSync(cache)) {
85089
84922
  import_node_fs114.default.mkdirSync(import_node_path119.default.dirname(cache), { recursive: true });
@@ -85118,7 +84951,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
85118
84951
  const digest3 = import_node_path119.default.join(temporary, "digest");
85119
84952
  import_node_fs114.default.writeFileSync(
85120
84953
  digest3,
85121
- (0, import_node_crypto70.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
84954
+ (0, import_node_crypto69.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
85122
84955
  );
85123
84956
  import_node_fs114.default.renameSync(digest3, cache);
85124
84957
  } finally {
@@ -85173,7 +85006,7 @@ function buildable(declaration) {
85173
85006
  return builderOf(declaration) !== null && declaration.dependencies.every(buildable);
85174
85007
  }
85175
85008
  function declarationInputs(declaration, builder, toolchain, dependencyKeys) {
85176
- const hash = (0, import_node_crypto70.createHash)("sha256");
85009
+ const hash = (0, import_node_crypto69.createHash)("sha256");
85177
85010
  const files2 = declaration.sources.filter(
85178
85011
  (source) => !source.generator && !source.file.split(import_node_path119.default.sep).includes(".git")
85179
85012
  ).map((source) => import_node_path119.default.relative(declaration.packageDir, source.file));
@@ -85307,12 +85140,12 @@ function genruleArchive(declaration, library, moduleRoot) {
85307
85140
  }
85308
85141
  return combined;
85309
85142
  }
85310
- var import_node_child_process53, import_node_crypto70, import_node_fs114, import_node_os24, import_node_path119, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
85143
+ var import_node_child_process53, import_node_crypto69, import_node_fs114, import_node_os24, import_node_path119, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
85311
85144
  var init_genrule_archives = __esm({
85312
85145
  "src/genrule-archives.ts"() {
85313
85146
  "use strict";
85314
85147
  import_node_child_process53 = require("node:child_process");
85315
- import_node_crypto70 = require("node:crypto");
85148
+ import_node_crypto69 = require("node:crypto");
85316
85149
  import_node_fs114 = __toESM(require("node:fs"), 1);
85317
85150
  import_node_os24 = __toESM(require("node:os"), 1);
85318
85151
  import_node_path119 = __toESM(require("node:path"), 1);
@@ -85420,7 +85253,7 @@ function privateSentrySlice(entry, moduleRoot) {
85420
85253
  function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact) {
85421
85254
  if (standin.module !== SENTRY_SWIFT_SLICE.name) return standin;
85422
85255
  const native = simulatorNativeLibrary(artifact());
85423
- if (!native || (0, import_node_crypto71.createHash)("sha256").update(import_node_fs115.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
85256
+ if (!native || (0, import_node_crypto70.createHash)("sha256").update(import_node_fs115.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
85424
85257
  return standin;
85425
85258
  if (configured)
85426
85259
  throw new Error(
@@ -85478,12 +85311,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
85478
85311
  }
85479
85312
  };
85480
85313
  }
85481
- var import_node_child_process54, import_node_crypto71, import_node_fs115, import_node_os25, import_node_path120, SENTRY_SWIFT_SLICE;
85314
+ var import_node_child_process54, import_node_crypto70, import_node_fs115, import_node_os25, import_node_path120, SENTRY_SWIFT_SLICE;
85482
85315
  var init_native_swift_slices = __esm({
85483
85316
  "src/native-swift-slices.ts"() {
85484
85317
  "use strict";
85485
85318
  import_node_child_process54 = require("node:child_process");
85486
- import_node_crypto71 = require("node:crypto");
85319
+ import_node_crypto70 = require("node:crypto");
85487
85320
  import_node_fs115 = __toESM(require("node:fs"), 1);
85488
85321
  import_node_os25 = __toESM(require("node:os"), 1);
85489
85322
  import_node_path120 = __toESM(require("node:path"), 1);
@@ -86291,7 +86124,7 @@ function treeDigest2(root) {
86291
86124
  }).join("\n");
86292
86125
  const memo2 = digests.get(`tree\0${root}`);
86293
86126
  if (memo2?.stamp === stamp) return memo2.digest;
86294
- const hash = (0, import_node_crypto72.createHash)("sha256");
86127
+ const hash = (0, import_node_crypto71.createHash)("sha256");
86295
86128
  for (const name3 of names) {
86296
86129
  hash.update(`${name3}\0`);
86297
86130
  hash.update(import_node_fs119.default.readFileSync(import_node_path123.default.join(root, name3)));
@@ -86338,7 +86171,7 @@ function swiftBinaryFramework(binary2) {
86338
86171
  const found4 = locateXcframework(import_node_path123.default.join(dir, "tree"));
86339
86172
  if (found4) return { dir: found4, digest: stored.sha };
86340
86173
  }
86341
- const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs119.default.readFileSync(binary2.dir)).digest("hex");
86174
+ const sha2 = (0, import_node_crypto71.createHash)("sha256").update(import_node_fs119.default.readFileSync(binary2.dir)).digest("hex");
86342
86175
  if (sha2 !== stored?.sha || !locateXcframework(import_node_path123.default.join(dir, "tree"))) {
86343
86176
  import_node_fs119.default.rmSync(dir, { recursive: true, force: true });
86344
86177
  import_node_fs119.default.mkdirSync(import_node_path123.default.join(dir, "tree"), { recursive: true });
@@ -86350,7 +86183,7 @@ function swiftBinaryFramework(binary2) {
86350
86183
  return { dir: found3, digest: sha2 };
86351
86184
  }
86352
86185
  if (stored && import_node_fs119.default.existsSync(archive)) {
86353
- const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs119.default.readFileSync(archive)).digest("hex");
86186
+ const sha2 = (0, import_node_crypto71.createHash)("sha256").update(import_node_fs119.default.readFileSync(archive)).digest("hex");
86354
86187
  if (sha2 !== expected)
86355
86188
  throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
86356
86189
  const found3 = locateXcframework(import_node_path123.default.join(dir, "tree"));
@@ -86359,7 +86192,7 @@ function swiftBinaryFramework(binary2) {
86359
86192
  import_node_fs119.default.rmSync(dir, { recursive: true, force: true });
86360
86193
  import_node_fs119.default.mkdirSync(import_node_path123.default.join(dir, "tree"), { recursive: true });
86361
86194
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
86362
- const sha = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs119.default.readFileSync(archive)).digest("hex");
86195
+ const sha = (0, import_node_crypto71.createHash)("sha256").update(import_node_fs119.default.readFileSync(archive)).digest("hex");
86363
86196
  if (sha !== expected) {
86364
86197
  import_node_fs119.default.rmSync(dir, { recursive: true, force: true });
86365
86198
  throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
@@ -86484,7 +86317,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
86484
86317
  });
86485
86318
  }
86486
86319
  }
86487
- const declaredDigest = (0, import_node_crypto72.createHash)("sha256");
86320
+ const declaredDigest = (0, import_node_crypto71.createHash)("sha256");
86488
86321
  for (const framework of providedFrameworks)
86489
86322
  declaredDigest.update(`provided/${import_node_path123.default.relative(artifact.dir, framework)}\0`);
86490
86323
  for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
@@ -86554,7 +86387,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
86554
86387
  import_node_fs119.default.copyFileSync(surface.modulemap, modulemap);
86555
86388
  }
86556
86389
  }
86557
- const contents2 = (0, import_node_crypto72.createHash)("sha256");
86390
+ const contents2 = (0, import_node_crypto71.createHash)("sha256");
86558
86391
  for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
86559
86392
  const modulemap = import_node_path123.default.join(
86560
86393
  pending2,
@@ -87969,7 +87802,7 @@ function crateSourceRoots(manifest, searchRoot) {
87969
87802
  return roots;
87970
87803
  }
87971
87804
  function crateSourceDigest(manifest, searchRoot) {
87972
- const hash = (0, import_node_crypto72.createHash)("sha256");
87805
+ const hash = (0, import_node_crypto71.createHash)("sha256");
87973
87806
  const walk4 = (dir, root) => {
87974
87807
  for (const entry of import_node_fs119.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
87975
87808
  const full = import_node_path123.default.join(dir, entry.name);
@@ -88416,7 +88249,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
88416
88249
  ...swiftSources.flags,
88417
88250
  ...swiftSources.sources.flatMap((source) => [
88418
88251
  source,
88419
- (0, import_node_crypto72.createHash)("sha256").update(import_node_fs119.default.readFileSync(import_node_path123.default.join(binary2.dir, source))).digest("hex")
88252
+ (0, import_node_crypto71.createHash)("sha256").update(import_node_fs119.default.readFileSync(import_node_path123.default.join(binary2.dir, source))).digest("hex")
88420
88253
  ])
88421
88254
  );
88422
88255
  continue;
@@ -88452,7 +88285,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
88452
88285
  );
88453
88286
  }
88454
88287
  }
88455
- return (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex");
88288
+ return (0, import_node_crypto71.createHash)("sha256").update(parts2.join("\0")).digest("hex");
88456
88289
  }
88457
88290
  function missingArtifactGap(binary2) {
88458
88291
  if (swiftBinaryOnDisk(binary2)) return null;
@@ -88534,7 +88367,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
88534
88367
  return NO_IMPORTABLE_SURFACE;
88535
88368
  }
88536
88369
  const configured = new Map(Object.entries(behavior));
88537
- const hash = (0, import_node_crypto72.createHash)("sha256").update(
88370
+ const hash = (0, import_node_crypto71.createHash)("sha256").update(
88538
88371
  standinGenerationInputs([binary2], toolchain, behavior)
88539
88372
  );
88540
88373
  hash.update(digest3);
@@ -88774,7 +88607,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
88774
88607
  );
88775
88608
  if (binary2.moduleSources !== void 0)
88776
88609
  frameworkInputs.push(
88777
- `${binary2.target}\0${(0, import_node_crypto72.createHash)("sha256").update(
88610
+ `${binary2.target}\0${(0, import_node_crypto71.createHash)("sha256").update(
88778
88611
  [iosSdkId(), ...swiftSources.flags, ...swiftSources.sources, ...texts].join(
88779
88612
  "\0"
88780
88613
  )
@@ -88815,7 +88648,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
88815
88648
  import_node_fs119.default.mkdirSync(sourceFrameworks);
88816
88649
  const frameworks = {
88817
88650
  dirs: [...frameworkDirs, sourceFrameworks].sort(),
88818
- digest: (0, import_node_crypto72.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
88651
+ digest: (0, import_node_crypto71.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
88819
88652
  surfaces: frameworkSurfaces
88820
88653
  };
88821
88654
  const siblings = new Map(
@@ -88934,12 +88767,12 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
88934
88767
  import_node_fs119.default.rmSync(modules, { recursive: true, force: true });
88935
88768
  }
88936
88769
  }
88937
- var import_node_child_process56, import_node_crypto72, import_node_fs119, import_node_path123, TRIPLE, cacheDir5, key, digests, isBinaryLibraryFile, OBJC_IMPORT, files, OBJC, NO_IMPORTABLE_SURFACE, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
88770
+ var import_node_child_process56, import_node_crypto71, import_node_fs119, import_node_path123, TRIPLE, cacheDir5, key, digests, isBinaryLibraryFile, OBJC_IMPORT, files, OBJC, NO_IMPORTABLE_SURFACE, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
88938
88771
  var init_swift_standins = __esm({
88939
88772
  "src/swift-standins.ts"() {
88940
88773
  "use strict";
88941
88774
  import_node_child_process56 = require("node:child_process");
88942
- import_node_crypto72 = require("node:crypto");
88775
+ import_node_crypto71 = require("node:crypto");
88943
88776
  import_node_fs119 = __toESM(require("node:fs"), 1);
88944
88777
  import_node_path123 = __toESM(require("node:path"), 1);
88945
88778
  init_forked_script_contract();
@@ -88969,7 +88802,7 @@ var init_swift_standins = __esm({
88969
88802
  init_swiftTargetContract();
88970
88803
  TRIPLE = SWIFT_WASM_TRIPLE;
88971
88804
  cacheDir5 = import_node_path123.default.join(cacheDir(), "swift-standins");
88972
- key = (...parts2) => (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
88805
+ key = (...parts2) => (0, import_node_crypto71.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
88973
88806
  digests = /* @__PURE__ */ new Map();
88974
88807
  isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
88975
88808
  OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
@@ -89129,11 +88962,6 @@ function compiledFrameworkImports(app, products) {
89129
88962
  }
89130
88963
  return imports2;
89131
88964
  }
89132
- function sha256Hex6(bytes) {
89133
- if (typeof Bun !== "undefined")
89134
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
89135
- return (0, import_node_crypto73.createHash)("sha256").update(bytes).digest("hex");
89136
- }
89137
88965
  function regularFileStamp(file) {
89138
88966
  const stat2 = import_node_fs120.default.lstatSync(file, { bigint: true, throwIfNoEntry: false });
89139
88967
  if (!stat2 || !stat2.isFile()) return null;
@@ -89147,7 +88975,7 @@ function verifyRetainedFile(work, file, hash, stamps) {
89147
88975
  if (typeof expectedStamp === "string" && regularFileStamp(resolved) === expectedStamp)
89148
88976
  return true;
89149
88977
  if (!import_node_fs120.default.existsSync(resolved)) return false;
89150
- return sha256Hex6(readPackageFile(work, resolved, Infinity)) === hash;
88978
+ return sha256Hex2(readPackageFile(work, resolved, Infinity)) === hash;
89151
88979
  }
89152
88980
  function recordRetainedStamps(work, files2) {
89153
88981
  const stamps = {};
@@ -89164,7 +88992,7 @@ function cachedBinaryFileDigest(file) {
89164
88992
  const memory = binaryFileDigests.get(real);
89165
88993
  if (memory?.stamp === stamp) return memory.digest;
89166
88994
  const dir = import_node_path124.default.join(swiftCacheDir(), "swift-binary-digests");
89167
- const record6 = import_node_path124.default.join(dir, `${sha256Hex6(real)}.json`);
88995
+ const record6 = import_node_path124.default.join(dir, `${sha256Hex2(real)}.json`);
89168
88996
  if (import_node_fs120.default.existsSync(record6)) {
89169
88997
  const saved = JSON.parse(import_node_fs120.default.readFileSync(record6, "utf8"));
89170
88998
  if (isRecord(saved) && saved.stamp === stamp && typeof saved.digest === "string") {
@@ -89172,10 +89000,10 @@ function cachedBinaryFileDigest(file) {
89172
89000
  return saved.digest;
89173
89001
  }
89174
89002
  }
89175
- const digest3 = sha256Hex6(import_node_fs120.default.readFileSync(real));
89003
+ const digest3 = sha256Hex2(import_node_fs120.default.readFileSync(real));
89176
89004
  binaryFileDigests.set(real, { stamp, digest: digest3 });
89177
89005
  import_node_fs120.default.mkdirSync(dir, { recursive: true });
89178
- const partial = `${record6}.${process.pid}.${(0, import_node_crypto73.randomUUID)()}`;
89006
+ const partial = `${record6}.${process.pid}.${(0, import_node_crypto72.randomUUID)()}`;
89179
89007
  import_node_fs120.default.writeFileSync(partial, JSON.stringify({ stamp, digest: digest3 }));
89180
89008
  import_node_fs120.default.renameSync(partial, record6);
89181
89009
  return digest3;
@@ -89713,7 +89541,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
89713
89541
  const staged = withFrameworkCompanionImports(original);
89714
89542
  if (staged !== original) sources.set(file, Buffer.from(staged));
89715
89543
  }
89716
- const digest3 = sha256Hex6;
89544
+ const digest3 = sha256Hex2;
89717
89545
  const providers = /* @__PURE__ */ new Map();
89718
89546
  for (const target of targets) {
89719
89547
  if (!supplied.has(target.moduleName)) continue;
@@ -90069,7 +89897,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
90069
89897
  products
90070
89898
  );
90071
89899
  const checkouts = remoteSwiftCheckouts(app.rootDir);
90072
- const digest3 = sha256Hex6;
89900
+ const digest3 = sha256Hex2;
90073
89901
  const inputs2 = Object.fromEntries(
90074
89902
  [...sources].map(([file, bytes]) => [file, digest3(bytes)])
90075
89903
  );
@@ -90451,16 +90279,17 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
90451
90279
  import_node_fs120.default.closeSync(descriptor);
90452
90280
  }
90453
90281
  }
90454
- var import_node_child_process57, import_node_crypto73, import_node_fs120, import_node_path124, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
90282
+ var import_node_child_process57, import_node_crypto72, import_node_fs120, import_node_path124, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
90455
90283
  var init_swift_objc_compile = __esm({
90456
90284
  "src/swift-objc-compile.ts"() {
90457
90285
  "use strict";
90458
90286
  import_node_child_process57 = require("node:child_process");
90459
- import_node_crypto73 = require("node:crypto");
90287
+ import_node_crypto72 = require("node:crypto");
90460
90288
  import_node_fs120 = __toESM(require("node:fs"), 1);
90461
90289
  import_node_path124 = __toESM(require("node:path"), 1);
90462
90290
  init_mapLimit();
90463
90291
  init_is_record();
90292
+ init_sha256();
90464
90293
  init_swift_objc_import();
90465
90294
  init_swift_objc_runtime();
90466
90295
  init_swift_objc_standin();
@@ -94546,19 +94375,19 @@ function u32(value) {
94546
94375
  }
94547
94376
  function propertyHash(property) {
94548
94377
  const transient = property.kind === "attribute" && property.transient;
94549
- const base2 = sha2563(
94378
+ const base2 = sha2562(
94550
94379
  property.name,
94551
94380
  [(property.optional ? 1 : 0) | (transient ? 2 : 0), 0],
94552
94381
  property.modifier ?? ""
94553
94382
  );
94554
94383
  if (property.kind === "attribute")
94555
- return sha2563(
94384
+ return sha2562(
94556
94385
  base2,
94557
94386
  u32(property.type),
94558
94387
  property.type === 1e3 && property.flags & EXTERNAL_BINARY ? [1] : [],
94559
94388
  property.flags & PRESERVE_AFTER_DELETION ? [1] : []
94560
94389
  );
94561
- return sha2563(
94390
+ return sha2562(
94562
94391
  base2,
94563
94392
  property.destination,
94564
94393
  property.inverse ?? "",
@@ -94573,7 +94402,7 @@ function entityHashes(model) {
94573
94402
  ...item.parent === null ? [] : allProperties(byName2.get(item.parent)),
94574
94403
  ...item.properties
94575
94404
  ];
94576
- const hash = (item) => sha2563(
94405
+ const hash = (item) => sha2562(
94577
94406
  item.name,
94578
94407
  [item.abstract ? 1 : 0],
94579
94408
  item.parent === null ? [] : hash(byName2.get(item.parent)),
@@ -94601,7 +94430,7 @@ function compileCoreDataModel(directory2) {
94601
94430
  files2[`${name3}.momd/${version2}.mom`] = archiveModel(model);
94602
94431
  const entities = entityHashes(model);
94603
94432
  hashes[version2] = Object.fromEntries(entities);
94604
- checksums[version2] = sha2563(...entities.map(([, hash]) => hash)).toString("base64");
94433
+ checksums[version2] = sha2562(...entities.map(([, hash]) => hash)).toString("base64");
94605
94434
  }
94606
94435
  const named = (0, import_node_fs124.existsSync)(import_node_path128.default.join(directory2, ".xccurrentversion")) ? {
94607
94436
  NSManagedObjectModel_CurrentVersionName: import_node_path128.default.basename(
@@ -94624,11 +94453,11 @@ function coreDataModelDirectories(files2) {
94624
94453
  }
94625
94454
  return [...models].sort();
94626
94455
  }
94627
- var import_node_crypto74, import_node_fs124, import_node_path128, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2563;
94456
+ var import_node_crypto73, import_node_fs124, import_node_path128, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2562;
94628
94457
  var init_core_data_model = __esm({
94629
94458
  "src/core-data-model.ts"() {
94630
94459
  "use strict";
94631
- import_node_crypto74 = require("node:crypto");
94460
+ import_node_crypto73 = require("node:crypto");
94632
94461
  import_node_fs124 = require("node:fs");
94633
94462
  import_node_path128 = __toESM(require("node:path"), 1);
94634
94463
  init_core_data_entity_classes();
@@ -94747,7 +94576,7 @@ var init_core_data_model = __esm({
94747
94576
  });
94748
94577
  }
94749
94578
  };
94750
- sha2563 = (...parts2) => (0, import_node_crypto74.createHash)("sha256").update(
94579
+ sha2562 = (...parts2) => (0, import_node_crypto73.createHash)("sha256").update(
94751
94580
  Buffer.concat(
94752
94581
  parts2.map(
94753
94582
  (part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
@@ -96939,7 +96768,7 @@ async function buildRiveRuntimeDependencies(checkout, moduleRoot) {
96939
96768
  ];
96940
96769
  const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
96941
96770
  const xcode = (0, import_node_child_process59.execFileSync)("xcodebuild", ["-version"], { encoding: "utf8" });
96942
- const key2 = (0, import_node_crypto75.createHash)("sha256").update(
96771
+ const key2 = (0, import_node_crypto74.createHash)("sha256").update(
96943
96772
  JSON.stringify([
96944
96773
  RECIPE,
96945
96774
  (0, import_node_child_process59.execFileSync)("git", ["-C", runtime, "rev-parse", "HEAD"], {
@@ -97150,12 +96979,12 @@ exec ${quote3(import_node_path129.default.join(toolchainBin, "llvm-ar"))} rcs "$
97150
96979
  );
97151
96980
  return directory2;
97152
96981
  }
97153
- var import_node_child_process59, import_node_crypto75, import_node_fs125, import_node_os26, import_node_path129, import_promises15, RECIPE, CONFIG, RUNTIME_LIBRARIES;
96982
+ var import_node_child_process59, import_node_crypto74, import_node_fs125, import_node_os26, import_node_path129, import_promises15, RECIPE, CONFIG, RUNTIME_LIBRARIES;
97154
96983
  var init_rive_runtime_dependencies = __esm({
97155
96984
  "src/rive-runtime-dependencies.ts"() {
97156
96985
  "use strict";
97157
96986
  import_node_child_process59 = require("node:child_process");
97158
- import_node_crypto75 = require("node:crypto");
96987
+ import_node_crypto74 = require("node:crypto");
97159
96988
  import_node_fs125 = __toESM(require("node:fs"), 1);
97160
96989
  import_node_os26 = __toESM(require("node:os"), 1);
97161
96990
  import_node_path129 = __toESM(require("node:path"), 1);
@@ -98012,7 +97841,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
98012
97841
  (binary2) => binary2.publicHeaders === void 0 && binary2.placeholder === void 0 && swiftBinaryOnDisk(binary2) && binaryHeaderSearchPaths(binary2, staged, app.rootDir).headers.length === 1
98013
97842
  ))
98014
97843
  return [...binaries];
98015
- const hash = (0, import_node_crypto76.createHash)("sha256");
97844
+ const hash = (0, import_node_crypto75.createHash)("sha256");
98016
97845
  hash.update(
98017
97846
  JSON.stringify([
98018
97847
  inputs2.targets,
@@ -98221,12 +98050,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
98221
98050
  );
98222
98051
  return result;
98223
98052
  }
98224
- var import_node_child_process61, import_node_crypto76, import_node_fs127, import_node_path131, cachedInputs;
98053
+ var import_node_child_process61, import_node_crypto75, import_node_fs127, import_node_path131, cachedInputs;
98225
98054
  var init_swift_cxx_reachable = __esm({
98226
98055
  "src/swift-cxx-reachable.ts"() {
98227
98056
  "use strict";
98228
98057
  import_node_child_process61 = require("node:child_process");
98229
- import_node_crypto76 = require("node:crypto");
98058
+ import_node_crypto75 = require("node:crypto");
98230
98059
  import_node_fs127 = __toESM(require("node:fs"), 1);
98231
98060
  import_node_path131 = __toESM(require("node:path"), 1);
98232
98061
  init_is_record();
@@ -98247,15 +98076,15 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
98247
98076
  const pending2 = /* @__PURE__ */ new Map();
98248
98077
  const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
98249
98078
  const cache = swiftCacheDir();
98250
- const cached4 = (sha2565) => import_node_path132.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
98079
+ const cached4 = (sha2564) => import_node_path132.default.join(cache, `swift-pdf-png-${renderer}-${sha2564}.png`);
98251
98080
  let remainingBytes = imageTotalBytes;
98252
- const record6 = ({ file, sha256: sha2565 }, bytes) => {
98081
+ const record6 = ({ file, sha256: sha2564 }, bytes) => {
98253
98082
  if (bytes.length > imageBytes)
98254
98083
  throw new Error(`swift image ${file} raster exceeds the per-image cap`);
98255
98084
  remainingBytes -= bytes.length;
98256
98085
  if (remainingBytes < 0)
98257
98086
  throw new Error("swift image pack exceeds the compile service caps");
98258
- rendered.set(sha2565, bytes);
98087
+ rendered.set(sha2564, bytes);
98259
98088
  };
98260
98089
  for (const input of inputs2) {
98261
98090
  if (rendered.has(input.sha256) || pending2.has(input.sha256)) continue;
@@ -98717,7 +98546,7 @@ function fetchSwiftSdkDataPlan({ url, dataPlan }) {
98717
98546
  if (!response.ok)
98718
98547
  throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
98719
98548
  const bytes = Buffer.from(await response.arrayBuffer());
98720
- if ((0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
98549
+ if ((0, import_node_crypto76.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
98721
98550
  throw new Error(`Swift SDK data plan ${address} failed its digest check`);
98722
98551
  return bytes;
98723
98552
  });
@@ -98822,7 +98651,7 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
98822
98651
  encode2(now),
98823
98652
  encodeNativeSdkLater({
98824
98653
  files: later.map((bytes) => ({
98825
- sha256: (0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex"),
98654
+ sha256: (0, import_node_crypto76.createHash)("sha256").update(bytes).digest("hex"),
98826
98655
  byteLength: bytes.length
98827
98656
  })),
98828
98657
  ...needs && {
@@ -98838,11 +98667,11 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
98838
98667
  later
98839
98668
  };
98840
98669
  }
98841
- var import_node_crypto77, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
98670
+ var import_node_crypto76, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
98842
98671
  var init_swift_sdk_later_data = __esm({
98843
98672
  "src/swift-sdk-later-data.ts"() {
98844
98673
  "use strict";
98845
- import_node_crypto77 = require("node:crypto");
98674
+ import_node_crypto76 = require("node:crypto");
98846
98675
  init_nativeSdkBindingContract();
98847
98676
  init_nativeWasmContract();
98848
98677
  init_swift_sdk_image();
@@ -99440,7 +99269,7 @@ function gpuChromeLaunchOptions(opts = {}, runtime = currentRuntime()) {
99440
99269
  async function launchWithPauseAwareDeadline(launch, opts) {
99441
99270
  const budget = typeof opts.timeout === "number" ? opts.timeout : DEFAULT_LAUNCH_TIMEOUT_MS;
99442
99271
  if (budget === 0) return launch(opts);
99443
- const marker = `--peach-launch-id=${(0, import_node_crypto78.randomUUID)()}`;
99272
+ const marker = `--peach-launch-id=${(0, import_node_crypto77.randomUUID)()}`;
99444
99273
  let expired = false;
99445
99274
  const cleanupAttempted = [];
99446
99275
  const lookupFailed = [];
@@ -99597,13 +99426,13 @@ async function launchReapedChrome(launch, opts = {}, rendererTarget, policy = {}
99597
99426
  policy.admission
99598
99427
  );
99599
99428
  }
99600
- var childProcess, import_node_child_process64, import_node_crypto78, fs80, os23, path116, LINUX_CHROME_SCOPE_ENV, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES, DEFAULT_LAUNCH_TIMEOUT_MS;
99429
+ var childProcess, import_node_child_process64, import_node_crypto77, fs80, os23, path116, LINUX_CHROME_SCOPE_ENV, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES, DEFAULT_LAUNCH_TIMEOUT_MS;
99601
99430
  var init_reap_browser = __esm({
99602
99431
  "src/reap-browser.ts"() {
99603
99432
  "use strict";
99604
99433
  childProcess = __toESM(require("node:child_process"), 1);
99605
99434
  import_node_child_process64 = require("node:child_process");
99606
- import_node_crypto78 = require("node:crypto");
99435
+ import_node_crypto77 = require("node:crypto");
99607
99436
  fs80 = __toESM(require("node:fs"), 1);
99608
99437
  os23 = __toESM(require("node:os"), 1);
99609
99438
  path116 = __toESM(require("node:path"), 1);
@@ -101057,7 +100886,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
101057
100886
  const part = await guard((0, import_node_path134.join)(directory2, `side-${id}.wasm`), lazy, env);
101058
100887
  const bytes = (0, import_node_fs132.readFileSync)(part.file);
101059
100888
  assertWasmCodeOnly(bytes);
101060
- return { ...part, slots: slots2, sha256: (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex") };
100889
+ return { ...part, slots: slots2, sha256: (0, import_node_crypto78.createHash)("sha256").update(bytes).digest("hex") };
101061
100890
  }
101062
100891
  );
101063
100892
  const dyldGroups = parts2.flatMap(
@@ -101082,9 +100911,9 @@ function sealNativeWasmSplit(split2, initialPages) {
101082
100911
  const slotOffset = 4 + split2.sides.length * NATIVE_LAZY_PART_BYTES;
101083
100912
  const inventory = Buffer.alloc(slotOffset + (lastSlot + 1) * 2);
101084
100913
  inventory.writeUInt32LE(split2.sides.length, 0);
101085
- for (const [id, { sha256: sha2565, byteLength, slots }] of split2.sides.entries()) {
100914
+ for (const [id, { sha256: sha2564, byteLength, slots }] of split2.sides.entries()) {
101086
100915
  const offset = 4 + id * NATIVE_LAZY_PART_BYTES;
101087
- inventory.write(sha2565, offset, NATIVE_LAZY_DIGEST_BYTES, "hex");
100916
+ inventory.write(sha2564, offset, NATIVE_LAZY_DIGEST_BYTES, "hex");
101088
100917
  inventory.writeUInt32LE(byteLength, offset + NATIVE_LAZY_DIGEST_BYTES);
101089
100918
  for (const slot of slots) inventory.writeUInt16LE(id + 1, slotOffset + slot * 2);
101090
100919
  }
@@ -101125,12 +100954,12 @@ function describePart(file) {
101125
100954
  );
101126
100955
  return { file, functions, byteLength: bytes.byteLength };
101127
100956
  }
101128
- var import_node_child_process66, import_node_crypto79, import_node_fs132, import_node_os28, import_node_path134, import_node_util16, run10, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
100957
+ var import_node_child_process66, import_node_crypto78, import_node_fs132, import_node_os28, import_node_path134, import_node_util16, run10, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
101129
100958
  var init_wasm_lazy_split = __esm({
101130
100959
  "src/wasm-lazy-split.ts"() {
101131
100960
  "use strict";
101132
100961
  import_node_child_process66 = require("node:child_process");
101133
- import_node_crypto79 = require("node:crypto");
100962
+ import_node_crypto78 = require("node:crypto");
101134
100963
  import_node_fs132 = require("node:fs");
101135
100964
  import_node_os28 = require("node:os");
101136
100965
  import_node_path134 = require("node:path");
@@ -101361,7 +101190,7 @@ async function storeStartupSplit(work, profile, parent, cache, partCodeBytes) {
101361
101190
  const result = {
101362
101191
  primary: delivery.primary,
101363
101192
  parts: new Map(
101364
- split2.sides.map(({ sha256: sha2565 }, index) => [sha2565, delivery.sides[index]])
101193
+ split2.sides.map(({ sha256: sha2564 }, index) => [sha2564, delivery.sides[index]])
101365
101194
  ),
101366
101195
  ...partCodeBytes === void 0 ? {} : {
101367
101196
  source: digest2(work.bytes),
@@ -101567,11 +101396,11 @@ async function bootSwiftPreview(launch, profile) {
101567
101396
  server.close();
101568
101397
  }
101569
101398
  }
101570
- var import_node_crypto80, import_node_fs133, import_node_http3, import_node_https2, import_node_os29, import_node_path135, packageName, guestPath, appPath, profileWindowMs, profileQuietMs, digest2, partDigest, platform;
101399
+ var import_node_crypto79, import_node_fs133, import_node_http3, import_node_https2, import_node_os29, import_node_path135, packageName, guestPath, appPath, profileWindowMs, profileQuietMs, digest2, partDigest, platform;
101571
101400
  var init_swift_startup_split = __esm({
101572
101401
  "src/swift-startup-split.ts"() {
101573
101402
  "use strict";
101574
- import_node_crypto80 = require("node:crypto");
101403
+ import_node_crypto79 = require("node:crypto");
101575
101404
  import_node_fs133 = require("node:fs");
101576
101405
  import_node_http3 = require("node:http");
101577
101406
  import_node_https2 = require("node:https");
@@ -101596,7 +101425,7 @@ var init_swift_startup_split = __esm({
101596
101425
  appPath = "/__peach/swift/startup.wasm";
101597
101426
  profileWindowMs = 3e4;
101598
101427
  profileQuietMs = 2e3;
101599
- digest2 = (bytes) => (0, import_node_crypto80.createHash)("sha256").update(bytes).digest("hex");
101428
+ digest2 = (bytes) => (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex");
101600
101429
  partDigest = /^[a-f0-9]{64}$/;
101601
101430
  platform = `${process.platform}-${process.arch}`;
101602
101431
  }
@@ -101621,7 +101450,7 @@ async function readAsset(url, digest3, contentType2 = "application/wasm") {
101621
101450
  `published Swift SDK asset ${digest3} answered HTTP ${response.status}`
101622
101451
  );
101623
101452
  const bytes = Buffer.from(await response.arrayBuffer());
101624
- if ((0, import_node_crypto81.createHash)("sha256").update(bytes).digest("hex") !== digest3)
101453
+ if ((0, import_node_crypto80.createHash)("sha256").update(bytes).digest("hex") !== digest3)
101625
101454
  throw new Error(`published Swift SDK asset ${digest3} digest mismatch`);
101626
101455
  return { bytes, contentType: contentType2, digest: digest3 };
101627
101456
  }
@@ -101637,7 +101466,7 @@ async function readPublishedSwiftSdkParts(url, module2) {
101637
101466
  const [dyld] = WebAssembly.Module.customSections(module2, NATIVE_DYLD_TABLE_SECTION);
101638
101467
  if (lazy.length > 1) throw new Error("native code has more than one part inventory");
101639
101468
  const parts2 = lazy[0] ? readNativeLazyParts(lazy[0]).parts : [];
101640
- const assets2 = new Map(parts2.map(({ sha256: sha2565, byteLength }) => [sha2565, byteLength]));
101469
+ const assets2 = new Map(parts2.map(({ sha256: sha2564, byteLength }) => [sha2564, byteLength]));
101641
101470
  let dyldDigest;
101642
101471
  if (dyld && !WebAssembly.Module.customSections(module2, NATIVE_DYLD_PACKS_SECTION).length) {
101643
101472
  const table = readNativeDyldTableIndex(dyld);
@@ -101656,11 +101485,11 @@ async function readPublishedSwiftSdkParts(url, module2) {
101656
101485
  }
101657
101486
  );
101658
101487
  }
101659
- var import_node_crypto81;
101488
+ var import_node_crypto80;
101660
101489
  var init_published_swift_sdk = __esm({
101661
101490
  "src/published-swift-sdk.ts"() {
101662
101491
  "use strict";
101663
- import_node_crypto81 = require("node:crypto");
101492
+ import_node_crypto80 = require("node:crypto");
101664
101493
  init_mapLimit();
101665
101494
  init_nativeDyldTableContract();
101666
101495
  init_nativeWasmContract();
@@ -101705,7 +101534,7 @@ function* filesUnder(absolute) {
101705
101534
  }
101706
101535
  function hashFile(absolutePath) {
101707
101536
  try {
101708
- return (0, import_node_crypto82.createHash)("sha1").update((0, import_node_fs134.readFileSync)(absolutePath)).digest("hex");
101537
+ return (0, import_node_crypto81.createHash)("sha1").update((0, import_node_fs134.readFileSync)(absolutePath)).digest("hex");
101709
101538
  } catch {
101710
101539
  return null;
101711
101540
  }
@@ -101839,11 +101668,11 @@ function findStaleRoutes(monorepoRoot, routes2) {
101839
101668
  }
101840
101669
  return stale;
101841
101670
  }
101842
- var import_node_crypto82, import_node_fs134, import_node_path136, DEV_BUILD_REBUILD_COMMAND, RECORD_DIR, PEACHSIM_ENGINE_INPUTS, ENGINE_SOURCES, ROUTES, STANDALONE_ENGINE_ROUTES, EXCLUDED_DIR_NAMES;
101671
+ var import_node_crypto81, import_node_fs134, import_node_path136, DEV_BUILD_REBUILD_COMMAND, RECORD_DIR, PEACHSIM_ENGINE_INPUTS, ENGINE_SOURCES, ROUTES, STANDALONE_ENGINE_ROUTES, EXCLUDED_DIR_NAMES;
101843
101672
  var init_dev_build_freshness = __esm({
101844
101673
  "cli/dev-build-freshness.ts"() {
101845
101674
  "use strict";
101846
- import_node_crypto82 = require("node:crypto");
101675
+ import_node_crypto81 = require("node:crypto");
101847
101676
  import_node_fs134 = require("node:fs");
101848
101677
  import_node_path136 = require("node:path");
101849
101678
  DEV_BUILD_REBUILD_COMMAND = "bun run build:peach";
@@ -101970,7 +101799,7 @@ function nativeSourceFiles(packagePath) {
101970
101799
  function swiftArtifactContentDigest(bytes) {
101971
101800
  let digest3 = swiftArtifactDigests.get(bytes);
101972
101801
  if (!digest3) {
101973
- digest3 = (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex");
101802
+ digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
101974
101803
  swiftArtifactDigests.set(bytes, digest3);
101975
101804
  }
101976
101805
  return digest3;
@@ -102098,7 +101927,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
102098
101927
  const clang = import_node_path137.default.join(toolchainBin, "clang");
102099
101928
  const empty = (binary2, file) => {
102100
101929
  const source = import_node_path137.default.join(binary2.dir, file);
102101
- const key2 = (0, import_node_crypto83.createHash)("sha256").update(
101930
+ const key2 = (0, import_node_crypto82.createHash)("sha256").update(
102102
101931
  JSON.stringify([
102103
101932
  clang,
102104
101933
  sdk2.sysroot,
@@ -102143,7 +101972,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
102143
101972
  return new Set(portable.flat());
102144
101973
  }
102145
101974
  async function swiftPackages(entry, app) {
102146
- const stamp = (file) => import_node_fs135.default.existsSync(file) ? (0, import_node_crypto83.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex") : null;
101975
+ const stamp = (file) => import_node_fs135.default.existsSync(file) ? (0, import_node_crypto82.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex") : null;
102147
101976
  const owners = [...app.frameworks, app].map((target) => ({
102148
101977
  module: target.moduleName,
102149
101978
  products: target.packageProducts ?? []
@@ -103312,18 +103141,18 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
103312
103141
  const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
103313
103142
  bytes
103314
103143
  );
103315
- const sha2565 = (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex");
103144
+ const sha2564 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
103316
103145
  const bundle = swiftResourceBundleForFile(bundles, key2);
103317
103146
  if (!bundle && inputs2["Package.swift"])
103318
103147
  throw new Error(`metal source ${key2} has no resource target bundle`);
103319
103148
  metalSources[key2] = {
103320
- sha256: sha2565,
103321
- url: `${baseUrl}${RESOURCE_PATH}${sha2565}.metal`,
103149
+ sha256: sha2564,
103150
+ url: `${baseUrl}${RESOURCE_PATH}${sha2564}.metal`,
103322
103151
  bundlePath: bundle?.path ?? "."
103323
103152
  };
103324
103153
  metalUploads[key2] = source;
103325
103154
  watched.push(file);
103326
- registered.set(`${sha2565}.metal`, { bytes, contentType: "text/plain; charset=utf-8" });
103155
+ registered.set(`${sha2564}.metal`, { bytes, contentType: "text/plain; charset=utf-8" });
103327
103156
  }
103328
103157
  const pdfs = /* @__PURE__ */ new Map();
103329
103158
  for (const { file } of found2) {
@@ -103335,7 +103164,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
103335
103164
  const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
103336
103165
  pdfs.set(file, {
103337
103166
  file: disk,
103338
- sha256: (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex")
103167
+ sha256: (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex")
103339
103168
  });
103340
103169
  }
103341
103170
  const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
@@ -103381,7 +103210,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
103381
103210
  throw new Error("swift image pack exceeds the compile service caps");
103382
103211
  }
103383
103212
  imageBytes += bytes.length;
103384
- const hash = (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
103213
+ const hash = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
103385
103214
  const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
103386
103215
  const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
103387
103216
  const variant2 = {
@@ -103690,7 +103519,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
103690
103519
  hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
103691
103520
  }
103692
103521
  function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
103693
- const hash = (0, import_node_crypto83.createHash)("sha256");
103522
+ const hash = (0, import_node_crypto82.createHash)("sha256");
103694
103523
  hash.update(packagePath);
103695
103524
  updateSwiftConfigStamp(hash, packagePath);
103696
103525
  const libraries = projects().get(packagePath)?.libraries;
@@ -103719,7 +103548,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
103719
103548
  return hash.digest("hex").slice(0, 16);
103720
103549
  }
103721
103550
  function sourceContentStamp(packagePath, moduleRootOverride) {
103722
- const hash = (0, import_node_crypto83.createHash)("sha256");
103551
+ const hash = (0, import_node_crypto82.createHash)("sha256");
103723
103552
  hash.update(compilerSourceDigest);
103724
103553
  updateSwiftConfigStamp(hash, packagePath);
103725
103554
  const libraries = projects().get(packagePath)?.libraries;
@@ -103751,7 +103580,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
103751
103580
  (root) => import_node_fs135.default.existsSync(import_node_path137.default.join(root, "toolchain.json"))
103752
103581
  );
103753
103582
  if (!moduleRoot) return "";
103754
- const hash = (0, import_node_crypto83.createHash)("sha256");
103583
+ const hash = (0, import_node_crypto82.createHash)("sha256");
103755
103584
  hash.update(moduleRoot);
103756
103585
  for (const relative7 of swiftModuleInputFiles(moduleRoot)) {
103757
103586
  hash.update(relative7);
@@ -103761,7 +103590,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
103761
103590
  }
103762
103591
  function otherInputs(input) {
103763
103592
  const { files: _files, ...rest } = input;
103764
- return (0, import_node_crypto83.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
103593
+ return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
103765
103594
  }
103766
103595
  function icuUrl(origin, artifact) {
103767
103596
  return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
@@ -103776,7 +103605,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
103776
103605
  for (const standin of standins) {
103777
103606
  if (!standin.prebuilt) continue;
103778
103607
  const bytes = Buffer.from(standin.prebuilt.library, "base64");
103779
- const digest3 = (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex");
103608
+ const digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
103780
103609
  const dir = import_node_path137.default.join(swiftCacheDir(), "native-archives", digest3);
103781
103610
  import_node_fs135.default.mkdirSync(dir, { recursive: true });
103782
103611
  const library = import_node_path137.default.join(dir, `lib${standin.module}.a`);
@@ -104124,7 +103953,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
104124
103953
  return import_node_path137.default.join(
104125
103954
  swiftCacheDir(),
104126
103955
  "swift-builds",
104127
- (0, import_node_crypto83.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
103956
+ (0, import_node_crypto82.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
104128
103957
  );
104129
103958
  }
104130
103959
  function installedWorkspaceInput(packagePath, entry, moduleRoot) {
@@ -104418,14 +104247,14 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
104418
104247
  const url = new URL(moduleUrl);
104419
104248
  const table = swiftDyldTableReference(url.pathname, module2);
104420
104249
  if (!table) return {};
104421
- const { sha256: sha2565, byteLength } = table;
104250
+ const { sha256: sha2564, byteLength } = table;
104422
104251
  url.pathname = table.path;
104423
104252
  const response = await fetch(url, { signal });
104424
104253
  if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
104425
104254
  const bytes = Buffer.from(await response.arrayBuffer());
104426
- if (bytes.length !== byteLength || (0, import_node_crypto83.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
104255
+ if (bytes.length !== byteLength || (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
104427
104256
  throw new Error(`swift compile: ${url} does not match its module's index`);
104428
- return { dyldTable: { sha256: sha2565, bytes } };
104257
+ return { dyldTable: { sha256: sha2564, bytes } };
104429
104258
  }
104430
104259
  function currentStamp(project2, moduleRoot) {
104431
104260
  return withXcodeLayout(
@@ -104714,10 +104543,10 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
104714
104543
  sdk2.binding.bytes,
104715
104544
  plan
104716
104545
  );
104717
- const digest3 = (0, import_node_crypto83.createHash)("sha256").update(split2.binding).digest("hex");
104546
+ const digest3 = (0, import_node_crypto82.createHash)("sha256").update(split2.binding).digest("hex");
104718
104547
  sdkBindingFiles.set(digest3, split2.binding);
104719
104548
  for (const later of split2.later)
104720
- sdkBindingFiles.set((0, import_node_crypto83.createHash)("sha256").update(later).digest("hex"), later);
104549
+ sdkBindingFiles.set((0, import_node_crypto82.createHash)("sha256").update(later).digest("hex"), later);
104721
104550
  sdkSplitBindings.set(key2, digest3);
104722
104551
  }
104723
104552
  function swiftCodePartAssets(origin, appParts, sdkDigest) {
@@ -104796,7 +104625,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch, runt
104796
104625
  const { key: key2 } = sdk2;
104797
104626
  const normalizedPackage = normalizedSwiftPackagePath(packagePath);
104798
104627
  const requireCurrentProfile = import_node_path137.default.basename(import_node_path137.default.dirname(normalizedPackage)) === "one-native-controls";
104799
- const app = (0, import_node_crypto83.createHash)("sha256").update(
104628
+ const app = (0, import_node_crypto82.createHash)("sha256").update(
104800
104629
  JSON.stringify([
104801
104630
  normalizedPackage,
104802
104631
  launch.environment,
@@ -104830,7 +104659,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch, runt
104830
104659
  app,
104831
104660
  requireCurrentProfile
104832
104661
  );
104833
- const name3 = (0, import_node_crypto83.createHash)("sha256").update(split2.primary).digest("hex");
104662
+ const name3 = (0, import_node_crypto82.createHash)("sha256").update(split2.primary).digest("hex");
104834
104663
  sdkPieces2.set(name3, split2.primary);
104835
104664
  for (const [digest3, bytes] of split2.parts) sdkPieces2.set(digest3, bytes);
104836
104665
  sdkStartupParts.set(name3, split2.parts);
@@ -105059,10 +104888,10 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
105059
104888
  const later = decodeNativeSdkBinding(
105060
104889
  bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
105061
104890
  ).later;
105062
- for (const { sha256: sha2565 } of later?.files ?? []) {
105063
- const laterBytes = sdkBindingFiles.get(sha2565);
105064
- if (!laterBytes) throw new Error(`swift sdk later data ${sha2565} is not served`);
105065
- assets2.set(`${SDK_BINDING_PATH}${sha2565}.bin`, {
104891
+ for (const { sha256: sha2564 } of later?.files ?? []) {
104892
+ const laterBytes = sdkBindingFiles.get(sha2564);
104893
+ if (!laterBytes) throw new Error(`swift sdk later data ${sha2564} is not served`);
104894
+ assets2.set(`${SDK_BINDING_PATH}${sha2564}.bin`, {
105066
104895
  bytes: laterBytes,
105067
104896
  contentType: "application/octet-stream"
105068
104897
  });
@@ -105074,13 +104903,13 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
105074
104903
  }
105075
104904
  return assets2;
105076
104905
  }
105077
- var import_node_async_hooks3, import_node_child_process67, import_node_crypto83, import_node_fs135, import_node_os30, import_node_path137, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, publishedSdkPieces, publishedSdkMirrors, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
104906
+ var import_node_async_hooks3, import_node_child_process67, import_node_crypto82, import_node_fs135, import_node_os30, import_node_path137, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, publishedSdkPieces, publishedSdkMirrors, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
105078
104907
  var init_swift_host = __esm({
105079
104908
  "src/swift-host.ts"() {
105080
104909
  "use strict";
105081
104910
  import_node_async_hooks3 = require("node:async_hooks");
105082
104911
  import_node_child_process67 = require("node:child_process");
105083
- import_node_crypto83 = require("node:crypto");
104912
+ import_node_crypto82 = require("node:crypto");
105084
104913
  import_node_fs135 = __toESM(require("node:fs"), 1);
105085
104914
  import_node_os30 = __toESM(require("node:os"), 1);
105086
104915
  import_node_path137 = __toESM(require("node:path"), 1);
@@ -105842,7 +105671,7 @@ function hashTree(root) {
105842
105671
  for (const entry of import_node_fs138.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
105843
105672
  if (!entry.isFile()) continue;
105844
105673
  const file = import_node_path140.default.join(entry.parentPath, entry.name);
105845
- hashes[import_node_path140.default.relative(root, file).split(import_node_path140.default.sep).join("/")] = (0, import_node_crypto84.createHash)("sha256").update(import_node_fs138.default.readFileSync(file)).digest("hex");
105674
+ hashes[import_node_path140.default.relative(root, file).split(import_node_path140.default.sep).join("/")] = (0, import_node_crypto83.createHash)("sha256").update(import_node_fs138.default.readFileSync(file)).digest("hex");
105846
105675
  }
105847
105676
  return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
105848
105677
  }
@@ -105892,12 +105721,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
105892
105721
  files: hashTree(generatedRoot)
105893
105722
  };
105894
105723
  }
105895
- var import_node_child_process68, import_node_crypto84, import_node_fs138, import_node_module17, import_node_path140, import_node_util17, run11, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
105724
+ var import_node_child_process68, import_node_crypto83, import_node_fs138, import_node_module17, import_node_path140, import_node_util17, run11, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
105896
105725
  var init_turbo_codegen_intake = __esm({
105897
105726
  "src/turbo-codegen-intake.ts"() {
105898
105727
  "use strict";
105899
105728
  import_node_child_process68 = require("node:child_process");
105900
- import_node_crypto84 = require("node:crypto");
105729
+ import_node_crypto83 = require("node:crypto");
105901
105730
  import_node_fs138 = __toESM(require("node:fs"), 1);
105902
105731
  import_node_module17 = require("node:module");
105903
105732
  import_node_path140 = __toESM(require("node:path"), 1);
@@ -106970,7 +106799,7 @@ async function collectTurboSources(options2) {
106970
106799
  );
106971
106800
  const installedHeaders = /* @__PURE__ */ new Map();
106972
106801
  const targetPath = (name3) => `Sources/${name3}`;
106973
- const providerTarget = (name3) => `TurboPackage_${sha2564(name3).slice(0, 16)}`;
106802
+ const providerTarget = (name3) => `TurboPackage_${sha2563(name3).slice(0, 16)}`;
106974
106803
  const folly = readFollyConfig(reactNative.root);
106975
106804
  const baseDefines = [
106976
106805
  options2.configuration === "Debug" ? "DEBUG=1" : "NDEBUG",
@@ -107114,7 +106943,7 @@ async function collectTurboSources(options2) {
107114
106943
  if (!Buffer.from(text7).equals(bytes))
107115
106944
  throw new Error(`TurboModule source is not UTF-8: ${disk}`);
107116
106945
  add(key2, text7);
107117
- result.sources.push({ file: key2, source: disk, sha256: sha2564(bytes) });
106946
+ result.sources.push({ file: key2, source: disk, sha256: sha2563(bytes) });
107118
106947
  pending2.push({ key: key2, targetName, label, root, relative: relative7 });
107119
106948
  return key2;
107120
106949
  };
@@ -107927,13 +107756,13 @@ async function collectTurboSources(options2) {
107927
107756
  let decoratorHasPerformanceLogger = false;
107928
107757
  let managerHasDevMenuDecorator = false;
107929
107758
  if (fabric) objc = true;
107930
- for (const { relative: relative7, source, text: text7, sha256: sha2565, configured } of glogSources()) {
107759
+ for (const { relative: relative7, source, text: text7, sha256: sha2564, configured } of glogSources()) {
107931
107760
  const key2 = `${core}/dependencies/glog/${relative7}`;
107932
107761
  add(key2, text7);
107933
107762
  result.sources.push({
107934
107763
  file: key2,
107935
107764
  source,
107936
- sha256: sha2565,
107765
+ sha256: sha2564,
107937
107766
  ...configured && { configured }
107938
107767
  });
107939
107768
  if (relative7.startsWith("src/glog/"))
@@ -110216,11 +110045,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
110216
110045
  }
110217
110046
  `;
110218
110047
  }
110219
- var import_node_crypto85, import_node_fs139, import_node_module18, import_node_path141, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER5, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, DECLARED_MODULE_NAME, EXPORTED_MODULE, sha2564, podspecList, reactNativePods, reactNativePod, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_SHADOW_HANDLE_HOST, FABRIC_HOST_INCLUDES, FABRIC_HOST_PAPER_INCLUDES, PAPER_UIKIT_BRIDGE_SWIFT;
110048
+ var import_node_crypto84, import_node_fs139, import_node_module18, import_node_path141, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER5, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, DECLARED_MODULE_NAME, EXPORTED_MODULE, sha2563, podspecList, reactNativePods, reactNativePod, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_SHADOW_HANDLE_HOST, FABRIC_HOST_INCLUDES, FABRIC_HOST_PAPER_INCLUDES, PAPER_UIKIT_BRIDGE_SWIFT;
110220
110049
  var init_turbo_source = __esm({
110221
110050
  "src/turbo-source.ts"() {
110222
110051
  "use strict";
110223
- import_node_crypto85 = require("node:crypto");
110052
+ import_node_crypto84 = require("node:crypto");
110224
110053
  import_node_fs139 = __toESM(require("node:fs"), 1);
110225
110054
  import_node_module18 = require("node:module");
110226
110055
  import_node_path141 = __toESM(require("node:path"), 1);
@@ -110350,7 +110179,7 @@ var init_turbo_source = __esm({
110350
110179
  ];
110351
110180
  DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
110352
110181
  EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
110353
- sha2564 = (data) => (0, import_node_crypto85.createHash)("sha256").update(data).digest("hex");
110182
+ sha2563 = (data) => (0, import_node_crypto84.createHash)("sha256").update(data).digest("hex");
110354
110183
  podspecList = podspecAttribute;
110355
110184
  reactNativePods = /* @__PURE__ */ new Set([
110356
110185
  "React",
@@ -111237,7 +111066,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped, cor
111237
111066
  }
111238
111067
  async function prepareTurboCompileInput(options2) {
111239
111068
  await prepareTurboSourceDependencies(options2.reactNativeRoot);
111240
- const key2 = (0, import_node_crypto86.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs140.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs140.default.realpathSync(options2.moduleRoot)).digest("hex");
111069
+ const key2 = (0, import_node_crypto85.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs140.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs140.default.realpathSync(options2.moduleRoot)).digest("hex");
111241
111070
  const scratch2 = import_node_path142.default.join(import_node_os31.default.tmpdir(), "peach-turbo-swift", key2);
111242
111071
  import_node_fs140.default.mkdirSync(scratch2, { recursive: true });
111243
111072
  const codegenDir = import_node_fs140.default.mkdtempSync(import_node_path142.default.join(scratch2, "codegen-"));
@@ -111479,11 +111308,11 @@ async function compileTurboModule(options2) {
111479
111308
  collection
111480
111309
  };
111481
111310
  }
111482
- var import_node_crypto86, import_node_fs140, import_node_module19, import_node_os31, import_node_path142;
111311
+ var import_node_crypto85, import_node_fs140, import_node_module19, import_node_os31, import_node_path142;
111483
111312
  var init_turbo_compile = __esm({
111484
111313
  "src/turbo-compile.ts"() {
111485
111314
  "use strict";
111486
- import_node_crypto86 = require("node:crypto");
111315
+ import_node_crypto85 = require("node:crypto");
111487
111316
  import_node_fs140 = __toESM(require("node:fs"), 1);
111488
111317
  import_node_module19 = require("node:module");
111489
111318
  import_node_os31 = __toESM(require("node:os"), 1);
@@ -111683,8 +111512,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
111683
111512
  );
111684
111513
  if (!isRecord(manifest) || typeof manifest.version !== "string")
111685
111514
  throw new Error(`${reactNativeRoot}: react-native has no version`);
111686
- const headers = (0, import_node_crypto87.createHash)("sha256");
111687
- const sources = (0, import_node_crypto87.createHash)("sha256");
111515
+ const headers = (0, import_node_crypto86.createHash)("sha256");
111516
+ const sources = (0, import_node_crypto86.createHash)("sha256");
111688
111517
  const walk4 = (relative7) => {
111689
111518
  for (const file of import_node_fs142.default.readdirSync(import_node_path144.default.join(reactNativeRoot, relative7), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
111690
111519
  if (file.name === "node_modules" || file.name.startsWith(".")) continue;
@@ -111791,7 +111620,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
111791
111620
  const file = import_node_path144.default.join(
111792
111621
  cacheDir(),
111793
111622
  "native-archives",
111794
- `${(0, import_node_crypto87.createHash)("sha256").update(data).digest("hex")}.a`
111623
+ `${(0, import_node_crypto86.createHash)("sha256").update(data).digest("hex")}.a`
111795
111624
  );
111796
111625
  import_node_fs142.default.mkdirSync(import_node_path144.default.dirname(file), { recursive: true });
111797
111626
  if (!import_node_fs142.default.existsSync(file)) import_node_fs142.default.writeFileSync(file, Buffer.from(data, "base64"));
@@ -111801,11 +111630,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
111801
111630
  }
111802
111631
  }
111803
111632
  }
111804
- var import_node_crypto87, import_node_fs142, import_node_module20, import_node_path144, import_node_util18, recipe, strings4, building;
111633
+ var import_node_crypto86, import_node_fs142, import_node_module20, import_node_path144, import_node_util18, recipe, strings4, building;
111805
111634
  var init_react_native_core = __esm({
111806
111635
  "src/react-native-core.ts"() {
111807
111636
  "use strict";
111808
- import_node_crypto87 = require("node:crypto");
111637
+ import_node_crypto86 = require("node:crypto");
111809
111638
  import_node_fs142 = __toESM(require("node:fs"), 1);
111810
111639
  import_node_module20 = require("node:module");
111811
111640
  import_node_path144 = __toESM(require("node:path"), 1);
@@ -111831,7 +111660,7 @@ function exportedNames(moduleRoot, name3) {
111831
111660
  const modules = import_node_path145.default.join(moduleRoot, "modules");
111832
111661
  const module2 = import_node_path145.default.join(modules, `${name3}.swiftmodule`);
111833
111662
  if (!import_node_fs143.default.existsSync(module2)) return /* @__PURE__ */ new Set();
111834
- const key2 = (0, import_node_crypto88.createHash)("sha256").update(import_node_fs143.default.readFileSync(module2)).digest("hex");
111663
+ const key2 = (0, import_node_crypto87.createHash)("sha256").update(import_node_fs143.default.readFileSync(module2)).digest("hex");
111835
111664
  const directory2 = import_node_path145.default.join(swiftCacheDir(), "swift-public-names");
111836
111665
  const receipt = import_node_path145.default.join(directory2, `${key2}.json`);
111837
111666
  if (import_node_fs143.default.existsSync(receipt)) {
@@ -111914,12 +111743,12 @@ function clangTypeOwnership(moduleRoot, module2) {
111914
111743
  }
111915
111744
  );
111916
111745
  }
111917
- var import_node_child_process70, import_node_crypto88, import_node_fs143, import_node_path145, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
111746
+ var import_node_child_process70, import_node_crypto87, import_node_fs143, import_node_path145, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
111918
111747
  var init_swift_clang_type_ownership = __esm({
111919
111748
  "src/swift-clang-type-ownership.ts"() {
111920
111749
  "use strict";
111921
111750
  import_node_child_process70 = require("node:child_process");
111922
- import_node_crypto88 = require("node:crypto");
111751
+ import_node_crypto87 = require("node:crypto");
111923
111752
  import_node_fs143 = __toESM(require("node:fs"), 1);
111924
111753
  import_node_path145 = __toESM(require("node:path"), 1);
111925
111754
  init_is_record();
@@ -113599,7 +113428,7 @@ function targetSettings2(units) {
113599
113428
  }
113600
113429
  function oneSDKStamp(oneSDK) {
113601
113430
  if (!oneSDK) return "";
113602
- const hash = (0, import_node_crypto89.createHash)("sha256");
113431
+ const hash = (0, import_node_crypto88.createHash)("sha256");
113603
113432
  for (const files2 of [oneSDK.targets, oneSDK.entry])
113604
113433
  for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
113605
113434
  hash.update(`${name3}\0${source}\0`);
@@ -113650,7 +113479,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
113650
113479
  `;
113651
113480
  }
113652
113481
  function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
113653
- const hash = (0, import_node_crypto89.createHash)("sha256");
113482
+ const hash = (0, import_node_crypto88.createHash)("sha256");
113654
113483
  hash.update(base2);
113655
113484
  hash.update(reactProviderStamp);
113656
113485
  for (const unit2 of units) {
@@ -114023,8 +113852,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
114023
113852
  }
114024
113853
  return provider;
114025
113854
  })() : void 0;
114026
- const reactProviderStamp = reactProvider ? (0, import_node_crypto89.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
114027
- const key2 = (0, import_node_crypto89.createHash)("sha256").update(import_node_fs144.default.realpathSync(root)).digest("hex");
113855
+ const reactProviderStamp = reactProvider ? (0, import_node_crypto88.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
113856
+ const key2 = (0, import_node_crypto88.createHash)("sha256").update(import_node_fs144.default.realpathSync(root)).digest("hex");
114028
113857
  const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
114029
113858
  const failures = /* @__PURE__ */ new Map();
114030
113859
  const failureRecords = /* @__PURE__ */ new Map();
@@ -114318,7 +114147,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
114318
114147
  await check2(part[0]);
114319
114148
  continue;
114320
114149
  }
114321
- const name3 = (0, import_node_crypto89.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
114150
+ const name3 = (0, import_node_crypto88.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
114322
114151
  report(`linking ${part.length} namespaces to isolate failures`);
114323
114152
  try {
114324
114153
  const built2 = await link(part, `isolate-${name3}`);
@@ -114503,13 +114332,13 @@ ${diagnostics}`}`
114503
114332
  }
114504
114333
  return true;
114505
114334
  }
114506
- var import_node_async_hooks4, import_node_child_process71, import_node_crypto89, import_node_fs144, import_node_module21, import_node_os32, import_node_path146, import_node_url7, import_node_util19, run12, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
114335
+ var import_node_async_hooks4, import_node_child_process71, import_node_crypto88, import_node_fs144, import_node_module21, import_node_os32, import_node_path146, import_node_url7, import_node_util19, run12, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
114507
114336
  var init_expo_swift_host = __esm({
114508
114337
  "src/expo-swift-host.ts"() {
114509
114338
  "use strict";
114510
114339
  import_node_async_hooks4 = require("node:async_hooks");
114511
114340
  import_node_child_process71 = require("node:child_process");
114512
- import_node_crypto89 = require("node:crypto");
114341
+ import_node_crypto88 = require("node:crypto");
114513
114342
  import_node_fs144 = __toESM(require("node:fs"), 1);
114514
114343
  import_node_module21 = require("node:module");
114515
114344
  import_node_os32 = __toESM(require("node:os"), 1);
@@ -118437,10 +118266,10 @@ function stageHostBytes(bytes, origin, extension = "") {
118437
118266
  }
118438
118267
  async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
118439
118268
  const directory2 = prepareStagedDirectory();
118440
- const inputDigest = (0, import_node_crypto91.createHash)("sha256").update(input).digest("hex");
118269
+ const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
118441
118270
  const index = import_node_path154.default.join(
118442
118271
  directory2,
118443
- `derived-${(0, import_node_crypto91.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
118272
+ `derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
118444
118273
  );
118445
118274
  const recorded = import_node_fs152.default.existsSync(index) ? import_node_fs152.default.readFileSync(index, "utf8") : "";
118446
118275
  if (STAGED_NAME.test(recorded) && import_node_fs152.default.existsSync(import_node_path154.default.join(directory2, recorded))) {
@@ -118451,7 +118280,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
118451
118280
  return new URL(STAGED_PREFIX + recorded, origin).toString();
118452
118281
  }
118453
118282
  const staged = writeStagedBytes(await derive(), origin, extension, directory2);
118454
- const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto91.randomUUID)());
118283
+ const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto90.randomUUID)());
118455
118284
  try {
118456
118285
  import_node_fs152.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
118457
118286
  flag: "wx"
@@ -118470,7 +118299,7 @@ function metroIndexName(url) {
118470
118299
  url.searchParams.get("unstable_path"),
118471
118300
  hashes[0]
118472
118301
  ]);
118473
- return `metro-${(0, import_node_crypto91.createHash)("sha256").update(key2).digest("hex")}`;
118302
+ return `metro-${(0, import_node_crypto90.createHash)("sha256").update(key2).digest("hex")}`;
118474
118303
  }
118475
118304
  function metroRequestIndex(rawUrl) {
118476
118305
  if (!rawUrl?.startsWith("/") || rawUrl.startsWith("//")) return null;
@@ -118498,7 +118327,7 @@ function prepareStagedDirectory() {
118498
118327
  return directory2;
118499
118328
  }
118500
118329
  function writeStagedBytes(bytes, origin, extension, directory2) {
118501
- const digest3 = (0, import_node_crypto91.createHash)("sha256").update(bytes).digest("hex");
118330
+ const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
118502
118331
  extension = extension.toLowerCase();
118503
118332
  const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
118504
118333
  stagedCapture.getStore()?.add(name3);
@@ -118507,7 +118336,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
118507
118336
  if (import_node_fs152.default.existsSync(destination)) {
118508
118337
  import_node_fs152.default.utimesSync(destination, new Date(now), new Date(now));
118509
118338
  } else {
118510
- const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto91.randomUUID)());
118339
+ const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto90.randomUUID)());
118511
118340
  try {
118512
118341
  import_node_fs152.default.writeFileSync(temporary, bytes, { flag: "wx" });
118513
118342
  import_node_fs152.default.renameSync(temporary, destination);
@@ -118579,12 +118408,12 @@ async function handleStagedHostFileRequest(req, res) {
118579
118408
  throw error;
118580
118409
  }
118581
118410
  }
118582
- var import_node_async_hooks5, import_node_crypto91, import_node_fs152, import_node_path154, stagedCapture, STAGED_PREFIX, STAGED_NAME, METRO_INDEX_NAME, STAGED_RETENTION_MS;
118411
+ var import_node_async_hooks5, import_node_crypto90, import_node_fs152, import_node_path154, stagedCapture, STAGED_PREFIX, STAGED_NAME, METRO_INDEX_NAME, STAGED_RETENTION_MS;
118583
118412
  var init_staged_host_files = __esm({
118584
118413
  "src/host/staged-host-files.ts"() {
118585
118414
  "use strict";
118586
118415
  import_node_async_hooks5 = require("node:async_hooks");
118587
- import_node_crypto91 = require("node:crypto");
118416
+ import_node_crypto90 = require("node:crypto");
118588
118417
  import_node_fs152 = __toESM(require("node:fs"), 1);
118589
118418
  import_node_path154 = __toESM(require("node:path"), 1);
118590
118419
  init_uttype_mime();
@@ -118632,7 +118461,7 @@ function writeGeneratedFile(file, content) {
118632
118461
  if (!error || typeof error !== "object" || !("code" in error) || error.code !== "ENOENT")
118633
118462
  throw error;
118634
118463
  }
118635
- const temporary = (0, import_node_path156.join)((0, import_node_path156.dirname)(file), `.${(0, import_node_path156.basename)(file)}.${(0, import_node_crypto92.randomUUID)()}.tmp`);
118464
+ const temporary = (0, import_node_path156.join)((0, import_node_path156.dirname)(file), `.${(0, import_node_path156.basename)(file)}.${(0, import_node_crypto91.randomUUID)()}.tmp`);
118636
118465
  try {
118637
118466
  (0, import_node_fs154.writeFileSync)(temporary, content);
118638
118467
  (0, import_node_fs154.renameSync)(temporary, file);
@@ -119740,7 +119569,7 @@ function nativeSourceContract(file, source) {
119740
119569
  enums,
119741
119570
  defaultView
119742
119571
  });
119743
- const hash = (0, import_node_crypto92.createHash)("sha256").update(canonical).digest("hex");
119572
+ const hash = (0, import_node_crypto91.createHash)("sha256").update(canonical).digest("hex");
119744
119573
  const declarations = structs.map(
119745
119574
  (struct) => `export interface ${struct.name} {${struct.fields.map((field) => ` ${field.name}${field.optional ? "?" : ""}: ${field.type};`).join("")} }`
119746
119575
  );
@@ -119875,7 +119704,7 @@ function renderSwiftSourceGlue(packageId, contracts, linkedViews = false) {
119875
119704
  throw new Error(`swift package ${packageId} declares ${name3} twice`);
119876
119705
  names.add(name3);
119877
119706
  }
119878
- const hash = (0, import_node_crypto92.createHash)("sha256").update(JSON.stringify({ packageId, modules, views })).digest("hex");
119707
+ const hash = (0, import_node_crypto91.createHash)("sha256").update(JSON.stringify({ packageId, modules, views })).digest("hex");
119879
119708
  const hasMain = contracts.some((contract) => contract.defaultView);
119880
119709
  const bodyName = `OneNativeSourceBody_${packageId}`;
119881
119710
  const className2 = `OneNativeSource_${packageId}`;
@@ -120260,11 +120089,11 @@ function renderSwiftSourceGlue(packageId, contracts, linkedViews = false) {
120260
120089
  ].join("\n");
120261
120090
  return { hash, source };
120262
120091
  }
120263
- var import_node_crypto92, import_node_fs154, import_node_path156, GENERATED_HEADER, DECLARATION_MODIFIERS, PLAIN_ATTRIBUTES, STRUCT_MEMBER_WORDS;
120092
+ var import_node_crypto91, import_node_fs154, import_node_path156, GENERATED_HEADER, DECLARATION_MODIFIERS, PLAIN_ATTRIBUTES, STRUCT_MEMBER_WORDS;
120264
120093
  var init_nativeSourceContract = __esm({
120265
120094
  "../one-bundler/src/nativeSourceContract.ts"() {
120266
120095
  "use strict";
120267
- import_node_crypto92 = require("node:crypto");
120096
+ import_node_crypto91 = require("node:crypto");
120268
120097
  import_node_fs154 = require("node:fs");
120269
120098
  import_node_path156 = require("node:path");
120270
120099
  init_swiftPackageId();
@@ -120336,7 +120165,7 @@ function chunkKey2(lines) {
120336
120165
  return lines.map((item) => item.text).join("\n");
120337
120166
  }
120338
120167
  function stableShardIndex(key2, shardCount) {
120339
- return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
120168
+ return (0, import_node_crypto92.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
120340
120169
  }
120341
120170
  function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
120342
120171
  if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
@@ -120580,11 +120409,11 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
120580
120409
  };
120581
120410
  });
120582
120411
  }
120583
- var import_node_crypto93, import_node_path157, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
120412
+ var import_node_crypto92, import_node_path157, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
120584
120413
  var init_one_sdk_shard = __esm({
120585
120414
  "../peach-globals/build/one-sdk-shard.ts"() {
120586
120415
  "use strict";
120587
- import_node_crypto93 = require("node:crypto");
120416
+ import_node_crypto92 = require("node:crypto");
120588
120417
  import_node_path157 = __toESM(require("node:path"), 1);
120589
120418
  init_swift_source_mask();
120590
120419
  ONE_SDK_BINDING_SHARDS = 8;
@@ -124666,7 +124495,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2, appPackages
124666
124495
  ""
124667
124496
  ].join("\n");
124668
124497
  }
124669
- const digest3 = (0, import_node_crypto94.createHash)("sha256").update(manifest);
124498
+ const digest3 = (0, import_node_crypto93.createHash)("sha256").update(manifest);
124670
124499
  for (const [name3, source] of files2)
124671
124500
  digest3.update(name3).update("\0").update(source).update("\0");
124672
124501
  const key2 = digest3.digest("hex").slice(0, 16);
@@ -124689,11 +124518,11 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2, appPackages
124689
124518
  ...oneSDKShards.size ? { oneSDKShards } : {}
124690
124519
  };
124691
124520
  }
124692
- var import_node_crypto94, import_node_fs157, import_node_module22, import_node_path160, import_node_url8, ONE_SDK_DEFINES, GUEST_ENTRY, BRIDGE_SWIFT, ONE_SDK_RUNTIME_SOURCES, ONE_NATIVE_STYLE_SHARDS, ONE_NATIVE_STYLE_SHARD_MIN_BYTES, DIRECT_HOST_SWIFT_SEEDS, DIRECT_HOST_IOS_FILES;
124521
+ var import_node_crypto93, import_node_fs157, import_node_module22, import_node_path160, import_node_url8, ONE_SDK_DEFINES, GUEST_ENTRY, BRIDGE_SWIFT, ONE_SDK_RUNTIME_SOURCES, ONE_NATIVE_STYLE_SHARDS, ONE_NATIVE_STYLE_SHARD_MIN_BYTES, DIRECT_HOST_SWIFT_SEEDS, DIRECT_HOST_IOS_FILES;
124693
124522
  var init_one_native_controls_package = __esm({
124694
124523
  "src/one-native-controls-package.ts"() {
124695
124524
  "use strict";
124696
- import_node_crypto94 = require("node:crypto");
124525
+ import_node_crypto93 = require("node:crypto");
124697
124526
  import_node_fs157 = __toESM(require("node:fs"), 1);
124698
124527
  import_node_module22 = require("node:module");
124699
124528
  import_node_path160 = __toESM(require("node:path"), 1);
@@ -126028,7 +125857,7 @@ async function readOneWidgetSources(appRoot) {
126028
125857
  if (!Buffer.from(text7).equals(bytes))
126029
125858
  throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
126030
125859
  files2.set(name3, text7);
126031
- sources[import_node_path162.default.relative(root, file).split(import_node_path162.default.sep).join("/")] = (0, import_node_crypto95.createHash)("sha256").update(bytes).digest("hex");
125860
+ sources[import_node_path162.default.relative(root, file).split(import_node_path162.default.sep).join("/")] = (0, import_node_crypto94.createHash)("sha256").update(bytes).digest("hex");
126032
125861
  }
126033
125862
  const contract = files2.get("OneWidgetContract.swift") ?? "";
126034
125863
  const source = files2.get("OneWidget.swift") ?? "";
@@ -126052,17 +125881,17 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
126052
125881
  return {
126053
125882
  metadata: source.widget,
126054
125883
  projectRoot: source.root,
126055
- appIdentity: (0, import_node_crypto95.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
125884
+ appIdentity: (0, import_node_crypto94.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
126056
125885
  bundleUrl,
126057
125886
  packageUrl,
126058
125887
  urlSchemes: source.urlSchemes
126059
125888
  };
126060
125889
  }
126061
- var import_node_crypto95, import_node_fs159, import_node_path162, ONE_WIDGET_PACKAGE, nonEmpty;
125890
+ var import_node_crypto94, import_node_fs159, import_node_path162, ONE_WIDGET_PACKAGE, nonEmpty;
126062
125891
  var init_one_widget_metadata = __esm({
126063
125892
  "src/one-widget-metadata.ts"() {
126064
125893
  "use strict";
126065
- import_node_crypto95 = require("node:crypto");
125894
+ import_node_crypto94 = require("node:crypto");
126066
125895
  import_node_fs159 = __toESM(require("node:fs"), 1);
126067
125896
  import_node_path162 = __toESM(require("node:path"), 1);
126068
125897
  init_is_record();
@@ -126096,7 +125925,7 @@ async function oneWidgetPackage(appRoot) {
126096
125925
  const packagePath = import_node_path163.default.join(
126097
125926
  import_node_os34.default.tmpdir(),
126098
125927
  "peach-one-widgets",
126099
- (0, import_node_crypto96.createHash)("sha256").update(root).digest("hex"),
125928
+ (0, import_node_crypto95.createHash)("sha256").update(root).digest("hex"),
126100
125929
  ONE_WIDGET_PACKAGE
126101
125930
  );
126102
125931
  import_node_fs160.default.mkdirSync(packagePath, { recursive: true });
@@ -126110,11 +125939,11 @@ async function oneWidgetPackage(appRoot) {
126110
125939
  widget
126111
125940
  };
126112
125941
  }
126113
- var import_node_crypto96, import_node_fs160, import_node_os34, import_node_path163;
125942
+ var import_node_crypto95, import_node_fs160, import_node_os34, import_node_path163;
126114
125943
  var init_one_widget_package = __esm({
126115
125944
  "src/one-widget-package.ts"() {
126116
125945
  "use strict";
126117
- import_node_crypto96 = require("node:crypto");
125946
+ import_node_crypto95 = require("node:crypto");
126118
125947
  import_node_fs160 = __toESM(require("node:fs"), 1);
126119
125948
  import_node_os34 = __toESM(require("node:os"), 1);
126120
125949
  import_node_path163 = __toESM(require("node:path"), 1);
@@ -126330,7 +126159,7 @@ var init_android_view_classes = __esm({
126330
126159
 
126331
126160
  // src/java-module-abi.ts
126332
126161
  async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
126333
- const digest3 = (0, import_node_crypto97.createHash)("sha256");
126162
+ const digest3 = (0, import_node_crypto96.createHash)("sha256");
126334
126163
  const parent = import_node_path165.default.join(kotlinHome(), "java-specs");
126335
126164
  import_node_fs162.default.mkdirSync(parent, { recursive: true });
126336
126165
  const work = import_node_fs162.default.mkdtempSync(import_node_path165.default.join(parent, ".read-"));
@@ -126427,12 +126256,12 @@ async function compileJavaModuleAbi(input) {
126427
126256
  );
126428
126257
  return library;
126429
126258
  }
126430
- var import_node_child_process74, import_node_crypto97, import_node_fs162, import_node_path165, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
126259
+ var import_node_child_process74, import_node_crypto96, import_node_fs162, import_node_path165, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
126431
126260
  var init_java_module_abi = __esm({
126432
126261
  "src/java-module-abi.ts"() {
126433
126262
  "use strict";
126434
126263
  import_node_child_process74 = require("node:child_process");
126435
- import_node_crypto97 = require("node:crypto");
126264
+ import_node_crypto96 = require("node:crypto");
126436
126265
  import_node_fs162 = __toESM(require("node:fs"), 1);
126437
126266
  import_node_path165 = __toESM(require("node:path"), 1);
126438
126267
  import_node_util20 = require("node:util");
@@ -126760,7 +126589,7 @@ function zipSources(bytes, where) {
126760
126589
  return entries2;
126761
126590
  }
126762
126591
  function extract(bytes, where) {
126763
- const key2 = (0, import_node_crypto98.createHash)("sha256").update(bytes).digest("hex");
126592
+ const key2 = (0, import_node_crypto97.createHash)("sha256").update(bytes).digest("hex");
126764
126593
  const cached4 = pending.get(key2);
126765
126594
  if (cached4) return cached4;
126766
126595
  const request = (async () => {
@@ -126809,11 +126638,11 @@ function readSourcesJar(archive, where) {
126809
126638
  function readMavenSourcesArchive(archive) {
126810
126639
  return extract(readSourcesJar(archive, archive), archive);
126811
126640
  }
126812
- var import_node_crypto98, import_node_fs164, import_node_os35, import_node_path167, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
126641
+ var import_node_crypto97, import_node_fs164, import_node_os35, import_node_path167, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
126813
126642
  var init_kotlin_maven_sources = __esm({
126814
126643
  "src/kotlin-maven-sources.ts"() {
126815
126644
  "use strict";
126816
- import_node_crypto98 = require("node:crypto");
126645
+ import_node_crypto97 = require("node:crypto");
126817
126646
  import_node_fs164 = __toESM(require("node:fs"), 1);
126818
126647
  import_node_os35 = __toESM(require("node:os"), 1);
126819
126648
  import_node_path167 = __toESM(require("node:path"), 1);
@@ -126854,7 +126683,7 @@ async function compileKotlinGradleLibraries(input) {
126854
126683
  ])
126855
126684
  ];
126856
126685
  const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
126857
- const suffix = (0, import_node_crypto99.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
126686
+ const suffix = (0, import_node_crypto98.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
126858
126687
  const klib = import_node_path168.default.join(input.output, `${name3}-${suffix}.klib`);
126859
126688
  const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
126860
126689
  const abiPairs = java.length ? dependencies.flatMap(
@@ -126896,11 +126725,11 @@ async function compileKotlinGradleLibraries(input) {
126896
126725
  }
126897
126726
  return [...compiled.values()].map(({ klib }) => klib);
126898
126727
  }
126899
- var import_node_crypto99, import_node_fs165, import_node_path168;
126728
+ var import_node_crypto98, import_node_fs165, import_node_path168;
126900
126729
  var init_kotlin_gradle_library_plan = __esm({
126901
126730
  "src/kotlin-gradle-library-plan.ts"() {
126902
126731
  "use strict";
126903
- import_node_crypto99 = require("node:crypto");
126732
+ import_node_crypto98 = require("node:crypto");
126904
126733
  import_node_fs165 = __toESM(require("node:fs"), 1);
126905
126734
  import_node_path168 = __toESM(require("node:path"), 1);
126906
126735
  init_kotlin_library_sources();
@@ -127136,17 +126965,17 @@ function verifyKotlinSdkDirectory(root, compiler) {
127136
126965
  if (!stat2.isFile() || stat2.nlink !== 1)
127137
126966
  throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
127138
126967
  const bytes = import_node_fs166.default.readFileSync(target);
127139
- if (bytes.length !== expected.bytes || (0, import_node_crypto100.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
126968
+ if (bytes.length !== expected.bytes || (0, import_node_crypto99.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
127140
126969
  throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
127141
126970
  }
127142
126971
  return manifest;
127143
126972
  }
127144
126973
  async function installKotlinSdkArchive(archive, compiler) {
127145
- const sha2565 = (0, import_node_crypto100.createHash)("sha256").update(archive).digest("hex");
126974
+ const sha2564 = (0, import_node_crypto99.createHash)("sha256").update(archive).digest("hex");
127146
126975
  const parent = import_node_path169.default.join(kotlinHome(), "sdk");
127147
- const root = import_node_path169.default.join(parent, sha2565);
126976
+ const root = import_node_path169.default.join(parent, sha2564);
127148
126977
  if (import_node_fs166.default.existsSync(root))
127149
- return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
126978
+ return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compiler) };
127150
126979
  import_node_fs166.default.mkdirSync(parent, { recursive: true });
127151
126980
  const work = import_node_fs166.default.mkdtempSync(import_node_path169.default.join(parent, ".install-"));
127152
126981
  try {
@@ -127166,17 +126995,17 @@ async function installKotlinSdkArchive(archive, compiler) {
127166
126995
  if (!import_node_fs166.default.existsSync(root)) throw error;
127167
126996
  verifyKotlinSdkDirectory(root, compiler);
127168
126997
  }
127169
- return { root, sha256: sha2565, manifest };
126998
+ return { root, sha256: sha2564, manifest };
127170
126999
  } finally {
127171
127000
  import_node_fs166.default.rmSync(work, { recursive: true, force: true });
127172
127001
  }
127173
127002
  }
127174
- var import_node_child_process76, import_node_crypto100, import_node_fs166, import_node_path169, import_node_util21, run14;
127003
+ var import_node_child_process76, import_node_crypto99, import_node_fs166, import_node_path169, import_node_util21, run14;
127175
127004
  var init_kotlin_sdk = __esm({
127176
127005
  "src/kotlin-sdk.ts"() {
127177
127006
  "use strict";
127178
127007
  import_node_child_process76 = require("node:child_process");
127179
- import_node_crypto100 = require("node:crypto");
127008
+ import_node_crypto99 = require("node:crypto");
127180
127009
  import_node_fs166 = __toESM(require("node:fs"), 1);
127181
127010
  import_node_path169 = __toESM(require("node:path"), 1);
127182
127011
  import_node_util21 = require("node:util");
@@ -127312,7 +127141,7 @@ function peachKotlinModuleRoot() {
127312
127141
  if (!IS_STANDALONE) return import_node_path170.default.join(peachsimPackageRoot(), "kotlin");
127313
127142
  if (installedRoot) return installedRoot;
127314
127143
  const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
127315
- const digest3 = (0, import_node_crypto101.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
127144
+ const digest3 = (0, import_node_crypto100.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
127316
127145
  const parent = import_node_path170.default.join(rnxHomeDir(), "kotlin", "modules");
127317
127146
  const root = import_node_path170.default.join(parent, digest3);
127318
127147
  import_node_fs167.default.mkdirSync(parent, { recursive: true });
@@ -127341,11 +127170,11 @@ function peachKotlinModuleRoot() {
127341
127170
  installedRoot = root;
127342
127171
  return root;
127343
127172
  }
127344
- var import_node_crypto101, import_node_fs167, import_node_path170, installedRoot;
127173
+ var import_node_crypto100, import_node_fs167, import_node_path170, installedRoot;
127345
127174
  var init_kotlin_module = __esm({
127346
127175
  "src/kotlin-module.ts"() {
127347
127176
  "use strict";
127348
- import_node_crypto101 = require("node:crypto");
127177
+ import_node_crypto100 = require("node:crypto");
127349
127178
  import_node_fs167 = __toESM(require("node:fs"), 1);
127350
127179
  import_node_path170 = __toESM(require("node:path"), 1);
127351
127180
  init_standalone();
@@ -127379,7 +127208,7 @@ async function resolveAndroidGradleSources(request) {
127379
127208
  const parent = import_node_path171.default.join(kotlinHome(), "gradle-sources");
127380
127209
  import_node_fs168.default.mkdirSync(parent, { recursive: true });
127381
127210
  const work = import_node_fs168.default.mkdtempSync(import_node_path171.default.join(parent, ".query-"));
127382
- const task = `peachAndroidSources${(0, import_node_crypto102.randomBytes)(8).toString("hex")}`;
127211
+ const task = `peachAndroidSources${(0, import_node_crypto101.randomBytes)(8).toString("hex")}`;
127383
127212
  const script = import_node_path171.default.join(work, "sources.gradle");
127384
127213
  const encoded = Buffer.from(
127385
127214
  JSON.stringify({
@@ -127531,12 +127360,12 @@ function readDependencySources(value) {
127531
127360
  };
127532
127361
  });
127533
127362
  }
127534
- var import_node_child_process77, import_node_crypto102, import_node_fs168, import_node_path171, import_node_util22, run15, modelQuery;
127363
+ var import_node_child_process77, import_node_crypto101, import_node_fs168, import_node_path171, import_node_util22, run15, modelQuery;
127535
127364
  var init_android_gradle_sources = __esm({
127536
127365
  "src/android-gradle-sources.ts"() {
127537
127366
  "use strict";
127538
127367
  import_node_child_process77 = require("node:child_process");
127539
- import_node_crypto102 = require("node:crypto");
127368
+ import_node_crypto101 = require("node:crypto");
127540
127369
  import_node_fs168 = __toESM(require("node:fs"), 1);
127541
127370
  import_node_path171 = __toESM(require("node:path"), 1);
127542
127371
  import_node_util22 = require("node:util");
@@ -127951,7 +127780,7 @@ function readExpoTypes(output) {
127951
127780
  });
127952
127781
  }
127953
127782
  async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
127954
- const digest3 = (0, import_node_crypto103.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
127783
+ const digest3 = (0, import_node_crypto102.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
127955
127784
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
127956
127785
  digest3.update(import_node_fs169.default.readFileSync(import_node_path172.default.join(moduleRoot, "sdk.tar.gz")));
127957
127786
  digest3.update(tool);
@@ -128613,7 +128442,7 @@ async function compileKotlin(input, origin) {
128613
128442
  bytes: import_node_fs169.default.readFileSync(file)
128614
128443
  }));
128615
128444
  const { composeArchive, ...compilerInputs } = toolchain;
128616
- const digest3 = (0, import_node_crypto103.createHash)("sha256");
128445
+ const digest3 = (0, import_node_crypto102.createHash)("sha256");
128617
128446
  digest3.update(
128618
128447
  JSON.stringify({
128619
128448
  format: BUILD_FORMAT,
@@ -128635,7 +128464,7 @@ async function compileKotlin(input, origin) {
128635
128464
  ...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
128636
128465
  ]);
128637
128466
  for (const file of files2) {
128638
- digest3.update((0, import_node_crypto103.createHash)("sha256").update(import_node_fs169.default.readFileSync(file)).digest());
128467
+ digest3.update((0, import_node_crypto102.createHash)("sha256").update(import_node_fs169.default.readFileSync(file)).digest());
128639
128468
  }
128640
128469
  }
128641
128470
  if (viewModels) digest3.update(viewModels.toolClass);
@@ -128927,12 +128756,12 @@ async function serveKotlinRequest(pathname, res, app) {
128927
128756
  }
128928
128757
  return true;
128929
128758
  }
128930
- var import_node_child_process78, import_node_crypto103, import_node_fs169, import_node_module23, import_node_path172, import_node_util23, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
128759
+ var import_node_child_process78, import_node_crypto102, import_node_fs169, import_node_module23, import_node_path172, import_node_util23, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
128931
128760
  var init_kotlin_host = __esm({
128932
128761
  "src/kotlin-host.ts"() {
128933
128762
  "use strict";
128934
128763
  import_node_child_process78 = require("node:child_process");
128935
- import_node_crypto103 = require("node:crypto");
128764
+ import_node_crypto102 = require("node:crypto");
128936
128765
  import_node_fs169 = __toESM(require("node:fs"), 1);
128937
128766
  import_node_module23 = require("node:module");
128938
128767
  import_node_path172 = __toESM(require("node:path"), 1);
@@ -129288,7 +129117,7 @@ async function readManagedExpoIdentity(root, platform3, iosTarget, bridgeOrigin)
129288
129117
  url.searchParams.set("root", root);
129289
129118
  const response = await nodeHttpFetch(url.href);
129290
129119
  if (response.ok && response.headers.get("content-type") === revisionType) {
129291
- const environment = (0, import_node_crypto104.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
129120
+ const environment = (0, import_node_crypto103.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
129292
129121
  const inputs2 = Buffer.from(
129293
129122
  JSON.stringify([
129294
129123
  await response.text(),
@@ -129344,11 +129173,11 @@ function handleManagedExpoInputs(req, res, url) {
129344
129173
  res.writeHead(200, { "Content-Type": revisionType });
129345
129174
  res.end(revision);
129346
129175
  }
129347
- var import_node_crypto104, import_node_fs171, import_node_path174, revisionType;
129176
+ var import_node_crypto103, import_node_fs171, import_node_path174, revisionType;
129348
129177
  var init_managed_expo_identity = __esm({
129349
129178
  "src/managed-expo-identity.ts"() {
129350
129179
  "use strict";
129351
- import_node_crypto104 = require("node:crypto");
129180
+ import_node_crypto103 = require("node:crypto");
129352
129181
  import_node_fs171 = __toESM(require("node:fs"), 1);
129353
129182
  import_node_path174 = __toESM(require("node:path"), 1);
129354
129183
  init_backend_origin();
@@ -129463,8 +129292,8 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
129463
129292
  const ext = import_node_path177.default.extname(file);
129464
129293
  if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
129465
129294
  if (ext.toLowerCase() === ".pdf") {
129466
- const sha2565 = (0, import_node_crypto105.createHash)("sha256").update(bytes).digest("hex");
129467
- const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2565 }]).get(sha2565);
129295
+ const sha2564 = (0, import_node_crypto104.createHash)("sha256").update(bytes).digest("hex");
129296
+ const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2564 }]).get(sha2564);
129468
129297
  return stageHostBytes(png, origin, ".png");
129469
129298
  }
129470
129299
  return stageHostBytes(bytes, origin, ext);
@@ -129476,11 +129305,11 @@ async function stageExpoWidgetAssets(appRoot, origin) {
129476
129305
  const prepared = await prepareExpoNativeProject(appRoot);
129477
129306
  return stagePreparedExpoWidgetAssets(prepared.app, origin);
129478
129307
  }
129479
- var import_node_crypto105, import_node_fs173, import_node_path177;
129308
+ var import_node_crypto104, import_node_fs173, import_node_path177;
129480
129309
  var init_expo_widget_assets = __esm({
129481
129310
  "src/expo-widget-assets.ts"() {
129482
129311
  "use strict";
129483
- import_node_crypto105 = require("node:crypto");
129312
+ import_node_crypto104 = require("node:crypto");
129484
129313
  import_node_fs173 = __toESM(require("node:fs"), 1);
129485
129314
  import_node_path177 = __toESM(require("node:path"), 1);
129486
129315
  init_app_catalog();
@@ -129535,11 +129364,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
129535
129364
  "specifications",
129536
129365
  `${checksum}.json`
129537
129366
  );
129538
- const sha1 = (value) => (0, import_node_crypto106.createHash)("sha1").update(value).digest("hex");
129367
+ const sha1 = (value) => (0, import_node_crypto105.createHash)("sha1").update(value).digest("hex");
129539
129368
  let text7;
129540
129369
  if (import_node_fs174.default.existsSync(file)) text7 = import_node_fs174.default.readFileSync(file, "utf8");
129541
129370
  else {
129542
- const shard2 = (0, import_node_crypto106.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
129371
+ const shard2 = (0, import_node_crypto105.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
129543
129372
  const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
129544
129373
  const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
129545
129374
  if (!response.ok)
@@ -129668,7 +129497,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
129668
129497
  "end",
129669
129498
  ""
129670
129499
  ].join("\n");
129671
- const key2 = (0, import_node_crypto106.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
129500
+ const key2 = (0, import_node_crypto105.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
129672
129501
  JSON.stringify(
129673
129502
  Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
129674
129503
  )
@@ -129737,11 +129566,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
129737
129566
  );
129738
129567
  });
129739
129568
  }
129740
- var import_node_crypto106, import_node_fs174, import_node_path178, APP, record5, project, podModuleName;
129569
+ var import_node_crypto105, import_node_fs174, import_node_path178, APP, record5, project, podModuleName;
129741
129570
  var init_swift_source_pods = __esm({
129742
129571
  "src/swift-source-pods.ts"() {
129743
129572
  "use strict";
129744
- import_node_crypto106 = require("node:crypto");
129573
+ import_node_crypto105 = require("node:crypto");
129745
129574
  import_node_fs174 = __toESM(require("node:fs"), 1);
129746
129575
  import_node_path178 = __toESM(require("node:path"), 1);
129747
129576
  init_browser();
@@ -130422,7 +130251,7 @@ async function prepareNitroCompileInput(options2) {
130422
130251
  input.libraries ??= {};
130423
130252
  input.libraries[nitroProviderTarget({ name: name3 })] = library;
130424
130253
  }
130425
- const key2 = (0, import_node_crypto107.createHash)("sha256").update(
130254
+ const key2 = (0, import_node_crypto106.createHash)("sha256").update(
130426
130255
  collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
130427
130256
  ).update("\0").update(import_node_fs175.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
130428
130257
  const packagePath = import_node_path179.default.join(import_node_os36.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
@@ -130478,11 +130307,11 @@ function nitrogenGeneratedSources(podDirectory) {
130478
130307
  ...sources(import_node_path179.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
130479
130308
  ];
130480
130309
  }
130481
- var import_node_crypto107, import_node_fs175, import_node_os36, import_node_path179, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
130310
+ var import_node_crypto106, import_node_fs175, import_node_os36, import_node_path179, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
130482
130311
  var init_nitro_compile = __esm({
130483
130312
  "src/nitro-compile.ts"() {
130484
130313
  "use strict";
130485
- import_node_crypto107 = require("node:crypto");
130314
+ import_node_crypto106 = require("node:crypto");
130486
130315
  import_node_fs175 = __toESM(require("node:fs"), 1);
130487
130316
  import_node_os36 = __toESM(require("node:os"), 1);
130488
130317
  import_node_path179 = __toESM(require("node:path"), 1);
@@ -130559,11 +130388,11 @@ var init_nitro_compile = __esm({
130559
130388
  });
130560
130389
 
130561
130390
  // src/nitro-compiler-digest.ts
130562
- var import_node_crypto108, import_node_fs176, import_node_path180;
130391
+ var import_node_crypto107, import_node_fs176, import_node_path180;
130563
130392
  var init_nitro_compiler_digest = __esm({
130564
130393
  "src/nitro-compiler-digest.ts"() {
130565
130394
  "use strict";
130566
- import_node_crypto108 = require("node:crypto");
130395
+ import_node_crypto107 = require("node:crypto");
130567
130396
  import_node_fs176 = require("node:fs");
130568
130397
  import_node_path180 = __toESM(require("node:path"), 1);
130569
130398
  init_swift_compiler_digest();
@@ -130701,7 +130530,7 @@ var init_nitro_superset = __esm({
130701
130530
  init_nitroContract();
130702
130531
  init_swift_standin_digest();
130703
130532
  NITRO_SUPERSET_ENTRY_NAME = "superset";
130704
- NITRO_COMPILER_DIGEST = true ? "474b8b30de1650e72f19b75c50a0db7090ddaffdf79752b283fb389946014fa7" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
130533
+ NITRO_COMPILER_DIGEST = true ? "379ef4bc3caf96c52a4ffe7df50670f16d8db945bfbc90e1513bff35258d8b6f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
130705
130534
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
130706
130535
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
130707
130536
  published3 = /* @__PURE__ */ new Map();
@@ -131067,7 +130896,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
131067
130896
  const packagePath = import_node_path184.default.join(
131068
130897
  swiftCacheDir(),
131069
130898
  "peach-one-sdk-swift",
131070
- (0, import_node_crypto109.createHash)("sha256").update(import_node_fs179.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
130899
+ (0, import_node_crypto108.createHash)("sha256").update(import_node_fs179.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
131071
130900
  "sdk"
131072
130901
  );
131073
130902
  const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
@@ -131114,11 +130943,11 @@ async function buildOneSDKBundle(appRoot) {
131114
130943
  assets: await compiledModuleAssets(compiled.artifact)
131115
130944
  };
131116
130945
  }
131117
- var import_node_crypto109, import_node_fs179, import_node_path184, ONE_SDK_ROUTE, handleOneSDKRequest;
130946
+ var import_node_crypto108, import_node_fs179, import_node_path184, ONE_SDK_ROUTE, handleOneSDKRequest;
131118
130947
  var init_one_sdk_bundle = __esm({
131119
130948
  "src/one-sdk-bundle.ts"() {
131120
130949
  "use strict";
131121
- import_node_crypto109 = require("node:crypto");
130950
+ import_node_crypto108 = require("node:crypto");
131122
130951
  import_node_fs179 = __toESM(require("node:fs"), 1);
131123
130952
  import_node_path184 = __toESM(require("node:path"), 1);
131124
130953
  init_one_sdk_shard();
@@ -131809,11 +131638,11 @@ function readSharedDesktopAuthSession() {
131809
131638
  return null;
131810
131639
  }
131811
131640
  }
131812
- var import_node_crypto110, import_node_fs183, import_node_path189, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
131641
+ var import_node_crypto109, import_node_fs183, import_node_path189, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
131813
131642
  var init_shared_session = __esm({
131814
131643
  "src/auth/shared-session.ts"() {
131815
131644
  "use strict";
131816
- import_node_crypto110 = require("node:crypto");
131645
+ import_node_crypto109 = require("node:crypto");
131817
131646
  import_node_fs183 = require("node:fs");
131818
131647
  import_node_path189 = require("node:path");
131819
131648
  init_home_paths();
@@ -131851,7 +131680,7 @@ var init_run_rnx = __esm({
131851
131680
  // cli/secure-file.ts
131852
131681
  function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
131853
131682
  (0, import_node_fs184.mkdirSync)((0, import_node_path190.dirname)(filepath), { recursive: true });
131854
- const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto111.randomUUID)()}`;
131683
+ const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto110.randomUUID)()}`;
131855
131684
  let descriptor = null;
131856
131685
  try {
131857
131686
  descriptor = (0, import_node_fs184.openSync)(temporary, "wx", 384);
@@ -131868,11 +131697,11 @@ function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
131868
131697
  throw error;
131869
131698
  }
131870
131699
  }
131871
- var import_node_crypto111, import_node_fs184, import_node_path190;
131700
+ var import_node_crypto110, import_node_fs184, import_node_path190;
131872
131701
  var init_secure_file = __esm({
131873
131702
  "cli/secure-file.ts"() {
131874
131703
  "use strict";
131875
- import_node_crypto111 = require("node:crypto");
131704
+ import_node_crypto110 = require("node:crypto");
131876
131705
  import_node_fs184 = require("node:fs");
131877
131706
  import_node_path190 = require("node:path");
131878
131707
  }
@@ -132650,6 +132479,11 @@ async function sha256HexBytes(bytes) {
132650
132479
  for (const byte of new Uint8Array(digest3)) hex += byte.toString(16).padStart(2, "0");
132651
132480
  return hex;
132652
132481
  }
132482
+ async function sha256Hex3(input) {
132483
+ return sha256HexBytes(
132484
+ typeof input === "string" ? new TextEncoder().encode(input) : input
132485
+ );
132486
+ }
132653
132487
  async function assertSelfContainedMetroArtifactAssets(bundle) {
132654
132488
  return visitVerifiedMetroArtifactAssets(
132655
132489
  bundle,
@@ -132749,24 +132583,24 @@ async function separateMetroArtifactAssets(bundle) {
132749
132583
  entry = { fileUris: [], fileHashes: [], scales: descriptor.scales };
132750
132584
  entries2.set(key2, entry);
132751
132585
  }
132752
- const sha2565 = descriptor.fileHashes?.[index];
132586
+ const sha2564 = descriptor.fileHashes?.[index];
132753
132587
  const scale = descriptor.scales[index];
132754
- if (!sha2565 || scale === void 0) {
132588
+ if (!sha2564 || scale === void 0) {
132755
132589
  throw new Error("verified Metro asset variant is incomplete");
132756
132590
  }
132757
132591
  const filename = metroAssetScaleFilename(descriptor.name, descriptor.type, scale);
132758
- const uri = `${PEACH_BUNDLE_ASSET_PREFIX}${sha2565}/${encodeURIComponent(filename)}`;
132592
+ const uri = `${PEACH_BUNDLE_ASSET_PREFIX}${sha2564}/${encodeURIComponent(filename)}`;
132759
132593
  if (!resources.has(uri)) {
132760
132594
  resources.set(uri, {
132761
132595
  uri,
132762
- sha256: sha2565,
132596
+ sha256: sha2564,
132763
132597
  contentType: metroAssetContentType(descriptor.type),
132764
132598
  bytes,
132765
132599
  byteLength: bytes.byteLength
132766
132600
  });
132767
132601
  }
132768
132602
  entry.fileUris.push(uri);
132769
- entry.fileHashes.push(sha2565);
132603
+ entry.fileHashes.push(sha2564);
132770
132604
  },
132771
132605
  (site) => {
132772
132606
  const entry = entries2.get(assetDescriptorKey(site.descriptor));
@@ -134061,7 +133895,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
134061
133895
  }
134062
133896
  const composed = composeRnxCloudDebugSourceMap(bundleSourceMap, sections);
134063
133897
  sourceMap = {
134064
- id: `sha256:${await sha256HexBytes(new TextEncoder().encode(composed.json))}`,
133898
+ id: `sha256:${await sha256Hex3(composed.json)}`,
134065
133899
  bytes: composed.bytes,
134066
133900
  json: composed.json,
134067
133901
  resolved: composed.resolved,
@@ -134082,7 +133916,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
134082
133916
  version: 2,
134083
133917
  mode,
134084
133918
  source: {
134085
- sha256: await sha256HexBytes(new TextEncoder().encode(bundle)),
133919
+ sha256: await sha256Hex3(bundle),
134086
133920
  bytes: Buffer.byteLength(bundle, "utf8")
134087
133921
  },
134088
133922
  modules,
@@ -134093,7 +133927,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
134093
133927
  assets: { ...assets2, encodedBytes: artifactEncoded },
134094
133928
  debug: sourceMap ? { sourceMap: { id: sourceMap.id, bytes: sourceMap.bytes } } : null,
134095
133929
  artifact: {
134096
- sha256: await sha256HexBytes(new TextEncoder().encode(code)),
133930
+ sha256: await sha256Hex3(code),
134097
133931
  bytes: artifactBytes
134098
133932
  }
134099
133933
  }
@@ -134234,11 +134068,11 @@ function createCloudSession(input) {
134234
134068
  }
134235
134069
  return session;
134236
134070
  }
134237
- var import_node_crypto112, import_node_fs186, import_node_path192, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
134071
+ var import_node_crypto111, import_node_fs186, import_node_path192, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
134238
134072
  var init_cloud_session = __esm({
134239
134073
  "cli/cloud-session.ts"() {
134240
134074
  "use strict";
134241
- import_node_crypto112 = require("node:crypto");
134075
+ import_node_crypto111 = require("node:crypto");
134242
134076
  import_node_fs186 = require("node:fs");
134243
134077
  import_node_path192 = require("node:path");
134244
134078
  init_backend_origin();
@@ -134500,7 +134334,7 @@ function listMetroAssetDest(assetsPath) {
134500
134334
  return { directory: directory2, files: files2, truncated };
134501
134335
  }
134502
134336
  function metroDescriptorHash(scaleBytes) {
134503
- const hasher = (0, import_node_crypto113.createHash)("md5");
134337
+ const hasher = (0, import_node_crypto112.createHash)("md5");
134504
134338
  for (const bytes of scaleBytes) hasher.update(bytes);
134505
134339
  return hasher.digest("hex");
134506
134340
  }
@@ -134529,7 +134363,7 @@ function distinctByContent(directory2, options2) {
134529
134363
  } catch {
134530
134364
  continue;
134531
134365
  }
134532
- const digest3 = (0, import_node_crypto113.createHash)("md5").update(bytes).digest("hex");
134366
+ const digest3 = (0, import_node_crypto112.createHash)("md5").update(bytes).digest("hex");
134533
134367
  if (!byContent.has(digest3)) byContent.set(digest3, relative7);
134534
134368
  }
134535
134369
  return [...byContent.values()];
@@ -134577,7 +134411,7 @@ function placeMetroDescriptor(listing, descriptor) {
134577
134411
  continue;
134578
134412
  }
134579
134413
  const identical = fileHashes2 ? bytes.every((file, index) => {
134580
- const digest3 = (0, import_node_crypto113.createHash)("md5").update(file).digest("hex");
134414
+ const digest3 = (0, import_node_crypto112.createHash)("md5").update(file).digest("hex");
134581
134415
  return descriptor.scales.some(
134582
134416
  (scale, declared) => scale === scales[index] && fileHashes2[declared] === digest3
134583
134417
  );
@@ -134602,7 +134436,7 @@ function unverifiedContentKey(dest, fileDigests2) {
134602
134436
  const file = (0, import_node_path194.join)(dest.directory, relative7);
134603
134437
  let digest3 = fileDigests2.get(file);
134604
134438
  if (digest3 === void 0) {
134605
- digest3 = (0, import_node_crypto113.createHash)("sha256").update((0, import_node_fs188.readFileSync)(file)).digest("hex");
134439
+ digest3 = (0, import_node_crypto112.createHash)("sha256").update((0, import_node_fs188.readFileSync)(file)).digest("hex");
134606
134440
  fileDigests2.set(file, digest3);
134607
134441
  }
134608
134442
  return [scale, digest3];
@@ -134891,7 +134725,7 @@ async function produceArtifact(prepared, maxBytes, command) {
134891
134725
  }
134892
134726
  return {
134893
134727
  bytes,
134894
- sha256: (0, import_node_crypto113.createHash)("sha256").update(bytes).digest("hex"),
134728
+ sha256: (0, import_node_crypto112.createHash)("sha256").update(bytes).digest("hex"),
134895
134729
  receipt: artifact.receipt,
134896
134730
  assetsDirectory: prepared.dest?.directory ?? null,
134897
134731
  warnings
@@ -134996,11 +134830,11 @@ async function createCloudBox(options2) {
134996
134830
  warnings: artifact.warnings
134997
134831
  };
134998
134832
  }
134999
- var import_node_crypto113, import_node_fs188, import_node_path194, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
134833
+ var import_node_crypto112, import_node_fs188, import_node_path194, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
135000
134834
  var init_cloud_client = __esm({
135001
134835
  "cli/cloud-client.ts"() {
135002
134836
  "use strict";
135003
- import_node_crypto113 = require("node:crypto");
134837
+ import_node_crypto112 = require("node:crypto");
135004
134838
  import_node_fs188 = require("node:fs");
135005
134839
  import_node_path194 = require("node:path");
135006
134840
  import_node_vm = require("node:vm");
@@ -135182,14 +135016,14 @@ init_oneNativeControlsContract();
135182
135016
  var ONE_NATIVE_CONTROLS_RELEASE_BUNDLE = "one-native-controls-release.tar.gz";
135183
135017
  var ONE_NATIVE_CONTROLS_RELEASE_PIN = "one-native-controls.sha256";
135184
135018
  var ONE_NATIVE_CONTROLS_STAGED_BUNDLE = `.vite/${ONE_NATIVE_CONTROLS_RELEASE_BUNDLE}`;
135185
- function oneNativeControlsReleaseObject(sha2565) {
135186
- return `native/swift-package/${ONE_NATIVE_CONTROLS_PACKAGE}/releases/${sha2565}.tar.gz`;
135019
+ function oneNativeControlsReleaseObject(sha2564) {
135020
+ return `native/swift-package/${ONE_NATIVE_CONTROLS_PACKAGE}/releases/${sha2564}.tar.gz`;
135187
135021
  }
135188
135022
  function parseOneNativeControlsReleasePin(pin2, file) {
135189
- const sha2565 = pin2.trim();
135190
- if (!/^[a-f0-9]{64}$/.test(sha2565))
135023
+ const sha2564 = pin2.trim();
135024
+ if (!/^[a-f0-9]{64}$/.test(sha2564))
135191
135025
  throw new Error(`invalid OneNativeControls release digest at ${file}`);
135192
- return sha2565;
135026
+ return sha2564;
135193
135027
  }
135194
135028
 
135195
135029
  // src/one-native-controls-release.ts
@@ -135209,22 +135043,22 @@ function isOneNativeControlsReleaseAsset(pathname) {
135209
135043
  async function serveOneNativeControlsRelease(req, res, pathname, runtime) {
135210
135044
  const pin2 = import_node_path8.default.join(runtime, ONE_NATIVE_CONTROLS_RELEASE_PIN);
135211
135045
  if (!import_node_fs10.default.existsSync(pin2)) return false;
135212
- const sha2565 = parseOneNativeControlsReleasePin(import_node_fs10.default.readFileSync(pin2, "utf8"), pin2);
135213
- const destDir = import_node_path8.default.join(cacheDir(), "one-native-controls", sha2565);
135046
+ const sha2564 = parseOneNativeControlsReleasePin(import_node_fs10.default.readFileSync(pin2, "utf8"), pin2);
135047
+ const destDir = import_node_path8.default.join(cacheDir(), "one-native-controls", sha2564);
135214
135048
  const metadata = pathname === ONE_NATIVE_CONTROLS_METADATA_PATH;
135215
135049
  if (metadata && !import_node_fs10.default.existsSync(import_node_path8.default.join(destDir, METADATA_FILE))) {
135216
- let pending2 = installing.get(sha2565);
135050
+ let pending2 = installing.get(sha2564);
135217
135051
  if (!pending2) {
135218
135052
  const staged = import_node_path8.default.join(runtime, ONE_NATIVE_CONTROLS_STAGED_BUNDLE);
135219
135053
  pending2 = installVerifiedTarball({
135220
- url: `${NATIVE_PREBUILT_ORIGIN}/${oneNativeControlsReleaseObject(sha2565)}`,
135054
+ url: `${NATIVE_PREBUILT_ORIGIN}/${oneNativeControlsReleaseObject(sha2564)}`,
135221
135055
  localPath: import_node_fs10.default.existsSync(staged) ? staged : void 0,
135222
- digest: { algorithm: "sha256", encoding: "hex", value: sha2565 },
135056
+ digest: { algorithm: "sha256", encoding: "hex", value: sha2564 },
135223
135057
  destDir,
135224
135058
  installedMarker: METADATA_FILE,
135225
135059
  label: ONE_NATIVE_CONTROLS_PACKAGE
135226
- }).finally(() => installing.delete(sha2565));
135227
- installing.set(sha2565, pending2);
135060
+ }).finally(() => installing.delete(sha2564));
135061
+ installing.set(sha2564, pending2);
135228
135062
  }
135229
135063
  await pending2;
135230
135064
  }
@@ -136781,7 +136615,7 @@ init_app_package_handler();
136781
136615
  init_fetch_proxy_handler();
136782
136616
 
136783
136617
  // src/host/fetch-proxy-transport.ts
136784
- var import_node_crypto90 = require("node:crypto");
136618
+ var import_node_crypto89 = require("node:crypto");
136785
136619
  var import_node_fs148 = require("node:fs");
136786
136620
  var import_node_http23 = require("node:http2");
136787
136621
  var import_node_path150 = __toESM(require("node:path"), 1);
@@ -136814,7 +136648,7 @@ async function createIdentity() {
136814
136648
  const keys = await crypto.subtle.generateKey(algorithm, true, ["sign", "verify"]);
136815
136649
  const certificate = await import_x5092.X509CertificateGenerator.createSelfSigned(
136816
136650
  {
136817
- serialNumber: (0, import_node_crypto90.randomBytes)(16).toString("hex"),
136651
+ serialNumber: (0, import_node_crypto89.randomBytes)(16).toString("hex"),
136818
136652
  name: "CN=localhost",
136819
136653
  notBefore: new Date(Date.now() - 6e4),
136820
136654
  notAfter: new Date(Date.now() + 365 * 24 * 60 * 6e4),
@@ -136833,7 +136667,7 @@ async function createIdentity() {
136833
136667
  ${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
136834
136668
  -----END PRIVATE KEY-----
136835
136669
  `,
136836
- spki: (0, import_node_crypto90.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
136670
+ spki: (0, import_node_crypto89.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
136837
136671
  };
136838
136672
  }
136839
136673
  async function startFetchProxyTransport(identityPath, hasLiveSims = () => false) {