peachsim 0.1.2584 → 0.1.2586

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 (130) 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 +14 -4
  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-ZVZ3OCQ5.mjs → acorn-GZX7I72N.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-HHYIRDUH.mjs → chunk-23ODQDFW.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-6HF6IVRZ.mjs → chunk-2NQ653MF.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-RJNIFR5Q.mjs → chunk-2S4GFU4A.mjs} +12 -12
  30. package/dist-lib/esm-chunks/{chunk-PMAEKUDN.mjs → chunk-3ALM6MH3.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-CXTYIQH4.mjs → chunk-4N3K677S.mjs} +5 -5
  32. package/dist-lib/esm-chunks/{chunk-VIUKS7O4.mjs → chunk-6QSC5ORF.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-IDKMFS7W.mjs → chunk-A4PYBOII.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-GOQIYGJD.mjs → chunk-AMT7A6SA.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-JJ3AI5Y2.mjs → chunk-CXT46CM5.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-ENXDCDUJ.mjs → chunk-D5OLUE6H.mjs} +2 -2
  37. package/dist-lib/esm-chunks/{chunk-RYY3XHOE.mjs → chunk-GNXDPMSC.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-KG72KS7D.mjs → chunk-JDNZ4KFU.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-6LCGYQ3Z.mjs → chunk-JDUEJO43.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-DXUEAJB5.mjs → chunk-MFHGRKID.mjs} +3 -3
  41. package/dist-lib/esm-chunks/{chunk-N6PTRYT5.mjs → chunk-OIURNWXD.mjs} +4 -4
  42. package/dist-lib/esm-chunks/{chunk-3FPE4AWV.mjs → chunk-PVMVYEUD.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-WWYAWBD7.mjs → chunk-QLIN4J63.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-CVDY4GSP.mjs → chunk-RPOSNOAS.mjs} +5 -5
  45. package/dist-lib/esm-chunks/{chunk-W5SRJG3R.mjs → chunk-STMHEKS3.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-5RPUNG6E.mjs → chunk-T3LXU4SX.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-NMYRZ4GT.mjs → chunk-TOCNIZDB.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-HEG3RAXL.mjs → chunk-YZPTYPTS.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{metro-layout-parser-VG2C6B5W.mjs → metro-layout-parser-4VKBSVGW.mjs} +3 -3
  50. package/dist-lib/esm-chunks/{swift-package-prebuilt-7W4NG7RW.mjs → swift-package-prebuilt-6MW2RHLS.mjs} +10 -10
  51. package/dist-lib/esm-chunks/{swift-sdk-app-module-PUXEFZD4.mjs → swift-sdk-app-module-BDRIO5G5.mjs} +14 -14
  52. package/dist-lib/esm-chunks/{swift-sdk-image-GGYEV75P.mjs → swift-sdk-image-S5O2DK3W.mjs} +14 -14
  53. package/dist-lib/esm-chunks/{swift-sdk-image-producer-EWBJ4A2A.mjs → swift-sdk-image-producer-FFLEV6OE.mjs} +4 -4
  54. package/dist-lib/expo-swift-bundle.cjs +13 -3
  55. package/dist-lib/expo-swift-metadata.cjs +1 -1
  56. package/dist-lib/expo-swift-metadata.mjs +7 -7
  57. package/dist-lib/home-paths.cjs +1 -1
  58. package/dist-lib/host/bridge-host.cjs +1088 -816
  59. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  60. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  61. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  62. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  63. package/dist-lib/host/websocket-proxy.cjs +1 -1
  64. package/dist-lib/index.cjs +1 -1
  65. package/dist-lib/kotlin-host.cjs +1 -1
  66. package/dist-lib/menu.cjs +1 -1
  67. package/dist-lib/menu.mjs +3 -3
  68. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  69. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  70. package/dist-lib/metro-production-bundle.cjs +1 -1
  71. package/dist-lib/metro-production-bundle.mjs +4 -4
  72. package/dist-lib/native-app-identity-project.cjs +1 -1
  73. package/dist-lib/native-app-identity-project.mjs +16 -16
  74. package/dist-lib/native-app-identity.cjs +1 -1
  75. package/dist-lib/native-app-identity.mjs +6 -6
  76. package/dist-lib/native-firebase-metadata.cjs +1 -1
  77. package/dist-lib/native-firebase-metadata.mjs +3 -3
  78. package/dist-lib/pdfium-raster.cjs +1 -1
  79. package/dist-lib/pdfium-raster.mjs +2 -2
  80. package/dist-lib/plist.cjs +1 -1
  81. package/dist-lib/plist.mjs +3 -3
  82. package/dist-lib/profiles.cjs +1 -1
  83. package/dist-lib/public-brand.cjs +1 -1
  84. package/dist-lib/public-origins-lib-esm.json +81 -81
  85. package/dist-lib/public-origins-lib.json +71 -69
  86. package/dist-lib/react-native-host-modules.cjs +1 -1
  87. package/dist-lib/react-native-host-modules.mjs +2 -2
  88. package/dist-lib/reap-browser.cjs +1 -1
  89. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  90. package/dist-lib/sdk.cjs +1 -1
  91. package/dist-lib/sdk.mjs +8 -8
  92. package/dist-lib/skills.cjs +1512 -1240
  93. package/dist-lib/swift-compile.cjs +1 -1
  94. package/dist-lib/swift-compile.mjs +10 -10
  95. package/dist-lib/swift-package.cjs +1 -1
  96. package/dist-lib/swift-package.mjs +3 -3
  97. package/dist-lib/swift-submit.cjs +1 -1
  98. package/dist-lib/swift-submit.mjs +6 -6
  99. package/dist-lib/swift-svg-raster.cjs +1 -1
  100. package/dist-lib/swift-svg-raster.mjs +2 -2
  101. package/dist-lib/swift-toolchain.cjs +1 -1
  102. package/dist-lib/swift.cjs +1 -1
  103. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  104. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  105. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  106. package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
  107. package/dist-lib/vendor/acorn.cjs +1 -1
  108. package/dist-lib/vendor/bplist-parser.cjs +1 -1
  109. package/dist-lib/vendor/ignore.cjs +1 -1
  110. package/dist-lib/vendor/magic-string.cjs +1 -1
  111. package/dist-lib/vendor/plist.cjs +1 -1
  112. package/dist-lib/vendor/smol-toml.cjs +1 -1
  113. package/dist-lib/vendor/stream-json.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  116. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  117. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  118. package/dist-lib/vendor/sucrase.cjs +1 -1
  119. package/dist-lib/vendor/terser.cjs +1 -1
  120. package/dist-lib/vendor/valibot.cjs +1 -1
  121. package/dist-lib/vendor/ws.cjs +1 -1
  122. package/dist-lib/vendor/zod.cjs +1 -1
  123. package/dist-lib/worklet-executable.cjs +1 -1
  124. package/dist-lib/worklet-executable.mjs +3 -3
  125. package/package.json +1 -1
  126. package/src/one-native-controls-package.ts +86 -43
  127. package/src/one-native-source.ts +7 -0
  128. package/src/swift-sdk-later-data.ts +30 -11
  129. package/src/swift-startup-split.ts +1 -1
  130. package/src/swift-wasm64-native-source.ts +10 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2584 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2586 | (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;
@@ -1142,9 +1142,9 @@ function compareSemver(a, b) {
1142
1142
  const hyphen = v10.indexOf("-");
1143
1143
  const core = hyphen >= 0 ? v10.slice(0, hyphen) : v10;
1144
1144
  const pre = hyphen >= 0 ? v10.slice(hyphen + 1) : "";
1145
- const parts = core.split(".").map((n) => Number.parseInt(n, 10));
1146
- if (parts.some((n) => !Number.isFinite(n))) return [[Number.POSITIVE_INFINITY], v10];
1147
- return [parts, pre];
1145
+ const parts2 = core.split(".").map((n) => Number.parseInt(n, 10));
1146
+ if (parts2.some((n) => !Number.isFinite(n))) return [[Number.POSITIVE_INFINITY], v10];
1147
+ return [parts2, pre];
1148
1148
  };
1149
1149
  const [an, ap] = parse17(a);
1150
1150
  const [bn, bp] = parse17(b);
@@ -2026,9 +2026,9 @@ function serveRuntimeFile(req, res, fullPath) {
2026
2026
  sendFileWithRanges(req, res, fullPath, stat2.size, {});
2027
2027
  }
2028
2028
  function runtimeFileRange(header, total) {
2029
- const parts = /^bytes=(\d*)-(\d*)$/.exec(header ?? "");
2030
- if (!parts) return;
2031
- const [, startRaw, endRaw] = parts;
2029
+ const parts2 = /^bytes=(\d*)-(\d*)$/.exec(header ?? "");
2030
+ if (!parts2) return;
2031
+ const [, startRaw, endRaw] = parts2;
2032
2032
  if (!startRaw && !endRaw || startRaw && endRaw && Number(endRaw) < Number(startRaw))
2033
2033
  return;
2034
2034
  const start = startRaw ? Number(startRaw) : Math.max(0, total - Number(endRaw));
@@ -3629,15 +3629,15 @@ async function settingsBundleFingerprint(bundlePath) {
3629
3629
  const entries2 = await (0, import_promises3.readdir)(bundlePath, { withFileTypes: true });
3630
3630
  const names = entries2.filter((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".plist")).map((entry) => entry.name).sort().slice(0, MAX_PLIST_FILES + 1);
3631
3631
  if (names.length === 0 || names.length > MAX_PLIST_FILES) return null;
3632
- const parts = await Promise.all(
3632
+ const parts2 = await Promise.all(
3633
3633
  names.map(async (name3) => {
3634
3634
  const metadata = await (0, import_promises3.stat)((0, import_node_path10.join)(bundlePath, name3));
3635
3635
  if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
3636
3636
  return `${name3}:${metadata.size}:${metadata.mtimeMs}:${metadata.ctimeMs}`;
3637
3637
  })
3638
3638
  );
3639
- if (parts.some((part) => part === null)) return null;
3640
- return parts.join("|");
3639
+ if (parts2.some((part) => part === null)) return null;
3640
+ return parts2.join("|");
3641
3641
  } catch {
3642
3642
  return null;
3643
3643
  }
@@ -5182,9 +5182,9 @@ var init_fetch_proxy_overrides = __esm({
5182
5182
  // src/dns-over-https.ts
5183
5183
  function parseIpLiteral(text7) {
5184
5184
  if (text7.includes(":")) return parseIpv6(text7);
5185
- const parts = text7.split(".");
5186
- if (parts.length !== 4 || !parts.every((part) => /^\d{1,3}$/.test(part))) return null;
5187
- const bytes = parts.map(Number);
5185
+ const parts2 = text7.split(".");
5186
+ if (parts2.length !== 4 || !parts2.every((part) => /^\d{1,3}$/.test(part))) return null;
5187
+ const bytes = parts2.map(Number);
5188
5188
  return bytes.every((byte) => byte <= 255) ? bytes : null;
5189
5189
  }
5190
5190
  function parseIpv6(text7) {
@@ -5518,8 +5518,8 @@ var init_autolinker_process = __esm({
5518
5518
  function autolinkerAppleFlags(autolinkerManifest, appRoot) {
5519
5519
  const manifest = JSON.parse(import_node_fs20.default.readFileSync(autolinkerManifest, "utf8"));
5520
5520
  const version2 = manifest && typeof manifest === "object" && Reflect.get(manifest, "version");
5521
- const parts = typeof version2 === "string" ? version2.split(".").map((part) => Number.parseInt(part, 10)) : [];
5522
- const [major, minor, patch] = parts;
5521
+ const parts2 = typeof version2 === "string" ? version2.split(".").map((part) => Number.parseInt(part, 10)) : [];
5522
+ const [major, minor, patch] = parts2;
5523
5523
  if (!Number.isInteger(major) || !Number.isInteger(minor) || !Number.isInteger(patch))
5524
5524
  throw new Error(
5525
5525
  `unreadable expo-modules-autolinking version in ${autolinkerManifest}`
@@ -5712,13 +5712,13 @@ var init_swift_standin_digest = __esm({
5712
5712
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
5713
5713
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
5714
5714
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
5715
- STANDIN_SOURCE_DIGEST = true ? "71ef9e61c61864dff0c32a00c95b9af8ae0dad6aca6b7f511d8ac998fc3304f7" : standinSourceDigest();
5715
+ STANDIN_SOURCE_DIGEST = true ? "f9c7192135f0d9ee6cc78cbd2401aa19d73d0b5e5e6b3138b21fcbc7c062213f" : standinSourceDigest();
5716
5716
  }
5717
5717
  });
5718
5718
 
5719
5719
  // src/expo-native-compiler-digest.ts
5720
5720
  function expoNativeCompilerDigestValue() {
5721
- return true ? "8bd2709578fdbd4f5b99d8584f8a0a813cdcb6e42b3100bb518ec29b99081407" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
5721
+ return true ? "af47be4907da44ab4fd386094b725e7b59e01c2cd6598d604074664c01c5f649" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
5722
5722
  }
5723
5723
  var import_node_crypto11;
5724
5724
  var init_expo_native_compiler_digest = __esm({
@@ -7290,24 +7290,24 @@ function stringMethod(interp, self, call, env) {
7290
7290
  return i < 0 ? null : i;
7291
7291
  }
7292
7292
  case "split": {
7293
- let parts;
7293
+ let parts2;
7294
7294
  if (a === void 0 || a === null || a instanceof RString && a.s === " ")
7295
- parts = s.trim().split(/\s+/).filter((x, i, all) => x !== "" || all.length > 1);
7296
- else if (a instanceof RRegexp) parts = s.split(new RegExp(a.re.source, a.re.flags));
7297
- else parts = s.split(strArg(interp, a));
7295
+ parts2 = s.trim().split(/\s+/).filter((x, i, all) => x !== "" || all.length > 1);
7296
+ else if (a instanceof RRegexp) parts2 = s.split(new RegExp(a.re.source, a.re.flags));
7297
+ else parts2 = s.split(strArg(interp, a));
7298
7298
  if (b !== void 0) {
7299
7299
  const limit = intArg(interp, b);
7300
- if (limit > 0 && parts.length > limit) {
7300
+ if (limit > 0 && parts2.length > limit) {
7301
7301
  const separator = a instanceof RString ? a.s : null;
7302
7302
  if (separator === null)
7303
7303
  throw new UnsupportedRuby("split with a limit and a non-string separator");
7304
- parts = [...parts.slice(0, limit - 1), parts.slice(limit - 1).join(separator)];
7304
+ parts2 = [...parts2.slice(0, limit - 1), parts2.slice(limit - 1).join(separator)];
7305
7305
  }
7306
7306
  if (limit === 0)
7307
- while (parts.length && parts[parts.length - 1] === "") parts.pop();
7308
- } else while (parts.length && parts[parts.length - 1] === "") parts.pop();
7309
- if (s === "") parts = [];
7310
- return parts.map(str);
7307
+ while (parts2.length && parts2[parts2.length - 1] === "") parts2.pop();
7308
+ } else while (parts2.length && parts2[parts2.length - 1] === "") parts2.pop();
7309
+ if (s === "") parts2 = [];
7310
+ return parts2.map(str);
7311
7311
  }
7312
7312
  case "sub":
7313
7313
  return str(stringSub(interp, s, call, false));
@@ -7877,8 +7877,8 @@ function arrayMethod(interp, self, call, env) {
7877
7877
  return Array.from({ length: intArg(interp, a) }, () => self).flat();
7878
7878
  case "join": {
7879
7879
  const sep3 = a === void 0 || a === null ? "" : strArg(interp, a);
7880
- const join29 = (values) => values.map((v10) => Array.isArray(v10) ? join29(v10) : interp.toS(v10, env)).join(sep3);
7881
- return str(join29(self));
7880
+ const join30 = (values) => values.map((v10) => Array.isArray(v10) ? join30(v10) : interp.toS(v10, env)).join(sep3);
7881
+ return str(join30(self));
7882
7882
  }
7883
7883
  case "compact":
7884
7884
  return self.filter((v10) => v10 !== null);
@@ -10462,9 +10462,9 @@ var init_podspec_ruby = __esm({
10462
10462
  if (self instanceof RObject || self instanceof RModule) return self.ivars;
10463
10463
  throw new UnsupportedRuby("instance variables on a builtin value");
10464
10464
  }
10465
- interpolate(parts, env, regexp = false) {
10465
+ interpolate(parts2, env, regexp = false) {
10466
10466
  let out = "";
10467
- for (const part of parts) {
10467
+ for (const part of parts2) {
10468
10468
  if (part instanceof N.StringNode)
10469
10469
  out += regexp ? sourceOfRegexpPart(part) : part.unescaped.value;
10470
10470
  else {
@@ -11538,9 +11538,9 @@ function text(interp, value) {
11538
11538
  function expandHome(p) {
11539
11539
  return p === "~" || p.startsWith("~/") ? import_node_path30.default.join(import_node_os7.default.homedir(), p.slice(1)) : p;
11540
11540
  }
11541
- function joinPaths(parts) {
11541
+ function joinPaths(parts2) {
11542
11542
  let out = "";
11543
- parts.forEach((part, index) => {
11543
+ parts2.forEach((part, index) => {
11544
11544
  if (index === 0) {
11545
11545
  out = part;
11546
11546
  return;
@@ -11624,7 +11624,7 @@ function rubyGlob(pattern, base2, dotMatch = false) {
11624
11624
  return;
11625
11625
  }
11626
11626
  const segment2 = segments[index];
11627
- const join29 = (name3) => shown === "" ? name3 : shown.endsWith("/") ? shown + name3 : `${shown}/${name3}`;
11627
+ const join30 = (name3) => shown === "" ? name3 : shown.endsWith("/") ? shown + name3 : `${shown}/${name3}`;
11628
11628
  if (segment2 === "" && index === 0) {
11629
11629
  walk4("/", "/", index + 1);
11630
11630
  return;
@@ -11640,14 +11640,14 @@ function rubyGlob(pattern, base2, dotMatch = false) {
11640
11640
  for (const entry of entries2.sort((a, b) => a.name < b.name ? -1 : 1)) {
11641
11641
  if (!dotMatch && entry.name.startsWith(".")) continue;
11642
11642
  if (entry.isDirectory())
11643
- walk4(import_node_path30.default.join(dir, entry.name), join29(entry.name), index);
11643
+ walk4(import_node_path30.default.join(dir, entry.name), join30(entry.name), index);
11644
11644
  }
11645
11645
  return;
11646
11646
  }
11647
11647
  if (!/[*?[{\\]/.test(segment2)) {
11648
11648
  const next = import_node_path30.default.join(dir, segment2);
11649
11649
  if (index === segments.length - 1 ? import_node_fs32.default.existsSync(next) : isDirectory(next))
11650
- walk4(next, join29(segment2), index + 1);
11650
+ walk4(next, join30(segment2), index + 1);
11651
11651
  return;
11652
11652
  }
11653
11653
  const matcher = segmentMatcher(segment2, dotMatch);
@@ -11661,7 +11661,7 @@ function rubyGlob(pattern, base2, dotMatch = false) {
11661
11661
  if (!matcher.test(name3)) continue;
11662
11662
  const next = import_node_path30.default.join(dir, name3);
11663
11663
  if (index < segments.length - 1 && !isDirectory(next)) continue;
11664
- walk4(next, join29(name3), index + 1);
11664
+ walk4(next, join30(name3), index + 1);
11665
11665
  }
11666
11666
  };
11667
11667
  walk4(absolute ? "/" : base2, "", absolute ? 1 : 0);
@@ -12286,9 +12286,9 @@ function installStdlib(interp) {
12286
12286
  for (const name3 of ["escape", "quote"])
12287
12287
  def(regexp, name3, (c) => str(escapeRegexp(text(interp, c.args[0]))));
12288
12288
  def(regexp, "union", (c) => {
12289
- const parts = c.args.length === 1 && Array.isArray(c.args[0]) ? c.args[0] : c.args;
12290
- if (parts.length === 1 && parts[0] instanceof RRegexp) return parts[0];
12291
- const sources = parts.map((part) => {
12289
+ const parts2 = c.args.length === 1 && Array.isArray(c.args[0]) ? c.args[0] : c.args;
12290
+ if (parts2.length === 1 && parts2[0] instanceof RRegexp) return parts2[0];
12291
+ const sources = parts2.map((part) => {
12292
12292
  if (!(part instanceof RRegexp)) return escapeRegexp(text(interp, part));
12293
12293
  if (part.re.flags !== "m")
12294
12294
  throw new UnsupportedRuby(`Regexp.union of /${part.source}/ with options`);
@@ -13520,12 +13520,12 @@ function swiftSdkBundle(swift, id, options2) {
13520
13520
  const key2 = [swift, id, ...options2].join("\0");
13521
13521
  const known = sdkBundles.get(key2);
13522
13522
  if (known && import_node_fs35.default.existsSync(known)) return known;
13523
- const configuration = (0, import_node_child_process12.execFileSync)(
13523
+ const configuration2 = (0, import_node_child_process12.execFileSync)(
13524
13524
  swift,
13525
13525
  ["sdk", "configure", ...options2, "--show-configuration", id, SWIFT_WASM_TRIPLE],
13526
13526
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
13527
13527
  );
13528
- const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration)?.[1]?.trim();
13528
+ const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration2)?.[1]?.trim();
13529
13529
  if (!sysroot || !import_node_path33.default.isAbsolute(sysroot))
13530
13530
  throw new Error(`Swift SDK ${id} reports no absolute sdkRootPath`);
13531
13531
  let bundle = sysroot;
@@ -15036,7 +15036,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
15036
15036
  const symbols = [];
15037
15037
  const relationships = [];
15038
15038
  const scopeOf = (name3, enclosing, extensionScope) => extensionScope ? name3.split(".").filter(
15039
- (part, index, parts) => !(index === 0 && parts.length > 1 && part === module2)
15039
+ (part, index, parts2) => !(index === 0 && parts2.length > 1 && part === module2)
15040
15040
  ) : [...enclosing, name3];
15041
15041
  const scopePattern = /^\s*((?:@\w+(?:\([^)]*\))?\s+)*)((?:\w+\s+)*?)(extension|class|struct|enum|protocol|actor)\s+([A-Za-z_][\w.]*)/;
15042
15042
  const lines = interfaceText.split("\n");
@@ -15206,7 +15206,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
15206
15206
  return { module: { name: module2 }, symbols, relationships };
15207
15207
  }
15208
15208
  function splitTopLevel(text7, separator) {
15209
- const parts = [];
15209
+ const parts2 = [];
15210
15210
  let depth = 0;
15211
15211
  let start = 0;
15212
15212
  for (let index = 0; index < text7.length; index++) {
@@ -15214,12 +15214,12 @@ function splitTopLevel(text7, separator) {
15214
15214
  if (char === "(" || char === "[" || char === "<") depth++;
15215
15215
  else if (char === ")" || char === "]" || char === ">") depth--;
15216
15216
  else if (char === separator && depth === 0) {
15217
- parts.push(text7.slice(start, index));
15217
+ parts2.push(text7.slice(start, index));
15218
15218
  start = index + 1;
15219
15219
  }
15220
15220
  }
15221
- parts.push(text7.slice(start));
15222
- return parts;
15221
+ parts2.push(text7.slice(start));
15222
+ return parts2;
15223
15223
  }
15224
15224
  function emitSwiftStandin(sourceGraphs, options2) {
15225
15225
  const imported = new Set(options2.imports);
@@ -15301,12 +15301,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
15301
15301
  const local = byId.get(id);
15302
15302
  if (local) return { name: pathOf(local), local: true };
15303
15303
  if (!fallback) return null;
15304
- const parts = fallback.split(".");
15305
- const module2 = parts[0] === "SwiftUICore" ? "SwiftUI" : parts[0];
15306
- const unqualified = parts.slice(1).join(".") || parts[0];
15307
- const name3 = parts.length > 1 && family.has(parts[0]) && parts[0] !== "SwiftUICore" ? (
15304
+ const parts2 = fallback.split(".");
15305
+ const module2 = parts2[0] === "SwiftUICore" ? "SwiftUI" : parts2[0];
15306
+ const unqualified = parts2.slice(1).join(".") || parts2[0];
15307
+ const name3 = parts2.length > 1 && family.has(parts2[0]) && parts2[0] !== "SwiftUICore" ? (
15308
15308
  // a module selector reaches past a class named like its module
15309
- `${parts[0]}::${unqualified}`
15309
+ `${parts2[0]}::${unqualified}`
15310
15310
  ) : unqualified;
15311
15311
  return { name: name3, module: module2, local: false };
15312
15312
  };
@@ -15446,7 +15446,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
15446
15446
  };
15447
15447
  const structBuilds = (id) => !omit.has(hiddenInit(id));
15448
15448
  const splitTop = (list2) => {
15449
- const parts = [];
15449
+ const parts2 = [];
15450
15450
  let depth = 0;
15451
15451
  let start = 0;
15452
15452
  for (let at = 0; at < list2.length; at++) {
@@ -15454,12 +15454,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
15454
15454
  if (char === "(" || char === "[" || char === "<") depth++;
15455
15455
  if (char === ")" || char === "]" || char === ">" && list2[at - 1] !== "-") depth--;
15456
15456
  if (char === "," && depth === 0) {
15457
- parts.push(list2.slice(start, at).trim());
15457
+ parts2.push(list2.slice(start, at).trim());
15458
15458
  start = at + 1;
15459
15459
  }
15460
15460
  }
15461
15461
  const last = list2.slice(start).trim();
15462
- return last ? [...parts, last] : parts;
15462
+ return last ? [...parts2, last] : parts2;
15463
15463
  };
15464
15464
  const building2 = [];
15465
15465
  const inertValue = (type, generics, scope2) => {
@@ -16643,9 +16643,9 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
16643
16643
  ];
16644
16644
  }
16645
16645
  function iosDeploymentMinimum(version2) {
16646
- const parts = /^(\d{1,2})(?:\.(\d{1,2}))?(?:\.(\d{1,2}))?$/.exec(version2 ?? "");
16647
- if (!parts) return void 0;
16648
- return Number(parts[1]) * 1e4 + Number(parts[2] ?? 0) * 100 + Number(parts[3] ?? 0);
16646
+ const parts2 = /^(\d{1,2})(?:\.(\d{1,2}))?(?:\.(\d{1,2}))?$/.exec(version2 ?? "");
16647
+ if (!parts2) return void 0;
16648
+ return Number(parts2[1]) * 1e4 + Number(parts2[2] ?? 0) * 100 + Number(parts2[3] ?? 0);
16649
16649
  }
16650
16650
  function moduleMapHeaders(modulemap, directoryHeaders) {
16651
16651
  const tokens2 = moduleMapTokens(import_node_fs36.default.readFileSync(modulemap, "utf8"));
@@ -19151,20 +19151,20 @@ function podspecLibrarySpecs(spec) {
19151
19151
  function podspecMembers(spec, requested = [""]) {
19152
19152
  const selected = /* @__PURE__ */ new Set();
19153
19153
  const visited = /* @__PURE__ */ new Set();
19154
- const select = (parts) => {
19155
- const key2 = parts.join("/");
19154
+ const select = (parts2) => {
19155
+ const key2 = parts2.join("/");
19156
19156
  if (visited.has(key2)) return;
19157
19157
  visited.add(key2);
19158
19158
  let current2 = spec;
19159
19159
  const chain = [spec];
19160
- for (const part of parts) {
19160
+ for (const part of parts2) {
19161
19161
  current2 = podspecSubspec(current2, part);
19162
19162
  chain.push(current2);
19163
19163
  }
19164
19164
  chain.forEach((member) => selected.add(member));
19165
19165
  const defaults = strings(current2, "default_subspecs");
19166
19166
  const children = defaults[0] === "none" ? [] : defaults.length ? defaults : current2.subspecs.map((child) => podspecName(child));
19167
- for (const child of children) select([...parts, ...child.split("/")]);
19167
+ for (const child of children) select([...parts2, ...child.split("/")]);
19168
19168
  for (const member of chain) {
19169
19169
  const dependencies = import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.string())).parse(member.attrs.get("dependencies") ?? {});
19170
19170
  for (const name3 of Object.keys(dependencies)) {
@@ -22008,26 +22008,26 @@ var init_directives = __esm({
22008
22008
  this.tags = Object.assign({}, _Directives.defaultTags);
22009
22009
  this.atNextDocument = false;
22010
22010
  }
22011
- const parts = line.trim().split(/[ \t]+/);
22012
- const name3 = parts.shift();
22011
+ const parts2 = line.trim().split(/[ \t]+/);
22012
+ const name3 = parts2.shift();
22013
22013
  switch (name3) {
22014
22014
  case "%TAG": {
22015
- if (parts.length !== 2) {
22015
+ if (parts2.length !== 2) {
22016
22016
  onError(0, "%TAG directive should contain exactly two parts");
22017
- if (parts.length < 2)
22017
+ if (parts2.length < 2)
22018
22018
  return false;
22019
22019
  }
22020
- const [handle, prefix] = parts;
22020
+ const [handle, prefix] = parts2;
22021
22021
  this.tags[handle] = prefix;
22022
22022
  return true;
22023
22023
  }
22024
22024
  case "%YAML": {
22025
22025
  this.yaml.explicit = true;
22026
- if (parts.length !== 1) {
22026
+ if (parts2.length !== 1) {
22027
22027
  onError(0, "%YAML directive should contain exactly one part");
22028
22028
  return false;
22029
22029
  }
22030
- const [version2] = parts;
22030
+ const [version2] = parts2;
22031
22031
  if (version2 === "1.1" || version2 === "1.2") {
22032
22032
  this.yaml.version = version2;
22033
22033
  return true;
@@ -24666,9 +24666,9 @@ var init_set = __esm({
24666
24666
  // ../../node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
24667
24667
  function parseSexagesimal(str3, asBigInt) {
24668
24668
  const sign = str3[0];
24669
- const parts = sign === "-" || sign === "+" ? str3.substring(1) : str3;
24669
+ const parts2 = sign === "-" || sign === "+" ? str3.substring(1) : str3;
24670
24670
  const num = (n) => asBigInt ? BigInt(n) : Number(n);
24671
- const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
24671
+ const res = parts2.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
24672
24672
  return sign === "-" ? num(-1) * res : res;
24673
24673
  }
24674
24674
  function stringifySexagesimal(node) {
@@ -24684,18 +24684,18 @@ function stringifySexagesimal(node) {
24684
24684
  value *= num(-1);
24685
24685
  }
24686
24686
  const _60 = num(60);
24687
- const parts = [value % _60];
24687
+ const parts2 = [value % _60];
24688
24688
  if (value < 60) {
24689
- parts.unshift(0);
24689
+ parts2.unshift(0);
24690
24690
  } else {
24691
- value = (value - parts[0]) / _60;
24692
- parts.unshift(value % _60);
24691
+ value = (value - parts2[0]) / _60;
24692
+ parts2.unshift(value % _60);
24693
24693
  if (value >= 60) {
24694
- value = (value - parts[0]) / _60;
24695
- parts.unshift(value);
24694
+ value = (value - parts2[0]) / _60;
24695
+ parts2.unshift(value);
24696
24696
  }
24697
24697
  }
24698
- return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
24698
+ return sign + parts2.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
24699
24699
  }
24700
24700
  var intTime, floatTime, timestamp;
24701
24701
  var init_timestamp = __esm({
@@ -29540,11 +29540,11 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
29540
29540
  }
29541
29541
  }
29542
29542
  const lines = [...blocks].map(([owner, { modules, views }]) => {
29543
- const parts = [
29543
+ const parts2 = [
29544
29544
  modules.length ? `modules: { ${modules.join(", ")} }` : "",
29545
29545
  views.length ? `views: { ${views.join(", ")} }` : ""
29546
29546
  ].filter(Boolean);
29547
- return ` [${JSON.stringify(owner)}]: { ${parts.join(", ")} },`;
29547
+ return ` [${JSON.stringify(owner)}]: { ${parts2.join(", ")} },`;
29548
29548
  });
29549
29549
  if (lines.length && kept.length)
29550
29550
  return [
@@ -31320,8 +31320,8 @@ var init_storeKitContract = __esm({
31320
31320
  });
31321
31321
 
31322
31322
  // src/storekit-test-store.ts
31323
- async function loadStoreKitTestStore(configuration, appDir) {
31324
- const catalog = readStoreKitCatalog(JSON.parse(await (0, import_promises8.readFile)(configuration, "utf8")));
31323
+ async function loadStoreKitTestStore(configuration2, appDir) {
31324
+ const catalog = readStoreKitCatalog(JSON.parse(await (0, import_promises8.readFile)(configuration2, "utf8")));
31325
31325
  const identityPath = import_node_path44.default.join(
31326
31326
  cacheDir(),
31327
31327
  "storekit-identities",
@@ -31553,20 +31553,20 @@ async function workspaceExclusion(root, portable = false, linkedPackages = []) {
31553
31553
  env: gitEnvironment()
31554
31554
  }).catch(() => ({ stdout: "" }));
31555
31555
  for (const entry of cached4.stdout.split("\0").filter(Boolean)) {
31556
- const parts = entry.split("/");
31557
- for (let index = 1; index <= parts.length; index++)
31558
- tracked.add(parts.slice(0, index).join(import_node_path46.default.sep));
31556
+ const parts2 = entry.split("/");
31557
+ for (let index = 1; index <= parts2.length; index++)
31558
+ tracked.add(parts2.slice(0, index).join(import_node_path46.default.sep));
31559
31559
  }
31560
31560
  }
31561
31561
  const ignoredByRules = gitignoreRules(root);
31562
31562
  return (relative5, knownDirectory) => {
31563
- const parts = relative5.split(import_node_path46.default.sep);
31563
+ const parts2 = relative5.split(import_node_path46.default.sep);
31564
31564
  const linked = linkedPackages.some(
31565
31565
  (directory2) => relative5.startsWith(directory2 + import_node_path46.default.sep)
31566
31566
  );
31567
31567
  if (linked) {
31568
31568
  return ["node_modules", ".git", ".expo", ".one"].some(
31569
- (name3) => parts.includes(name3)
31569
+ (name3) => parts2.includes(name3)
31570
31570
  );
31571
31571
  }
31572
31572
  if (portable && relative5 && !tracked.has(relative5) && ignoredByRules(
@@ -31574,7 +31574,7 @@ async function workspaceExclusion(root, portable = false, linkedPackages = []) {
31574
31574
  knownDirectory ?? import_node_fs46.default.lstatSync(import_node_path46.default.join(root, relative5)).isDirectory()
31575
31575
  ))
31576
31576
  return true;
31577
- return ignored.has(parts.join("/")) && !tracked.has(relative5) || parts.includes("node_modules") || parts.includes(".git") || parts.includes(".expo") || parts.includes(".one") || parts.some((name3) => name3 === ".beast-gate" || name3.startsWith(".beast-gate-")) || parts.includes("ios") && (parts.includes("Pods") || parts.includes("build"));
31577
+ return ignored.has(parts2.join("/")) && !tracked.has(relative5) || parts2.includes("node_modules") || parts2.includes(".git") || parts2.includes(".expo") || parts2.includes(".one") || parts2.some((name3) => name3 === ".beast-gate" || name3.startsWith(".beast-gate-")) || parts2.includes("ios") && (parts2.includes("Pods") || parts2.includes("build"));
31578
31578
  };
31579
31579
  }
31580
31580
  async function untrackedIgnored(root, linkedPackages) {
@@ -31591,10 +31591,10 @@ async function untrackedIgnored(root, linkedPackages) {
31591
31591
  function gitignoreRules(root) {
31592
31592
  const ignoreFiles = /* @__PURE__ */ new Map();
31593
31593
  return (relative5, isDirectory5) => {
31594
- const parts = relative5.split(import_node_path46.default.sep);
31594
+ const parts2 = relative5.split(import_node_path46.default.sep);
31595
31595
  let excluded = false;
31596
- for (let index = 0; index < parts.length; index++) {
31597
- const directory2 = parts.slice(0, index).join(import_node_path46.default.sep);
31596
+ for (let index = 0; index < parts2.length; index++) {
31597
+ const directory2 = parts2.slice(0, index).join(import_node_path46.default.sep);
31598
31598
  let rules2 = ignoreFiles.get(directory2);
31599
31599
  if (rules2 === void 0) {
31600
31600
  const file = import_node_path46.default.join(root, directory2, ".gitignore");
@@ -31602,7 +31602,7 @@ function gitignoreRules(root) {
31602
31602
  ignoreFiles.set(directory2, rules2);
31603
31603
  }
31604
31604
  if (!rules2) continue;
31605
- const item = parts.slice(index).join("/");
31605
+ const item = parts2.slice(index).join("/");
31606
31606
  const result = rules2.test(isDirectory5 ? `${item}/` : item);
31607
31607
  if (result.ignored) excluded = true;
31608
31608
  else if (result.unignored) excluded = false;
@@ -32151,10 +32151,10 @@ function normalizeArraySettings(settings, objectVersion) {
32151
32151
  const stripped2 = key2.replace(/\[[^\]]+\]$/, "");
32152
32152
  if (typeof value === "string") {
32153
32153
  if (!arraySettings.has(stripped2)) continue;
32154
- const parts = [...value.matchAll(/ *((['"]?).*?[^\\]\2)(?= |(?![\s\S]))/g)].map(
32154
+ const parts2 = [...value.matchAll(/ *((['"]?).*?[^\\]\2)(?= |(?![\s\S]))/g)].map(
32155
32155
  (match) => match[1]
32156
32156
  );
32157
- if (parts.length > 1) settings[key2] = parts;
32157
+ if (parts2.length > 1) settings[key2] = parts2;
32158
32158
  } else if (Array.isArray(value)) {
32159
32159
  if (value.length > 1 && arraySettings.has(stripped2)) continue;
32160
32160
  settings[key2] = value.map((item) => typeof item === "string" ? item : "").join(" ");
@@ -34695,7 +34695,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
34695
34695
  ]);
34696
34696
  const cached4 = sdkViews.get(key2);
34697
34697
  if (cached4 && import_node_fs51.default.existsSync(cached4.manifest)) return touchSdkView(cached4.options);
34698
- const configuration = (0, import_node_child_process22.execFileSync)(
34698
+ const configuration2 = (0, import_node_child_process22.execFileSync)(
34699
34699
  import_node_path51.default.join(toolchainBin, "swift"),
34700
34700
  [
34701
34701
  "sdk",
@@ -34707,7 +34707,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
34707
34707
  ],
34708
34708
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
34709
34709
  );
34710
- const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration)?.[1]?.trim();
34710
+ const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration2)?.[1]?.trim();
34711
34711
  if (!sysroot || !import_node_path51.default.isAbsolute(sysroot))
34712
34712
  throw new Error(`swift sdk ${sdk2} reports no absolute sdkRootPath`);
34713
34713
  let bundle = sysroot;
@@ -36657,7 +36657,7 @@ function takeGuestStartupData(wasm, address, length) {
36657
36657
  }
36658
36658
  if (covered !== length)
36659
36659
  throw new Error("guest startup data does not initialize the whole range");
36660
- const parts = [result.subarray(0, data[0])];
36660
+ const parts2 = [result.subarray(0, data[0])];
36661
36661
  const payload = [result.subarray(data[1], segments[0].header)];
36662
36662
  for (const [index, segment2] of segments.entries()) {
36663
36663
  if (!emptied.has(index)) {
@@ -36675,8 +36675,8 @@ function takeGuestStartupData(wasm, address, length) {
36675
36675
  }
36676
36676
  size2.push(rest % 128 | 128);
36677
36677
  }
36678
- parts.push(Uint8Array.of(11, ...size2), section2, result.subarray(data[2]));
36679
- return { wasm: Buffer.concat(parts), bytes };
36678
+ parts2.push(Uint8Array.of(11, ...size2), section2, result.subarray(data[2]));
36679
+ return { wasm: Buffer.concat(parts2), bytes };
36680
36680
  }
36681
36681
  var import_node_fs55, import_node_string_decoder, constant;
36682
36682
  var init_swift_guest_linked_spans = __esm({
@@ -37132,11 +37132,11 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
37132
37132
  ]
37133
37133
  ]
37134
37134
  ]);
37135
- const parts = [bytes.subarray(0, 8)];
37135
+ const parts2 = [bytes.subarray(0, 8)];
37136
37136
  for (const s of m.sections) {
37137
37137
  if (s.name === ".swift1_autolink_entries") continue;
37138
37138
  const payload = replaced.get(s.id);
37139
- parts.push(payload ? section(s.id, payload) : bytes.subarray(s.offset, s.end));
37139
+ parts2.push(payload ? section(s.id, payload) : bytes.subarray(s.offset, s.end));
37140
37140
  }
37141
37141
  const address = (name3) => {
37142
37142
  const value = m.global(name3);
@@ -37161,7 +37161,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
37161
37161
  const functionSlots = m.bodies.map(
37162
37162
  (_, ordinal) => m.slots.get(ordinal + m.importedFuncs) ?? 0
37163
37163
  );
37164
- return { image: Buffer.concat(parts), sdkInterface, functionSlots };
37164
+ return { image: Buffer.concat(parts2), sdkInterface, functionSlots };
37165
37165
  }
37166
37166
  function passiveSegments(bytes) {
37167
37167
  const data = wasmSections(bytes).find((s) => s.id === 11);
@@ -40089,8 +40089,8 @@ function primaryFunctionTable(bytes) {
40089
40089
  throw new Error("native primary exports no function table");
40090
40090
  return { name: wasmReader(exported, 0).name(), table64 };
40091
40091
  }
40092
- function vectorSection(id, count, parts) {
40093
- const body = Buffer.concat([Buffer.from(uleb2(count)), ...parts]);
40092
+ function vectorSection(id, count, parts2) {
40093
+ const body = Buffer.concat([Buffer.from(uleb2(count)), ...parts2]);
40094
40094
  return Buffer.concat([Buffer.from([id, ...uleb2(body.length)]), body]);
40095
40095
  }
40096
40096
  function rewriteSections(bytes, sections, changes) {
@@ -40725,7 +40725,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
40725
40725
  offset = stop;
40726
40726
  subsections.push({ kind, content });
40727
40727
  }
40728
- const parts = [encodedString(sectionName), encodeNumber(version2)];
40728
+ const parts2 = [encodedString(sectionName), encodeNumber(version2)];
40729
40729
  for (const subsection of subsections) {
40730
40730
  let content = subsection.content;
40731
40731
  if (subsection.kind === 6 && objcLoader !== void 0) {
@@ -40748,13 +40748,13 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
40748
40748
  throw new Error("invalid init functions subsection");
40749
40749
  content = Buffer.concat(entries2);
40750
40750
  }
40751
- parts.push(
40751
+ parts2.push(
40752
40752
  Buffer.from([subsection.kind]),
40753
40753
  encodeNumber(content.length),
40754
40754
  content
40755
40755
  );
40756
40756
  }
40757
- section2 = Buffer.concat(parts);
40757
+ section2 = Buffer.concat(parts2);
40758
40758
  } else if (!sections && sectionName.startsWith("reloc.")) {
40759
40759
  number4();
40760
40760
  for (let count = number4(); count > 0; count--) {
@@ -41209,14 +41209,14 @@ ${store} call void @__peach_register_guest_tables(ptr @.app_tables)
41209
41209
  }
41210
41210
  function nameGuestImageAliases(wasm, symbols) {
41211
41211
  const alias = /^__peach_image_\d+_symbol_(\d+)$/;
41212
- const parts = [wasm.subarray(0, 8)];
41212
+ const parts2 = [wasm.subarray(0, 8)];
41213
41213
  let position = 8;
41214
41214
  while (position < wasm.length) {
41215
41215
  const [size2, start] = readNumber(wasm, position + 1);
41216
41216
  const end = start + size2;
41217
41217
  const custom = wasm[position] === 0 ? readString(wasm, start) : void 0;
41218
41218
  if (custom?.[0] !== "name") {
41219
- parts.push(wasm.subarray(position, end));
41219
+ parts2.push(wasm.subarray(position, end));
41220
41220
  position = end;
41221
41221
  continue;
41222
41222
  }
@@ -41244,10 +41244,10 @@ function nameGuestImageAliases(wasm, symbols) {
41244
41244
  at = subEnd;
41245
41245
  }
41246
41246
  const section2 = Buffer.concat(subsections);
41247
- parts.push(Buffer.from([0]), encodeNumber(section2.length), section2);
41247
+ parts2.push(Buffer.from([0]), encodeNumber(section2.length), section2);
41248
41248
  position = end;
41249
41249
  }
41250
- return Buffer.concat(parts);
41250
+ return Buffer.concat(parts2);
41251
41251
  }
41252
41252
  var import_node_crypto31, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
41253
41253
  var init_swift_guest_image_ledger = __esm({
@@ -41345,12 +41345,12 @@ function readWasmCustomSection(bytes, name3) {
41345
41345
  return void 0;
41346
41346
  }
41347
41347
  function dropWasmCustomSection(bytes, name3) {
41348
- const parts = [bytes.subarray(0, 8)];
41348
+ const parts2 = [bytes.subarray(0, 8)];
41349
41349
  for (const { id, offset, start, end } of wasmSections2(bytes)) {
41350
41350
  if (id === 0 && readWasmSection(bytes, start, end).name() === name3) continue;
41351
- parts.push(bytes.subarray(offset, end));
41351
+ parts2.push(bytes.subarray(offset, end));
41352
41352
  }
41353
- return Buffer.concat(parts);
41353
+ return Buffer.concat(parts2);
41354
41354
  }
41355
41355
  function writeWasmCustomSection(bytes, name3, data) {
41356
41356
  const section2 = Buffer.concat([Buffer.from(encodeWasmName(name3)), data]);
@@ -41580,16 +41580,16 @@ function hasWasmExport(bytes, name3) {
41580
41580
  return false;
41581
41581
  }
41582
41582
  function withSections(bytes, layout2, replacements) {
41583
- const parts = [bytes.subarray(0, 8)];
41583
+ const parts2 = [bytes.subarray(0, 8)];
41584
41584
  let at = 8;
41585
41585
  for (const section2 of layout2) {
41586
41586
  const body = replacements.get(section2.id);
41587
- parts.push(
41587
+ parts2.push(
41588
41588
  body ? Uint8Array.from([section2.id, ...encodeWasmNumber(body.length), ...body]) : bytes.subarray(at, section2.end)
41589
41589
  );
41590
41590
  at = section2.end;
41591
41591
  }
41592
- return Buffer.concat(parts);
41592
+ return Buffer.concat(parts2);
41593
41593
  }
41594
41594
  function narrowWasmBoundary(bytes, wideExports) {
41595
41595
  const layout2 = wasmSections2(bytes);
@@ -44513,8 +44513,8 @@ function clangIrLinkOptions(ir) {
44513
44513
  if (!/^!\d+$/.test(id)) throw new Error(`invalid clang link metadata ${id}`);
44514
44514
  const node = new RegExp(`^${id} = !\\{([^\\n]*)\\}$`, "m").exec(ir);
44515
44515
  if (!node) throw new Error(`missing clang link metadata ${id}`);
44516
- const parts = node[1].split(/,\s*(?=!")/);
44517
- for (const part of parts) {
44516
+ const parts2 = node[1].split(/,\s*(?=!")/);
44517
+ for (const part of parts2) {
44518
44518
  const value = /^!"((?:[^"\\]|\\[0-9A-Fa-f]{2})*)"$/.exec(part.trim());
44519
44519
  if (!value) throw new Error(`invalid clang link option ${part}`);
44520
44520
  const decoded = value[1].replace(
@@ -46767,9 +46767,9 @@ async function publishedClosure(pkg, version2, stage) {
46767
46767
  for (const entry of listing.files) {
46768
46768
  const name3 = entry.name.slice(1);
46769
46769
  if (!name3.startsWith(`${stage.from}/`)) continue;
46770
- const parts = name3.slice(stage.from.length + 1).split("/");
46771
- const base2 = parts.at(-1) ?? "";
46772
- if (parts.some((part) => part.startsWith(".") || stage.skip.includes(part))) continue;
46770
+ const parts2 = name3.slice(stage.from.length + 1).split("/");
46771
+ const base2 = parts2.at(-1) ?? "";
46772
+ if (parts2.some((part) => part.startsWith(".") || stage.skip.includes(part))) continue;
46773
46773
  if (!keep.test(base2) || base2 === stage.exclude) continue;
46774
46774
  files2[name3] = Buffer.from(entry.hash, "base64").toString("hex");
46775
46775
  }
@@ -48262,11 +48262,11 @@ function sdkLinkInputs(appRoot) {
48262
48262
  const libraries = [];
48263
48263
  const objects = /* @__PURE__ */ new Set();
48264
48264
  const seen = /* @__PURE__ */ new Set();
48265
- const flag = (...parts) => {
48266
- const key2 = parts.join(" ");
48265
+ const flag = (...parts2) => {
48266
+ const key2 = parts2.join(" ");
48267
48267
  if (seen.has(key2)) return;
48268
48268
  seen.add(key2);
48269
- flags.push(...parts);
48269
+ flags.push(...parts2);
48270
48270
  };
48271
48271
  let crt = "";
48272
48272
  for (let i = 0; i < tokens2.length; i++) {
@@ -48671,10 +48671,10 @@ function decodeNativeSdkLater(trailer) {
48671
48671
  at += LATER_DIGEST_BYTES + 4;
48672
48672
  }
48673
48673
  if (!files2.length || at + 4 > trailer.byteLength) throw truncated();
48674
- const parts = view.getUint32(at, true);
48674
+ const parts2 = view.getUint32(at, true);
48675
48675
  at += 4;
48676
48676
  const needs = [];
48677
- for (let part = 0; part < parts; part++) {
48677
+ for (let part = 0; part < parts2; part++) {
48678
48678
  if (at >= trailer.byteLength) throw truncated();
48679
48679
  const n = trailer[at++];
48680
48680
  if (at + n > trailer.byteLength) throw truncated();
@@ -48685,7 +48685,7 @@ function decodeNativeSdkLater(trailer) {
48685
48685
  at += n;
48686
48686
  }
48687
48687
  if (at !== trailer.byteLength) throw new Error("Swift SDK binding has trailing bytes");
48688
- return parts ? { files: files2, needs } : { files: files2 };
48688
+ return parts2 ? { files: files2, needs } : { files: files2 };
48689
48689
  }
48690
48690
  function encodeNativeSdkFixups(triples) {
48691
48691
  if (triples.length % 3) throw new Error("Swift SDK fixups are not triples");
@@ -49489,16 +49489,16 @@ function resolveSdkReferences(source, sdk2, forwarders) {
49489
49489
  sections.find((section2) => section2.id === 10),
49490
49490
  expanded
49491
49491
  ) : void 0;
49492
- const parts = [bytes.subarray(0, 8)];
49492
+ const parts2 = [bytes.subarray(0, 8)];
49493
49493
  for (const s of sections) {
49494
49494
  if (s === tags || s.name === "linking" || s.name?.startsWith("reloc.") || s.name === ".swift1_autolink_entries")
49495
49495
  continue;
49496
49496
  const payload = replaced.get(s.id);
49497
- parts.push(
49497
+ parts2.push(
49498
49498
  s.id === 10 && rebuiltCode ? rebuiltCode : payload ? Uint8Array.from([s.id, ...uleb4(payload.length), ...payload]) : bytes.subarray(s.offset, s.end)
49499
49499
  );
49500
49500
  }
49501
- return { bytes: Buffer.concat(parts), linkage };
49501
+ return { bytes: Buffer.concat(parts2), linkage };
49502
49502
  }
49503
49503
  function expandSdkRelocations(bytes, section2, patches) {
49504
49504
  patches.sort((a, b) => a.at - b.at);
@@ -49513,19 +49513,19 @@ function expandSdkRelocations(bytes, section2, patches) {
49513
49513
  if (!patches[next] || patches[next].at >= end) {
49514
49514
  payload.push(bytes.subarray(start, end));
49515
49515
  } else {
49516
- const parts = [];
49516
+ const parts2 = [];
49517
49517
  let at = r.at;
49518
49518
  for (; patches[next] && patches[next].at < end; next++) {
49519
49519
  const patch = patches[next];
49520
49520
  if (patch.at < at || patch.at + patch.length > end)
49521
49521
  throw new Error("Swift SDK relocations overlap a function boundary");
49522
- parts.push(bytes.subarray(at, patch.at), patch.code);
49522
+ parts2.push(bytes.subarray(at, patch.at), patch.code);
49523
49523
  at = patch.at + patch.length;
49524
49524
  }
49525
- parts.push(bytes.subarray(at, end));
49525
+ parts2.push(bytes.subarray(at, end));
49526
49526
  payload.push(
49527
- Uint8Array.from(uleb4(parts.reduce((size3, part) => size3 + part.length, 0))),
49528
- ...parts
49527
+ Uint8Array.from(uleb4(parts2.reduce((size3, part) => size3 + part.length, 0))),
49528
+ ...parts2
49529
49529
  );
49530
49530
  }
49531
49531
  r.at = end;
@@ -51052,22 +51052,22 @@ function swiftIcuLayout(head, blobBytes) {
51052
51052
  }
51053
51053
  function swiftIcuPack(blob, deflate2) {
51054
51054
  const layout2 = swiftIcuLayout(blob, blob.byteLength);
51055
- const parts = [
51055
+ const parts2 = [
51056
51056
  deflate2(blob.subarray(0, layout2.headBytes)),
51057
51057
  ...layout2.packs.map(([start, end]) => deflate2(blob.subarray(start, end)))
51058
51058
  ];
51059
- const index = new DataView(new ArrayBuffer(16 + parts.length * 4));
51059
+ const index = new DataView(new ArrayBuffer(16 + parts2.length * 4));
51060
51060
  index.setUint32(0, MAGIC, true);
51061
51061
  index.setUint32(4, VERSION, true);
51062
51062
  index.setUint32(8, blob.byteLength, true);
51063
51063
  index.setUint32(12, layout2.packs.length, true);
51064
- parts.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
51064
+ parts2.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
51065
51065
  const packed = new Uint8Array(
51066
- index.byteLength + parts.reduce((total, part) => total + part.byteLength, 0)
51066
+ index.byteLength + parts2.reduce((total, part) => total + part.byteLength, 0)
51067
51067
  );
51068
51068
  packed.set(new Uint8Array(index.buffer));
51069
51069
  let at = index.byteLength;
51070
- for (const part of parts) {
51070
+ for (const part of parts2) {
51071
51071
  packed.set(part, at);
51072
51072
  at += part.byteLength;
51073
51073
  }
@@ -52669,13 +52669,13 @@ function swiftSdkPaths(moduleRoot, toolchainBin, options2 = swiftCompileSdkOptio
52669
52669
  const key2 = JSON.stringify([toolchainBin, sdk2, options2]);
52670
52670
  const cached4 = sdkPaths.get(key2);
52671
52671
  if (cached4) return cached4;
52672
- const configuration = (0, import_node_child_process40.execFileSync)(
52672
+ const configuration2 = (0, import_node_child_process40.execFileSync)(
52673
52673
  import_node_path80.default.join(toolchainBin, "swift"),
52674
52674
  ["sdk", "configure", ...options2, "--show-configuration", sdk2, SWIFT_WASM_TRIPLE],
52675
52675
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
52676
52676
  );
52677
52677
  const field = (name3) => {
52678
- const value = new RegExp(`^${name3}:\\s*(.+)$`, "m").exec(configuration)?.[1]?.trim();
52678
+ const value = new RegExp(`^${name3}:\\s*(.+)$`, "m").exec(configuration2)?.[1]?.trim();
52679
52679
  if (!value) throw new Error(`swift sdk ${sdk2} reports no ${name3}`);
52680
52680
  return value;
52681
52681
  };
@@ -62319,7 +62319,7 @@ var init_pods_targets = __esm({
62319
62319
  return this.fileAccessors.map((fa) => this.#headerMappings(fa, fa.publicHeaders()));
62320
62320
  }
62321
62321
  #recursive = /* @__PURE__ */ new Map();
62322
- recursiveDependentTargets(configuration = null) {
62322
+ recursiveDependentTargets(configuration2 = null) {
62323
62323
  if (this.#recursive.size === 0) {
62324
62324
  const byConfig = this.configVariants.map(
62325
62325
  (config) => {
@@ -62339,8 +62339,8 @@ var init_pods_targets = __esm({
62339
62339
  for (const [config, targets] of byConfig) this.#recursive.set(config, targets);
62340
62340
  this.#recursive.set(null, [...new Set(byConfig.flatMap(([, targets]) => targets))]);
62341
62341
  }
62342
- const found2 = this.#recursive.get(configuration);
62343
- if (!found2) throw new Error(`No configuration ${configuration} for ${this.label}`);
62342
+ const found2 = this.#recursive.get(configuration2);
62343
+ if (!found2) throw new Error(`No configuration ${configuration2} for ${this.label}`);
62344
62344
  return found2;
62345
62345
  }
62346
62346
  configurationBuildDir(dir = CONFIGURATION_BUILD_DIR_VARIABLE) {
@@ -62479,8 +62479,8 @@ var init_pods_targets = __esm({
62479
62479
  get podTargets() {
62480
62480
  return [...new Set([...this.podTargetsForBuildConfiguration.values()].flat())];
62481
62481
  }
62482
- podTargetsFor(configuration) {
62483
- return this.podTargetsForBuildConfiguration.get(configuration) ?? [];
62482
+ podTargetsFor(configuration2) {
62483
+ return this.podTargetsForBuildConfiguration.get(configuration2) ?? [];
62484
62484
  }
62485
62485
  get usesSwift() {
62486
62486
  return this.podTargets.some((target) => target.usesSwift);
@@ -62950,10 +62950,10 @@ var init_pods_build_settings = __esm({
62950
62950
  };
62951
62951
  developerFrameworkSearchPaths = (frameworks) => frameworks.includes("XCTest") || frameworks.includes("SenTestingKit") ? ["$(PLATFORM_DIR)/Developer/Library/Frameworks"] : [];
62952
62952
  PodTargetSettings = class extends BuildSettings {
62953
- constructor(target, configuration, settingsFor, setArcCompatibilityFlag) {
62953
+ constructor(target, configuration2, settingsFor, setArcCompatibilityFlag) {
62954
62954
  super();
62955
62955
  this.target = target;
62956
- this.configuration = configuration;
62956
+ this.configuration = configuration2;
62957
62957
  this.settingsFor = settingsFor;
62958
62958
  this.setArcCompatibilityFlag = setArcCompatibilityFlag;
62959
62959
  }
@@ -63489,25 +63489,25 @@ var init_pods_build_settings = __esm({
63489
63489
  }
63490
63490
  #pods = /* @__PURE__ */ new Map();
63491
63491
  #aggregates = /* @__PURE__ */ new Map();
63492
- pod = (target, configuration) => {
63492
+ pod = (target, configuration2) => {
63493
63493
  let byConfig = this.#pods.get(target);
63494
63494
  if (!byConfig) {
63495
63495
  byConfig = /* @__PURE__ */ new Map();
63496
63496
  this.#pods.set(target, byConfig);
63497
63497
  }
63498
- let settings = byConfig.get(configuration);
63498
+ let settings = byConfig.get(configuration2);
63499
63499
  if (!settings) {
63500
- if (!target.configVariants.includes(configuration))
63500
+ if (!target.configVariants.includes(configuration2))
63501
63501
  throw new Error(
63502
- `No build settings for ${target.label} (configuration ${configuration})`
63502
+ `No build settings for ${target.label} (configuration ${configuration2})`
63503
63503
  );
63504
63504
  settings = new PodTargetSettings(
63505
63505
  target,
63506
- configuration,
63506
+ configuration2,
63507
63507
  this.pod,
63508
63508
  this.setArcCompatibilityFlag
63509
63509
  );
63510
- byConfig.set(configuration, settings);
63510
+ byConfig.set(configuration2, settings);
63511
63511
  }
63512
63512
  return settings;
63513
63513
  };
@@ -63886,14 +63886,14 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
63886
63886
  } else this.table.get(config).baseConfigurationReference = ref;
63887
63887
  }
63888
63888
  }
63889
- xcconfigRef(configuration) {
63889
+ xcconfigRef(configuration2) {
63890
63890
  const main = this.project.mainGroup;
63891
63891
  const group = this.project.child(main, "Pods") ?? this.project.newGroup(
63892
63892
  main,
63893
63893
  "Pods",
63894
63894
  import_node_path89.default.relative(this.target.clientRoot, this.target.sandbox.root)
63895
63895
  );
63896
- const xcconfig = this.target.xcconfigPath(configuration);
63896
+ const xcconfig = this.target.xcconfigPath(configuration2);
63897
63897
  const relative5 = import_node_path89.default.relative(this.project.realPath(group), xcconfig);
63898
63898
  const filename = import_node_path89.default.basename(relative5);
63899
63899
  const ref = this.project.files(group).find((id) => this.project.displayName(id) === filename);
@@ -64003,10 +64003,10 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
64003
64003
  delete object8.inputFileListPaths;
64004
64004
  delete object8.outputFileListPaths;
64005
64005
  }
64006
- fileListKey(script, kind, configuration) {
64006
+ fileListKey(script, kind, configuration2) {
64007
64007
  const name3 = (config) => `${this.target.label}-${script}-${config}-${kind}-files.xcfilelist`;
64008
64008
  return {
64009
- path: import_node_path89.default.join(this.target.supportFilesDir, name3(configuration)),
64009
+ path: import_node_path89.default.join(this.target.supportFilesDir, name3(configuration2)),
64010
64010
  relativePath: this.podsRootPath(
64011
64011
  import_node_path89.default.join(this.target.supportFilesDir, name3("${CONFIGURATION}"))
64012
64012
  )
@@ -68913,21 +68913,21 @@ function graphInputsDigest(root) {
68913
68913
  hash.update(file).update(import_node_fs91.default.readFileSync(import_node_path93.default.join(root, file)));
68914
68914
  return hash.digest("hex");
68915
68915
  }
68916
- function configurationFlags(configuration) {
68916
+ function configurationFlags(configuration2) {
68917
68917
  return [
68918
68918
  "-c",
68919
- configuration === "Release" ? "opt" : "dbg",
68919
+ configuration2 === "Release" ? "opt" : "dbg",
68920
68920
  "--cpu=ios_sim_arm64",
68921
68921
  "--platforms=@build_bazel_apple_support//platforms:ios_sim_arm64",
68922
68922
  // generators run the developer's tools, as their own builds find them
68923
68923
  "--action_env=PATH"
68924
68924
  ];
68925
68925
  }
68926
- function bazelGraph(root, label, configuration) {
68927
- const key2 = JSON.stringify([root, label, configuration]);
68926
+ function bazelGraph(root, label, configuration2) {
68927
+ const key2 = JSON.stringify([root, label, configuration2]);
68928
68928
  const cached4 = graphs.get(key2);
68929
68929
  if (cached4) return cached4;
68930
- const flags = configurationFlags(configuration);
68930
+ const flags = configurationFlags(configuration2);
68931
68931
  const digest3 = (0, import_node_crypto51.createHash)("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
68932
68932
  const file = import_node_path93.default.join(root, ".build", "peach-bazel", `graph-${digest3}.json`);
68933
68933
  const bazel = bazelBinary(root);
@@ -69066,8 +69066,8 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options2 =
69066
69066
  const root = import_node_fs91.default.realpathSync.native(workspaceRoot(import_node_fs91.default.realpathSync.native(buildFile)));
69067
69067
  const pkg = import_node_path93.default.relative(root, import_node_path93.default.dirname(import_node_fs91.default.realpathSync.native(buildFile)));
69068
69068
  const label = `//${pkg.split(import_node_path93.default.sep).join("/")}:${targetName}`;
69069
- const configuration = configurationName ?? "Debug";
69070
- const graph = bazelGraph(root, label, configuration);
69069
+ const configuration2 = configurationName ?? "Debug";
69070
+ const graph = bazelGraph(root, label, configuration2);
69071
69071
  const files2 = new BazelFiles(graph, root);
69072
69072
  const ruleOf = (raw2, from) => {
69073
69073
  let rule = graph.rules.get(canonicalLabel(raw2, from));
@@ -69121,7 +69121,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options2 =
69121
69121
  propagated.set(rule.label, result);
69122
69122
  return result;
69123
69123
  };
69124
- const debug = configuration !== "Release";
69124
+ const debug = configuration2 !== "Release";
69125
69125
  const products = import_node_path93.default.join(root, PRODUCTS);
69126
69126
  const resources = [];
69127
69127
  const resourceNames = {};
@@ -69391,7 +69391,7 @@ ${published4.map(
69391
69391
  if (generators2.length > 0)
69392
69392
  (0, import_node_child_process43.execFileSync)(
69393
69393
  bazelBinary(root),
69394
- ["build", ...configurationFlags(configuration), ...generators2],
69394
+ ["build", ...configurationFlags(configuration2), ...generators2],
69395
69395
  { cwd: root, stdio: ["ignore", "pipe", "pipe"], maxBuffer: 1 << 28 }
69396
69396
  );
69397
69397
  mirror();
@@ -69703,7 +69703,7 @@ ${published4.map(
69703
69703
  sdkFrameworks,
69704
69704
  packageResolved: [],
69705
69705
  appTargets: [targetName],
69706
- configuration,
69706
+ configuration: configuration2,
69707
69707
  settings: (key2) => key2 === "PRODUCT_MODULE_NAME" ? appModule.moduleName : key2 === "IPHONEOS_DEPLOYMENT_TARGET" ? minimumOS : key2 === "PRODUCT_BUNDLE_IDENTIFIER" ? graph.app.attrs.get("bundle_id")?.value ?? "" : "",
69708
69708
  cocoapods: null
69709
69709
  };
@@ -70296,7 +70296,7 @@ function groupParentsOf(objects) {
70296
70296
  groupParents.set(objects, parents);
70297
70297
  return parents;
70298
70298
  }
70299
- function xcodePathResolver(objects, projectDir, join29, sourceTreeRoot) {
70299
+ function xcodePathResolver(objects, projectDir, join30, sourceTreeRoot) {
70300
70300
  const parents = groupParentsOf(objects);
70301
70301
  const paths = /* @__PURE__ */ new Map();
70302
70302
  const resolve10 = (id) => {
@@ -70308,14 +70308,14 @@ function xcodePathResolver(objects, projectDir, join29, sourceTreeRoot) {
70308
70308
  const own2 = str2(entry.path) ?? "";
70309
70309
  const tree2 = str2(entry.sourceTree) ?? "<group>";
70310
70310
  if (tree2 === "<absolute>") result = own2;
70311
- else if (tree2 === "SOURCE_ROOT") result = join29(projectDir, own2);
70311
+ else if (tree2 === "SOURCE_ROOT") result = join30(projectDir, own2);
70312
70312
  else if (tree2 === "<group>") {
70313
70313
  const parent = parents.get(id);
70314
70314
  const base2 = parent ? resolve10(parent) : projectDir;
70315
- if (base2 !== null) result = join29(base2, own2);
70315
+ if (base2 !== null) result = join30(base2, own2);
70316
70316
  } else {
70317
70317
  const base2 = sourceTreeRoot?.(tree2);
70318
- if (base2) result = join29(base2, own2);
70318
+ if (base2) result = join30(base2, own2);
70319
70319
  }
70320
70320
  }
70321
70321
  paths.set(id, result);
@@ -70337,7 +70337,7 @@ function xcodeTargetMemberVisitor(objects) {
70337
70337
  if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
70338
70338
  synchronizedGroups.push({ id, group });
70339
70339
  }
70340
- return (targetId, resolvePath, filesUnder, join29, visit3) => {
70340
+ return (targetId, resolvePath, filesUnder, join30, visit3) => {
70341
70341
  const target = objects[targetId];
70342
70342
  if (!isDict(target)) return;
70343
70343
  for (const phaseId of list(target.buildPhases)) {
@@ -70384,7 +70384,7 @@ function xcodeTargetMemberVisitor(objects) {
70384
70384
  for (const relative5 of list(exception.membershipExceptions))
70385
70385
  exceptions.add(relative5);
70386
70386
  }
70387
- const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(join29(folder, relative5)));
70387
+ const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(join30(folder, relative5)));
70388
70388
  for (const file of members2) {
70389
70389
  const relative5 = file.slice(prefix.length);
70390
70390
  const excepted = [...exceptions].some(
@@ -72284,20 +72284,20 @@ function swiftPackageManifest(dir, platform3 = GUEST_PLATFORMS, requirePrepared
72284
72284
  }
72285
72285
  if (string6(tool) === "swift" && linksOnPlatform(condition, traits, platforms2)) {
72286
72286
  const config = string6(record3(condition).config);
72287
- const configuration = config === "debug" || config === "release" ? config : null;
72287
+ const configuration2 = config === "debug" || config === "release" ? config : null;
72288
72288
  for (const [kind2, into] of [
72289
72289
  ["enableExperimentalFeature", experimentalFeatures],
72290
72290
  ["enableUpcomingFeature", upcomingFeatures2]
72291
72291
  ]) {
72292
72292
  const name5 = string6(record3(settingKind[kind2])._0);
72293
72293
  if (name5 && /^[A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?$/.test(name5))
72294
- into.push({ name: name5, configuration });
72294
+ into.push({ name: name5, configuration: configuration2 });
72295
72295
  }
72296
72296
  const flags = record3(settingKind.unsafeFlags)._0;
72297
72297
  if (Array.isArray(flags) && flags.every((flag) => typeof flag === "string"))
72298
72298
  swiftFlags.push({
72299
72299
  flags: flags.filter((flag) => typeof flag === "string"),
72300
- configuration
72300
+ configuration: configuration2
72301
72301
  });
72302
72302
  }
72303
72303
  for (const [kind2, into] of [
@@ -74636,7 +74636,7 @@ function readXcodeJsonProject(xcodeproj, source) {
74636
74636
  settingsOf(entry["build-settings"]),
74637
74637
  new Map(
74638
74638
  items(entry["specialized-configurations"]).flatMap(
74639
- (configuration) => isObject(configuration) && text6(configuration.name) ? [[text6(configuration.name), configuration.file]] : []
74639
+ (configuration2) => isObject(configuration2) && text6(configuration2.name) ? [[text6(configuration2.name), configuration2.file]] : []
74640
74640
  )
74641
74641
  )
74642
74642
  );
@@ -74851,7 +74851,7 @@ function readXcconfig(file, read) {
74851
74851
  }
74852
74852
  return settings;
74853
74853
  }
74854
- function applyConditions(raw2, configuration) {
74854
+ function applyConditions(raw2, configuration2) {
74855
74855
  const plain = {};
74856
74856
  const conditional = {};
74857
74857
  for (const [key2, value] of Object.entries(raw2)) {
@@ -74862,7 +74862,7 @@ function applyConditions(raw2, configuration) {
74862
74862
  }
74863
74863
  const matches = [...key2.slice(bracket).matchAll(/\[([^=\]]+)=([^\]]*)\]/g)].every(
74864
74864
  ([, name3, pattern]) => {
74865
- const actual = name3 === "config" ? configuration : CONDITIONS[name3];
74865
+ const actual = name3 === "config" ? configuration2 : CONDITIONS[name3];
74866
74866
  return actual !== void 0 && new RegExp(
74867
74867
  `^${pattern.replace(/[.+^${}()|\\]/g, "\\$&").replaceAll("*", ".*").replaceAll("?", ".")}$`
74868
74868
  ).test(actual);
@@ -75150,17 +75150,17 @@ function processedInfoPlist(name3, file, settings, settingKeys) {
75150
75150
  }
75151
75151
  return info;
75152
75152
  }
75153
- function targetSettings(ref, configuration, builtins, options2 = {}, overrides = {}) {
75153
+ function targetSettings(ref, configuration2, builtins, options2 = {}, overrides = {}) {
75154
75154
  const { project: project2, target } = ref;
75155
75155
  const xcconfigs = [];
75156
75156
  const selected = (listId) => {
75157
75157
  const configList = project2.object(listId);
75158
75158
  const configs = list(configList?.buildConfigurations).map(project2.object);
75159
- return configs.find((entry) => entry?.name === configuration) ?? configs.find((entry) => entry?.name === str2(configList?.defaultConfigurationName));
75159
+ return configs.find((entry) => entry?.name === configuration2) ?? configs.find((entry) => entry?.name === str2(configList?.defaultConfigurationName));
75160
75160
  };
75161
75161
  const level = (config) => {
75162
75162
  if (!config) return [];
75163
- const name3 = str2(config.name) ?? configuration;
75163
+ const name3 = str2(config.name) ?? configuration2;
75164
75164
  const base2 = str2(config.baseConfigurationReference);
75165
75165
  const anchor = str2(config.baseConfigurationReferenceAnchor);
75166
75166
  const relative5 = str2(config.baseConfigurationReferenceRelativePath);
@@ -75188,7 +75188,7 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
75188
75188
  };
75189
75189
  const targetConfig = selected(str2(target.buildConfigurationList));
75190
75190
  const levels = [
75191
- { ...builtins, CONFIGURATION: str2(targetConfig?.name) ?? configuration },
75191
+ { ...builtins, CONFIGURATION: str2(targetConfig?.name) ?? configuration2 },
75192
75192
  ...level(selected(str2(project2.project.buildConfigurationList))),
75193
75193
  ...level(targetConfig),
75194
75194
  overrides
@@ -75992,10 +75992,10 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
75992
75992
  return value === void 0 ? void 0 : decodeXml(value);
75993
75993
  };
75994
75994
  const runnable = launch ? /<BuildableProductRunnable\b[\s\S]*?<BuildableReference\b([^>]*)>/.exec(launch[2]) : null;
75995
- const configuration = launch ? attribute2(launch[1], "buildConfiguration") : void 0;
75995
+ const configuration2 = launch ? attribute2(launch[1], "buildConfiguration") : void 0;
75996
75996
  const blueprint = runnable ? attribute2(runnable[1], "BlueprintIdentifier") : void 0;
75997
75997
  const referenced = runnable ? attribute2(runnable[1], "ReferencedContainer") : void 0;
75998
- if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
75998
+ if (!configuration2 || !blueprint || !referenced?.startsWith("container:")) {
75999
75999
  throw new Error(`scheme ${scheme} runs no application target`);
76000
76000
  }
76001
76001
  const projectPath = import_node_path101.default.resolve(
@@ -76018,7 +76018,7 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
76018
76018
  `scheme ${scheme} runs blueprint ${blueprint}, which no project here declares (declared targets: ${declared.join(", ") || "none"})`
76019
76019
  );
76020
76020
  }
76021
- return { target: name3, configuration };
76021
+ return { target: name3, configuration: configuration2 };
76022
76022
  }
76023
76023
  function selectIosAppTarget(projectRoot, iosTarget) {
76024
76024
  const nested = import_node_path101.default.join(projectRoot, "ios");
@@ -76096,10 +76096,10 @@ function selectIosAppTarget(projectRoot, iosTarget) {
76096
76096
  );
76097
76097
  return { xcodeproj, target, workspace: project2.workspace };
76098
76098
  }
76099
- async function resolveXcodeSwiftPackages(input, signal, target, configuration) {
76099
+ async function resolveXcodeSwiftPackages(input, signal, target, configuration2) {
76100
76100
  if (import_node_fs98.default.existsSync(workspaceResolvedFile(import_node_fs98.default.realpathSync.native(input)))) return;
76101
76101
  try {
76102
- readXcodeAppTarget(input, target, configuration, {
76102
+ readXcodeAppTarget(input, target, configuration2, {
76103
76103
  installedPods: true,
76104
76104
  requireSources: false,
76105
76105
  deferPackageResolution: true
@@ -76147,7 +76147,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
76147
76147
  const appConfigNames = list(appConfigs?.buildConfigurations).flatMap(
76148
76148
  (id) => str2(app.project.object(id)?.name) ?? []
76149
76149
  );
76150
- const configuration = configurationName === void 0 ? defaultConfiguration(app.project) : appConfigNames.includes(configurationName) ? configurationName : str2(appConfigs?.defaultConfigurationName) ?? configurationName;
76150
+ const configuration2 = configurationName === void 0 ? defaultConfiguration(app.project) : appConfigNames.includes(configurationName) ? configurationName : str2(appConfigs?.defaultConfigurationName) ?? configurationName;
76151
76151
  const byProduct = /* @__PURE__ */ new Map();
76152
76152
  for (const ref of allTargets) {
76153
76153
  const product = ref.project.object(str2(ref.target.productReference));
@@ -76272,7 +76272,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
76272
76272
  if (cached4 !== void 0) return cached4;
76273
76273
  const product = targetSettings(
76274
76274
  ref,
76275
- configuration,
76275
+ configuration2,
76276
76276
  { TARGET_NAME: str2(ref.target.name) ?? ref.id },
76277
76277
  options2
76278
76278
  ).get("PRODUCT_NAME");
@@ -76350,7 +76350,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
76350
76350
  xcconfigs: read
76351
76351
  } = targetSettings(
76352
76352
  ref,
76353
- configuration,
76353
+ configuration2,
76354
76354
  {
76355
76355
  TARGET_NAME: name3,
76356
76356
  TARGETNAME: "$(TARGET_NAME)",
@@ -77094,9 +77094,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
77094
77094
  continue;
77095
77095
  const resolved = fileId ? project2.resolvePath(fileId) : null;
77096
77096
  if (fileId && resolved !== null && !import_node_fs98.default.existsSync(resolved)) {
77097
- const parts = resolved.split(import_node_path101.default.sep);
77098
- const pods = parts.lastIndexOf("Pods");
77099
- const sandbox = parts.slice(0, pods + 1).join(import_node_path101.default.sep);
77097
+ const parts2 = resolved.split(import_node_path101.default.sep);
77098
+ const pods = parts2.lastIndexOf("Pods");
77099
+ const sandbox = parts2.slice(0, pods + 1).join(import_node_path101.default.sep);
77100
77100
  if (!options2.installedPods && options2.requireSources === false && pods > 0 && import_node_fs98.default.existsSync(import_node_path101.default.join(import_node_path101.default.dirname(sandbox), "Podfile")))
77101
77101
  continue;
77102
77102
  if (!ios_sdk_frameworks_default.frameworks.includes(name3))
@@ -77227,7 +77227,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
77227
77227
  ).sort(),
77228
77228
  packageResolved,
77229
77229
  appTargets: appTargetNames,
77230
- configuration,
77230
+ configuration: configuration2,
77231
77231
  settings,
77232
77232
  cocoapods
77233
77233
  };
@@ -77635,9 +77635,9 @@ function watchRoot(root) {
77635
77635
  if (existing) return existing;
77636
77636
  const watch3 = { edits: 0 };
77637
77637
  const watcher = import_node_fs99.default.watch(root, { recursive: true }, (_event, filename) => {
77638
- const parts = filename?.split(import_node_path102.default.sep) ?? [];
77638
+ const parts2 = filename?.split(import_node_path102.default.sep) ?? [];
77639
77639
  const { excluded } = watch3;
77640
- if (excluded && parts.some((_, index) => excluded(parts.slice(0, index + 1).join(import_node_path102.default.sep))))
77640
+ if (excluded && parts2.some((_, index) => excluded(parts2.slice(0, index + 1).join(import_node_path102.default.sep))))
77641
77641
  return;
77642
77642
  if (filename && watch3.ignoredLater?.(filename)) return;
77643
77643
  watch3.edits += 1;
@@ -79123,11 +79123,11 @@ function readSources(value) {
79123
79123
  });
79124
79124
  }
79125
79125
  function packageRootOf(appRoot, file) {
79126
- const parts = file.split("/");
79127
- if (parts[0] !== "node_modules") return null;
79128
- const at = parts.lastIndexOf("node_modules") + 1;
79129
- const end = at + (parts[at]?.startsWith("@") ? 2 : 1);
79130
- return parts.length > end ? import_node_path107.default.join(appRoot, ...parts.slice(0, end)) : null;
79126
+ const parts2 = file.split("/");
79127
+ if (parts2[0] !== "node_modules") return null;
79128
+ const at = parts2.lastIndexOf("node_modules") + 1;
79129
+ const end = at + (parts2[at]?.startsWith("@") ? 2 : 1);
79130
+ return parts2.length > end ? import_node_path107.default.join(appRoot, ...parts2.slice(0, end)) : null;
79131
79131
  }
79132
79132
  async function expoNativeInputs(appRoot) {
79133
79133
  appRoot = import_node_fs104.default.realpathSync(appRoot);
@@ -79359,8 +79359,8 @@ var init_expo_native_prebuilt = __esm({
79359
79359
 
79360
79360
  // src/native-preparation.ts
79361
79361
  function ignoredChange(relative5) {
79362
- const parts = relative5.split(import_node_path108.default.sep);
79363
- return relative5 === import_node_path108.default.join(".git", "index") || parts.includes(".cache") || parts.includes(".expo") || /(?:^|[\\/])node_modules[\\/]expo-widgets[\\/]bundle[\\/]build(?:[\\/]|$)/.test(
79362
+ const parts2 = relative5.split(import_node_path108.default.sep);
79363
+ return relative5 === import_node_path108.default.join(".git", "index") || parts2.includes(".cache") || parts2.includes(".expo") || /(?:^|[\\/])node_modules[\\/]expo-widgets[\\/]bundle[\\/]build(?:[\\/]|$)/.test(
79364
79364
  relative5
79365
79365
  );
79366
79366
  }
@@ -81678,6 +81678,16 @@ var init_swift_wasm64_native_source = __esm({
81678
81678
  derivedSha256: "3df712348b50a065f465304dc7027ffbdfe8e633ba9ed535803592c3ace7f5f5",
81679
81679
  rewrite: deriveWamrWasm64Wasi
81680
81680
  }
81681
+ ],
81682
+ [
81683
+ "POPAnimationExtras.mm",
81684
+ {
81685
+ upstreamCommit: "fb0e62ba8a147f0821da6aa63c09da7d79a10111",
81686
+ originalSha256: "9f7f063b3f7a45ebc51d35a9dcf143dd3c3348396a476e1083061578618d917b",
81687
+ derivedSha256: "1be70de0cb0be9950b48e1540d57da2eed46bf054d347ea0d4a75718b487947a",
81688
+ before: "UIKIT_EXTERN CGFloat UIAnimationDragCoefficient();",
81689
+ after: "UIKIT_EXTERN float UIAnimationDragCoefficient();"
81690
+ }
81681
81691
  ]
81682
81692
  ]);
81683
81693
  }
@@ -81712,13 +81722,13 @@ function walk3(dir) {
81712
81722
  function placeOutputs(declaration, roots, outDir) {
81713
81723
  const built2 = roots.flatMap(walk3);
81714
81724
  for (const output of declaration.outputs) {
81715
- const parts = output.path.split(import_node_path116.default.sep);
81716
- const name3 = parts.at(-1).toLowerCase();
81725
+ const parts2 = output.path.split(import_node_path116.default.sep);
81726
+ const name3 = parts2.at(-1).toLowerCase();
81717
81727
  const candidates = built2.filter((file) => import_node_path116.default.basename(file).toLowerCase() === name3);
81718
81728
  const score = (file) => {
81719
81729
  const theirs = file.split(import_node_path116.default.sep);
81720
81730
  let shared = 1;
81721
- while (shared < parts.length && theirs.at(-1 - shared) === parts.at(-1 - shared))
81731
+ while (shared < parts2.length && theirs.at(-1 - shared) === parts2.at(-1 - shared))
81722
81732
  shared++;
81723
81733
  return shared;
81724
81734
  };
@@ -82178,7 +82188,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
82178
82188
  const compiler = (name3) => {
82179
82189
  const file = import_node_path117.default.join(root, name3);
82180
82190
  const script = `${file}.cjs`;
82181
- const configuration = {
82191
+ const configuration2 = {
82182
82192
  compiler: import_node_path117.default.join(toolchainBin, name3),
82183
82193
  frameworks: frameworkResponses,
82184
82194
  response,
@@ -82188,7 +82198,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
82188
82198
  script,
82189
82199
  `
82190
82200
  const { spawnSync } = require('node:child_process');
82191
- const config = ${JSON.stringify(configuration)};
82201
+ const config = ${JSON.stringify(configuration2)};
82192
82202
  const input = process.argv.slice(2), args = [], frameworks = [];
82193
82203
  for (let i = 0; i < input.length; i++) {
82194
82204
  if (input[i] === '-framework' || input[i] === '-weak_framework') {
@@ -82227,7 +82237,7 @@ for arg in "$@"; do
82227
82237
  -framework|-weak_framework|-Wl,-framework,*|-Wl,-weak_framework,*) exec node ${shellQuote(script)} "$@" ;;
82228
82238
  esac
82229
82239
  done
82230
- exec ${shellQuote(configuration.compiler)} "$@"
82240
+ exec ${shellQuote(configuration2.compiler)} "$@"
82231
82241
  `,
82232
82242
  { mode: 493 }
82233
82243
  );
@@ -85544,7 +85554,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85544
85554
  const { moduleRoot, release } = toolchain;
85545
85555
  const sdk2 = swiftModuleSdk(moduleRoot);
85546
85556
  const digest3 = sourceDir === void 0 ? STANDIN_SOURCE_DIGEST : standinSourceDigest(sourceDir);
85547
- const parts = [
85557
+ const parts2 = [
85548
85558
  "standin/v13",
85549
85559
  release,
85550
85560
  sdk2.wasmSdkId,
@@ -85566,7 +85576,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85566
85576
  );
85567
85577
  const selected = Object.keys(behavior).filter((name3) => modules.has(name3)).sort();
85568
85578
  if (selected.length > 0)
85569
- parts.push(
85579
+ parts2.push(
85570
85580
  JSON.stringify(
85571
85581
  selected.map((name3) => [
85572
85582
  name3,
@@ -85577,7 +85587,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85577
85587
  for (const binary2 of binaries) {
85578
85588
  const swiftSources = binary2.placeholder ?? binary2.moduleSources;
85579
85589
  if (swiftSources !== void 0) {
85580
- parts.push(
85590
+ parts2.push(
85581
85591
  binary2.target,
85582
85592
  binary2.source,
85583
85593
  binary2.placeholder ? `placeholder/${binary2.placeholder.gap}` : `module-sources/${binary2.moduleSources?.resources}`,
@@ -85590,13 +85600,13 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85590
85600
  continue;
85591
85601
  }
85592
85602
  if (binary2.publicHeaders !== void 0 && swiftTargetModuleName(binary2.target) !== binary2.target)
85593
- parts.push(`module/${swiftTargetModuleName(binary2.target)}`);
85603
+ parts2.push(`module/${swiftTargetModuleName(binary2.target)}`);
85594
85604
  try {
85595
85605
  if (binary2.publicHeaders === void 0 && surfaces(swiftBinaryFramework(binary2).dir, binary2.target).some(
85596
85606
  (surface) => surface.kind === "swift"
85597
85607
  ))
85598
- parts.push(`interface-emulation/${WASI_EMULATION.join(",")}`);
85599
- parts.push(
85608
+ parts2.push(`interface-emulation/${WASI_EMULATION.join(",")}`);
85609
+ parts2.push(
85600
85610
  binary2.target,
85601
85611
  binary2.source,
85602
85612
  binary2.url ?? "",
@@ -85611,7 +85621,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85611
85621
  ].join("\0") : swiftBinaryFramework(binary2).digest
85612
85622
  );
85613
85623
  } catch {
85614
- parts.push(
85624
+ parts2.push(
85615
85625
  binary2.target,
85616
85626
  binary2.source,
85617
85627
  binary2.url ?? "",
@@ -85620,7 +85630,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
85620
85630
  );
85621
85631
  }
85622
85632
  }
85623
- return (0, import_node_crypto72.createHash)("sha256").update(parts.join("\0")).digest("hex");
85633
+ return (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex");
85624
85634
  }
85625
85635
  function missingArtifactGap(binary2) {
85626
85636
  if (swiftBinaryOnDisk(binary2)) return null;
@@ -86139,7 +86149,7 @@ var init_swift_standins = __esm({
86139
86149
  init_swiftTargetContract();
86140
86150
  TRIPLE = SWIFT_WASM_TRIPLE;
86141
86151
  cacheDir5 = import_node_path122.default.join(cacheDir(), "swift-standins");
86142
- key = (...parts) => (0, import_node_crypto72.createHash)("sha256").update(parts.join("\0")).digest("hex").slice(0, 32);
86152
+ key = (...parts2) => (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
86143
86153
  digests = /* @__PURE__ */ new Map();
86144
86154
  isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
86145
86155
  OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
@@ -86430,7 +86440,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
86430
86440
  );
86431
86441
  const binaryFrameworks = binarySearch2.flatMap((search) => search.frameworks);
86432
86442
  const binaryHeaders = binarySearch2.flatMap((search) => search.headers);
86433
- const configuration = app.configuration === "Debug" ? "debug" : "release";
86443
+ const configuration2 = app.configuration === "Debug" ? "debug" : "release";
86434
86444
  for (const binary2 of binaries) {
86435
86445
  if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0)
86436
86446
  continue;
@@ -86446,7 +86456,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
86446
86456
  for (const dependency of binary2.headerDependencies ?? [])
86447
86457
  yield* addHeaders(import_node_path123.default.resolve(binary2.dir, dependency.path));
86448
86458
  const settings = target.nativeSettings.filter(
86449
- (setting) => setting.configuration === null || setting.configuration === configuration
86459
+ (setting) => setting.configuration === null || setting.configuration === configuration2
86450
86460
  );
86451
86461
  const nativeFlags = settings.flatMap((setting) => setting.flags);
86452
86462
  for (const [index, flag] of nativeFlags.entries()) {
@@ -86476,7 +86486,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
86476
86486
  "-fobjc-arc",
86477
86487
  "-fmodules",
86478
86488
  "-DSWIFT_PACKAGE",
86479
- ...configuration === "debug" ? ["-DDEBUG"] : [],
86489
+ ...configuration2 === "debug" ? ["-DDEBUG"] : [],
86480
86490
  ...settings.filter((setting) => setting.tool === "c").flatMap((setting) => setting.flags)
86481
86491
  ],
86482
86492
  cxxFlags: settings.filter((setting) => setting.tool === "cxx").flatMap((setting) => setting.flags),
@@ -89365,16 +89375,16 @@ function providesNamespace(text7) {
89365
89375
  }
89366
89376
  }
89367
89377
  function catalogEntryName(contentsPath, kind, readText) {
89368
- const parts = contentsPath.split("/");
89369
- const leaf2 = parts[parts.length - 2] ?? "";
89378
+ const parts2 = contentsPath.split("/");
89379
+ const leaf2 = parts2[parts2.length - 2] ?? "";
89370
89380
  if (!leaf2.endsWith(kind)) return null;
89371
89381
  const short = leaf2.slice(0, -kind.length) || null;
89372
89382
  if (short === null) return null;
89373
89383
  const segments = [short];
89374
- for (let depth = parts.length - 3; depth >= 0; depth -= 1) {
89375
- const dir = parts[depth] ?? "";
89384
+ for (let depth = parts2.length - 3; depth >= 0; depth -= 1) {
89385
+ const dir = parts2[depth] ?? "";
89376
89386
  if (dir.endsWith(".xcassets") || dir === "" || dir === "." || dir === "..") break;
89377
- const folderContents = [...parts.slice(0, depth + 1), "Contents.json"].join("/");
89387
+ const folderContents = [...parts2.slice(0, depth + 1), "Contents.json"].join("/");
89378
89388
  if (providesNamespace(readText(folderContents))) segments.unshift(dir);
89379
89389
  }
89380
89390
  return segments.join("/");
@@ -89700,11 +89710,11 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
89700
89710
  return aDepth - bDepth || (a < b ? -1 : a > b ? 1 : 0);
89701
89711
  });
89702
89712
  for (const file of ordered) {
89703
- const parts = file.split("/");
89704
- const nested = parts.findIndex(
89713
+ const parts2 = file.split("/");
89714
+ const nested = parts2.findIndex(
89705
89715
  (part) => /\.(atlasc|lproj|bundle|storyboardc|nib|momd)$/.test(part)
89706
89716
  );
89707
- const base2 = nested < 0 ? baseOf(file) : parts.slice(nested).join("/");
89717
+ const base2 = nested < 0 ? baseOf(file) : parts2.slice(nested).join("/");
89708
89718
  if (seen.has(base2)) continue;
89709
89719
  seen.add(base2);
89710
89720
  found2.push({ base: base2, file });
@@ -91794,9 +91804,9 @@ var init_core_data_model = __esm({
91794
91804
  });
91795
91805
  }
91796
91806
  };
91797
- sha2563 = (...parts) => (0, import_node_crypto74.createHash)("sha256").update(
91807
+ sha2563 = (...parts2) => (0, import_node_crypto74.createHash)("sha256").update(
91798
91808
  Buffer.concat(
91799
- parts.map(
91809
+ parts2.map(
91800
91810
  (part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
91801
91811
  )
91802
91812
  )
@@ -94402,17 +94412,31 @@ function addressImmediates(bytes) {
94402
94412
  while (bytes[at++] & 128) ;
94403
94413
  };
94404
94414
  const address = (bits) => {
94405
- let value = 0;
94415
+ let lo = 0;
94416
+ let hi = 0;
94406
94417
  let shift = 0;
94407
94418
  let byte = 0;
94408
94419
  do {
94409
94420
  byte = bytes[at++];
94410
- if (shift < 35) value += (byte & 127) * 2 ** shift;
94421
+ const chunk = byte & 127;
94422
+ if (shift < 28) lo |= chunk << shift;
94423
+ else if (shift === 28) {
94424
+ lo |= (chunk & 15) << 28;
94425
+ hi |= chunk >>> 4;
94426
+ } else if (shift < 63) hi |= chunk << shift - 32;
94427
+ else hi |= (chunk & 1) << 31;
94411
94428
  shift += 7;
94412
94429
  } while (byte & 128);
94413
94430
  const negative = (byte & 64) !== 0;
94414
- if (bits === 32) out.push(negative ? value - 2 ** shift >>> 0 : value >>> 0);
94415
- else if (!negative && shift <= 35 && value < 2 ** 32) out.push(value);
94431
+ if (negative && shift < 64) {
94432
+ if (shift < 32) {
94433
+ lo |= ~0 << shift;
94434
+ hi = ~0;
94435
+ } else hi |= ~0 << shift - 32;
94436
+ }
94437
+ const uLo = lo >>> 0;
94438
+ const uHi = hi >>> 0;
94439
+ if (bits === 32 || uHi === 0 || uHi === 2147483648) out.push(uLo);
94416
94440
  };
94417
94441
  const memarg = () => {
94418
94442
  if (u() & 64) skip();
@@ -94583,17 +94607,20 @@ function eagerLinkReferences(pieces, inventory) {
94583
94607
  functionCallStarts,
94584
94608
  functionCalls
94585
94609
  } = pieces;
94610
+ const deferred = (index) => {
94611
+ const slot = functionSlots[index];
94612
+ if (!slot) return false;
94613
+ const at = slotOffset + slot * 2;
94614
+ return at + 2 <= slots.byteLength && slots.getUint16(at, true) !== 0;
94615
+ };
94586
94616
  const seen = new Uint8Array(functionSlots.length);
94587
94617
  const pending = [];
94588
94618
  const visit3 = (index) => {
94589
- if (seen[index]) return;
94619
+ if (seen[index] || deferred(index)) return;
94590
94620
  seen[index] = 1;
94591
94621
  pending.push(index);
94592
94622
  };
94593
- for (const [index, slot] of functionSlots.entries()) {
94594
- const at = slotOffset + slot * 2;
94595
- if (!slot || at >= slots.byteLength || !slots.getUint16(at, true)) visit3(index);
94596
- }
94623
+ for (let index = 0; index < functionSlots.length; index++) visit3(index);
94597
94624
  const references = [];
94598
94625
  while (pending.length) {
94599
94626
  const index = pending.pop();
@@ -94606,13 +94633,13 @@ function eagerLinkReferences(pieces, inventory) {
94606
94633
  }
94607
94634
  return references;
94608
94635
  }
94609
- function swiftSdkDeferredDataPlan(directory2, primary, parts) {
94636
+ function swiftSdkDeferredDataPlan(directory2, primary, parts2) {
94610
94637
  const pieces = readSdkPieces(directory2);
94611
94638
  const inventory = readWasmCustomSection(primary, NATIVE_LAZY_SECTION);
94612
94639
  if (!inventory) return Buffer.alloc(pieces.starts.length);
94613
94640
  const eager = reachedFrom(pieces, [primary]);
94614
94641
  closeOverData(pieces, eager, eagerLinkReferences(pieces, inventory));
94615
- const reaches = Array.from(parts, (part) => reachedFrom(pieces, [part]));
94642
+ const reaches = Array.from(parts2, (part) => reachedFrom(pieces, [part]));
94616
94643
  const owner = new Int32Array(pieces.starts.length).fill(-1);
94617
94644
  const owned = new Float64Array(reaches.length);
94618
94645
  for (const [part, reached] of reaches.entries())
@@ -97046,11 +97073,11 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
97046
97073
  if (!primaryLazy.has(lazy)) members2.push(lazy);
97047
97074
  lazyByGroup.set(group2, members2);
97048
97075
  }
97049
- const parts = slotsByPart.flatMap((slots2, id) => {
97076
+ const parts2 = slotsByPart.flatMap((slots2, id) => {
97050
97077
  const lazy = lazyByGroup.get(id);
97051
97078
  return slots2.length || lazy ? [{ id, slots: slots2, lazy }] : [];
97052
97079
  });
97053
- if (!parts.length) return { primary: describePart(input), sides: [] };
97080
+ if (!parts2.length) return { primary: describePart(input), sides: [] };
97054
97081
  const admitted = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
97055
97082
  const requested = Number(process.env.BINARYEN_CORES);
97056
97083
  const jobs = Math.min(
@@ -97061,7 +97088,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
97061
97088
  );
97062
97089
  const env = jobs > 1 ? { ...process.env, BINARYEN_CORES: "1" } : void 0;
97063
97090
  const sides = await mapLimit(
97064
- parts,
97091
+ parts2,
97065
97092
  jobs,
97066
97093
  async ({ id, slots: slots2, lazy }) => {
97067
97094
  const part = await guard((0, import_node_path131.join)(directory2, `side-${id}.wasm`), lazy, env);
@@ -97070,7 +97097,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
97070
97097
  return { ...part, slots: slots2, sha256: (0, import_node_crypto78.createHash)("sha256").update(bytes2).digest("hex") };
97071
97098
  }
97072
97099
  );
97073
- const dyldGroups = parts.flatMap(
97100
+ const dyldGroups = parts2.flatMap(
97074
97101
  ({ lazy }, part) => lazy ? [{ first: lazy[0], part }] : []
97075
97102
  );
97076
97103
  return {
@@ -97260,7 +97287,7 @@ async function splitSwiftSdkImage(bytes, directory2, launch, app) {
97260
97287
  for (const file of files2) hash.update(file);
97261
97288
  const cache = (0, import_node_path132.join)(
97262
97289
  directory2,
97263
- `startup-v10-${platform}-${hash.digest("hex").slice(0, 16)}`
97290
+ `startup-v11-${platform}-${hash.digest("hex").slice(0, 16)}`
97264
97291
  );
97265
97292
  return { files: files2, cache };
97266
97293
  };
@@ -97659,23 +97686,23 @@ function withXcodeProject(xcodeproj, options2, run17) {
97659
97686
  }
97660
97687
  );
97661
97688
  }
97662
- async function prepareXcodeSwiftPackages(input, target, configuration, signal) {
97663
- await resolveXcodeSwiftPackages(input, signal, target, configuration);
97664
- const app = readXcodeAppTarget(input, target, configuration, {
97689
+ async function prepareXcodeSwiftPackages(input, target, configuration2, signal) {
97690
+ await resolveXcodeSwiftPackages(input, signal, target, configuration2);
97691
+ const app = readXcodeAppTarget(input, target, configuration2, {
97665
97692
  installedPods: true,
97666
97693
  requireSources: false
97667
97694
  });
97668
97695
  await prefetchSwiftCheckouts(app.rootDir, app.packageResolved, signal);
97669
97696
  }
97670
- function readXcodeAppTargetPrepared(input, target, configuration, options2) {
97697
+ function readXcodeAppTargetPrepared(input, target, configuration2, options2) {
97671
97698
  if (options2.prepareGeneratedSources !== true)
97672
- return readXcodeAppTarget(input, target, configuration, {
97699
+ return readXcodeAppTarget(input, target, configuration2, {
97673
97700
  ...options2,
97674
97701
  deferPackageResolution: true
97675
97702
  });
97676
- const key2 = JSON.stringify([input, target, configuration, options2.nativeModules]);
97703
+ const key2 = JSON.stringify([input, target, configuration2, options2.nativeModules]);
97677
97704
  if (!preparedScriptInputs.has(key2)) {
97678
- const probe = readXcodeAppTarget(input, target, configuration, {
97705
+ const probe = readXcodeAppTarget(input, target, configuration2, {
97679
97706
  ...options2,
97680
97707
  prepareGeneratedSources: false,
97681
97708
  requireSources: false,
@@ -97705,13 +97732,13 @@ function readXcodeAppTargetPrepared(input, target, configuration, options2) {
97705
97732
  }
97706
97733
  preparedScriptInputs.add(key2);
97707
97734
  }
97708
- return readXcodeAppTarget(input, target, configuration, {
97735
+ return readXcodeAppTarget(input, target, configuration2, {
97709
97736
  ...options2,
97710
97737
  deferPackageResolution: true
97711
97738
  });
97712
97739
  }
97713
- function openXcodeProject(xcodeproj, target, moduleRoot, configuration, interfaceRoot, nativeModules) {
97714
- const app = readXcodeAppTargetPrepared(xcodeproj, target, configuration, {
97740
+ function openXcodeProject(xcodeproj, target, moduleRoot, configuration2, interfaceRoot, nativeModules) {
97741
+ const app = readXcodeAppTargetPrepared(xcodeproj, target, configuration2, {
97715
97742
  prepareGeneratedSources: true,
97716
97743
  installedPods: true,
97717
97744
  nativeModules
@@ -97984,11 +98011,11 @@ async function buildXcodeLayout(root) {
97984
98011
  project: project2,
97985
98012
  target,
97986
98013
  module: module2,
97987
- configuration,
98014
+ configuration: configuration2,
97988
98015
  machOType,
97989
98016
  settings
97990
98017
  }) => {
97991
- const framework = readXcodeAppTarget(project2, target, configuration, {
98018
+ const framework = readXcodeAppTarget(project2, target, configuration2, {
97992
98019
  prepareGeneratedSources: true,
97993
98020
  frameworkMachOType: machOType,
97994
98021
  frameworkBuildSettings: settings
@@ -99439,8 +99466,8 @@ function xcodeArchiveSlice(root, flag) {
99439
99466
  const filename = import_node_path133.default.basename(flag);
99440
99467
  const name3 = /^lib([A-Za-z_]\w*)\.a$/.exec(filename)?.[1];
99441
99468
  if (!name3) return null;
99442
- const parts = flag.split(import_node_path133.default.sep);
99443
- const target = parts.findLastIndex(
99469
+ const parts2 = flag.split(import_node_path133.default.sep);
99470
+ const target = parts2.findLastIndex(
99444
99471
  (part) => /^(?:aarch64|x86_64)-apple-ios(?:-sim)?$/.test(part)
99445
99472
  );
99446
99473
  if (target < 0)
@@ -99448,8 +99475,8 @@ function xcodeArchiveSlice(root, flag) {
99448
99475
  name: name3,
99449
99476
  file: packageInputPath(import_node_fs132.default.realpathSync(inputPackageRoot(root, flag)), flag)
99450
99477
  } : null;
99451
- parts[target] = RUST_TARGET;
99452
- const slice = parts.join(import_node_path133.default.sep);
99478
+ parts2[target] = RUST_TARGET;
99479
+ const slice = parts2.join(import_node_path133.default.sep);
99453
99480
  return import_node_fs132.default.existsSync(slice) ? { name: name3, file: packageInputPath(root, slice) } : null;
99454
99481
  }
99455
99482
  function xcodeArchiveLinks(layout2, moduleRoot) {
@@ -99736,12 +99763,12 @@ function swiftBuildRoot(packagePath, moduleRoot) {
99736
99763
  const distribution = swiftDistributionAt(moduleRoot);
99737
99764
  const compilerKey = distribution ? `${distribution.release}\0${distribution.wasmSdkChecksum}` : moduleRoot;
99738
99765
  const resolvedPath = import_node_path133.default.resolve(packagePath);
99739
- const parts = resolvedPath.split(import_node_path133.default.sep);
99766
+ const parts2 = resolvedPath.split(import_node_path133.default.sep);
99740
99767
  const scopedAt = Math.max(
99741
- parts.lastIndexOf("peach-expo-swift"),
99742
- parts.lastIndexOf("peach-nitro-swift")
99768
+ parts2.lastIndexOf("peach-expo-swift"),
99769
+ parts2.lastIndexOf("peach-nitro-swift")
99743
99770
  );
99744
- const buildKeyPath = scopedAt >= 0 && parts.length >= scopedAt + 3 ? parts.slice(0, scopedAt + 2).join(import_node_path133.default.sep) : sourceEntries().get(resolvedPath) ?? resolvedPath;
99771
+ const buildKeyPath = scopedAt >= 0 && parts2.length >= scopedAt + 3 ? parts2.slice(0, scopedAt + 2).join(import_node_path133.default.sep) : sourceEntries().get(resolvedPath) ?? resolvedPath;
99745
99772
  return import_node_path133.default.join(
99746
99773
  swiftCacheDir(),
99747
99774
  "swift-builds",
@@ -108513,11 +108540,11 @@ function expoManifest(files2, generation = "", settings = /* @__PURE__ */ new Ma
108513
108540
  }
108514
108541
  const declarations = [...targets].map(([name3, dir]) => {
108515
108542
  const declared = settings.get(name3);
108516
- const configuration = dir.startsWith(`${SWIFT_STANDINS_DIR}/`) ? { languageMode: 5, mainActorIsolation: false } : declared;
108543
+ const configuration2 = dir.startsWith(`${SWIFT_STANDINS_DIR}/`) ? { languageMode: 5, mainActorIsolation: false } : declared;
108517
108544
  const dependencies = (declared?.dependencies ?? []).flatMap(
108518
108545
  (dependency) => dependency.kind === "target" && targets.has(dependency.name) ? [dependency.name] : []
108519
108546
  );
108520
- return `.target(name: ${JSON.stringify(name3)}, dependencies: ${JSON.stringify(dependencies)}, path: ${JSON.stringify(dir)}${declared?.resources ? ", resources: []" : ""}${configuration ? ", " + swiftManifestSettings(configuration) : ""})`;
108547
+ return `.target(name: ${JSON.stringify(name3)}, dependencies: ${JSON.stringify(dependencies)}, path: ${JSON.stringify(dir)}${declared?.resources ? ", resources: []" : ""}${configuration2 ? ", " + swiftManifestSettings(configuration2) : ""})`;
108521
108548
  });
108522
108549
  const appProducts = [...targets.keys()].map((name3) => JSON.stringify(name3));
108523
108550
  appProducts.push(
@@ -113473,6 +113500,203 @@ var init_staged_host_files = __esm({
113473
113500
  }
113474
113501
  });
113475
113502
 
113503
+ // ../peach-globals/build/one-swift-control-source.ts
113504
+ function statements(body) {
113505
+ const found2 = [];
113506
+ let at = 0;
113507
+ while ((at = body.indexOf("[_nativeView ", at)) !== -1) {
113508
+ let depth = 0;
113509
+ let end = at;
113510
+ for (; end < body.length; ++end) {
113511
+ if (body[end] === "[") ++depth;
113512
+ else if (body[end] === "]" && --depth === 0) break;
113513
+ }
113514
+ found2.push(body.slice(at + "[_nativeView ".length, end));
113515
+ at = end;
113516
+ }
113517
+ return found2;
113518
+ }
113519
+ function parts(statement) {
113520
+ const result = [];
113521
+ let depth = 0;
113522
+ let start = 0;
113523
+ const flush = (end) => {
113524
+ const text7 = statement.slice(start, end).trim();
113525
+ const colon = text7.indexOf(":");
113526
+ if (colon < 0) throw new Error("unparsed selector part: " + text7);
113527
+ result.push({ label: text7.slice(0, colon), expression: text7.slice(colon + 1).trim() });
113528
+ };
113529
+ for (let index = 0; index < statement.length; ++index) {
113530
+ const char = statement[index];
113531
+ if (char === "[" || char === "(") ++depth;
113532
+ else if (char === "]" || char === ")") --depth;
113533
+ else if (depth === 0 && /\s/.test(char) && /^\s*[A-Za-z]\w*:/.test(statement.slice(index)) && index > start && statement.slice(start, index).includes(":")) {
113534
+ flush(index);
113535
+ start = index;
113536
+ }
113537
+ }
113538
+ flush(statement.length);
113539
+ return result;
113540
+ }
113541
+ function eventBindings(name3, source) {
113542
+ const bindings = [];
113543
+ for (const match of source.matchAll(/_nativeView\.(\w+) = \^\(([^)]*)\) \{(.*?)\};/g)) {
113544
+ const [, property, parameterList, body] = match;
113545
+ const parameters = parameterList.split(",").map((parameter) => parameter.trim()).filter(Boolean).map((parameter) => {
113546
+ const typed = /^(NSString \*|BOOL|NSInteger|double|CGFloat)\s*(\w+)$/.exec(
113547
+ parameter.replace(/NSString \* ?/, "NSString *")
113548
+ );
113549
+ if (!typed) throw new Error(`${name3}: unparsed event parameter ${parameter}`);
113550
+ return { type: typed[1], name: typed[2] };
113551
+ });
113552
+ if (/update(?:MeasuredHeight)?:height\]/.test(body)) {
113553
+ bindings.push({
113554
+ property,
113555
+ parameters,
113556
+ event: "height",
113557
+ fields: [{ field: "height", parameter: parameters[0] }],
113558
+ sync: false
113559
+ });
113560
+ continue;
113561
+ }
113562
+ const call = /emitter->(\w+)\( ?\{([^}]*)\} ?\)/.exec(body);
113563
+ if (!call) throw new Error(`${name3}: unmapped event block ${property}`);
113564
+ const fields = [...call[2].matchAll(/\.(\w+) = ([^,]+)/g)].map(
113565
+ ([, field, expression]) => {
113566
+ const parameter = parameters.find(
113567
+ ({ name: name4 }) => new RegExp(`\\b${name4}\\b`).test(expression)
113568
+ );
113569
+ if (!parameter)
113570
+ throw new Error(`${name3}: event field ${field} reads no parameter`);
113571
+ return { field, parameter };
113572
+ }
113573
+ );
113574
+ bindings.push({
113575
+ property,
113576
+ parameters,
113577
+ fields,
113578
+ event: call[1],
113579
+ sync: body.includes("OneNativeSyncDidSetExternally")
113580
+ });
113581
+ }
113582
+ if (source.includes("OneNativeForwardSwiftStyleEvents")) {
113583
+ const parameters = ["name", "value"].map((name4) => ({ type: "NSString *", name: name4 }));
113584
+ bindings.push({
113585
+ property: "onSwiftStyleEvent",
113586
+ parameters,
113587
+ fields: parameters.map((parameter) => ({ field: parameter.name, parameter })),
113588
+ event: "onNativeSDKEvent",
113589
+ sync: false
113590
+ });
113591
+ }
113592
+ return bindings;
113593
+ }
113594
+ function configuration(name3, source) {
113595
+ const viewClass = /_nativeView = \[(\w+) new\]/.exec(source)?.[1];
113596
+ if (!viewClass) throw new Error(`${name3}: no native view class`);
113597
+ const guard = /^#if (ONE_GROUP_\w+)$/m.exec(source)?.[1];
113598
+ const update = /- \(void\)updateProps:[\s\S]*?\n\}/.exec(source)?.[0]?.replace(/\s+/g, " ");
113599
+ if (!update) throw new Error(`${name3}: no updateProps`);
113600
+ return { viewClass, guard, update };
113601
+ }
113602
+ function componentViews(one, selected) {
113603
+ const schema4 = JSON.parse((0, import_node_fs150.readFileSync)((0, import_node_path151.join)(one, "schema.json"), "utf8"));
113604
+ const folders = [(0, import_node_path151.join)(one, "ios/Generated"), (0, import_node_path151.join)(one, "ios")];
113605
+ const files2 = folders.map((folder) => new Set((0, import_node_fs150.readdirSync)(folder)));
113606
+ return schema4.components.flatMap(({ name: name3, props, commands = {} }) => {
113607
+ if (selected && !selected.includes(name3)) return [];
113608
+ const file = `${name3}ComponentView.mm`;
113609
+ const folder = folders.find((_, index) => files2[index].has(file));
113610
+ if (!folder) return [];
113611
+ const raw2 = (0, import_node_fs150.readFileSync)((0, import_node_path151.join)(folder, file), "utf8");
113612
+ const view = /\b(_\w+) = \[OneNative\w+View new\]/.exec(raw2)?.[1];
113613
+ if (!view) return [];
113614
+ const source = raw2.replace(new RegExp(`\\b${view}\\b`, "g"), "_nativeView");
113615
+ return [{ name: name3, props, commands, source, file: (0, import_node_path151.join)(folder, file) }];
113616
+ });
113617
+ }
113618
+ function swiftGuestControls(one, names) {
113619
+ const watched = [(0, import_node_path151.join)(one, "schema.json")];
113620
+ const views = componentViews(one, names);
113621
+ const entries2 = views.map(({ name: name3, props, source, file }) => {
113622
+ const { viewClass, update } = configuration(name3, source);
113623
+ const swift = (0, import_node_path151.join)((0, import_node_path151.dirname)(file), viewClass + ".swift");
113624
+ const declaration = (0, import_node_fs150.readFileSync)(swift, "utf8");
113625
+ watched.push(file, swift);
113626
+ const initializer = /public (?:override )?init\(\)/.test(declaration) ? "()" : "(frame: .zero)";
113627
+ const lines = [
113628
+ ` "${name3}": { existing, spec, style, emit in`,
113629
+ ` let view = existing as? ${viewClass} ?? ${viewClass}${initializer}`
113630
+ ];
113631
+ for (const statement of statements(update)) {
113632
+ const selector = parts(statement);
113633
+ const first = selector[0].label;
113634
+ if (first === "configureAccessibility") {
113635
+ lines.push(
113636
+ ' let access = spec["accessibility"] as? Spec ?? [:]',
113637
+ ' view.configureAccessibility(access["label"] as? String ?? "", hint: access["hint"] as? String ?? "", value: access["value"] as? String ?? "", identifier: access["identifier"] as? String ?? spec["testID"] as? String ?? "")'
113638
+ );
113639
+ continue;
113640
+ }
113641
+ const withLabel = /^(\w+)With([A-Z])(\w*)$/.exec(first);
113642
+ const args = selector.map(({ label, expression }, index) => {
113643
+ let value;
113644
+ if (expression === "OneNativeStyleDictionary(next.swiftStyle)") value = "style";
113645
+ else {
113646
+ const prop = /\bnext\.(\w+)/.exec(expression)?.[1];
113647
+ const types2 = {
113648
+ string: 'String ?? ""',
113649
+ boolean: "Bool ?? false",
113650
+ Double: "Double ?? 0",
113651
+ Int32: "Int ?? 0"
113652
+ };
113653
+ if (!prop || !types2[props[prop]?.type])
113654
+ throw new Error(`${name3}: unmapped guest argument ${expression}`);
113655
+ value = `spec["${prop}"] as? ${types2[props[prop].type]}`;
113656
+ }
113657
+ const argLabel = index ? label : withLabel ? withLabel[2].toLowerCase() + withLabel[3] : "";
113658
+ return argLabel ? argLabel + ": " + value : value;
113659
+ });
113660
+ lines.push(` view.${withLabel?.[1] ?? first}(${args.join(", ")})`);
113661
+ }
113662
+ for (const { property, parameters, fields, event, sync } of eventBindings(
113663
+ name3,
113664
+ source.replace(/\s+/g, " ")
113665
+ )) {
113666
+ if (sync) throw new Error(`${name3}: guest control requires native sync state`);
113667
+ const payload = fields.map(({ field, parameter }) => `"${field}": ${parameter.name}`).join(", ") || ":";
113668
+ const signature2 = parameters.map(({ name: name4 }) => name4).join(", ");
113669
+ lines.push(
113670
+ ` view.${property} = { ${signature2 ? signature2 + " in " : ""}emit("${event}", [${payload}]) }`
113671
+ );
113672
+ }
113673
+ lines.push(" return view", " },");
113674
+ return lines.join("\n");
113675
+ });
113676
+ for (const name3 of names) {
113677
+ if (!views.some((view) => view.name === name3))
113678
+ throw new Error(`no generated device component for ${name3}`);
113679
+ }
113680
+ return {
113681
+ source: [
113682
+ "import UIKit",
113683
+ "let guestControls: [String: (UIView?, Spec, Spec, @escaping (String, Spec) -> Void) -> UIView] = [",
113684
+ ...entries2,
113685
+ "]",
113686
+ ""
113687
+ ].join("\n"),
113688
+ watched
113689
+ };
113690
+ }
113691
+ var import_node_fs150, import_node_path151;
113692
+ var init_one_swift_control_source = __esm({
113693
+ "../peach-globals/build/one-swift-control-source.ts"() {
113694
+ "use strict";
113695
+ import_node_fs150 = require("node:fs");
113696
+ import_node_path151 = require("node:path");
113697
+ }
113698
+ });
113699
+
113476
113700
  // ../peach-globals/src/oneNativeControlsContract.ts
113477
113701
  var ONE_NATIVE_CONTROLS_PACKAGE, ONE_NATIVE_CONTROLS_CONTRACT, ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW, ONE_NATIVE_CONTROLS_NAVIGATION_SPLIT_VIEW;
113478
113702
  var init_oneNativeControlsContract = __esm({
@@ -113495,8 +113719,8 @@ var init_oneNativeControlsContract2 = __esm({
113495
113719
 
113496
113720
  // src/one-native-controls-package.ts
113497
113721
  function resolveOneNativeAppleIosDir(appRoot) {
113498
- if (appRoot && import_node_fs150.default.existsSync(import_node_path151.default.join(appRoot, "package.json"))) {
113499
- const appRequire = (0, import_node_module21.createRequire)(import_node_path151.default.join(appRoot, "package.json"));
113722
+ if (appRoot && import_node_fs151.default.existsSync(import_node_path152.default.join(appRoot, "package.json"))) {
113723
+ const appRequire = (0, import_node_module21.createRequire)(import_node_path152.default.join(appRoot, "package.json"));
113500
113724
  let oneManifest;
113501
113725
  try {
113502
113726
  oneManifest = appRequire.resolve("one/package.json");
@@ -113506,33 +113730,33 @@ function resolveOneNativeAppleIosDir(appRoot) {
113506
113730
  }
113507
113731
  }
113508
113732
  if (oneManifest) {
113509
- const installed2 = import_node_path151.default.join(import_node_path151.default.dirname(oneManifest), "native/apple/ios");
113510
- if (import_node_fs150.default.existsSync(
113511
- import_node_path151.default.join(installed2, "Generated/OneNativeNavigationStackView.swift")
113733
+ const installed2 = import_node_path152.default.join(import_node_path152.default.dirname(oneManifest), "native/apple/ios");
113734
+ if (import_node_fs151.default.existsSync(
113735
+ import_node_path152.default.join(installed2, "Generated/OneNativeNavigationStackView.swift")
113512
113736
  ))
113513
113737
  return installed2;
113514
113738
  }
113515
113739
  }
113516
- const workspace = import_node_path151.default.resolve(
113517
- import_node_path151.default.dirname((0, import_node_url8.fileURLToPath)(__sootsim_import_meta_url)),
113740
+ const workspace = import_node_path152.default.resolve(
113741
+ import_node_path152.default.dirname((0, import_node_url8.fileURLToPath)(__sootsim_import_meta_url)),
113518
113742
  "../../one-v3/native/apple/ios"
113519
113743
  );
113520
- if (!import_node_fs150.default.existsSync(import_node_path151.default.join(workspace, "Generated/OneNativeNavigationStackView.swift"))) {
113744
+ if (!import_node_fs151.default.existsSync(import_node_path152.default.join(workspace, "Generated/OneNativeNavigationStackView.swift"))) {
113521
113745
  throw new Error(`One SwiftUI native sources not found at ${workspace}`);
113522
113746
  }
113523
113747
  return workspace;
113524
113748
  }
113525
113749
  async function oneNativeControlsPackage(appRoot) {
113526
113750
  const iosDir = resolveOneNativeAppleIosDir(appRoot);
113527
- const sdkDir = import_node_path151.default.join(iosDir, "SDK");
113528
- const sdkFiles = import_node_fs150.default.readdirSync(sdkDir).filter((name3) => name3.endsWith(".swift")).sort().map((name3) => `SDK/${name3}`);
113751
+ const sdkDir = import_node_path152.default.join(iosDir, "SDK");
113752
+ const sdkFiles = import_node_fs151.default.readdirSync(sdkDir).filter((name3) => name3.endsWith(".swift")).sort().map((name3) => `SDK/${name3}`);
113529
113753
  const files2 = /* @__PURE__ */ new Map();
113530
113754
  const watched = [];
113531
113755
  const digest3 = (0, import_node_crypto89.createHash)("sha256");
113532
113756
  for (const relative5 of [...ONE_CONTROL_SOURCES, ...sdkFiles]) {
113533
- const full = import_node_path151.default.join(iosDir, relative5);
113534
- const content = import_node_fs150.default.readFileSync(full, "utf8");
113535
- const flatName = import_node_path151.default.basename(relative5);
113757
+ const full = import_node_path152.default.join(iosDir, relative5);
113758
+ const content = import_node_fs151.default.readFileSync(full, "utf8");
113759
+ const flatName = import_node_path152.default.basename(relative5);
113536
113760
  if (files2.has(flatName)) {
113537
113761
  throw new Error(`duplicate Swift filename ${flatName} in OneNativeControls`);
113538
113762
  }
@@ -113540,6 +113764,15 @@ async function oneNativeControlsPackage(appRoot) {
113540
113764
  watched.push(full);
113541
113765
  digest3.update(flatName).update("\0").update(content).update("\0");
113542
113766
  }
113767
+ const generated = swiftGuestControls(import_node_path152.default.dirname(iosDir), [
113768
+ "OneNativeButton",
113769
+ "OneNativeLabel",
113770
+ "OneNativeText",
113771
+ "OneNativeImage"
113772
+ ]);
113773
+ files2.set("OneNativeGuestControls.swift", generated.source);
113774
+ watched.push(...generated.watched);
113775
+ digest3.update("OneNativeGuestControls.swift\0").update(generated.source).update("\0");
113543
113776
  files2.set("OneNativeControlsBridge.swift", BRIDGE_SWIFT);
113544
113777
  digest3.update("OneNativeControlsBridge.swift\0").update(BRIDGE_SWIFT).update("\0");
113545
113778
  const key2 = digest3.digest("hex").slice(0, 16);
@@ -113555,28 +113788,29 @@ async function oneNativeControlsPackage(appRoot) {
113555
113788
  ""
113556
113789
  ].join("\n")
113557
113790
  );
113558
- const packagePath = import_node_path151.default.join(
113791
+ const packagePath = import_node_path152.default.join(
113559
113792
  swiftCacheDir(),
113560
113793
  "one-native-controls",
113561
113794
  key2,
113562
113795
  ONE_NATIVE_CONTROLS_PACKAGE
113563
113796
  );
113564
- import_node_fs150.default.mkdirSync(packagePath, { recursive: true });
113797
+ import_node_fs151.default.mkdirSync(packagePath, { recursive: true });
113565
113798
  syncSwiftTree(
113566
113799
  packagePath,
113567
- new Map([...files2].map(([file, text7]) => [import_node_path151.default.join(packagePath, file), text7]))
113800
+ new Map([...files2].map(([file, text7]) => [import_node_path152.default.join(packagePath, file), text7]))
113568
113801
  );
113569
113802
  return { packagePath, watched };
113570
113803
  }
113571
- var import_node_crypto89, import_node_fs150, import_node_module21, import_node_path151, import_node_url8, ONE_CONTROL_SOURCES, ONE_SDK_DEFINES, BRIDGE_SWIFT;
113804
+ var import_node_crypto89, import_node_fs151, import_node_module21, import_node_path152, import_node_url8, ONE_CONTROL_SOURCES, ONE_SDK_DEFINES, BRIDGE_SWIFT;
113572
113805
  var init_one_native_controls_package = __esm({
113573
113806
  "src/one-native-controls-package.ts"() {
113574
113807
  "use strict";
113575
113808
  import_node_crypto89 = require("node:crypto");
113576
- import_node_fs150 = __toESM(require("node:fs"), 1);
113809
+ import_node_fs151 = __toESM(require("node:fs"), 1);
113577
113810
  import_node_module21 = require("node:module");
113578
- import_node_path151 = __toESM(require("node:path"), 1);
113811
+ import_node_path152 = __toESM(require("node:path"), 1);
113579
113812
  import_node_url8 = require("node:url");
113813
+ init_one_swift_control_source();
113580
113814
  init_oneNativeControlsContract2();
113581
113815
  init_swift_compile();
113582
113816
  init_swift_host();
@@ -113585,6 +113819,7 @@ var init_one_native_controls_package = __esm({
113585
113819
  ONE_CONTROL_SOURCES = [
113586
113820
  "Generated/OneNativeNavigationSplitViewView.swift",
113587
113821
  "Generated/OneNativeNavigationStackView.swift",
113822
+ "Generated/OneNativeViewSlots.swift",
113588
113823
  "Generated/OneNativeToolbarView.swift",
113589
113824
  "Generated/OneNativeListView.swift",
113590
113825
  "Generated/OneNativeSectionView.swift",
@@ -113615,7 +113850,7 @@ var init_one_native_controls_package = __esm({
113615
113850
  @_spi(Peach) import UIKit
113616
113851
  import PeachJSON
113617
113852
 
113618
- private typealias Spec = [String: Any]
113853
+ typealias Spec = [String: Any]
113619
113854
 
113620
113855
  private func platformColor(named name: String) -> UIColor? {
113621
113856
  switch name {
@@ -113757,11 +113992,6 @@ private class ControlComposition {
113757
113992
  let spec = node["spec"] as! Spec
113758
113993
  let control = spec["control"] as! String
113759
113994
  let style = normalizeStyle(spec["swiftStyle"] as? Spec)
113760
- let access = spec["accessibility"] as? Spec ?? [:]
113761
- let label = access["label"] as? String ?? ""
113762
- let hint = access["hint"] as? String ?? ""
113763
- let value = access["value"] as? String ?? ""
113764
- let identifier = access["identifier"] as? String ?? spec["testID"] as? String ?? ""
113765
113995
  let visit: (String, String) -> Void = { [weak self] name, value in
113766
113996
  self?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
113767
113997
  }
@@ -113789,42 +114019,6 @@ private class ControlComposition {
113789
114019
  marker.configureStyle(style)
113790
114020
  marker.setOnSDKEvent(visit)
113791
114021
  view = marker
113792
- case "OneNativeButton":
113793
- let button = views[id] as? OneNativeButtonView ?? OneNativeButtonView()
113794
- button.configure(buttonRole: spec["buttonRole"] as? String ?? "")
113795
- button.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
113796
- button.onAction = { [weak self] count in
113797
- self?.send(id, "onNativeButtonPress", ["eventCount": count])
113798
- }
113799
- view = button
113800
- case "OneNativeLabel":
113801
- let labelView = views[id] as? OneNativeLabelView ?? OneNativeLabelView(frame: .zero)
113802
- labelView.configure(spec["label"] as? String ?? "", systemImage: spec["systemImage"] as? String ?? "")
113803
- labelView.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
113804
- labelView.configureStyle(style)
113805
- labelView.onSDKEvent = visit
113806
- view = labelView
113807
- case "OneNativeText":
113808
- let text = views[id] as? OneNativeTextView ?? OneNativeTextView(frame: .zero)
113809
- text.configure(spec["text"] as? String ?? "")
113810
- text.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
113811
- text.configureStyle(style)
113812
- text.onSDKEvent = visit
113813
- view = text
113814
- case "OneNativeImage":
113815
- let image = views[id] as? OneNativeImageView ?? OneNativeImageView(frame: .zero)
113816
- image.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
113817
- image.configureStyle(style)
113818
- image.configure(
113819
- spec["systemName"] as? String ?? "",
113820
- uri: spec["uri"] as? String ?? "",
113821
- renderingMode: spec["renderingMode"] as? String ?? "original",
113822
- variableValue: spec["variableValue"] as? Double ?? 0,
113823
- hasVariableValue: spec["hasVariableValue"] as? Bool ?? false,
113824
- resizable: spec["resizable"] as? Bool ?? false
113825
- )
113826
- image.onSDKEvent = visit
113827
- view = image
113828
114022
  case "OneNativeContainerSlot":
113829
114023
  let slot = views[id] as? OneNativeContainerSlotView ?? OneNativeContainerSlotView(frame: .zero)
113830
114024
  let host = slots[id] ?? UIView(frame: .zero)
@@ -113836,7 +114030,8 @@ private class ControlComposition {
113836
114030
  slot.onSwiftStyleEvent = visit
113837
114031
  view = slot
113838
114032
  default:
113839
- preconditionFailure("unsupported One toolbar child \\(control)")
114033
+ guard let mount = guestControls[control] else { preconditionFailure("unsupported One toolbar child \\(control)") }
114034
+ view = mount(views[id], spec, style) { [weak self] event, fields in self?.send(id, event, fields) }
113840
114035
  }
113841
114036
  views[id] = view
113842
114037
  if let container = view as? OneNativeContainerView {
@@ -113864,13 +114059,79 @@ private class ControlComposition {
113864
114059
  }
113865
114060
  }
113866
114061
 
114062
+ private struct NavigationDestinationSlot: Identifiable, Equatable {
114063
+ let id: String
114064
+ let contentHost: String
114065
+ let slotValues: String
114066
+ let title: String
114067
+ let titleMode: String
114068
+ let barHidden: Bool
114069
+ }
114070
+
114071
+ private final class NavigationDestinationSlots: ObservableObject {
114072
+ @Published var slots: [NavigationDestinationSlot] = []
114073
+ var hosts: [String: UIView] = [:]
114074
+ var onSDKEvent: ((String, String, String) -> Void)?
114075
+ }
114076
+
114077
+ private struct NavigationDestinationModifiers: View {
114078
+ @ObservedObject var model: NavigationDestinationSlots
114079
+
114080
+ var body: some View {
114081
+ ForEach(model.slots) { slot in
114082
+ Color.clear.frame(width: 0, height: 0)
114083
+ .oneNativeViewSlot(OneNativeViewSlotName.navigationDestination, values: slot.slotValues, emit: { name, value in
114084
+ model.onSDKEvent?(slot.id, name, value)
114085
+ }) {
114086
+ let content = OneNativeSlot(content: model.hosts[slot.id]!, mode: .fill)
114087
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
114088
+ .ignoresSafeArea([.container, .keyboard], edges: .bottom)
114089
+ .navigationTitle(slot.title)
114090
+ .navigationBarTitleDisplayMode(slot.titleMode == "inline" ? .inline : slot.titleMode == "large" ? .large : .automatic)
114091
+ return AnyView(content.toolbarVisibility(slot.barHidden ? .hidden : .automatic, for: .navigationBar))
114092
+ }
114093
+ }
114094
+ }
114095
+ }
114096
+
113867
114097
  private struct NavigationStackBridge: UIViewRepresentable {
113868
114098
  let spec: Spec
113869
114099
  let emit: (String, String) -> Void
113870
114100
 
113871
114101
  final class Coordinator: ControlComposition {
113872
114102
  let slot = UIView(frame: .zero)
114103
+ let destinations = NavigationDestinationSlots()
114104
+ var destinationController: UIHostingController<NavigationDestinationModifiers>?
113873
114105
  var toolbars: [OneNativeToolbarView] = []
114106
+
114107
+ func updateDestinations(_ specs: [Spec]) {
114108
+ let next = specs.map { spec in
114109
+ NavigationDestinationSlot(
114110
+ id: spec["id"] as! String,
114111
+ contentHost: spec["contentHost"] as! String,
114112
+ slotValues: spec["slotValues"] as! String,
114113
+ title: spec["title"] as? String ?? "",
114114
+ titleMode: spec["titleMode"] as? String ?? "automatic",
114115
+ barHidden: spec["barHidden"] as? Bool ?? false
114116
+ )
114117
+ }
114118
+ guard destinations.slots != next else { return }
114119
+ destinations.hosts = Dictionary(uniqueKeysWithValues: next.map { item in
114120
+ let host = destinations.hosts[item.id] ?? UIView(frame: .zero)
114121
+ host._peachReactContentHost = item.contentHost
114122
+ return (item.id, host)
114123
+ })
114124
+ destinations.slots = next
114125
+ if destinationController == nil {
114126
+ let controller = UIHostingController(rootView: NavigationDestinationModifiers(model: destinations))
114127
+ controller.view.frame = .zero
114128
+ controller.view.isUserInteractionEnabled = false
114129
+ controller.view.backgroundColor = .clear
114130
+ slot.addSubview(controller.view)
114131
+ destinationController = controller
114132
+ }
114133
+ destinationController?.view.setNeedsDisplay()
114134
+ }
113874
114135
  }
113875
114136
 
113876
114137
  func makeCoordinator() -> Coordinator { Coordinator() }
@@ -113891,6 +114152,10 @@ private struct NavigationStackBridge: UIViewRepresentable {
113891
114152
  let id = root["id"] as! String
113892
114153
  let rootSpec = root["spec"] as! Spec
113893
114154
  state.slot._peachReactContentHost = spec["contentHost"] as? String
114155
+ state.destinations.onSDKEvent = { [weak state] id, name, value in
114156
+ state?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
114157
+ }
114158
+ state.updateDestinations(spec["destinationSlots"] as? [Spec] ?? [])
113894
114159
  stack.onSDKEvent = { [weak state] name, value in
113895
114160
  state?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
113896
114161
  }
@@ -113911,6 +114176,8 @@ private struct NavigationStackBridge: UIViewRepresentable {
113911
114176
 
113912
114177
  static func dismantleUIView(_ view: OneNativeNavigationStackView, coordinator: Coordinator) {
113913
114178
  view.unmountContent(coordinator.slot)
114179
+ coordinator.destinationController?.view.removeFromSuperview()
114180
+ coordinator.destinationController = nil
113914
114181
  for toolbar in coordinator.toolbars { view.unmountToolbar(toolbar) }
113915
114182
  coordinator.prune(keeping: [])
113916
114183
  coordinator.toolbars.removeAll()
@@ -114161,13 +114428,13 @@ struct OneNativeControlsGuest: PeachPackage {
114161
114428
  // src/one-native-app-config.ts
114162
114429
  function oneConfigPath(root) {
114163
114430
  for (const name3 of CONFIG_FILES) {
114164
- const file = import_node_path152.default.join(root, name3);
114165
- if (import_node_fs151.default.existsSync(file)) return file;
114431
+ const file = import_node_path153.default.join(root, name3);
114432
+ if (import_node_fs152.default.existsSync(file)) return file;
114166
114433
  }
114167
114434
  return null;
114168
114435
  }
114169
114436
  function readModule2(file) {
114170
- const { code } = (0, import_sucrase4.transform)(import_node_fs151.default.readFileSync(file, "utf8"), {
114437
+ const { code } = (0, import_sucrase4.transform)(import_node_fs152.default.readFileSync(file, "utf8"), {
114171
114438
  transforms: /\.[cm]?tsx?$/.test(file) ? ["typescript"] : [],
114172
114439
  disableESTransforms: true
114173
114440
  });
@@ -114190,9 +114457,9 @@ function resolveName(module2, name3, seen) {
114190
114457
  if (!source.startsWith(".")) continue;
114191
114458
  for (const specifier of statement.specifiers) {
114192
114459
  if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
114193
- const base2 = import_node_path152.default.resolve(import_node_path152.default.dirname(module2.file), source);
114460
+ const base2 = import_node_path153.default.resolve(import_node_path153.default.dirname(module2.file), source);
114194
114461
  const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
114195
- (file) => import_node_fs151.default.existsSync(file) && import_node_fs151.default.statSync(file).isFile()
114462
+ (file) => import_node_fs152.default.existsSync(file) && import_node_fs152.default.statSync(file).isFile()
114196
114463
  );
114197
114464
  if (!target) return NOT_STATIC;
114198
114465
  const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
@@ -114263,12 +114530,12 @@ function readOneNativeApp(root) {
114263
114530
  });
114264
114531
  return app;
114265
114532
  }
114266
- var import_node_fs151, import_node_path152, import_acorn3, import_sucrase4, CONFIG_FILES, MODULE_EXTENSIONS, NOT_STATIC;
114533
+ var import_node_fs152, import_node_path153, import_acorn3, import_sucrase4, CONFIG_FILES, MODULE_EXTENSIONS, NOT_STATIC;
114267
114534
  var init_one_native_app_config = __esm({
114268
114535
  "src/one-native-app-config.ts"() {
114269
114536
  "use strict";
114270
- import_node_fs151 = __toESM(require("node:fs"), 1);
114271
- import_node_path152 = __toESM(require("node:path"), 1);
114537
+ import_node_fs152 = __toESM(require("node:fs"), 1);
114538
+ import_node_path153 = __toESM(require("node:path"), 1);
114272
114539
  import_acorn3 = require("peachsim/vendor/acorn");
114273
114540
  import_sucrase4 = require("peachsim/vendor/sucrase");
114274
114541
  init_estree_walk();
@@ -114321,7 +114588,7 @@ function readConfig(root) {
114321
114588
  return {
114322
114589
  widget,
114323
114590
  urlSchemes,
114324
- watched: [import_node_path153.default.join(root, "package.json"), ...configPath ? [configPath] : []]
114591
+ watched: [import_node_path154.default.join(root, "package.json"), ...configPath ? [configPath] : []]
114325
114592
  };
114326
114593
  }
114327
114594
  function declaredFamilies(source) {
@@ -114335,13 +114602,13 @@ function declaredFamilies(source) {
114335
114602
  return home;
114336
114603
  }
114337
114604
  async function readOneWidgetSources(appRoot) {
114338
- const root = import_node_fs152.default.realpathSync(appRoot);
114605
+ const root = import_node_fs153.default.realpathSync(appRoot);
114339
114606
  const config = readConfig(root);
114340
114607
  if (!config.widget) return null;
114341
114608
  const widget = config.widget;
114342
114609
  const sourceFiles2 = {
114343
- "OneWidget.swift": import_node_path153.default.join(root, "ios/OneWidgets/OneWidget.swift"),
114344
- "OneWidgetContract.swift": import_node_path153.default.join(
114610
+ "OneWidget.swift": import_node_path154.default.join(root, "ios/OneWidgets/OneWidget.swift"),
114611
+ "OneWidgetContract.swift": import_node_path154.default.join(
114345
114612
  root,
114346
114613
  "ios",
114347
114614
  widget.appName,
@@ -114351,14 +114618,14 @@ async function readOneWidgetSources(appRoot) {
114351
114618
  const files2 = /* @__PURE__ */ new Map();
114352
114619
  const sources = {};
114353
114620
  for (const [name3, file] of Object.entries(sourceFiles2)) {
114354
- if (!import_node_fs152.default.existsSync(file))
114621
+ if (!import_node_fs153.default.existsSync(file))
114355
114622
  throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
114356
114623
  const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
114357
114624
  const text7 = bytes.toString("utf8");
114358
114625
  if (!Buffer.from(text7).equals(bytes))
114359
114626
  throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
114360
114627
  files2.set(name3, text7);
114361
- sources[import_node_path153.default.relative(root, file).split(import_node_path153.default.sep).join("/")] = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
114628
+ sources[import_node_path154.default.relative(root, file).split(import_node_path154.default.sep).join("/")] = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
114362
114629
  }
114363
114630
  const contract = files2.get("OneWidgetContract.swift") ?? "";
114364
114631
  const source = files2.get("OneWidget.swift") ?? "";
@@ -114388,13 +114655,13 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
114388
114655
  urlSchemes: source.urlSchemes
114389
114656
  };
114390
114657
  }
114391
- var import_node_crypto90, import_node_fs152, import_node_path153, ONE_WIDGET_PACKAGE, nonEmpty;
114658
+ var import_node_crypto90, import_node_fs153, import_node_path154, ONE_WIDGET_PACKAGE, nonEmpty;
114392
114659
  var init_one_widget_metadata = __esm({
114393
114660
  "src/one-widget-metadata.ts"() {
114394
114661
  "use strict";
114395
114662
  import_node_crypto90 = require("node:crypto");
114396
- import_node_fs152 = __toESM(require("node:fs"), 1);
114397
- import_node_path153 = __toESM(require("node:path"), 1);
114663
+ import_node_fs153 = __toESM(require("node:fs"), 1);
114664
+ import_node_path154 = __toESM(require("node:path"), 1);
114398
114665
  init_is_record();
114399
114666
  init_one_native_app_config();
114400
114667
  init_oneWidgetContract();
@@ -114423,16 +114690,16 @@ async function oneWidgetPackage(appRoot) {
114423
114690
  ""
114424
114691
  ].join("\n")
114425
114692
  );
114426
- const packagePath = import_node_path154.default.join(
114693
+ const packagePath = import_node_path155.default.join(
114427
114694
  import_node_os32.default.tmpdir(),
114428
114695
  "peach-one-widgets",
114429
114696
  (0, import_node_crypto91.createHash)("sha256").update(root).digest("hex"),
114430
114697
  ONE_WIDGET_PACKAGE
114431
114698
  );
114432
- import_node_fs153.default.mkdirSync(packagePath, { recursive: true });
114699
+ import_node_fs154.default.mkdirSync(packagePath, { recursive: true });
114433
114700
  syncSwiftTree(
114434
114701
  packagePath,
114435
- new Map([...files2].map(([file, text7]) => [import_node_path154.default.join(packagePath, file), text7]))
114702
+ new Map([...files2].map(([file, text7]) => [import_node_path155.default.join(packagePath, file), text7]))
114436
114703
  );
114437
114704
  return {
114438
114705
  packagePath,
@@ -114440,14 +114707,14 @@ async function oneWidgetPackage(appRoot) {
114440
114707
  widget
114441
114708
  };
114442
114709
  }
114443
- var import_node_crypto91, import_node_fs153, import_node_os32, import_node_path154;
114710
+ var import_node_crypto91, import_node_fs154, import_node_os32, import_node_path155;
114444
114711
  var init_one_widget_package = __esm({
114445
114712
  "src/one-widget-package.ts"() {
114446
114713
  "use strict";
114447
114714
  import_node_crypto91 = require("node:crypto");
114448
- import_node_fs153 = __toESM(require("node:fs"), 1);
114715
+ import_node_fs154 = __toESM(require("node:fs"), 1);
114449
114716
  import_node_os32 = __toESM(require("node:os"), 1);
114450
- import_node_path154 = __toESM(require("node:path"), 1);
114717
+ import_node_path155 = __toESM(require("node:path"), 1);
114451
114718
  init_one_widget_metadata();
114452
114719
  init_swift_compile();
114453
114720
  init_one_widget_metadata();
@@ -114499,27 +114766,27 @@ function readBridgeFiles(output) {
114499
114766
  });
114500
114767
  }
114501
114768
  function androidAppSources(appRoot) {
114502
- const moduleDir = import_node_path155.default.join(appRoot, "android", "app");
114503
- const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path155.default.join(moduleDir, name3)).find((file) => import_node_fs154.default.existsSync(file));
114769
+ const moduleDir = import_node_path156.default.join(appRoot, "android", "app");
114770
+ const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path156.default.join(moduleDir, name3)).find((file) => import_node_fs155.default.existsSync(file));
114504
114771
  if (!gradle) return null;
114505
114772
  const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
114506
- import_node_fs154.default.readFileSync(gradle, "utf8")
114773
+ import_node_fs155.default.readFileSync(gradle, "utf8")
114507
114774
  );
114508
114775
  if (!id) throw new Error(`${gradle}: no applicationId`);
114509
114776
  const kotlin = [];
114510
114777
  const java = [];
114511
114778
  const walk4 = (dir) => {
114512
- if (!import_node_fs154.default.existsSync(dir)) return;
114513
- for (const child of import_node_fs154.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
114514
- const file = import_node_path155.default.join(dir, child.name);
114779
+ if (!import_node_fs155.default.existsSync(dir)) return;
114780
+ for (const child of import_node_fs155.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
114781
+ const file = import_node_path156.default.join(dir, child.name);
114515
114782
  if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
114516
114783
  if (child.isDirectory()) walk4(file);
114517
114784
  else if (child.name.endsWith(".kt")) kotlin.push(file);
114518
114785
  else if (child.name.endsWith(".java")) java.push(file);
114519
114786
  }
114520
114787
  };
114521
- walk4(import_node_path155.default.join(moduleDir, "src", "main", "java"));
114522
- walk4(import_node_path155.default.join(moduleDir, "src", "main", "kotlin"));
114788
+ walk4(import_node_path156.default.join(moduleDir, "src", "main", "java"));
114789
+ walk4(import_node_path156.default.join(moduleDir, "src", "main", "kotlin"));
114523
114790
  return { applicationId: id[1], kotlin, java };
114524
114791
  }
114525
114792
  function declares(source, owner, name3) {
@@ -114528,7 +114795,7 @@ function declares(source, owner, name3) {
114528
114795
  }
114529
114796
  function selectBridgePackages(applicationId, files2, javaFiles) {
114530
114797
  const texts = new Map(
114531
- files2.map((file) => [file.file, import_node_fs154.default.readFileSync(file.file, "utf8")])
114798
+ files2.map((file) => [file.file, import_node_fs155.default.readFileSync(file.file, "utf8")])
114532
114799
  );
114533
114800
  const owners = /* @__PURE__ */ new Map();
114534
114801
  for (const file of files2)
@@ -114536,8 +114803,8 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
114536
114803
  owners.set(name3, [...owners.get(name3) ?? [], file]);
114537
114804
  const javaDeclarations = javaFiles.map((file) => ({
114538
114805
  file,
114539
- package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs154.default.readFileSync(file, "utf8"))?.[1] ?? "",
114540
- name: import_node_path155.default.basename(file, ".java")
114806
+ package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs155.default.readFileSync(file, "utf8"))?.[1] ?? "",
114807
+ name: import_node_path156.default.basename(file, ".java")
114541
114808
  }));
114542
114809
  const closure = (root) => {
114543
114810
  const seen = /* @__PURE__ */ new Set([root]);
@@ -114610,12 +114877,12 @@ function moduleName(text7, className2) {
114610
114877
  );
114611
114878
  return match ? match[1] : null;
114612
114879
  }
114613
- var import_node_fs154, import_node_path155, qualified2;
114880
+ var import_node_fs155, import_node_path156, qualified2;
114614
114881
  var init_android_bridge_packages = __esm({
114615
114882
  "src/android-bridge-packages.ts"() {
114616
114883
  "use strict";
114617
- import_node_fs154 = __toESM(require("node:fs"), 1);
114618
- import_node_path155 = __toESM(require("node:path"), 1);
114884
+ import_node_fs155 = __toESM(require("node:fs"), 1);
114885
+ import_node_path156 = __toESM(require("node:path"), 1);
114619
114886
  init_is_record();
114620
114887
  qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
114621
114888
  }
@@ -114661,17 +114928,17 @@ var init_android_view_classes = __esm({
114661
114928
  // src/java-module-abi.ts
114662
114929
  async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
114663
114930
  const digest3 = (0, import_node_crypto92.createHash)("sha256");
114664
- const parent = import_node_path156.default.join(kotlinHome(), "java-specs");
114665
- import_node_fs155.default.mkdirSync(parent, { recursive: true });
114666
- const work = import_node_fs155.default.mkdtempSync(import_node_path156.default.join(parent, ".read-"));
114931
+ const parent = import_node_path157.default.join(kotlinHome(), "java-specs");
114932
+ import_node_fs156.default.mkdirSync(parent, { recursive: true });
114933
+ const work = import_node_fs156.default.mkdtempSync(import_node_path157.default.join(parent, ".read-"));
114667
114934
  try {
114668
114935
  const origins = /* @__PURE__ */ new Map();
114669
114936
  for (const [index, file] of files2.entries()) {
114670
- const bytes = import_node_fs155.default.readFileSync(file);
114937
+ const bytes = import_node_fs156.default.readFileSync(file);
114671
114938
  digest3.update(file).update("\0").update(bytes).update("\0");
114672
- const target = import_node_path156.default.join(work, String(index), import_node_path156.default.basename(file));
114673
- import_node_fs155.default.mkdirSync(import_node_path156.default.dirname(target));
114674
- import_node_fs155.default.writeFileSync(target, bytes);
114939
+ const target = import_node_path157.default.join(work, String(index), import_node_path157.default.basename(file));
114940
+ import_node_fs156.default.mkdirSync(import_node_path157.default.dirname(target));
114941
+ import_node_fs156.default.writeFileSync(target, bytes);
114675
114942
  origins.set(target, file);
114676
114943
  }
114677
114944
  const stdout = await runKotlinTool(
@@ -114704,20 +114971,20 @@ ${diagnostic.trim()}`, { cause });
114704
114971
  });
114705
114972
  return { sha256: digest3.digest("hex"), specs };
114706
114973
  } finally {
114707
- import_node_fs155.default.rmSync(work, { recursive: true, force: true });
114974
+ import_node_fs156.default.rmSync(work, { recursive: true, force: true });
114708
114975
  }
114709
114976
  }
114710
114977
  async function compileJavaModuleAbi(input) {
114711
114978
  const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
114712
- const directory2 = import_node_path156.default.join(work, "java-abi");
114713
- import_node_fs155.default.mkdirSync(directory2);
114979
+ const directory2 = import_node_path157.default.join(work, "java-abi");
114980
+ import_node_fs156.default.mkdirSync(directory2);
114714
114981
  const sources = specs.specs.map((spec, index) => {
114715
- const target = import_node_path156.default.join(directory2, `Spec${index}.kt`);
114716
- import_node_fs155.default.writeFileSync(target, spec.source);
114982
+ const target = import_node_path157.default.join(directory2, `Spec${index}.kt`);
114983
+ import_node_fs156.default.writeFileSync(target, spec.source);
114717
114984
  return target;
114718
114985
  });
114719
- const initializer = import_node_path156.default.join(directory2, "Bindings.kt");
114720
- import_node_fs155.default.writeFileSync(
114986
+ const initializer = import_node_path157.default.join(directory2, "Bindings.kt");
114987
+ import_node_fs156.default.writeFileSync(
114721
114988
  initializer,
114722
114989
  [
114723
114990
  "package dev.peach.jni",
@@ -114731,8 +114998,8 @@ async function compileJavaModuleAbi(input) {
114731
114998
  "-J-Xmx2g",
114732
114999
  "-Xwasm-target=js",
114733
115000
  "-libraries",
114734
- libraries.join(import_node_path156.default.delimiter),
114735
- `-Xplugin=${import_node_path156.default.join(sdkRoot, "plugin.jar")}`,
115001
+ libraries.join(import_node_path157.default.delimiter),
115002
+ `-Xplugin=${import_node_path157.default.join(sdkRoot, "plugin.jar")}`,
114736
115003
  `-Xfriend-modules=${sdkLibrary}`,
114737
115004
  "-language-version",
114738
115005
  language,
@@ -114748,23 +115015,23 @@ async function compileJavaModuleAbi(input) {
114748
115015
  ],
114749
115016
  { maxBuffer: 16 * 1024 * 1024 }
114750
115017
  );
114751
- const library = import_node_path156.default.join(directory2, "java-abi.klib");
115018
+ const library = import_node_path157.default.join(directory2, "java-abi.klib");
114752
115019
  await runKotlinTool(
114753
115020
  toolchain,
114754
115021
  sdkRoot,
114755
115022
  "dev.peach.tools.platform.JavaPlatformTypesKt",
114756
- [import_node_path156.default.join(directory2, `${name3}.klib`), library]
115023
+ [import_node_path157.default.join(directory2, `${name3}.klib`), library]
114757
115024
  );
114758
115025
  return library;
114759
115026
  }
114760
- var import_node_child_process72, import_node_crypto92, import_node_fs155, import_node_path156, import_node_util18, run13, JAVA_BINDINGS_INITIALIZER;
115027
+ var import_node_child_process72, import_node_crypto92, import_node_fs156, import_node_path157, import_node_util18, run13, JAVA_BINDINGS_INITIALIZER;
114761
115028
  var init_java_module_abi = __esm({
114762
115029
  "src/java-module-abi.ts"() {
114763
115030
  "use strict";
114764
115031
  import_node_child_process72 = require("node:child_process");
114765
115032
  import_node_crypto92 = require("node:crypto");
114766
- import_node_fs155 = __toESM(require("node:fs"), 1);
114767
- import_node_path156 = __toESM(require("node:path"), 1);
115033
+ import_node_fs156 = __toESM(require("node:fs"), 1);
115034
+ import_node_path157 = __toESM(require("node:path"), 1);
114768
115035
  import_node_util18 = require("node:util");
114769
115036
  init_android_bridge_packages();
114770
115037
  init_is_record();
@@ -115002,22 +115269,22 @@ var init_kotlinSdkContract = __esm({
115002
115269
  // src/kotlin-sdk.ts
115003
115270
  function verifyKotlinSdkDirectory(root, compiler) {
115004
115271
  const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
115005
- const names = import_node_fs156.default.readdirSync(root);
115272
+ const names = import_node_fs157.default.readdirSync(root);
115006
115273
  if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
115007
115274
  throw new Error("Kotlin SDK directory contains unexpected inputs");
115008
- const manifestStat = import_node_fs156.default.lstatSync(import_node_path157.default.join(root, "manifest.json"));
115275
+ const manifestStat = import_node_fs157.default.lstatSync(import_node_path158.default.join(root, "manifest.json"));
115009
115276
  if (!manifestStat.isFile() || manifestStat.nlink !== 1)
115010
115277
  throw new Error("Kotlin SDK manifest is not a regular file");
115011
115278
  const manifest = readKotlinSdkManifest(
115012
- import_node_fs156.default.readFileSync(import_node_path157.default.join(root, "manifest.json"), "utf8"),
115279
+ import_node_fs157.default.readFileSync(import_node_path158.default.join(root, "manifest.json"), "utf8"),
115013
115280
  compiler.upstreamSha256
115014
115281
  );
115015
115282
  for (const [name3, expected] of Object.entries(manifest.files)) {
115016
- const target = import_node_path157.default.join(root, name3);
115017
- const stat2 = import_node_fs156.default.lstatSync(target);
115283
+ const target = import_node_path158.default.join(root, name3);
115284
+ const stat2 = import_node_fs157.default.lstatSync(target);
115018
115285
  if (!stat2.isFile() || stat2.nlink !== 1)
115019
115286
  throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
115020
- const bytes = import_node_fs156.default.readFileSync(target);
115287
+ const bytes = import_node_fs157.default.readFileSync(target);
115021
115288
  if (bytes.length !== expected.bytes || (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
115022
115289
  throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
115023
115290
  }
@@ -115025,42 +115292,42 @@ function verifyKotlinSdkDirectory(root, compiler) {
115025
115292
  }
115026
115293
  async function installKotlinSdkArchive(archive, compiler) {
115027
115294
  const sha2565 = (0, import_node_crypto93.createHash)("sha256").update(archive).digest("hex");
115028
- const parent = import_node_path157.default.join(kotlinHome(), "sdk");
115029
- const root = import_node_path157.default.join(parent, sha2565);
115030
- if (import_node_fs156.default.existsSync(root))
115295
+ const parent = import_node_path158.default.join(kotlinHome(), "sdk");
115296
+ const root = import_node_path158.default.join(parent, sha2565);
115297
+ if (import_node_fs157.default.existsSync(root))
115031
115298
  return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
115032
- import_node_fs156.default.mkdirSync(parent, { recursive: true });
115033
- const work = import_node_fs156.default.mkdtempSync(import_node_path157.default.join(parent, ".install-"));
115299
+ import_node_fs157.default.mkdirSync(parent, { recursive: true });
115300
+ const work = import_node_fs157.default.mkdtempSync(import_node_path158.default.join(parent, ".install-"));
115034
115301
  try {
115035
- const packed = import_node_path157.default.join(work, "sdk.tar.gz");
115036
- import_node_fs156.default.writeFileSync(packed, archive);
115302
+ const packed = import_node_path158.default.join(work, "sdk.tar.gz");
115303
+ import_node_fs157.default.writeFileSync(packed, archive);
115037
115304
  const { stdout } = await run14("tar", ["-tzf", packed]);
115038
115305
  const names = stdout.trim().split("\n");
115039
115306
  const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
115040
115307
  if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
115041
115308
  throw new Error("Kotlin SDK archive contains unexpected inputs");
115042
115309
  await run14("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
115043
- import_node_fs156.default.rmSync(packed);
115310
+ import_node_fs157.default.rmSync(packed);
115044
115311
  const manifest = verifyKotlinSdkDirectory(work, compiler);
115045
115312
  try {
115046
- import_node_fs156.default.renameSync(work, root);
115313
+ import_node_fs157.default.renameSync(work, root);
115047
115314
  } catch (error) {
115048
- if (!import_node_fs156.default.existsSync(root)) throw error;
115315
+ if (!import_node_fs157.default.existsSync(root)) throw error;
115049
115316
  verifyKotlinSdkDirectory(root, compiler);
115050
115317
  }
115051
115318
  return { root, sha256: sha2565, manifest };
115052
115319
  } finally {
115053
- import_node_fs156.default.rmSync(work, { recursive: true, force: true });
115320
+ import_node_fs157.default.rmSync(work, { recursive: true, force: true });
115054
115321
  }
115055
115322
  }
115056
- var import_node_child_process73, import_node_crypto93, import_node_fs156, import_node_path157, import_node_util19, run14;
115323
+ var import_node_child_process73, import_node_crypto93, import_node_fs157, import_node_path158, import_node_util19, run14;
115057
115324
  var init_kotlin_sdk = __esm({
115058
115325
  "src/kotlin-sdk.ts"() {
115059
115326
  "use strict";
115060
115327
  import_node_child_process73 = require("node:child_process");
115061
115328
  import_node_crypto93 = require("node:crypto");
115062
- import_node_fs156 = __toESM(require("node:fs"), 1);
115063
- import_node_path157 = __toESM(require("node:path"), 1);
115329
+ import_node_fs157 = __toESM(require("node:fs"), 1);
115330
+ import_node_path158 = __toESM(require("node:path"), 1);
115064
115331
  import_node_util19 = require("node:util");
115065
115332
  init_kotlin_toolchain();
115066
115333
  init_kotlinSdkContract();
@@ -115191,45 +115458,45 @@ var init_kotlin_view_models = __esm({
115191
115458
 
115192
115459
  // src/kotlin-module.ts
115193
115460
  function peachKotlinModuleRoot() {
115194
- if (!IS_STANDALONE) return import_node_path158.default.join(peachsimPackageRoot(), "kotlin");
115461
+ if (!IS_STANDALONE) return import_node_path159.default.join(peachsimPackageRoot(), "kotlin");
115195
115462
  if (installedRoot) return installedRoot;
115196
115463
  const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
115197
115464
  const digest3 = (0, import_node_crypto94.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
115198
- const parent = import_node_path158.default.join(rnxHomeDir(), "kotlin", "modules");
115199
- const root = import_node_path158.default.join(parent, digest3);
115200
- import_node_fs157.default.mkdirSync(parent, { recursive: true });
115201
- if (!import_node_fs157.default.existsSync(root)) {
115202
- const pending = import_node_fs157.default.mkdtempSync(import_node_path158.default.join(parent, ".install-"));
115465
+ const parent = import_node_path159.default.join(rnxHomeDir(), "kotlin", "modules");
115466
+ const root = import_node_path159.default.join(parent, digest3);
115467
+ import_node_fs158.default.mkdirSync(parent, { recursive: true });
115468
+ if (!import_node_fs158.default.existsSync(root)) {
115469
+ const pending = import_node_fs158.default.mkdtempSync(import_node_path159.default.join(parent, ".install-"));
115203
115470
  try {
115204
115471
  for (const [name3, contents2] of Object.entries(files2)) {
115205
- const file = import_node_path158.default.join(pending, name3);
115206
- import_node_fs157.default.mkdirSync(import_node_path158.default.dirname(file), { recursive: true });
115207
- import_node_fs157.default.writeFileSync(file, Buffer.from(contents2, "base64"));
115472
+ const file = import_node_path159.default.join(pending, name3);
115473
+ import_node_fs158.default.mkdirSync(import_node_path159.default.dirname(file), { recursive: true });
115474
+ import_node_fs158.default.writeFileSync(file, Buffer.from(contents2, "base64"));
115208
115475
  }
115209
115476
  try {
115210
- import_node_fs157.default.renameSync(pending, root);
115477
+ import_node_fs158.default.renameSync(pending, root);
115211
115478
  } catch (error) {
115212
115479
  if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
115213
115480
  throw error;
115214
115481
  }
115215
115482
  } finally {
115216
- import_node_fs157.default.rmSync(pending, { recursive: true, force: true });
115483
+ import_node_fs158.default.rmSync(pending, { recursive: true, force: true });
115217
115484
  }
115218
115485
  }
115219
115486
  for (const [name3, contents2] of Object.entries(files2)) {
115220
- if (!import_node_fs157.default.readFileSync(import_node_path158.default.join(root, name3)).equals(Buffer.from(contents2, "base64")))
115487
+ if (!import_node_fs158.default.readFileSync(import_node_path159.default.join(root, name3)).equals(Buffer.from(contents2, "base64")))
115221
115488
  throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
115222
115489
  }
115223
115490
  installedRoot = root;
115224
115491
  return root;
115225
115492
  }
115226
- var import_node_crypto94, import_node_fs157, import_node_path158, installedRoot;
115493
+ var import_node_crypto94, import_node_fs158, import_node_path159, installedRoot;
115227
115494
  var init_kotlin_module = __esm({
115228
115495
  "src/kotlin-module.ts"() {
115229
115496
  "use strict";
115230
115497
  import_node_crypto94 = require("node:crypto");
115231
- import_node_fs157 = __toESM(require("node:fs"), 1);
115232
- import_node_path158 = __toESM(require("node:path"), 1);
115498
+ import_node_fs158 = __toESM(require("node:fs"), 1);
115499
+ import_node_path159 = __toESM(require("node:path"), 1);
115233
115500
  init_standalone();
115234
115501
  init_home_paths();
115235
115502
  init_is_record();
@@ -115253,16 +115520,16 @@ async function resolveAndroidGradleSources(request) {
115253
115520
  includeDependencySources = false
115254
115521
  } = request;
115255
115522
  if (projectDirs.length === 0) return [];
115256
- if (!import_node_path159.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path159.default.isAbsolute(dir)))
115523
+ if (!import_node_path160.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path160.default.isAbsolute(dir)))
115257
115524
  throw new Error("Android Gradle source selection requires absolute project paths");
115258
115525
  if (!variant2) throw new Error("Android Gradle source selection requires a variant");
115259
- root = import_node_fs158.default.realpathSync(root);
115260
- const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs158.default.realpathSync(dir)))];
115261
- const parent = import_node_path159.default.join(kotlinHome(), "gradle-sources");
115262
- import_node_fs158.default.mkdirSync(parent, { recursive: true });
115263
- const work = import_node_fs158.default.mkdtempSync(import_node_path159.default.join(parent, ".query-"));
115526
+ root = import_node_fs159.default.realpathSync(root);
115527
+ const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs159.default.realpathSync(dir)))];
115528
+ const parent = import_node_path160.default.join(kotlinHome(), "gradle-sources");
115529
+ import_node_fs159.default.mkdirSync(parent, { recursive: true });
115530
+ const work = import_node_fs159.default.mkdtempSync(import_node_path160.default.join(parent, ".query-"));
115264
115531
  const task = `peachAndroidSources${(0, import_node_crypto95.randomBytes)(8).toString("hex")}`;
115265
- const script = import_node_path159.default.join(work, "sources.gradle");
115532
+ const script = import_node_path160.default.join(work, "sources.gradle");
115266
115533
  const encoded = Buffer.from(
115267
115534
  JSON.stringify({
115268
115535
  root,
@@ -115276,12 +115543,12 @@ async function resolveAndroidGradleSources(request) {
115276
115543
  task
115277
115544
  })
115278
115545
  ).toString("base64");
115279
- import_node_fs158.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
115546
+ import_node_fs159.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
115280
115547
  try {
115281
115548
  await run15(
115282
115549
  "bash",
115283
115550
  [
115284
- import_node_path159.default.join(root, "gradlew"),
115551
+ import_node_path160.default.join(root, "gradlew"),
115285
115552
  "--init-script",
115286
115553
  script,
115287
115554
  `${task}All`,
@@ -115300,19 +115567,19 @@ async function resolveAndroidGradleSources(request) {
115300
115567
  );
115301
115568
  return projects2.map((projectDir, index) => {
115302
115569
  const value = JSON.parse(
115303
- import_node_fs158.default.readFileSync(import_node_path159.default.join(work, `${index}.json`), "utf8")
115570
+ import_node_fs159.default.readFileSync(import_node_path160.default.join(work, `${index}.json`), "utf8")
115304
115571
  );
115305
115572
  if (!isRecord(value) || value.projectDir !== projectDir || value.variant !== variant2 || typeof value.projectPath !== "string" || value.applicationId !== null && typeof value.applicationId !== "string" || typeof value.namespace !== "string" || !value.namespace || value.targetSdk !== null && (typeof value.targetSdk !== "number" || !Number.isInteger(value.targetSdk) || value.targetSdk <= 0))
115306
115573
  throw new Error("Gradle printed an invalid Android project source model");
115307
115574
  const paths = (field) => {
115308
115575
  const list2 = value[field];
115309
- if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path159.default.isAbsolute(file)))
115576
+ if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path160.default.isAbsolute(file)))
115310
115577
  throw new Error(`Gradle printed invalid Android ${field} paths`);
115311
115578
  return list2.map(String);
115312
115579
  };
115313
115580
  const linkedResource = (field) => {
115314
115581
  const file = value[field];
115315
- if (typeof file !== "string" || !import_node_path159.default.isAbsolute(file) || !import_node_fs158.default.statSync(file, { throwIfNoEntry: false })?.isFile())
115582
+ if (typeof file !== "string" || !import_node_path160.default.isAbsolute(file) || !import_node_fs159.default.statSync(file, { throwIfNoEntry: false })?.isFile())
115316
115583
  throw new Error(`Gradle did not produce ${field} for ${projectDir}:${variant2}`);
115317
115584
  return file;
115318
115585
  };
@@ -115361,14 +115628,14 @@ async function resolveAndroidGradleSources(request) {
115361
115628
  };
115362
115629
  });
115363
115630
  } finally {
115364
- import_node_fs158.default.rmSync(work, { recursive: true, force: true });
115631
+ import_node_fs159.default.rmSync(work, { recursive: true, force: true });
115365
115632
  }
115366
115633
  }
115367
115634
  function readDependencySources(value) {
115368
115635
  if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
115369
115636
  const coordinates = /* @__PURE__ */ new Set();
115370
115637
  return value.map((entry) => {
115371
- if (!isRecord(entry) || typeof entry.group !== "string" || !entry.group || typeof entry.name !== "string" || !entry.name || typeof entry.version !== "string" || !entry.version || typeof entry.archive !== "string" || !import_node_path159.default.isAbsolute(entry.archive) || !import_node_fs158.default.statSync(entry.archive, { throwIfNoEntry: false })?.isFile())
115638
+ if (!isRecord(entry) || typeof entry.group !== "string" || !entry.group || typeof entry.name !== "string" || !entry.name || typeof entry.version !== "string" || !entry.version || typeof entry.archive !== "string" || !import_node_path160.default.isAbsolute(entry.archive) || !import_node_fs159.default.statSync(entry.archive, { throwIfNoEntry: false })?.isFile())
115372
115639
  throw new Error("Gradle printed an invalid dependency sources archive");
115373
115640
  const coordinate = `${entry.group}:${entry.name}:${entry.version}`;
115374
115641
  if (coordinates.has(coordinate))
@@ -115382,14 +115649,14 @@ function readDependencySources(value) {
115382
115649
  };
115383
115650
  });
115384
115651
  }
115385
- var import_node_child_process74, import_node_crypto95, import_node_fs158, import_node_path159, import_node_util20, run15, modelQuery;
115652
+ var import_node_child_process74, import_node_crypto95, import_node_fs159, import_node_path160, import_node_util20, run15, modelQuery;
115386
115653
  var init_android_gradle_sources = __esm({
115387
115654
  "src/android-gradle-sources.ts"() {
115388
115655
  "use strict";
115389
115656
  import_node_child_process74 = require("node:child_process");
115390
115657
  import_node_crypto95 = require("node:crypto");
115391
- import_node_fs158 = __toESM(require("node:fs"), 1);
115392
- import_node_path159 = __toESM(require("node:path"), 1);
115658
+ import_node_fs159 = __toESM(require("node:fs"), 1);
115659
+ import_node_path160 = __toESM(require("node:path"), 1);
115393
115660
  import_node_util20 = require("node:util");
115394
115661
  init_forked_script_contract();
115395
115662
  init_is_record();
@@ -115577,16 +115844,16 @@ __export(kotlin_host_exports, {
115577
115844
  });
115578
115845
  function loadKotlinSdk(moduleRoot, toolchain) {
115579
115846
  return installKotlinSdkArchive(
115580
- import_node_fs159.default.readFileSync(import_node_path160.default.join(moduleRoot, "sdk.tar.gz")),
115847
+ import_node_fs160.default.readFileSync(import_node_path161.default.join(moduleRoot, "sdk.tar.gz")),
115581
115848
  toolchain.compiler
115582
115849
  );
115583
115850
  }
115584
115851
  function appKotlinLanguage(root) {
115585
- const reactNative = import_node_path160.default.dirname(
115586
- (0, import_node_module22.createRequire)(import_node_path160.default.join(root, "package.json")).resolve("react-native/package.json")
115852
+ const reactNative = import_node_path161.default.dirname(
115853
+ (0, import_node_module22.createRequire)(import_node_path161.default.join(root, "package.json")).resolve("react-native/package.json")
115587
115854
  );
115588
- const versions = import_node_fs159.default.readFileSync(
115589
- import_node_path160.default.join(reactNative, "gradle", "libs.versions.toml"),
115855
+ const versions = import_node_fs160.default.readFileSync(
115856
+ import_node_path161.default.join(reactNative, "gradle", "libs.versions.toml"),
115590
115857
  "utf8"
115591
115858
  );
115592
115859
  const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
@@ -115597,9 +115864,9 @@ function appKotlinLanguage(root) {
115597
115864
  function kotlinSources(root, skip = SKIP_DIRS) {
115598
115865
  const sources = [];
115599
115866
  const walk4 = (dir) => {
115600
- for (const entry of import_node_fs159.default.readdirSync(dir, { withFileTypes: true })) {
115867
+ for (const entry of import_node_fs160.default.readdirSync(dir, { withFileTypes: true })) {
115601
115868
  if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
115602
- const full = import_node_path160.default.join(dir, entry.name);
115869
+ const full = import_node_path161.default.join(dir, entry.name);
115603
115870
  if (entry.isDirectory()) walk4(full);
115604
115871
  else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
115605
115872
  }
@@ -115656,7 +115923,7 @@ function entrySource(ids) {
115656
115923
  ].join("\n");
115657
115924
  }
115658
115925
  function buildsDir() {
115659
- return import_node_path160.default.join(kotlinHome(), "builds");
115926
+ return import_node_path161.default.join(kotlinHome(), "builds");
115660
115927
  }
115661
115928
  async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
115662
115929
  const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
@@ -115669,7 +115936,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
115669
115936
  const viewIds = [];
115670
115937
  let usesCompose = false;
115671
115938
  for (const file of sources) {
115672
- const source = import_node_fs159.default.readFileSync(file, "utf8");
115939
+ const source = import_node_fs160.default.readFileSync(file, "utf8");
115673
115940
  if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
115674
115941
  const contract = nativeSourceContract(file, source);
115675
115942
  if (contract.modules.length === 0 && contract.views.length === 0) continue;
@@ -115760,9 +116027,9 @@ function readExpoTypes(output) {
115760
116027
  async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
115761
116028
  const digest3 = (0, import_node_crypto96.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
115762
116029
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
115763
- digest3.update(import_node_fs159.default.readFileSync(import_node_path160.default.join(moduleRoot, "sdk.tar.gz")));
116030
+ digest3.update(import_node_fs160.default.readFileSync(import_node_path161.default.join(moduleRoot, "sdk.tar.gz")));
115764
116031
  digest3.update(tool);
115765
- for (const file of files2) digest3.update(`${file}\0${import_node_fs159.default.readFileSync(file, "utf8")}\0`);
116032
+ for (const file of files2) digest3.update(`${file}\0${import_node_fs160.default.readFileSync(file, "utf8")}\0`);
115766
116033
  const key2 = digest3.digest("hex");
115767
116034
  let scan3 = toolScans.get(key2);
115768
116035
  if (!scan3) {
@@ -115777,7 +116044,7 @@ async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
115777
116044
  async function scanExpoTypes(toolchain, moduleRoot, sources) {
115778
116045
  const candidates = sources.filter(
115779
116046
  (file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
115780
- import_node_fs159.default.readFileSync(file, "utf8")
116047
+ import_node_fs160.default.readFileSync(file, "utf8")
115781
116048
  )
115782
116049
  );
115783
116050
  if (candidates.length === 0) return [];
@@ -115921,7 +116188,7 @@ function expoTypeSources(files2) {
115921
116188
  )
115922
116189
  ];
115923
116190
  if (edits.length > 0 || views.length > 0) {
115924
- let text7 = import_node_fs159.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
116191
+ let text7 = import_node_fs160.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
115925
116192
  for (const { range: range3, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
115926
116193
  text7 = `${text7.slice(0, range3[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal3(field.key)}, ${field.required}) { ${text7.slice(range3[0], range3[1])} }${text7.slice(range3[1])}`;
115927
116194
  if (views.length > 0) {
@@ -115937,7 +116204,7 @@ function expoTypeSources(files2) {
115937
116204
  `${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
115938
116205
  );
115939
116206
  }
115940
- const name3 = `PeachExpoSource_${index}_${import_node_path160.default.basename(file.file)}`;
116207
+ const name3 = `PeachExpoSource_${index}_${import_node_path161.default.basename(file.file)}`;
115941
116208
  generated[name3] = text7;
115942
116209
  origins[name3] = file.file;
115943
116210
  }
@@ -115979,7 +116246,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
115979
116246
  const language = appKotlinLanguage(root);
115980
116247
  const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
115981
116248
  const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
115982
- (file) => /\bandroidx\.compose\./.test(import_node_fs159.default.readFileSync(file, "utf8"))
116249
+ (file) => /\bandroidx\.compose\./.test(import_node_fs160.default.readFileSync(file, "utf8"))
115983
116250
  );
115984
116251
  const types2 = expoTypeSources(scanned);
115985
116252
  const rewritten = new Set(Object.values(types2.origins));
@@ -116197,7 +116464,7 @@ function appResourceSources(app) {
116197
116464
  entries: app.drawables.map((drawable) => ({
116198
116465
  name: drawable.name,
116199
116466
  init: `listOf(
116200
- ${drawable.files.map((file) => drawableInit(file, import_node_path160.default.relative(app.moduleDir, file.file))).join(",\n")}
116467
+ ${drawable.files.map((file) => drawableInit(file, import_node_path161.default.relative(app.moduleDir, file.file))).join(",\n")}
116201
116468
  )`
116202
116469
  }))
116203
116470
  },
@@ -116321,7 +116588,7 @@ function drawableInit(drawable, file) {
116321
116588
  if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
116322
116589
  if (drawable.kind === "bitmap")
116323
116590
  return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal3(
116324
- import_node_fs159.default.readFileSync(drawable.file).toString("base64")
116591
+ import_node_fs160.default.readFileSync(drawable.file).toString("base64")
116325
116592
  )})`;
116326
116593
  const vector = drawable.vector;
116327
116594
  const float3 = (value) => `${value}f`;
@@ -116386,8 +116653,8 @@ async function compileKotlin(input, origin) {
116386
116653
  javaSpecs = []
116387
116654
  } = input;
116388
116655
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
116389
- const plugin = import_node_path160.default.join(sdk2.root, "plugin.jar");
116390
- const sdkLibrary = import_node_path160.default.join(sdk2.root, `${sdkProfile}.klib`);
116656
+ const plugin = import_node_path161.default.join(sdk2.root, "plugin.jar");
116657
+ const sdkLibrary = import_node_path161.default.join(sdk2.root, `${sdkProfile}.klib`);
116391
116658
  const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
116392
116659
  const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
116393
116660
  const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
@@ -116415,7 +116682,7 @@ async function compileKotlin(input, origin) {
116415
116682
  };
116416
116683
  const inputs2 = sources.map((file) => ({
116417
116684
  file,
116418
- bytes: import_node_fs159.default.readFileSync(file)
116685
+ bytes: import_node_fs160.default.readFileSync(file)
116419
116686
  }));
116420
116687
  const { composeArchive, ...compilerInputs } = toolchain;
116421
116688
  const digest3 = (0, import_node_crypto96.createHash)("sha256");
@@ -116432,7 +116699,7 @@ async function compileKotlin(input, origin) {
116432
116699
  })
116433
116700
  );
116434
116701
  for (const { file, bytes } of inputs2)
116435
- digest3.update(import_node_path160.default.relative(root, file)).update("\0").update(bytes).update("\0");
116702
+ digest3.update(import_node_path161.default.relative(root, file)).update("\0").update(bytes).update("\0");
116436
116703
  if (viewModels) digest3.update(viewModels.toolClass);
116437
116704
  for (const [name3, text7] of Object.entries(generated))
116438
116705
  digest3.update(`${name3}\0${text7}\0`);
@@ -116441,28 +116708,28 @@ async function compileKotlin(input, origin) {
116441
116708
  url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
116442
116709
  hash
116443
116710
  };
116444
- const out = import_node_path160.default.join(buildsDir(), hash);
116445
- if (import_node_fs159.default.existsSync(import_node_path160.default.join(out, "js", "app.wasm"))) return artifact;
116711
+ const out = import_node_path161.default.join(buildsDir(), hash);
116712
+ if (import_node_fs160.default.existsSync(import_node_path161.default.join(out, "js", "app.wasm"))) return artifact;
116446
116713
  const pending = builds.get(hash);
116447
116714
  if (pending) return pending;
116448
116715
  const build2 = (async () => {
116449
116716
  const ready = await ensureToolchain(toolchain);
116450
116717
  const { kotlinc } = ready;
116451
- const libraries = [...ready.libraries, sdkLibrary, import_node_path160.default.join(sdk2.root, "java.klib")];
116718
+ const libraries = [...ready.libraries, sdkLibrary, import_node_path161.default.join(sdk2.root, "java.klib")];
116452
116719
  const compose = usesCompose ? await ensureCompose(toolchain) : null;
116453
116720
  if (compose) libraries.push(...compose.libraries);
116454
- import_node_fs159.default.mkdirSync(buildsDir(), { recursive: true });
116455
- const work = import_node_fs159.default.mkdtempSync(import_node_path160.default.join(buildsDir(), `${hash}-`));
116456
- const javaLibrary = java ? import_node_path160.default.join(work, "java-abi", "java-abi.klib") : null;
116721
+ import_node_fs160.default.mkdirSync(buildsDir(), { recursive: true });
116722
+ const work = import_node_fs160.default.mkdtempSync(import_node_path161.default.join(buildsDir(), `${hash}-`));
116723
+ const javaLibrary = java ? import_node_path161.default.join(work, "java-abi", "java-abi.klib") : null;
116457
116724
  if (javaLibrary) libraries.push(javaLibrary);
116458
- const generatedDir = import_node_path160.default.join(work, "generated");
116459
- import_node_fs159.default.mkdirSync(generatedDir);
116725
+ const generatedDir = import_node_path161.default.join(work, "generated");
116726
+ import_node_fs160.default.mkdirSync(generatedDir);
116460
116727
  for (const [name3, text7] of Object.entries(generated))
116461
- import_node_fs159.default.writeFileSync(import_node_path160.default.join(generatedDir, name3), text7);
116728
+ import_node_fs160.default.writeFileSync(import_node_path161.default.join(generatedDir, name3), text7);
116462
116729
  const compiledSources = inputs2.map(({ file, bytes }, index) => {
116463
- const target = import_node_path160.default.join(work, "sources", String(index), import_node_path160.default.basename(file));
116464
- import_node_fs159.default.mkdirSync(import_node_path160.default.dirname(target), { recursive: true });
116465
- import_node_fs159.default.writeFileSync(target, bytes);
116730
+ const target = import_node_path161.default.join(work, "sources", String(index), import_node_path161.default.basename(file));
116731
+ import_node_fs160.default.mkdirSync(import_node_path161.default.dirname(target), { recursive: true });
116732
+ import_node_fs160.default.writeFileSync(target, bytes);
116466
116733
  return { file, target };
116467
116734
  });
116468
116735
  const common2 = [
@@ -116471,19 +116738,19 @@ async function compileKotlin(input, origin) {
116471
116738
  "-Xallow-kotlin-package",
116472
116739
  "-Xwasm-target=js",
116473
116740
  "-libraries",
116474
- libraries.join(import_node_path160.default.delimiter)
116741
+ libraries.join(import_node_path161.default.delimiter)
116475
116742
  ];
116476
116743
  const compileKlib = (outputDir) => run16(
116477
116744
  kotlinc,
116478
116745
  [
116479
116746
  ...common2,
116480
116747
  `-Xplugin=${plugin}`,
116481
- `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path160.default.delimiter)}`,
116748
+ `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path161.default.delimiter)}`,
116482
116749
  ...usesCompose ? [
116483
- `-Xplugin=${import_node_path160.default.resolve(import_node_path160.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
116750
+ `-Xplugin=${import_node_path161.default.resolve(import_node_path161.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
116484
116751
  ] : [],
116485
116752
  ...usesSerialization ? [
116486
- `-Xplugin=${import_node_path160.default.resolve(import_node_path160.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
116753
+ `-Xplugin=${import_node_path161.default.resolve(import_node_path161.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
116487
116754
  ] : [],
116488
116755
  "-language-version",
116489
116756
  language,
@@ -116497,7 +116764,7 @@ async function compileKotlin(input, origin) {
116497
116764
  "-ir-output-name",
116498
116765
  "app",
116499
116766
  ...compiledSources.map(({ target }) => target),
116500
- ...Object.keys(generated).map((name3) => import_node_path160.default.join(generatedDir, name3))
116767
+ ...Object.keys(generated).map((name3) => import_node_path161.default.join(generatedDir, name3))
116501
116768
  ],
116502
116769
  { maxBuffer: 16 * 1024 * 1024 }
116503
116770
  );
@@ -116516,49 +116783,49 @@ async function compileKotlin(input, origin) {
116516
116783
  if (viewModels && inputs2.some(
116517
116784
  ({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
116518
116785
  )) {
116519
- await compileKlib(import_node_path160.default.join(work, "abi"));
116786
+ await compileKlib(import_node_path161.default.join(work, "abi"));
116520
116787
  const stdout = await runKotlinTool(
116521
116788
  ready,
116522
116789
  sdk2.root,
116523
116790
  viewModels.toolClass,
116524
- [import_node_path160.default.join(work, "abi")],
116791
+ [import_node_path161.default.join(work, "abi")],
116525
116792
  64 * 1024 * 1024
116526
116793
  );
116527
- import_node_fs159.default.writeFileSync(
116528
- import_node_path160.default.join(generatedDir, viewModels.file),
116794
+ import_node_fs160.default.writeFileSync(
116795
+ import_node_path161.default.join(generatedDir, viewModels.file),
116529
116796
  viewModels.render(viewModelClasses(readAbiClasses(stdout)))
116530
116797
  );
116531
116798
  }
116532
- await compileKlib(import_node_path160.default.join(work, "klib"));
116799
+ await compileKlib(import_node_path161.default.join(work, "klib"));
116533
116800
  await run16(
116534
116801
  kotlinc,
116535
116802
  [
116536
116803
  ...common2,
116537
116804
  "-nowarn",
116538
116805
  "-Xpartial-linkage-loglevel=error",
116539
- `-Xinclude=${import_node_path160.default.join(work, "klib")}`,
116806
+ `-Xinclude=${import_node_path161.default.join(work, "klib")}`,
116540
116807
  "-Xir-produce-js",
116541
116808
  "-Xir-dce",
116542
116809
  "-ir-output-dir",
116543
- import_node_path160.default.join(work, "js"),
116810
+ import_node_path161.default.join(work, "js"),
116544
116811
  "-ir-output-name",
116545
116812
  "app"
116546
116813
  ],
116547
116814
  { maxBuffer: 16 * 1024 * 1024 }
116548
116815
  );
116549
116816
  if (compose) {
116550
- import_node_fs159.default.writeFileSync(
116551
- import_node_path160.default.join(work, "js", "skiko.mjs"),
116552
- kotlinSkikoSource(import_node_fs159.default.readFileSync(compose.loader))
116817
+ import_node_fs160.default.writeFileSync(
116818
+ import_node_path161.default.join(work, "js", "skiko.mjs"),
116819
+ kotlinSkikoSource(import_node_fs160.default.readFileSync(compose.loader))
116553
116820
  );
116554
116821
  }
116555
116822
  if (usesCompose) {
116556
116823
  for (const library of toolchain.composeJsLibraries) {
116557
116824
  let imported = false;
116558
- for (const file of import_node_fs159.default.readdirSync(import_node_path160.default.join(work, "js"))) {
116825
+ for (const file of import_node_fs160.default.readdirSync(import_node_path161.default.join(work, "js"))) {
116559
116826
  if (!file.endsWith(".mjs")) continue;
116560
- const target = import_node_path160.default.join(work, "js", file);
116561
- const source = import_node_fs159.default.readFileSync(target, "utf8");
116827
+ const target = import_node_path161.default.join(work, "js", file);
116828
+ const source = import_node_fs160.default.readFileSync(target, "utf8");
116562
116829
  let next = source;
116563
116830
  for (const quote3 of ["'", '"'])
116564
116831
  next = next.replaceAll(
@@ -116566,11 +116833,11 @@ async function compileKotlin(input, origin) {
116566
116833
  `from ${quote3}./${library.file}${quote3}`
116567
116834
  );
116568
116835
  if (next === source) continue;
116569
- import_node_fs159.default.writeFileSync(target, next);
116836
+ import_node_fs160.default.writeFileSync(target, next);
116570
116837
  imported = true;
116571
116838
  }
116572
116839
  if (!imported) continue;
116573
- const archive = import_node_path160.default.join(
116840
+ const archive = import_node_path161.default.join(
116574
116841
  kotlinHome(),
116575
116842
  toolchain.compiler.version,
116576
116843
  library.name
@@ -116579,24 +116846,24 @@ async function compileKotlin(input, origin) {
116579
116846
  const { stdout } = await run16("tar", ["-xOf", archive, library.archiveEntry], {
116580
116847
  maxBuffer: 16 * 1024 * 1024
116581
116848
  });
116582
- import_node_fs159.default.writeFileSync(import_node_path160.default.join(work, "js", library.file), stdout);
116849
+ import_node_fs160.default.writeFileSync(import_node_path161.default.join(work, "js", library.file), stdout);
116583
116850
  }
116584
116851
  }
116585
116852
  } catch (error) {
116586
- import_node_fs159.default.rmSync(work, { recursive: true, force: true });
116853
+ import_node_fs160.default.rmSync(work, { recursive: true, force: true });
116587
116854
  let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
116588
116855
  for (const [name3, source] of Object.entries(origins))
116589
- output = output.replaceAll(import_node_path160.default.join(generatedDir, name3), source);
116856
+ output = output.replaceAll(import_node_path161.default.join(generatedDir, name3), source);
116590
116857
  for (const [index, spec] of applicationJava.entries())
116591
116858
  output = output.replaceAll(
116592
- import_node_path160.default.join(generatedDir, `JavaApplication${index}.kt`),
116859
+ import_node_path161.default.join(generatedDir, `JavaApplication${index}.kt`),
116593
116860
  spec.file
116594
116861
  );
116595
116862
  for (const { file, target } of compiledSources)
116596
- output = output.replaceAll(target, file).replaceAll(import_node_path160.default.relative(process.cwd(), target), file);
116863
+ output = output.replaceAll(target, file).replaceAll(import_node_path161.default.relative(process.cwd(), target), file);
116597
116864
  for (const [index, spec] of (java?.specs ?? []).entries())
116598
116865
  output = output.replaceAll(
116599
- import_node_path160.default.join(work, "java-abi", `Spec${index}.kt`),
116866
+ import_node_path161.default.join(work, "java-abi", `Spec${index}.kt`),
116600
116867
  spec.file
116601
116868
  );
116602
116869
  output = output.replace(
@@ -116609,20 +116876,20 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
116609
116876
  );
116610
116877
  }
116611
116878
  const seams = [kotlinNodeDetection];
116612
- const js = import_node_fs159.default.readdirSync(import_node_path160.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
116879
+ const js = import_node_fs160.default.readdirSync(import_node_path161.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
116613
116880
  if (js.some(
116614
- (file) => import_node_fs159.default.readFileSync(import_node_path160.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
116881
+ (file) => import_node_fs160.default.readFileSync(import_node_path161.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
116615
116882
  ))
116616
116883
  seams.push(kotlinCoroutineDispatcher);
116617
116884
  for (const [from, to] of seams) {
116618
116885
  let patched = 0;
116619
116886
  for (const file of js) {
116620
- const target = import_node_path160.default.join(work, "js", file);
116621
- const text7 = import_node_fs159.default.readFileSync(target, "utf8");
116887
+ const target = import_node_path161.default.join(work, "js", file);
116888
+ const text7 = import_node_fs160.default.readFileSync(target, "utf8");
116622
116889
  const next = text7.replaceAll(from, to);
116623
116890
  if (next !== text7) {
116624
116891
  patched++;
116625
- import_node_fs159.default.writeFileSync(target, next);
116892
+ import_node_fs160.default.writeFileSync(target, next);
116626
116893
  }
116627
116894
  }
116628
116895
  if (patched === 0)
@@ -116630,11 +116897,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
116630
116897
  `kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
116631
116898
  );
116632
116899
  }
116633
- const entry = import_node_path160.default.join(work, "js/app.mjs");
116634
- const entrySource2 = import_node_fs159.default.readFileSync(entry, "utf8");
116635
- const importsPath = import_node_path160.default.join(work, "js/app.import-object.mjs");
116900
+ const entry = import_node_path161.default.join(work, "js/app.mjs");
116901
+ const entrySource2 = import_node_fs160.default.readFileSync(entry, "utf8");
116902
+ const importsPath = import_node_path161.default.join(work, "js/app.import-object.mjs");
116636
116903
  const importsFactory = kotlinInstanceSource(
116637
- import_node_fs159.default.readFileSync(importsPath, "utf8"),
116904
+ import_node_fs160.default.readFileSync(importsPath, "utf8"),
116638
116905
  "createKotlinImportObject"
116639
116906
  );
116640
116907
  const runtimeFactory = kotlinInstanceSource(
@@ -116642,9 +116909,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
116642
116909
  "createKotlinInstance",
116643
116910
  /* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
116644
116911
  );
116645
- import_node_fs159.default.writeFileSync(importsPath, importsFactory.source);
116646
- import_node_fs159.default.writeFileSync(import_node_path160.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
116647
- import_node_fs159.default.writeFileSync(
116912
+ import_node_fs160.default.writeFileSync(importsPath, importsFactory.source);
116913
+ import_node_fs160.default.writeFileSync(import_node_path161.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
116914
+ import_node_fs160.default.writeFileSync(
116648
116915
  entry,
116649
116916
  [
116650
116917
  "import { createKotlinInstance } from './app-runtime.mjs';",
@@ -116657,10 +116924,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
116657
116924
  ].join("\n")
116658
116925
  );
116659
116926
  try {
116660
- import_node_fs159.default.renameSync(work, out);
116927
+ import_node_fs160.default.renameSync(work, out);
116661
116928
  } catch (error) {
116662
- if (!import_node_fs159.default.existsSync(import_node_path160.default.join(out, "js", "app.wasm"))) throw error;
116663
- import_node_fs159.default.rmSync(work, { recursive: true, force: true });
116929
+ if (!import_node_fs160.default.existsSync(import_node_path161.default.join(out, "js", "app.wasm"))) throw error;
116930
+ import_node_fs160.default.rmSync(work, { recursive: true, force: true });
116664
116931
  }
116665
116932
  return artifact;
116666
116933
  })().finally(() => builds.delete(hash));
@@ -116668,24 +116935,24 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
116668
116935
  return build2;
116669
116936
  }
116670
116937
  function kotlinArtifactFiles(hash) {
116671
- const dir = import_node_path160.default.join(buildsDir(), hash, "js");
116672
- return import_node_fs159.default.readdirSync(dir).sort().map((name3) => {
116673
- const contentType2 = CONTENT_TYPES[import_node_path160.default.extname(name3)];
116938
+ const dir = import_node_path161.default.join(buildsDir(), hash, "js");
116939
+ return import_node_fs160.default.readdirSync(dir).sort().map((name3) => {
116940
+ const contentType2 = CONTENT_TYPES[import_node_path161.default.extname(name3)];
116674
116941
  if (!contentType2) throw new Error(`unexpected kotlin artifact file ${name3}`);
116675
- return { name: name3, bytes: import_node_fs159.default.readFileSync(import_node_path160.default.join(dir, name3)), contentType: contentType2 };
116942
+ return { name: name3, bytes: import_node_fs160.default.readFileSync(import_node_path161.default.join(dir, name3)), contentType: contentType2 };
116676
116943
  });
116677
116944
  }
116678
116945
  function serveKotlinArtifact(pathname, res) {
116679
116946
  if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
116680
116947
  const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
116681
- const type = file ? CONTENT_TYPES[import_node_path160.default.extname(file)] : void 0;
116948
+ const type = file ? CONTENT_TYPES[import_node_path161.default.extname(file)] : void 0;
116682
116949
  if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
116683
116950
  res.statusCode = 404;
116684
116951
  res.end("not a kotlin artifact");
116685
116952
  return true;
116686
116953
  }
116687
- const target = import_node_path160.default.join(buildsDir(), hash, "js", file);
116688
- if (!import_node_fs159.default.existsSync(target)) {
116954
+ const target = import_node_path161.default.join(buildsDir(), hash, "js", file);
116955
+ if (!import_node_fs160.default.existsSync(target)) {
116689
116956
  res.statusCode = 404;
116690
116957
  res.end(`kotlin artifact ${hash}/${file} was not built`);
116691
116958
  return true;
@@ -116693,7 +116960,7 @@ function serveKotlinArtifact(pathname, res) {
116693
116960
  res.setHeader("access-control-allow-origin", "*");
116694
116961
  res.setHeader("content-type", type);
116695
116962
  res.setHeader("cache-control", "public, max-age=31536000, immutable");
116696
- res.end(import_node_fs159.default.readFileSync(target));
116963
+ res.end(import_node_fs160.default.readFileSync(target));
116697
116964
  return true;
116698
116965
  }
116699
116966
  async function serveKotlinRequest(pathname, res, app) {
@@ -116710,15 +116977,15 @@ async function serveKotlinRequest(pathname, res, app) {
116710
116977
  }
116711
116978
  return true;
116712
116979
  }
116713
- var import_node_child_process75, import_node_crypto96, import_node_fs159, import_node_module22, import_node_path160, import_node_util21, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
116980
+ var import_node_child_process75, import_node_crypto96, import_node_fs160, import_node_module22, import_node_path161, import_node_util21, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
116714
116981
  var init_kotlin_host = __esm({
116715
116982
  "src/kotlin-host.ts"() {
116716
116983
  "use strict";
116717
116984
  import_node_child_process75 = require("node:child_process");
116718
116985
  import_node_crypto96 = require("node:crypto");
116719
- import_node_fs159 = __toESM(require("node:fs"), 1);
116986
+ import_node_fs160 = __toESM(require("node:fs"), 1);
116720
116987
  import_node_module22 = require("node:module");
116721
- import_node_path160 = __toESM(require("node:path"), 1);
116988
+ import_node_path161 = __toESM(require("node:path"), 1);
116722
116989
  import_node_util21 = require("node:util");
116723
116990
  init_kotlinDiscoveryContract();
116724
116991
  init_android_bridge_packages();
@@ -116832,9 +117099,9 @@ __export(one_native_source_exports, {
116832
117099
  });
116833
117100
  function appFor(url, origin, allowRootless) {
116834
117101
  const requested = url.searchParams.get("root");
116835
- if (requested === null ? !allowRootless : !import_node_path161.default.isAbsolute(requested) || !import_node_fs160.default.existsSync(requested))
117102
+ if (requested === null ? !allowRootless : !import_node_path162.default.isAbsolute(requested) || !import_node_fs161.default.existsSync(requested))
116836
117103
  return null;
116837
- const root = requested === null ? "" : import_node_fs160.default.realpathSync(requested);
117104
+ const root = requested === null ? "" : import_node_fs161.default.realpathSync(requested);
116838
117105
  let app = apps.get(root);
116839
117106
  if (!app) {
116840
117107
  app = {
@@ -116856,7 +117123,7 @@ function send2(app, change) {
116856
117123
  if (client2.readyState === import_ws2.WebSocket.OPEN) client2.send(message);
116857
117124
  }
116858
117125
  async function swiftPackages2(root) {
116859
- const resolved = (0, import_node_module23.createRequire)(import_node_path161.default.join(root, "package.json")).resolve(
117126
+ const resolved = (0, import_node_module23.createRequire)(import_node_path162.default.join(root, "package.json")).resolve(
116860
117127
  "vxrn/swift-package-id"
116861
117128
  );
116862
117129
  const loaded4 = await import((0, import_node_url9.pathToFileURL)(resolved).href);
@@ -116884,7 +117151,11 @@ async function packageMetadata(app, packageName2) {
116884
117151
  packagePath,
116885
117152
  packageName2,
116886
117153
  moduleRoot,
116887
- app.origin
117154
+ app.origin,
117155
+ void 0,
117156
+ void 0,
117157
+ [],
117158
+ app.startupRuntimeUrl
116888
117159
  );
116889
117160
  if (!app.active.has(packageName2)) {
116890
117161
  const files2 = [
@@ -116895,7 +117166,7 @@ async function packageMetadata(app, packageName2) {
116895
117166
  app.active.set(packageName2, { packagePath, files: new Set(files2) });
116896
117167
  watch(app, packagePath, true);
116897
117168
  for (const file of files2)
116898
- if (!file.startsWith(`${packagePath}${import_node_path161.default.sep}`)) watch(app, import_node_path161.default.dirname(file));
117169
+ if (!file.startsWith(`${packagePath}${import_node_path162.default.sep}`)) watch(app, import_node_path162.default.dirname(file));
116899
117170
  }
116900
117171
  return {
116901
117172
  ...built2,
@@ -116904,9 +117175,9 @@ async function packageMetadata(app, packageName2) {
116904
117175
  };
116905
117176
  }
116906
117177
  function changed(app, file) {
116907
- if (import_node_path161.default.basename(file) === "Package.swift") app.packages = void 0;
117178
+ if (import_node_path162.default.basename(file) === "Package.swift") app.packages = void 0;
116908
117179
  for (const [packageName2, { packagePath, files: files2 }] of app.active) {
116909
- if (!files2.has(file) && !file.startsWith(`${packagePath}${import_node_path161.default.sep}`)) continue;
117180
+ if (!files2.has(file) && !file.startsWith(`${packagePath}${import_node_path162.default.sep}`)) continue;
116910
117181
  packageMetadata(app, packageName2).then(
116911
117182
  (metadata) => send2(app, { type: "package", packageName: packageName2, metadata }),
116912
117183
  (error) => send2(app, {
@@ -116917,15 +117188,15 @@ function changed(app, file) {
116917
117188
  );
116918
117189
  }
116919
117190
  const kotlinModule = app.kotlinModule;
116920
- if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${import_node_path161.default.sep}`)))
117191
+ if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${import_node_path162.default.sep}`)))
116921
117192
  send2(app, { type: "kotlin", packageName: "kotlin" });
116922
117193
  }
116923
117194
  function watch(app, directory2, recursive = false) {
116924
- if (app.watched.has(directory2) || !import_node_fs160.default.existsSync(directory2)) return;
117195
+ if (app.watched.has(directory2) || !import_node_fs161.default.existsSync(directory2)) return;
116925
117196
  app.watched.add(directory2);
116926
- import_node_fs160.default.watch(directory2, { recursive }, (_event, name3) => {
116927
- if (name3 && !name3.split(import_node_path161.default.sep).includes("node_modules"))
116928
- changed(app, import_node_path161.default.join(directory2, name3));
117197
+ import_node_fs161.default.watch(directory2, { recursive }, (_event, name3) => {
117198
+ if (name3 && !name3.split(import_node_path162.default.sep).includes("node_modules"))
117199
+ changed(app, import_node_path162.default.join(directory2, name3));
116929
117200
  });
116930
117201
  }
116931
117202
  function loopbackClient(req) {
@@ -116933,7 +117204,7 @@ function loopbackClient(req) {
116933
117204
  const origin = req.headers.origin;
116934
117205
  return !!remote && isLoopbackHost(remote) && (!origin || isLoopbackHost(new URL(origin).hostname));
116935
117206
  }
116936
- async function handleOneNativeSourceRequest(req, res) {
117207
+ async function handleOneNativeSourceRequest(req, res, startupRuntimeUrl) {
116937
117208
  const url = new URL(req.url ?? "/", "http://localhost");
116938
117209
  const isSwift = url.pathname.startsWith(SWIFT_PACKAGE_PATH);
116939
117210
  if (!isSwift && url.pathname !== KOTLIN_PACKAGE_PATH && url.pathname !== ONE_WIDGET_PATH)
@@ -116953,6 +117224,7 @@ async function handleOneNativeSourceRequest(req, res) {
116953
117224
  res.end("missing absolute app root");
116954
117225
  return true;
116955
117226
  }
117227
+ if (startupRuntimeUrl) app.startupRuntimeUrl = startupRuntimeUrl;
116956
117228
  try {
116957
117229
  if (url.pathname === ONE_WIDGET_PATH) {
116958
117230
  const bundle = url.searchParams.get("bundle");
@@ -117017,13 +117289,13 @@ function handleOneNativeSourceUpgrade(req, socket, head) {
117017
117289
  });
117018
117290
  return true;
117019
117291
  }
117020
- var import_node_fs160, import_node_module23, import_node_path161, import_node_url9, import_node_util22, import_node_zlib10, import_ws2, apps, compressMetadata;
117292
+ var import_node_fs161, import_node_module23, import_node_path162, import_node_url9, import_node_util22, import_node_zlib10, import_ws2, apps, compressMetadata;
117021
117293
  var init_one_native_source = __esm({
117022
117294
  "src/one-native-source.ts"() {
117023
117295
  "use strict";
117024
- import_node_fs160 = __toESM(require("node:fs"), 1);
117296
+ import_node_fs161 = __toESM(require("node:fs"), 1);
117025
117297
  import_node_module23 = require("node:module");
117026
- import_node_path161 = __toESM(require("node:path"), 1);
117298
+ import_node_path162 = __toESM(require("node:path"), 1);
117027
117299
  import_node_url9 = require("node:url");
117028
117300
  import_node_util22 = require("node:util");
117029
117301
  import_node_zlib10 = require("node:zlib");
@@ -117105,12 +117377,12 @@ function handleManagedExpoInputs(req, res, url) {
117105
117377
  return;
117106
117378
  }
117107
117379
  const source = url.searchParams.get("root");
117108
- if (!source || !import_node_path162.default.isAbsolute(source)) {
117380
+ if (!source || !import_node_path163.default.isAbsolute(source)) {
117109
117381
  res.writeHead(400);
117110
117382
  res.end("Missing absolute app root");
117111
117383
  return;
117112
117384
  }
117113
- const root = import_node_fs161.default.realpathSync(source);
117385
+ const root = import_node_fs162.default.realpathSync(source);
117114
117386
  const revision = nativeInputRevision(root);
117115
117387
  res.setHeader("Cache-Control", "no-store");
117116
117388
  if (!revision) {
@@ -117121,13 +117393,13 @@ function handleManagedExpoInputs(req, res, url) {
117121
117393
  res.writeHead(200, { "Content-Type": revisionType });
117122
117394
  res.end(revision);
117123
117395
  }
117124
- var import_node_crypto97, import_node_fs161, import_node_path162, revisionType;
117396
+ var import_node_crypto97, import_node_fs162, import_node_path163, revisionType;
117125
117397
  var init_managed_expo_identity = __esm({
117126
117398
  "src/managed-expo-identity.ts"() {
117127
117399
  "use strict";
117128
117400
  import_node_crypto97 = require("node:crypto");
117129
- import_node_fs161 = __toESM(require("node:fs"), 1);
117130
- import_node_path162 = __toESM(require("node:path"), 1);
117401
+ import_node_fs162 = __toESM(require("node:fs"), 1);
117402
+ import_node_path163 = __toESM(require("node:path"), 1);
117131
117403
  init_backend_origin();
117132
117404
  init_cli_version();
117133
117405
  init_expo_native_prebuilt();
@@ -117143,11 +117415,11 @@ var init_managed_expo_identity = __esm({
117143
117415
  });
117144
117416
 
117145
117417
  // src/one-native-app-catalog.ts
117146
- var import_node_path163;
117418
+ var import_node_path164;
117147
117419
  var init_one_native_app_catalog = __esm({
117148
117420
  "src/one-native-app-catalog.ts"() {
117149
117421
  "use strict";
117150
- import_node_path163 = __toESM(require("node:path"), 1);
117422
+ import_node_path164 = __toESM(require("node:path"), 1);
117151
117423
  init_is_record();
117152
117424
  init_one_native_app_config();
117153
117425
  }
@@ -117196,12 +117468,12 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
117196
117468
  }
117197
117469
  );
117198
117470
  }
117199
- var import_node_fs162, import_node_path164;
117471
+ var import_node_fs163, import_node_path165;
117200
117472
  var init_app_catalog = __esm({
117201
117473
  "cli/app-catalog.ts"() {
117202
117474
  "use strict";
117203
- import_node_fs162 = __toESM(require("node:fs"), 1);
117204
- import_node_path164 = __toESM(require("node:path"), 1);
117475
+ import_node_fs163 = __toESM(require("node:fs"), 1);
117476
+ import_node_path165 = __toESM(require("node:path"), 1);
117205
117477
  init_bundleAssets();
117206
117478
  init_expo_native_workspace();
117207
117479
  init_staged_host_files();
@@ -117212,17 +117484,17 @@ var init_app_catalog = __esm({
117212
117484
 
117213
117485
  // src/expo-widget-assets.ts
117214
117486
  async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
117215
- const ios = import_node_path165.default.join(preparedApp, "ios");
117216
- const targets = import_node_fs163.default.readdirSync(ios, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).flatMap((entry) => readXcodeExtensionTargets(import_node_path165.default.join(ios, entry.name))).filter(
117487
+ const ios = import_node_path166.default.join(preparedApp, "ios");
117488
+ const targets = import_node_fs164.default.readdirSync(ios, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).flatMap((entry) => readXcodeExtensionTargets(import_node_path166.default.join(ios, entry.name))).filter(
117217
117489
  ({ infoPlist: infoPlist2 }) => isRecord(infoPlist2.NSExtension) && infoPlist2.NSExtension.NSExtensionPointIdentifier === "com.apple.widgetkit-extension" && typeof infoPlist2.ExpoWidgetsAppGroupIdentifier === "string"
117218
117490
  );
117219
117491
  if (targets.length === 0) return null;
117220
117492
  if (targets.length !== 1) throw new Error("expected one Expo Widgets extension target");
117221
117493
  const target = targets[0];
117222
- const root = import_node_fs163.default.realpathSync(findWorkspaceRoot(preparedApp));
117494
+ const root = import_node_fs164.default.realpathSync(findWorkspaceRoot(preparedApp));
117223
117495
  const members2 = new Map(
117224
117496
  target.resources.map((file) => [
117225
- import_node_path165.default.relative(root, file).split(import_node_path165.default.sep).join("/"),
117497
+ import_node_path166.default.relative(root, file).split(import_node_path166.default.sep).join("/"),
117226
117498
  file
117227
117499
  ])
117228
117500
  );
@@ -117237,7 +117509,7 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
117237
117509
  (file) => members2.has(file) ? read(file).toString("utf8") : null,
117238
117510
  (file, scale) => {
117239
117511
  const bytes = read(file);
117240
- const ext = import_node_path165.default.extname(file);
117512
+ const ext = import_node_path166.default.extname(file);
117241
117513
  if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
117242
117514
  if (ext.toLowerCase() === ".pdf") {
117243
117515
  const sha2565 = (0, import_node_crypto98.createHash)("sha256").update(bytes).digest("hex");
@@ -117253,13 +117525,13 @@ async function stageExpoWidgetAssets(appRoot, origin) {
117253
117525
  const prepared = await prepareExpoNativeProject(appRoot);
117254
117526
  return stagePreparedExpoWidgetAssets(prepared.app, origin);
117255
117527
  }
117256
- var import_node_crypto98, import_node_fs163, import_node_path165;
117528
+ var import_node_crypto98, import_node_fs164, import_node_path166;
117257
117529
  var init_expo_widget_assets = __esm({
117258
117530
  "src/expo-widget-assets.ts"() {
117259
117531
  "use strict";
117260
117532
  import_node_crypto98 = require("node:crypto");
117261
- import_node_fs163 = __toESM(require("node:fs"), 1);
117262
- import_node_path165 = __toESM(require("node:path"), 1);
117533
+ import_node_fs164 = __toESM(require("node:fs"), 1);
117534
+ import_node_path166 = __toESM(require("node:path"), 1);
117263
117535
  init_app_catalog();
117264
117536
  init_expo_native_workspace();
117265
117537
  init_staged_host_files();
@@ -117306,7 +117578,7 @@ var init_nitro_app_providers = __esm({
117306
117578
  async function trunkSpecification(lockFile, root, version2, checksum) {
117307
117579
  if (typeof checksum !== "string" || !/^[a-f0-9]{40}$/.test(checksum))
117308
117580
  throw new Error(`${lockFile}: missing checksum for ${root}`);
117309
- const file = import_node_path166.default.join(
117581
+ const file = import_node_path167.default.join(
117310
117582
  cacheDir(),
117311
117583
  "swift-source-pods",
117312
117584
  "specifications",
@@ -117314,7 +117586,7 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
117314
117586
  );
117315
117587
  const sha1 = (value) => (0, import_node_crypto99.createHash)("sha1").update(value).digest("hex");
117316
117588
  let text7;
117317
- if (import_node_fs164.default.existsSync(file)) text7 = import_node_fs164.default.readFileSync(file, "utf8");
117589
+ if (import_node_fs165.default.existsSync(file)) text7 = import_node_fs165.default.readFileSync(file, "utf8");
117318
117590
  else {
117319
117591
  const shard2 = (0, import_node_crypto99.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
117320
117592
  const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
@@ -117351,21 +117623,21 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
117351
117623
  const spec = JSON.parse(text7);
117352
117624
  if (!record5(spec) || spec.name !== root || spec.version !== version2)
117353
117625
  throw new Error(`specification identity differs for ${root} ${version2}`);
117354
- if (!import_node_fs164.default.existsSync(file)) {
117355
- import_node_fs164.default.mkdirSync(import_node_path166.default.dirname(file), { recursive: true });
117356
- import_node_fs164.default.writeFileSync(file, text7);
117626
+ if (!import_node_fs165.default.existsSync(file)) {
117627
+ import_node_fs165.default.mkdirSync(import_node_path167.default.dirname(file), { recursive: true });
117628
+ import_node_fs165.default.writeFileSync(file, text7);
117357
117629
  }
117358
117630
  return { text: text7, spec };
117359
117631
  }
117360
117632
  function appPodfileLock(appRoot) {
117361
117633
  return [
117362
- import_node_path166.default.join(appRoot, "ios", "Podfile.lock"),
117363
- import_node_path166.default.join(appRoot, "Podfile.lock")
117364
- ].find((file) => import_node_fs164.default.existsSync(file));
117634
+ import_node_path167.default.join(appRoot, "ios", "Podfile.lock"),
117635
+ import_node_path167.default.join(appRoot, "Podfile.lock")
117636
+ ].find((file) => import_node_fs165.default.existsSync(file));
117365
117637
  }
117366
117638
  async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModules = []) {
117367
117639
  if (modules.length === 0 && headerModules.length === 0) return null;
117368
- const original = import_node_fs164.default.readFileSync(lockFile, "utf8");
117640
+ const original = import_node_fs165.default.readFileSync(lockFile, "utf8");
117369
117641
  const lock = browser_default.parse(original);
117370
117642
  const pods = lockedPods(lock);
117371
117643
  if (!record5(lock) || !record5(lock["SPEC CHECKSUMS"]))
@@ -117450,12 +117722,12 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
117450
117722
  Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
117451
117723
  )
117452
117724
  ).digest("hex");
117453
- const work = import_node_path166.default.join(cacheDir(), "swift-source-pods", key2);
117725
+ const work = import_node_path167.default.join(cacheDir(), "swift-source-pods", key2);
117454
117726
  return withSwiftRootLock(work, async () => {
117455
- const ios = import_node_path166.default.join(work, "ios");
117456
- const complete = import_node_path166.default.join(work, "pods-installed");
117457
- if (!import_node_fs164.default.existsSync(complete)) {
117458
- import_node_fs164.default.mkdirSync(import_node_path166.default.join(ios, `${APP}.xcodeproj`), { recursive: true });
117727
+ const ios = import_node_path167.default.join(work, "ios");
117728
+ const complete = import_node_path167.default.join(work, "pods-installed");
117729
+ if (!import_node_fs165.default.existsSync(complete)) {
117730
+ import_node_fs165.default.mkdirSync(import_node_path167.default.join(ios, `${APP}.xcodeproj`), { recursive: true });
117459
117731
  for (const root of [...roots].sort()) {
117460
117732
  const { text: text7 } = await trunkSpecification(
117461
117733
  lockFile,
@@ -117463,26 +117735,26 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
117463
117735
  rootVersion(root),
117464
117736
  specificationChecksums[root]
117465
117737
  );
117466
- import_node_fs164.default.writeFileSync(import_node_path166.default.join(ios, `${root}.podspec.json`), text7);
117738
+ import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, `${root}.podspec.json`), text7);
117467
117739
  }
117468
- import_node_fs164.default.writeFileSync(import_node_path166.default.join(ios, `${APP}.xcodeproj/project.pbxproj`), project);
117469
- import_node_fs164.default.writeFileSync(import_node_path166.default.join(ios, "main.swift"), "import Foundation\n");
117470
- import_node_fs164.default.writeFileSync(import_node_path166.default.join(ios, "Podfile"), podfile);
117740
+ import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, `${APP}.xcodeproj/project.pbxproj`), project);
117741
+ import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, "main.swift"), "import Foundation\n");
117742
+ import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, "Podfile"), podfile);
117471
117743
  await installPods(
117472
117744
  work,
117473
117745
  { ...process.env, LANG: "en_US.UTF-8", LC_ALL: "en_US.UTF-8" },
117474
117746
  work
117475
117747
  );
117476
- import_node_fs164.default.writeFileSync(complete, key2);
117748
+ import_node_fs165.default.writeFileSync(complete, key2);
117477
117749
  }
117478
117750
  const actual = lockedPods(
117479
- browser_default.parse(import_node_fs164.default.readFileSync(import_node_path166.default.join(ios, "Pods/Manifest.lock"), "utf8"))
117751
+ browser_default.parse(import_node_fs165.default.readFileSync(import_node_path167.default.join(ios, "Pods/Manifest.lock"), "utf8"))
117480
117752
  );
117481
117753
  if (JSON.stringify([...actual].sort(([a], [b]) => a.localeCompare(b))) !== JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b))))
117482
117754
  throw new Error(
117483
117755
  `${work}: installed pod versions or dependencies differ from ${lockFile}`
117484
117756
  );
117485
- const workspace = import_node_path166.default.join(ios, `${APP}.xcworkspace`);
117757
+ const workspace = import_node_path167.default.join(ios, `${APP}.xcworkspace`);
117486
117758
  await prepareXcodeSwiftPackages(workspace, APP, "Release");
117487
117759
  const app = readXcodeAppTarget(workspace, APP, "Release", { installedPods: true });
117488
117760
  if (app.binaryFrameworks.length > 0)
@@ -117514,13 +117786,13 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
117514
117786
  );
117515
117787
  });
117516
117788
  }
117517
- var import_node_crypto99, import_node_fs164, import_node_path166, APP, record5, project, podModuleName;
117789
+ var import_node_crypto99, import_node_fs165, import_node_path167, APP, record5, project, podModuleName;
117518
117790
  var init_swift_source_pods = __esm({
117519
117791
  "src/swift-source-pods.ts"() {
117520
117792
  "use strict";
117521
117793
  import_node_crypto99 = require("node:crypto");
117522
- import_node_fs164 = __toESM(require("node:fs"), 1);
117523
- import_node_path166 = __toESM(require("node:path"), 1);
117794
+ import_node_fs165 = __toESM(require("node:fs"), 1);
117795
+ import_node_path167 = __toESM(require("node:path"), 1);
117524
117796
  init_browser();
117525
117797
  init_home_paths();
117526
117798
  init_pod_lockfile();
@@ -117575,8 +117847,8 @@ function bundledNamespaceDefines(target, targetPath, files2) {
117575
117847
  );
117576
117848
  });
117577
117849
  }
117578
- function collectNitroCompileInput(collection, adapter, dependencies, iosDeploymentTarget, configuration) {
117579
- const ndebug = configuration === "Release" ? ["-DNDEBUG"] : [];
117850
+ function collectNitroCompileInput(collection, adapter, dependencies, iosDeploymentTarget, configuration2) {
117851
+ const ndebug = configuration2 === "Release" ? ["-DNDEBUG"] : [];
117580
117852
  const files2 = { ...collection.files };
117581
117853
  const headerAliases = {
117582
117854
  ...dependencies?.headerAliases,
@@ -117711,7 +117983,7 @@ function collectNitroCompileInput(collection, adapter, dependencies, iosDeployme
117711
117983
  "FOLLY_USE_LIBCPP=1"
117712
117984
  ] : [],
117713
117985
  ...!hasClangDefines ? ["DEBUG"] : [],
117714
- ...configuration === "Release" ? ["NDEBUG"] : []
117986
+ ...configuration2 === "Release" ? ["NDEBUG"] : []
117715
117987
  ]);
117716
117988
  const nativeSettings = `cSettings: [${[...cDefines, ...prefixFlags, ...turboSupport.cEntries, ...clangSettingEntries(target.clangSettings, "c")].join(", ")}], cxxSettings: [${[...cxxDefines, ...bundledNamespaceDefines(target.name, target.path, files2), ...prefixFlags, ...turboSupport.cxxEntries, ...clangSettingEntries(target.clangSettings, "cxx")].join(", ")}]`;
117717
117989
  const swift2 = Object.keys(files2).some(
@@ -117780,11 +118052,11 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117780
118052
  const coreUpstream = `Sources/${TURBO_CORE_TARGET}/upstream/react-native`;
117781
118053
  const flatMap = /* @__PURE__ */ new Map();
117782
118054
  for (const { from, to } of RN_HEADER_DIR_MAP) {
117783
- const dir = import_node_path167.default.join(reactNativeRoot, from);
117784
- if (!import_node_fs165.default.existsSync(dir)) continue;
117785
- for (const entry of import_node_fs165.default.readdirSync(dir, { recursive: true, withFileTypes: true })) {
118055
+ const dir = import_node_path168.default.join(reactNativeRoot, from);
118056
+ if (!import_node_fs166.default.existsSync(dir)) continue;
118057
+ for (const entry of import_node_fs166.default.readdirSync(dir, { recursive: true, withFileTypes: true })) {
117786
118058
  if (!entry.isFile() || !/\.(?:h|hpp)$/.test(entry.name)) continue;
117787
- const rel = import_node_path167.default.relative(reactNativeRoot, import_node_path167.default.join(entry.parentPath, entry.name)).split(import_node_path167.default.sep).join("/");
118059
+ const rel = import_node_path168.default.relative(reactNativeRoot, import_node_path168.default.join(entry.parentPath, entry.name)).split(import_node_path168.default.sep).join("/");
117788
118060
  const key2 = `${to}/${entry.name}`;
117789
118061
  if (!flatMap.has(key2)) flatMap.set(key2, rel);
117790
118062
  }
@@ -117793,12 +118065,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117793
118065
  const scanQueue = [];
117794
118066
  const stageRelative = (rel) => {
117795
118067
  const clean2 = rel.replace(/^\//, "");
117796
- const full = import_node_path167.default.join(reactNativeRoot, clean2);
117797
- if (!import_node_fs165.default.statSync(full, { throwIfNoEntry: false })?.isFile()) return null;
118068
+ const full = import_node_path168.default.join(reactNativeRoot, clean2);
118069
+ if (!import_node_fs166.default.statSync(full, { throwIfNoEntry: false })?.isFile()) return null;
117798
118070
  const targetKey = `${coreUpstream}/${clean2}`;
117799
118071
  if (!Object.hasOwn(supportFiles, targetKey)) {
117800
- supportFiles[targetKey] = import_node_fs165.default.readFileSync(full, "utf8");
117801
- scanQueue.push({ key: targetKey, dir: import_node_path167.default.posix.dirname(clean2) });
118072
+ supportFiles[targetKey] = import_node_fs166.default.readFileSync(full, "utf8");
118073
+ scanQueue.push({ key: targetKey, dir: import_node_path168.default.posix.dirname(clean2) });
117802
118074
  }
117803
118075
  return targetKey;
117804
118076
  };
@@ -117807,7 +118079,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117807
118079
  if (Object.hasOwn(supportFiles, outKey)) return;
117808
118080
  let targetKey = null;
117809
118081
  if (fromDir) {
117810
- const candidate = import_node_path167.default.posix.normalize(import_node_path167.default.posix.join(fromDir, include));
118082
+ const candidate = import_node_path168.default.posix.normalize(import_node_path168.default.posix.join(fromDir, include));
117811
118083
  if (!candidate.startsWith("..")) targetKey = stageRelative(candidate);
117812
118084
  }
117813
118085
  if (!targetKey && flatMap.has(include)) {
@@ -117815,12 +118087,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117815
118087
  }
117816
118088
  if (!targetKey) {
117817
118089
  for (const root of RN_COMMON_ROOTS) {
117818
- targetKey = stageRelative(import_node_path167.default.posix.join(root, include));
118090
+ targetKey = stageRelative(import_node_path168.default.posix.join(root, include));
117819
118091
  if (targetKey) break;
117820
118092
  }
117821
118093
  }
117822
118094
  if (targetKey) {
117823
- const rel = import_node_path167.default.posix.relative(import_node_path167.default.posix.dirname(outKey), targetKey);
118095
+ const rel = import_node_path168.default.posix.relative(import_node_path168.default.posix.dirname(outKey), targetKey);
117824
118096
  supportFiles[outKey] = `#pragma once
117825
118097
  #ifdef __OBJC__
117826
118098
  #import ${JSON.stringify(rel)}
@@ -117833,7 +118105,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117833
118105
  const dep = dependencyHeader(include);
117834
118106
  if (dep) {
117835
118107
  supportFiles[outKey] = dep.text;
117836
- scanQueue.push({ key: outKey, dir: import_node_path167.default.posix.dirname(include) });
118108
+ scanQueue.push({ key: outKey, dir: import_node_path168.default.posix.dirname(include) });
117837
118109
  for (const extra of nitroDependencyIncludes(
117838
118110
  reactNativeVersion,
117839
118111
  reactNativeRoot,
@@ -117844,7 +118116,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
117844
118116
  const extraDep = dependencyHeader(extra);
117845
118117
  if (extraDep) {
117846
118118
  supportFiles[extraOut] = extraDep.text;
117847
- scanQueue.push({ key: extraOut, dir: import_node_path167.default.posix.dirname(extra) });
118119
+ scanQueue.push({ key: extraOut, dir: import_node_path168.default.posix.dirname(extra) });
117848
118120
  }
117849
118121
  }
117850
118122
  }
@@ -117888,7 +118160,7 @@ function nitroDependencyHeaderSettings(target, dependencies, files2) {
117888
118160
  return { extraDeps: [], cEntries: [], cxxEntries: [], usesTurboCore: false };
117889
118161
  }
117890
118162
  const turboInclude = `.headerSearchPath(${JSON.stringify(
117891
- import_node_path167.default.posix.relative(target.path, `Sources/${TURBO_CORE_TARGET}/include`)
118163
+ import_node_path168.default.posix.relative(target.path, `Sources/${TURBO_CORE_TARGET}/include`)
117892
118164
  )})`;
117893
118165
  const pchPath = `Sources/${TURBO_CORE_TARGET}/include/PeachTurboPrefix.pch`;
117894
118166
  const pchFlag = files2[pchPath] ? [`.unsafeFlags(${JSON.stringify(["-include", pchPath])})`] : [];
@@ -117924,7 +118196,7 @@ async function prepareNitroCompileInput(options2) {
117924
118196
  const ndebug = options2.configuration === "Release" ? ["-DNDEBUG"] : [];
117925
118197
  await prepareNitroSourceDependencies(options2);
117926
118198
  const workspace = installedXcodeWorkspace(options2.projectRoot);
117927
- const installedRoot2 = import_node_fs165.default.realpathSync(options2.projectRoot);
118199
+ const installedRoot2 = import_node_fs166.default.realpathSync(options2.projectRoot);
117928
118200
  const autolinked = await iosAutolinkedDependencies(
117929
118201
  options2.appRoot ?? options2.projectRoot
117930
118202
  );
@@ -117939,11 +118211,11 @@ async function prepareNitroCompileInput(options2) {
117939
118211
  peerPackageRoots: autolinked.map(({ root }) => root)
117940
118212
  });
117941
118213
  const activePods = autolinked.flatMap(
117942
- ({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(import_node_fs165.default.realpathSync(root)) ? [{ name: name3, root, podspecPath }] : []
118214
+ ({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(import_node_fs166.default.realpathSync(root)) ? [{ name: name3, root, podspecPath }] : []
117943
118215
  );
117944
118216
  const podSources = (pod) => [
117945
118217
  ...podspecSourceFiles2(pod, options2.appRoot ?? options2.projectRoot),
117946
- ...nitrogenGeneratedSources(import_node_path167.default.dirname(pod.podspecPath))
118218
+ ...nitrogenGeneratedSources(import_node_path168.default.dirname(pod.podspecPath))
117947
118219
  ].map((file) => projectSourceKey([installedRoot2], file));
117948
118220
  let nativeSourceKeys;
117949
118221
  if (workspace) {
@@ -117965,7 +118237,7 @@ async function prepareNitroCompileInput(options2) {
117965
118237
  const collection = collectNitroSources(
117966
118238
  { ...options2, peerPackageRoots: autolinked.map(({ root }) => root) },
117967
118239
  nativeSourceKeys,
117968
- import_node_fs165.default.realpathSync(options2.appRoot ?? options2.projectRoot)
118240
+ import_node_fs166.default.realpathSync(options2.appRoot ?? options2.projectRoot)
117969
118241
  );
117970
118242
  const providerNames = new Set(collection.providers.map(({ name: name3 }) => name3));
117971
118243
  const installedLibraries = workspace ? installedNativeLibraries(
@@ -118036,7 +118308,7 @@ async function prepareNitroCompileInput(options2) {
118036
118308
  )
118037
118309
  );
118038
118310
  const views = new Set(
118039
- import_node_fs165.default.readdirSync(import_node_path167.default.join(collection.nitro.root, "cpp/views"))
118311
+ import_node_fs166.default.readdirSync(import_node_path168.default.join(collection.nitro.root, "cpp/views"))
118040
118312
  );
118041
118313
  for (const [file, source] of Object.entries(collection.files))
118042
118314
  if (file.endsWith("/NitroModules-umbrella.h"))
@@ -118105,8 +118377,8 @@ async function prepareNitroCompileInput(options2) {
118105
118377
  ([file, text7]) => /\.(?:h|hh|hpp|hxx|c|cc|cpp|cxx|m|mm)$/.test(file) && REACT_VERSION_PATTERN.test(text7)
118106
118378
  );
118107
118379
  if (reactProviders.length > 0 || usesReactHeaders) {
118108
- const nitroReactCodegenDir = import_node_fs165.default.mkdtempSync(
118109
- import_node_path167.default.join(import_node_os33.default.tmpdir(), "peach-nitro-react-")
118380
+ const nitroReactCodegenDir = import_node_fs166.default.mkdtempSync(
118381
+ import_node_path168.default.join(import_node_os33.default.tmpdir(), "peach-nitro-react-")
118110
118382
  );
118111
118383
  let support;
118112
118384
  try {
@@ -118121,7 +118393,7 @@ async function prepareNitroCompileInput(options2) {
118121
118393
  installedPods: nativeLibraries
118122
118394
  });
118123
118395
  } finally {
118124
- import_node_fs165.default.rmSync(nitroReactCodegenDir, { recursive: true, force: true });
118396
+ import_node_fs166.default.rmSync(nitroReactCodegenDir, { recursive: true, force: true });
118125
118397
  }
118126
118398
  if (support.providers.length > 0 || usesReactHeaders && support.targets.some(({ name: name3 }) => name3 === TURBO_CORE_TARGET)) {
118127
118399
  linkReactNativeCore(
@@ -118191,23 +118463,23 @@ async function prepareNitroCompileInput(options2) {
118191
118463
  );
118192
118464
  for (const [name3, pod] of nativeLibraries) {
118193
118465
  if (pod.library === void 0) continue;
118194
- const library = import_node_fs165.default.readFileSync(pod.library).toString("base64");
118466
+ const library = import_node_fs166.default.readFileSync(pod.library).toString("base64");
118195
118467
  input.libraries ??= {};
118196
118468
  input.libraries[nitroProviderTarget({ name: name3 })] = library;
118197
118469
  }
118198
118470
  const key2 = (0, import_node_crypto100.createHash)("sha256").update(
118199
118471
  collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
118200
- ).update("\0").update(import_node_fs165.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
118201
- const packagePath = import_node_path167.default.join(import_node_os33.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
118472
+ ).update("\0").update(import_node_fs166.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
118473
+ const packagePath = import_node_path168.default.join(import_node_os33.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
118202
118474
  const sharedLibrary = [...nativeLibraries.values()].find(
118203
118475
  (pod) => pod.sharedLibrary
118204
118476
  )?.sharedLibrary;
118205
118477
  if (sharedLibrary) {
118206
- import_node_fs165.default.mkdirSync(packagePath, { recursive: true });
118207
- const core = import_node_path167.default.join(packagePath, "adapter.a");
118208
- import_node_fs165.default.writeFileSync(core, Buffer.from(adapter.base64, "base64"));
118478
+ import_node_fs166.default.mkdirSync(packagePath, { recursive: true });
118479
+ const core = import_node_path168.default.join(packagePath, "adapter.a");
118480
+ import_node_fs166.default.writeFileSync(core, Buffer.from(adapter.base64, "base64"));
118209
118481
  input.libraries ??= {};
118210
- input.libraries.NitroCore = import_node_fs165.default.readFileSync(
118482
+ input.libraries.NitroCore = import_node_fs166.default.readFileSync(
118211
118483
  combineNativeStaticLibraries([core, sharedLibrary], options2.moduleRoot)
118212
118484
  ).toString("base64");
118213
118485
  }
@@ -118219,7 +118491,7 @@ async function compileNitroModule(options2) {
118219
118491
  packagePath,
118220
118492
  new Map(
118221
118493
  Object.entries(input.files).map(([file, source]) => [
118222
- import_node_path167.default.join(packagePath, file),
118494
+ import_node_path168.default.join(packagePath, file),
118223
118495
  source
118224
118496
  ])
118225
118497
  )
@@ -118245,21 +118517,21 @@ async function compileNitroModule(options2) {
118245
118517
  };
118246
118518
  }
118247
118519
  function nitrogenGeneratedSources(podDirectory) {
118248
- const generated = import_node_path167.default.join(podDirectory, "nitrogen", "generated");
118249
- const sources = (directory2, extension) => import_node_fs165.default.existsSync(directory2) ? import_node_fs165.default.readdirSync(directory2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile() && extension.test(entry.name)).map((entry) => import_node_path167.default.join(entry.parentPath, entry.name)) : [];
118520
+ const generated = import_node_path168.default.join(podDirectory, "nitrogen", "generated");
118521
+ const sources = (directory2, extension) => import_node_fs166.default.existsSync(directory2) ? import_node_fs166.default.readdirSync(directory2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile() && extension.test(entry.name)).map((entry) => import_node_path168.default.join(entry.parentPath, entry.name)) : [];
118250
118522
  return [
118251
- ...sources(import_node_path167.default.join(generated, "shared"), /\.(h|hpp|c|cpp|swift)$/),
118252
- ...sources(import_node_path167.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
118523
+ ...sources(import_node_path168.default.join(generated, "shared"), /\.(h|hpp|c|cpp|swift)$/),
118524
+ ...sources(import_node_path168.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
118253
118525
  ];
118254
118526
  }
118255
- var import_node_crypto100, import_node_fs165, import_node_os33, import_node_path167, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
118527
+ var import_node_crypto100, import_node_fs166, import_node_os33, import_node_path168, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
118256
118528
  var init_nitro_compile = __esm({
118257
118529
  "src/nitro-compile.ts"() {
118258
118530
  "use strict";
118259
118531
  import_node_crypto100 = require("node:crypto");
118260
- import_node_fs165 = __toESM(require("node:fs"), 1);
118532
+ import_node_fs166 = __toESM(require("node:fs"), 1);
118261
118533
  import_node_os33 = __toESM(require("node:os"), 1);
118262
- import_node_path167 = __toESM(require("node:path"), 1);
118534
+ import_node_path168 = __toESM(require("node:path"), 1);
118263
118535
  init_answeredNativePackages();
118264
118536
  init_installed_native_libraries();
118265
118537
  init_native_app_identity_project();
@@ -118333,29 +118605,29 @@ var init_nitro_compile = __esm({
118333
118605
  });
118334
118606
 
118335
118607
  // src/nitro-compiler-digest.ts
118336
- var import_node_crypto101, import_node_fs166, import_node_path168;
118608
+ var import_node_crypto101, import_node_fs167, import_node_path169;
118337
118609
  var init_nitro_compiler_digest = __esm({
118338
118610
  "src/nitro-compiler-digest.ts"() {
118339
118611
  "use strict";
118340
118612
  import_node_crypto101 = require("node:crypto");
118341
- import_node_fs166 = require("node:fs");
118342
- import_node_path168 = __toESM(require("node:path"), 1);
118613
+ import_node_fs167 = require("node:fs");
118614
+ import_node_path169 = __toESM(require("node:path"), 1);
118343
118615
  init_swift_compiler_digest();
118344
118616
  }
118345
118617
  });
118346
118618
 
118347
118619
  // src/nitro-superset-inputs.ts
118348
118620
  async function nitroSupersetInputs(options2) {
118349
- const resolve10 = (0, import_node_module24.createRequire)((0, import_node_path169.join)(options2.appRoot, "package.json")).resolve;
118621
+ const resolve10 = (0, import_node_module24.createRequire)((0, import_node_path170.join)(options2.appRoot, "package.json")).resolve;
118350
118622
  const pin2 = swiftNativePin();
118351
118623
  const inputs2 = {
118352
118624
  configuration: options2.configuration,
118353
118625
  "ios-deployment-target": options2.iosDeploymentTarget,
118354
- "react-native": packageVersion((0, import_node_path169.dirname)(resolve10("react-native/package.json"))),
118626
+ "react-native": packageVersion((0, import_node_path170.dirname)(resolve10("react-native/package.json"))),
118355
118627
  "swift-distribution": pin2.distribution.id,
118356
118628
  "nitro-runtime": JSON.stringify(pin2.adapters.nitro)
118357
118629
  };
118358
- const nitroModules = (0, import_node_path169.dirname)(resolve10("react-native-nitro-modules/package.json"));
118630
+ const nitroModules = (0, import_node_path170.dirname)(resolve10("react-native-nitro-modules/package.json"));
118359
118631
  for (const { name: name3, root } of [
118360
118632
  ...options2.providers,
118361
118633
  { name: "react-native-nitro-modules", root: nitroModules }
@@ -118363,16 +118635,16 @@ async function nitroSupersetInputs(options2) {
118363
118635
  inputs2[`provider:${name3}`] = `${packageVersion(root)}\0${await packageTreeDigest(root)}`;
118364
118636
  return inputs2;
118365
118637
  }
118366
- var import_node_fs167, import_node_module24, import_node_path169, packageVersion;
118638
+ var import_node_fs168, import_node_module24, import_node_path170, packageVersion;
118367
118639
  var init_nitro_superset_inputs = __esm({
118368
118640
  "src/nitro-superset-inputs.ts"() {
118369
118641
  "use strict";
118370
- import_node_fs167 = require("node:fs");
118642
+ import_node_fs168 = require("node:fs");
118371
118643
  import_node_module24 = require("node:module");
118372
- import_node_path169 = require("node:path");
118644
+ import_node_path170 = require("node:path");
118373
118645
  init_package_tree_digest();
118374
118646
  init_swift_native_pin();
118375
- packageVersion = (root) => JSON.parse((0, import_node_fs167.readFileSync)((0, import_node_path169.join)(root, "package.json"), "utf8")).version;
118647
+ packageVersion = (root) => JSON.parse((0, import_node_fs168.readFileSync)((0, import_node_path170.join)(root, "package.json"), "utf8")).version;
118376
118648
  }
118377
118649
  });
118378
118650
 
@@ -118475,7 +118747,7 @@ var init_nitro_superset = __esm({
118475
118747
  init_nitroContract();
118476
118748
  init_swift_standin_digest();
118477
118749
  NITRO_SUPERSET_ENTRY_NAME = "superset";
118478
- NITRO_COMPILER_DIGEST = true ? "72ea7e5570b529ca321acbc4932707d53f851844aa2b74b525212dc5e3c8362c" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
118750
+ NITRO_COMPILER_DIGEST = true ? "d7332e8094966a9964f28748a0f8eb19acb8509eca15e182bea368f0cc6b6f13" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
118479
118751
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
118480
118752
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
118481
118753
  published3 = /* @__PURE__ */ new Map();
@@ -118503,7 +118775,7 @@ __export(nitro_bundle_exports, {
118503
118775
  handleNitroRequest: () => handleNitroRequest
118504
118776
  });
118505
118777
  async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared = true, iosTarget, answered) {
118506
- appRoot = import_node_fs168.default.realpathSync(appRoot);
118778
+ appRoot = import_node_fs169.default.realpathSync(appRoot);
118507
118779
  const selection = await selectCompiledNitroProviders(appRoot, answered);
118508
118780
  if (!selection) return null;
118509
118781
  const { packageRoots, answers: answers2 } = selection;
@@ -118512,10 +118784,10 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
118512
118784
  projectRoot,
118513
118785
  iosTarget
118514
118786
  )?.iosDeploymentTarget;
118515
- const configuration = typeof configure === "function" ? await configure() : configure;
118787
+ const configuration2 = typeof configure === "function" ? await configure() : configure;
118516
118788
  const sharedModule = shared && !moduleRoot && iosDeploymentTarget ? await (await Promise.resolve().then(() => (init_nitro_superset(), nitro_superset_exports))).sharedNitroModule({
118517
118789
  appRoot,
118518
- configuration,
118790
+ configuration: configuration2,
118519
118791
  iosDeploymentTarget,
118520
118792
  providers: selection.providers,
118521
118793
  answers: answers2
@@ -118526,13 +118798,13 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
118526
118798
  const { artifact, collection } = await compileNitroModule({
118527
118799
  appRoot: projectRoot,
118528
118800
  packageRoots: packageRoots.map(
118529
- (root) => import_node_path170.default.resolve(projectRoot, import_node_path170.default.relative(appRoot, root))
118801
+ (root) => import_node_path171.default.resolve(projectRoot, import_node_path171.default.relative(appRoot, root))
118530
118802
  ),
118531
118803
  answers: answers2,
118532
118804
  moduleRoot: module2,
118533
118805
  projectRoot,
118534
118806
  iosTarget,
118535
- configuration,
118807
+ configuration: configuration2,
118536
118808
  answeredPackages: answered
118537
118809
  });
118538
118810
  return {
@@ -118564,8 +118836,8 @@ async function compiledModuleAssets(artifact) {
118564
118836
  ..."gzip" in artifact.icu ? [await swiftIcuBundleAsset(artifact.icu)] : []
118565
118837
  ];
118566
118838
  }
118567
- async function buildNitroBundle(appRoot, configuration, moduleRoot, shared = true) {
118568
- const compiled = await compileNitroApp(appRoot, "", configuration, moduleRoot, shared);
118839
+ async function buildNitroBundle(appRoot, configuration2, moduleRoot, shared = true) {
118840
+ const compiled = await compileNitroApp(appRoot, "", configuration2, moduleRoot, shared);
118569
118841
  if (!compiled) return null;
118570
118842
  return {
118571
118843
  metadata: compiled.metadata,
@@ -118588,14 +118860,14 @@ function compiledModuleRequestHandler(label, compile2, options2) {
118588
118860
  res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
118589
118861
  const root = url.searchParams.get("root");
118590
118862
  const host2 = req.headers.host;
118591
- if (req.method !== "GET" || !root || !import_node_path170.default.isAbsolute(root) || !host2) {
118863
+ if (req.method !== "GET" || !root || !import_node_path171.default.isAbsolute(root) || !host2) {
118592
118864
  res.writeHead(400);
118593
118865
  res.end(`${label} compilation needs GET with an absolute app root`);
118594
118866
  return;
118595
118867
  }
118596
118868
  try {
118597
118869
  const iosTarget = url.searchParams.get("iosTarget") ?? void 0;
118598
- const app = import_node_fs168.default.realpathSync(root);
118870
+ const app = import_node_fs169.default.realpathSync(root);
118599
118871
  const key2 = `${host2}\0${app}\0${iosTarget ?? ""}\0${url.searchParams.get("configuration") ?? ""}`;
118600
118872
  const assetOrigin = `http://${host2}`;
118601
118873
  const build2 = () => compile2(app, assetOrigin, iosTarget, url.searchParams);
@@ -118622,12 +118894,12 @@ function compiledModuleRequestHandler(label, compile2, options2) {
118622
118894
  }
118623
118895
  };
118624
118896
  }
118625
- var import_node_fs168, import_node_path170, NITRO_ROUTE, handleNitroRequest;
118897
+ var import_node_fs169, import_node_path171, NITRO_ROUTE, handleNitroRequest;
118626
118898
  var init_nitro_bundle = __esm({
118627
118899
  "src/nitro-bundle.ts"() {
118628
118900
  "use strict";
118629
- import_node_fs168 = __toESM(require("node:fs"), 1);
118630
- import_node_path170 = __toESM(require("node:path"), 1);
118901
+ import_node_fs169 = __toESM(require("node:fs"), 1);
118902
+ import_node_path171 = __toESM(require("node:path"), 1);
118631
118903
  init_app_config();
118632
118904
  init_backend_origin();
118633
118905
  init_expo_native_workspace();
@@ -118642,10 +118914,10 @@ var init_nitro_bundle = __esm({
118642
118914
  handleNitroRequest = compiledModuleRequestHandler(
118643
118915
  "Nitro",
118644
118916
  (root, origin, iosTarget, params) => {
118645
- const configuration = params.get("configuration");
118646
- if (configuration !== "Debug" && configuration !== "Release")
118917
+ const configuration2 = params.get("configuration");
118918
+ if (configuration2 !== "Debug" && configuration2 !== "Release")
118647
118919
  throw new Error("Nitro compilation needs configuration=Debug or Release");
118648
- return compileNitroApp(root, origin, configuration, void 0, true, iosTarget);
118920
+ return compileNitroApp(root, origin, configuration2, void 0, true, iosTarget);
118649
118921
  },
118650
118922
  {
118651
118923
  configuredNativeSources: true,
@@ -118663,7 +118935,7 @@ __export(expo_widgets_bundle_exports, {
118663
118935
  handleExpoWidgetsRequest: () => handleExpoWidgetsRequest
118664
118936
  });
118665
118937
  async function buildExpoWidgetsBundle(appRoot, origin = "") {
118666
- const require2 = (0, import_node_module25.createRequire)(import_node_path171.default.join(appRoot, "package.json"));
118938
+ const require2 = (0, import_node_module25.createRequire)(import_node_path172.default.join(appRoot, "package.json"));
118667
118939
  let manifest;
118668
118940
  try {
118669
118941
  manifest = require2.resolve("expo-widgets/package.json");
@@ -118672,16 +118944,16 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
118672
118944
  return null;
118673
118945
  throw error;
118674
118946
  }
118675
- const packageDir = import_node_path171.default.dirname(manifest);
118947
+ const packageDir = import_node_path172.default.dirname(manifest);
118676
118948
  const runtimeBundle = await withSwiftRootLock(
118677
- import_node_path171.default.join(await import_promises19.default.realpath(packageDir), "bundle"),
118949
+ import_node_path172.default.join(await import_promises19.default.realpath(packageDir), "bundle"),
118678
118950
  async () => {
118679
118951
  await (0, import_node_util23.promisify)(import_node_child_process76.execFile)(
118680
118952
  process.env.NODE_BINARY || "node",
118681
- [import_node_path171.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
118953
+ [import_node_path172.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
118682
118954
  { cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
118683
118955
  );
118684
- return import_promises19.default.readFile(import_node_path171.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"), "utf8");
118956
+ return import_promises19.default.readFile(import_node_path172.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"), "utf8");
118685
118957
  }
118686
118958
  );
118687
118959
  const catalog = await stageExpoWidgetAssets(appRoot, origin);
@@ -118692,14 +118964,14 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
118692
118964
  }
118693
118965
  };
118694
118966
  }
118695
- var import_node_child_process76, import_promises19, import_node_module25, import_node_path171, import_node_util23, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
118967
+ var import_node_child_process76, import_promises19, import_node_module25, import_node_path172, import_node_util23, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
118696
118968
  var init_expo_widgets_bundle = __esm({
118697
118969
  "src/expo-widgets-bundle.ts"() {
118698
118970
  "use strict";
118699
118971
  import_node_child_process76 = require("node:child_process");
118700
118972
  import_promises19 = __toESM(require("node:fs/promises"), 1);
118701
118973
  import_node_module25 = require("node:module");
118702
- import_node_path171 = __toESM(require("node:path"), 1);
118974
+ import_node_path172 = __toESM(require("node:path"), 1);
118703
118975
  import_node_util23 = require("node:util");
118704
118976
  init_expo_widget_assets();
118705
118977
  init_staged_host_files();
@@ -119258,12 +119530,12 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
119258
119530
  if (current2.length > 0) buckets.push(current2);
119259
119531
  const stem2 = name3.slice(0, -".swift".length);
119260
119532
  return buckets.map((bucket, shardIndex) => {
119261
- const parts = [];
119533
+ const parts2 = [];
119262
119534
  let openEnum = null;
119263
119535
  let enumBody = [];
119264
119536
  const flushEnum = () => {
119265
119537
  if (!openEnum) return;
119266
- parts.push(`extension ${openEnum} {
119538
+ parts2.push(`extension ${openEnum} {
119267
119539
  ${enumBody.join("\n\n")}
119268
119540
  }`);
119269
119541
  openEnum = null;
@@ -119278,11 +119550,11 @@ ${enumBody.join("\n\n")}
119278
119550
  enumBody.push(chunk.text);
119279
119551
  } else {
119280
119552
  flushEnum();
119281
- parts.push(chunk.text);
119553
+ parts2.push(chunk.text);
119282
119554
  }
119283
119555
  }
119284
119556
  flushEnum();
119285
- return [`${stem2}_${shardIndex}.swift`, `${header}${parts.join("\n\n")}
119557
+ return [`${stem2}_${shardIndex}.swift`, `${header}${parts2.join("\n\n")}
119286
119558
  `];
119287
119559
  });
119288
119560
  }
@@ -119290,16 +119562,16 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
119290
119562
  const selected = await selectOneSDK(appRoot);
119291
119563
  if (!selected) throw new Error("prepared app has no One SDK imports");
119292
119564
  const { one, frameworks } = selected;
119293
- const sourceRoot = import_node_path172.default.join(preparedRoot, ONE_SDK_SOURCE_DIRECTORY);
119565
+ const sourceRoot = import_node_path173.default.join(preparedRoot, ONE_SDK_SOURCE_DIRECTORY);
119294
119566
  const generated = readOneSDKSourceManifest(
119295
- JSON.parse(import_node_fs169.default.readFileSync(import_node_path172.default.join(sourceRoot, "manifest.json"), "utf8"))
119567
+ JSON.parse(import_node_fs170.default.readFileSync(import_node_path173.default.join(sourceRoot, "manifest.json"), "utf8"))
119296
119568
  );
119297
119569
  const { generation } = JSON.parse(
119298
- import_node_fs169.default.readFileSync(import_node_path172.default.join(one, "ios-bindings/manifest.json"), "utf8")
119570
+ import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "ios-bindings/manifest.json"), "utf8")
119299
119571
  );
119300
119572
  if (generated.generation !== generation) {
119301
119573
  const { version: version2 } = JSON.parse(
119302
- import_node_fs169.default.readFileSync(import_node_path172.default.join(one, "package.json"), "utf8")
119574
+ import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "package.json"), "utf8")
119303
119575
  );
119304
119576
  throw new Error(
119305
119577
  `${appRoot} has One ${version2} installed, which differs from the One its lockfile resolves. Install its dependencies, restart its dev server and open it again.`
@@ -119319,12 +119591,12 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
119319
119591
  "SDKViews/OneNativeViewsTable.swift"
119320
119592
  ])
119321
119593
  targets.set(
119322
- `Sources/One/${import_node_path172.default.basename(source)}`,
119323
- import_node_fs169.default.readFileSync(import_node_path172.default.join(one, "ios", source), "utf8")
119594
+ `Sources/One/${import_node_path173.default.basename(source)}`,
119595
+ import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "ios", source), "utf8")
119324
119596
  );
119325
119597
  for (const name3 of generated.files) {
119326
119598
  const filePath = `Sources/OneSDKBindings/${name3}`;
119327
- const source = import_node_fs169.default.readFileSync(import_node_path172.default.join(sourceRoot, name3), "utf8");
119599
+ const source = import_node_fs170.default.readFileSync(import_node_path173.default.join(sourceRoot, name3), "utf8");
119328
119600
  if (options2.shard) {
119329
119601
  for (const [shardedName, shardedSource] of shardOneSDKBindingSource(
119330
119602
  filePath,
@@ -119352,10 +119624,10 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
119352
119624
  const optimize = options2.optimize ?? true;
119353
119625
  const sources = await oneSDKLinkSources(appRoot, preparedRoot, { shard: !optimize });
119354
119626
  const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
119355
- const packagePath = import_node_path172.default.join(
119627
+ const packagePath = import_node_path173.default.join(
119356
119628
  swiftCacheDir(),
119357
119629
  "peach-one-sdk-swift",
119358
- (0, import_node_crypto102.createHash)("sha256").update(import_node_fs169.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
119630
+ (0, import_node_crypto102.createHash)("sha256").update(import_node_fs170.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
119359
119631
  "sdk"
119360
119632
  );
119361
119633
  const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
@@ -119374,10 +119646,10 @@ let package = Package(name: "OneSDKGuest", targets: [
119374
119646
  for (const [name3, source] of sources.targets) files2.set(name3, source);
119375
119647
  for (const [name3, source] of sources.entry) files2.set(`Sources/App/${name3}`, source);
119376
119648
  files2.set("Sources/App/App.swift", oneSDKApp);
119377
- import_node_fs169.default.mkdirSync(packagePath, { recursive: true });
119649
+ import_node_fs170.default.mkdirSync(packagePath, { recursive: true });
119378
119650
  syncSwiftTree(
119379
119651
  packagePath,
119380
- new Map([...files2].map(([name3, source]) => [import_node_path172.default.join(packagePath, name3), source]))
119652
+ new Map([...files2].map(([name3, source]) => [import_node_path173.default.join(packagePath, name3), source]))
119381
119653
  );
119382
119654
  const project2 = projectFor(packagePath);
119383
119655
  project2.oneModule = false;
@@ -119402,13 +119674,13 @@ async function buildOneSDKBundle(appRoot) {
119402
119674
  assets: await compiledModuleAssets(compiled.artifact)
119403
119675
  };
119404
119676
  }
119405
- var import_node_crypto102, import_node_fs169, import_node_path172, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
119677
+ var import_node_crypto102, import_node_fs170, import_node_path173, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
119406
119678
  var init_one_sdk_bundle = __esm({
119407
119679
  "src/one-sdk-bundle.ts"() {
119408
119680
  "use strict";
119409
119681
  import_node_crypto102 = require("node:crypto");
119410
- import_node_fs169 = __toESM(require("node:fs"), 1);
119411
- import_node_path172 = __toESM(require("node:path"), 1);
119682
+ import_node_fs170 = __toESM(require("node:fs"), 1);
119683
+ import_node_path173 = __toESM(require("node:path"), 1);
119412
119684
  init_expo_native_workspace();
119413
119685
  init_nitro_bundle();
119414
119686
  init_one_sdk_preparation();
@@ -119485,8 +119757,8 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
119485
119757
  }
119486
119758
  const { artifact, collection } = await compileTurboModule({
119487
119759
  appRoot,
119488
- reactNativeRoot: import_node_path173.default.dirname(
119489
- (0, import_node_module26.createRequire)(import_node_path173.default.join(projectRoot, "package.json")).resolve(
119760
+ reactNativeRoot: import_node_path174.default.dirname(
119761
+ (0, import_node_module26.createRequire)(import_node_path174.default.join(projectRoot, "package.json")).resolve(
119490
119762
  "react-native/package.json"
119491
119763
  )
119492
119764
  ),
@@ -119524,12 +119796,12 @@ async function buildTurboBundle(appRoot, moduleRoot, prepareReactNativeCore) {
119524
119796
  assets: compiled.artifact ? await compiledModuleAssets(compiled.artifact) : []
119525
119797
  };
119526
119798
  }
119527
- var import_node_module26, import_node_path173, TURBO_ROUTE, handleTurboRequest;
119799
+ var import_node_module26, import_node_path174, TURBO_ROUTE, handleTurboRequest;
119528
119800
  var init_turbo_bundle = __esm({
119529
119801
  "src/turbo-bundle.ts"() {
119530
119802
  "use strict";
119531
119803
  import_node_module26 = require("node:module");
119532
- import_node_path173 = __toESM(require("node:path"), 1);
119804
+ import_node_path174 = __toESM(require("node:path"), 1);
119533
119805
  init_app_project();
119534
119806
  init_app_config();
119535
119807
  init_expo_native_prebuilt();
@@ -119581,7 +119853,7 @@ var init_androidAutolinkingContract = __esm({
119581
119853
 
119582
119854
  // src/android-autolinking.ts
119583
119855
  async function resolveExpoAndroidAutolinking(appRoot) {
119584
- const root = import_node_fs170.default.realpathSync(appRoot);
119856
+ const root = import_node_fs171.default.realpathSync(appRoot);
119585
119857
  const existing = resolving.get(root);
119586
119858
  if (existing) return existing;
119587
119859
  const pending = resolveAndroidModules(root);
@@ -119595,7 +119867,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
119595
119867
  async function resolveAndroidModules(appRoot) {
119596
119868
  let autolinker;
119597
119869
  try {
119598
- autolinker = (0, import_node_module27.createRequire)(import_node_path174.default.join(appRoot, "package.json")).resolve(
119870
+ autolinker = (0, import_node_module27.createRequire)(import_node_path175.default.join(appRoot, "package.json")).resolve(
119599
119871
  "expo-modules-autolinking/package.json"
119600
119872
  );
119601
119873
  } catch (error) {
@@ -119603,7 +119875,7 @@ async function resolveAndroidModules(appRoot) {
119603
119875
  throw error;
119604
119876
  }
119605
119877
  const output = await runAutolinker(
119606
- import_node_path174.default.join(import_node_path174.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
119878
+ import_node_path175.default.join(import_node_path175.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
119607
119879
  ["resolve", "--platform", "android", "--project-root", appRoot, "--json"],
119608
119880
  {
119609
119881
  timeout: 3e4,
@@ -119649,13 +119921,13 @@ async function resolveReactNativeAndroidAutolinking(appRoot) {
119649
119921
  }
119650
119922
  return linked;
119651
119923
  }
119652
- var import_node_fs170, import_node_module27, import_node_path174, resolving;
119924
+ var import_node_fs171, import_node_module27, import_node_path175, resolving;
119653
119925
  var init_android_autolinking = __esm({
119654
119926
  "src/android-autolinking.ts"() {
119655
119927
  "use strict";
119656
- import_node_fs170 = __toESM(require("node:fs"), 1);
119928
+ import_node_fs171 = __toESM(require("node:fs"), 1);
119657
119929
  import_node_module27 = require("node:module");
119658
- import_node_path174 = __toESM(require("node:path"), 1);
119930
+ import_node_path175 = __toESM(require("node:path"), 1);
119659
119931
  init_androidAutolinkingContract();
119660
119932
  init_autolinker_process();
119661
119933
  init_is_record();
@@ -119666,8 +119938,8 @@ var init_android_autolinking = __esm({
119666
119938
 
119667
119939
  // src/android-bridge-dependencies.ts
119668
119940
  async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
119669
- const root = import_node_path175.default.join(appRoot, "android");
119670
- if (!import_node_fs171.default.existsSync(import_node_path175.default.join(root, "gradlew"))) return null;
119941
+ const root = import_node_path176.default.join(appRoot, "android");
119942
+ if (!import_node_fs172.default.existsSync(import_node_path176.default.join(root, "gradlew"))) return null;
119671
119943
  const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
119672
119944
  (dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
119673
119945
  {
@@ -119681,7 +119953,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
119681
119953
  const models = await resolveAndroidGradleSources({
119682
119954
  root,
119683
119955
  projects: [
119684
- import_node_path175.default.join(root, "app"),
119956
+ import_node_path176.default.join(root, "app"),
119685
119957
  ...dependencies.map((dependency) => dependency.sourceDir)
119686
119958
  ],
119687
119959
  variant: "debug"
@@ -119691,7 +119963,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
119691
119963
  const toolchain = readToolchain(moduleRoot);
119692
119964
  const [sdk2, ready] = await Promise.all([
119693
119965
  installKotlinSdkArchive(
119694
- import_node_fs171.default.readFileSync(import_node_path175.default.join(moduleRoot, "sdk.tar.gz")),
119966
+ import_node_fs172.default.readFileSync(import_node_path176.default.join(moduleRoot, "sdk.tar.gz")),
119695
119967
  toolchain.compiler
119696
119968
  ),
119697
119969
  ensureToolchain(toolchain)
@@ -119699,7 +119971,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
119699
119971
  const packages = [];
119700
119972
  for (const dependency of dependencies) {
119701
119973
  const model = models.find(
119702
- (entry) => entry.projectDir === import_node_fs171.default.realpathSync(dependency.sourceDir)
119974
+ (entry) => entry.projectDir === import_node_fs172.default.realpathSync(dependency.sourceDir)
119703
119975
  );
119704
119976
  try {
119705
119977
  const className2 = /^import\s+([\w.]+)\s*;$/.exec(
@@ -119738,12 +120010,12 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
119738
120010
  }
119739
120011
  return packages.length ? { applicationId, packages } : null;
119740
120012
  }
119741
- var import_node_fs171, import_node_path175;
120013
+ var import_node_fs172, import_node_path176;
119742
120014
  var init_android_bridge_dependencies = __esm({
119743
120015
  "src/android-bridge-dependencies.ts"() {
119744
120016
  "use strict";
119745
- import_node_fs171 = __toESM(require("node:fs"), 1);
119746
- import_node_path175 = __toESM(require("node:path"), 1);
120017
+ import_node_fs172 = __toESM(require("node:fs"), 1);
120018
+ import_node_path176 = __toESM(require("node:path"), 1);
119747
120019
  init_android_autolinking();
119748
120020
  init_android_gradle_sources();
119749
120021
  init_java_module_abi();
@@ -119771,8 +120043,8 @@ async function collectExpoKotlinModules(appRoot) {
119771
120043
  for (const project2 of entry.projects) {
119772
120044
  if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
119773
120045
  throw new Error("invalid Expo Android project");
119774
- const sourceDir = import_node_fs172.default.realpathSync(project2.sourceDir);
119775
- const installed2 = sourceDir.split(import_node_path176.default.sep).includes("node_modules");
120046
+ const sourceDir = import_node_fs173.default.realpathSync(project2.sourceDir);
120047
+ const installed2 = sourceDir.split(import_node_path177.default.sep).includes("node_modules");
119776
120048
  if (installed2) {
119777
120049
  if (typeof entry.packageName !== "string") continue;
119778
120050
  if (peachAnsweredNativePackages().has(entry.packageName)) {
@@ -119800,9 +120072,9 @@ async function collectExpoKotlinModules(appRoot) {
119800
120072
  group.unsupported ??= reason;
119801
120073
  };
119802
120074
  const walk4 = (dir) => {
119803
- if (!import_node_fs172.default.existsSync(dir)) return;
119804
- for (const child of import_node_fs172.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
119805
- const file = import_node_path176.default.join(dir, child.name);
120075
+ if (!import_node_fs173.default.existsSync(dir)) return;
120076
+ for (const child of import_node_fs173.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
120077
+ const file = import_node_path177.default.join(dir, child.name);
119806
120078
  if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
119807
120079
  else if (child.isDirectory()) walk4(file);
119808
120080
  else if (child.name.endsWith(".java"))
@@ -119810,8 +120082,8 @@ async function collectExpoKotlinModules(appRoot) {
119810
120082
  else if (child.name.endsWith(".kt")) group.sources.push(file);
119811
120083
  }
119812
120084
  };
119813
- walk4(import_node_path176.default.join(sourceDir, "src", "main", "java"));
119814
- walk4(import_node_path176.default.join(sourceDir, "src", "main", "kotlin"));
120085
+ walk4(import_node_path177.default.join(sourceDir, "src", "main", "java"));
120086
+ walk4(import_node_path177.default.join(sourceDir, "src", "main", "kotlin"));
119815
120087
  result.push(group);
119816
120088
  }
119817
120089
  }
@@ -119824,7 +120096,7 @@ async function collectBridgePackages(appRoot) {
119824
120096
  );
119825
120097
  const app = androidAppSources(appRoot);
119826
120098
  if (!app || !app.kotlin.some(
119827
- (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs172.default.readFileSync(file, "utf8"))
120099
+ (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs173.default.readFileSync(file, "utf8"))
119828
120100
  ))
119829
120101
  return dependencies;
119830
120102
  const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
@@ -119939,7 +120211,7 @@ async function handleExpoKotlinRequest(req, res) {
119939
120211
  return true;
119940
120212
  }
119941
120213
  const root = url.searchParams.get("root");
119942
- if (!root || !import_node_path176.default.isAbsolute(root)) {
120214
+ if (!root || !import_node_path177.default.isAbsolute(root)) {
119943
120215
  res.writeHead(400);
119944
120216
  res.end("missing absolute app root");
119945
120217
  return true;
@@ -119970,12 +120242,12 @@ async function handleExpoKotlinRequest(req, res) {
119970
120242
  }
119971
120243
  return true;
119972
120244
  }
119973
- var import_node_fs172, import_node_path176, EXPO_KOTLIN_ROUTE, compiling;
120245
+ var import_node_fs173, import_node_path177, EXPO_KOTLIN_ROUTE, compiling;
119974
120246
  var init_expo_kotlin_host = __esm({
119975
120247
  "src/expo-kotlin-host.ts"() {
119976
120248
  "use strict";
119977
- import_node_fs172 = __toESM(require("node:fs"), 1);
119978
- import_node_path176 = __toESM(require("node:path"), 1);
120249
+ import_node_fs173 = __toESM(require("node:fs"), 1);
120250
+ import_node_path177 = __toESM(require("node:path"), 1);
119979
120251
  init_android_autolinking();
119980
120252
  init_android_bridge_dependencies();
119981
120253
  init_android_bridge_packages();
@@ -119998,14 +120270,14 @@ function sharedDesktopAuthAccounts(user) {
119998
120270
  function getBaseDir() {
119999
120271
  const explicit = process.env[SESSION_FILE_ENV];
120000
120272
  if (explicit?.trim()) {
120001
- return (0, import_node_path177.dirname)((0, import_node_path177.resolve)(explicit));
120273
+ return (0, import_node_path178.dirname)((0, import_node_path178.resolve)(explicit));
120002
120274
  }
120003
120275
  return electronUserDataDir();
120004
120276
  }
120005
120277
  function getSharedDesktopAuthFilePath() {
120006
120278
  const explicit = process.env[SESSION_FILE_ENV];
120007
- if (explicit?.trim()) return (0, import_node_path177.resolve)(explicit);
120008
- return (0, import_node_path177.join)(getBaseDir(), "desktop-auth.json");
120279
+ if (explicit?.trim()) return (0, import_node_path178.resolve)(explicit);
120280
+ return (0, import_node_path178.join)(getBaseDir(), "desktop-auth.json");
120009
120281
  }
120010
120282
  function normalizeUser(input) {
120011
120283
  if (!input || typeof input !== "object") return null;
@@ -120055,27 +120327,27 @@ function normalizeSession(input) {
120055
120327
  }
120056
120328
  function readSharedDesktopAuthSession() {
120057
120329
  const filepath = getSharedDesktopAuthFilePath();
120058
- if (!(0, import_node_fs173.existsSync)(filepath)) return null;
120330
+ if (!(0, import_node_fs174.existsSync)(filepath)) return null;
120059
120331
  try {
120060
- const parsed2 = JSON.parse((0, import_node_fs173.readFileSync)(filepath, "utf8"));
120332
+ const parsed2 = JSON.parse((0, import_node_fs174.readFileSync)(filepath, "utf8"));
120061
120333
  const normalized = normalizeSession(parsed2);
120062
120334
  if (!normalized) {
120063
- (0, import_node_fs173.rmSync)(filepath, { force: true });
120335
+ (0, import_node_fs174.rmSync)(filepath, { force: true });
120064
120336
  return null;
120065
120337
  }
120066
120338
  return normalized;
120067
120339
  } catch {
120068
- (0, import_node_fs173.rmSync)(filepath, { force: true });
120340
+ (0, import_node_fs174.rmSync)(filepath, { force: true });
120069
120341
  return null;
120070
120342
  }
120071
120343
  }
120072
- var import_node_crypto103, import_node_fs173, import_node_path177, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
120344
+ var import_node_crypto103, import_node_fs174, import_node_path178, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
120073
120345
  var init_shared_session = __esm({
120074
120346
  "src/auth/shared-session.ts"() {
120075
120347
  "use strict";
120076
120348
  import_node_crypto103 = require("node:crypto");
120077
- import_node_fs173 = require("node:fs");
120078
- import_node_path177 = require("node:path");
120349
+ import_node_fs174 = require("node:fs");
120350
+ import_node_path178 = require("node:path");
120079
120351
  init_home_paths();
120080
120352
  init_public_brand();
120081
120353
  SESSION_VERSION = 1;
@@ -120110,31 +120382,31 @@ var init_run_rnx = __esm({
120110
120382
 
120111
120383
  // cli/secure-file.ts
120112
120384
  function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
120113
- (0, import_node_fs174.mkdirSync)((0, import_node_path178.dirname)(filepath), { recursive: true });
120385
+ (0, import_node_fs175.mkdirSync)((0, import_node_path179.dirname)(filepath), { recursive: true });
120114
120386
  const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto104.randomUUID)()}`;
120115
120387
  let descriptor = null;
120116
120388
  try {
120117
- descriptor = (0, import_node_fs174.openSync)(temporary, "wx", 384);
120118
- (0, import_node_fs174.fchmodSync)(descriptor, 384);
120119
- (0, import_node_fs174.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
120389
+ descriptor = (0, import_node_fs175.openSync)(temporary, "wx", 384);
120390
+ (0, import_node_fs175.fchmodSync)(descriptor, 384);
120391
+ (0, import_node_fs175.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
120120
120392
  `);
120121
- if (durable) (0, import_node_fs174.fsyncSync)(descriptor);
120122
- (0, import_node_fs174.closeSync)(descriptor);
120393
+ if (durable) (0, import_node_fs175.fsyncSync)(descriptor);
120394
+ (0, import_node_fs175.closeSync)(descriptor);
120123
120395
  descriptor = null;
120124
- (0, import_node_fs174.renameSync)(temporary, filepath);
120396
+ (0, import_node_fs175.renameSync)(temporary, filepath);
120125
120397
  } catch (error) {
120126
- if (descriptor !== null) (0, import_node_fs174.closeSync)(descriptor);
120127
- (0, import_node_fs174.rmSync)(temporary, { force: true });
120398
+ if (descriptor !== null) (0, import_node_fs175.closeSync)(descriptor);
120399
+ (0, import_node_fs175.rmSync)(temporary, { force: true });
120128
120400
  throw error;
120129
120401
  }
120130
120402
  }
120131
- var import_node_crypto104, import_node_fs174, import_node_path178;
120403
+ var import_node_crypto104, import_node_fs175, import_node_path179;
120132
120404
  var init_secure_file = __esm({
120133
120405
  "cli/secure-file.ts"() {
120134
120406
  "use strict";
120135
120407
  import_node_crypto104 = require("node:crypto");
120136
- import_node_fs174 = require("node:fs");
120137
- import_node_path178 = require("node:path");
120408
+ import_node_fs175 = require("node:fs");
120409
+ import_node_path179 = require("node:path");
120138
120410
  }
120139
120411
  });
120140
120412
 
@@ -120184,25 +120456,25 @@ function isCliApiKeySecret(secret) {
120184
120456
  return secret.startsWith("sk_rnx_");
120185
120457
  }
120186
120458
  function savedApiKeyFile() {
120187
- return import_node_path179.default.join(rnxHomeDir(), "api-key.json");
120459
+ return import_node_path180.default.join(rnxHomeDir(), "api-key.json");
120188
120460
  }
120189
120461
  function readApiKeyFile(file) {
120190
- if (!(0, import_node_fs175.existsSync)(file)) return null;
120191
- const secret = (0, import_node_fs175.readFileSync)(file, "utf8").trim();
120462
+ if (!(0, import_node_fs176.existsSync)(file)) return null;
120463
+ const secret = (0, import_node_fs176.readFileSync)(file, "utf8").trim();
120192
120464
  return isCliApiKeySecret(secret) ? secret : null;
120193
120465
  }
120194
120466
  function saveApiKey(secret) {
120195
120467
  writeSecureJsonAtomic(savedApiKeyFile(), { secret });
120196
120468
  }
120197
120469
  function forgetApiKey() {
120198
- if (!(0, import_node_fs175.existsSync)(savedApiKeyFile())) return false;
120199
- (0, import_node_fs175.rmSync)(savedApiKeyFile());
120470
+ if (!(0, import_node_fs176.existsSync)(savedApiKeyFile())) return false;
120471
+ (0, import_node_fs176.rmSync)(savedApiKeyFile());
120200
120472
  return true;
120201
120473
  }
120202
120474
  function readSavedApiKey() {
120203
- if (!(0, import_node_fs175.existsSync)(savedApiKeyFile())) return null;
120475
+ if (!(0, import_node_fs176.existsSync)(savedApiKeyFile())) return null;
120204
120476
  const saved = savedKeySchema.safeParse(
120205
- JSON.parse((0, import_node_fs175.readFileSync)(savedApiKeyFile(), "utf8"))
120477
+ JSON.parse((0, import_node_fs176.readFileSync)(savedApiKeyFile(), "utf8"))
120206
120478
  );
120207
120479
  return saved.success && isCliApiKeySecret(saved.data.secret) ? saved.data.secret : null;
120208
120480
  }
@@ -120260,12 +120532,12 @@ function authHeaderOrExit(commandLabel) {
120260
120532
  );
120261
120533
  rnxExit(1);
120262
120534
  }
120263
- var import_node_fs175, import_node_path179, import_zod3, GITHUB_TOKEN_PREFIXES, DOWNLOADED_API_KEY_FILE, savedKeySchema, CHOOSE_ACCOUNT_HINT;
120535
+ var import_node_fs176, import_node_path180, import_zod3, GITHUB_TOKEN_PREFIXES, DOWNLOADED_API_KEY_FILE, savedKeySchema, CHOOSE_ACCOUNT_HINT;
120264
120536
  var init_auth = __esm({
120265
120537
  "cli/auth.ts"() {
120266
120538
  "use strict";
120267
- import_node_fs175 = require("node:fs");
120268
- import_node_path179 = __toESM(require("node:path"), 1);
120539
+ import_node_fs176 = require("node:fs");
120540
+ import_node_path180 = __toESM(require("node:path"), 1);
120269
120541
  import_zod3 = require("peachsim/vendor/zod");
120270
120542
  init_shared_session();
120271
120543
  init_home_paths();
@@ -121080,9 +121352,9 @@ function metroIosAssetLocationSuffixes(httpServerLocation) {
121080
121352
  const variants = [dropped];
121081
121353
  if (dropped[0] === "assets" && dropped.length > 1) variants.push(dropped.slice(1));
121082
121354
  const suffixes = [];
121083
- for (const parts of variants) {
121084
- const swapped = parts.map(swapNodeModulesPrefix);
121085
- for (const candidate of [parts, swapped]) {
121355
+ for (const parts2 of variants) {
121356
+ const swapped = parts2.map(swapNodeModulesPrefix);
121357
+ for (const candidate of [parts2, swapped]) {
121086
121358
  const suffix = candidate.join("/");
121087
121359
  if (suffix && !suffixes.includes(suffix)) suffixes.push(suffix);
121088
121360
  }
@@ -121181,17 +121453,17 @@ async function embedMetroAssetFiles(bundle, sites, read) {
121181
121453
  });
121182
121454
  embedded.set(key2, { fileUris, fileHashes: fileHashes2, scales });
121183
121455
  }
121184
- const parts = [];
121456
+ const parts2 = [];
121185
121457
  let cursor = 0;
121186
121458
  for (const site of sites) {
121187
121459
  const entry = embedded.get(assetDescriptorKey(site.descriptor));
121188
121460
  if (!entry) continue;
121189
- parts.push(bundle.slice(cursor, site.start));
121190
- parts.push(rewriteDescriptorObject(bundle, site, entry));
121461
+ parts2.push(bundle.slice(cursor, site.start));
121462
+ parts2.push(rewriteDescriptorObject(bundle, site, entry));
121191
121463
  cursor = site.end;
121192
121464
  }
121193
- parts.push(bundle.slice(cursor));
121194
- const code = parts.join("");
121465
+ parts2.push(bundle.slice(cursor));
121466
+ const code = parts2.join("");
121195
121467
  if (countNewlines(code) !== countNewlines(bundle)) {
121196
121468
  throw new Error(
121197
121469
  "peach Cloud asset embedding changed the bundle line count, which invalidates its source map"
@@ -122494,13 +122766,13 @@ function createCloudSession(input) {
122494
122766
  }
122495
122767
  return session;
122496
122768
  }
122497
- var import_node_crypto105, import_node_fs176, import_node_path180, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
122769
+ var import_node_crypto105, import_node_fs177, import_node_path181, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
122498
122770
  var init_cloud_session = __esm({
122499
122771
  "cli/cloud-session.ts"() {
122500
122772
  "use strict";
122501
122773
  import_node_crypto105 = require("node:crypto");
122502
- import_node_fs176 = require("node:fs");
122503
- import_node_path180 = require("node:path");
122774
+ import_node_fs177 = require("node:fs");
122775
+ import_node_path181 = require("node:path");
122504
122776
  init_backend_origin();
122505
122777
  init_home_paths();
122506
122778
  init_is_record();
@@ -122583,12 +122855,12 @@ var init_run_registry = __esm({
122583
122855
  });
122584
122856
 
122585
122857
  // cli/stream-record.ts
122586
- var import_node_fs177, import_node_path181, import_zod4, sceneCommandEndpoint, streamRecord;
122858
+ var import_node_fs178, import_node_path182, import_zod4, sceneCommandEndpoint, streamRecord;
122587
122859
  var init_stream_record = __esm({
122588
122860
  "cli/stream-record.ts"() {
122589
122861
  "use strict";
122590
- import_node_fs177 = require("node:fs");
122591
- import_node_path181 = require("node:path");
122862
+ import_node_fs178 = require("node:fs");
122863
+ import_node_path182 = require("node:path");
122592
122864
  import_zod4 = require("peachsim/vendor/zod");
122593
122865
  init_home_paths();
122594
122866
  init_secure_file();
@@ -122644,27 +122916,27 @@ function resolveCloudOrigin(value) {
122644
122916
  return normalizeCloudOrigin(source);
122645
122917
  }
122646
122918
  function readImmutableBundleSource(bundlePath, command) {
122647
- const filepath = (0, import_node_path182.resolve)(bundlePath);
122648
- if ((0, import_node_path182.extname)(filepath) === ".hbc") {
122919
+ const filepath = (0, import_node_path183.resolve)(bundlePath);
122920
+ if ((0, import_node_path183.extname)(filepath) === ".hbc") {
122649
122921
  const platform3 = filepath.includes("/android/") ? "android" : "ios";
122650
122922
  throw new Error(
122651
122923
  `${command} cannot preview Hermes bytecode (${bundlePath}). Export plain JavaScript with \`npx expo export --platform ${platform3} --no-bytecode\` and preview the .js bundle instead.`
122652
122924
  );
122653
122925
  }
122654
- if ((0, import_node_path182.extname)(filepath) !== ".js") {
122926
+ if ((0, import_node_path183.extname)(filepath) !== ".js") {
122655
122927
  throw new Error(`${command} requires one local .js bundle`);
122656
122928
  }
122657
- const descriptor = (0, import_node_fs178.openSync)(filepath, "r");
122929
+ const descriptor = (0, import_node_fs179.openSync)(filepath, "r");
122658
122930
  try {
122659
- const before = (0, import_node_fs178.fstatSync)(descriptor, { bigint: true });
122931
+ const before = (0, import_node_fs179.fstatSync)(descriptor, { bigint: true });
122660
122932
  if (!before.isFile()) {
122661
122933
  throw new Error(`${command} bundle must be a regular local file`);
122662
122934
  }
122663
122935
  if (before.size <= 0n) {
122664
122936
  throw new Error(`${command} bundle is empty`);
122665
122937
  }
122666
- const bytes = (0, import_node_fs178.readFileSync)(descriptor);
122667
- const after = (0, import_node_fs178.fstatSync)(descriptor, { bigint: true });
122938
+ const bytes = (0, import_node_fs179.readFileSync)(descriptor);
122939
+ const after = (0, import_node_fs179.fstatSync)(descriptor, { bigint: true });
122668
122940
  if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeNs !== after.mtimeNs || bytes.length !== Number(before.size)) {
122669
122941
  throw new Error(`${command} bundle changed while it was being read`);
122670
122942
  }
@@ -122676,7 +122948,7 @@ function readImmutableBundleSource(bundlePath, command) {
122676
122948
  }
122677
122949
  return source;
122678
122950
  } finally {
122679
- (0, import_node_fs178.closeSync)(descriptor);
122951
+ (0, import_node_fs179.closeSync)(descriptor);
122680
122952
  }
122681
122953
  }
122682
122954
  async function fetchBundleSource(bundleUrl, command) {
@@ -122730,15 +123002,15 @@ async function loadBundleSource(bundleInput, command) {
122730
123002
  return source;
122731
123003
  }
122732
123004
  function listMetroAssetDest(assetsPath) {
122733
- const directory2 = (0, import_node_path182.resolve)(assetsPath);
122734
- if (!(0, import_node_fs178.existsSync)(directory2)) return { directory: directory2, files: [], truncated: false };
122735
- const skipNested = (0, import_node_fs178.existsSync)((0, import_node_path182.join)(directory2, "package.json"));
123005
+ const directory2 = (0, import_node_path183.resolve)(assetsPath);
123006
+ if (!(0, import_node_fs179.existsSync)(directory2)) return { directory: directory2, files: [], truncated: false };
123007
+ const skipNested = (0, import_node_fs179.existsSync)((0, import_node_path183.join)(directory2, "package.json"));
122736
123008
  const files2 = [];
122737
123009
  let truncated = false;
122738
123010
  const walk4 = (dir, prefix) => {
122739
123011
  let entries2;
122740
123012
  try {
122741
- entries2 = (0, import_node_fs178.readdirSync)(dir, { withFileTypes: true });
123013
+ entries2 = (0, import_node_fs179.readdirSync)(dir, { withFileTypes: true });
122742
123014
  } catch {
122743
123015
  return;
122744
123016
  }
@@ -122750,7 +123022,7 @@ function listMetroAssetDest(assetsPath) {
122750
123022
  if (entry.isDirectory()) {
122751
123023
  if (entry.name === ".git") continue;
122752
123024
  if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
122753
- walk4((0, import_node_path182.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
123025
+ walk4((0, import_node_path183.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
122754
123026
  } else if (entry.isFile()) {
122755
123027
  files2.push(prefix ? `${prefix}/${entry.name}` : entry.name);
122756
123028
  }
@@ -122785,7 +123057,7 @@ function distinctByContent(directory2, options2) {
122785
123057
  for (const relative5 of options2) {
122786
123058
  let bytes;
122787
123059
  try {
122788
- bytes = (0, import_node_fs178.readFileSync)((0, import_node_path182.join)(directory2, relative5));
123060
+ bytes = (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(directory2, relative5));
122789
123061
  } catch {
122790
123062
  continue;
122791
123063
  }
@@ -122831,7 +123103,7 @@ function placeMetroDescriptor(listing, descriptor) {
122831
123103
  let bytes;
122832
123104
  try {
122833
123105
  bytes = combination.map(
122834
- (relative5) => (0, import_node_fs178.readFileSync)((0, import_node_path182.join)(listing.directory, relative5))
123106
+ (relative5) => (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(listing.directory, relative5))
122835
123107
  );
122836
123108
  } catch {
122837
123109
  continue;
@@ -122859,10 +123131,10 @@ function unverifiedContentKey(dest, fileDigests2) {
122859
123131
  return JSON.stringify(
122860
123132
  dest.placements.map(
122861
123133
  (placement) => placement.verified ? null : [...placement.files].map(([scale, relative5]) => {
122862
- const file = (0, import_node_path182.join)(dest.directory, relative5);
123134
+ const file = (0, import_node_path183.join)(dest.directory, relative5);
122863
123135
  let digest3 = fileDigests2.get(file);
122864
123136
  if (digest3 === void 0) {
122865
- digest3 = (0, import_node_crypto106.createHash)("sha256").update((0, import_node_fs178.readFileSync)(file)).digest("hex");
123137
+ digest3 = (0, import_node_crypto106.createHash)("sha256").update((0, import_node_fs179.readFileSync)(file)).digest("hex");
122866
123138
  fileDigests2.set(file, digest3);
122867
123139
  }
122868
123140
  return [scale, digest3];
@@ -122871,42 +123143,42 @@ function unverifiedContentKey(dest, fileDigests2) {
122871
123143
  );
122872
123144
  }
122873
123145
  function findExpoExportRoot(bundleDirectory) {
122874
- let directory2 = (0, import_node_path182.resolve)(bundleDirectory);
123146
+ let directory2 = (0, import_node_path183.resolve)(bundleDirectory);
122875
123147
  for (let depth = 0; depth < 6; depth++) {
122876
- const metadata = (0, import_node_path182.join)(directory2, "metadata.json");
122877
- if ((0, import_node_fs178.existsSync)(metadata) && (0, import_node_fs178.existsSync)((0, import_node_path182.join)(directory2, "assets"))) {
123148
+ const metadata = (0, import_node_path183.join)(directory2, "metadata.json");
123149
+ if ((0, import_node_fs179.existsSync)(metadata) && (0, import_node_fs179.existsSync)((0, import_node_path183.join)(directory2, "assets"))) {
122878
123150
  try {
122879
- if ((0, import_node_fs178.readFileSync)(metadata, "utf8").includes('"fileMetadata"')) {
123151
+ if ((0, import_node_fs179.readFileSync)(metadata, "utf8").includes('"fileMetadata"')) {
122880
123152
  return directory2;
122881
123153
  }
122882
123154
  } catch {
122883
123155
  }
122884
123156
  }
122885
- const parent = (0, import_node_path182.dirname)(directory2);
123157
+ const parent = (0, import_node_path183.dirname)(directory2);
122886
123158
  if (parent === directory2) return null;
122887
123159
  directory2 = parent;
122888
123160
  }
122889
123161
  return null;
122890
123162
  }
122891
123163
  function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory) {
122892
- const bundleDirectory = (0, import_node_path182.dirname)((0, import_node_path182.resolve)(bundlePath));
123164
+ const bundleDirectory = (0, import_node_path183.dirname)((0, import_node_path183.resolve)(bundlePath));
122893
123165
  const expoRoot = assetsDirectory || isRemoteBundleInput(bundlePath) ? null : findExpoExportRoot(bundleDirectory);
122894
- const candidates = assetsDirectory ? [(0, import_node_path182.resolve)(assetsDirectory)] : [
122895
- ...expoRoot ? [(0, import_node_path182.join)(expoRoot, "assets")] : [],
122896
- (0, import_node_path182.join)(bundleDirectory, "assets"),
123166
+ const candidates = assetsDirectory ? [(0, import_node_path183.resolve)(assetsDirectory)] : [
123167
+ ...expoRoot ? [(0, import_node_path183.join)(expoRoot, "assets")] : [],
123168
+ (0, import_node_path183.join)(bundleDirectory, "assets"),
122897
123169
  bundleDirectory,
122898
- (0, import_node_path182.resolve)(bundleDirectory, "..", "assets")
123170
+ (0, import_node_path183.resolve)(bundleDirectory, "..", "assets")
122899
123171
  ];
122900
123172
  const cwd = process.cwd();
122901
123173
  let projectDirectory = null;
122902
123174
  for (const start of assetsDirectory ? [] : [bundleDirectory, cwd]) {
122903
- let directory2 = (0, import_node_path182.resolve)(start);
123175
+ let directory2 = (0, import_node_path183.resolve)(start);
122904
123176
  while (true) {
122905
123177
  if (detectProject(directory2)?.hasMetroConfig) {
122906
123178
  projectDirectory = directory2;
122907
123179
  break;
122908
123180
  }
122909
- const parent = (0, import_node_path182.dirname)(directory2);
123181
+ const parent = (0, import_node_path183.dirname)(directory2);
122910
123182
  if (parent === directory2) break;
122911
123183
  directory2 = parent;
122912
123184
  }
@@ -122914,11 +123186,11 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
122914
123186
  }
122915
123187
  if (projectDirectory) {
122916
123188
  candidates.push(
122917
- (0, import_node_path182.join)(projectDirectory, "assets"),
122918
- (0, import_node_path182.join)(projectDirectory, "dist"),
122919
- (0, import_node_path182.join)(projectDirectory, "dist", "assets"),
122920
- (0, import_node_path182.join)(projectDirectory, "build"),
122921
- (0, import_node_path182.join)(projectDirectory, "build", "assets")
123189
+ (0, import_node_path183.join)(projectDirectory, "assets"),
123190
+ (0, import_node_path183.join)(projectDirectory, "dist"),
123191
+ (0, import_node_path183.join)(projectDirectory, "dist", "assets"),
123192
+ (0, import_node_path183.join)(projectDirectory, "build"),
123193
+ (0, import_node_path183.join)(projectDirectory, "build", "assets")
122922
123194
  );
122923
123195
  }
122924
123196
  const searched = [];
@@ -122926,7 +123198,7 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
122926
123198
  const stale = [];
122927
123199
  let truncated = false;
122928
123200
  for (const candidate of candidates) {
122929
- const directory2 = (0, import_node_path182.resolve)(candidate);
123201
+ const directory2 = (0, import_node_path183.resolve)(candidate);
122930
123202
  if (searched.includes(directory2)) continue;
122931
123203
  searched.push(directory2);
122932
123204
  const listing = listMetroAssetDest(directory2);
@@ -123007,20 +123279,20 @@ async function produceCloudArtifact(bundlePath, maxBytes = MAX_RNX_CLOUD_BUNDLE_
123007
123279
  }
123008
123280
  function bundleAppProject(bundlePath) {
123009
123281
  if (isRemoteBundleInput(bundlePath)) return null;
123010
- for (let dir = (0, import_node_path182.dirname)((0, import_node_path182.resolve)(bundlePath)); ; dir = (0, import_node_path182.dirname)(dir)) {
123011
- const manifest = (0, import_node_path182.join)(dir, "package.json");
123012
- if ((0, import_node_fs178.existsSync)(manifest)) {
123013
- const json = JSON.parse((0, import_node_fs178.readFileSync)(manifest, "utf8"));
123282
+ for (let dir = (0, import_node_path183.dirname)((0, import_node_path183.resolve)(bundlePath)); ; dir = (0, import_node_path183.dirname)(dir)) {
123283
+ const manifest = (0, import_node_path183.join)(dir, "package.json");
123284
+ if ((0, import_node_fs179.existsSync)(manifest)) {
123285
+ const json = JSON.parse((0, import_node_fs179.readFileSync)(manifest, "utf8"));
123014
123286
  if (isRecord(json) && [json.dependencies, json.devDependencies].some(
123015
123287
  (dependencies) => isRecord(dependencies) && "react-native" in dependencies
123016
123288
  ))
123017
123289
  return dir;
123018
123290
  }
123019
- if ((0, import_node_path182.dirname)(dir) === dir) return null;
123291
+ if ((0, import_node_path183.dirname)(dir) === dir) return null;
123020
123292
  }
123021
123293
  }
123022
123294
  async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirectory, assetServer, nativeProjectDir) {
123023
- const project2 = nativeProjectDir ? (0, import_node_path182.resolve)(nativeProjectDir) : bundleAppProject(bundlePath);
123295
+ const project2 = nativeProjectDir ? (0, import_node_path183.resolve)(nativeProjectDir) : bundleAppProject(bundlePath);
123024
123296
  const loaded4 = await loadBundleSource(bundlePath, command);
123025
123297
  const source = project2 && !readPackageVersionsFooter(loaded4)?.["react-native"] ? insertPackageVersionsFooter(
123026
123298
  loaded4,
@@ -123061,7 +123333,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
123061
123333
  );
123062
123334
  }
123063
123335
  const relative5 = placement?.files.get(variant2.scale);
123064
- if (relative5 && dest) return (0, import_node_fs178.readFileSync)((0, import_node_path182.join)(dest.directory, relative5));
123336
+ if (relative5 && dest) return (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(dest.directory, relative5));
123065
123337
  if (assetServer) {
123066
123338
  const filename2 = metroAssetScaleFilename(
123067
123339
  variant2.descriptor.name,
@@ -123109,7 +123381,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
123109
123381
  );
123110
123382
  const classic = metroIosAssetDestRelatives(variant2.descriptor.httpServerLocation, filename)[0] ?? filename;
123111
123383
  throw new Error(
123112
- `${command} could not read ${(0, import_node_path182.join)(dest?.directory ?? ".", classic)} for ${variant2.descriptor.name}.${variant2.descriptor.type} at scale ${variant2.scale}, and has no stand-in for a .${variant2.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
123384
+ `${command} could not read ${(0, import_node_path183.join)(dest?.directory ?? ".", classic)} for ${variant2.descriptor.name}.${variant2.descriptor.type} at scale ${variant2.scale}, and has no stand-in for a .${variant2.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
123113
123385
  );
123114
123386
  });
123115
123387
  return {
@@ -123256,13 +123528,13 @@ async function createCloudBox(options2) {
123256
123528
  warnings: artifact.warnings
123257
123529
  };
123258
123530
  }
123259
- var import_node_crypto106, import_node_fs178, import_node_path182, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
123531
+ var import_node_crypto106, import_node_fs179, import_node_path183, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
123260
123532
  var init_cloud_client = __esm({
123261
123533
  "cli/cloud-client.ts"() {
123262
123534
  "use strict";
123263
123535
  import_node_crypto106 = require("node:crypto");
123264
- import_node_fs178 = require("node:fs");
123265
- import_node_path182 = require("node:path");
123536
+ import_node_fs179 = require("node:fs");
123537
+ import_node_path183 = require("node:path");
123266
123538
  import_node_vm = require("node:vm");
123267
123539
  init_package_versions();
123268
123540
  init_metroAssetArtifact();
@@ -125656,9 +125928,9 @@ var delimiter = ":";
125656
125928
  function isAbsolute3(p) {
125657
125929
  return p.charCodeAt(0) === 47;
125658
125930
  }
125659
- function normalizeSegments(parts, allowAboveRoot) {
125931
+ function normalizeSegments(parts2, allowAboveRoot) {
125660
125932
  const out = [];
125661
- for (const part of parts) {
125933
+ for (const part of parts2) {
125662
125934
  if (part === "" || part === ".") continue;
125663
125935
  if (part === "..") {
125664
125936
  if (out.length > 0 && out[out.length - 1] !== "..") out.pop();
@@ -125682,23 +125954,23 @@ function normalize(p) {
125682
125954
  if (trailingSlash) joined += "/";
125683
125955
  return absolute ? "/" + joined : joined;
125684
125956
  }
125685
- function join22(...parts) {
125686
- const present = parts.filter((part) => part.length > 0);
125957
+ function join22(...parts2) {
125958
+ const present = parts2.filter((part) => part.length > 0);
125687
125959
  if (present.length === 0) return ".";
125688
125960
  return normalize(present.join("/"));
125689
125961
  }
125690
- function resolve5(...parts) {
125962
+ function resolve5(...parts2) {
125691
125963
  let resolved = "";
125692
125964
  let absolute = false;
125693
- for (let i = parts.length - 1; i >= 0 && !absolute; i--) {
125694
- const part = parts[i];
125965
+ for (let i = parts2.length - 1; i >= 0 && !absolute; i--) {
125966
+ const part = parts2[i];
125695
125967
  if (part.length === 0) continue;
125696
125968
  resolved = resolved.length > 0 ? `${part}/${resolved}` : part;
125697
125969
  absolute = isAbsolute3(part);
125698
125970
  }
125699
125971
  if (!absolute)
125700
125972
  throw new Error(
125701
- `posixPath.resolve needs an absolute segment, got: ${parts.join(", ")}`
125973
+ `posixPath.resolve needs an absolute segment, got: ${parts2.join(", ")}`
125702
125974
  );
125703
125975
  const normalized = normalizeSegments(resolved.split("/"), false).join("/");
125704
125976
  return normalized.length > 0 ? "/" + normalized : "/";
@@ -127828,8 +128100,8 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
127828
128100
  });
127829
128101
  const envEditor = process.env.REACT_EDITOR || process.env.EDITOR;
127830
128102
  if (envEditor) {
127831
- const parts = envEditor.split(" ").filter(Boolean);
127832
- if (parts.length && await trySpawn(parts[0], [...parts.slice(1), "-g", target]))
128103
+ const parts2 = envEditor.split(" ").filter(Boolean);
128104
+ if (parts2.length && await trySpawn(parts2[0], [...parts2.slice(1), "-g", target]))
127833
128105
  return;
127834
128106
  }
127835
128107
  if (await trySpawn("cursor", ["-g", target])) return;
@@ -128320,17 +128592,17 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
128320
128592
  this.writeConnectedRuntimeSnapshot();
128321
128593
  }
128322
128594
  describeSimLoss(sim, code, reason) {
128323
- const parts = [];
128595
+ const parts2 = [];
128324
128596
  const hostInitiated = this.hostCloseCauseBySocket.get(sim.ws);
128325
- if (hostInitiated) parts.push(hostInitiated);
128597
+ if (hostInitiated) parts2.push(hostInitiated);
128326
128598
  if (typeof code === "number") {
128327
128599
  const trimmed = reason?.trim();
128328
128600
  const socket = code === SOOTSIM_BRIDGE_SIM_CLOSE_CODE ? `bridge closed sim socket (${code})` : `sim socket closed (${code}${trimmed ? `, ${trimmed}` : ""})`;
128329
- parts.push(socket);
128601
+ parts2.push(socket);
128330
128602
  } else {
128331
- parts.push("sim socket closed");
128603
+ parts2.push("sim socket closed");
128332
128604
  }
128333
- return parts.join("; ");
128605
+ return parts2.join("; ");
128334
128606
  }
128335
128607
  getRestorableSimState(simId) {
128336
128608
  const snapshot = this.restorableSims.get(simId);