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;
@@ -10502,7 +10502,7 @@ var init_swift_objc_sdk_tree = __esm({
10502
10502
 
10503
10503
  // src/swift-compiler-digest.ts
10504
10504
  function swiftArchiveCompilerDigestValue() {
10505
- return true ? "dafa6520c0bcd0e852437835ad9626e824b1e758db5c163a7de2f7fc70ac67ee" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
10505
+ return true ? "b4b2fc7face997792991900efb229414642f042031ba789c00a1d17e542756e3" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
10506
10506
  }
10507
10507
  var import_node_crypto10, import_node_fs20, import_node_path17, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
10508
10508
  var init_swift_compiler_digest = __esm({
@@ -10531,6 +10531,7 @@ var init_swift_compiler_digest = __esm({
10531
10531
  "swift-objc-prebuilt-catalog.ts",
10532
10532
  "swift-toolchain.ts",
10533
10533
  "swift-shared-sdk.ts",
10534
+ "wasm-binary-sections.ts",
10534
10535
  "swift-distribution-mirror.ts",
10535
10536
  "swift-design-time.ts",
10536
10537
  "binaryen.lock.json",
@@ -14424,6 +14425,111 @@ var init_swift_objc_standin = __esm({
14424
14425
  }
14425
14426
  });
14426
14427
 
14428
+ // src/wasm-binary-sections.ts
14429
+ function encodeWasmNumber(value) {
14430
+ const bytes = [];
14431
+ for (let rest = value; ; ) {
14432
+ const byte = rest % 128;
14433
+ rest = Math.floor(rest / 128);
14434
+ if (rest === 0) return [...bytes, byte];
14435
+ bytes.push(byte | 128);
14436
+ }
14437
+ }
14438
+ function encodeWasmSigned(value) {
14439
+ const out = [];
14440
+ for (; ; ) {
14441
+ const byte = Number(value & 127n);
14442
+ value >>= 7n;
14443
+ if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
14444
+ out.push(byte);
14445
+ return out;
14446
+ }
14447
+ out.push(byte | 128);
14448
+ }
14449
+ }
14450
+ function encodeWasmName(name3) {
14451
+ const bytes = new TextEncoder().encode(name3);
14452
+ return [...encodeWasmNumber(bytes.length), ...bytes];
14453
+ }
14454
+ function readULEB(bytes, offset, end = bytes.length) {
14455
+ if (offset < end) {
14456
+ const first = bytes[offset];
14457
+ if (first < 128) return [first, offset + 1];
14458
+ }
14459
+ let value = 0;
14460
+ for (let shift = 0; ; shift += 7) {
14461
+ if (offset >= end || shift > 63) throw new Error("invalid wasm integer");
14462
+ const byte = bytes[offset++];
14463
+ value += (byte & 127) * 2 ** shift;
14464
+ if (!(byte & 128)) return [value, offset];
14465
+ }
14466
+ }
14467
+ function readSLEB(bytes, offset, end = bytes.length) {
14468
+ let value = 0n;
14469
+ let shift = 0n;
14470
+ let byte = 0;
14471
+ do {
14472
+ if (offset >= end || shift > 70n) throw new Error("invalid wasm integer");
14473
+ byte = bytes[offset++];
14474
+ value |= BigInt(byte & 127) << shift;
14475
+ shift += 7n;
14476
+ } while (byte & 128);
14477
+ if (byte & 64) value -= 1n << shift;
14478
+ return [value, offset];
14479
+ }
14480
+ function skipLEB(bytes, offset) {
14481
+ while ((bytes[offset++] & 128) !== 0) {
14482
+ }
14483
+ return offset;
14484
+ }
14485
+ function readWasmSection(bytes, start, end) {
14486
+ let at = start;
14487
+ const number3 = () => {
14488
+ const [value, next] = readULEB(bytes, at, end);
14489
+ at = next;
14490
+ return value;
14491
+ };
14492
+ return {
14493
+ number: number3,
14494
+ byte: () => {
14495
+ if (at >= end) throw new Error("truncated wasm section");
14496
+ return bytes[at++];
14497
+ },
14498
+ name: () => {
14499
+ const length = number3();
14500
+ at += length;
14501
+ if (at > end) throw new Error("truncated wasm name");
14502
+ return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
14503
+ },
14504
+ skip: (length) => {
14505
+ at += length;
14506
+ if (at > end) throw new Error("truncated wasm section");
14507
+ },
14508
+ position: () => at,
14509
+ done: () => at === end
14510
+ };
14511
+ }
14512
+ function wasmSections(bytes) {
14513
+ if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
14514
+ throw new Error("not a wasm module");
14515
+ const found = [];
14516
+ for (let at = 8; at < bytes.length; ) {
14517
+ const header = readWasmSection(bytes, at, bytes.length);
14518
+ const id = header.byte();
14519
+ const size2 = header.number();
14520
+ const start = header.position();
14521
+ if (start + size2 > bytes.length) throw new Error("truncated wasm section");
14522
+ found.push({ id, offset: at, start, end: start + size2 });
14523
+ at = start + size2;
14524
+ }
14525
+ return found;
14526
+ }
14527
+ var init_wasm_binary_sections = __esm({
14528
+ "src/wasm-binary-sections.ts"() {
14529
+ "use strict";
14530
+ }
14531
+ });
14532
+
14427
14533
  // src/swift-shared-sdk.ts
14428
14534
  function swiftSharedSdkSourceRoot(moduleRoot, distribution) {
14429
14535
  return import_node_path23.default.resolve(moduleRoot, distribution ? "sdk/ios" : "../peachsim/sdk/ios");
@@ -14474,18 +14580,6 @@ function swiftSharedSdkFlags(moduleRoot, distribution) {
14474
14580
  import_node_path23.default.join(root, "usr/include")
14475
14581
  ];
14476
14582
  }
14477
- function readULEB(b, o) {
14478
- let res = 0;
14479
- let shift = 0;
14480
- let p = o;
14481
- while (true) {
14482
- const byte = b[p++];
14483
- res |= (byte & 127) << shift;
14484
- if ((byte & 128) === 0) break;
14485
- shift += 7;
14486
- }
14487
- return [res, p];
14488
- }
14489
14583
  function weakenFoundationSymbolsInWasmObj(buf) {
14490
14584
  let pos = 8;
14491
14585
  while (pos < buf.length) {
@@ -14850,6 +14944,7 @@ var init_swift_shared_sdk = __esm({
14850
14944
  import_node_path23 = __toESM(require("node:path"), 1);
14851
14945
  init_swift_toolchain();
14852
14946
  init_swiftTargetContract();
14947
+ init_wasm_binary_sections();
14853
14948
  SWIFT_DISTRIBUTION_MIRROR_RECORD = ".peach-mirror.json";
14854
14949
  distributionHeaderRoots = /* @__PURE__ */ new Map();
14855
14950
  WEAKEN_FOUNDATION_SYMS = /* @__PURE__ */ new Set([
@@ -15929,6 +16024,21 @@ var init_swift_foundation = __esm({
15929
16024
  }
15930
16025
  });
15931
16026
 
16027
+ // src/sha256.ts
16028
+ function sha256Hex(input) {
16029
+ if (typeof Bun !== "undefined") {
16030
+ return new Bun.CryptoHasher("sha256").update(input).digest("hex");
16031
+ }
16032
+ return (0, import_node_crypto15.createHash)("sha256").update(input).digest("hex");
16033
+ }
16034
+ var import_node_crypto15;
16035
+ var init_sha256 = __esm({
16036
+ "src/sha256.ts"() {
16037
+ "use strict";
16038
+ import_node_crypto15 = require("node:crypto");
16039
+ }
16040
+ });
16041
+
15932
16042
  // src/swift-guest-source-plan.ts
15933
16043
  function swiftPackageLinkage(target) {
15934
16044
  const linkage = target.machOType === "staticlib" ? "static" : target.machOType === "mh_dylib" ? "dynamic" : null;
@@ -16339,16 +16449,12 @@ var init_swift_link_roots = __esm({
16339
16449
  "use strict";
16340
16450
  import_node_fs27 = __toESM(require("node:fs"), 1);
16341
16451
  import_node_path27 = __toESM(require("node:path"), 1);
16452
+ init_wasm_binary_sections();
16342
16453
  OBJC_RUNTIME_LOOKUP_SECTION = "peach_objc_runtime_lookup";
16343
16454
  leb = (bytes, at) => {
16344
- let value = 0;
16345
- let scale = 1;
16346
- for (; ; ) {
16347
- const byte = bytes[at.offset++];
16348
- value += (byte & 127) * scale;
16349
- if (!(byte & 128)) return value;
16350
- scale *= 128;
16351
- }
16455
+ const [value, next] = readULEB(bytes, at.offset);
16456
+ at.offset = next;
16457
+ return value;
16352
16458
  };
16353
16459
  rootsByDistribution = /* @__PURE__ */ new Map();
16354
16460
  }
@@ -17177,68 +17283,6 @@ var init_swift_guest_linked_spans = __esm({
17177
17283
  }
17178
17284
  });
17179
17285
 
17180
- // src/wasm-binary-sections.ts
17181
- function encodeWasmNumber(value) {
17182
- const bytes = [];
17183
- for (let rest = value; ; ) {
17184
- const byte = rest % 128;
17185
- rest = Math.floor(rest / 128);
17186
- if (rest === 0) return [...bytes, byte];
17187
- bytes.push(byte | 128);
17188
- }
17189
- }
17190
- function encodeWasmName(name3) {
17191
- const bytes = new TextEncoder().encode(name3);
17192
- return [...encodeWasmNumber(bytes.length), ...bytes];
17193
- }
17194
- function readWasmSection(bytes, start, end) {
17195
- let at = start;
17196
- const number3 = () => {
17197
- let value = 0;
17198
- for (let shift = 0; ; shift += 7) {
17199
- if (at >= end || shift > 63) throw new Error("invalid wasm integer");
17200
- const byte = bytes[at++];
17201
- value += (byte & 127) * 2 ** shift;
17202
- if (!(byte & 128)) return value;
17203
- }
17204
- };
17205
- return {
17206
- number: number3,
17207
- byte: () => {
17208
- if (at >= end) throw new Error("truncated wasm section");
17209
- return bytes[at++];
17210
- },
17211
- name: () => {
17212
- const length = number3();
17213
- at += length;
17214
- if (at > end) throw new Error("truncated wasm name");
17215
- return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
17216
- },
17217
- position: () => at,
17218
- done: () => at === end
17219
- };
17220
- }
17221
- function wasmSections(bytes) {
17222
- if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
17223
- throw new Error("not a wasm module");
17224
- const found = [];
17225
- for (let at = 8; at < bytes.length; ) {
17226
- const header = readWasmSection(bytes, at, bytes.length);
17227
- const id = header.byte();
17228
- const size2 = header.number();
17229
- const start = header.position();
17230
- if (start + size2 > bytes.length) throw new Error("truncated wasm section");
17231
- found.push({ id, offset: at, start, end: start + size2 });
17232
- at = start + size2;
17233
- }
17234
- return found;
17235
- }
17236
- var init_wasm_binary_sections = __esm({
17237
- "src/wasm-binary-sections.ts"() {
17238
- "use strict";
17239
- }
17240
- });
17241
-
17242
17286
  // src/wasm-imports.ts
17243
17287
  function readWasmImports(bytes, section2, visit3) {
17244
17288
  const input = readWasmSection(bytes, section2.start, section2.end);
@@ -17522,23 +17566,13 @@ function wasmReader(bytes, start) {
17522
17566
  const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
17523
17567
  let at = start;
17524
17568
  const u = () => {
17525
- let value = 0;
17526
- for (let shift = 0; ; shift += 7) {
17527
- const byte = bytes[at++];
17528
- value += (byte & 127) * 2 ** shift;
17529
- if (!(byte & 128)) return value;
17530
- }
17569
+ const [value, next] = readULEB(bytes, at);
17570
+ at = next;
17571
+ return value;
17531
17572
  };
17532
17573
  const s = () => {
17533
- let value = 0n;
17534
- let shift = 0n;
17535
- let byte = 0;
17536
- do {
17537
- byte = bytes[at++];
17538
- value |= BigInt(byte & 127) << shift;
17539
- shift += 7n;
17540
- } while (byte & 128);
17541
- if (byte & 64) value -= 1n << shift;
17574
+ const [value, next] = readSLEB(bytes, at);
17575
+ at = next;
17542
17576
  return value;
17543
17577
  };
17544
17578
  return {
@@ -17843,7 +17877,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
17843
17877
  else data[entry.name] = value;
17844
17878
  }
17845
17879
  if (entry.kind !== 0 && entry.kind !== 3 || host2.has(entry.name))
17846
- kept.push([...encodedName(entry.name), entry.kind, ...uleb(entry.index)]);
17880
+ kept.push([...encodeWasmName(entry.name), entry.kind, ...encodeWasmNumber(entry.index)]);
17847
17881
  }
17848
17882
  if (guestMap) {
17849
17883
  if (guestMap.code.length !== m.bodies.length)
@@ -17858,19 +17892,19 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
17858
17892
  const er = wasmReader(bytes, elements.start);
17859
17893
  const segments = er.u();
17860
17894
  const replaced = /* @__PURE__ */ new Map([
17861
- [4, [1, 112, 4, ...uleb(tableEnd + added.length)]],
17862
- [7, [...uleb(kept.length), ...kept.flat()]],
17895
+ [4, [1, 112, 4, ...encodeWasmNumber(tableEnd + added.length)]],
17896
+ [7, [...encodeWasmNumber(kept.length), ...kept.flat()]],
17863
17897
  [
17864
17898
  9,
17865
17899
  [
17866
- ...uleb(segments + 1),
17900
+ ...encodeWasmNumber(segments + 1),
17867
17901
  ...bytes.subarray(er.at, elements.end),
17868
17902
  0,
17869
17903
  66,
17870
- ...sleb(BigInt(tableEnd)),
17904
+ ...encodeWasmSigned(BigInt(tableEnd)),
17871
17905
  11,
17872
- ...uleb(added.length),
17873
- ...added.flatMap(uleb)
17906
+ ...encodeWasmNumber(added.length),
17907
+ ...added.flatMap(encodeWasmNumber)
17874
17908
  ]
17875
17909
  ]
17876
17910
  ]);
@@ -17976,33 +18010,33 @@ function codeOnlySdkImage(bytes, constructorMask) {
17976
18010
  if (drop) r.skip(1);
17977
18011
  gated.push(
17978
18012
  66,
17979
- ...sleb(BigInt(constructorMask + index++)),
18013
+ ...encodeWasmSigned(BigInt(constructorMask + index++)),
17980
18014
  45,
17981
18015
  0,
17982
18016
  0,
17983
18017
  4,
17984
18018
  64,
17985
18019
  16,
17986
- ...uleb(callee),
18020
+ ...encodeWasmNumber(callee),
17987
18021
  ...drop ? [26] : [],
17988
18022
  11
17989
18023
  );
17990
18024
  }
17991
18025
  if (index > SWIFT_SDK_CONSTRUCTOR_LIMIT)
17992
18026
  throw new Error(`${index} sdk constructors exceed the mask`);
17993
- gated.push(16, ...uleb(functionIndex("__peach_sdk_register")), 11);
18027
+ gated.push(16, ...encodeWasmNumber(functionIndex("__peach_sdk_register")), 11);
17994
18028
  bodies[constructors] = Uint8Array.from(gated);
17995
18029
  }
17996
- const codeParts = [Uint8Array.from(uleb(bodies.length))];
17997
- for (const body of bodies) codeParts.push(Uint8Array.from(uleb(body.length)), body);
18030
+ const codeParts = [Uint8Array.from(encodeWasmNumber(bodies.length))];
18031
+ for (const body of bodies) codeParts.push(Uint8Array.from(encodeWasmNumber(body.length)), body);
17998
18032
  const codeSize = codeParts.reduce((sum, part) => sum + part.length, 0);
17999
18033
  const tls = passiveSegments(bytes)[0];
18000
18034
  const out = [bytes.subarray(0, 8)];
18001
18035
  for (const s of m.sections) {
18002
18036
  if (s.id === 10) {
18003
- out.push(Uint8Array.from([10, ...uleb(codeSize)]));
18037
+ out.push(Uint8Array.from([10, ...encodeWasmNumber(codeSize)]));
18004
18038
  for (const part of codeParts) out.push(part);
18005
- } else if (s.id === 11) out.push(section(11, [1, 1, ...uleb(tls.length), ...tls]));
18039
+ } else if (s.id === 11) out.push(section(11, [1, 1, ...encodeWasmNumber(tls.length), ...tls]));
18006
18040
  else if (s.id === 12) out.push(section(12, [1]));
18007
18041
  else out.push(bytes.subarray(s.offset, s.end));
18008
18042
  }
@@ -18319,39 +18353,14 @@ function unslottedFunctions(bytes) {
18319
18353
  }
18320
18354
  return definedFuncs - slotted.size;
18321
18355
  }
18322
- 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;
18356
+ var section, PROCESS_EXPORTS, SWIFT_SDK_CONSTRUCTOR_LIMIT, FUNCTION_RELOCATIONS, MEMORY_RELOCATIONS, ADDEND_RELOCATIONS, FUNCTION_RELOC_MASK, MEMORY_RELOC_MASK, ADDEND_RELOC_MASK;
18323
18357
  var init_swift_sdk_image_wasm = __esm({
18324
18358
  "src/swift-sdk-image-wasm.ts"() {
18325
18359
  "use strict";
18326
18360
  init_swift_sdk_image_map();
18327
18361
  init_swiftSdkLinkContract();
18328
- uleb = (value) => {
18329
- const out = [];
18330
- do {
18331
- let byte = value % 128;
18332
- value = Math.floor(value / 128);
18333
- if (value) byte |= 128;
18334
- out.push(byte);
18335
- } while (value);
18336
- return out;
18337
- };
18338
- sleb = (value) => {
18339
- const out = [];
18340
- for (; ; ) {
18341
- const byte = Number(value & 127n);
18342
- value >>= 7n;
18343
- if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
18344
- out.push(byte);
18345
- return out;
18346
- }
18347
- out.push(byte | 128);
18348
- }
18349
- };
18350
- encodedName = (name3) => {
18351
- const bytes = [...Buffer.from(name3)];
18352
- return [...uleb(bytes.length), ...bytes];
18353
- };
18354
- section = (id, payload) => Uint8Array.from([id, ...uleb(payload.length), ...payload]);
18362
+ init_wasm_binary_sections();
18363
+ section = (id, payload) => Uint8Array.from([id, ...encodeWasmNumber(payload.length), ...payload]);
18355
18364
  PROCESS_EXPORTS = [
18356
18365
  "_initialize",
18357
18366
  "__wasm_call_ctors",
@@ -18456,20 +18465,12 @@ function localizeDefinedWasmSymbols(bytes, names) {
18456
18465
  const output = new Uint8Array(bytes);
18457
18466
  let cur = 8;
18458
18467
  const readU = () => {
18459
- const b0 = bytes[cur++];
18460
- if (b0 < 128) return b0;
18461
- let res = b0 & 127;
18462
- let shift = 7;
18463
- while (true) {
18464
- const byte = bytes[cur++];
18465
- res |= (byte & 127) << shift;
18466
- if ((byte & 128) === 0) return res;
18467
- shift += 7;
18468
- }
18468
+ const [res, next] = readULEB(bytes, cur);
18469
+ cur = next;
18470
+ return res;
18469
18471
  };
18470
18472
  const skipU = () => {
18471
- while ((bytes[cur++] & 128) !== 0) {
18472
- }
18473
+ cur = skipLEB(bytes, cur);
18473
18474
  };
18474
18475
  const importFuncNames = [];
18475
18476
  const importGlobalNames = [];
@@ -18576,50 +18577,11 @@ function localizeDefinedWasmSymbols(bytes, names) {
18576
18577
  var init_swift_wasm_archive = __esm({
18577
18578
  "src/swift-wasm-archive.ts"() {
18578
18579
  "use strict";
18580
+ init_wasm_binary_sections();
18579
18581
  }
18580
18582
  });
18581
18583
 
18582
18584
  // src/swift-wasm-prune.ts
18583
- function sha256Hex(bytes) {
18584
- if (typeof Bun !== "undefined")
18585
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
18586
- return (0, import_node_crypto15.createHash)("sha256").update(bytes).digest("hex");
18587
- }
18588
- function readULEB2(b, o) {
18589
- let res = 0;
18590
- let shift = 0;
18591
- let p = o;
18592
- while (true) {
18593
- const byte = b[p++];
18594
- res |= (byte & 127) << shift;
18595
- if ((byte & 128) === 0) break;
18596
- shift += 7;
18597
- }
18598
- return [res, p];
18599
- }
18600
- function readSLEB(b, o) {
18601
- let res = 0;
18602
- let shift = 0;
18603
- let p = o;
18604
- let byte = 0;
18605
- do {
18606
- byte = b[p++];
18607
- res |= (byte & 127) << shift;
18608
- shift += 7;
18609
- } while (byte & 128);
18610
- if (shift < 32 && byte & 64) res |= ~0 << shift;
18611
- return [res, p];
18612
- }
18613
- function encodeULEB(val) {
18614
- const out = [];
18615
- do {
18616
- let byte = val & 127;
18617
- val >>>= 7;
18618
- if (val !== 0) byte |= 128;
18619
- out.push(byte);
18620
- } while (val !== 0);
18621
- return out;
18622
- }
18623
18585
  function isRootSegName(name3) {
18624
18586
  for (const pref of ROOT_SEG_PREFIXES) {
18625
18587
  if (name3 === pref || name3.startsWith(`${pref}.`)) return true;
@@ -18645,39 +18607,14 @@ function decodeRelocations(buf, sections) {
18645
18607
  for (let k = 0; k < sectionCount; k++, i++) {
18646
18608
  start[i] = length + cur - baseAt;
18647
18609
  const rType = buf[cur++];
18648
- let offset = buf[cur++];
18649
- if (offset >= 128) {
18650
- offset &= 127;
18651
- let shift = 7;
18652
- while (true) {
18653
- const byte = buf[cur++];
18654
- offset |= (byte & 127) << shift;
18655
- if (byte < 128) break;
18656
- shift += 7;
18657
- }
18658
- }
18659
- let symbol2 = buf[cur++];
18660
- if (symbol2 >= 128) {
18661
- symbol2 &= 127;
18662
- let shift = 7;
18663
- while (true) {
18664
- const byte = buf[cur++];
18665
- symbol2 |= (byte & 127) << shift;
18666
- if (byte < 128) break;
18667
- shift += 7;
18668
- }
18669
- }
18610
+ let offset;
18611
+ [offset, cur] = readULEB(buf, cur);
18612
+ let symbol2;
18613
+ [symbol2, cur] = readULEB(buf, cur);
18670
18614
  if (rType < 32 && (ADDEND_RELOC_MASK2 & 1 << rType) !== 0) {
18671
- let byte = buf[cur++];
18672
- let value = byte & 127;
18673
- let shift = 7;
18674
- while (byte >= 128) {
18675
- byte = buf[cur++];
18676
- value |= (byte & 127) << shift;
18677
- shift += 7;
18678
- }
18679
- if (shift < 32 && (byte & 64) !== 0) value |= ~0 << shift;
18680
- addend[i] = value;
18615
+ let value;
18616
+ [value, cur] = readSLEB(buf, cur);
18617
+ addend[i] = Number(BigInt.asIntN(32, value));
18681
18618
  }
18682
18619
  ro[i] = offset;
18683
18620
  rs[i] = symbol2;
@@ -18712,36 +18649,36 @@ function patchSwiftrtObject(src) {
18712
18649
  let pos = 8;
18713
18650
  while (pos < buf.length) {
18714
18651
  const id = buf[pos++];
18715
- const [sz, p] = readULEB2(buf, pos);
18652
+ const [sz, p] = readULEB(buf, pos);
18716
18653
  const end = p + sz;
18717
18654
  if (id === 0) {
18718
- const [nLen, np] = readULEB2(buf, p);
18655
+ const [nLen, np] = readULEB(buf, p);
18719
18656
  const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
18720
18657
  const cp = np + nLen;
18721
18658
  if (name3 === "linking") {
18722
- let [, lp] = readULEB2(buf, cp);
18659
+ let [, lp] = readULEB(buf, cp);
18723
18660
  while (lp < end) {
18724
18661
  const subId = buf[lp++];
18725
- const [subLen, sp] = readULEB2(buf, lp);
18662
+ const [subLen, sp] = readULEB(buf, lp);
18726
18663
  const subEnd = sp + subLen;
18727
18664
  if (subId === 8) {
18728
- let [cnt, cur] = readULEB2(buf, sp);
18665
+ let [cnt, cur] = readULEB(buf, sp);
18729
18666
  for (let i = 0; i < cnt; i++) {
18730
18667
  const kind = buf[cur++];
18731
18668
  const flPos = cur;
18732
- const [fl, c2] = readULEB2(buf, cur);
18669
+ const [fl, c2] = readULEB(buf, cur);
18733
18670
  cur = c2;
18734
18671
  const isUndef = (fl & 16) !== 0;
18735
18672
  const isExplicitName = (fl & 64) !== 0;
18736
18673
  if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
18737
- const [, c3] = readULEB2(buf, cur);
18674
+ const [, c3] = readULEB(buf, cur);
18738
18675
  cur = c3;
18739
18676
  if (!isUndef || isExplicitName) {
18740
- const [sLen, c4] = readULEB2(buf, cur);
18677
+ const [sLen, c4] = readULEB(buf, cur);
18741
18678
  cur = c4 + sLen;
18742
18679
  }
18743
18680
  } else if (kind === 1) {
18744
- const [sLen, c3] = readULEB2(buf, cur);
18681
+ const [sLen, c3] = readULEB(buf, cur);
18745
18682
  const sName = Buffer.from(buf.subarray(c3, c3 + sLen)).toString("utf8");
18746
18683
  if (sName === "_ZN12_GLOBAL__N_18sectionsE") fallbackSymIdx = i;
18747
18684
  for (const prefix of ["__start_", "__stop_"]) {
@@ -18753,13 +18690,13 @@ function patchSwiftrtObject(src) {
18753
18690
  }
18754
18691
  cur = c3 + sLen;
18755
18692
  if (!isUndef) {
18756
- const [, c4] = readULEB2(buf, cur);
18757
- const [, c5] = readULEB2(buf, c4);
18758
- const [, c6] = readULEB2(buf, c5);
18693
+ const [, c4] = readULEB(buf, cur);
18694
+ const [, c5] = readULEB(buf, c4);
18695
+ const [, c6] = readULEB(buf, c5);
18759
18696
  cur = c6;
18760
18697
  }
18761
18698
  } else if (kind === 3) {
18762
- const [, c3] = readULEB2(buf, cur);
18699
+ const [, c3] = readULEB(buf, cur);
18763
18700
  cur = c3;
18764
18701
  }
18765
18702
  }
@@ -18773,26 +18710,25 @@ function patchSwiftrtObject(src) {
18773
18710
  pos = 8;
18774
18711
  while (pos < buf.length) {
18775
18712
  const id = buf[pos++];
18776
- const [sz, p] = readULEB2(buf, pos);
18713
+ const [sz, p] = readULEB(buf, pos);
18777
18714
  const end = p + sz;
18778
18715
  if (id === 0) {
18779
- const [nLen, np] = readULEB2(buf, p);
18716
+ const [nLen, np] = readULEB(buf, p);
18780
18717
  const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
18781
18718
  const cp = np + nLen;
18782
18719
  if (name3 === "reloc.CODE") {
18783
- const [, r1] = readULEB2(buf, cp);
18784
- let [cnt, cur] = readULEB2(buf, r1);
18720
+ const [, r1] = readULEB(buf, cp);
18721
+ let [cnt, cur] = readULEB(buf, r1);
18785
18722
  for (let i = 0; i < cnt; i++) {
18786
18723
  const rType = buf[cur++];
18787
- const [, c2] = readULEB2(buf, cur);
18788
- const [rs, c3] = readULEB2(buf, c2);
18724
+ const [, c2] = readULEB(buf, cur);
18725
+ const [rs, c3] = readULEB(buf, c2);
18789
18726
  if (neutralizedSyms.has(rs) && c3 - c2 === 1) {
18790
18727
  buf[c2] = fallbackSymIdx;
18791
18728
  }
18792
18729
  cur = c3;
18793
18730
  if (ADDEND_RELOCATIONS.has(rType)) {
18794
- const [, c4] = readSLEB(buf, cur);
18795
- cur = c4;
18731
+ cur = skipLEB(buf, cur);
18796
18732
  }
18797
18733
  }
18798
18734
  }
@@ -18806,25 +18742,14 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
18806
18742
  let pos = 8;
18807
18743
  let cur = 8;
18808
18744
  const readU = () => {
18809
- const b0 = buf[cur++];
18810
- if (b0 < 128) return b0;
18811
- let res = b0 & 127;
18812
- let shift = 7;
18813
- while (true) {
18814
- const byte = buf[cur++];
18815
- res |= (byte & 127) << shift;
18816
- if (byte < 128) return res;
18817
- shift += 7;
18818
- }
18745
+ const [res, next] = readULEB(buf, cur);
18746
+ cur = next;
18747
+ return res;
18819
18748
  };
18820
18749
  const skipU = () => {
18821
- while (buf[cur++] >= 128) {
18822
- }
18823
- };
18824
- const skipS = () => {
18825
- while (buf[cur++] >= 128) {
18826
- }
18750
+ cur = skipLEB(buf, cur);
18827
18751
  };
18752
+ const skipS = skipU;
18828
18753
  let numImportFuncs = 0;
18829
18754
  let importsDlsym = false;
18830
18755
  const importFuncNames = [];
@@ -19422,16 +19347,9 @@ function guestWasmSymbols(bytes) {
19422
19347
  const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
19423
19348
  let cur = 8;
19424
19349
  const readU = () => {
19425
- const b0 = bytes[cur++];
19426
- if (b0 < 128) return b0;
19427
- let res = b0 & 127;
19428
- let shift = 7;
19429
- while (true) {
19430
- const byte = bytes[cur++];
19431
- res |= (byte & 127) << shift;
19432
- if ((byte & 128) === 0) return res;
19433
- shift += 7;
19434
- }
19350
+ const [res, next] = readULEB(bytes, cur);
19351
+ cur = next;
19352
+ return res;
19435
19353
  };
19436
19354
  let importsDlsym = false;
19437
19355
  const importFuncNames = [];
@@ -19621,7 +19539,7 @@ function swiftPrunedSdkObjectOrigins(sdk2, args, rewritten) {
19621
19539
  }
19622
19540
  function ensureUnpackedSdkObjects(sdkWasiDir) {
19623
19541
  const archives = import_node_fs29.default.readdirSync(sdkWasiDir).filter((file) => file.endsWith(".a")).sort();
19624
- const hash = (0, import_node_crypto15.createHash)("sha256");
19542
+ const hash = (0, import_node_crypto16.createHash)("sha256");
19625
19543
  for (const archive of archives) {
19626
19544
  hash.update(archive + "\0");
19627
19545
  hash.update(swiftFileChecksum(import_node_path29.default.join(sdkWasiDir, archive)));
@@ -20572,7 +20490,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20572
20490
  if (!deadSpecialSegs.has(sIdx)) continue;
20573
20491
  if (!isSpecialSegRelocLive(obj, obj.segNames[sIdx], data.rs[i])) continue;
20574
20492
  const first = relocationBytes(data, i);
20575
- const [, afterRoOff] = readULEB2(first, 1);
20493
+ const [, afterRoOff] = readULEB(first, 1);
20576
20494
  firstLiveInSpecialSeg.set(sIdx, {
20577
20495
  rType: first[0],
20578
20496
  afterRo: first.subarray(afterRoOff)
@@ -20602,7 +20520,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20602
20520
  zeroDataReloc(i);
20603
20521
  } else {
20604
20522
  const repl = firstLiveInSpecialSeg.get(segIdx);
20605
- const roBytes = encodeULEB(data.ro[i]);
20523
+ const roBytes = encodeWasmNumber(data.ro[i]);
20606
20524
  const out = new Uint8Array(1 + roBytes.length + repl.afterRo.length);
20607
20525
  out[0] = repl.rType;
20608
20526
  out.set(roBytes, 1);
@@ -20641,34 +20559,34 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20641
20559
  while (pos < buf.length) {
20642
20560
  const secStart = pos;
20643
20561
  const id = buf[pos++];
20644
- const [sz, p] = readULEB2(buf, pos);
20562
+ const [sz, p] = readULEB(buf, pos);
20645
20563
  const end = p + sz;
20646
20564
  if (id === 0) {
20647
- const [nLen, np] = readULEB2(buf, p);
20565
+ const [nLen, np] = readULEB(buf, p);
20648
20566
  const name3 = rawBuf.toString("utf8", np, np + nLen);
20649
20567
  const cp = np + nLen;
20650
20568
  if (name3 === "linking") {
20651
- const [, lpStart] = readULEB2(buf, cp);
20569
+ const [, lpStart] = readULEB(buf, cp);
20652
20570
  const subChunks = [buf.subarray(p, lpStart)];
20653
20571
  let lp = lpStart;
20654
20572
  while (lp < end) {
20655
20573
  const subStart = lp;
20656
20574
  const subId = buf[lp++];
20657
- const [subLen, sp] = readULEB2(buf, lp);
20575
+ const [subLen, sp] = readULEB(buf, lp);
20658
20576
  const subEnd = sp + subLen;
20659
20577
  if (subId === 5) {
20660
20578
  const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
20661
- let [cnt, cur] = readULEB2(buf, sp);
20579
+ let [cnt, cur] = readULEB(buf, sp);
20662
20580
  for (let i = 0; i < cnt; i++) {
20663
- const [sLen, s2] = readULEB2(buf, cur);
20581
+ const [sLen, s2] = readULEB(buf, cur);
20664
20582
  const segName = obj.segNames[i];
20665
20583
  const repl = RECORD_SEGS.get(segName);
20666
20584
  const isSpecial = repl !== void 0;
20667
20585
  if (deadSpecialSegs.has(i) && repl !== void 0)
20668
20586
  subCopy.set(Buffer.from(repl, "utf8"), s2 - subStart);
20669
20587
  cur = s2 + sLen;
20670
- const [, s3] = readULEB2(buf, cur);
20671
- const [segFl, s4] = readULEB2(buf, s3);
20588
+ const [, s3] = readULEB(buf, cur);
20589
+ const [segFl, s4] = readULEB(buf, s3);
20672
20590
  const sFlLen = s4 - s3;
20673
20591
  const keepRetain = isSpecial ? !deadSpecialSegs.has(i) : isRootSegName(segName) && !segName.startsWith(".init_array") && sLive[i] === 1;
20674
20592
  const newSegFl = keepRetain ? segFl | 4 : segFl & ~4;
@@ -20682,12 +20600,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20682
20600
  }
20683
20601
  subChunks.push(subCopy);
20684
20602
  } else if (subId === 6) {
20685
- let [cnt, cur] = readULEB2(buf, sp);
20603
+ let [cnt, cur] = readULEB(buf, sp);
20686
20604
  const entrySlices = [];
20687
20605
  for (let i = 0; i < cnt; i++) {
20688
20606
  const eStart = cur;
20689
- const [, s2] = readULEB2(buf, cur);
20690
- const [symIdx, s3] = readULEB2(buf, s2);
20607
+ const [, s2] = readULEB(buf, cur);
20608
+ const [symIdx, s3] = readULEB(buf, s2);
20691
20609
  cur = s3;
20692
20610
  if (obj.symKind[symIdx] === 0 && obj.symElemIdx[symIdx] >= obj.numImportFuncs) {
20693
20611
  if (fLive[obj.symElemIdx[symIdx] - obj.numImportFuncs] === 1) {
@@ -20698,19 +20616,19 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20698
20616
  }
20699
20617
  }
20700
20618
  if (entrySlices.length > 0) {
20701
- const cntBytes = Uint8Array.from(encodeULEB(entrySlices.length));
20619
+ const cntBytes = Uint8Array.from(encodeWasmNumber(entrySlices.length));
20702
20620
  const bodyLen = cntBytes.length + entrySlices.reduce((a, b) => a + b.length, 0);
20703
- const lenBytes = Uint8Array.from(encodeULEB(bodyLen));
20621
+ const lenBytes = Uint8Array.from(encodeWasmNumber(bodyLen));
20704
20622
  subChunks.push(Uint8Array.of(6), lenBytes, cntBytes);
20705
20623
  for (const entry of entrySlices) subChunks.push(entry);
20706
20624
  }
20707
20625
  } else if (subId === 8) {
20708
20626
  const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
20709
- let [cnt, cur] = readULEB2(buf, sp);
20627
+ let [cnt, cur] = readULEB(buf, sp);
20710
20628
  for (let i = 0; i < cnt; i++) {
20711
20629
  const kind = buf[cur++];
20712
20630
  const flOffset = cur - subStart;
20713
- const [fl, c2] = readULEB2(buf, cur);
20631
+ const [fl, c2] = readULEB(buf, cur);
20714
20632
  cur = c2;
20715
20633
  const isUndef = (fl & 16) !== 0;
20716
20634
  const isExplicitName = (fl & 64) !== 0;
@@ -20730,23 +20648,23 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20730
20648
  subCopy[flOffset + 1] = 0;
20731
20649
  }
20732
20650
  if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
20733
- const [, c3] = readULEB2(buf, cur);
20651
+ const [, c3] = readULEB(buf, cur);
20734
20652
  cur = c3;
20735
20653
  if (!isUndef || isExplicitName) {
20736
- const [sLen, c4] = readULEB2(buf, cur);
20654
+ const [sLen, c4] = readULEB(buf, cur);
20737
20655
  cur = c4 + sLen;
20738
20656
  }
20739
20657
  } else if (kind === 1) {
20740
- const [sLen, c3] = readULEB2(buf, cur);
20658
+ const [sLen, c3] = readULEB(buf, cur);
20741
20659
  cur = c3 + sLen;
20742
20660
  if (!isUndef) {
20743
- const [, c4] = readULEB2(buf, cur);
20744
- const [, c5] = readULEB2(buf, c4);
20745
- const [, c6] = readULEB2(buf, c5);
20661
+ const [, c4] = readULEB(buf, cur);
20662
+ const [, c5] = readULEB(buf, c4);
20663
+ const [, c6] = readULEB(buf, c5);
20746
20664
  cur = c6;
20747
20665
  }
20748
20666
  } else if (kind === 3) {
20749
- const [, c3] = readULEB2(buf, cur);
20667
+ const [, c3] = readULEB(buf, cur);
20750
20668
  cur = c3;
20751
20669
  }
20752
20670
  }
@@ -20757,29 +20675,29 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20757
20675
  lp = subEnd;
20758
20676
  }
20759
20677
  const totalSubLen = subChunks.reduce((a, b) => a + b.length, 0);
20760
- outChunks.push(Uint8Array.of(0), Uint8Array.from(encodeULEB(totalSubLen)));
20678
+ outChunks.push(Uint8Array.of(0), Uint8Array.from(encodeWasmNumber(totalSubLen)));
20761
20679
  for (const chunk of subChunks) outChunks.push(chunk);
20762
20680
  } else if (name3 === "reloc.CODE") {
20763
- const [, r1] = readULEB2(buf, cp);
20681
+ const [, r1] = readULEB(buf, cp);
20764
20682
  const headerSlice = buf.subarray(p, r1);
20765
- const cntBytes = Uint8Array.from(encodeULEB(keptCodeRelocs.length));
20683
+ const cntBytes = Uint8Array.from(encodeWasmNumber(keptCodeRelocs.length));
20766
20684
  const relSlices = keptCodeRelocs.map((i) => relocationBytes(code, i));
20767
20685
  const totalLen = headerSlice.length + cntBytes.length + relSlices.reduce((a, b) => a + b.length, 0);
20768
20686
  outChunks.push(
20769
20687
  Uint8Array.of(0),
20770
- Uint8Array.from(encodeULEB(totalLen)),
20688
+ Uint8Array.from(encodeWasmNumber(totalLen)),
20771
20689
  headerSlice,
20772
20690
  cntBytes
20773
20691
  );
20774
20692
  for (const relocation of relSlices) outChunks.push(relocation);
20775
20693
  } else if (name3 === "reloc.DATA") {
20776
- const [, r1] = readULEB2(buf, cp);
20694
+ const [, r1] = readULEB(buf, cp);
20777
20695
  const headerSlice = buf.subarray(p, r1);
20778
- const cntBytes = Uint8Array.from(encodeULEB(keptDataRelocBytes.length));
20696
+ const cntBytes = Uint8Array.from(encodeWasmNumber(keptDataRelocBytes.length));
20779
20697
  const totalLen = headerSlice.length + cntBytes.length + keptDataRelocBytes.reduce((a, b) => a + b.length, 0);
20780
20698
  outChunks.push(
20781
20699
  Uint8Array.of(0),
20782
- Uint8Array.from(encodeULEB(totalLen)),
20700
+ Uint8Array.from(encodeWasmNumber(totalLen)),
20783
20701
  headerSlice,
20784
20702
  cntBytes
20785
20703
  );
@@ -20789,15 +20707,15 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20789
20707
  const nameBytes = buf.subarray(p, cp);
20790
20708
  outChunks.push(
20791
20709
  Uint8Array.of(0),
20792
- Uint8Array.from(encodeULEB(nameBytes.length)),
20710
+ Uint8Array.from(encodeWasmNumber(nameBytes.length)),
20793
20711
  nameBytes
20794
20712
  );
20795
20713
  } else if (name3.startsWith("reloc..debug_")) {
20796
- const [, r1] = readULEB2(buf, cp);
20714
+ const [, r1] = readULEB(buf, cp);
20797
20715
  const headerSlice = buf.subarray(p, r1);
20798
20716
  outChunks.push(
20799
20717
  Uint8Array.of(0),
20800
- Uint8Array.from(encodeULEB(headerSlice.length + 1)),
20718
+ Uint8Array.from(encodeWasmNumber(headerSlice.length + 1)),
20801
20719
  headerSlice,
20802
20720
  Uint8Array.of(0)
20803
20721
  );
@@ -20910,15 +20828,16 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
20910
20828
  );
20911
20829
  import_node_fs29.default.rmSync(rspPath, { force: true });
20912
20830
  }
20913
- var import_node_child_process16, import_node_crypto15, import_node_fs29, import_node_path29, 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;
20831
+ var import_node_child_process16, import_node_crypto16, import_node_fs29, import_node_path29, 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;
20914
20832
  var init_swift_wasm_prune = __esm({
20915
20833
  "src/swift-wasm-prune.ts"() {
20916
20834
  "use strict";
20917
20835
  import_node_child_process16 = require("node:child_process");
20918
- import_node_crypto15 = require("node:crypto");
20836
+ import_node_crypto16 = require("node:crypto");
20919
20837
  import_node_fs29 = __toESM(require("node:fs"), 1);
20920
20838
  import_node_path29 = __toESM(require("node:path"), 1);
20921
20839
  v3 = __toESM(require("peachsim/vendor/valibot"), 1);
20840
+ init_sha256();
20922
20841
  init_swift_guest_source_plan();
20923
20842
  init_swift_link_roots();
20924
20843
  init_swift_resource_class_names();
@@ -20926,6 +20845,7 @@ var init_swift_wasm_prune = __esm({
20926
20845
  init_swift_toolchain();
20927
20846
  init_swift_wasm_archive();
20928
20847
  init_swiftRuntimeProductContract();
20848
+ init_wasm_binary_sections();
20929
20849
  WIDE_DATA_RELOCS = /* @__PURE__ */ new Set([16, 19, 22, 27]);
20930
20850
  ROOT_SEG_PREFIXES = [
20931
20851
  ".init_array",
@@ -21032,7 +20952,7 @@ function aliasGuestArchive(options2) {
21032
20952
  alias,
21033
20953
  name: member.name,
21034
20954
  ordinal,
21035
- sha256: (0, import_node_crypto16.createHash)("sha256").update(member.bytes).digest("hex")
20955
+ sha256: (0, import_node_crypto17.createHash)("sha256").update(member.bytes).digest("hex")
21036
20956
  };
21037
20957
  });
21038
20958
  const response = import_node_path30.default.join(options2.directory, "members.rsp");
@@ -21045,7 +20965,7 @@ function aliasGuestArchive(options2) {
21045
20965
  (0, import_node_child_process17.execFileSync)(options2.llvmAr, ["rcsD", archive, `@${response}`], { stdio: "pipe" });
21046
20966
  const rewritten = readArMembers((0, import_node_fs30.readFileSync)(archive));
21047
20967
  if (rewritten.length !== members2.length || rewritten.some(
21048
- (member, index) => member.name !== members2[index].alias || (0, import_node_crypto16.createHash)("sha256").update(member.bytes).digest("hex") !== members2[index].sha256
20968
+ (member, index) => member.name !== members2[index].alias || (0, import_node_crypto17.createHash)("sha256").update(member.bytes).digest("hex") !== members2[index].sha256
21049
20969
  ))
21050
20970
  throw new Error(`guest archive changed members ${options2.archive}`);
21051
20971
  return { source: options2.archive, archive, members: members2 };
@@ -21105,12 +21025,12 @@ function aliasGuestLinkIdentities(identities, archives) {
21105
21025
  }
21106
21026
  return result;
21107
21027
  }
21108
- var import_node_child_process17, import_node_crypto16, import_node_fs30, import_node_path30;
21028
+ var import_node_child_process17, import_node_crypto17, import_node_fs30, import_node_path30;
21109
21029
  var init_swift_guest_archive = __esm({
21110
21030
  "src/swift-guest-archive.ts"() {
21111
21031
  "use strict";
21112
21032
  import_node_child_process17 = require("node:child_process");
21113
- import_node_crypto16 = require("node:crypto");
21033
+ import_node_crypto17 = require("node:crypto");
21114
21034
  import_node_fs30 = require("node:fs");
21115
21035
  import_node_path30 = __toESM(require("node:path"), 1);
21116
21036
  init_swift_wasm_prune();
@@ -21124,15 +21044,15 @@ function nativeDyldName(bytes) {
21124
21044
  name3 += String.fromCharCode(...bytes.subarray(start, start + 4096));
21125
21045
  return name3;
21126
21046
  }
21127
- function nativeDyldTablePath(primary, sha2565) {
21047
+ function nativeDyldTablePath(primary, sha2564) {
21128
21048
  const prefix = primary.slice(0, primary.lastIndexOf("/") + 1);
21129
- return prefix + sha2565 + (primary.endsWith(".wasm") ? ".dyld" : "");
21049
+ return prefix + sha2564 + (primary.endsWith(".wasm") ? ".dyld" : "");
21130
21050
  }
21131
21051
  function readNativeDyldTableIndex(section2) {
21132
21052
  const bytes = new Uint8Array(section2);
21133
21053
  const view = new DataView(section2);
21134
21054
  if (bytes.length < 40) throw new Error("native dyld table index is truncated");
21135
- const sha2565 = Array.from(
21055
+ const sha2564 = Array.from(
21136
21056
  bytes.subarray(0, 32),
21137
21057
  (byte) => byte.toString(16).padStart(2, "0")
21138
21058
  ).join("");
@@ -21156,7 +21076,7 @@ function readNativeDyldTableIndex(section2) {
21156
21076
  at = end + 1;
21157
21077
  }
21158
21078
  if (at !== bytes.length) throw new Error("native dyld table index has trailing bytes");
21159
- return { sha256: sha2565, byteLength, packs, firsts };
21079
+ return { sha256: sha2564, byteLength, packs, firsts };
21160
21080
  }
21161
21081
  var NATIVE_DYLD_TABLE_SECTION, NATIVE_DYLD_PACKS_SECTION;
21162
21082
  var init_nativeDyldTableContract = __esm({
@@ -21189,34 +21109,11 @@ var init_nativeWasmContract = __esm({
21189
21109
  });
21190
21110
 
21191
21111
  // src/swift-guest-image-ledger.ts
21192
- function readNumber(bytes, position) {
21193
- if (position < bytes.length) {
21194
- const first = bytes[position];
21195
- if (first < 128) return [first, position + 1];
21196
- }
21197
- let value = 0;
21198
- let shift = 0;
21199
- for (; ; ) {
21200
- if (position >= bytes.length || shift > 63) throw new Error("invalid wasm integer");
21201
- const byte = bytes[position++];
21202
- value += (byte & 127) * 2 ** shift;
21203
- if (!(byte & 128)) return [value, position];
21204
- shift += 7;
21205
- }
21206
- }
21207
21112
  function encodeNumber(value) {
21208
- if (value < 128) return Buffer.from([value]);
21209
- const bytes = [];
21210
- do {
21211
- let byte = value % 128;
21212
- value = Math.floor(value / 128);
21213
- if (value) byte |= 128;
21214
- bytes.push(byte);
21215
- } while (value);
21216
- return Buffer.from(bytes);
21113
+ return Buffer.from(encodeWasmNumber(value));
21217
21114
  }
21218
21115
  function readString(bytes, position) {
21219
- const [length, start] = readNumber(bytes, position);
21116
+ const [length, start] = readULEB(bytes, position);
21220
21117
  if (start + length > bytes.length) throw new Error("invalid wasm string");
21221
21118
  return [
21222
21119
  Buffer.from(bytes.buffer, bytes.byteOffset + start, length).toString("utf8"),
@@ -21542,13 +21439,13 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
21542
21439
  for (const subsection of subsections) {
21543
21440
  if (subsection.kind === 6 && objcLoader !== void 0) {
21544
21441
  const content = subsection.parts[0];
21545
- const [count, entriesStart] = readNumber(content, 0);
21442
+ const [count, entriesStart] = readULEB(content, 0);
21546
21443
  const initWriter = new ByteWriter(content.length + 16);
21547
21444
  initWriter.bytes(content, 0, entriesStart);
21548
21445
  let entryStart = entriesStart;
21549
21446
  for (let i = 0; i < count; i++) {
21550
- const [, symbolStart] = readNumber(content, entryStart);
21551
- const [symbol2, entryEnd] = readNumber(content, symbolStart);
21447
+ const [, symbolStart] = readULEB(content, entryStart);
21448
+ const [symbol2, entryEnd] = readULEB(content, symbolStart);
21552
21449
  if (symbol2 === objcLoader) {
21553
21450
  initWriter.uleb(1);
21554
21451
  initWriter.bytes(content, symbolStart, entryEnd);
@@ -21618,7 +21515,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
21618
21515
  if (position < bytes.length && bytes[position] < 128) {
21619
21516
  size2 = bytes[position++];
21620
21517
  } else {
21621
- const [val, next] = readNumber(bytes, position);
21518
+ const [val, next] = readULEB(bytes, position);
21622
21519
  size2 = val;
21623
21520
  position = next;
21624
21521
  }
@@ -22118,7 +22015,7 @@ function createGuestImageLedger(input) {
22118
22015
  const digest3 = ({ object: object8 }) => {
22119
22016
  let value = digests2.get(object8);
22120
22017
  if (value === void 0) {
22121
- value = (0, import_node_crypto17.createHash)("sha256").update(objects2.get(object8).bytes).digest("hex");
22018
+ value = (0, import_node_crypto18.createHash)("sha256").update(objects2.get(object8).bytes).digest("hex");
22122
22019
  digests2.set(object8, value);
22123
22020
  }
22124
22021
  return value;
@@ -22333,7 +22230,7 @@ done:
22333
22230
  attributes #0 = { "wasm-import-module"="${NATIVE_TABLE_IMPORT_MODULE}" "wasm-import-name"="${NATIVE_DYLD_FUNCTION_IMPORT}" }`;
22334
22231
  }
22335
22232
  function sdkGuestCallerId(product) {
22336
- const hash = (0, import_node_crypto17.createHash)("sha256").update(product).digest().readUInt32LE(0);
22233
+ const hash = (0, import_node_crypto18.createHash)("sha256").update(product).digest().readUInt32LE(0);
22337
22234
  return (hash | 2147483648) >>> 0;
22338
22235
  }
22339
22236
  function sdkGuestSymbolName(product, name3) {
@@ -22374,7 +22271,7 @@ function nameGuestImageAliases(wasm, symbols) {
22374
22271
  const parts = [wasm.subarray(0, 8)];
22375
22272
  let position = 8;
22376
22273
  while (position < wasm.length) {
22377
- const [size2, start] = readNumber(wasm, position + 1);
22274
+ const [size2, start] = readULEB(wasm, position + 1);
22378
22275
  const end = start + size2;
22379
22276
  const custom = wasm[position] === 0 ? readString(wasm, start) : void 0;
22380
22277
  if (custom?.[0] !== "name") {
@@ -22385,17 +22282,17 @@ function nameGuestImageAliases(wasm, symbols) {
22385
22282
  const subsections = [encodedString("name")];
22386
22283
  let at = custom[1];
22387
22284
  while (at < end) {
22388
- const [subSize, subStart] = readNumber(wasm, at + 1);
22285
+ const [subSize, subStart] = readULEB(wasm, at + 1);
22389
22286
  const subEnd = subStart + subSize;
22390
22287
  if (wasm[at] !== 1) {
22391
22288
  subsections.push(wasm.subarray(at, subEnd));
22392
22289
  at = subEnd;
22393
22290
  continue;
22394
22291
  }
22395
- let [count, cursor] = readNumber(wasm, subStart);
22292
+ let [count, cursor] = readULEB(wasm, subStart);
22396
22293
  const entries2 = [encodeNumber(count)];
22397
22294
  for (; count > 0; count--) {
22398
- const [index, next] = readNumber(wasm, cursor);
22295
+ const [index, next] = readULEB(wasm, cursor);
22399
22296
  const [name3, after] = readString(wasm, next);
22400
22297
  cursor = after;
22401
22298
  const symbol2 = symbols[Number(alias.exec(name3)?.[1] ?? -1)];
@@ -22411,14 +22308,15 @@ function nameGuestImageAliases(wasm, symbols) {
22411
22308
  }
22412
22309
  return Buffer.concat(parts);
22413
22310
  }
22414
- var import_node_crypto17, ByteWriter, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, sha256PairHex, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
22311
+ var import_node_crypto18, ByteWriter, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, sha256PairHex, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
22415
22312
  var init_swift_guest_image_ledger = __esm({
22416
22313
  "src/swift-guest-image-ledger.ts"() {
22417
22314
  "use strict";
22418
- import_node_crypto17 = require("node:crypto");
22315
+ import_node_crypto18 = require("node:crypto");
22419
22316
  init_nativeWasmContract();
22420
22317
  init_swift_sdk_image_wasm();
22421
22318
  init_swiftSdkLinkContract();
22319
+ init_wasm_binary_sections();
22422
22320
  ByteWriter = class {
22423
22321
  buf;
22424
22322
  pos = 0;
@@ -22439,16 +22337,13 @@ var init_swift_guest_image_ledger = __esm({
22439
22337
  this.buf[this.pos++] = value;
22440
22338
  }
22441
22339
  uleb(value) {
22442
- this.ensure(10);
22443
- let pos = this.pos;
22444
- const buf = this.buf;
22445
- do {
22446
- let byte = value % 128;
22447
- value = Math.floor(value / 128);
22448
- if (value) byte |= 128;
22449
- buf[pos++] = byte;
22450
- } while (value);
22451
- this.pos = pos;
22340
+ if (value < 128) {
22341
+ this.byte(value);
22342
+ return;
22343
+ }
22344
+ const encoded = encodeWasmNumber(value);
22345
+ this.ensure(encoded.length);
22346
+ for (let i = 0; i < encoded.length; i++) this.buf[this.pos++] = encoded[i];
22452
22347
  }
22453
22348
  bytes(source, start = 0, end = source.length) {
22454
22349
  const len = end - start;
@@ -22472,7 +22367,7 @@ var init_swift_guest_image_ledger = __esm({
22472
22367
  };
22473
22368
  OBJC_INIT_RECORD = ".objc_init";
22474
22369
  TABLE_INDEX_RELOCATIONS = /* @__PURE__ */ new Set([1, 2, 12, 18, 19, 24]);
22475
- sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0, import_node_crypto17.createHash)("sha256").update(first).update("\0").update(second).digest("hex");
22370
+ sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0, import_node_crypto18.createHash)("sha256").update(first).update("\0").update(second).digest("hex");
22476
22371
  GUEST_DYLD_VALUES_SECTION = "peach_dyld_values";
22477
22372
  GUEST_LAZY_FUNCTION_BASE = 2 ** 32;
22478
22373
  SDK_DYLD_RESOLVER = "__peach_sdk_dyld_resolve";
@@ -22798,19 +22693,7 @@ var init_wasm_narrow_boundary = __esm({
22798
22693
  function sha256Buffer(bytes) {
22799
22694
  if (typeof Bun !== "undefined")
22800
22695
  return Buffer.from(new Bun.CryptoHasher("sha256").update(bytes).digest());
22801
- return (0, import_node_crypto18.createHash)("sha256").update(bytes).digest();
22802
- }
22803
- function sha256Hex2(bytes) {
22804
- if (typeof Bun !== "undefined")
22805
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
22806
- return (0, import_node_crypto18.createHash)("sha256").update(bytes).digest("hex");
22807
- }
22808
- function uleb2(value) {
22809
- const bytes = [];
22810
- for (let rest = value; ; rest = Math.floor(rest / 128)) {
22811
- if (rest < 128) return [...bytes, rest];
22812
- bytes.push(rest % 128 | 128);
22813
- }
22696
+ return (0, import_node_crypto19.createHash)("sha256").update(bytes).digest();
22814
22697
  }
22815
22698
  function encodeGuestDyldTable(rows) {
22816
22699
  const encoded = rows.map((row) => ({ ...row, bytes: Buffer.from(row.name) })).sort((a, b) => Buffer.compare(a.bytes, b.bytes));
@@ -22824,7 +22707,7 @@ function encodeGuestDyldTable(rows) {
22824
22707
  value.writeBigUInt64LE(row.value);
22825
22708
  const bytes = Buffer.concat([
22826
22709
  row.bytes,
22827
- Buffer.from([0, ...uleb2(row.image), row.kind]),
22710
+ Buffer.from([0, ...encodeWasmNumber(row.image), row.kind]),
22828
22711
  value
22829
22712
  ]);
22830
22713
  if (!current2.length) firsts.push(row.bytes);
@@ -22894,8 +22777,8 @@ function guestDyldValueRange(map2) {
22894
22777
  function swiftDyldTableReference(modulePath, module2) {
22895
22778
  const section2 = readWasmCustomSection(module2, NATIVE_DYLD_TABLE_SECTION);
22896
22779
  if (!section2 || readWasmCustomSection(module2, NATIVE_DYLD_PACKS_SECTION)) return;
22897
- const { sha256: sha2565, byteLength } = readNativeDyldTableIndex(Uint8Array.from(section2).buffer);
22898
- return { path: nativeDyldTablePath(modulePath, sha2565), sha256: sha2565, byteLength };
22780
+ const { sha256: sha2564, byteLength } = readNativeDyldTableIndex(Uint8Array.from(section2).buffer);
22781
+ return { path: nativeDyldTablePath(modulePath, sha2564), sha256: sha2564, byteLength };
22899
22782
  }
22900
22783
  function splitSwiftDyldTable(wasm) {
22901
22784
  const packs = readWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION);
@@ -22903,18 +22786,20 @@ function splitSwiftDyldTable(wasm) {
22903
22786
  const bytes = Buffer.from(packs);
22904
22787
  return {
22905
22788
  module: dropWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION),
22906
- table: { sha256: sha256Hex2(bytes), bytes }
22789
+ table: { sha256: sha256Hex(bytes), bytes }
22907
22790
  };
22908
22791
  }
22909
- var import_node_crypto18, import_node_zlib4, PACK_BYTES;
22792
+ var import_node_crypto19, import_node_zlib4, PACK_BYTES;
22910
22793
  var init_swift_guest_dyld_table = __esm({
22911
22794
  "src/swift-guest-dyld-table.ts"() {
22912
22795
  "use strict";
22913
- import_node_crypto18 = require("node:crypto");
22796
+ import_node_crypto19 = require("node:crypto");
22914
22797
  import_node_zlib4 = require("node:zlib");
22915
22798
  init_nativeDyldTableContract();
22799
+ init_sha256();
22916
22800
  init_swift_guest_image_ledger();
22917
22801
  init_swift_guest_linked_spans();
22802
+ init_wasm_binary_sections();
22918
22803
  init_wasm_narrow_boundary();
22919
22804
  PACK_BYTES = 64 * 1024;
22920
22805
  }
@@ -22990,8 +22875,8 @@ function readImports2(bytes, sections) {
22990
22875
  return { functions, table64 };
22991
22876
  }
22992
22877
  function vectorSection(id, count, parts) {
22993
- const body = Buffer.concat([Buffer.from(uleb3(count)), ...parts]);
22994
- return Buffer.concat([Buffer.from([id, ...uleb3(body.length)]), body]);
22878
+ const body = Buffer.concat([Buffer.from(encodeWasmNumber(count)), ...parts]);
22879
+ return Buffer.concat([Buffer.from([id, ...encodeWasmNumber(body.length)]), body]);
22995
22880
  }
22996
22881
  function rewriteSections(bytes, sections, changes) {
22997
22882
  const out = [bytes.subarray(0, 8)];
@@ -23047,9 +22932,9 @@ function appendLazyPlacement(bytes, functions, table) {
23047
22932
  vectorSection(2, count + 1, [
23048
22933
  found && header ? bytes.subarray(header.at, found.end) : new Uint8Array(),
23049
22934
  Buffer.from([
23050
- ...uleb3(module2.length),
22935
+ ...encodeWasmNumber(module2.length),
23051
22936
  ...module2,
23052
- ...uleb3(name4.length),
22937
+ ...encodeWasmNumber(name4.length),
23053
22938
  ...name4,
23054
22939
  1,
23055
22940
  112,
@@ -23071,7 +22956,7 @@ function appendLazyPlacement(bytes, functions, table) {
23071
22956
  elements.splice(
23072
22957
  placementIndex,
23073
22958
  0,
23074
- Buffer.from([1, 0, ...uleb3(functions.length), ...functions.flatMap(uleb3)])
22959
+ Buffer.from([1, 0, ...encodeWasmNumber(functions.length), ...functions.flatMap(encodeWasmNumber)])
23075
22960
  );
23076
22961
  const place2 = imports2.functions + declared.length;
23077
22962
  const instructions = [
@@ -23085,7 +22970,7 @@ function appendLazyPlacement(bytes, functions, table) {
23085
22970
  1,
23086
22971
  252,
23087
22972
  12,
23088
- ...uleb3(placementIndex),
22973
+ ...encodeWasmNumber(placementIndex),
23089
22974
  0,
23090
22975
  11
23091
22976
  ];
@@ -23106,14 +22991,14 @@ function appendLazyPlacement(bytes, functions, table) {
23106
22991
  3,
23107
22992
  vectorSection(3, declared.length + 1, [
23108
22993
  ...declared,
23109
- Buffer.from(uleb3(types2.length))
22994
+ Buffer.from(encodeWasmNumber(types2.length))
23110
22995
  ])
23111
22996
  ],
23112
22997
  [
23113
22998
  7,
23114
22999
  vectorSection(7, exports2.length + 1, [
23115
23000
  ...exports2,
23116
- Buffer.from([...uleb3(name3.length), ...name3, 0, ...uleb3(place2)])
23001
+ Buffer.from([...encodeWasmNumber(name3.length), ...name3, 0, ...encodeWasmNumber(place2)])
23117
23002
  ])
23118
23003
  ],
23119
23004
  [9, vectorSection(9, elements.length, elements)],
@@ -23121,7 +23006,7 @@ function appendLazyPlacement(bytes, functions, table) {
23121
23006
  10,
23122
23007
  vectorSection(10, bodies.length + 1, [
23123
23008
  ...bodies,
23124
- Buffer.from([...uleb3(instructions.length), ...instructions])
23009
+ Buffer.from([...encodeWasmNumber(instructions.length), ...instructions])
23125
23010
  ])
23126
23011
  ]
23127
23012
  ])
@@ -23174,22 +23059,13 @@ function placeGuestLazyFunctions(bytes, lazy) {
23174
23059
  function guestLazyExports(lazy) {
23175
23060
  return lazy.map((name3) => JSON.stringify(`--export=${name3}`)).join("\n");
23176
23061
  }
23177
- var uleb3, SECTION_ORDER, readExport, lastTableElement;
23062
+ var SECTION_ORDER, readExport, lastTableElement;
23178
23063
  var init_swift_guest_dyld_functions = __esm({
23179
23064
  "src/swift-guest-dyld-functions.ts"() {
23180
23065
  "use strict";
23181
23066
  init_nativeWasmContract();
23182
23067
  init_swift_sdk_image_wasm();
23183
- uleb3 = (value) => {
23184
- const out = [];
23185
- do {
23186
- let byte = value % 128;
23187
- value = Math.floor(value / 128);
23188
- if (value) byte |= 128;
23189
- out.push(byte);
23190
- } while (value);
23191
- return out;
23192
- };
23068
+ init_wasm_binary_sections();
23193
23069
  SECTION_ORDER = [1, 2, 3, 4, 5, 13, 6, 7, 8, 9, 12, 10, 11];
23194
23070
  readExport = (r) => {
23195
23071
  r.name();
@@ -23255,7 +23131,7 @@ function selectedGuestManifestInputs(plan, selection, identities, readSelected)
23255
23131
  throw new Error(
23256
23132
  `selected member has no original identity: ${item.artifact}(${item.member})`
23257
23133
  );
23258
- if (origin && (0, import_node_crypto19.createHash)("sha256").update(bytes).digest("hex") !== origin.sha256)
23134
+ if (origin && (0, import_node_crypto20.createHash)("sha256").update(bytes).digest("hex") !== origin.sha256)
23259
23135
  throw new Error(
23260
23136
  `selected member differs from original: ${item.artifact}(${item.member})`
23261
23137
  );
@@ -23302,7 +23178,7 @@ function createGuestImageManifest(image) {
23302
23178
  cpuType: -1,
23303
23179
  cpuSubtype: 0
23304
23180
  };
23305
- const digest3 = (0, import_node_crypto19.createHash)("sha256");
23181
+ const digest3 = (0, import_node_crypto20.createHash)("sha256");
23306
23182
  const sizeBuf = Buffer.allocUnsafe(8);
23307
23183
  const add = (bytes) => {
23308
23184
  sizeBuf.writeBigUInt64BE(BigInt(bytes.byteLength));
@@ -23344,11 +23220,11 @@ function createGuestImageManifest(image) {
23344
23220
  regions: image.regions
23345
23221
  };
23346
23222
  }
23347
- var import_node_crypto19, import_node_fs31, framedLinkOptionsCache;
23223
+ var import_node_crypto20, import_node_fs31, framedLinkOptionsCache;
23348
23224
  var init_swift_guest_manifest = __esm({
23349
23225
  "src/swift-guest-manifest.ts"() {
23350
23226
  "use strict";
23351
- import_node_crypto19 = require("node:crypto");
23227
+ import_node_crypto20 = require("node:crypto");
23352
23228
  import_node_fs31 = require("node:fs");
23353
23229
  init_swift_guest_link_plan();
23354
23230
  init_swift_wasm_prune();
@@ -23814,11 +23690,11 @@ var init_swift_guest_projection_storage = __esm({
23814
23690
  function frameworkRuntimeProductId(product) {
23815
23691
  return `swift-package/${product.packageName}/${product.product.name}`;
23816
23692
  }
23817
- var import_node_crypto20, v4, packageSchema;
23693
+ var import_node_crypto21, v4, packageSchema;
23818
23694
  var init_swift_runtime_products = __esm({
23819
23695
  "src/swift-runtime-products.ts"() {
23820
23696
  "use strict";
23821
- import_node_crypto20 = require("node:crypto");
23697
+ import_node_crypto21 = require("node:crypto");
23822
23698
  v4 = __toESM(require("peachsim/vendor/valibot"), 1);
23823
23699
  init_is_record();
23824
23700
  packageSchema = v4.object({
@@ -23849,7 +23725,7 @@ function canonicalArchivePath(file) {
23849
23725
  function sdkArtifactBytes(root, artifact) {
23850
23726
  const file = import_node_path31.default.resolve(root, artifact.path);
23851
23727
  const linked = (0, import_node_fs32.readFileSync)(file);
23852
- const hash = (bytes) => (0, import_node_crypto21.createHash)("sha256").update(bytes).digest("hex");
23728
+ const hash = (bytes) => (0, import_node_crypto22.createHash)("sha256").update(bytes).digest("hex");
23853
23729
  if (hash(linked) === artifact.sha256) return { source: linked, linked };
23854
23730
  if (artifact.kind !== "archive" || artifact.path !== `${SWIFT_SDK_PRODUCT_DIRECTORY}/libFoundation.a`)
23855
23731
  throw new Error(`SDK product artifact changed ${file}`);
@@ -23875,9 +23751,9 @@ function indexSdkMembers(bytes) {
23875
23751
  );
23876
23752
  }
23877
23753
  function verifySdkObjectTransform(source, linked, sourceSha256, transformation) {
23878
- if ((0, import_node_crypto21.createHash)("sha256").update(source).digest("hex") !== sourceSha256 || transformation.inputSha256 !== sourceSha256)
23754
+ if ((0, import_node_crypto22.createHash)("sha256").update(source).digest("hex") !== sourceSha256 || transformation.inputSha256 !== sourceSha256)
23879
23755
  throw new Error("SDK object transform input changed");
23880
- if ((0, import_node_crypto21.createHash)("sha256").update(linked).digest("hex") !== transformation.outputSha256 || transformation.kind === "swiftrt" && !Buffer.from(patchSwiftrtObject(source)).equals(linked))
23756
+ if ((0, import_node_crypto22.createHash)("sha256").update(linked).digest("hex") !== transformation.outputSha256 || transformation.kind === "swiftrt" && !Buffer.from(patchSwiftrtObject(source)).equals(linked))
23881
23757
  throw new Error("SDK object transform output changed");
23882
23758
  }
23883
23759
  function readGuestRuntimeCatalogs(sdkRoot, distributionRoot) {
@@ -24157,7 +24033,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
24157
24033
  const digest3 = (file) => {
24158
24034
  let value = hashes.get(file);
24159
24035
  if (!value) {
24160
- value = (0, import_node_crypto21.createHash)("sha256").update((0, import_node_fs32.readFileSync)(file)).digest("hex");
24036
+ value = (0, import_node_crypto22.createHash)("sha256").update((0, import_node_fs32.readFileSync)(file)).digest("hex");
24161
24037
  hashes.set(file, value);
24162
24038
  }
24163
24039
  return value;
@@ -24225,9 +24101,9 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
24225
24101
  if (input.member) {
24226
24102
  if (original.kind !== "archive")
24227
24103
  throw new Error(`SDK input member has no archive ${originalFile}`);
24228
- const { name: name3, ordinal, sha256: sha2565 } = input.member;
24104
+ const { name: name3, ordinal, sha256: sha2564 } = input.member;
24229
24105
  const member = original.members.find(
24230
- (entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 === sha2565
24106
+ (entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 === sha2564
24231
24107
  );
24232
24108
  let records = archiveMembers.get(originalFile);
24233
24109
  if (!records) {
@@ -24235,7 +24111,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
24235
24111
  archiveMembers.set(originalFile, records);
24236
24112
  }
24237
24113
  const bytes = records.filter((entry) => entry.name === name3)[ordinal - 1]?.bytes;
24238
- if (!member || !bytes || (0, import_node_crypto21.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
24114
+ if (!member || !bytes || (0, import_node_crypto22.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
24239
24115
  throw new Error(`SDK input member changed ${originalFile}(${name3})`);
24240
24116
  } else if (original.kind !== "object")
24241
24117
  throw new Error(`SDK object input has no member ${originalFile}`);
@@ -24264,7 +24140,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
24264
24140
  const member = members2.get(key2);
24265
24141
  const source = indexed.source.get(key2);
24266
24142
  const linked2 = indexed.linked.get(key2);
24267
- if (!member || !source || !linked2 || (0, import_node_crypto21.createHash)("sha256").update(source).digest("hex") !== member.sha256 || (0, import_node_crypto21.createHash)("sha256").update(linked2).digest("hex") !== digest3(origin.original))
24143
+ if (!member || !source || !linked2 || (0, import_node_crypto22.createHash)("sha256").update(source).digest("hex") !== member.sha256 || (0, import_node_crypto22.createHash)("sha256").update(linked2).digest("hex") !== digest3(origin.original))
24268
24144
  throw new Error(`SDK member differs from source product ${origin.original}`);
24269
24145
  add({
24270
24146
  path: origin.original,
@@ -24329,7 +24205,7 @@ function guestAliasedSdkArchiveArtifacts(options2) {
24329
24205
  const key2 = JSON.stringify([member.name, member.ordinal]);
24330
24206
  const bytes = sourceMembers[index].get(key2);
24331
24207
  const linked = viewMembers[index].get(key2);
24332
- return bytes !== void 0 && linked !== void 0 && (0, import_node_crypto21.createHash)("sha256").update(bytes).digest("hex") === entry.sha256 && (0, import_node_crypto21.createHash)("sha256").update(linked).digest("hex") === member.sha256;
24208
+ return bytes !== void 0 && linked !== void 0 && (0, import_node_crypto22.createHash)("sha256").update(bytes).digest("hex") === entry.sha256 && (0, import_node_crypto22.createHash)("sha256").update(linked).digest("hex") === member.sha256;
24333
24209
  }) ? [product2.id] : []
24334
24210
  )
24335
24211
  );
@@ -24362,11 +24238,11 @@ function guestAliasedSdkArchiveArtifacts(options2) {
24362
24238
  }
24363
24239
  return result;
24364
24240
  }
24365
- var import_node_crypto21, import_node_fs32, import_node_path31, v5, SDK_CONTAINING_IMAGE;
24241
+ var import_node_crypto22, import_node_fs32, import_node_path31, v5, SDK_CONTAINING_IMAGE;
24366
24242
  var init_swift_guest_runtime_plan = __esm({
24367
24243
  "src/swift-guest-runtime-plan.ts"() {
24368
24244
  "use strict";
24369
- import_node_crypto21 = require("node:crypto");
24245
+ import_node_crypto22 = require("node:crypto");
24370
24246
  import_node_fs32 = require("node:fs");
24371
24247
  import_node_path31 = __toESM(require("node:path"), 1);
24372
24248
  v5 = __toESM(require("peachsim/vendor/valibot"), 1);
@@ -26211,13 +26087,8 @@ function clangBinaryStamp(file) {
26211
26087
  const stat = (0, import_node_fs35.statSync)(file, { bigint: true });
26212
26088
  return [file, stat.size, stat.mtimeNs].join(":");
26213
26089
  }
26214
- function sha256Hex3(bytes) {
26215
- if (typeof Bun !== "undefined")
26216
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
26217
- return (0, import_node_crypto22.createHash)("sha256").update(bytes).digest("hex");
26218
- }
26219
26090
  function clangWrapperStamp(file) {
26220
- return sha256Hex3((0, import_node_fs35.readFileSync)(file));
26091
+ return sha256Hex((0, import_node_fs35.readFileSync)(file));
26221
26092
  }
26222
26093
  function clangArgsNeedCwd(args) {
26223
26094
  const pathFlags = /* @__PURE__ */ new Set([
@@ -26395,7 +26266,7 @@ function sourceGuestClangLinkOptions(options2) {
26395
26266
  import_node_path34.default.join(options2.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)
26396
26267
  )))
26397
26268
  throw new Error(`unsupported source object producer ${file}`);
26398
- const key2 = sha256Hex3(
26269
+ const key2 = sha256Hex(
26399
26270
  JSON.stringify([
26400
26271
  "clang-link-options/v2",
26401
26272
  clangArgsNeedCwd(command.args) ? process.cwd() : null,
@@ -26406,7 +26277,7 @@ function sourceGuestClangLinkOptions(options2) {
26406
26277
  clangProducerStamp(file)
26407
26278
  ])
26408
26279
  );
26409
- const cacheFile = import_node_path34.default.join(cacheDirectory, sha256Hex3(file) + ".json");
26280
+ const cacheFile = import_node_path34.default.join(cacheDirectory, sha256Hex(file) + ".json");
26410
26281
  const cached2 = readClangLinkOptions(cacheFile, key2);
26411
26282
  if (cached2) {
26412
26283
  validateClangLinkOptions(cached2);
@@ -26528,30 +26399,12 @@ function wasmAutolinkEntries(bytes, out) {
26528
26399
  const len = bytes.length;
26529
26400
  while (pos < len) {
26530
26401
  const id = bytes[pos++];
26531
- let sz = bytes[pos++];
26532
- if (sz >= 128) {
26533
- sz &= 127;
26534
- let shift = 7;
26535
- while (true) {
26536
- const b = bytes[pos++];
26537
- sz |= (b & 127) << shift;
26538
- if (b < 128) break;
26539
- shift += 7;
26540
- }
26541
- }
26402
+ let sz;
26403
+ [sz, pos] = readULEB(bytes, pos, len);
26542
26404
  const end = pos + sz;
26543
26405
  if (id === 0) {
26544
- let nLen = bytes[pos++];
26545
- if (nLen >= 128) {
26546
- nLen &= 127;
26547
- let shift = 7;
26548
- while (true) {
26549
- const b = bytes[pos++];
26550
- nLen |= (b & 127) << shift;
26551
- if (b < 128) break;
26552
- shift += 7;
26553
- }
26554
- }
26406
+ let nLen;
26407
+ [nLen, pos] = readULEB(bytes, pos, end);
26555
26408
  if (nLen === 24 && raw2.toString("ascii", pos, pos + 24) === ".swift1_autolink_entries") {
26556
26409
  const payload = raw2.toString("utf8", pos + 24, end);
26557
26410
  for (const entry of payload.split("\0")) {
@@ -26619,7 +26472,7 @@ function sourceGuestRuntimeLinks(options2) {
26619
26472
  const file = import_node_path34.default.resolve(directory2, alias.moduleMap);
26620
26473
  if (!file.startsWith(directory2 + import_node_path34.default.sep))
26621
26474
  throw new Error(`invalid framework module map ${alias.moduleMap}`);
26622
- if ((0, import_node_crypto22.createHash)("sha256").update((0, import_node_fs35.readFileSync)(file)).digest("hex") !== alias.moduleMapSha256)
26475
+ if (sha256Hex((0, import_node_fs35.readFileSync)(file)) !== alias.moduleMapSha256)
26623
26476
  throw new Error(`framework module map changed ${alias.moduleMap}`);
26624
26477
  sdkAliases.set(alias.name, {
26625
26478
  product: product.id,
@@ -26675,7 +26528,7 @@ function sourceGuestRuntimeLinks(options2) {
26675
26528
  const map2 = import_node_path34.default.resolve(root, alias.moduleMap);
26676
26529
  if (!map2.startsWith(root + import_node_path34.default.sep))
26677
26530
  throw new Error(`invalid framework module map ${alias.moduleMap}`);
26678
- if ((0, import_node_crypto22.createHash)("sha256").update((0, import_node_fs35.readFileSync)(map2)).digest("hex") !== alias.moduleMapSha256)
26531
+ if (sha256Hex((0, import_node_fs35.readFileSync)(map2)) !== alias.moduleMapSha256)
26679
26532
  throw new Error(`framework module map changed ${alias.moduleMap}`);
26680
26533
  frameworkAliases.set(alias.name, { kind: "package", targets: closure(alias.targets) });
26681
26534
  }
@@ -26776,18 +26629,19 @@ function logicalGuestLinkOptions(args, identities, roots) {
26776
26629
  }
26777
26630
  return output;
26778
26631
  }
26779
- var import_node_child_process20, import_node_crypto22, import_node_fs35, import_node_path34, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
26632
+ var import_node_child_process20, import_node_fs35, import_node_path34, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
26780
26633
  var init_swift_guest_source_inputs = __esm({
26781
26634
  "src/swift-guest-source-inputs.ts"() {
26782
26635
  "use strict";
26783
26636
  import_node_child_process20 = require("node:child_process");
26784
- import_node_crypto22 = require("node:crypto");
26785
26637
  import_node_fs35 = require("node:fs");
26786
26638
  import_node_path34 = __toESM(require("node:path"), 1);
26787
26639
  init_forked_script_contract();
26640
+ init_sha256();
26788
26641
  init_swift_guest_source_plan();
26789
26642
  init_swift_runtime_products();
26790
26643
  init_swift_wasm_prune();
26644
+ init_wasm_binary_sections();
26791
26645
  CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
26792
26646
  PARALLEL_REPLAY = `
26793
26647
  const { spawn } = require('node:child_process')
@@ -28629,7 +28483,7 @@ function headerClosure(roots) {
28629
28483
  ).filter((file) => !file.endsWith(`/${j.exclude}`));
28630
28484
  const nitroFiles = roots.nitroModules ? headerFiles2(roots.nitroModules, n.from, n.skip, new RegExp(n.keep)) : [];
28631
28485
  const hashes = (base2, files2) => Object.fromEntries(
28632
- files2.map((file) => [file, sha256Hex4((0, import_node_fs39.readFileSync)(import_node_path38.default.join(base2, file)))])
28486
+ files2.map((file) => [file, sha256Hex2((0, import_node_fs39.readFileSync)(import_node_path38.default.join(base2, file)))])
28633
28487
  );
28634
28488
  return {
28635
28489
  jsi: hashes(roots.reactNative, jsiFiles),
@@ -28793,11 +28647,11 @@ function verifyInstalledAdapter(family, directory2, pin2) {
28793
28647
  if (JSON.stringify(recorded) !== JSON.stringify(pinned))
28794
28648
  throw new Error(`${label} manifest does not match the lock this build carries`);
28795
28649
  const bytes = (0, import_node_fs39.readFileSync)(import_node_path38.default.join(directory2, archive.path));
28796
- if (bytes.length !== archive.size || sha256Hex4(bytes) !== archive.sha256)
28650
+ if (bytes.length !== archive.size || sha256Hex2(bytes) !== archive.sha256)
28797
28651
  throw new Error(`${label} library does not match its manifest`);
28798
28652
  return manifest;
28799
28653
  }
28800
- var import_node_crypto24, import_node_fs39, import_node_path38, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE, sha256Hex4, hex64, sameHeaders;
28654
+ var import_node_crypto24, import_node_fs39, import_node_path38, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE, sha256Hex2, hex64, sameHeaders;
28801
28655
  var init_nitroAdapterContract = __esm({
28802
28656
  "src/nitroAdapterContract.ts"() {
28803
28657
  "use strict";
@@ -28847,7 +28701,7 @@ void scheduleDrain();
28847
28701
  to: ["core", "core/NitroModules"]
28848
28702
  }
28849
28703
  };
28850
- sha256Hex4 = (data) => (0, import_node_crypto24.createHash)("sha256").update(data).digest("hex");
28704
+ sha256Hex2 = (data) => (0, import_node_crypto24.createHash)("sha256").update(data).digest("hex");
28851
28705
  hex64 = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
28852
28706
  sameHeaders = (a, b) => JSON.stringify(a) === JSON.stringify(b);
28853
28707
  }
@@ -28921,10 +28775,10 @@ function swiftNativePin() {
28921
28775
  }
28922
28776
  return pin;
28923
28777
  }
28924
- function publishedSwiftSdk(sha2565) {
28778
+ function publishedSwiftSdk(sha2564) {
28925
28779
  const { sdkRuntime, sdkGuestRuntime } = swiftNativePin().distribution;
28926
28780
  return [sdkRuntime, sdkGuestRuntime].find(
28927
- (publication) => publication?.source === sha2565
28781
+ (publication) => publication?.source === sha2564
28928
28782
  );
28929
28783
  }
28930
28784
  var pin;
@@ -31964,6 +31818,10 @@ ${SWIFT_SDK_IMAGE_VERSION}
31964
31818
  `).update(inputs2).update(products.length === 0 ? "" : `
31965
31819
  products ${products.join(" ")}`).digest("hex").slice(0, 32);
31966
31820
  }
31821
+ function swiftSdkImageVariantKey(baseKey, required) {
31822
+ if (!required.length) return baseKey;
31823
+ return (0, import_node_crypto30.createHash)("sha256").update(baseKey).update(JSON.stringify(required)).digest("hex").slice(0, 32);
31824
+ }
31967
31825
  function swiftSdkImageEntry(key2, scopedLookups) {
31968
31826
  const inputs2 = { image: key2 };
31969
31827
  return {
@@ -31993,15 +31851,15 @@ function cached(directory2, key2) {
31993
31851
  return void 0;
31994
31852
  }
31995
31853
  }
31996
- function sdkImageAt(directory2, key2, sha2565) {
31854
+ function sdkImageAt(directory2, key2, sha2564) {
31997
31855
  refreshSwiftCacheHold(directory2);
31998
- const cacheKey = `${directory2}\0${sha2565}`;
31856
+ const cacheKey = `${directory2}\0${sha2564}`;
31999
31857
  let loadedInterface;
32000
31858
  return {
32001
31859
  key: key2,
32002
31860
  directory: directory2,
32003
31861
  image: import_node_path44.default.join(directory2, IMAGE_FILE),
32004
- sha256: sha2565,
31862
+ sha256: sha2564,
32005
31863
  get sdkInterface() {
32006
31864
  if (loadedInterface) return loadedInterface;
32007
31865
  const memo2 = cachedSdkInterfaces.get(cacheKey);
@@ -32015,11 +31873,24 @@ function sdkImageAt(directory2, key2, sha2565) {
32015
31873
  }
32016
31874
  async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkImports2 = [], options2) {
32017
31875
  const { imports: imports2, products } = swiftSdkImageProducts(moduleRoot, frameworkImports2);
32018
- const key2 = swiftSdkImageKey(moduleRoot, scopedLookups, products);
32019
- const directory2 = import_node_path44.default.join(swiftCacheDir(), "swift-sdk-images", key2);
31876
+ const images = import_node_path44.default.join(swiftCacheDir(), "swift-sdk-images");
31877
+ const baseKey = swiftSdkImageKey(moduleRoot, scopedLookups, products);
31878
+ const required = [...new Set(options2?.requiredGuestSymbols)].sort();
31879
+ const base2 = cached(import_node_path44.default.join(images, baseKey), baseKey);
31880
+ if (base2) {
31881
+ if (!required.length) return base2;
31882
+ const { functions, data, tls } = base2.sdkInterface;
31883
+ if (required.every(
31884
+ (name3) => functions[name3] !== void 0 || data[name3] !== void 0 || tls[name3] !== void 0
31885
+ ))
31886
+ return base2;
31887
+ }
31888
+ const key2 = swiftSdkImageVariantKey(baseKey, required);
31889
+ const directory2 = import_node_path44.default.join(images, key2);
32020
31890
  const existing = cached(directory2, key2);
32021
31891
  if (existing) return existing;
32022
- if (!options2?.producer && !swiftDistributionAt(moduleRoot) && import_node_path44.default.resolve(moduleRoot) === sourceSwiftCheckout() && process.platform === "linux" && process.env.TM_SESSION) {
31892
+ const distribution = swiftDistributionAt(moduleRoot);
31893
+ if (!options2?.producer && !required.length && !distribution && import_node_path44.default.resolve(moduleRoot) === sourceSwiftCheckout() && process.platform === "linux" && process.env.TM_SESSION) {
32023
31894
  const { produceSwiftSdkImage: produceSwiftSdkImage2 } = await Promise.resolve().then(() => (init_swift_sdk_image_producer(), swift_sdk_image_producer_exports));
32024
31895
  await produceSwiftSdkImage2({
32025
31896
  moduleRoot,
@@ -32040,7 +31911,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
32040
31911
  return cached(directory2, key2) ?? withSwiftRootLock(directory2, async () => {
32041
31912
  const previous = cached(directory2, key2);
32042
31913
  if (previous) return previous;
32043
- if (swiftDistributionAt(moduleRoot)) {
31914
+ if (distribution && !required.length) {
32044
31915
  const entry = swiftSdkImageEntry(key2, scopedLookups);
32045
31916
  const fetched = fetchNativeEntry("sdk-image", entry.name, entry.key);
32046
31917
  if (fetched) {
@@ -32077,6 +31948,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
32077
31948
  work,
32078
31949
  scopedLookups,
32079
31950
  imports2,
31951
+ required,
32080
31952
  releaseFrameworks
32081
31953
  )
32082
31954
  );
@@ -32085,7 +31957,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
32085
31957
  }
32086
31958
  });
32087
31959
  }
32088
- async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, releaseFrameworks) {
31960
+ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, required, releaseFrameworks) {
32089
31961
  (0, import_node_fs45.rmSync)(work, { recursive: true, force: true });
32090
31962
  (0, import_node_fs45.mkdirSync)(work, { recursive: true });
32091
31963
  const toolchain = swiftModuleToolchain(moduleRoot);
@@ -32246,7 +32118,10 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
32246
32118
  const quote3 = (value) => JSON.stringify(value);
32247
32119
  (0, import_node_fs45.writeFileSync)(
32248
32120
  import_node_path44.default.join(work, "exports.rsp"),
32249
- [...defined].map((name3) => quote3(`--export-if-defined=${name3}`)).join("\n")
32121
+ [
32122
+ ...[...defined].map((name3) => quote3(`--export-if-defined=${name3}`)),
32123
+ ...required.filter((name3) => !defined.has(name3)).map((name3) => quote3(`--export=${name3}`))
32124
+ ].join("\n")
32250
32125
  );
32251
32126
  const guestServices = import_node_path44.default.join(work, "peach-guest-services.allow");
32252
32127
  (0, import_node_fs45.writeFileSync)(guestServices, peachGuestServiceAllowlist);
@@ -32337,11 +32212,12 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
32337
32212
  import_node_path44.default.join(work, IMAGE_DIGEST),
32338
32213
  typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(image).digest("hex") : (0, import_node_crypto30.createHash)("sha256").update(image).digest("hex")
32339
32214
  );
32340
- if (swiftSdkImageKey(
32215
+ const baseKey = swiftSdkImageKey(
32341
32216
  moduleRoot,
32342
32217
  scopedLookups,
32343
32218
  swiftSdkImageProducts(moduleRoot, imports2).products
32344
- ) !== key2)
32219
+ );
32220
+ if (swiftSdkImageVariantKey(baseKey, required) !== key2)
32345
32221
  throw new Error("Swift SDK image inputs changed during compilation");
32346
32222
  for (const name3 of (0, import_node_fs45.readdirSync)(work))
32347
32223
  if (!SWIFT_SDK_IMAGE_FILES.includes(name3))
@@ -32752,12 +32628,12 @@ function encodeNativeSdkLater(later) {
32752
32628
  const view = new DataView(bytes.buffer);
32753
32629
  view.setUint32(0, files2.length, true);
32754
32630
  let at = 4;
32755
- for (const { sha256: sha2565, byteLength } of files2) {
32756
- if (!/^[a-f0-9]{64}$/.test(sha2565))
32631
+ for (const { sha256: sha2564, byteLength } of files2) {
32632
+ if (!/^[a-f0-9]{64}$/.test(sha2564))
32757
32633
  throw new Error("Swift SDK later data needs a sha256 digest");
32758
32634
  if (!byteLength) throw new Error("Swift SDK later data file is empty");
32759
32635
  for (let i = 0; i < LATER_DIGEST_BYTES; i++)
32760
- bytes[at + i] = Number.parseInt(sha2565.slice(i * 2, i * 2 + 2), 16);
32636
+ bytes[at + i] = Number.parseInt(sha2564.slice(i * 2, i * 2 + 2), 16);
32761
32637
  view.setUint32(at + LATER_DIGEST_BYTES, byteLength, true);
32762
32638
  at += LATER_DIGEST_BYTES + 4;
32763
32639
  }
@@ -32782,13 +32658,13 @@ function decodeNativeSdkLater(trailer) {
32782
32658
  const files2 = [];
32783
32659
  for (let file = 0; file < count; file++) {
32784
32660
  if (at + LATER_DIGEST_BYTES + 4 > trailer.byteLength) throw truncated();
32785
- const sha2565 = Array.from(
32661
+ const sha2564 = Array.from(
32786
32662
  trailer.subarray(at, at + LATER_DIGEST_BYTES),
32787
32663
  (byte) => byte.toString(16).padStart(2, "0")
32788
32664
  ).join("");
32789
32665
  const byteLength = view.getUint32(at + LATER_DIGEST_BYTES, true);
32790
32666
  if (!byteLength) throw new Error("Swift SDK binding names empty later data");
32791
- files2.push({ sha256: sha2565, byteLength });
32667
+ files2.push({ sha256: sha2564, byteLength });
32792
32668
  at += LATER_DIGEST_BYTES + 4;
32793
32669
  }
32794
32670
  if (!files2.length || at + 4 > trailer.byteLength) throw truncated();
@@ -33023,8 +32899,8 @@ function finishSwiftAppModuleFile(file) {
33023
32899
  return;
33024
32900
  }
33025
32901
  const thunks = sdkImportThunks(prefix);
33026
- const nameBytes = Buffer.from(encodedName2(NATIVE_SDK_THUNK_SECTION));
33027
- const header = Buffer.from([0, ...uleb4(nameBytes.length + thunks.length)]);
32902
+ const nameBytes = Buffer.from(encodeWasmName(NATIVE_SDK_THUNK_SECTION));
32903
+ const header = Buffer.from([0, ...encodeWasmNumber(nameBytes.length + thunks.length)]);
33028
32904
  (0, import_node_fs46.appendFileSync)(file, Buffer.concat([header, nameBytes, thunks]));
33029
32905
  }
33030
32906
  function swiftAppModuleInputs(tokens2, buildRoot, sdkLibraries) {
@@ -33376,17 +33252,17 @@ function sdkImportThunks(bytes) {
33376
33252
  for (const { type } of imports2)
33377
33253
  if (!typeIndex.has(type)) typeIndex.set(type, typeIndex.size + 1);
33378
33254
  const loaderType = [96, 1, 127, 0];
33379
- const vector = (items2) => [...uleb4(items2.length), ...items2.flat()];
33380
- const sectionBytes = (id, body) => [id, ...uleb4(body.length), ...body];
33255
+ const vector = (items2) => [...encodeWasmNumber(items2.length), ...items2.flat()];
33256
+ const sectionBytes = (id, body) => [id, ...encodeWasmNumber(body.length), ...body];
33381
33257
  const slotGlobals = imports2.map(({ slot }) => [
33382
- ...encodedName2(NATIVE_SDK_IMPORT_MODULE),
33383
- ...encodedName2(String(slot)),
33258
+ ...encodeWasmName(NATIVE_SDK_IMPORT_MODULE),
33259
+ ...encodeWasmName(String(slot)),
33384
33260
  3,
33385
33261
  127,
33386
33262
  0
33387
33263
  ]);
33388
33264
  const bodies = imports2.map(({ type }, index) => {
33389
- const slotValue = [35, ...uleb4(index)];
33265
+ const slotValue = [35, ...encodeWasmNumber(index)];
33390
33266
  const code = [
33391
33267
  0,
33392
33268
  ...slotValue,
@@ -33399,14 +33275,14 @@ function sdkImportThunks(bytes) {
33399
33275
  16,
33400
33276
  0,
33401
33277
  11,
33402
- ...Array.from({ length: params[type] }, (_, i) => [32, ...uleb4(i)]).flat(),
33278
+ ...Array.from({ length: params[type] }, (_, i) => [32, ...encodeWasmNumber(i)]).flat(),
33403
33279
  ...slotValue,
33404
33280
  17,
33405
- ...uleb4(typeIndex.get(type)),
33281
+ ...encodeWasmNumber(typeIndex.get(type)),
33406
33282
  0,
33407
33283
  11
33408
33284
  ];
33409
- return [...uleb4(code.length), ...code];
33285
+ return [...encodeWasmNumber(code.length), ...code];
33410
33286
  });
33411
33287
  return Uint8Array.from([
33412
33288
  0,
@@ -33424,21 +33300,21 @@ function sdkImportThunks(bytes) {
33424
33300
  ...sectionBytes(
33425
33301
  2,
33426
33302
  vector([
33427
- [...encodedName2("env"), ...encodedName2("__indirect_function_table"), 1, ...table],
33303
+ [...encodeWasmName("env"), ...encodeWasmName("__indirect_function_table"), 1, ...table],
33428
33304
  [
33429
- ...encodedName2(NATIVE_LAZY_IMPORT_MODULE),
33430
- ...encodedName2(NATIVE_LAZY_SLOT_IMPORT),
33305
+ ...encodeWasmName(NATIVE_LAZY_IMPORT_MODULE),
33306
+ ...encodeWasmName(NATIVE_LAZY_SLOT_IMPORT),
33431
33307
  0,
33432
33308
  0
33433
33309
  ],
33434
33310
  ...slotGlobals
33435
33311
  ])
33436
33312
  ),
33437
- ...sectionBytes(3, vector(imports2.map(({ type }) => uleb4(typeIndex.get(type))))),
33313
+ ...sectionBytes(3, vector(imports2.map(({ type }) => encodeWasmNumber(typeIndex.get(type))))),
33438
33314
  ...sectionBytes(
33439
33315
  7,
33440
33316
  vector(
33441
- imports2.map(({ slot }, i) => [...encodedName2(String(slot)), 0, ...uleb4(i + 1)])
33317
+ imports2.map(({ slot }, i) => [...encodeWasmName(String(slot)), 0, ...encodeWasmNumber(i + 1)])
33442
33318
  )
33443
33319
  ),
33444
33320
  ...sectionBytes(10, vector(bodies))
@@ -33558,7 +33434,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33558
33434
  syntheticGlobals.push(type);
33559
33435
  got.set(index, value);
33560
33436
  }
33561
- return [35, ...uleb4(index)];
33437
+ return [35, ...encodeWasmNumber(index)];
33562
33438
  };
33563
33439
  const tlsHelpers = new Map(
33564
33440
  symbols.filter((symbol2) => symbol2.kind === 0 && symbol2.name.startsWith(SDK_TLS_HELPER)).map((symbol2) => [symbol2.name.slice(SDK_TLS_HELPER.length), symbol2.index])
@@ -33610,7 +33486,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33610
33486
  const code = [16];
33611
33487
  for (let i = 0, rest = helper; i < 5; i++, rest >>>= 7)
33612
33488
  code.push(i < 4 ? rest & 127 | 128 : rest & 127);
33613
- if (addend) code.push(66, ...sleb2(addend), 124);
33489
+ if (addend) code.push(66, ...encodeWasmSigned(addend), 124);
33614
33490
  patchCode(at2, 11, code);
33615
33491
  continue;
33616
33492
  }
@@ -33684,7 +33560,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33684
33560
  syntheticGlobals.push(valueType);
33685
33561
  scratchGlobals.set(valueType, scratch2);
33686
33562
  }
33687
- const index = uleb4(scratch2);
33563
+ const index = encodeWasmNumber(scratch2);
33688
33564
  patchCode(at - 2, 12, [
33689
33565
  36,
33690
33566
  ...index,
@@ -33700,7 +33576,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33700
33576
  }
33701
33577
  const encodedNameBuf = (name3) => {
33702
33578
  const raw2 = Buffer.from(name3, "utf8");
33703
- const len = uleb4(raw2.length);
33579
+ const len = encodeWasmNumber(raw2.length);
33704
33580
  const out = Buffer.allocUnsafe(len.length + raw2.length);
33705
33581
  for (let i = 0; i < len.length; i++) out[i] = len[i];
33706
33582
  raw2.copy(out, len.length);
@@ -33745,7 +33621,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33745
33621
  }
33746
33622
  }
33747
33623
  const globalParts = [
33748
- Buffer.from(uleb4(globalCount - 1 + syntheticGlobals.length))
33624
+ Buffer.from(encodeWasmNumber(globalCount - 1 + syntheticGlobals.length))
33749
33625
  ];
33750
33626
  for (let index = 0; index < globalCount; index++) {
33751
33627
  const start = gr.at;
@@ -33790,18 +33666,18 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33790
33666
  }
33791
33667
  }
33792
33668
  const exportParts = [
33793
- Buffer.from(uleb4(exportCount + 1 + got.size)),
33669
+ Buffer.from(encodeWasmNumber(exportCount + 1 + got.size)),
33794
33670
  bytes.subarray(originalExportsStart, exportSection.end)
33795
33671
  ];
33796
33672
  for (const [index, value] of got) {
33797
33673
  exportParts.push(
33798
33674
  encodedNameBuf(`${NATIVE_SDK_GLOBAL_PREFIX}${value}.${index}`),
33799
- Buffer.from([3, ...uleb4(index)])
33675
+ Buffer.from([3, ...encodeWasmNumber(index)])
33800
33676
  );
33801
33677
  }
33802
33678
  exportParts.push(encodedNameBuf("__indirect_function_table"), Buffer.from([1, 0]));
33803
33679
  const replaced = /* @__PURE__ */ new Map([
33804
- [2, Buffer.concat([Buffer.from(uleb4(importEntryCount)), ...importParts])],
33680
+ [2, Buffer.concat([Buffer.from(encodeWasmNumber(importEntryCount)), ...importParts])],
33805
33681
  [6, Buffer.concat(globalParts)],
33806
33682
  [7, Buffer.concat(exportParts)]
33807
33683
  ]);
@@ -33818,7 +33694,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
33818
33694
  if (s.id === 10 && rebuiltCode) {
33819
33695
  parts.push(rebuiltCode);
33820
33696
  } else if (payload) {
33821
- parts.push(Buffer.from([s.id, ...uleb4(payload.length)]), payload);
33697
+ parts.push(Buffer.from([s.id, ...encodeWasmNumber(payload.length)]), payload);
33822
33698
  } else {
33823
33699
  parts.push(bytes.subarray(s.offset, s.end));
33824
33700
  }
@@ -33834,7 +33710,7 @@ function expandSdkRelocations(bytes, section2, patches) {
33834
33710
  patches.sort((a, b) => a.at - b.at);
33835
33711
  const r = wasmReader(bytes, section2.start);
33836
33712
  const count = r.u();
33837
- const payload = [Uint8Array.from(uleb4(count))];
33713
+ const payload = [Uint8Array.from(encodeWasmNumber(count))];
33838
33714
  let next = 0;
33839
33715
  for (let i = 0; i < count; i++) {
33840
33716
  const start = r.at;
@@ -33854,7 +33730,7 @@ function expandSdkRelocations(bytes, section2, patches) {
33854
33730
  }
33855
33731
  parts.push(bytes.subarray(at, end));
33856
33732
  payload.push(
33857
- Uint8Array.from(uleb4(parts.reduce((size3, part) => size3 + part.length, 0))),
33733
+ Uint8Array.from(encodeWasmNumber(parts.reduce((size3, part) => size3 + part.length, 0))),
33858
33734
  ...parts
33859
33735
  );
33860
33736
  }
@@ -33863,7 +33739,7 @@ function expandSdkRelocations(bytes, section2, patches) {
33863
33739
  if (next !== patches.length || r.at !== section2.end)
33864
33740
  throw new Error("Swift SDK code relocations exceed the code section");
33865
33741
  return Buffer.concat([
33866
- Uint8Array.from([10, ...uleb4(payload.reduce((size2, part) => size2 + part.length, 0))]),
33742
+ Uint8Array.from([10, ...encodeWasmNumber(payload.reduce((size2, part) => size2 + part.length, 0))]),
33867
33743
  ...payload
33868
33744
  ]);
33869
33745
  }
@@ -33975,8 +33851,8 @@ function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
33975
33851
  const binding = bindSwiftAppModule(linkage, sdk2);
33976
33852
  const { data, liveSlots } = selectSwiftSdkData(sdk2, usage, linkage, projection);
33977
33853
  const bytes = Buffer.concat([binding, data]);
33978
- const sha2565 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto31.createHash)("sha256").update(bytes).digest("hex");
33979
- return { bytes, sha256: sha2565, liveSlots };
33854
+ const sha2564 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto31.createHash)("sha256").update(bytes).digest("hex");
33855
+ return { bytes, sha256: sha2564, liveSlots };
33980
33856
  }
33981
33857
  function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
33982
33858
  const map2 = readWasmLinkMap(mapFile, false);
@@ -34555,7 +34431,7 @@ function partitionParent(section2) {
34555
34431
  "__objc_class_refs"
34556
34432
  ].find((name3) => section2 === name3 || section2.startsWith(`${name3}.`));
34557
34433
  }
34558
- var import_node_child_process29, import_node_crypto31, import_node_fs46, import_node_path45, import_node_util9, import_node_zlib5, run3, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, uleb4, sleb2, encodedName2, SCANNED, RUN_GAP;
34434
+ var import_node_child_process29, import_node_crypto31, import_node_fs46, import_node_path45, import_node_util9, import_node_zlib5, run3, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, SCANNED, RUN_GAP;
34559
34435
  var init_swift_sdk_app_module = __esm({
34560
34436
  "src/swift-sdk-app-module.ts"() {
34561
34437
  "use strict";
@@ -34578,6 +34454,7 @@ var init_swift_sdk_app_module = __esm({
34578
34454
  init_swift_wasm_prune();
34579
34455
  init_swiftSdkLinkContract();
34580
34456
  init_swiftTargetContract();
34457
+ init_wasm_binary_sections();
34581
34458
  init_wasm_narrow_boundary();
34582
34459
  init_wasm_optimize();
34583
34460
  run3 = (0, import_node_util9.promisify)(import_node_child_process29.execFile);
@@ -34598,32 +34475,6 @@ var init_swift_sdk_app_module = __esm({
34598
34475
  SDK_TLS_HELPER = "__peach_sdk_tls.";
34599
34476
  SDK_TLS_DELTA = "__peach_sdk_tls_delta.";
34600
34477
  OBJC_SECTION_BOUNDARY = /^__(?:start|stop)_(__objc_(?:selectors|classes|class_refs|cats|protocols|protocol_refs|class_aliases|constant_string))$/;
34601
- uleb4 = (value) => {
34602
- const out = [];
34603
- do {
34604
- let byte = value % 128;
34605
- value = Math.floor(value / 128);
34606
- if (value) byte |= 128;
34607
- out.push(byte);
34608
- } while (value);
34609
- return out;
34610
- };
34611
- sleb2 = (value) => {
34612
- const out = [];
34613
- for (; ; ) {
34614
- const byte = Number(value & 127n);
34615
- value >>= 7n;
34616
- if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
34617
- out.push(byte);
34618
- return out;
34619
- }
34620
- out.push(byte | 128);
34621
- }
34622
- };
34623
- encodedName2 = (name3) => {
34624
- const bytes = [...Buffer.from(name3)];
34625
- return [...uleb4(bytes.length), ...bytes];
34626
- };
34627
34478
  SCANNED = /* @__PURE__ */ new Set([
34628
34479
  "swift5_protocols",
34629
34480
  "swift5_protocol_conformances",
@@ -35714,36 +35565,22 @@ function archiveMember(archive, name3) {
35714
35565
  throw new Error(`swift-icu: ${name3} is not in the sdk's icu archive`);
35715
35566
  }
35716
35567
  function icuSegment(object8) {
35717
- let at = 8;
35718
- const leb2 = () => {
35719
- let result = 0;
35720
- let shift = 0;
35721
- let byte;
35722
- do {
35723
- byte = object8[at++];
35724
- result += (byte & 127) * 2 ** shift;
35725
- shift += 7;
35726
- } while (byte & 128);
35727
- return result;
35728
- };
35729
35568
  const found = [];
35730
- while (at < object8.length) {
35731
- const id = object8[at++];
35732
- const size2 = leb2();
35733
- const end = at + size2;
35734
- if (id === 11) {
35735
- for (let count = leb2(); count > 0; count--) {
35736
- if (leb2() !== 0) throw new Error("swift-icu: unexpected data segment kind");
35737
- at++;
35738
- leb2();
35739
- at++;
35740
- const length = leb2();
35741
- const bytes = object8.subarray(at, at + length);
35742
- if (bytes[2] === 218 && bytes[3] === 39) found.push(bytes);
35743
- at += length;
35744
- }
35569
+ for (const section2 of wasmSections(object8)) {
35570
+ if (section2.id !== 11) continue;
35571
+ const reader = readWasmSection(object8, section2.start, section2.end);
35572
+ for (let count = reader.number(); count > 0; count--) {
35573
+ if (reader.number() !== 0)
35574
+ throw new Error("swift-icu: unexpected data segment kind");
35575
+ reader.byte();
35576
+ reader.number();
35577
+ reader.byte();
35578
+ const length = reader.number();
35579
+ const start = reader.position();
35580
+ const bytes = object8.subarray(start, start + length);
35581
+ if (bytes[2] === 218 && bytes[3] === 39) found.push(bytes);
35582
+ reader.skip(length);
35745
35583
  }
35746
- at = end;
35747
35584
  }
35748
35585
  if (found.length !== 1)
35749
35586
  throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
@@ -35797,6 +35634,7 @@ var init_swift_icu = __esm({
35797
35634
  init_icuData();
35798
35635
  init_swift_toolchain();
35799
35636
  init_swiftTargetContract();
35637
+ init_wasm_binary_sections();
35800
35638
  run4 = (0, import_node_util10.promisify)(import_node_child_process31.execFile);
35801
35639
  deflate = (0, import_node_util10.promisify)(import_node_zlib6.gzip);
35802
35640
  compressBrotli = (0, import_node_util10.promisify)(import_node_zlib6.brotliCompress);
@@ -42520,7 +42358,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
42520
42358
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
42521
42359
  MULTI_MANIFEST_VERSION = 76;
42522
42360
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
42523
- compilerSourceDigest = true ? "1803ba36803a88ceeca92ee7b13baa39dde72fbb72df14659f0414084afaf5d7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
42361
+ compilerSourceDigest = true ? "816651f27c8e6bad4746f2f90d840446903e3c4a2384095dcdf1c9ceb69ceba8" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
42524
42362
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
42525
42363
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
42526
42364
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -68497,11 +68335,6 @@ var init_podspec_sources = __esm({
68497
68335
  });
68498
68336
 
68499
68337
  // src/bazel-project.ts
68500
- function sha256Hex5(bytes) {
68501
- if (typeof Bun !== "undefined")
68502
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
68503
- return (0, import_node_crypto44.createHash)("sha256").update(bytes).digest("hex");
68504
- }
68505
68338
  function isBazelPackage(input) {
68506
68339
  return /^BUILD(?:\.bazel)?$/.test(import_node_path74.default.basename(input)) && import_node_fs73.default.statSync(input).isFile();
68507
68340
  }
@@ -68531,7 +68364,7 @@ function bazelBinary(root) {
68531
68364
  const expected = (0, import_node_child_process41.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
68532
68365
  encoding: "utf8"
68533
68366
  }).split(/\s/)[0];
68534
- const actual = (0, import_node_crypto44.createHash)("sha256").update(import_node_fs73.default.readFileSync(partial)).digest("hex");
68367
+ const actual = sha256Hex(import_node_fs73.default.readFileSync(partial));
68535
68368
  if (actual !== expected) {
68536
68369
  import_node_fs73.default.rmSync(partial, { force: true });
68537
68370
  throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
@@ -69256,8 +69089,8 @@ ${published3.map(
69256
69089
  ]
69257
69090
  )
69258
69091
  ]);
69259
- const digest3 = sha256Hex5(
69260
- JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex5(bytes)]))
69092
+ const digest3 = sha256Hex(
69093
+ JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex(bytes)]))
69261
69094
  );
69262
69095
  const stamp = import_node_path74.default.join(bundle, ".peach-digest");
69263
69096
  if (!import_node_fs73.default.existsSync(stamp) || import_node_fs73.default.readFileSync(stamp, "utf8") !== digest3) {
@@ -69429,6 +69262,7 @@ var init_bazel_project = __esm({
69429
69262
  import_node_path74 = __toESM(require("node:path"), 1);
69430
69263
  init_is_record();
69431
69264
  init_plist();
69265
+ init_sha256();
69432
69266
  LIBRARY_RULES = /* @__PURE__ */ new Set(["swift_library", "objc_library", "cc_library"]);
69433
69267
  QUERIED_RULES = [
69434
69268
  "swift_library",
@@ -69917,7 +69751,7 @@ var init_provenance = __esm({
69917
69751
  import_node_crypto46 = require("node:crypto");
69918
69752
  import_node_fs75 = require("node:fs");
69919
69753
  import_node_path76 = require("node:path");
69920
- 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_path76.join)(__sootsim_import_meta_dirname, ".."));
69754
+ 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_path76.join)(__sootsim_import_meta_dirname, ".."));
69921
69755
  }
69922
69756
  });
69923
69757
 
@@ -70909,12 +70743,12 @@ function catalogDigest(directory2) {
70909
70743
  const path145 = (0, import_node_path78.join)(dir, entry.name);
70910
70744
  if (entry.isDirectory()) walk4(path145);
70911
70745
  else if (entry.isFile() && (0, import_node_fs77.statSync)(path145).size <= 64 * 1024 * 1024)
70912
- hashes.push([(0, import_node_path78.relative)(directory2, path145), sha2562((0, import_node_fs77.readFileSync)(path145))]);
70746
+ hashes.push([(0, import_node_path78.relative)(directory2, path145), sha256Hex((0, import_node_fs77.readFileSync)(path145))]);
70913
70747
  else throw new Error(`Unsupported asset catalog entry: ${path145}`);
70914
70748
  }
70915
70749
  };
70916
70750
  walk4(directory2);
70917
- return sha2562(JSON.stringify(hashes));
70751
+ return sha256Hex(JSON.stringify(hashes));
70918
70752
  }
70919
70753
  function symbolSource(plan, root) {
70920
70754
  const key2 = JSON.stringify([root, plan]);
@@ -71011,16 +70845,15 @@ function assetSymbolText(plan, root) {
71011
70845
  if (source.status === "unknown") throw new Error(source.reason);
71012
70846
  return source.text;
71013
70847
  }
71014
- var import_node_crypto47, import_node_fs77, import_node_path78, sha2562, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
70848
+ var import_node_fs77, import_node_path78, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
71015
70849
  var init_xcode_assets = __esm({
71016
70850
  "src/swift-coverage/xcode-assets.ts"() {
71017
70851
  "use strict";
71018
- import_node_crypto47 = require("node:crypto");
71019
70852
  import_node_fs77 = require("node:fs");
71020
70853
  import_node_path78 = require("node:path");
70854
+ init_sha256();
71021
70855
  init_provenance();
71022
70856
  init_xcode_asset_symbols();
71023
- sha2562 = (bytes) => (0, import_node_crypto47.createHash)("sha256").update(bytes).digest("hex");
71024
70857
  unprovenAssetSettings = [
71025
70858
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
71026
70859
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
@@ -71761,7 +71594,7 @@ function normalizedEnums(input) {
71761
71594
  }
71762
71595
  function localizationIdentifier(field, key2) {
71763
71596
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
71764
- const digest3 = (0, import_node_crypto48.createHash)("sha256").update(JSON.stringify([...field, key2])).digest();
71597
+ const digest3 = (0, import_node_crypto47.createHash)("sha256").update(JSON.stringify([...field, key2])).digest();
71765
71598
  return Array.from(
71766
71599
  digest3.subarray(0, 6),
71767
71600
  (byte) => alphabet[byte % alphabet.length]
@@ -72086,12 +71919,12 @@ function writeIntentDefinition(input, prefix) {
72086
71919
  lines.push("</plist>", "");
72087
71920
  return lines.join("\n");
72088
71921
  }
72089
- var import_strict4, import_node_crypto48, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
71922
+ var import_strict4, import_node_crypto47, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
72090
71923
  var init_metadata = __esm({
72091
71924
  "src/intent-definition/metadata.ts"() {
72092
71925
  "use strict";
72093
71926
  import_strict4 = __toESM(require("node:assert/strict"), 1);
72094
- import_node_crypto48 = require("node:crypto");
71927
+ import_node_crypto47 = require("node:crypto");
72095
71928
  init_fields();
72096
71929
  init_hash_input();
72097
71930
  init_siphash();
@@ -72800,7 +72633,7 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
72800
72633
  if (prefix) identifier(prefix);
72801
72634
  if (module2) identifier(module2);
72802
72635
  const source = import_node_fs80.default.readFileSync(definition2);
72803
- const key2 = (0, import_node_crypto49.createHash)("sha256").update(
72636
+ const key2 = (0, import_node_crypto48.createHash)("sha256").update(
72804
72637
  JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
72805
72638
  ).update("\0").update(source).digest("hex");
72806
72639
  const cache = import_node_path81.default.join(derivedDirectory, "IntentDefinitions");
@@ -72840,11 +72673,11 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
72840
72673
  import_node_fs80.default.rmSync(stage, { recursive: true, force: true });
72841
72674
  }
72842
72675
  }
72843
- var import_node_crypto49, import_node_fs80, import_node_path81, intentCompilerRevision;
72676
+ var import_node_crypto48, import_node_fs80, import_node_path81, intentCompilerRevision;
72844
72677
  var init_xcode_intents = __esm({
72845
72678
  "src/xcode-intents.ts"() {
72846
72679
  "use strict";
72847
- import_node_crypto49 = require("node:crypto");
72680
+ import_node_crypto48 = require("node:crypto");
72848
72681
  import_node_fs80 = __toESM(require("node:fs"), 1);
72849
72682
  import_node_path81 = __toESM(require("node:path"), 1);
72850
72683
  init_fields();
@@ -73546,7 +73379,7 @@ function loadProject(xcodeproj) {
73546
73379
  if (!projectFile)
73547
73380
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
73548
73381
  const source = import_node_fs81.default.readFileSync(projectFile, "utf8");
73549
- const digest3 = (0, import_node_crypto50.createHash)("sha256").update(source).digest("hex");
73382
+ const digest3 = (0, import_node_crypto49.createHash)("sha256").update(source).digest("hex");
73550
73383
  const cached2 = loaded3.get(projectFile);
73551
73384
  if (cached2?.digest === digest3) return cached2.project;
73552
73385
  const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
@@ -73598,7 +73431,7 @@ function xcodeInstallationIdentity() {
73598
73431
  if (!selected) return null;
73599
73432
  const directory2 = import_node_path83.default.extname(selected) === ".app" ? import_node_path83.default.join(selected, "Contents", "Developer") : selected;
73600
73433
  const versionFile = `${directory2}/../version.plist`;
73601
- const version2 = import_node_fs81.default.existsSync(versionFile) ? (0, import_node_crypto50.createHash)("sha256").update(import_node_fs81.default.readFileSync(versionFile)).digest("hex") : null;
73434
+ const version2 = import_node_fs81.default.existsSync(versionFile) ? (0, import_node_crypto49.createHash)("sha256").update(import_node_fs81.default.readFileSync(versionFile)).digest("hex") : null;
73602
73435
  return { directory: directory2, version: version2 };
73603
73436
  }
73604
73437
  function defaultConfiguration(project2) {
@@ -74082,7 +73915,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
74082
73915
  );
74083
73916
  });
74084
73917
  }
74085
- const signature2 = (0, import_node_crypto50.createHash)("sha256").update(
73918
+ const signature2 = (0, import_node_crypto49.createHash)("sha256").update(
74086
73919
  JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
74087
73920
  );
74088
73921
  for (const file of inputFiles) {
@@ -74237,7 +74070,7 @@ ${output}`
74237
74070
  const inputs2 = JSON.stringify([
74238
74071
  1,
74239
74072
  args,
74240
- (0, import_node_crypto50.createHash)("sha256").update(import_node_fs81.default.readFileSync(file)).digest("hex")
74073
+ (0, import_node_crypto49.createHash)("sha256").update(import_node_fs81.default.readFileSync(file)).digest("hex")
74241
74074
  ]);
74242
74075
  const developer = settings("DEVELOPER_DIR");
74243
74076
  const cached2 = import_node_fs81.default.existsSync(output) && import_node_fs81.default.existsSync(stamp) ? import_node_fs81.default.readFileSync(stamp, "utf8").split("\n") : [];
@@ -75747,12 +75580,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
75747
75580
  cocoapods
75748
75581
  };
75749
75582
  }
75750
- var import_node_child_process42, import_node_crypto50, import_node_fs81, import_node_module5, import_node_path83, 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;
75583
+ var import_node_child_process42, import_node_crypto49, import_node_fs81, import_node_module5, import_node_path83, 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;
75751
75584
  var init_xcode_project = __esm({
75752
75585
  "src/xcode-project.ts"() {
75753
75586
  "use strict";
75754
75587
  import_node_child_process42 = require("node:child_process");
75755
- import_node_crypto50 = require("node:crypto");
75588
+ import_node_crypto49 = require("node:crypto");
75756
75589
  import_node_fs81 = __toESM(require("node:fs"), 1);
75757
75590
  import_node_module5 = require("node:module");
75758
75591
  import_node_path83 = __toESM(require("node:path"), 1);
@@ -75961,8 +75794,8 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
75961
75794
  );
75962
75795
  const appRelative = import_node_path84.default.relative(root, app);
75963
75796
  const manifest = JSON.parse(import_node_fs82.default.readFileSync(import_node_path84.default.join(root, "package.json"), "utf8"));
75964
- const hash = (0, import_node_crypto51.createHash)("sha256");
75965
- const native = (0, import_node_crypto51.createHash)("sha256");
75797
+ const hash = (0, import_node_crypto50.createHash)("sha256");
75798
+ const native = (0, import_node_crypto50.createHash)("sha256");
75966
75799
  const nativeDirectories = localPackageDirectories(root, app);
75967
75800
  const versionFree = new Set(
75968
75801
  nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
@@ -76046,7 +75879,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
76046
75879
  unread.slice(start, start + 32).map(async ({ file, content }) => {
76047
75880
  const bytes = await import_node_fs82.default.promises.readFile(file);
76048
75881
  content.size = bytes.length;
76049
- content.digest = (0, import_node_crypto51.createHash)("sha256").update(bytes).digest("hex");
75882
+ content.digest = (0, import_node_crypto50.createHash)("sha256").update(bytes).digest("hex");
76050
75883
  fileDigests.set(file, content);
76051
75884
  })
76052
75885
  );
@@ -76599,10 +76432,10 @@ function stageCachedQuickCryptoOpenSsl(app) {
76599
76432
  const opensslDir = import_node_path84.default.join(packageDir, "ios", "openssl");
76600
76433
  if (import_node_fs82.default.existsSync(import_node_path84.default.join(opensslDir, "quickcrypto_openssl_prefix.h"))) return;
76601
76434
  const podspec = import_node_fs82.default.readFileSync(import_node_path84.default.join(packageDir, "QuickCrypto.podspec"), "utf8");
76602
- const sha2565 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
76603
- if (!sha2565) return;
76604
- const archive = import_node_path84.default.join(cacheDir(), "pod-archives", `${sha2565}.zip`);
76605
- if (!import_node_fs82.default.existsSync(archive) || (0, import_node_crypto51.createHash)("sha256").update(import_node_fs82.default.readFileSync(archive)).digest("hex") !== sha2565)
76435
+ const sha2564 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
76436
+ if (!sha2564) return;
76437
+ const archive = import_node_path84.default.join(cacheDir(), "pod-archives", `${sha2564}.zip`);
76438
+ if (!import_node_fs82.default.existsSync(archive) || (0, import_node_crypto50.createHash)("sha256").update(import_node_fs82.default.readFileSync(archive)).digest("hex") !== sha2564)
76606
76439
  return;
76607
76440
  import_node_fs82.default.rmSync(opensslDir, { recursive: true, force: true });
76608
76441
  import_node_fs82.default.mkdirSync(opensslDir, { recursive: true });
@@ -76640,12 +76473,12 @@ ${failedOutputLine(command, cwd, bytes)}`
76640
76473
  });
76641
76474
  });
76642
76475
  }
76643
- var import_node_child_process43, import_node_crypto51, import_node_fs82, import_node_module6, import_node_os20, import_node_path84, import_node_util11, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
76476
+ var import_node_child_process43, import_node_crypto50, import_node_fs82, import_node_module6, import_node_os20, import_node_path84, import_node_util11, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
76644
76477
  var init_expo_native_workspace = __esm({
76645
76478
  "src/expo-native-workspace.ts"() {
76646
76479
  "use strict";
76647
76480
  import_node_child_process43 = require("node:child_process");
76648
- import_node_crypto51 = require("node:crypto");
76481
+ import_node_crypto50 = require("node:crypto");
76649
76482
  import_node_fs82 = __toESM(require("node:fs"), 1);
76650
76483
  import_node_module6 = require("node:module");
76651
76484
  import_node_os20 = __toESM(require("node:os"), 1);
@@ -78522,7 +78355,7 @@ async function loadStoreKitTestStore(configuration, appDir) {
78522
78355
  const identityPath = import_node_path86.default.join(
78523
78356
  cacheDir(),
78524
78357
  "storekit-identities",
78525
- `${(0, import_node_crypto52.createHash)("sha256").update(import_node_path86.default.resolve(appDir)).digest("hex")}.json`
78358
+ `${(0, import_node_crypto51.createHash)("sha256").update(import_node_path86.default.resolve(appDir)).digest("hex")}.json`
78526
78359
  );
78527
78360
  let signing;
78528
78361
  try {
@@ -78538,7 +78371,7 @@ async function loadStoreKitTestStore(configuration, appDir) {
78538
78371
  const certificate = await import_x509.X509CertificateGenerator.createSelfSigned(
78539
78372
  {
78540
78373
  name: "CN=StoreKit Testing in Xcode, O=StoreKit Testing in Xcode",
78541
- serialNumber: (0, import_node_crypto52.randomBytes)(16).toString("hex"),
78374
+ serialNumber: (0, import_node_crypto51.randomBytes)(16).toString("hex"),
78542
78375
  notBefore: new Date(Date.now() - 6e4),
78543
78376
  notAfter: new Date(Date.now() + 365 * 864e5),
78544
78377
  signingAlgorithm: algorithm,
@@ -78555,11 +78388,11 @@ async function loadStoreKitTestStore(configuration, appDir) {
78555
78388
  }
78556
78389
  return { ...catalog, signing };
78557
78390
  }
78558
- var import_node_crypto52, import_promises8, import_node_path86, import_x509;
78391
+ var import_node_crypto51, import_promises8, import_node_path86, import_x509;
78559
78392
  var init_storekit_test_store = __esm({
78560
78393
  "src/storekit-test-store.ts"() {
78561
78394
  "use strict";
78562
- import_node_crypto52 = require("node:crypto");
78395
+ import_node_crypto51 = require("node:crypto");
78563
78396
  import_promises8 = require("node:fs/promises");
78564
78397
  import_node_path86 = __toESM(require("node:path"), 1);
78565
78398
  init_storeKitContract();
@@ -78659,7 +78492,7 @@ function kotlinHome() {
78659
78492
  }
78660
78493
  async function fetchVerified(download2, target) {
78661
78494
  if (import_node_fs84.default.existsSync(target)) {
78662
- if ((0, import_node_crypto53.createHash)("sha256").update(import_node_fs84.default.readFileSync(target)).digest("hex") !== download2.sha256)
78495
+ if ((0, import_node_crypto52.createHash)("sha256").update(import_node_fs84.default.readFileSync(target)).digest("hex") !== download2.sha256)
78663
78496
  throw new Error(
78664
78497
  `cached Kotlin download differs from its pin: ${import_node_path87.default.basename(target)}`
78665
78498
  );
@@ -78668,7 +78501,7 @@ async function fetchVerified(download2, target) {
78668
78501
  const response = await fetch(download2.url);
78669
78502
  if (!response.ok) throw new Error(`${download2.url} answered ${response.status}`);
78670
78503
  const bytes = Buffer.from(await response.arrayBuffer());
78671
- const digest3 = (0, import_node_crypto53.createHash)("sha256").update(bytes).digest("hex");
78504
+ const digest3 = (0, import_node_crypto52.createHash)("sha256").update(bytes).digest("hex");
78672
78505
  if (digest3 !== download2.sha256)
78673
78506
  throw new Error(`${download2.url} has sha256 ${digest3}, expected ${download2.sha256}`);
78674
78507
  import_node_fs84.default.mkdirSync(import_node_path87.default.dirname(target), { recursive: true });
@@ -78680,9 +78513,9 @@ async function ensureCompose(toolchain) {
78680
78513
  const downloads = [...toolchain.composeLibraries, toolchain.composeLoader];
78681
78514
  const root = import_node_path87.default.join(kotlinHome(), "compose", toolchain.composeArchive.sha256);
78682
78515
  const verify = (dir) => {
78683
- for (const { name: name3, sha256: sha2565 } of downloads) {
78684
- const actual = (0, import_node_crypto53.createHash)("sha256").update(import_node_fs84.default.readFileSync(import_node_path87.default.join(dir, name3))).digest("hex");
78685
- if (actual !== sha2565)
78516
+ for (const { name: name3, sha256: sha2564 } of downloads) {
78517
+ const actual = (0, import_node_crypto52.createHash)("sha256").update(import_node_fs84.default.readFileSync(import_node_path87.default.join(dir, name3))).digest("hex");
78518
+ if (actual !== sha2564)
78686
78519
  throw new Error(`Compose input differs from its pin: ${name3}`);
78687
78520
  }
78688
78521
  };
@@ -78752,12 +78585,12 @@ function ensureToolchain(toolchain) {
78752
78585
  toolchains.set(key2, ready);
78753
78586
  return ready;
78754
78587
  }
78755
- var import_node_child_process44, import_node_crypto53, import_node_fs84, import_node_path87, import_node_util12, run6, toolchains;
78588
+ var import_node_child_process44, import_node_crypto52, import_node_fs84, import_node_path87, import_node_util12, run6, toolchains;
78756
78589
  var init_kotlin_toolchain = __esm({
78757
78590
  "src/kotlin-toolchain.ts"() {
78758
78591
  "use strict";
78759
78592
  import_node_child_process44 = require("node:child_process");
78760
- import_node_crypto53 = require("node:crypto");
78593
+ import_node_crypto52 = require("node:crypto");
78761
78594
  import_node_fs84 = __toESM(require("node:fs"), 1);
78762
78595
  import_node_path87 = __toESM(require("node:path"), 1);
78763
78596
  import_node_util12 = require("node:util");
@@ -79032,7 +78865,7 @@ async function prepareNitroDependencies(reactNativeVersion, reactNativeRoot) {
79032
78865
  throw new Error(`${dependency.name} archive holds a symlink: ${name3}`);
79033
78866
  if (entry.isDirectory()) walk4(name3);
79034
78867
  else if (entry.isFile() && (dependency.files ?? HEADER4).test(entry.name))
79035
- files2[name3] = (0, import_node_crypto54.createHash)("sha256").update(import_node_fs85.default.readFileSync(import_node_path88.default.join(tree2, name3))).digest("hex");
78868
+ files2[name3] = (0, import_node_crypto53.createHash)("sha256").update(import_node_fs85.default.readFileSync(import_node_path88.default.join(tree2, name3))).digest("hex");
79036
78869
  }
79037
78870
  };
79038
78871
  for (const sourceRoot of dependency.sourceDirectories ?? [dependency.headers.from])
@@ -79082,7 +78915,7 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
79082
78915
  const tree2 = import_node_path88.default.join(directory(dependency), "tree");
79083
78916
  const source = import_node_path88.default.join(tree2, relative4);
79084
78917
  const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
79085
- const original = (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex");
78918
+ const original = (0, import_node_crypto53.createHash)("sha256").update(bytes).digest("hex");
79086
78919
  if (original !== digest3)
79087
78920
  throw new Error(
79088
78921
  `${dependency.name} header differs from its verified archive: ${relative4}`
@@ -79091,15 +78924,15 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
79091
78924
  if (!Buffer.from(text7).equals(bytes))
79092
78925
  throw new Error(`Nitro dependency header is not UTF-8: ${source}`);
79093
78926
  const backport = dependency.backport?.file === relative4 ? dependency.backport : void 0;
79094
- let sha2565 = original;
78927
+ let sha2564 = original;
79095
78928
  if (backport) {
79096
78929
  if (original !== backport.originalSha256)
79097
78930
  throw new Error(`${dependency.name} backport original differs: ${relative4}`);
79098
78931
  if (!text7.includes(backport.before))
79099
78932
  throw new Error(`${dependency.name} backport anchor missing: ${relative4}`);
79100
78933
  text7 = text7.replace(backport.before, backport.after);
79101
- sha2565 = (0, import_node_crypto54.createHash)("sha256").update(text7).digest("hex");
79102
- if (sha2565 !== backport.derivedSha256)
78934
+ sha2564 = (0, import_node_crypto53.createHash)("sha256").update(text7).digest("hex");
78935
+ if (sha2564 !== backport.derivedSha256)
79103
78936
  throw new Error(`${dependency.name} backport derived source differs: ${relative4}`);
79104
78937
  }
79105
78938
  return {
@@ -79107,7 +78940,7 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
79107
78940
  name: dependency.name,
79108
78941
  source,
79109
78942
  text: text7,
79110
- sha256: sha2565,
78943
+ sha256: sha2564,
79111
78944
  ...backport && {
79112
78945
  derivation: {
79113
78946
  upstreamCommit: backport.upstreamCommit,
@@ -79139,7 +78972,7 @@ function nitroDependencySources(reactNativeVersion, reactNativeRoot, select) {
79139
78972
  if (!select(dependency.name, prepared)) continue;
79140
78973
  const source = import_node_path88.default.join(tree2, relative4);
79141
78974
  const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
79142
- if ((0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex") !== digest3)
78975
+ if ((0, import_node_crypto53.createHash)("sha256").update(bytes).digest("hex") !== digest3)
79143
78976
  throw new Error(
79144
78977
  `${dependency.name} source differs from its verified archive: ${relative4}`
79145
78978
  );
@@ -79168,7 +79001,7 @@ function glogSources() {
79168
79001
  if (!digest3) throw new Error(`glog ${GLOG.prefix} has no ${relative4}`);
79169
79002
  const source = import_node_path88.default.join(tree2, relative4);
79170
79003
  const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
79171
- if ((0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex") !== digest3)
79004
+ if ((0, import_node_crypto53.createHash)("sha256").update(bytes).digest("hex") !== digest3)
79172
79005
  throw new Error(`glog source differs from its verified archive: ${relative4}`);
79173
79006
  return { relative: relative4, source, text: bytes.toString("utf8"), sha256: digest3 };
79174
79007
  };
@@ -79178,7 +79011,7 @@ function glogSources() {
79178
79011
  relative: output,
79179
79012
  source: original.source,
79180
79013
  text: text7,
79181
- sha256: (0, import_node_crypto54.createHash)("sha256").update(text7).digest("hex"),
79014
+ sha256: (0, import_node_crypto53.createHash)("sha256").update(text7).digest("hex"),
79182
79015
  configured: { template, originalSha256: original.sha256 }
79183
79016
  };
79184
79017
  };
@@ -79206,12 +79039,12 @@ function glogSources() {
79206
79039
  for (const unit2 of GLOG_UNITS) sources.push(read(unit2));
79207
79040
  return sources;
79208
79041
  }
79209
- var import_node_child_process45, import_node_crypto54, import_node_fs85, import_node_path88, import_node_util13, run7, DOUBLE_CONVERSION_WASM64_BACKPORT2, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER4, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
79042
+ var import_node_child_process45, import_node_crypto53, import_node_fs85, import_node_path88, import_node_util13, run7, DOUBLE_CONVERSION_WASM64_BACKPORT2, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER4, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
79210
79043
  var init_nitro_dependencies = __esm({
79211
79044
  "src/nitro-dependencies.ts"() {
79212
79045
  "use strict";
79213
79046
  import_node_child_process45 = require("node:child_process");
79214
- import_node_crypto54 = require("node:crypto");
79047
+ import_node_crypto53 = require("node:crypto");
79215
79048
  import_node_fs85 = __toESM(require("node:fs"), 1);
79216
79049
  import_node_path88 = __toESM(require("node:path"), 1);
79217
79050
  import_node_util13 = require("node:util");
@@ -80164,7 +79997,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
80164
79997
  result.sources.push({
80165
79998
  file: original,
80166
79999
  source,
80167
- sha256: (0, import_node_crypto55.createHash)("sha256").update(bytes).digest("hex")
80000
+ sha256: (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex")
80168
80001
  });
80169
80002
  }
80170
80003
  const requested = `${targetPath(name3)}/upstream/${sourceRelative}`;
@@ -80354,7 +80187,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
80354
80187
  result.sources.push({
80355
80188
  file: mapKey,
80356
80189
  source: import_node_fs87.default.realpathSync(modulemapPath),
80357
- sha256: (0, import_node_crypto55.createHash)("sha256").update(modulemapBytes).digest("hex")
80190
+ sha256: (0, import_node_crypto54.createHash)("sha256").update(modulemapBytes).digest("hex")
80358
80191
  });
80359
80192
  registered.push(clangModule);
80360
80193
  }
@@ -80416,7 +80249,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
80416
80249
  result.sources.push({
80417
80250
  file: key2,
80418
80251
  source: real,
80419
- sha256: (0, import_node_crypto55.createHash)("sha256").update(bytes).digest("hex")
80252
+ sha256: (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex")
80420
80253
  });
80421
80254
  if (/\.(?:c|cc|cpp|cxx|m|mm|swift)$/.test(canonicalRel)) {
80422
80255
  excludes.add(`upstream/${canonicalRel}`);
@@ -80769,11 +80602,11 @@ extern "C" void ${registration.symbol}();
80769
80602
  }
80770
80603
  return result;
80771
80604
  }
80772
- var import_node_crypto55, import_node_fs87, import_node_module8, import_node_path90, import_zod2, nitroProviderTarget, NITRO_VIEWS_TARGET, PEER_PODSPEC_SKIP;
80605
+ var import_node_crypto54, import_node_fs87, import_node_module8, import_node_path90, import_zod2, nitroProviderTarget, NITRO_VIEWS_TARGET, PEER_PODSPEC_SKIP;
80773
80606
  var init_nitro_source = __esm({
80774
80607
  "src/nitro-source.ts"() {
80775
80608
  "use strict";
80776
- import_node_crypto55 = require("node:crypto");
80609
+ import_node_crypto54 = require("node:crypto");
80777
80610
  import_node_fs87 = __toESM(require("node:fs"), 1);
80778
80611
  import_node_module8 = require("node:module");
80779
80612
  import_node_path90 = __toESM(require("node:path"), 1);
@@ -80783,7 +80616,7 @@ var init_nitro_source = __esm({
80783
80616
  init_react_native_autolinking();
80784
80617
  init_swift_source_file();
80785
80618
  init_swift_submit();
80786
- nitroProviderTarget = (provider) => `NitroPackage_${(0, import_node_crypto55.createHash)("sha256").update(provider.name).digest("hex").slice(0, 16)}`;
80619
+ nitroProviderTarget = (provider) => `NitroPackage_${(0, import_node_crypto54.createHash)("sha256").update(provider.name).digest("hex").slice(0, 16)}`;
80787
80620
  NITRO_VIEWS_TARGET = "PeachNitroViews";
80788
80621
  PEER_PODSPEC_SKIP = /* @__PURE__ */ new Set([
80789
80622
  "React-jsi",
@@ -81763,7 +81596,7 @@ function watchNativeInputs(root) {
81763
81596
  (0, import_node_timers.clearTimeout)(expiry);
81764
81597
  for (const watcher of watchers) watcher.close();
81765
81598
  }
81766
- const inputs2 = { expiry, revision: (0, import_node_crypto56.randomUUID)() };
81599
+ const inputs2 = { expiry, revision: (0, import_node_crypto55.randomUUID)() };
81767
81600
  const watch = (directory2, recursive, name3) => {
81768
81601
  const watcher = import_node_fs91.default.watch(
81769
81602
  directory2,
@@ -81804,11 +81637,11 @@ function watchNativeInputs(root) {
81804
81637
  watchedInputs.set(workspace, inputs2);
81805
81638
  return inputs2;
81806
81639
  }
81807
- var import_node_crypto56, import_node_fs91, import_node_path94, import_node_timers, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
81640
+ var import_node_crypto55, import_node_fs91, import_node_path94, import_node_timers, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
81808
81641
  var init_native_preparation = __esm({
81809
81642
  "src/native-preparation.ts"() {
81810
81643
  "use strict";
81811
- import_node_crypto56 = require("node:crypto");
81644
+ import_node_crypto55 = require("node:crypto");
81812
81645
  import_node_fs91 = __toESM(require("node:fs"), 1);
81813
81646
  import_node_path94 = __toESM(require("node:path"), 1);
81814
81647
  import_node_timers = require("node:timers");
@@ -81938,7 +81771,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk2, distribution) {
81938
81771
  return { name: recipe2.name, inputs: inputs2, key: nativeEntryKey(inputs2) };
81939
81772
  }
81940
81773
  function nativeStaticLibraryRecipe(bytes) {
81941
- const digest3 = (0, import_node_crypto57.createHash)("sha256").update(bytes).digest("hex");
81774
+ const digest3 = (0, import_node_crypto56.createHash)("sha256").update(bytes).digest("hex");
81942
81775
  return NATIVE_STATIC_LIBRARY_RECIPES.find((item) => item.nativeSha256 === digest3);
81943
81776
  }
81944
81777
  function nativeStaticLibrary(file, recipe2, moduleRoot) {
@@ -81981,7 +81814,7 @@ function isRustSymbol(name3, demangled) {
81981
81814
  function rustStaticLibrary(file, moduleRoot) {
81982
81815
  const toolchain = swiftModuleToolchain(moduleRoot);
81983
81816
  const bytes = import_node_fs92.default.readFileSync(file);
81984
- const key2 = (0, import_node_crypto57.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
81817
+ const key2 = (0, import_node_crypto56.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
81985
81818
  const directory2 = import_node_path95.default.join(cacheDir(), "native-archives", key2);
81986
81819
  const archive = import_node_path95.default.join(directory2, "library.a");
81987
81820
  if (import_node_fs92.default.existsSync(archive)) return archive;
@@ -82010,7 +81843,7 @@ function rustStaticLibrary(file, moduleRoot) {
82010
81843
  const members2 = readArMembers(bytes, true);
82011
81844
  const seen = /* @__PURE__ */ new Set();
82012
81845
  const unique2 = members2.filter(({ name: name3, bytes: bytes2 }) => {
82013
- const identity2 = name3 + "\0" + (0, import_node_crypto57.createHash)("sha256").update(bytes2).digest("hex");
81846
+ const identity2 = name3 + "\0" + (0, import_node_crypto56.createHash)("sha256").update(bytes2).digest("hex");
82014
81847
  if (seen.has(identity2)) return false;
82015
81848
  seen.add(identity2);
82016
81849
  return true;
@@ -82057,14 +81890,14 @@ function rustStaticLibrary(file, moduleRoot) {
82057
81890
  function combineNativeStaticLibraries(files2, moduleRoot) {
82058
81891
  if (files2.length === 1) return files2[0];
82059
81892
  const toolchain = swiftModuleToolchain(moduleRoot);
82060
- const hash = (0, import_node_crypto57.createHash)("sha256").update(toolchain.release);
81893
+ const hash = (0, import_node_crypto56.createHash)("sha256").update(toolchain.release);
82061
81894
  for (const file of files2)
82062
81895
  hash.update("\0").update(import_node_path95.default.basename(file)).update("\0").update(import_node_fs92.default.readFileSync(file));
82063
81896
  const directory2 = import_node_path95.default.join(cacheDir(), "native-archives", hash.digest("hex"));
82064
81897
  const archive = import_node_path95.default.join(directory2, "combined.a");
82065
81898
  if (import_node_fs92.default.existsSync(archive)) return archive;
82066
81899
  import_node_fs92.default.mkdirSync(directory2, { recursive: true });
82067
- const temporary = import_node_path95.default.join(directory2, `combined-${(0, import_node_crypto57.randomUUID)()}.a`);
81900
+ const temporary = import_node_path95.default.join(directory2, `combined-${(0, import_node_crypto56.randomUUID)()}.a`);
82068
81901
  try {
82069
81902
  (0, import_node_child_process47.execFileSync)(import_node_path95.default.join(toolchain.toolchainBin, "llvm-ar"), [
82070
81903
  "qcsDL",
@@ -82077,12 +81910,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
82077
81910
  }
82078
81911
  return archive;
82079
81912
  }
82080
- var import_node_child_process47, import_node_crypto57, import_node_fs92, import_node_path95, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
81913
+ var import_node_child_process47, import_node_crypto56, import_node_fs92, import_node_path95, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
82081
81914
  var init_native_static_libraries = __esm({
82082
81915
  "src/native-static-libraries.ts"() {
82083
81916
  "use strict";
82084
81917
  import_node_child_process47 = require("node:child_process");
82085
- import_node_crypto57 = require("node:crypto");
81918
+ import_node_crypto56 = require("node:crypto");
82086
81919
  import_node_fs92 = __toESM(require("node:fs"), 1);
82087
81920
  import_node_path95 = __toESM(require("node:path"), 1);
82088
81921
  init_home_paths();
@@ -82804,11 +82637,11 @@ var init_nitro_adapter = __esm({
82804
82637
  });
82805
82638
 
82806
82639
  // src/react-native-core-digest.ts
82807
- var import_node_crypto58, import_node_fs95, import_node_path98;
82640
+ var import_node_crypto57, import_node_fs95, import_node_path98;
82808
82641
  var init_react_native_core_digest = __esm({
82809
82642
  "src/react-native-core-digest.ts"() {
82810
82643
  "use strict";
82811
- import_node_crypto58 = require("node:crypto");
82644
+ import_node_crypto57 = require("node:crypto");
82812
82645
  import_node_fs95 = __toESM(require("node:fs"), 1);
82813
82646
  import_node_path98 = __toESM(require("node:path"), 1);
82814
82647
  }
@@ -86143,19 +85976,19 @@ function u32(value) {
86143
85976
  }
86144
85977
  function propertyHash(property) {
86145
85978
  const transient = property.kind === "attribute" && property.transient;
86146
- const base2 = sha2563(
85979
+ const base2 = sha2562(
86147
85980
  property.name,
86148
85981
  [(property.optional ? 1 : 0) | (transient ? 2 : 0), 0],
86149
85982
  property.modifier ?? ""
86150
85983
  );
86151
85984
  if (property.kind === "attribute")
86152
- return sha2563(
85985
+ return sha2562(
86153
85986
  base2,
86154
85987
  u32(property.type),
86155
85988
  property.type === 1e3 && property.flags & EXTERNAL_BINARY ? [1] : [],
86156
85989
  property.flags & PRESERVE_AFTER_DELETION ? [1] : []
86157
85990
  );
86158
- return sha2563(
85991
+ return sha2562(
86159
85992
  base2,
86160
85993
  property.destination,
86161
85994
  property.inverse ?? "",
@@ -86170,7 +86003,7 @@ function entityHashes(model) {
86170
86003
  ...item.parent === null ? [] : allProperties(byName2.get(item.parent)),
86171
86004
  ...item.properties
86172
86005
  ];
86173
- const hash = (item) => sha2563(
86006
+ const hash = (item) => sha2562(
86174
86007
  item.name,
86175
86008
  [item.abstract ? 1 : 0],
86176
86009
  item.parent === null ? [] : hash(byName2.get(item.parent)),
@@ -86198,7 +86031,7 @@ function compileCoreDataModel(directory2) {
86198
86031
  files2[`${name3}.momd/${version2}.mom`] = archiveModel(model);
86199
86032
  const entities = entityHashes(model);
86200
86033
  hashes[version2] = Object.fromEntries(entities);
86201
- checksums[version2] = sha2563(...entities.map(([, hash]) => hash)).toString("base64");
86034
+ checksums[version2] = sha2562(...entities.map(([, hash]) => hash)).toString("base64");
86202
86035
  }
86203
86036
  const named = (0, import_node_fs97.existsSync)(import_node_path100.default.join(directory2, ".xccurrentversion")) ? {
86204
86037
  NSManagedObjectModel_CurrentVersionName: import_node_path100.default.basename(
@@ -86221,11 +86054,11 @@ function coreDataModelDirectories(files2) {
86221
86054
  }
86222
86055
  return [...models].sort();
86223
86056
  }
86224
- var import_node_crypto59, import_node_fs97, import_node_path100, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2563;
86057
+ var import_node_crypto58, import_node_fs97, import_node_path100, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2562;
86225
86058
  var init_core_data_model = __esm({
86226
86059
  "src/core-data-model.ts"() {
86227
86060
  "use strict";
86228
- import_node_crypto59 = require("node:crypto");
86061
+ import_node_crypto58 = require("node:crypto");
86229
86062
  import_node_fs97 = require("node:fs");
86230
86063
  import_node_path100 = __toESM(require("node:path"), 1);
86231
86064
  init_core_data_entity_classes();
@@ -86344,7 +86177,7 @@ var init_core_data_model = __esm({
86344
86177
  });
86345
86178
  }
86346
86179
  };
86347
- sha2563 = (...parts) => (0, import_node_crypto59.createHash)("sha256").update(
86180
+ sha2562 = (...parts) => (0, import_node_crypto58.createHash)("sha256").update(
86348
86181
  Buffer.concat(
86349
86182
  parts.map(
86350
86183
  (part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
@@ -88607,7 +88440,7 @@ function sourceClosureFiles(srcDir, entrypoints, excludedFiles = []) {
88607
88440
  return files2.sort();
88608
88441
  }
88609
88442
  function sourceClosureDigest(srcDir, entrypoints, excludedFiles) {
88610
- const hash = (0, import_node_crypto60.createHash)("sha256");
88443
+ const hash = (0, import_node_crypto59.createHash)("sha256");
88611
88444
  for (const file of sourceClosureFiles(srcDir, entrypoints, excludedFiles)) {
88612
88445
  const key2 = import_node_path101.default.relative(srcDir, file);
88613
88446
  const bytes = (0, import_node_fs98.readFileSync)(file);
@@ -88615,11 +88448,11 @@ function sourceClosureDigest(srcDir, entrypoints, excludedFiles) {
88615
88448
  }
88616
88449
  return hash.digest("hex");
88617
88450
  }
88618
- var import_node_crypto60, import_node_fs98, import_node_path101, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES, RUNTIME_IMPORT, standinSourceDigest, STANDIN_SOURCE_DIGEST;
88451
+ var import_node_crypto59, import_node_fs98, import_node_path101, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES, RUNTIME_IMPORT, standinSourceDigest, STANDIN_SOURCE_DIGEST;
88619
88452
  var init_swift_standin_digest = __esm({
88620
88453
  "src/swift-standin-digest.ts"() {
88621
88454
  "use strict";
88622
- import_node_crypto60 = require("node:crypto");
88455
+ import_node_crypto59 = require("node:crypto");
88623
88456
  import_node_fs98 = require("node:fs");
88624
88457
  import_node_path101 = __toESM(require("node:path"), 1);
88625
88458
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
@@ -88630,7 +88463,7 @@ var init_swift_standin_digest = __esm({
88630
88463
  ];
88631
88464
  RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
88632
88465
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
88633
- STANDIN_SOURCE_DIGEST = true ? "c2d1c024e059538977fdd0666278d52ec2116aafae79fe0e8b1cda82a5981f3b" : standinSourceDigest();
88466
+ STANDIN_SOURCE_DIGEST = true ? "6f991ca933bc6ae43f06c18cb2029ff3209de583afa4457105e7452437c20f01" : standinSourceDigest();
88634
88467
  }
88635
88468
  });
88636
88469
 
@@ -88942,13 +88775,13 @@ var init_swift_wasm64_wamr = __esm({
88942
88775
 
88943
88776
  // src/swift-wasm64-native-source.ts
88944
88777
  function deriveSource(file, bytes, backport) {
88945
- if (!backport || (0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
88778
+ if (!backport || (0, import_node_crypto60.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
88946
88779
  return null;
88947
88780
  const source = bytes.toString("utf8");
88948
88781
  const derived = Buffer.from(
88949
88782
  "rewrite" in backport ? backport.rewrite(source) : source.replace(backport.before, backport.after)
88950
88783
  );
88951
- if ((0, import_node_crypto61.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
88784
+ if ((0, import_node_crypto60.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
88952
88785
  throw new Error(`Native source derivation differs: ${file}`);
88953
88786
  return {
88954
88787
  bytes: derived,
@@ -88967,11 +88800,11 @@ function deriveWasm64NativeSource(file, bytes) {
88967
88800
  sourceDerivations.get(name3) ?? headerDerivations.get(name3)
88968
88801
  );
88969
88802
  }
88970
- var import_node_crypto61, import_node_path103, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
88803
+ var import_node_crypto60, import_node_path103, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
88971
88804
  var init_swift_wasm64_native_source = __esm({
88972
88805
  "src/swift-wasm64-native-source.ts"() {
88973
88806
  "use strict";
88974
- import_node_crypto61 = require("node:crypto");
88807
+ import_node_crypto60 = require("node:crypto");
88975
88808
  import_node_path103 = __toESM(require("node:path"), 1);
88976
88809
  init_swift_wasm64_wamr();
88977
88810
  init_swiftWasm64ConfigContract();
@@ -89431,7 +89264,7 @@ var init_genrule_library_builds = __esm({
89431
89264
  function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
89432
89265
  const distribution = swiftDistributionAt(moduleRoot);
89433
89266
  const sdk2 = swiftSdkPaths(moduleRoot, toolchainBin);
89434
- const identity2 = (0, import_node_crypto62.createHash)("sha256").update(
89267
+ const identity2 = (0, import_node_crypto61.createHash)("sha256").update(
89435
89268
  JSON.stringify([
89436
89269
  distribution?.id,
89437
89270
  distribution?.link,
@@ -89457,7 +89290,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
89457
89290
  for (const alias of product.frameworkAliases) {
89458
89291
  if (alias.wasmSdkId !== distribution.wasmSdkId || alias.wasmSdkChecksum !== distribution.wasmSdkChecksum)
89459
89292
  throw new Error(`framework SDK identity differs for ${alias.name}`);
89460
- if ((0, import_node_crypto62.createHash)("sha256").update(import_node_fs101.default.readFileSync(import_node_path105.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
89293
+ if ((0, import_node_crypto61.createHash)("sha256").update(import_node_fs101.default.readFileSync(import_node_path105.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
89461
89294
  throw new Error(`framework module map changed ${alias.moduleMap}`);
89462
89295
  const selected = /* @__PURE__ */ new Set();
89463
89296
  const reach = (name3) => {
@@ -89498,7 +89331,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
89498
89331
  for (const alias of owner.frameworkAliases) {
89499
89332
  if (frameworkResponses[alias.name])
89500
89333
  throw new Error(`ambiguous declared framework ${alias.name}`);
89501
- if ((0, import_node_crypto62.createHash)("sha256").update(import_node_fs101.default.readFileSync(import_node_path105.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
89334
+ if ((0, import_node_crypto61.createHash)("sha256").update(import_node_fs101.default.readFileSync(import_node_path105.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
89502
89335
  throw new Error(`framework module map changed ${alias.moduleMap}`);
89503
89336
  const file = import_node_path105.default.join(root, `${alias.name}.rsp`);
89504
89337
  import_node_fs101.default.writeFileSync(file, aliasArtifacts.map(quote3).join("\n") + "\n");
@@ -89592,11 +89425,11 @@ exec ${shellQuote2(configuration.compiler)} "$@"
89592
89425
  };
89593
89426
  return { cc: compiler("clang"), cxx: compiler("clang++"), identity: identity2 };
89594
89427
  }
89595
- var import_node_crypto62, import_node_fs101, import_node_path105, v7;
89428
+ var import_node_crypto61, import_node_fs101, import_node_path105, v7;
89596
89429
  var init_native_framework_compiler = __esm({
89597
89430
  "src/native-framework-compiler.ts"() {
89598
89431
  "use strict";
89599
- import_node_crypto62 = require("node:crypto");
89432
+ import_node_crypto61 = require("node:crypto");
89600
89433
  import_node_fs101 = __toESM(require("node:fs"), 1);
89601
89434
  import_node_path105 = __toESM(require("node:path"), 1);
89602
89435
  v7 = __toESM(require("peachsim/vendor/valibot"), 1);
@@ -89617,7 +89450,7 @@ function processAlive(pid) {
89617
89450
  }
89618
89451
  function tryAcquireNumberedLock(directory2, detail = "") {
89619
89452
  (0, import_node_fs102.mkdirSync)(directory2, { recursive: true });
89620
- const claim = (0, import_node_path106.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto63.randomUUID)()}`);
89453
+ const claim = (0, import_node_path106.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto62.randomUUID)()}`);
89621
89454
  for (; ; ) {
89622
89455
  const numbers = (0, import_node_fs102.readdirSync)(directory2).filter((name3) => /^\d+$/.test(name3)).map(Number);
89623
89456
  const top = Math.max(-1, ...numbers);
@@ -89656,11 +89489,11 @@ ${detail}` : ""}`);
89656
89489
  };
89657
89490
  }
89658
89491
  }
89659
- var import_node_crypto63, import_node_fs102, import_node_path106, errorCode2;
89492
+ var import_node_crypto62, import_node_fs102, import_node_path106, errorCode2;
89660
89493
  var init_numbered_lock = __esm({
89661
89494
  "src/numbered-lock.ts"() {
89662
89495
  "use strict";
89663
- import_node_crypto63 = require("node:crypto");
89496
+ import_node_crypto62 = require("node:crypto");
89664
89497
  import_node_fs102 = require("node:fs");
89665
89498
  import_node_path106 = require("node:path");
89666
89499
  errorCode2 = (error) => error instanceof Error && "code" in error ? error.code : void 0;
@@ -89687,7 +89520,7 @@ function llvmIdentity(toolchainBin, release) {
89687
89520
  ] : ["clang", "wasm-ld", "llvm-ar", "llvm-nm", "llvm-strip"].map(
89688
89521
  (name3) => swiftFileChecksum(import_node_path107.default.join(toolchainBin, name3))
89689
89522
  );
89690
- const identity2 = (0, import_node_crypto64.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
89523
+ const identity2 = (0, import_node_crypto63.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
89691
89524
  toolIdentities.set(toolchainBin, identity2);
89692
89525
  return identity2;
89693
89526
  }
@@ -89695,7 +89528,7 @@ function cSdkIdentity(sysroot, resourceDir, frameworks) {
89695
89528
  const key2 = JSON.stringify([sysroot, resourceDir, frameworks]);
89696
89529
  const cached2 = sysrootIdentities.get(key2);
89697
89530
  if (cached2) return cached2;
89698
- const hash = (0, import_node_crypto64.createHash)("sha256");
89531
+ const hash = (0, import_node_crypto63.createHash)("sha256");
89699
89532
  const add = (root, relative4) => {
89700
89533
  const file = import_node_path107.default.join(root, relative4);
89701
89534
  const stat = import_node_fs103.default.statSync(file, { throwIfNoEntry: false });
@@ -89730,7 +89563,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
89730
89563
  import_node_fs103.default.readFileSync(import_node_path107.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
89731
89564
  )
89732
89565
  );
89733
- const hash = (0, import_node_crypto64.createHash)("sha256").update(
89566
+ const hash = (0, import_node_crypto63.createHash)("sha256").update(
89734
89567
  JSON.stringify([
89735
89568
  headers,
89736
89569
  distribution.link,
@@ -89740,7 +89573,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
89740
89573
  ])
89741
89574
  );
89742
89575
  const objects = distribution.objects.map((file) => [file, distribution.files[file]]);
89743
- const objectKey = (0, import_node_crypto64.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
89576
+ const objectKey = (0, import_node_crypto63.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
89744
89577
  const cache = import_node_path107.default.join(cacheDir4, "framework-symbols-by-object", objectKey);
89745
89578
  if (!import_node_fs103.default.existsSync(cache)) {
89746
89579
  import_node_fs103.default.mkdirSync(import_node_path107.default.dirname(cache), { recursive: true });
@@ -89775,7 +89608,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
89775
89608
  const digest3 = import_node_path107.default.join(temporary, "digest");
89776
89609
  import_node_fs103.default.writeFileSync(
89777
89610
  digest3,
89778
- (0, import_node_crypto64.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
89611
+ (0, import_node_crypto63.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
89779
89612
  );
89780
89613
  import_node_fs103.default.renameSync(digest3, cache);
89781
89614
  } finally {
@@ -89830,7 +89663,7 @@ function buildable(declaration) {
89830
89663
  return builderOf(declaration) !== null && declaration.dependencies.every(buildable);
89831
89664
  }
89832
89665
  function declarationInputs(declaration, builder, toolchain, dependencyKeys) {
89833
- const hash = (0, import_node_crypto64.createHash)("sha256");
89666
+ const hash = (0, import_node_crypto63.createHash)("sha256");
89834
89667
  const files2 = declaration.sources.filter(
89835
89668
  (source) => !source.generator && !source.file.split(import_node_path107.default.sep).includes(".git")
89836
89669
  ).map((source) => import_node_path107.default.relative(declaration.packageDir, source.file));
@@ -89964,12 +89797,12 @@ function genruleArchive(declaration, library, moduleRoot) {
89964
89797
  }
89965
89798
  return combined;
89966
89799
  }
89967
- var import_node_child_process51, import_node_crypto64, import_node_fs103, import_node_os21, import_node_path107, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
89800
+ var import_node_child_process51, import_node_crypto63, import_node_fs103, import_node_os21, import_node_path107, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
89968
89801
  var init_genrule_archives = __esm({
89969
89802
  "src/genrule-archives.ts"() {
89970
89803
  "use strict";
89971
89804
  import_node_child_process51 = require("node:child_process");
89972
- import_node_crypto64 = require("node:crypto");
89805
+ import_node_crypto63 = require("node:crypto");
89973
89806
  import_node_fs103 = __toESM(require("node:fs"), 1);
89974
89807
  import_node_os21 = __toESM(require("node:os"), 1);
89975
89808
  import_node_path107 = __toESM(require("node:path"), 1);
@@ -90077,7 +89910,7 @@ function privateSentrySlice(entry, moduleRoot) {
90077
89910
  function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact) {
90078
89911
  if (standin.module !== SENTRY_SWIFT_SLICE.name) return standin;
90079
89912
  const native = simulatorNativeLibrary(artifact());
90080
- if (!native || (0, import_node_crypto65.createHash)("sha256").update(import_node_fs104.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
89913
+ if (!native || (0, import_node_crypto64.createHash)("sha256").update(import_node_fs104.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
90081
89914
  return standin;
90082
89915
  if (configured)
90083
89916
  throw new Error(
@@ -90135,12 +89968,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
90135
89968
  }
90136
89969
  };
90137
89970
  }
90138
- var import_node_child_process52, import_node_crypto65, import_node_fs104, import_node_os22, import_node_path108, SENTRY_SWIFT_SLICE;
89971
+ var import_node_child_process52, import_node_crypto64, import_node_fs104, import_node_os22, import_node_path108, SENTRY_SWIFT_SLICE;
90139
89972
  var init_native_swift_slices = __esm({
90140
89973
  "src/native-swift-slices.ts"() {
90141
89974
  "use strict";
90142
89975
  import_node_child_process52 = require("node:child_process");
90143
- import_node_crypto65 = require("node:crypto");
89976
+ import_node_crypto64 = require("node:crypto");
90144
89977
  import_node_fs104 = __toESM(require("node:fs"), 1);
90145
89978
  import_node_os22 = __toESM(require("node:os"), 1);
90146
89979
  import_node_path108 = __toESM(require("node:path"), 1);
@@ -90900,7 +90733,7 @@ function treeDigest(root) {
90900
90733
  }).join("\n");
90901
90734
  const memo2 = digests.get(`tree\0${root}`);
90902
90735
  if (memo2?.stamp === stamp) return memo2.digest;
90903
- const hash = (0, import_node_crypto66.createHash)("sha256");
90736
+ const hash = (0, import_node_crypto65.createHash)("sha256");
90904
90737
  for (const name3 of names) {
90905
90738
  hash.update(`${name3}\0`);
90906
90739
  hash.update(import_node_fs108.default.readFileSync(import_node_path111.default.join(root, name3)));
@@ -90947,7 +90780,7 @@ function swiftBinaryFramework(binary2) {
90947
90780
  const found3 = locateXcframework(import_node_path111.default.join(dir, "tree"));
90948
90781
  if (found3) return { dir: found3, digest: stored.sha };
90949
90782
  }
90950
- const sha2 = (0, import_node_crypto66.createHash)("sha256").update(import_node_fs108.default.readFileSync(binary2.dir)).digest("hex");
90783
+ const sha2 = (0, import_node_crypto65.createHash)("sha256").update(import_node_fs108.default.readFileSync(binary2.dir)).digest("hex");
90951
90784
  if (sha2 !== stored?.sha || !locateXcframework(import_node_path111.default.join(dir, "tree"))) {
90952
90785
  import_node_fs108.default.rmSync(dir, { recursive: true, force: true });
90953
90786
  import_node_fs108.default.mkdirSync(import_node_path111.default.join(dir, "tree"), { recursive: true });
@@ -90959,7 +90792,7 @@ function swiftBinaryFramework(binary2) {
90959
90792
  return { dir: found2, digest: sha2 };
90960
90793
  }
90961
90794
  if (stored && import_node_fs108.default.existsSync(archive)) {
90962
- const sha2 = (0, import_node_crypto66.createHash)("sha256").update(import_node_fs108.default.readFileSync(archive)).digest("hex");
90795
+ const sha2 = (0, import_node_crypto65.createHash)("sha256").update(import_node_fs108.default.readFileSync(archive)).digest("hex");
90963
90796
  if (sha2 !== expected)
90964
90797
  throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
90965
90798
  const found2 = locateXcframework(import_node_path111.default.join(dir, "tree"));
@@ -90968,7 +90801,7 @@ function swiftBinaryFramework(binary2) {
90968
90801
  import_node_fs108.default.rmSync(dir, { recursive: true, force: true });
90969
90802
  import_node_fs108.default.mkdirSync(import_node_path111.default.join(dir, "tree"), { recursive: true });
90970
90803
  exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
90971
- const sha = (0, import_node_crypto66.createHash)("sha256").update(import_node_fs108.default.readFileSync(archive)).digest("hex");
90804
+ const sha = (0, import_node_crypto65.createHash)("sha256").update(import_node_fs108.default.readFileSync(archive)).digest("hex");
90972
90805
  if (sha !== expected) {
90973
90806
  import_node_fs108.default.rmSync(dir, { recursive: true, force: true });
90974
90807
  throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
@@ -91093,7 +90926,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
91093
90926
  });
91094
90927
  }
91095
90928
  }
91096
- const declaredDigest = (0, import_node_crypto66.createHash)("sha256");
90929
+ const declaredDigest = (0, import_node_crypto65.createHash)("sha256");
91097
90930
  for (const framework of providedFrameworks)
91098
90931
  declaredDigest.update(`provided/${import_node_path111.default.relative(artifact.dir, framework)}\0`);
91099
90932
  for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
@@ -91163,7 +90996,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
91163
90996
  import_node_fs108.default.copyFileSync(surface.modulemap, modulemap);
91164
90997
  }
91165
90998
  }
91166
- const contents2 = (0, import_node_crypto66.createHash)("sha256");
90999
+ const contents2 = (0, import_node_crypto65.createHash)("sha256");
91167
91000
  for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
91168
91001
  const modulemap = import_node_path111.default.join(
91169
91002
  pending2,
@@ -92578,7 +92411,7 @@ function crateSourceRoots(manifest, searchRoot) {
92578
92411
  return roots;
92579
92412
  }
92580
92413
  function crateSourceDigest(manifest, searchRoot) {
92581
- const hash = (0, import_node_crypto66.createHash)("sha256");
92414
+ const hash = (0, import_node_crypto65.createHash)("sha256");
92582
92415
  const walk4 = (dir, root) => {
92583
92416
  for (const entry of import_node_fs108.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
92584
92417
  const full = import_node_path111.default.join(dir, entry.name);
@@ -93025,7 +92858,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
93025
92858
  ...swiftSources.flags,
93026
92859
  ...swiftSources.sources.flatMap((source) => [
93027
92860
  source,
93028
- (0, import_node_crypto66.createHash)("sha256").update(import_node_fs108.default.readFileSync(import_node_path111.default.join(binary2.dir, source))).digest("hex")
92861
+ (0, import_node_crypto65.createHash)("sha256").update(import_node_fs108.default.readFileSync(import_node_path111.default.join(binary2.dir, source))).digest("hex")
93029
92862
  ])
93030
92863
  );
93031
92864
  continue;
@@ -93061,7 +92894,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
93061
92894
  );
93062
92895
  }
93063
92896
  }
93064
- return (0, import_node_crypto66.createHash)("sha256").update(parts.join("\0")).digest("hex");
92897
+ return (0, import_node_crypto65.createHash)("sha256").update(parts.join("\0")).digest("hex");
93065
92898
  }
93066
92899
  function missingArtifactGap(binary2) {
93067
92900
  if (swiftBinaryOnDisk(binary2)) return null;
@@ -93143,7 +92976,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
93143
92976
  return NO_IMPORTABLE_SURFACE;
93144
92977
  }
93145
92978
  const configured = new Map(Object.entries(behavior));
93146
- const hash = (0, import_node_crypto66.createHash)("sha256").update(
92979
+ const hash = (0, import_node_crypto65.createHash)("sha256").update(
93147
92980
  standinGenerationInputs([binary2], toolchain, behavior)
93148
92981
  );
93149
92982
  hash.update(digest3);
@@ -93383,7 +93216,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
93383
93216
  );
93384
93217
  if (binary2.moduleSources !== void 0)
93385
93218
  frameworkInputs.push(
93386
- `${binary2.target}\0${(0, import_node_crypto66.createHash)("sha256").update(
93219
+ `${binary2.target}\0${(0, import_node_crypto65.createHash)("sha256").update(
93387
93220
  [iosSdkId(), ...swiftSources.flags, ...swiftSources.sources, ...texts].join(
93388
93221
  "\0"
93389
93222
  )
@@ -93424,7 +93257,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
93424
93257
  import_node_fs108.default.mkdirSync(sourceFrameworks);
93425
93258
  const frameworks = {
93426
93259
  dirs: [...frameworkDirs, sourceFrameworks].sort(),
93427
- digest: (0, import_node_crypto66.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
93260
+ digest: (0, import_node_crypto65.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
93428
93261
  surfaces: frameworkSurfaces
93429
93262
  };
93430
93263
  const siblings = new Map(
@@ -93543,12 +93376,12 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
93543
93376
  import_node_fs108.default.rmSync(modules, { recursive: true, force: true });
93544
93377
  }
93545
93378
  }
93546
- var import_node_child_process54, import_node_crypto66, import_node_fs108, import_node_path111, 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;
93379
+ var import_node_child_process54, import_node_crypto65, import_node_fs108, import_node_path111, 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;
93547
93380
  var init_swift_standins = __esm({
93548
93381
  "src/swift-standins.ts"() {
93549
93382
  "use strict";
93550
93383
  import_node_child_process54 = require("node:child_process");
93551
- import_node_crypto66 = require("node:crypto");
93384
+ import_node_crypto65 = require("node:crypto");
93552
93385
  import_node_fs108 = __toESM(require("node:fs"), 1);
93553
93386
  import_node_path111 = __toESM(require("node:path"), 1);
93554
93387
  init_forked_script_contract();
@@ -93578,7 +93411,7 @@ var init_swift_standins = __esm({
93578
93411
  init_swiftTargetContract();
93579
93412
  TRIPLE = SWIFT_WASM_TRIPLE;
93580
93413
  cacheDir5 = import_node_path111.default.join(cacheDir(), "swift-standins");
93581
- key = (...parts) => (0, import_node_crypto66.createHash)("sha256").update(parts.join("\0")).digest("hex").slice(0, 32);
93414
+ key = (...parts) => (0, import_node_crypto65.createHash)("sha256").update(parts.join("\0")).digest("hex").slice(0, 32);
93582
93415
  digests = /* @__PURE__ */ new Map();
93583
93416
  isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
93584
93417
  OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
@@ -93738,11 +93571,6 @@ function compiledFrameworkImports(app, products) {
93738
93571
  }
93739
93572
  return imports2;
93740
93573
  }
93741
- function sha256Hex6(bytes) {
93742
- if (typeof Bun !== "undefined")
93743
- return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
93744
- return (0, import_node_crypto67.createHash)("sha256").update(bytes).digest("hex");
93745
- }
93746
93574
  function regularFileStamp(file) {
93747
93575
  const stat = import_node_fs109.default.lstatSync(file, { bigint: true, throwIfNoEntry: false });
93748
93576
  if (!stat || !stat.isFile()) return null;
@@ -93756,7 +93584,7 @@ function verifyRetainedFile(work, file, hash, stamps) {
93756
93584
  if (typeof expectedStamp === "string" && regularFileStamp(resolved) === expectedStamp)
93757
93585
  return true;
93758
93586
  if (!import_node_fs109.default.existsSync(resolved)) return false;
93759
- return sha256Hex6(readPackageFile(work, resolved, Infinity)) === hash;
93587
+ return sha256Hex(readPackageFile(work, resolved, Infinity)) === hash;
93760
93588
  }
93761
93589
  function recordRetainedStamps(work, files2) {
93762
93590
  const stamps = {};
@@ -93773,7 +93601,7 @@ function cachedBinaryFileDigest(file) {
93773
93601
  const memory = binaryFileDigests.get(real);
93774
93602
  if (memory?.stamp === stamp) return memory.digest;
93775
93603
  const dir = import_node_path112.default.join(swiftCacheDir(), "swift-binary-digests");
93776
- const record5 = import_node_path112.default.join(dir, `${sha256Hex6(real)}.json`);
93604
+ const record5 = import_node_path112.default.join(dir, `${sha256Hex(real)}.json`);
93777
93605
  if (import_node_fs109.default.existsSync(record5)) {
93778
93606
  const saved = JSON.parse(import_node_fs109.default.readFileSync(record5, "utf8"));
93779
93607
  if (isRecord(saved) && saved.stamp === stamp && typeof saved.digest === "string") {
@@ -93781,10 +93609,10 @@ function cachedBinaryFileDigest(file) {
93781
93609
  return saved.digest;
93782
93610
  }
93783
93611
  }
93784
- const digest3 = sha256Hex6(import_node_fs109.default.readFileSync(real));
93612
+ const digest3 = sha256Hex(import_node_fs109.default.readFileSync(real));
93785
93613
  binaryFileDigests.set(real, { stamp, digest: digest3 });
93786
93614
  import_node_fs109.default.mkdirSync(dir, { recursive: true });
93787
- const partial = `${record5}.${process.pid}.${(0, import_node_crypto67.randomUUID)()}`;
93615
+ const partial = `${record5}.${process.pid}.${(0, import_node_crypto66.randomUUID)()}`;
93788
93616
  import_node_fs109.default.writeFileSync(partial, JSON.stringify({ stamp, digest: digest3 }));
93789
93617
  import_node_fs109.default.renameSync(partial, record5);
93790
93618
  return digest3;
@@ -94322,7 +94150,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
94322
94150
  const staged = withFrameworkCompanionImports(original);
94323
94151
  if (staged !== original) sources.set(file, Buffer.from(staged));
94324
94152
  }
94325
- const digest3 = sha256Hex6;
94153
+ const digest3 = sha256Hex;
94326
94154
  const providers = /* @__PURE__ */ new Map();
94327
94155
  for (const target of targets) {
94328
94156
  if (!supplied.has(target.moduleName)) continue;
@@ -94678,7 +94506,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
94678
94506
  products
94679
94507
  );
94680
94508
  const checkouts = remoteSwiftCheckouts(app.rootDir);
94681
- const digest3 = sha256Hex6;
94509
+ const digest3 = sha256Hex;
94682
94510
  const inputs2 = Object.fromEntries(
94683
94511
  [...sources].map(([file, bytes]) => [file, digest3(bytes)])
94684
94512
  );
@@ -95060,16 +94888,17 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
95060
94888
  import_node_fs109.default.closeSync(descriptor);
95061
94889
  }
95062
94890
  }
95063
- var import_node_child_process55, import_node_crypto67, import_node_fs109, import_node_path112, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
94891
+ var import_node_child_process55, import_node_crypto66, import_node_fs109, import_node_path112, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
95064
94892
  var init_swift_objc_compile = __esm({
95065
94893
  "src/swift-objc-compile.ts"() {
95066
94894
  "use strict";
95067
94895
  import_node_child_process55 = require("node:child_process");
95068
- import_node_crypto67 = require("node:crypto");
94896
+ import_node_crypto66 = require("node:crypto");
95069
94897
  import_node_fs109 = __toESM(require("node:fs"), 1);
95070
94898
  import_node_path112 = __toESM(require("node:path"), 1);
95071
94899
  init_mapLimit();
95072
94900
  init_is_record();
94901
+ init_sha256();
95073
94902
  init_swift_objc_import();
95074
94903
  init_swift_objc_runtime();
95075
94904
  init_swift_objc_standin();
@@ -95118,7 +94947,7 @@ async function buildRiveRuntimeDependencies(checkout, moduleRoot) {
95118
94947
  ];
95119
94948
  const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
95120
94949
  const xcode = (0, import_node_child_process56.execFileSync)("xcodebuild", ["-version"], { encoding: "utf8" });
95121
- const key2 = (0, import_node_crypto68.createHash)("sha256").update(
94950
+ const key2 = (0, import_node_crypto67.createHash)("sha256").update(
95122
94951
  JSON.stringify([
95123
94952
  RECIPE,
95124
94953
  (0, import_node_child_process56.execFileSync)("git", ["-C", runtime, "rev-parse", "HEAD"], {
@@ -95329,12 +95158,12 @@ exec ${quote3(import_node_path113.default.join(toolchainBin, "llvm-ar"))} rcs "$
95329
95158
  );
95330
95159
  return directory2;
95331
95160
  }
95332
- var import_node_child_process56, import_node_crypto68, import_node_fs110, import_node_os23, import_node_path113, import_promises10, RECIPE, CONFIG, RUNTIME_LIBRARIES;
95161
+ var import_node_child_process56, import_node_crypto67, import_node_fs110, import_node_os23, import_node_path113, import_promises10, RECIPE, CONFIG, RUNTIME_LIBRARIES;
95333
95162
  var init_rive_runtime_dependencies = __esm({
95334
95163
  "src/rive-runtime-dependencies.ts"() {
95335
95164
  "use strict";
95336
95165
  import_node_child_process56 = require("node:child_process");
95337
- import_node_crypto68 = require("node:crypto");
95166
+ import_node_crypto67 = require("node:crypto");
95338
95167
  import_node_fs110 = __toESM(require("node:fs"), 1);
95339
95168
  import_node_os23 = __toESM(require("node:os"), 1);
95340
95169
  import_node_path113 = __toESM(require("node:path"), 1);
@@ -96191,7 +96020,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
96191
96020
  (binary2) => binary2.publicHeaders === void 0 && binary2.placeholder === void 0 && swiftBinaryOnDisk(binary2) && binaryHeaderSearchPaths(binary2, staged, app.rootDir).headers.length === 1
96192
96021
  ))
96193
96022
  return [...binaries];
96194
- const hash = (0, import_node_crypto69.createHash)("sha256");
96023
+ const hash = (0, import_node_crypto68.createHash)("sha256");
96195
96024
  hash.update(
96196
96025
  JSON.stringify([
96197
96026
  inputs2.targets,
@@ -96400,12 +96229,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
96400
96229
  );
96401
96230
  return result;
96402
96231
  }
96403
- var import_node_child_process58, import_node_crypto69, import_node_fs112, import_node_path115, cachedInputs;
96232
+ var import_node_child_process58, import_node_crypto68, import_node_fs112, import_node_path115, cachedInputs;
96404
96233
  var init_swift_cxx_reachable = __esm({
96405
96234
  "src/swift-cxx-reachable.ts"() {
96406
96235
  "use strict";
96407
96236
  import_node_child_process58 = require("node:child_process");
96408
- import_node_crypto69 = require("node:crypto");
96237
+ import_node_crypto68 = require("node:crypto");
96409
96238
  import_node_fs112 = __toESM(require("node:fs"), 1);
96410
96239
  import_node_path115 = __toESM(require("node:path"), 1);
96411
96240
  init_is_record();
@@ -96426,15 +96255,15 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
96426
96255
  const pending2 = /* @__PURE__ */ new Map();
96427
96256
  const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
96428
96257
  const cache = swiftCacheDir();
96429
- const cached2 = (sha2565) => import_node_path116.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
96258
+ const cached2 = (sha2564) => import_node_path116.default.join(cache, `swift-pdf-png-${renderer}-${sha2564}.png`);
96430
96259
  let remainingBytes = imageTotalBytes;
96431
- const record5 = ({ file, sha256: sha2565 }, bytes) => {
96260
+ const record5 = ({ file, sha256: sha2564 }, bytes) => {
96432
96261
  if (bytes.length > imageBytes)
96433
96262
  throw new Error(`swift image ${file} raster exceeds the per-image cap`);
96434
96263
  remainingBytes -= bytes.length;
96435
96264
  if (remainingBytes < 0)
96436
96265
  throw new Error("swift image pack exceeds the compile service caps");
96437
- rendered.set(sha2565, bytes);
96266
+ rendered.set(sha2564, bytes);
96438
96267
  };
96439
96268
  for (const input of inputs2) {
96440
96269
  if (rendered.has(input.sha256) || pending2.has(input.sha256)) continue;
@@ -96896,7 +96725,7 @@ function fetchSwiftSdkDataPlan({ url, dataPlan }) {
96896
96725
  if (!response.ok)
96897
96726
  throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
96898
96727
  const bytes = Buffer.from(await response.arrayBuffer());
96899
- if ((0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
96728
+ if ((0, import_node_crypto69.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
96900
96729
  throw new Error(`Swift SDK data plan ${address} failed its digest check`);
96901
96730
  return bytes;
96902
96731
  });
@@ -97001,7 +96830,7 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
97001
96830
  encode(now),
97002
96831
  encodeNativeSdkLater({
97003
96832
  files: later.map((bytes) => ({
97004
- sha256: (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex"),
96833
+ sha256: (0, import_node_crypto69.createHash)("sha256").update(bytes).digest("hex"),
97005
96834
  byteLength: bytes.length
97006
96835
  })),
97007
96836
  ...needs && {
@@ -97017,11 +96846,11 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
97017
96846
  later
97018
96847
  };
97019
96848
  }
97020
- var import_node_crypto70, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
96849
+ var import_node_crypto69, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
97021
96850
  var init_swift_sdk_later_data = __esm({
97022
96851
  "src/swift-sdk-later-data.ts"() {
97023
96852
  "use strict";
97024
- import_node_crypto70 = require("node:crypto");
96853
+ import_node_crypto69 = require("node:crypto");
97025
96854
  init_nativeSdkBindingContract();
97026
96855
  init_nativeWasmContract();
97027
96856
  init_swift_sdk_image();
@@ -97073,7 +96902,7 @@ function nativeSourceDescriptor(packagePath) {
97073
96902
  function swiftArtifactContentDigest(bytes) {
97074
96903
  let digest3 = swiftArtifactDigests.get(bytes);
97075
96904
  if (!digest3) {
97076
- digest3 = (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex");
96905
+ digest3 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
97077
96906
  swiftArtifactDigests.set(bytes, digest3);
97078
96907
  }
97079
96908
  return digest3;
@@ -97201,7 +97030,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
97201
97030
  const clang = import_node_path117.default.join(toolchainBin, "clang");
97202
97031
  const empty = (binary2, file) => {
97203
97032
  const source = import_node_path117.default.join(binary2.dir, file);
97204
- const key2 = (0, import_node_crypto71.createHash)("sha256").update(
97033
+ const key2 = (0, import_node_crypto70.createHash)("sha256").update(
97205
97034
  JSON.stringify([
97206
97035
  clang,
97207
97036
  sdk2.sysroot,
@@ -97246,7 +97075,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
97246
97075
  return new Set(portable.flat());
97247
97076
  }
97248
97077
  async function swiftPackages(entry, app) {
97249
- const stamp = (file) => import_node_fs114.default.existsSync(file) ? (0, import_node_crypto71.createHash)("sha256").update(import_node_fs114.default.readFileSync(file)).digest("hex") : null;
97078
+ const stamp = (file) => import_node_fs114.default.existsSync(file) ? (0, import_node_crypto70.createHash)("sha256").update(import_node_fs114.default.readFileSync(file)).digest("hex") : null;
97250
97079
  const owners = [...app.frameworks, app].map((target) => ({
97251
97080
  module: target.moduleName,
97252
97081
  products: target.packageProducts ?? []
@@ -98415,18 +98244,18 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
98415
98244
  const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
98416
98245
  bytes
98417
98246
  );
98418
- const sha2565 = (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex");
98247
+ const sha2564 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
98419
98248
  const bundle = swiftResourceBundleForFile(bundles, key2);
98420
98249
  if (!bundle && inputs2["Package.swift"])
98421
98250
  throw new Error(`metal source ${key2} has no resource target bundle`);
98422
98251
  metalSources[key2] = {
98423
- sha256: sha2565,
98424
- url: `${baseUrl}${RESOURCE_PATH}${sha2565}.metal`,
98252
+ sha256: sha2564,
98253
+ url: `${baseUrl}${RESOURCE_PATH}${sha2564}.metal`,
98425
98254
  bundlePath: bundle?.path ?? "."
98426
98255
  };
98427
98256
  metalUploads[key2] = source;
98428
98257
  watched.push(file);
98429
- registered.set(`${sha2565}.metal`, { bytes, contentType: "text/plain; charset=utf-8" });
98258
+ registered.set(`${sha2564}.metal`, { bytes, contentType: "text/plain; charset=utf-8" });
98430
98259
  }
98431
98260
  const pdfs = /* @__PURE__ */ new Map();
98432
98261
  for (const { file } of found) {
@@ -98438,7 +98267,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
98438
98267
  const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
98439
98268
  pdfs.set(file, {
98440
98269
  file: disk,
98441
- sha256: (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex")
98270
+ sha256: (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex")
98442
98271
  });
98443
98272
  }
98444
98273
  const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
@@ -98484,7 +98313,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
98484
98313
  throw new Error("swift image pack exceeds the compile service caps");
98485
98314
  }
98486
98315
  imageBytes += bytes.length;
98487
- const hash = (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
98316
+ const hash = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
98488
98317
  const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
98489
98318
  const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
98490
98319
  const variant2 = {
@@ -98790,7 +98619,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
98790
98619
  hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
98791
98620
  }
98792
98621
  function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
98793
- const hash = (0, import_node_crypto71.createHash)("sha256");
98622
+ const hash = (0, import_node_crypto70.createHash)("sha256");
98794
98623
  hash.update(packagePath);
98795
98624
  updateSwiftConfigStamp(hash, packagePath);
98796
98625
  const libraries = projects().get(packagePath)?.libraries;
@@ -98819,7 +98648,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
98819
98648
  return hash.digest("hex").slice(0, 16);
98820
98649
  }
98821
98650
  function sourceContentStamp(packagePath, moduleRootOverride) {
98822
- const hash = (0, import_node_crypto71.createHash)("sha256");
98651
+ const hash = (0, import_node_crypto70.createHash)("sha256");
98823
98652
  hash.update(compilerSourceDigest);
98824
98653
  updateSwiftConfigStamp(hash, packagePath);
98825
98654
  const libraries = projects().get(packagePath)?.libraries;
@@ -98851,7 +98680,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
98851
98680
  (root) => import_node_fs114.default.existsSync(import_node_path117.default.join(root, "toolchain.json"))
98852
98681
  );
98853
98682
  if (!moduleRoot) return "";
98854
- const hash = (0, import_node_crypto71.createHash)("sha256");
98683
+ const hash = (0, import_node_crypto70.createHash)("sha256");
98855
98684
  hash.update(moduleRoot);
98856
98685
  for (const relative4 of swiftModuleInputFiles(moduleRoot)) {
98857
98686
  hash.update(relative4);
@@ -98861,7 +98690,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
98861
98690
  }
98862
98691
  function otherInputs(input) {
98863
98692
  const { files: _files, ...rest } = input;
98864
- return (0, import_node_crypto71.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
98693
+ return (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
98865
98694
  }
98866
98695
  function icuUrl(origin, artifact) {
98867
98696
  return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
@@ -98876,7 +98705,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
98876
98705
  for (const standin of standins) {
98877
98706
  if (!standin.prebuilt) continue;
98878
98707
  const bytes = Buffer.from(standin.prebuilt.library, "base64");
98879
- const digest3 = (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex");
98708
+ const digest3 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
98880
98709
  const dir = import_node_path117.default.join(swiftCacheDir(), "native-archives", digest3);
98881
98710
  import_node_fs114.default.mkdirSync(dir, { recursive: true });
98882
98711
  const library = import_node_path117.default.join(dir, `lib${standin.module}.a`);
@@ -99224,7 +99053,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
99224
99053
  return import_node_path117.default.join(
99225
99054
  swiftCacheDir(),
99226
99055
  "swift-builds",
99227
- (0, import_node_crypto71.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
99056
+ (0, import_node_crypto70.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
99228
99057
  );
99229
99058
  }
99230
99059
  function installedWorkspaceInput(packagePath, entry, moduleRoot) {
@@ -99518,14 +99347,14 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
99518
99347
  const url = new URL(moduleUrl);
99519
99348
  const table = swiftDyldTableReference(url.pathname, module2);
99520
99349
  if (!table) return {};
99521
- const { sha256: sha2565, byteLength } = table;
99350
+ const { sha256: sha2564, byteLength } = table;
99522
99351
  url.pathname = table.path;
99523
99352
  const response = await fetch(url, { signal });
99524
99353
  if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
99525
99354
  const bytes = Buffer.from(await response.arrayBuffer());
99526
- if (bytes.length !== byteLength || (0, import_node_crypto71.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
99355
+ if (bytes.length !== byteLength || (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
99527
99356
  throw new Error(`swift compile: ${url} does not match its module's index`);
99528
- return { dyldTable: { sha256: sha2565, bytes } };
99357
+ return { dyldTable: { sha256: sha2564, bytes } };
99529
99358
  }
99530
99359
  function currentStamp(project2, moduleRoot) {
99531
99360
  return withXcodeLayout(
@@ -99609,10 +99438,10 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
99609
99438
  sdk2.binding.bytes,
99610
99439
  plan
99611
99440
  );
99612
- const digest3 = (0, import_node_crypto71.createHash)("sha256").update(split.binding).digest("hex");
99441
+ const digest3 = (0, import_node_crypto70.createHash)("sha256").update(split.binding).digest("hex");
99613
99442
  sdkBindingFiles.set(digest3, split.binding);
99614
99443
  for (const later of split.later)
99615
- sdkBindingFiles.set((0, import_node_crypto71.createHash)("sha256").update(later).digest("hex"), later);
99444
+ sdkBindingFiles.set((0, import_node_crypto70.createHash)("sha256").update(later).digest("hex"), later);
99616
99445
  sdkSplitBindings.set(key2, digest3);
99617
99446
  }
99618
99447
  function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
@@ -99687,10 +99516,10 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
99687
99516
  const later = decodeNativeSdkBinding(
99688
99517
  bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
99689
99518
  ).later;
99690
- for (const { sha256: sha2565 } of later?.files ?? []) {
99691
- const laterBytes = sdkBindingFiles.get(sha2565);
99692
- if (!laterBytes) throw new Error(`swift sdk later data ${sha2565} is not served`);
99693
- assets2.set(`${SDK_BINDING_PATH}${sha2565}.bin`, {
99519
+ for (const { sha256: sha2564 } of later?.files ?? []) {
99520
+ const laterBytes = sdkBindingFiles.get(sha2564);
99521
+ if (!laterBytes) throw new Error(`swift sdk later data ${sha2564} is not served`);
99522
+ assets2.set(`${SDK_BINDING_PATH}${sha2564}.bin`, {
99694
99523
  bytes: laterBytes,
99695
99524
  contentType: "application/octet-stream"
99696
99525
  });
@@ -99702,13 +99531,13 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
99702
99531
  }
99703
99532
  return assets2;
99704
99533
  }
99705
- var import_node_async_hooks3, import_node_child_process60, import_node_crypto71, import_node_fs114, import_node_os25, import_node_path117, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, 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, sdkStartupParts, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
99534
+ var import_node_async_hooks3, import_node_child_process60, import_node_crypto70, import_node_fs114, import_node_os25, import_node_path117, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, 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, sdkStartupParts, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
99706
99535
  var init_swift_host = __esm({
99707
99536
  "src/swift-host.ts"() {
99708
99537
  "use strict";
99709
99538
  import_node_async_hooks3 = require("node:async_hooks");
99710
99539
  import_node_child_process60 = require("node:child_process");
99711
- import_node_crypto71 = require("node:crypto");
99540
+ import_node_crypto70 = require("node:crypto");
99712
99541
  import_node_fs114 = __toESM(require("node:fs"), 1);
99713
99542
  import_node_os25 = __toESM(require("node:os"), 1);
99714
99543
  import_node_path117 = __toESM(require("node:path"), 1);
@@ -100269,7 +100098,7 @@ function hashTree(root) {
100269
100098
  for (const entry of import_node_fs117.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
100270
100099
  if (!entry.isFile()) continue;
100271
100100
  const file = import_node_path120.default.join(entry.parentPath, entry.name);
100272
- hashes[import_node_path120.default.relative(root, file).split(import_node_path120.default.sep).join("/")] = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs117.default.readFileSync(file)).digest("hex");
100101
+ hashes[import_node_path120.default.relative(root, file).split(import_node_path120.default.sep).join("/")] = (0, import_node_crypto71.createHash)("sha256").update(import_node_fs117.default.readFileSync(file)).digest("hex");
100273
100102
  }
100274
100103
  return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
100275
100104
  }
@@ -100319,12 +100148,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
100319
100148
  files: hashTree(generatedRoot)
100320
100149
  };
100321
100150
  }
100322
- var import_node_child_process61, import_node_crypto72, import_node_fs117, import_node_module13, import_node_path120, import_node_util15, run10, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
100151
+ var import_node_child_process61, import_node_crypto71, import_node_fs117, import_node_module13, import_node_path120, import_node_util15, run10, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
100323
100152
  var init_turbo_codegen_intake = __esm({
100324
100153
  "src/turbo-codegen-intake.ts"() {
100325
100154
  "use strict";
100326
100155
  import_node_child_process61 = require("node:child_process");
100327
- import_node_crypto72 = require("node:crypto");
100156
+ import_node_crypto71 = require("node:crypto");
100328
100157
  import_node_fs117 = __toESM(require("node:fs"), 1);
100329
100158
  import_node_module13 = require("node:module");
100330
100159
  import_node_path120 = __toESM(require("node:path"), 1);
@@ -101397,7 +101226,7 @@ async function collectTurboSources(options2) {
101397
101226
  );
101398
101227
  const installedHeaders = /* @__PURE__ */ new Map();
101399
101228
  const targetPath = (name3) => `Sources/${name3}`;
101400
- const providerTarget = (name3) => `TurboPackage_${sha2564(name3).slice(0, 16)}`;
101229
+ const providerTarget = (name3) => `TurboPackage_${sha2563(name3).slice(0, 16)}`;
101401
101230
  const folly = readFollyConfig(reactNative.root);
101402
101231
  const baseDefines = [
101403
101232
  options2.configuration === "Debug" ? "DEBUG=1" : "NDEBUG",
@@ -101541,7 +101370,7 @@ async function collectTurboSources(options2) {
101541
101370
  if (!Buffer.from(text7).equals(bytes))
101542
101371
  throw new Error(`TurboModule source is not UTF-8: ${disk}`);
101543
101372
  add(key2, text7);
101544
- result.sources.push({ file: key2, source: disk, sha256: sha2564(bytes) });
101373
+ result.sources.push({ file: key2, source: disk, sha256: sha2563(bytes) });
101545
101374
  pending2.push({ key: key2, targetName, label, root, relative: relative4 });
101546
101375
  return key2;
101547
101376
  };
@@ -102354,13 +102183,13 @@ async function collectTurboSources(options2) {
102354
102183
  let decoratorHasPerformanceLogger = false;
102355
102184
  let managerHasDevMenuDecorator = false;
102356
102185
  if (fabric) objc = true;
102357
- for (const { relative: relative4, source, text: text7, sha256: sha2565, configured } of glogSources()) {
102186
+ for (const { relative: relative4, source, text: text7, sha256: sha2564, configured } of glogSources()) {
102358
102187
  const key2 = `${core}/dependencies/glog/${relative4}`;
102359
102188
  add(key2, text7);
102360
102189
  result.sources.push({
102361
102190
  file: key2,
102362
102191
  source,
102363
- sha256: sha2565,
102192
+ sha256: sha2564,
102364
102193
  ...configured && { configured }
102365
102194
  });
102366
102195
  if (relative4.startsWith("src/glog/"))
@@ -104643,11 +104472,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
104643
104472
  }
104644
104473
  `;
104645
104474
  }
104646
- var import_node_crypto73, import_node_fs118, import_node_module14, import_node_path121, 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;
104475
+ var import_node_crypto72, import_node_fs118, import_node_module14, import_node_path121, 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;
104647
104476
  var init_turbo_source = __esm({
104648
104477
  "src/turbo-source.ts"() {
104649
104478
  "use strict";
104650
- import_node_crypto73 = require("node:crypto");
104479
+ import_node_crypto72 = require("node:crypto");
104651
104480
  import_node_fs118 = __toESM(require("node:fs"), 1);
104652
104481
  import_node_module14 = require("node:module");
104653
104482
  import_node_path121 = __toESM(require("node:path"), 1);
@@ -104777,7 +104606,7 @@ var init_turbo_source = __esm({
104777
104606
  ];
104778
104607
  DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
104779
104608
  EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
104780
- sha2564 = (data) => (0, import_node_crypto73.createHash)("sha256").update(data).digest("hex");
104609
+ sha2563 = (data) => (0, import_node_crypto72.createHash)("sha256").update(data).digest("hex");
104781
104610
  podspecList = podspecAttribute;
104782
104611
  reactNativePods = /* @__PURE__ */ new Set([
104783
104612
  "React",
@@ -105664,7 +105493,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped, cor
105664
105493
  }
105665
105494
  async function prepareTurboCompileInput(options2) {
105666
105495
  await prepareTurboSourceDependencies(options2.reactNativeRoot);
105667
- const key2 = (0, import_node_crypto74.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs119.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs119.default.realpathSync(options2.moduleRoot)).digest("hex");
105496
+ const key2 = (0, import_node_crypto73.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs119.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs119.default.realpathSync(options2.moduleRoot)).digest("hex");
105668
105497
  const scratch2 = import_node_path122.default.join(import_node_os26.default.tmpdir(), "peach-turbo-swift", key2);
105669
105498
  import_node_fs119.default.mkdirSync(scratch2, { recursive: true });
105670
105499
  const codegenDir = import_node_fs119.default.mkdtempSync(import_node_path122.default.join(scratch2, "codegen-"));
@@ -105906,11 +105735,11 @@ async function compileTurboModule(options2) {
105906
105735
  collection
105907
105736
  };
105908
105737
  }
105909
- var import_node_crypto74, import_node_fs119, import_node_module15, import_node_os26, import_node_path122;
105738
+ var import_node_crypto73, import_node_fs119, import_node_module15, import_node_os26, import_node_path122;
105910
105739
  var init_turbo_compile = __esm({
105911
105740
  "src/turbo-compile.ts"() {
105912
105741
  "use strict";
105913
- import_node_crypto74 = require("node:crypto");
105742
+ import_node_crypto73 = require("node:crypto");
105914
105743
  import_node_fs119 = __toESM(require("node:fs"), 1);
105915
105744
  import_node_module15 = require("node:module");
105916
105745
  import_node_os26 = __toESM(require("node:os"), 1);
@@ -106110,8 +105939,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
106110
105939
  );
106111
105940
  if (!isRecord(manifest) || typeof manifest.version !== "string")
106112
105941
  throw new Error(`${reactNativeRoot}: react-native has no version`);
106113
- const headers = (0, import_node_crypto75.createHash)("sha256");
106114
- const sources = (0, import_node_crypto75.createHash)("sha256");
105942
+ const headers = (0, import_node_crypto74.createHash)("sha256");
105943
+ const sources = (0, import_node_crypto74.createHash)("sha256");
106115
105944
  const walk4 = (relative4) => {
106116
105945
  for (const file of import_node_fs121.default.readdirSync(import_node_path124.default.join(reactNativeRoot, relative4), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
106117
105946
  if (file.name === "node_modules" || file.name.startsWith(".")) continue;
@@ -106218,7 +106047,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
106218
106047
  const file = import_node_path124.default.join(
106219
106048
  cacheDir(),
106220
106049
  "native-archives",
106221
- `${(0, import_node_crypto75.createHash)("sha256").update(data).digest("hex")}.a`
106050
+ `${(0, import_node_crypto74.createHash)("sha256").update(data).digest("hex")}.a`
106222
106051
  );
106223
106052
  import_node_fs121.default.mkdirSync(import_node_path124.default.dirname(file), { recursive: true });
106224
106053
  if (!import_node_fs121.default.existsSync(file)) import_node_fs121.default.writeFileSync(file, Buffer.from(data, "base64"));
@@ -106228,11 +106057,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
106228
106057
  }
106229
106058
  }
106230
106059
  }
106231
- var import_node_crypto75, import_node_fs121, import_node_module16, import_node_path124, import_node_util16, recipe, strings3, building;
106060
+ var import_node_crypto74, import_node_fs121, import_node_module16, import_node_path124, import_node_util16, recipe, strings3, building;
106232
106061
  var init_react_native_core = __esm({
106233
106062
  "src/react-native-core.ts"() {
106234
106063
  "use strict";
106235
- import_node_crypto75 = require("node:crypto");
106064
+ import_node_crypto74 = require("node:crypto");
106236
106065
  import_node_fs121 = __toESM(require("node:fs"), 1);
106237
106066
  import_node_module16 = require("node:module");
106238
106067
  import_node_path124 = __toESM(require("node:path"), 1);
@@ -106263,11 +106092,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
106263
106092
  "specifications",
106264
106093
  `${checksum}.json`
106265
106094
  );
106266
- const sha1 = (value) => (0, import_node_crypto76.createHash)("sha1").update(value).digest("hex");
106095
+ const sha1 = (value) => (0, import_node_crypto75.createHash)("sha1").update(value).digest("hex");
106267
106096
  let text7;
106268
106097
  if (import_node_fs122.default.existsSync(file)) text7 = import_node_fs122.default.readFileSync(file, "utf8");
106269
106098
  else {
106270
- const shard2 = (0, import_node_crypto76.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
106099
+ const shard2 = (0, import_node_crypto75.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
106271
106100
  const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
106272
106101
  const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
106273
106102
  if (!response.ok)
@@ -106396,7 +106225,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
106396
106225
  "end",
106397
106226
  ""
106398
106227
  ].join("\n");
106399
- const key2 = (0, import_node_crypto76.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
106228
+ const key2 = (0, import_node_crypto75.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
106400
106229
  JSON.stringify(
106401
106230
  Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
106402
106231
  )
@@ -106465,11 +106294,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
106465
106294
  );
106466
106295
  });
106467
106296
  }
106468
- var import_node_crypto76, import_node_fs122, import_node_path125, APP, record4, project, podModuleName;
106297
+ var import_node_crypto75, import_node_fs122, import_node_path125, APP, record4, project, podModuleName;
106469
106298
  var init_swift_source_pods = __esm({
106470
106299
  "src/swift-source-pods.ts"() {
106471
106300
  "use strict";
106472
- import_node_crypto76 = require("node:crypto");
106301
+ import_node_crypto75 = require("node:crypto");
106473
106302
  import_node_fs122 = __toESM(require("node:fs"), 1);
106474
106303
  import_node_path125 = __toESM(require("node:path"), 1);
106475
106304
  init_browser();
@@ -107150,7 +106979,7 @@ async function prepareNitroCompileInput(options2) {
107150
106979
  input.libraries ??= {};
107151
106980
  input.libraries[nitroProviderTarget({ name: name3 })] = library;
107152
106981
  }
107153
- const key2 = (0, import_node_crypto77.createHash)("sha256").update(
106982
+ const key2 = (0, import_node_crypto76.createHash)("sha256").update(
107154
106983
  collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
107155
106984
  ).update("\0").update(import_node_fs123.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
107156
106985
  const packagePath = import_node_path126.default.join(import_node_os27.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
@@ -107206,11 +107035,11 @@ function nitrogenGeneratedSources(podDirectory) {
107206
107035
  ...sources(import_node_path126.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
107207
107036
  ];
107208
107037
  }
107209
- var import_node_crypto77, import_node_fs123, import_node_os27, import_node_path126, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
107038
+ var import_node_crypto76, import_node_fs123, import_node_os27, import_node_path126, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
107210
107039
  var init_nitro_compile = __esm({
107211
107040
  "src/nitro-compile.ts"() {
107212
107041
  "use strict";
107213
- import_node_crypto77 = require("node:crypto");
107042
+ import_node_crypto76 = require("node:crypto");
107214
107043
  import_node_fs123 = __toESM(require("node:fs"), 1);
107215
107044
  import_node_os27 = __toESM(require("node:os"), 1);
107216
107045
  import_node_path126 = __toESM(require("node:path"), 1);
@@ -107287,11 +107116,11 @@ var init_nitro_compile = __esm({
107287
107116
  });
107288
107117
 
107289
107118
  // src/nitro-compiler-digest.ts
107290
- var import_node_crypto78, import_node_fs124, import_node_path127;
107119
+ var import_node_crypto77, import_node_fs124, import_node_path127;
107291
107120
  var init_nitro_compiler_digest = __esm({
107292
107121
  "src/nitro-compiler-digest.ts"() {
107293
107122
  "use strict";
107294
- import_node_crypto78 = require("node:crypto");
107123
+ import_node_crypto77 = require("node:crypto");
107295
107124
  import_node_fs124 = require("node:fs");
107296
107125
  import_node_path127 = __toESM(require("node:path"), 1);
107297
107126
  init_swift_compiler_digest();
@@ -107312,7 +107141,7 @@ function hashPackageTree(root, options2) {
107312
107141
  }
107313
107142
  };
107314
107143
  walk4(root, "");
107315
- const hash = (0, import_node_crypto79.createHash)("sha256");
107144
+ const hash = (0, import_node_crypto78.createHash)("sha256");
107316
107145
  return (async () => {
107317
107146
  for (let start = 0; start < files2.length; start += READ_AHEAD) {
107318
107147
  const batch = files2.slice(start, start + READ_AHEAD);
@@ -107327,11 +107156,11 @@ function packageTreeDigest(root) {
107327
107156
  compareNames: (left, right) => left.localeCompare(right)
107328
107157
  });
107329
107158
  }
107330
- var import_node_crypto79, import_node_fs125, import_promises12, import_node_path128, READ_AHEAD;
107159
+ var import_node_crypto78, import_node_fs125, import_promises12, import_node_path128, READ_AHEAD;
107331
107160
  var init_package_tree_digest = __esm({
107332
107161
  "src/package-tree-digest.ts"() {
107333
107162
  "use strict";
107334
- import_node_crypto79 = require("node:crypto");
107163
+ import_node_crypto78 = require("node:crypto");
107335
107164
  import_node_fs125 = require("node:fs");
107336
107165
  import_promises12 = require("node:fs/promises");
107337
107166
  import_node_path128 = require("node:path");
@@ -107470,7 +107299,7 @@ var init_nitro_superset = __esm({
107470
107299
  init_nitroContract();
107471
107300
  init_swift_standin_digest();
107472
107301
  NITRO_SUPERSET_ENTRY_NAME = "superset";
107473
- NITRO_COMPILER_DIGEST = true ? "474b8b30de1650e72f19b75c50a0db7090ddaffdf79752b283fb389946014fa7" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
107302
+ NITRO_COMPILER_DIGEST = true ? "379ef4bc3caf96c52a4ffe7df50670f16d8db945bfbc90e1513bff35258d8b6f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
107474
107303
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
107475
107304
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
107476
107305
  published = /* @__PURE__ */ new Map();
@@ -108080,7 +107909,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
108080
107909
  const packagePath = import_node_path131.default.join(
108081
107910
  swiftCacheDir(),
108082
107911
  "peach-one-sdk-swift",
108083
- (0, import_node_crypto80.createHash)("sha256").update(import_node_fs128.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
107912
+ (0, import_node_crypto79.createHash)("sha256").update(import_node_fs128.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
108084
107913
  "sdk"
108085
107914
  );
108086
107915
  const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
@@ -108127,11 +107956,11 @@ async function buildOneSDKBundle(appRoot) {
108127
107956
  assets: await compiledModuleAssets(compiled.artifact)
108128
107957
  };
108129
107958
  }
108130
- var import_node_crypto80, import_node_fs128, import_node_path131, ONE_SDK_ROUTE, handleOneSDKRequest;
107959
+ var import_node_crypto79, import_node_fs128, import_node_path131, ONE_SDK_ROUTE, handleOneSDKRequest;
108131
107960
  var init_one_sdk_bundle = __esm({
108132
107961
  "src/one-sdk-bundle.ts"() {
108133
107962
  "use strict";
108134
- import_node_crypto80 = require("node:crypto");
107963
+ import_node_crypto79 = require("node:crypto");
108135
107964
  import_node_fs128 = __toESM(require("node:fs"), 1);
108136
107965
  import_node_path131 = __toESM(require("node:path"), 1);
108137
107966
  init_one_sdk_shard();
@@ -108174,13 +108003,13 @@ var init_expo_eager_seam_contract = __esm({
108174
108003
 
108175
108004
  // src/expo-native-compiler-digest.ts
108176
108005
  function expoNativeCompilerDigestValue() {
108177
- return true ? "c9950c3dbdb6ca5891145f8c4133c9b62e89b35f62d9343e8d7ef410cda838f5" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
108006
+ return true ? "5217c97f9f40e75420d8af715a312e49984d9ec52582e3c5d6209439c3cb70f4" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
108178
108007
  }
108179
- var import_node_crypto81;
108008
+ var import_node_crypto80;
108180
108009
  var init_expo_native_compiler_digest = __esm({
108181
108010
  "src/expo-native-compiler-digest.ts"() {
108182
108011
  "use strict";
108183
- import_node_crypto81 = require("node:crypto");
108012
+ import_node_crypto80 = require("node:crypto");
108184
108013
  init_react_native_core_digest();
108185
108014
  init_swift_compiler_digest();
108186
108015
  init_swift_standin_digest();
@@ -108189,7 +108018,7 @@ var init_expo_native_compiler_digest = __esm({
108189
108018
 
108190
108019
  // src/expo-discovery-cache.ts
108191
108020
  function peachPin() {
108192
- return (0, import_node_crypto82.createHash)("sha256").update(
108021
+ return (0, import_node_crypto81.createHash)("sha256").update(
108193
108022
  `${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
108194
108023
  ).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
108195
108024
  }
@@ -108203,7 +108032,7 @@ function stable(value) {
108203
108032
  }
108204
108033
  async function expoDiscoveryKey(options2) {
108205
108034
  const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
108206
- const key2 = (0, import_node_crypto82.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");
108035
+ const key2 = (0, import_node_crypto81.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");
108207
108036
  return { key: key2, root };
108208
108037
  }
108209
108038
  function expoDiscoveryCacheDir() {
@@ -108274,7 +108103,7 @@ function readExpoDiscovery(key2) {
108274
108103
  if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
108275
108104
  const archive = import_node_path132.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
108276
108105
  const bytes = import_node_fs129.default.readFileSync(archive);
108277
- if ((0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
108106
+ if ((0, import_node_crypto81.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
108278
108107
  return void 0;
108279
108108
  const bodies = (0, import_node_zlib8.zstdDecompressSync)(bytes);
108280
108109
  const decoded = /* @__PURE__ */ new Map();
@@ -108348,7 +108177,7 @@ function stampedFileHash(file) {
108348
108177
  const stamp = [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
108349
108178
  const cached2 = fileHashes.get(file);
108350
108179
  if (cached2?.stamp === stamp) return cached2.checksum;
108351
- const checksum = (0, import_node_crypto82.createHash)("sha256").update(import_node_fs129.default.readFileSync(file)).digest("hex");
108180
+ const checksum = (0, import_node_crypto81.createHash)("sha256").update(import_node_fs129.default.readFileSync(file)).digest("hex");
108352
108181
  fileHashes.set(file, { stamp, checksum });
108353
108182
  fileHashesChanged = true;
108354
108183
  return checksum;
@@ -108357,7 +108186,7 @@ function saveFileHashes() {
108357
108186
  if (!fileHashesChanged) return;
108358
108187
  fileHashesChanged = false;
108359
108188
  const target = fileHashesPath();
108360
- const temporary = `${target}.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`;
108189
+ const temporary = `${target}.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`;
108361
108190
  try {
108362
108191
  import_node_fs129.default.mkdirSync(import_node_path132.default.dirname(target), { recursive: true });
108363
108192
  import_node_fs129.default.writeFileSync(
@@ -108412,7 +108241,7 @@ function frameworkDigest(directory2, signal) {
108412
108241
  if (target !== root && !target.startsWith(`${root}${import_node_path132.default.sep}`))
108413
108242
  throw new Error(`framework link escapes its tree: ${relative4}`);
108414
108243
  }
108415
- return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
108244
+ return (0, import_node_crypto81.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
108416
108245
  }
108417
108246
  function rewritePreparedPaths(options2) {
108418
108247
  const { units, sourceRoot, preparedRoot, signal } = options2;
@@ -108433,7 +108262,7 @@ function rewritePreparedPaths(options2) {
108433
108262
  return null;
108434
108263
  }
108435
108264
  if (!preparedBytes.equals(sourceBytes)) return null;
108436
- dependencies[sourceFile] = (0, import_node_crypto82.createHash)("sha256").update(sourceBytes).digest("hex");
108265
+ dependencies[sourceFile] = (0, import_node_crypto81.createHash)("sha256").update(sourceBytes).digest("hex");
108437
108266
  verifiedFiles.set(preparedFile, sourceFile);
108438
108267
  return sourceFile;
108439
108268
  };
@@ -108510,7 +108339,7 @@ function rewritePreparedPaths(options2) {
108510
108339
  portableDir = import_node_path132.default.join(parent, import_node_path132.default.basename(dir));
108511
108340
  if (!import_node_fs129.default.existsSync(portableDir)) {
108512
108341
  import_node_fs129.default.mkdirSync(parent, { recursive: true });
108513
- const tmp = import_node_path132.default.join(parent, `.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`);
108342
+ const tmp = import_node_path132.default.join(parent, `.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`);
108514
108343
  try {
108515
108344
  import_node_fs129.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
108516
108345
  if (frameworkDigest(tmp, signal) !== preparedDigest)
@@ -108539,7 +108368,7 @@ function writeExpoDiscovery(options2) {
108539
108368
  try {
108540
108369
  const dir = expoDiscoveryCacheDir();
108541
108370
  import_node_fs129.default.mkdirSync(dir, { recursive: true });
108542
- const tmp = import_node_path132.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`);
108371
+ const tmp = import_node_path132.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`);
108543
108372
  if (options2.units === null) {
108544
108373
  import_node_fs129.default.writeFileSync(
108545
108374
  tmp,
@@ -108602,8 +108431,8 @@ function writeExpoDiscovery(options2) {
108602
108431
  }
108603
108432
  );
108604
108433
  const contents2 = (0, import_node_zlib8.zstdCompressSync)(Buffer.concat(chunks, size2));
108605
- const archive = (0, import_node_crypto82.createHash)("sha256").update(contents2).digest("hex");
108606
- const temporary = import_node_path132.default.join(blobDir, "." + (0, import_node_crypto82.randomUUID)() + ".tmp");
108434
+ const archive = (0, import_node_crypto81.createHash)("sha256").update(contents2).digest("hex");
108435
+ const temporary = import_node_path132.default.join(blobDir, "." + (0, import_node_crypto81.randomUUID)() + ".tmp");
108607
108436
  try {
108608
108437
  import_node_fs129.default.writeFileSync(temporary, contents2);
108609
108438
  import_node_fs129.default.renameSync(temporary, import_node_path132.default.join(blobDir, `${archive}.zst`));
@@ -108630,11 +108459,11 @@ function writeExpoDiscovery(options2) {
108630
108459
  return error instanceof Error ? error.message : String(error);
108631
108460
  }
108632
108461
  }
108633
- var import_node_crypto82, import_node_fs129, import_node_path132, import_node_zlib8, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings4, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
108462
+ var import_node_crypto81, import_node_fs129, import_node_path132, import_node_zlib8, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings4, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
108634
108463
  var init_expo_discovery_cache = __esm({
108635
108464
  "src/expo-discovery-cache.ts"() {
108636
108465
  "use strict";
108637
- import_node_crypto82 = require("node:crypto");
108466
+ import_node_crypto81 = require("node:crypto");
108638
108467
  import_node_fs129 = __toESM(require("node:fs"), 1);
108639
108468
  import_node_path132 = __toESM(require("node:path"), 1);
108640
108469
  import_node_zlib8 = require("node:zlib");
@@ -108838,7 +108667,7 @@ async function expoNativeInputs(appRoot) {
108838
108667
  "swift-pin": JSON.stringify(swiftNativePin()),
108839
108668
  answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
108840
108669
  "pods-environment": JSON.stringify(reactNativePodsEnvironment()),
108841
- fingerprint: (0, import_node_crypto83.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
108670
+ fingerprint: (0, import_node_crypto82.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
108842
108671
  },
108843
108672
  packages
108844
108673
  };
@@ -108944,7 +108773,7 @@ async function prebuiltAppTarget(appRoot, signal, dependencies = "lockfile") {
108944
108773
  }
108945
108774
  function servedExpoSwift(appRoot, entry, app) {
108946
108775
  if (!entry.expoSwift) return null;
108947
- const rootId = `${(0, import_node_crypto83.createHash)("sha256").update(import_node_fs131.default.realpathSync(appRoot)).digest("hex")}/Expo`;
108776
+ const rootId = `${(0, import_node_crypto82.createHash)("sha256").update(import_node_fs131.default.realpathSync(appRoot)).digest("hex")}/Expo`;
108948
108777
  if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
108949
108778
  const installed = installedInfoPlist(app.infoPlist, entry.infoPlist);
108950
108779
  const infoPlist2 = Buffer.from(installed).toString("base64");
@@ -108972,11 +108801,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
108972
108801
  await prebuiltAppTarget(appRoot, signal, "installed")
108973
108802
  );
108974
108803
  }
108975
- var import_node_crypto83, import_node_fs131, import_node_module19, import_node_path134, import_node_util17, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published2, lookups, answers;
108804
+ var import_node_crypto82, import_node_fs131, import_node_module19, import_node_path134, import_node_util17, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published2, lookups, answers;
108976
108805
  var init_expo_native_prebuilt = __esm({
108977
108806
  "src/expo-native-prebuilt.ts"() {
108978
108807
  "use strict";
108979
- import_node_crypto83 = require("node:crypto");
108808
+ import_node_crypto82 = require("node:crypto");
108980
108809
  import_node_fs131 = __toESM(require("node:fs"), 1);
108981
108810
  import_node_module19 = require("node:module");
108982
108811
  import_node_path134 = __toESM(require("node:path"), 1);
@@ -109593,7 +109422,7 @@ function exportedNames(moduleRoot, name3) {
109593
109422
  const modules = import_node_path136.default.join(moduleRoot, "modules");
109594
109423
  const module2 = import_node_path136.default.join(modules, `${name3}.swiftmodule`);
109595
109424
  if (!import_node_fs133.default.existsSync(module2)) return /* @__PURE__ */ new Set();
109596
- const key2 = (0, import_node_crypto84.createHash)("sha256").update(import_node_fs133.default.readFileSync(module2)).digest("hex");
109425
+ const key2 = (0, import_node_crypto83.createHash)("sha256").update(import_node_fs133.default.readFileSync(module2)).digest("hex");
109597
109426
  const directory2 = import_node_path136.default.join(swiftCacheDir(), "swift-public-names");
109598
109427
  const receipt = import_node_path136.default.join(directory2, `${key2}.json`);
109599
109428
  if (import_node_fs133.default.existsSync(receipt)) {
@@ -109676,12 +109505,12 @@ function clangTypeOwnership(moduleRoot, module2) {
109676
109505
  }
109677
109506
  );
109678
109507
  }
109679
- var import_node_child_process64, import_node_crypto84, import_node_fs133, import_node_path136, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
109508
+ var import_node_child_process64, import_node_crypto83, import_node_fs133, import_node_path136, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
109680
109509
  var init_swift_clang_type_ownership = __esm({
109681
109510
  "src/swift-clang-type-ownership.ts"() {
109682
109511
  "use strict";
109683
109512
  import_node_child_process64 = require("node:child_process");
109684
- import_node_crypto84 = require("node:crypto");
109513
+ import_node_crypto83 = require("node:crypto");
109685
109514
  import_node_fs133 = __toESM(require("node:fs"), 1);
109686
109515
  import_node_path136 = __toESM(require("node:path"), 1);
109687
109516
  init_is_record();
@@ -111349,7 +111178,7 @@ function targetSettings2(units) {
111349
111178
  }
111350
111179
  function oneSDKStamp(oneSDK) {
111351
111180
  if (!oneSDK) return "";
111352
- const hash = (0, import_node_crypto85.createHash)("sha256");
111181
+ const hash = (0, import_node_crypto84.createHash)("sha256");
111353
111182
  for (const files2 of [oneSDK.targets, oneSDK.entry])
111354
111183
  for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
111355
111184
  hash.update(`${name3}\0${source}\0`);
@@ -111400,7 +111229,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
111400
111229
  `;
111401
111230
  }
111402
111231
  function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
111403
- const hash = (0, import_node_crypto85.createHash)("sha256");
111232
+ const hash = (0, import_node_crypto84.createHash)("sha256");
111404
111233
  hash.update(base2);
111405
111234
  hash.update(reactProviderStamp);
111406
111235
  for (const unit2 of units) {
@@ -111773,8 +111602,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
111773
111602
  }
111774
111603
  return provider;
111775
111604
  })() : void 0;
111776
- const reactProviderStamp = reactProvider ? (0, import_node_crypto85.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
111777
- const key2 = (0, import_node_crypto85.createHash)("sha256").update(import_node_fs134.default.realpathSync(root)).digest("hex");
111605
+ const reactProviderStamp = reactProvider ? (0, import_node_crypto84.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
111606
+ const key2 = (0, import_node_crypto84.createHash)("sha256").update(import_node_fs134.default.realpathSync(root)).digest("hex");
111778
111607
  const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
111779
111608
  const failures = /* @__PURE__ */ new Map();
111780
111609
  const failureRecords = /* @__PURE__ */ new Map();
@@ -112068,7 +111897,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
112068
111897
  await check2(part[0]);
112069
111898
  continue;
112070
111899
  }
112071
- const name3 = (0, import_node_crypto85.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
111900
+ const name3 = (0, import_node_crypto84.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
112072
111901
  report(`linking ${part.length} namespaces to isolate failures`);
112073
111902
  try {
112074
111903
  const built2 = await link(part, `isolate-${name3}`);
@@ -112141,13 +111970,13 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
112141
111970
  throw failure2;
112142
111971
  }
112143
111972
  }
112144
- var import_node_async_hooks4, import_node_child_process65, import_node_crypto85, import_node_fs134, import_node_module21, import_node_os29, import_node_path137, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
111973
+ var import_node_async_hooks4, import_node_child_process65, import_node_crypto84, import_node_fs134, import_node_module21, import_node_os29, import_node_path137, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
112145
111974
  var init_expo_swift_host = __esm({
112146
111975
  "src/expo-swift-host.ts"() {
112147
111976
  "use strict";
112148
111977
  import_node_async_hooks4 = require("node:async_hooks");
112149
111978
  import_node_child_process65 = require("node:child_process");
112150
- import_node_crypto85 = require("node:crypto");
111979
+ import_node_crypto84 = require("node:crypto");
112151
111980
  import_node_fs134 = __toESM(require("node:fs"), 1);
112152
111981
  import_node_module21 = require("node:module");
112153
111982
  import_node_os29 = __toESM(require("node:os"), 1);
@@ -112472,7 +112301,7 @@ async function resolveAndroidGradleSources(request) {
112472
112301
  const parent = import_node_path140.default.join(kotlinHome(), "gradle-sources");
112473
112302
  import_node_fs136.default.mkdirSync(parent, { recursive: true });
112474
112303
  const work = import_node_fs136.default.mkdtempSync(import_node_path140.default.join(parent, ".query-"));
112475
- const task = `peachAndroidSources${(0, import_node_crypto86.randomBytes)(8).toString("hex")}`;
112304
+ const task = `peachAndroidSources${(0, import_node_crypto85.randomBytes)(8).toString("hex")}`;
112476
112305
  const script = import_node_path140.default.join(work, "sources.gradle");
112477
112306
  const encoded = Buffer.from(
112478
112307
  JSON.stringify({
@@ -112624,12 +112453,12 @@ function readDependencySources(value) {
112624
112453
  };
112625
112454
  });
112626
112455
  }
112627
- var import_node_child_process66, import_node_crypto86, import_node_fs136, import_node_path140, import_node_util19, run12, modelQuery;
112456
+ var import_node_child_process66, import_node_crypto85, import_node_fs136, import_node_path140, import_node_util19, run12, modelQuery;
112628
112457
  var init_android_gradle_sources = __esm({
112629
112458
  "src/android-gradle-sources.ts"() {
112630
112459
  "use strict";
112631
112460
  import_node_child_process66 = require("node:child_process");
112632
- import_node_crypto86 = require("node:crypto");
112461
+ import_node_crypto85 = require("node:crypto");
112633
112462
  import_node_fs136 = __toESM(require("node:fs"), 1);
112634
112463
  import_node_path140 = __toESM(require("node:path"), 1);
112635
112464
  import_node_util19 = require("node:util");
@@ -113017,7 +112846,7 @@ var init_android_bridge_packages = __esm({
113017
112846
 
113018
112847
  // src/java-module-abi.ts
113019
112848
  async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
113020
- const digest3 = (0, import_node_crypto87.createHash)("sha256");
112849
+ const digest3 = (0, import_node_crypto86.createHash)("sha256");
113021
112850
  const parent = import_node_path142.default.join(kotlinHome(), "java-specs");
113022
112851
  import_node_fs138.default.mkdirSync(parent, { recursive: true });
113023
112852
  const work = import_node_fs138.default.mkdtempSync(import_node_path142.default.join(parent, ".read-"));
@@ -113114,12 +112943,12 @@ async function compileJavaModuleAbi(input) {
113114
112943
  );
113115
112944
  return library;
113116
112945
  }
113117
- var import_node_child_process67, import_node_crypto87, import_node_fs138, import_node_path142, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
112946
+ var import_node_child_process67, import_node_crypto86, import_node_fs138, import_node_path142, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
113118
112947
  var init_java_module_abi = __esm({
113119
112948
  "src/java-module-abi.ts"() {
113120
112949
  "use strict";
113121
112950
  import_node_child_process67 = require("node:child_process");
113122
- import_node_crypto87 = require("node:crypto");
112951
+ import_node_crypto86 = require("node:crypto");
113123
112952
  import_node_fs138 = __toESM(require("node:fs"), 1);
113124
112953
  import_node_path142 = __toESM(require("node:path"), 1);
113125
112954
  import_node_util20 = require("node:util");
@@ -113227,17 +113056,17 @@ function verifyKotlinSdkDirectory(root, compiler) {
113227
113056
  if (!stat.isFile() || stat.nlink !== 1)
113228
113057
  throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
113229
113058
  const bytes = import_node_fs139.default.readFileSync(target);
113230
- if (bytes.length !== expected.bytes || (0, import_node_crypto88.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
113059
+ if (bytes.length !== expected.bytes || (0, import_node_crypto87.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
113231
113060
  throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
113232
113061
  }
113233
113062
  return manifest;
113234
113063
  }
113235
113064
  async function installKotlinSdkArchive(archive, compiler) {
113236
- const sha2565 = (0, import_node_crypto88.createHash)("sha256").update(archive).digest("hex");
113065
+ const sha2564 = (0, import_node_crypto87.createHash)("sha256").update(archive).digest("hex");
113237
113066
  const parent = import_node_path143.default.join(kotlinHome(), "sdk");
113238
- const root = import_node_path143.default.join(parent, sha2565);
113067
+ const root = import_node_path143.default.join(parent, sha2564);
113239
113068
  if (import_node_fs139.default.existsSync(root))
113240
- return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
113069
+ return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compiler) };
113241
113070
  import_node_fs139.default.mkdirSync(parent, { recursive: true });
113242
113071
  const work = import_node_fs139.default.mkdtempSync(import_node_path143.default.join(parent, ".install-"));
113243
113072
  try {
@@ -113257,17 +113086,17 @@ async function installKotlinSdkArchive(archive, compiler) {
113257
113086
  if (!import_node_fs139.default.existsSync(root)) throw error;
113258
113087
  verifyKotlinSdkDirectory(root, compiler);
113259
113088
  }
113260
- return { root, sha256: sha2565, manifest };
113089
+ return { root, sha256: sha2564, manifest };
113261
113090
  } finally {
113262
113091
  import_node_fs139.default.rmSync(work, { recursive: true, force: true });
113263
113092
  }
113264
113093
  }
113265
- var import_node_child_process68, import_node_crypto88, import_node_fs139, import_node_path143, import_node_util21, run14;
113094
+ var import_node_child_process68, import_node_crypto87, import_node_fs139, import_node_path143, import_node_util21, run14;
113266
113095
  var init_kotlin_sdk = __esm({
113267
113096
  "src/kotlin-sdk.ts"() {
113268
113097
  "use strict";
113269
113098
  import_node_child_process68 = require("node:child_process");
113270
- import_node_crypto88 = require("node:crypto");
113099
+ import_node_crypto87 = require("node:crypto");
113271
113100
  import_node_fs139 = __toESM(require("node:fs"), 1);
113272
113101
  import_node_path143 = __toESM(require("node:path"), 1);
113273
113102
  import_node_util21 = require("node:util");
@@ -113373,7 +113202,7 @@ function peachKotlinModuleRoot() {
113373
113202
  if (!IS_STANDALONE) return import_node_path145.default.join(peachsimPackageRoot(), "kotlin");
113374
113203
  if (installedRoot) return installedRoot;
113375
113204
  const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
113376
- const digest3 = (0, import_node_crypto89.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
113205
+ const digest3 = (0, import_node_crypto88.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
113377
113206
  const parent = import_node_path145.default.join(rnxHomeDir(), "kotlin", "modules");
113378
113207
  const root = import_node_path145.default.join(parent, digest3);
113379
113208
  import_node_fs141.default.mkdirSync(parent, { recursive: true });
@@ -113402,11 +113231,11 @@ function peachKotlinModuleRoot() {
113402
113231
  installedRoot = root;
113403
113232
  return root;
113404
113233
  }
113405
- var import_node_crypto89, import_node_fs141, import_node_path145, installedRoot;
113234
+ var import_node_crypto88, import_node_fs141, import_node_path145, installedRoot;
113406
113235
  var init_kotlin_module = __esm({
113407
113236
  "src/kotlin-module.ts"() {
113408
113237
  "use strict";
113409
- import_node_crypto89 = require("node:crypto");
113238
+ import_node_crypto88 = require("node:crypto");
113410
113239
  import_node_fs141 = __toESM(require("node:fs"), 1);
113411
113240
  import_node_path145 = __toESM(require("node:path"), 1);
113412
113241
  init_standalone();
@@ -113769,7 +113598,7 @@ function zipSources(bytes, where) {
113769
113598
  return entries2;
113770
113599
  }
113771
113600
  function extract(bytes, where) {
113772
- const key2 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
113601
+ const key2 = (0, import_node_crypto89.createHash)("sha256").update(bytes).digest("hex");
113773
113602
  const cached2 = pending.get(key2);
113774
113603
  if (cached2) return cached2;
113775
113604
  const request = (async () => {
@@ -113818,11 +113647,11 @@ function readSourcesJar(archive, where) {
113818
113647
  function readMavenSourcesArchive(archive) {
113819
113648
  return extract(readSourcesJar(archive, archive), archive);
113820
113649
  }
113821
- var import_node_crypto90, import_node_fs143, import_node_os30, import_node_path147, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
113650
+ var import_node_crypto89, import_node_fs143, import_node_os30, import_node_path147, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
113822
113651
  var init_kotlin_maven_sources = __esm({
113823
113652
  "src/kotlin-maven-sources.ts"() {
113824
113653
  "use strict";
113825
- import_node_crypto90 = require("node:crypto");
113654
+ import_node_crypto89 = require("node:crypto");
113826
113655
  import_node_fs143 = __toESM(require("node:fs"), 1);
113827
113656
  import_node_os30 = __toESM(require("node:os"), 1);
113828
113657
  import_node_path147 = __toESM(require("node:path"), 1);
@@ -113863,7 +113692,7 @@ async function compileKotlinGradleLibraries(input) {
113863
113692
  ])
113864
113693
  ];
113865
113694
  const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
113866
- const suffix = (0, import_node_crypto91.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
113695
+ const suffix = (0, import_node_crypto90.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
113867
113696
  const klib = import_node_path148.default.join(input.output, `${name3}-${suffix}.klib`);
113868
113697
  const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
113869
113698
  const abiPairs = java.length ? dependencies.flatMap(
@@ -113905,11 +113734,11 @@ async function compileKotlinGradleLibraries(input) {
113905
113734
  }
113906
113735
  return [...compiled.values()].map(({ klib }) => klib);
113907
113736
  }
113908
- var import_node_crypto91, import_node_fs144, import_node_path148;
113737
+ var import_node_crypto90, import_node_fs144, import_node_path148;
113909
113738
  var init_kotlin_gradle_library_plan = __esm({
113910
113739
  "src/kotlin-gradle-library-plan.ts"() {
113911
113740
  "use strict";
113912
- import_node_crypto91 = require("node:crypto");
113741
+ import_node_crypto90 = require("node:crypto");
113913
113742
  import_node_fs144 = __toESM(require("node:fs"), 1);
113914
113743
  import_node_path148 = __toESM(require("node:path"), 1);
113915
113744
  init_kotlin_library_sources();
@@ -114366,7 +114195,7 @@ function readExpoTypes(output) {
114366
114195
  });
114367
114196
  }
114368
114197
  async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
114369
- const digest3 = (0, import_node_crypto92.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
114198
+ const digest3 = (0, import_node_crypto91.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
114370
114199
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
114371
114200
  digest3.update(import_node_fs145.default.readFileSync(import_node_path149.default.join(moduleRoot, "sdk.tar.gz")));
114372
114201
  digest3.update(tool);
@@ -115028,7 +114857,7 @@ async function compileKotlin(input, origin) {
115028
114857
  bytes: import_node_fs145.default.readFileSync(file)
115029
114858
  }));
115030
114859
  const { composeArchive, ...compilerInputs } = toolchain;
115031
- const digest3 = (0, import_node_crypto92.createHash)("sha256");
114860
+ const digest3 = (0, import_node_crypto91.createHash)("sha256");
115032
114861
  digest3.update(
115033
114862
  JSON.stringify({
115034
114863
  format: BUILD_FORMAT,
@@ -115050,7 +114879,7 @@ async function compileKotlin(input, origin) {
115050
114879
  ...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
115051
114880
  ]);
115052
114881
  for (const file of files2) {
115053
- digest3.update((0, import_node_crypto92.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
114882
+ digest3.update((0, import_node_crypto91.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
115054
114883
  }
115055
114884
  }
115056
114885
  if (viewModels) digest3.update(viewModels.toolClass);
@@ -115342,12 +115171,12 @@ async function serveKotlinRequest(pathname, res, app) {
115342
115171
  }
115343
115172
  return true;
115344
115173
  }
115345
- var import_node_child_process70, import_node_crypto92, import_node_fs145, import_node_module24, import_node_path149, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
115174
+ var import_node_child_process70, import_node_crypto91, import_node_fs145, import_node_module24, import_node_path149, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
115346
115175
  var init_kotlin_host = __esm({
115347
115176
  "src/kotlin-host.ts"() {
115348
115177
  "use strict";
115349
115178
  import_node_child_process70 = require("node:child_process");
115350
- import_node_crypto92 = require("node:crypto");
115179
+ import_node_crypto91 = require("node:crypto");
115351
115180
  import_node_fs145 = __toESM(require("node:fs"), 1);
115352
115181
  import_node_module24 = require("node:module");
115353
115182
  import_node_path149 = __toESM(require("node:path"), 1);
@@ -116190,7 +116019,7 @@ __export(bundle_channel_exports, {
116190
116019
  snapshotOneProductionBundle: () => snapshotOneProductionBundle
116191
116020
  });
116192
116021
  module.exports = __toCommonJS(bundle_channel_exports);
116193
- var import_node_crypto94 = require("node:crypto");
116022
+ var import_node_crypto93 = require("node:crypto");
116194
116023
  var import_node_fs153 = require("node:fs");
116195
116024
  var import_node_path158 = require("node:path");
116196
116025
  var import_node_vm = require("node:vm");
@@ -116399,7 +116228,7 @@ init_expo_native_workspace();
116399
116228
 
116400
116229
  // src/host/staged-host-files.ts
116401
116230
  var import_node_async_hooks5 = require("node:async_hooks");
116402
- var import_node_crypto93 = require("node:crypto");
116231
+ var import_node_crypto92 = require("node:crypto");
116403
116232
  var import_node_fs148 = __toESM(require("node:fs"), 1);
116404
116233
  var import_node_path152 = __toESM(require("node:path"), 1);
116405
116234
 
@@ -116531,10 +116360,10 @@ function stageHostBytes(bytes, origin, extension = "") {
116531
116360
  }
116532
116361
  async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
116533
116362
  const directory2 = prepareStagedDirectory();
116534
- const inputDigest = (0, import_node_crypto93.createHash)("sha256").update(input).digest("hex");
116363
+ const inputDigest = (0, import_node_crypto92.createHash)("sha256").update(input).digest("hex");
116535
116364
  const index = import_node_path152.default.join(
116536
116365
  directory2,
116537
- `derived-${(0, import_node_crypto93.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
116366
+ `derived-${(0, import_node_crypto92.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
116538
116367
  );
116539
116368
  const recorded = import_node_fs148.default.existsSync(index) ? import_node_fs148.default.readFileSync(index, "utf8") : "";
116540
116369
  if (STAGED_NAME.test(recorded) && import_node_fs148.default.existsSync(import_node_path152.default.join(directory2, recorded))) {
@@ -116545,7 +116374,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
116545
116374
  return new URL(STAGED_PREFIX + recorded, origin).toString();
116546
116375
  }
116547
116376
  const staged = writeStagedBytes(await derive(), origin, extension, directory2);
116548
- const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto93.randomUUID)());
116377
+ const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto92.randomUUID)());
116549
116378
  try {
116550
116379
  import_node_fs148.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
116551
116380
  flag: "wx"
@@ -116570,7 +116399,7 @@ function prepareStagedDirectory() {
116570
116399
  return directory2;
116571
116400
  }
116572
116401
  function writeStagedBytes(bytes, origin, extension, directory2) {
116573
- const digest3 = (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex");
116402
+ const digest3 = (0, import_node_crypto92.createHash)("sha256").update(bytes).digest("hex");
116574
116403
  extension = extension.toLowerCase();
116575
116404
  const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
116576
116405
  stagedCapture.getStore()?.add(name3);
@@ -116579,7 +116408,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
116579
116408
  if (import_node_fs148.default.existsSync(destination)) {
116580
116409
  import_node_fs148.default.utimesSync(destination, new Date(now), new Date(now));
116581
116410
  } else {
116582
- const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto93.randomUUID)());
116411
+ const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto92.randomUUID)());
116583
116412
  try {
116584
116413
  import_node_fs148.default.writeFileSync(temporary, bytes, { flag: "wx" });
116585
116414
  import_node_fs148.default.renameSync(temporary, destination);
@@ -116876,7 +116705,7 @@ async function discoverProjectOneNativeAppCatalog(projectRoot, assetOrigin) {
116876
116705
  }
116877
116706
 
116878
116707
  // src/bundle-channel.mjs
116879
- var digest2 = (bytes) => (0, import_node_crypto94.createHash)("sha256").update(bytes).digest("hex");
116708
+ var digest2 = (bytes) => (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex");
116880
116709
  var segment2 = /^[a-zA-Z0-9._-]+$/;
116881
116710
  function packagedAssetDirectory(location) {
116882
116711
  const parsed2 = new URL(location, "https://packaged.invalid");
@@ -116982,7 +116811,7 @@ async function prepareChannel({
116982
116811
  files2.set(asset.path, asset.bytes);
116983
116812
  }
116984
116813
  }
116985
- const identity2 = (0, import_node_crypto94.createHash)("sha256").update(bundle).update(icon);
116814
+ const identity2 = (0, import_node_crypto93.createHash)("sha256").update(bundle).update(icon);
116986
116815
  for (const [path145, bytes] of [...files2].sort(
116987
116816
  ([a], [b]) => a < b ? -1 : a > b ? 1 : 0
116988
116817
  )) {