@wix/himalaya-cli 0.1854.0 → 0.1856.0

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 (40) hide show
  1. package/dist/browser-plane/assets.json +5 -5
  2. package/dist/browser-plane/preview-deferred/{fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9.bin → c1f008be31a41521c6de7c1afad419a1f4dad53cbc2701a14738d5b22f291463.bin} +1 -1
  3. package/dist/browser-plane/sw.js +10 -10
  4. package/dist/cli.mjs +598 -312
  5. package/dist/preview-assets.generated.bin +0 -0
  6. package/guides/himi-json-output.md +2 -2
  7. package/guides/one-app-to-himi-app.md +2 -2
  8. package/package.json +2 -2
  9. package/templates/bare-fashion/tier5-src/himi-bare-fashion-home/index.ts +5 -2
  10. package/templates/branded-lite/l10n/ar.json +15 -10
  11. package/templates/branded-lite/l10n/cs.json +15 -10
  12. package/templates/branded-lite/l10n/da.json +15 -10
  13. package/templates/branded-lite/l10n/de.json +15 -10
  14. package/templates/branded-lite/l10n/el.json +15 -10
  15. package/templates/branded-lite/l10n/es.json +15 -10
  16. package/templates/branded-lite/l10n/fi.json +15 -10
  17. package/templates/branded-lite/l10n/fr.json +15 -10
  18. package/templates/branded-lite/l10n/he.json +12 -8
  19. package/templates/branded-lite/l10n/hu.json +15 -10
  20. package/templates/branded-lite/l10n/id.json +15 -10
  21. package/templates/branded-lite/l10n/it.json +15 -10
  22. package/templates/branded-lite/l10n/ja.json +15 -10
  23. package/templates/branded-lite/l10n/ko.json +15 -10
  24. package/templates/branded-lite/l10n/lt.json +15 -10
  25. package/templates/branded-lite/l10n/nl.json +15 -10
  26. package/templates/branded-lite/l10n/no.json +15 -10
  27. package/templates/branded-lite/l10n/pl.json +15 -10
  28. package/templates/branded-lite/l10n/pt.json +15 -10
  29. package/templates/branded-lite/l10n/ru.json +15 -10
  30. package/templates/branded-lite/l10n/sv.json +15 -10
  31. package/templates/branded-lite/l10n/th.json +15 -10
  32. package/templates/branded-lite/l10n/tr.json +15 -10
  33. package/templates/branded-lite/l10n/uk.json +15 -10
  34. package/templates/branded-lite/l10n/vi.json +15 -10
  35. package/templates/branded-lite/l10n/zh.json +15 -10
  36. package/templates/branded-lite/recipes/performance-tracker.json +464 -75
  37. package/templates/branded-lite/tier5-src/_shared/galleries-section.ts +52 -23
  38. package/templates/branded-lite/tier5-src/_shared/performance-tracker-goal.ts +57 -0
  39. package/templates/branded-lite/tier5-src/_shared/performance-tracker-section.ts +124 -49
  40. package/templates/branded-lite/tier5-src/_shared/performance-tracker-weeks.ts +2 -2
package/dist/cli.mjs CHANGED
@@ -3007,12 +3007,13 @@ async function retainedReleaseRefs(store, app2, keepRecent = 20, keepReleaseIds
3007
3007
  }
3008
3008
  return refs;
3009
3009
  }
3010
- var TEMPLATE_APP_PREFIX;
3010
+ var INLINE_ASSET_MAX_BYTES, TEMPLATE_APP_PREFIX;
3011
3011
  var init_store = __esm({
3012
3012
  "../../core/serve-storage/src/store.ts"() {
3013
3013
  init_define_HHP_CATALOG();
3014
3014
  init_ownership2();
3015
3015
  init_wip_pointer();
3016
+ INLINE_ASSET_MAX_BYTES = 4 * 1024 * 1024;
3016
3017
  TEMPLATE_APP_PREFIX = "himi-template-";
3017
3018
  }
3018
3019
  });
@@ -4449,7 +4450,6 @@ var init_himi_package = __esm({
4449
4450
  var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
4450
4451
  var init_icon_catalog_generated = __esm({
4451
4452
  "../../core/ts/src/icon-catalog.generated.ts"() {
4452
- "use strict";
4453
4453
  init_define_HHP_CATALOG();
4454
4454
  ICON_VIEW_BOX = 24;
4455
4455
  ICON_STROKE_WIDTH = 2;
@@ -42996,7 +42996,6 @@ function shouldRevealError(args) {
42996
42996
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
42997
42997
  var init_validation = __esm({
42998
42998
  "../../core/ts/src/validation.ts"() {
42999
- "use strict";
43000
42999
  init_define_HHP_CATALOG();
43001
43000
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
43002
43001
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -147717,7 +147716,9 @@ var init_runtimeCopy_generated = __esm({
147717
147716
  "runtime.nav.dismiss": "Dismiss",
147718
147717
  "runtime.nav.dismissMenu": "Dismiss menu",
147719
147718
  "runtime.nav.dismissSheet": "Dismiss sheet",
147719
+ "runtime.nav.done": "Done",
147720
147720
  "runtime.nav.drawer": "Navigation",
147721
+ "runtime.nav.edit": "Edit",
147721
147722
  "runtime.nav.hostedAppFailed": "Couldn't open {title}.",
147722
147723
  "runtime.nav.jumpToLatest": "Jump to latest",
147723
147724
  "runtime.nav.menu": "Menu",
@@ -147729,7 +147730,14 @@ var init_runtimeCopy_generated = __esm({
147729
147730
  "runtime.nav.screenBlocked": "This screen's address can't be opened here.",
147730
147731
  "runtime.nav.screenFailed": "This screen couldn't render.",
147731
147732
  "runtime.nav.search": "Search",
147733
+ "runtime.nav.searchClear": "Clear",
147734
+ "runtime.nav.searchError": "Results weren't loaded due to a technical issue. Wait and try again.",
147735
+ "runtime.nav.searchNoResults": "No results",
147736
+ "runtime.nav.searchRecents": "Recent searches",
147737
+ "runtime.nav.searchTryAgain": "Try Again",
147738
+ "runtime.nav.selectionCount": "{count} selected",
147732
147739
  "runtime.nav.showActions": "Show actions",
147740
+ "runtime.nav.stillSaving": "Still saving\u2026",
147733
147741
  "runtime.nav.thisApp": "this app",
147734
147742
  "runtime.nav.toggleSidebar": "Toggle sidebar",
147735
147743
  "runtime.nav.voiceSearch": "Voice search",
@@ -153810,7 +153818,7 @@ var init_src6 = __esm({
153810
153818
  });
153811
153819
 
153812
153820
  // ../../core/serve-storage/src/file-store.ts
153813
- import { mkdirSync as mkdirSync22, readFileSync as readFileSync44, rmSync as rmSync12, writeFileSync as writeFileSync17, readdirSync as readdirSync25, existsSync as existsSync41 } from "node:fs";
153821
+ import { mkdirSync as mkdirSync22, readFileSync as readFileSync44, rmSync as rmSync12, writeFileSync as writeFileSync17, readdirSync as readdirSync25, existsSync as existsSync41, statSync as statSync10 } from "node:fs";
153814
153822
  import { join as join36, resolve as resolve35, sep as sep12 } from "node:path";
153815
153823
  var FileReleaseStore;
153816
153824
  var init_file_store = __esm({
@@ -153982,11 +153990,17 @@ var init_file_store = __esm({
153982
153990
  async getSource(app2, sha2569) {
153983
153991
  return this.getDoc(app2, sha2569);
153984
153992
  }
153985
- async getAsset(app2, sha2569) {
153993
+ async getAsset(app2, sha2569, maxBytes) {
153994
+ if (maxBytes !== void 0) {
153995
+ const path2 = join36(this.appDir(app2), "assets", this.safe(sha2569));
153996
+ if (existsSync41(path2) && statSync10(path2).size > maxBytes) return null;
153997
+ }
153986
153998
  return this.read(app2, "assets", this.safe(sha2569));
153987
153999
  }
153988
- async hasAsset(app2, sha2569) {
153989
- return existsSync41(join36(this.appDir(app2), "assets", this.safe(sha2569)));
154000
+ async hasAsset(app2, sha2569, bytes2) {
154001
+ const path2 = join36(this.appDir(app2), "assets", this.safe(sha2569));
154002
+ if (!existsSync41(path2)) return false;
154003
+ return bytes2 === void 0 || statSync10(path2).size === bytes2;
153990
154004
  }
153991
154005
  async listApps() {
153992
154006
  try {
@@ -155881,9 +155895,9 @@ function localDatabaseAnswer(schema2, store, queue, method, params) {
155881
155895
  case "queueDepth":
155882
155896
  return { depth: queue.length };
155883
155897
  case "queueDrain": {
155884
- const drained = queue.length;
155898
+ const drained2 = queue.length;
155885
155899
  queue.length = 0;
155886
- return { drained };
155900
+ return { drained: drained2 };
155887
155901
  }
155888
155902
  // #5776 — principal-bound writes. A crawl session has one principal for life, so its token is
155889
155903
  // constant and a bound write always matches; a foreign token is refused as the runtimes refuse it.
@@ -161790,7 +161804,7 @@ __export(studio_exports, {
161790
161804
  writeStudioRecord: () => writeStudioRecord
161791
161805
  });
161792
161806
  import { createHash as createHash25 } from "node:crypto";
161793
- import { existsSync as existsSync46, readdirSync as readdirSync28, readFileSync as readFileSync49, realpathSync as realpathSync7, statSync as statSync10 } from "node:fs";
161807
+ import { existsSync as existsSync46, readdirSync as readdirSync28, readFileSync as readFileSync49, realpathSync as realpathSync7, statSync as statSync11 } from "node:fs";
161794
161808
  import { basename as basename12, extname as extname3, join as join41, relative as relative11, resolve as resolve37, sep as sep14 } from "node:path";
161795
161809
  import { pathToFileURL as pathToFileURL6 } from "node:url";
161796
161810
  function realInside(dir, abs) {
@@ -161809,7 +161823,7 @@ function archiveFile(dir, memory2, abs) {
161809
161823
  let mtimeMs;
161810
161824
  let ino;
161811
161825
  try {
161812
- ({ size, mtimeMs, ino } = statSync10(real));
161826
+ ({ size, mtimeMs, ino } = statSync11(real));
161813
161827
  } catch {
161814
161828
  return null;
161815
161829
  }
@@ -161877,7 +161891,7 @@ function appIdentity(dir) {
161877
161891
  const icon = text2(manifest2?.icon)?.trim();
161878
161892
  const iconPath = icon ? resolve37(dir, icon) : null;
161879
161893
  const real = iconPath ? realInside(dir, iconPath) : null;
161880
- return { name, iconFile: real && statSync10(real).isFile() ? iconPath : null };
161894
+ return { name, iconFile: real && statSync11(real).isFile() ? iconPath : null };
161881
161895
  }
161882
161896
  function testRuns(dir) {
161883
161897
  const att = join41(dir, ".himi", "attestations");
@@ -162778,7 +162792,7 @@ var init_cli_shared = __esm({
162778
162792
  });
162779
162793
 
162780
162794
  // src/self-update.ts
162781
- import { readFileSync as readFileSync51, mkdirSync as mkdirSync24, writeFileSync as writeFileSync19, existsSync as existsSync48, rmSync as rmSync14, statSync as statSync11, accessSync, constants as constants2 } from "node:fs";
162795
+ import { readFileSync as readFileSync51, mkdirSync as mkdirSync24, writeFileSync as writeFileSync19, existsSync as existsSync48, rmSync as rmSync14, statSync as statSync12, accessSync, constants as constants2 } from "node:fs";
162782
162796
  import { execFile, execFileSync as execFileSync3, spawnSync as spawnSync6 } from "node:child_process";
162783
162797
  import { randomUUID as randomUUID7 } from "node:crypto";
162784
162798
  import { homedir as homedir8, hostname } from "node:os";
@@ -163083,7 +163097,7 @@ function staleUpdateLockFile(cachePath, now) {
163083
163097
  let since = stamped;
163084
163098
  if (!Number.isFinite(since)) {
163085
163099
  try {
163086
- since = statSync11(path2).mtimeMs;
163100
+ since = statSync12(path2).mtimeMs;
163087
163101
  } catch {
163088
163102
  continue;
163089
163103
  }
@@ -163420,7 +163434,7 @@ __export(wix_owner_exports, {
163420
163434
  });
163421
163435
  import { spawn as spawn3 } from "node:child_process";
163422
163436
  import { createHash as createHash26 } from "node:crypto";
163423
- import { accessSync as accessSync2, constants as fsConstants, statSync as statSync12 } from "node:fs";
163437
+ import { accessSync as accessSync2, constants as fsConstants, statSync as statSync13 } from "node:fs";
163424
163438
  import { delimiter, join as join44 } from "node:path";
163425
163439
  function resolveSiteId(flag3) {
163426
163440
  const id = flag3?.trim() || process.env.WIX_SITE_ID?.trim();
@@ -163556,7 +163570,7 @@ function wixCliOnPath(env = process.env) {
163556
163570
  for (const ext of exts) {
163557
163571
  try {
163558
163572
  const candidate = join44(dir, `wix${ext}`);
163559
- if (!statSync12(candidate).isFile()) continue;
163573
+ if (!statSync13(candidate).isFile()) continue;
163560
163574
  if (process.platform !== "win32") accessSync2(candidate, fsConstants.X_OK);
163561
163575
  return true;
163562
163576
  } catch {
@@ -171451,7 +171465,7 @@ var init_customer_signing_inspect = __esm({
171451
171465
  });
171452
171466
 
171453
171467
  // src/push-onboarding.ts
171454
- import { existsSync as existsSync52, mkdirSync as mkdirSync25, readFileSync as readFileSync55, statSync as statSync13, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
171468
+ import { existsSync as existsSync52, mkdirSync as mkdirSync25, readFileSync as readFileSync55, statSync as statSync14, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
171455
171469
  import { basename as basename14, dirname as dirname31, join as join45, resolve as resolve42 } from "node:path";
171456
171470
  function parsePushPlatforms(v2) {
171457
171471
  if (v2 === void 0) return { ok: true };
@@ -171556,7 +171570,7 @@ function localIdentityRefusal(i2) {
171556
171570
  function readKeyFile(path2) {
171557
171571
  let size;
171558
171572
  try {
171559
- size = statSync13(path2).size;
171573
+ size = statSync14(path2).size;
171560
171574
  } catch {
171561
171575
  return { ok: false, code: "key_file_unreadable", reason: "cannot read the selected key file; check its path and file permissions" };
171562
171576
  }
@@ -171753,7 +171767,7 @@ var signing_inspect_exports = {};
171753
171767
  __export(signing_inspect_exports, {
171754
171768
  runSigningInspect: () => runSigningInspect
171755
171769
  });
171756
- import { existsSync as existsSync53, readFileSync as readFileSync56, statSync as statSync14 } from "node:fs";
171770
+ import { existsSync as existsSync53, readFileSync as readFileSync56, statSync as statSync15 } from "node:fs";
171757
171771
  import { isAbsolute as isAbsolute6, resolve as resolve43 } from "node:path";
171758
171772
  function fail5(io2, code3, fields2 = {}) {
171759
171773
  io2.error(JSON.stringify({ ok: false, code: code3, ...fields2 }));
@@ -171846,7 +171860,7 @@ async function runSigningInspect(pos, flags, io2, deps = {}) {
171846
171860
  if (!existsSync53(certPath) || !existsSync53(profilePath2)) {
171847
171861
  return fail5(io2, "signing_inspect_local_assets_unreadable", { error: "cannot read --cert-file or --profile-file" });
171848
171862
  }
171849
- if (statSync14(certPath).size > 1048576 || statSync14(profilePath2).size > 1048576) {
171863
+ if (statSync15(certPath).size > 1048576 || statSync15(profilePath2).size > 1048576) {
171850
171864
  return fail5(io2, "signing_inspect_local_assets_unreadable", { error: "cert or profile file is unexpectedly large" });
171851
171865
  }
171852
171866
  assets = {
@@ -172393,7 +172407,7 @@ __export(template_trim_exports, {
172393
172407
  trimCapabilities: () => trimCapabilities,
172394
172408
  workersInUse: () => workersInUse
172395
172409
  });
172396
- import { cpSync, existsSync as existsSync54, mkdirSync as mkdirSync26, readdirSync as readdirSync30, readFileSync as readFileSync58, renameSync as renameSync10, rmSync as rmSync15, statSync as statSync15, writeFileSync as writeFileSync22 } from "node:fs";
172410
+ import { cpSync, existsSync as existsSync54, mkdirSync as mkdirSync26, readdirSync as readdirSync30, readFileSync as readFileSync58, renameSync as renameSync10, rmSync as rmSync15, statSync as statSync16, writeFileSync as writeFileSync22 } from "node:fs";
172397
172411
  import { dirname as dirname32, join as join47 } from "node:path";
172398
172412
  import ts9 from "typescript";
172399
172413
  function routeMatcher(pattern) {
@@ -173306,14 +173320,14 @@ function homeModulesPass(app2, kept, edited) {
173306
173320
  function listWorkers(dir) {
173307
173321
  const root = join47(dir, "tier5-src");
173308
173322
  if (!existsSync54(root)) return { dirs: [], files: {} };
173309
- const dirs = readdirSync30(root).filter((n2) => statSync15(join47(root, n2)).isDirectory()).sort();
173323
+ const dirs = readdirSync30(root).filter((n2) => statSync16(join47(root, n2)).isDirectory()).sort();
173310
173324
  const files = {};
173311
173325
  const walk5 = (abs, rel2) => {
173312
173326
  for (const name of readdirSync30(abs)) {
173313
173327
  if (name === "node_modules") continue;
173314
173328
  const p2 = join47(abs, name);
173315
173329
  const r3 = `${rel2}/${name}`;
173316
- if (statSync15(p2).isDirectory()) walk5(p2, r3);
173330
+ if (statSync16(p2).isDirectory()) walk5(p2, r3);
173317
173331
  else if (/\.(?:[cm]?[jt]sx?|json)$/.test(name)) files[r3] = readFileSync58(p2, "utf8");
173318
173332
  }
173319
173333
  };
@@ -173749,7 +173763,7 @@ __export(template_adopt_exports, {
173749
173763
  writeInventory: () => writeInventory,
173750
173764
  writeNoFollow: () => writeNoFollow
173751
173765
  });
173752
- import { existsSync as existsSync55, lstatSync as lstatSync19, mkdirSync as mkdirSync27, readdirSync as readdirSync31, readFileSync as readFileSync59, renameSync as renameSync11, statSync as statSync16, writeFileSync as writeFileSync23 } from "node:fs";
173766
+ import { existsSync as existsSync55, lstatSync as lstatSync19, mkdirSync as mkdirSync27, readdirSync as readdirSync31, readFileSync as readFileSync59, renameSync as renameSync11, statSync as statSync17, writeFileSync as writeFileSync23 } from "node:fs";
173753
173767
  import { dirname as dirname33, join as join48, posix as posix2, relative as relative13 } from "node:path";
173754
173768
  import ts10 from "typescript";
173755
173769
  function readAppSources(dir) {
@@ -173763,14 +173777,14 @@ function readAppSources(dir) {
173763
173777
  if (existsSync55(root)) {
173764
173778
  for (const name of readdirSync31(root).sort()) {
173765
173779
  const abs = join48(root, name);
173766
- if (!statSync16(abs).isDirectory()) continue;
173780
+ if (!statSync17(abs).isDirectory()) continue;
173767
173781
  const files = {};
173768
173782
  const walk5 = (a3, rel2) => {
173769
173783
  for (const n2 of readdirSync31(a3).sort()) {
173770
173784
  if (n2 === "node_modules") continue;
173771
173785
  const p2 = join48(a3, n2);
173772
173786
  const r3 = `${rel2}/${n2}`;
173773
- if (statSync16(p2).isDirectory()) walk5(p2, r3);
173787
+ if (statSync17(p2).isDirectory()) walk5(p2, r3);
173774
173788
  else if (/\.(?:[cm]?[jt]sx?)$/.test(n2)) files[r3] = readFileSync59(p2, "utf8");
173775
173789
  }
173776
173790
  };
@@ -173923,7 +173937,7 @@ function walkPackage(dir, rel2 = "") {
173923
173937
  if (IGNORED.has(n2)) continue;
173924
173938
  const r3 = rel2 ? `${rel2}/${n2}` : n2;
173925
173939
  const abs = join48(dir, r3);
173926
- if (statSync16(abs).isDirectory()) out2.push(...walkPackage(dir, r3));
173940
+ if (statSync17(abs).isDirectory()) out2.push(...walkPackage(dir, r3));
173927
173941
  else if (/\.(?:tsx?|jsx?|json)$/.test(n2)) out2.push(r3);
173928
173942
  }
173929
173943
  return out2;
@@ -175623,7 +175637,7 @@ __export(icon_exports, {
175623
175637
  writePreparedIcon: () => writePreparedIcon
175624
175638
  });
175625
175639
  import { createHash as createHash29 } from "node:crypto";
175626
- import { accessSync as accessSync3, constants as constants4, existsSync as existsSync57, mkdirSync as mkdirSync28, readFileSync as readFileSync61, statSync as statSync17, writeFileSync as writeFileSync24 } from "node:fs";
175640
+ import { accessSync as accessSync3, constants as constants4, existsSync as existsSync57, mkdirSync as mkdirSync28, readFileSync as readFileSync61, statSync as statSync18, writeFileSync as writeFileSync24 } from "node:fs";
175627
175641
  import { basename as basename15, dirname as dirname35, join as join49, resolve as resolve45, sep as sep16 } from "node:path";
175628
175642
  function readManifest(dir) {
175629
175643
  try {
@@ -175653,7 +175667,7 @@ function templateIconMatch(png) {
175653
175667
  for (const template of availableTemplates()) {
175654
175668
  const candidate = join49(templateSourceDir(template), DEFAULT_CONTENT_ICON);
175655
175669
  try {
175656
- if (statSync17(candidate).size !== png.length) continue;
175670
+ if (statSync18(candidate).size !== png.length) continue;
175657
175671
  if (readFileSync61(candidate).equals(png)) return template;
175658
175672
  } catch {
175659
175673
  }
@@ -175664,7 +175678,7 @@ function playState(dir) {
175664
175678
  const p2 = join49(resolve45(dir), PLAY_LISTING_ICON);
175665
175679
  if (!existsSync57(p2)) return null;
175666
175680
  try {
175667
- if (!statSync17(p2).isFile()) return { path: p2, issues: ["is a directory, not a PNG file"] };
175681
+ if (!statSync18(p2).isFile()) return { path: p2, issues: ["is a directory, not a PNG file"] };
175668
175682
  return { path: p2, issues: playListingIconIssues(readFileSync61(p2)) };
175669
175683
  } catch (err) {
175670
175684
  return { path: p2, issues: [`could not be read (${err.message.split("\n")[0]})`] };
@@ -175691,7 +175705,7 @@ async function iconStatus(dir) {
175691
175705
  if (!path2 || !existsSync57(path2)) return base2;
175692
175706
  let png;
175693
175707
  try {
175694
- if (!statSync17(path2).isFile()) {
175708
+ if (!statSync18(path2).isFile()) {
175695
175709
  return {
175696
175710
  ...base2,
175697
175711
  byteIssues: [`at ${path2} is a directory, not a PNG file`],
@@ -175816,7 +175830,7 @@ function writePreparedIcon(dir, master, play) {
175816
175830
  ];
175817
175831
  for (const path2 of targets) {
175818
175832
  if (existsSync57(path2)) {
175819
- if (!statSync17(path2).isFile()) throw new Error(`himi icon: destination is not a regular file: ${path2}`);
175833
+ if (!statSync18(path2).isFile()) throw new Error(`himi icon: destination is not a regular file: ${path2}`);
175820
175834
  accessSync3(path2, constants4.W_OK);
175821
175835
  } else accessSync3(dirname35(path2), constants4.W_OK);
175822
175836
  }
@@ -180584,7 +180598,7 @@ __export(pack_exports, {
180584
180598
  });
180585
180599
  import { createHash as createHash30 } from "node:crypto";
180586
180600
  import { deflateRawSync, inflateRawSync } from "node:zlib";
180587
- import { existsSync as existsSync62, mkdirSync as mkdirSync31, readFileSync as readFileSync66, readdirSync as readdirSync32, rmSync as rmSync18, statSync as statSync18, writeFileSync as writeFileSync27 } from "node:fs";
180601
+ import { existsSync as existsSync62, mkdirSync as mkdirSync31, readFileSync as readFileSync66, readdirSync as readdirSync32, rmSync as rmSync18, statSync as statSync19, writeFileSync as writeFileSync27 } from "node:fs";
180588
180602
  import { dirname as dirname38, join as join55, resolve as resolve47 } from "node:path";
180589
180603
  function writeZip(entries) {
180590
180604
  const sorted3 = entries.slice().sort((a3, b3) => a3.path < b3.path ? -1 : a3.path > b3.path ? 1 : 0);
@@ -180679,10 +180693,10 @@ function inflateEntry(buf, entry) {
180679
180693
  return bytes2;
180680
180694
  }
180681
180695
  function readIf(path2) {
180682
- return existsSync62(path2) && statSync18(path2).isFile() ? readFileSync66(path2) : null;
180696
+ return existsSync62(path2) && statSync19(path2).isFile() ? readFileSync66(path2) : null;
180683
180697
  }
180684
180698
  function listDir(dir) {
180685
- return existsSync62(dir) ? readdirSync32(dir).filter((f2) => statSync18(join55(dir, f2)).isFile()) : [];
180699
+ return existsSync62(dir) ? readdirSync32(dir).filter((f2) => statSync19(join55(dir, f2)).isFile()) : [];
180686
180700
  }
180687
180701
  function gatherReleaseEntries(appDir3) {
180688
180702
  const manifestPath = join55(appDir3, HIMI_PACKAGE_MANIFEST_PATH);
@@ -180761,7 +180775,7 @@ function packRelease(releaseRoot, app2, out2, opts = {}) {
180761
180775
  const appDir3 = join55(resolve47(releaseRoot), app2);
180762
180776
  const { all, header: header2, skipped } = buildEntries(appDir3, app2, opts);
180763
180777
  const buf = writeZip(all);
180764
- const isDir3 = existsSync62(out2) && statSync18(out2).isDirectory();
180778
+ const isDir3 = existsSync62(out2) && statSync19(out2).isDirectory();
180765
180779
  const outFile = isDir3 ? join55(resolve47(out2), packageFileName(app2, header2.releaseId)) : resolve47(out2);
180766
180780
  mkdirSync31(dirname38(outFile), { recursive: true });
180767
180781
  writeFileSync27(outFile, buf);
@@ -180779,10 +180793,10 @@ function resolvePackageDirDest(outDir, app2, releaseId) {
180779
180793
  };
180780
180794
  const replaceable = (dir) => {
180781
180795
  if (!existsSync62(dir)) return true;
180782
- if (!statSync18(dir).isDirectory()) return false;
180796
+ if (!statSync19(dir).isDirectory()) return false;
180783
180797
  return readdirSync32(dir).length === 0 || packagedApp(dir) === app2;
180784
180798
  };
180785
- if (existsSync62(outDir) && !statSync18(outDir).isDirectory()) {
180799
+ if (existsSync62(outDir) && !statSync19(outDir).isDirectory()) {
180786
180800
  throw new Error(`refusing to write a package tree over ${outDir} \u2014 it is a file, not a directory`);
180787
180801
  }
180788
180802
  if (replaceable(outDir)) return outDir;
@@ -180839,7 +180853,7 @@ function openPackageDir(dir) {
180839
180853
  for (const name of readdirSync32(abs)) {
180840
180854
  const childRel = rel2 ? `${rel2}/${name}` : name;
180841
180855
  const childAbs = join55(abs, name);
180842
- if (statSync18(childAbs).isDirectory()) walk5(childRel);
180856
+ if (statSync19(childAbs).isDirectory()) walk5(childRel);
180843
180857
  else if (isSafeEntryName(childRel)) entries.set(childRel, readFileSync66(childAbs));
180844
180858
  }
180845
180859
  };
@@ -181224,7 +181238,7 @@ __export(run_watch_exports, {
181224
181238
  watchedContentDir: () => watchedContentDir,
181225
181239
  writeRunRecord: () => writeRunRecord
181226
181240
  });
181227
- import { closeSync as closeSync5, constants as constants5, existsSync as existsSync64, fstatSync as fstatSync2, lstatSync as lstatSync21, statSync as statSync19, readdirSync as readdirSync34, mkdirSync as mkdirSync33, openSync as openSync5, readFileSync as readFileSync68, realpathSync as realpathSync9, renameSync as renameSync12, rmSync as rmSync20, writeFileSync as writeFileSync29, watch as fsWatch } from "node:fs";
181241
+ import { closeSync as closeSync5, constants as constants5, existsSync as existsSync64, fstatSync as fstatSync2, lstatSync as lstatSync21, statSync as statSync20, readdirSync as readdirSync34, mkdirSync as mkdirSync33, openSync as openSync5, readFileSync as readFileSync68, realpathSync as realpathSync9, renameSync as renameSync12, rmSync as rmSync20, writeFileSync as writeFileSync29, watch as fsWatch } from "node:fs";
181228
181242
  import { randomUUID as randomUUID9 } from "node:crypto";
181229
181243
  import { extname as extname4, join as join57, relative as relative14, resolve as resolve49, sep as sep19 } from "node:path";
181230
181244
  function diffReleases(prev, next) {
@@ -181343,7 +181357,7 @@ function watchedContentDir(source2) {
181343
181357
  if (!source2 || /^https?:\/\//i.test(source2)) return null;
181344
181358
  const dir = resolve49(source2);
181345
181359
  try {
181346
- return statSync19(dir).isDirectory() && existsSync64(join57(dir, "himalaya.content.json")) ? dir : null;
181360
+ return statSync20(dir).isDirectory() && existsSync64(join57(dir, "himalaya.content.json")) ? dir : null;
181347
181361
  } catch {
181348
181362
  return null;
181349
181363
  }
@@ -181525,7 +181539,7 @@ var init_run_watch = __esm({
181525
181539
  };
181526
181540
  isDir = (path2) => {
181527
181541
  try {
181528
- return statSync19(path2).isDirectory();
181542
+ return statSync20(path2).isDirectory();
181529
181543
  } catch {
181530
181544
  return false;
181531
181545
  }
@@ -182008,7 +182022,7 @@ __export(milestones_exports, {
182008
182022
  });
182009
182023
  import { createHash as createHash34, randomUUID as randomUUID10 } from "node:crypto";
182010
182024
  import { spawn as spawn4 } from "node:child_process";
182011
- import { closeSync as closeSync6, existsSync as existsSync65, lstatSync as lstatSync24, readFileSync as readFileSync72, statSync as statSync20 } from "node:fs";
182025
+ import { closeSync as closeSync6, existsSync as existsSync65, lstatSync as lstatSync24, readFileSync as readFileSync72, statSync as statSync21 } from "node:fs";
182012
182026
  import { createServer as createServer3 } from "node:net";
182013
182027
  import { basename as basename18, dirname as dirname39, isAbsolute as isAbsolute8, join as join61, relative as relative15, resolve as resolve50, sep as sep20 } from "node:path";
182014
182028
  function homeShotPath(dir, home2) {
@@ -182087,7 +182101,7 @@ async function renderHomeInChild(dir, home2, opts) {
182087
182101
  }
182088
182102
  let fresh = false;
182089
182103
  try {
182090
- fresh = statSync20(shot).mtimeMs >= started - 1e3;
182104
+ fresh = statSync21(shot).mtimeMs >= started - 1e3;
182091
182105
  } catch {
182092
182106
  }
182093
182107
  if (code3 === 0 && fresh) {
@@ -182296,7 +182310,7 @@ function afterBrowserTestRun(dir, input) {
182296
182310
  function shotIsCurrent(shot, sourceChangedAtMs) {
182297
182311
  if (sourceChangedAtMs === void 0) return false;
182298
182312
  try {
182299
- return statSync20(shot).mtimeMs >= sourceChangedAtMs;
182313
+ return statSync21(shot).mtimeMs >= sourceChangedAtMs;
182300
182314
  } catch {
182301
182315
  return false;
182302
182316
  }
@@ -182671,7 +182685,7 @@ function afterHandoverPostcard(dir, opts = {}) {
182671
182685
  let fresh = false;
182672
182686
  try {
182673
182687
  const st2 = lstatSync24(file2);
182674
- fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync20(join61(dir, ".himi", "progress.jsonl")).mtimeMs;
182688
+ fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync21(join61(dir, ".himi", "progress.jsonl")).mtimeMs;
182675
182689
  } catch {
182676
182690
  fresh = false;
182677
182691
  }
@@ -182760,9 +182774,9 @@ function fromBase64(b642) {
182760
182774
  }
182761
182775
  function toBase64(bytes2) {
182762
182776
  let bin = "";
182763
- const CHUNK = 32768;
182764
- for (let i2 = 0; i2 < bytes2.length; i2 += CHUNK) {
182765
- bin += String.fromCharCode(...bytes2.subarray(i2, i2 + CHUNK));
182777
+ const CHUNK2 = 32768;
182778
+ for (let i2 = 0; i2 < bytes2.length; i2 += CHUNK2) {
182779
+ bin += String.fromCharCode(...bytes2.subarray(i2, i2 + CHUNK2));
182766
182780
  }
182767
182781
  return btoa(bin);
182768
182782
  }
@@ -188895,7 +188909,7 @@ var init_localweb = __esm({
188895
188909
  });
188896
188910
 
188897
188911
  // ../native-config/capability-registrations.ts
188898
- import { existsSync as existsSync76, readdirSync as readdirSync38, readFileSync as readFileSync83, statSync as statSync21 } from "node:fs";
188912
+ import { existsSync as existsSync76, readdirSync as readdirSync38, readFileSync as readFileSync83, statSync as statSync22 } from "node:fs";
188899
188913
  import { dirname as dirname42, join as join74, resolve as resolve53 } from "node:path";
188900
188914
  import { fileURLToPath as fileURLToPath29 } from "node:url";
188901
188915
  function registrarClasses(path2, re2) {
@@ -188960,7 +188974,7 @@ function filesWithRegisterMarkers(root, ext) {
188960
188974
  } else {
188961
188975
  stack.push([path2, depth + 1, "main"]);
188962
188976
  }
188963
- } else if (where === "main" && entry.isFile() && entry.name.endsWith(ext) && statSync21(path2).size <= 1 << 20) {
188977
+ } else if (where === "main" && entry.isFile() && entry.name.endsWith(ext) && statSync22(path2).size <= 1 << 20) {
188964
188978
  if (readFileSync83(path2, "utf8").includes(`>>> ${LABEL_CAPABILITIES_REGISTER} `)) out2.push(path2);
188965
188979
  }
188966
188980
  }
@@ -190683,7 +190697,7 @@ __export(gen_native_config_exports, {
190683
190697
  xmlAttr: () => xmlAttr2,
190684
190698
  yamlScalar: () => yamlScalar
190685
190699
  });
190686
- import { existsSync as existsSync81, mkdirSync as mkdirSync34, readFileSync as readFileSync89, readdirSync as readdirSync40, rmSync as rmSync23, statSync as statSync22, writeFileSync as writeFileSync34 } from "node:fs";
190700
+ import { existsSync as existsSync81, mkdirSync as mkdirSync34, readFileSync as readFileSync89, readdirSync as readdirSync40, rmSync as rmSync23, statSync as statSync23, writeFileSync as writeFileSync34 } from "node:fs";
190687
190701
  import { dirname as dirname45, join as join79 } from "node:path";
190688
190702
  import { fileURLToPath as fileURLToPath30 } from "node:url";
190689
190703
  import ts18 from "typescript";
@@ -191230,7 +191244,7 @@ function kotlinBootSourcesUnder(root) {
191230
191244
  } else {
191231
191245
  stack.push([path2, depth + 1, "main"]);
191232
191246
  }
191233
- } else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") && statSync22(path2).size <= BOOT_SOURCE_MAX_BYTES && readFileSync89(path2, "utf8").includes("installLinkedModules")) {
191247
+ } else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") && statSync23(path2).size <= BOOT_SOURCE_MAX_BYTES && readFileSync89(path2, "utf8").includes("installLinkedModules")) {
191234
191248
  out2.push(path2);
191235
191249
  }
191236
191250
  }
@@ -191583,7 +191597,7 @@ function coreExtensionSourceRoots(projectYmlPath) {
191583
191597
  if (t2.type !== "app-extension" || !(t2.dependencies ?? []).some((d2) => /^HimalayaCore/.test(d2.product ?? d2.package ?? ""))) continue;
191584
191598
  const paths2 = (t2.sources ?? []).map((s5) => typeof s5 === "string" ? s5 : s5.path).filter((p2) => !!p2);
191585
191599
  const infoDir = t2.info?.path ? dirname45(t2.info.path) : void 0;
191586
- const root = paths2.find((p2) => p2 === infoDir) ?? paths2.find((p2) => existsSync81(join79(dir, p2)) && statSync22(join79(dir, p2)).isDirectory());
191600
+ const root = paths2.find((p2) => p2 === infoDir) ?? paths2.find((p2) => existsSync81(join79(dir, p2)) && statSync23(join79(dir, p2)).isDirectory());
191587
191601
  if (!root) throw new Error(`${projectYmlPath}: app extension linking HimalayaCore has no source directory to bundle its privacy manifest from`);
191588
191602
  roots2.push(join79(dir, root));
191589
191603
  }
@@ -195298,7 +195312,7 @@ var init_diff_hash = __esm({
195298
195312
 
195299
195313
  // src/attestation-lock.ts
195300
195314
  import { randomBytes as randomBytes2 } from "node:crypto";
195301
- import { closeSync as closeSync7, linkSync, openSync as openSync6, readFileSync as readFileSync98, renameSync as renameSync13, statSync as statSync23, unlinkSync as unlinkSync4, writeSync } from "node:fs";
195315
+ import { closeSync as closeSync7, linkSync, openSync as openSync6, readFileSync as readFileSync98, renameSync as renameSync13, statSync as statSync24, unlinkSync as unlinkSync4, writeSync } from "node:fs";
195302
195316
  import { hostname as hostname2 } from "node:os";
195303
195317
  import { join as join90 } from "node:path";
195304
195318
  function sleepSync2(ms2) {
@@ -195326,7 +195340,7 @@ function processAlive3(pid) {
195326
195340
  function isStale(path2, owner, staleMs, now) {
195327
195341
  if (!owner) {
195328
195342
  try {
195329
- return now - statSync23(path2).mtimeMs > UNREADABLE_STALE_MS;
195343
+ return now - statSync24(path2).mtimeMs > UNREADABLE_STALE_MS;
195330
195344
  } catch {
195331
195345
  return false;
195332
195346
  }
@@ -196159,7 +196173,7 @@ __export(desktop_measure_lint_exports, {
196159
196173
  listRoot: () => listRoot,
196160
196174
  readMeasures: () => readMeasures
196161
196175
  });
196162
- import { readFileSync as readFileSync103, statSync as statSync24 } from "node:fs";
196176
+ import { readFileSync as readFileSync103, statSync as statSync25 } from "node:fs";
196163
196177
  import { isAbsolute as isAbsolute12, resolve as resolve66, sep as sep25 } from "node:path";
196164
196178
  function nodes2(root, at2) {
196165
196179
  const out2 = [];
@@ -196230,7 +196244,7 @@ function readMeasures(dir, config, opts = {}) {
196230
196244
  }
196231
196245
  let size;
196232
196246
  try {
196233
- const st2 = statSync24(file2);
196247
+ const st2 = statSync25(file2);
196234
196248
  if (!st2.isFile()) return DEFAULT_MEASURES;
196235
196249
  size = st2.size;
196236
196250
  } catch {
@@ -198164,7 +198178,7 @@ var init_cli_bridge = __esm({
198164
198178
  });
198165
198179
 
198166
198180
  // src/mcp/file-tools.ts
198167
- import { closeSync as closeSync8, constants as constants6, lstatSync as lstatSync29, mkdirSync as mkdirSync41, openSync as openSync7, readdirSync as readdirSync42, readFileSync as readFileSync108, realpathSync as realpathSync12, renameSync as renameSync15, rmSync as rmSync26, statSync as statSync25, writeSync as writeSync2, existsSync as existsSync97 } from "node:fs";
198181
+ import { closeSync as closeSync8, constants as constants6, lstatSync as lstatSync29, mkdirSync as mkdirSync41, openSync as openSync7, readdirSync as readdirSync42, readFileSync as readFileSync108, realpathSync as realpathSync12, renameSync as renameSync15, rmSync as rmSync26, statSync as statSync26, writeSync as writeSync2, existsSync as existsSync97 } from "node:fs";
198168
198182
  import { randomBytes as randomBytes4 } from "node:crypto";
198169
198183
  import { dirname as dirname53, isAbsolute as isAbsolute13, join as join98, relative as relative21, resolve as resolve68, sep as sep26 } from "node:path";
198170
198184
  import * as z2 from "zod";
@@ -198283,7 +198297,7 @@ function listFiles2(appDir3) {
198283
198297
  const rel2 = relative21(appDir3, p2);
198284
198298
  if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) continue;
198285
198299
  if (files.length >= MAX_LISTED) return false;
198286
- files.push({ path: rel2.split(sep26).join("/"), bytes: statSync25(p2).size });
198300
+ files.push({ path: rel2.split(sep26).join("/"), bytes: statSync26(p2).size });
198287
198301
  }
198288
198302
  }
198289
198303
  return true;
@@ -198319,7 +198333,7 @@ function fileTools() {
198319
198333
  handler: async (a3, d2) => {
198320
198334
  const app2 = await confinedAppDir(a3, d2);
198321
198335
  if (typeof app2 !== "string") return app2;
198322
- if (!existsSync97(app2) || !statSync25(app2).isDirectory()) return refuse5("no_app", `no folder at ${app2}`);
198336
+ if (!existsSync97(app2) || !statSync26(app2).isDirectory()) return refuse5("no_app", `no folder at ${app2}`);
198323
198337
  return ok({ ok: true, dir: app2, ...listFiles2(app2) });
198324
198338
  }
198325
198339
  },
@@ -198335,7 +198349,7 @@ function fileTools() {
198335
198349
  const p2 = confinedPath(app2, a3.path);
198336
198350
  if (typeof p2 !== "string") return refuse5("bad_path", p2.error);
198337
198351
  if (!existsSync97(p2) || !lstatSync29(p2).isFile()) return refuse5("not_found", `no file "${String(a3.path)}"`);
198338
- const size = statSync25(p2).size;
198352
+ const size = statSync26(p2).size;
198339
198353
  if (size > MAX_FILE_BYTES2) return refuse5("too_large", `"${String(a3.path)}" is ${size} bytes \u2014 over the ${MAX_FILE_BYTES2}-byte read limit`);
198340
198354
  return ok({ ok: true, path: a3.path, bytes: size, content: readFileSync108(p2, "utf8") });
198341
198355
  }
@@ -199127,7 +199141,7 @@ var init_open_url = __esm({
199127
199141
  });
199128
199142
 
199129
199143
  // src/store-build-lookup.ts
199130
- import { existsSync as existsSync98, lstatSync as lstatSync30, readFileSync as readFileSync109, readdirSync as readdirSync43, statSync as statSync26 } from "node:fs";
199144
+ import { existsSync as existsSync98, lstatSync as lstatSync30, readFileSync as readFileSync109, readdirSync as readdirSync43, statSync as statSync27 } from "node:fs";
199131
199145
  import { basename as basename25, join as join99, resolve as resolve71 } from "node:path";
199132
199146
  function readUploadFacts(dir) {
199133
199147
  const path2 = join99(dir, LAST_DIST_PATH);
@@ -199154,7 +199168,7 @@ function newestLocalIpa(dir) {
199154
199168
  const folder = join99(dir, LOCAL_IPA_DIR);
199155
199169
  try {
199156
199170
  if (!existsSync98(folder) || lstatSync30(folder).isSymbolicLink() || !lstatSync30(folder).isDirectory()) return void 0;
199157
- const ipas = readdirSync43(folder).filter((n2) => n2.toLowerCase().endsWith(".ipa")).map((n2) => join99(folder, n2)).filter((p2) => lstatSync30(p2).isFile()).sort((a3, b3) => statSync26(b3).mtimeMs - statSync26(a3).mtimeMs);
199171
+ const ipas = readdirSync43(folder).filter((n2) => n2.toLowerCase().endsWith(".ipa")).map((n2) => join99(folder, n2)).filter((p2) => lstatSync30(p2).isFile()).sort((a3, b3) => statSync27(b3).mtimeMs - statSync27(a3).mtimeMs);
199158
199172
  return ipas[0];
199159
199173
  } catch {
199160
199174
  return void 0;
@@ -201457,7 +201471,7 @@ function devtoolsSend(cdp, method, params = {}) {
201457
201471
  return cdp.send(method, params);
201458
201472
  }
201459
201473
  async function attachConsole(port, io2 = {}) {
201460
- const sleep4 = sleepFor(io2);
201474
+ const sleep5 = sleepFor(io2);
201461
201475
  let target;
201462
201476
  for (let i2 = 0; i2 < 30 && !target; i2++) {
201463
201477
  const pages2 = await listPages(port, io2);
@@ -201467,7 +201481,7 @@ async function attachConsole(port, io2 = {}) {
201467
201481
  throw new ConsoleError("auth", reauth ? `Google wants you to confirm it's you again before Play Console (its "Verify it's you" page)` : "The Chrome profile isn't signed in to Google (it shows the sign-in page)", { remediation: "Add --reauth to open the window and sign in there, or run gplay-node console login" });
201468
201482
  }
201469
201483
  if (!target)
201470
- await sleep4(500);
201484
+ await sleep5(500);
201471
201485
  }
201472
201486
  if (!target?.webSocketDebuggerUrl)
201473
201487
  throw new ConsoleError("network", "No Play Console page opened in the Chrome profile");
@@ -201484,7 +201498,7 @@ async function attachConsole(port, io2 = {}) {
201484
201498
  const learn = async (timeoutMs) => {
201485
201499
  const deadline = Date.now() + timeoutMs;
201486
201500
  while (!(auth.apiKey && auth.authUser) && Date.now() < deadline) {
201487
- await sleep4(250);
201501
+ await sleep5(250);
201488
201502
  await new Promise((r3) => setTimeout(r3, 0));
201489
201503
  }
201490
201504
  return !!(auth.apiKey && auth.authUser) && (!wantDev || developerIdFromUrl(await href()) === wantDev);
@@ -201535,7 +201549,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
201535
201549
  let headless = launch.headless && !opened.reauthed;
201536
201550
  let told = false;
201537
201551
  const waitMs = opts.waitMs ?? 10 * 6e4;
201538
- const sleep4 = sleepFor(io2);
201552
+ const sleep5 = sleepFor(io2);
201539
201553
  const tell = (what, how) => {
201540
201554
  if (told)
201541
201555
  return;
@@ -201551,7 +201565,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
201551
201565
  if (headless) {
201552
201566
  current.attached.close();
201553
201567
  current.chrome.close();
201554
- await sleep4(1500);
201568
+ await sleep5(1500);
201555
201569
  const chrome = await launchChrome({ ...launch, headless: false }, io2);
201556
201570
  headless = false;
201557
201571
  tell(what, "A Chrome window opened: sign in there yourself and the command carries on.");
@@ -201570,7 +201584,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
201570
201584
  const href = await current.attached.page.evaluate("location.href").catch(() => "");
201571
201585
  if (isConsoleUrl(href))
201572
201586
  return;
201573
- await sleep4(2e3);
201587
+ await sleep5(2e3);
201574
201588
  }
201575
201589
  throw timedOut(what);
201576
201590
  }
@@ -201676,7 +201690,7 @@ async function awaitSignIn(page, what) {
201676
201690
  await page.signIn(what);
201677
201691
  }
201678
201692
  async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE_MS) {
201679
- const sleep4 = sleeperOf(opts);
201693
+ const sleep5 = sleeperOf(opts);
201680
201694
  const tries = Math.max(1, Math.ceil((opts.readyTimeoutMs ?? 3e4) / 500));
201681
201695
  for (let signIns = 0; ; signIns++) {
201682
201696
  const reply = await page.send("Page.navigate", { url });
@@ -201684,12 +201698,12 @@ async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE
201684
201698
  throw new ConsoleError("network", `Couldn't open ${what}: ${reply.errorText}`);
201685
201699
  let signin = false;
201686
201700
  for (let i2 = 0; i2 < tries && !signin; i2++) {
201687
- await sleep4(500);
201701
+ await sleep5(500);
201688
201702
  const state = await page.evaluate(formScript("ready", `if (${SIGN_IN_TEST}) return 'signin'; return !!(${readyTest});`)).catch(() => false);
201689
201703
  if (state === "signin")
201690
201704
  signin = true;
201691
201705
  else if (state === true) {
201692
- await sleep4(settleMs);
201706
+ await sleep5(settleMs);
201693
201707
  return;
201694
201708
  }
201695
201709
  }
@@ -201704,7 +201718,7 @@ async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE
201704
201718
  throw new ConsoleError("server", `${what} didn't load in Play Console${at2}`, { remediation: "Check the app id and that this Google account can see the app; --show opens the window to watch" });
201705
201719
  }
201706
201720
  async function pressSave(page, what, twoStep, opts = {}) {
201707
- const sleep4 = sleeperOf(opts);
201721
+ const sleep5 = sleeperOf(opts);
201708
201722
  const save = () => page.evaluate(formScript("save", "return { pressed: press('Save'), errors: errors() };"));
201709
201723
  let result = await save();
201710
201724
  if (result.pressed === "missing" && twoStep) {
@@ -201712,7 +201726,7 @@ async function pressSave(page, what, twoStep, opts = {}) {
201712
201726
  if (next.pressed !== "pressed")
201713
201727
  throw new ConsoleError("invalid", `${what}: Next is ${next.pressed}${next.errors.length ? `: ${next.errors.join(" | ")}` : ""}`);
201714
201728
  for (let i2 = 0; i2 < 20; i2++) {
201715
- await sleep4(500);
201729
+ await sleep5(500);
201716
201730
  result = await save();
201717
201731
  if (result.pressed !== "missing")
201718
201732
  break;
@@ -201721,17 +201735,17 @@ async function pressSave(page, what, twoStep, opts = {}) {
201721
201735
  if (result.pressed !== "pressed") {
201722
201736
  throw new ConsoleError("invalid", `${what}: Save is ${result.pressed}${result.errors.length ? `: ${result.errors.join(" | ")}` : ""}`, { remediation: "The form wants something this command doesn't fill in; open it in Play Console" });
201723
201737
  }
201724
- await sleep4(SAVE_WAIT_MS);
201738
+ await sleep5(SAVE_WAIT_MS);
201725
201739
  const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
201726
201740
  if (after.errors.length)
201727
201741
  throw new ConsoleError("invalid", `${what}: Play Console didn't take the answer: ${after.errors.join(" | ")}`);
201728
201742
  }
201729
201743
  async function readBackUntil(page, url, ready, what, read2, ok5, opts, settleMs) {
201730
- const sleep4 = sleeperOf(opts);
201744
+ const sleep5 = sleeperOf(opts);
201731
201745
  let value2;
201732
201746
  for (let attempt2 = 0; attempt2 < READBACK_TRIES; attempt2++) {
201733
201747
  if (attempt2)
201734
- await sleep4(READBACK_GAP_MS);
201748
+ await sleep5(READBACK_GAP_MS);
201735
201749
  await openForm(page, url, ready, what, opts, settleMs);
201736
201750
  value2 = await read2();
201737
201751
  if (ok5(value2))
@@ -201900,10 +201914,10 @@ async function declareTargetAudience(page, url, plan, opts) {
201900
201914
  const next = await page.evaluate(declareScripts.agesNext());
201901
201915
  if (next.pressed !== "pressed")
201902
201916
  throw new ConsoleError("invalid", `Target audience: Next is ${next.pressed}${next.errors.length ? `: ${next.errors.join(" | ")}` : ""}`);
201903
- const sleep4 = sleeperOf(opts);
201917
+ const sleep5 = sleeperOf(opts);
201904
201918
  let summary2 = null;
201905
201919
  for (let i2 = 0; i2 < 20 && summary2 === null; i2++) {
201906
- await sleep4(500);
201920
+ await sleep5(500);
201907
201921
  summary2 = await page.evaluate(declareScripts.agesSummary()).catch(() => null);
201908
201922
  }
201909
201923
  if (summary2 !== wanted.join(", ")) {
@@ -201920,7 +201934,7 @@ async function declareTargetAudience(page, url, plan, opts) {
201920
201934
  async function declareCategory(page, url, plan, opts) {
201921
201935
  const label4 = plan.set;
201922
201936
  const base2 = { form: plan.form, title: plan.title, set: label4 };
201923
- const sleep4 = sleeperOf(opts);
201937
+ const sleep5 = sleeperOf(opts);
201924
201938
  const ready = "document.body.innerText.includes('App category')";
201925
201939
  await openForm(page, url, ready, "Store settings", opts);
201926
201940
  const before = await page.evaluate(declareScripts.categoryNow());
@@ -201931,7 +201945,7 @@ async function declareCategory(page, url, plan, opts) {
201931
201945
  throw new ConsoleError("server", `App category: ${edit.error ?? "Edit wasn't pressed"}`);
201932
201946
  let at2 = null;
201933
201947
  for (let i2 = 0; i2 < 20 && !at2; i2++) {
201934
- await sleep4(500);
201948
+ await sleep5(500);
201935
201949
  at2 = await page.evaluate(declareScripts.categoryDropdown());
201936
201950
  }
201937
201951
  if (!at2)
@@ -201940,7 +201954,7 @@ async function declareCategory(page, url, plan, opts) {
201940
201954
  await page.send("Input.dispatchMouseEvent", { type: type2, x: at2.x, y: at2.y, button: "left", clickCount: 1 });
201941
201955
  let pick5 = { open: false };
201942
201956
  for (let i2 = 0; i2 < 10 && !pick5.open; i2++) {
201943
- await sleep4(500);
201957
+ await sleep5(500);
201944
201958
  pick5 = await page.evaluate(declareScripts.categoryPick(label4));
201945
201959
  }
201946
201960
  if (!pick5.open)
@@ -202434,17 +202448,17 @@ function summarizeDataSafetyCsv(csv2) {
202434
202448
  const answered3 = rows.filter((r3) => (r3[2] ?? "").trim() !== "");
202435
202449
  return { rows: rows.length, answered: answered3.length, questionsAnswered: new Set(answered3.map((r3) => r3[0])).size };
202436
202450
  }
202437
- async function waitForCsv(dir, before, sleep4) {
202451
+ async function waitForCsv(dir, before, sleep5) {
202438
202452
  for (let i2 = 0; i2 < 30; i2++) {
202439
202453
  const fresh = (await readdir(dir)).filter((f2) => !before.has(f2) && f2.toLowerCase().endsWith(".csv"));
202440
202454
  if (fresh.length)
202441
202455
  return fresh[0];
202442
- await sleep4(1e3);
202456
+ await sleep5(1e3);
202443
202457
  }
202444
202458
  return void 0;
202445
202459
  }
202446
202460
  async function pullDataSafety(page, developerId, appId3, opts) {
202447
- const sleep4 = sleeperOf(opts);
202461
+ const sleep5 = sleeperOf(opts);
202448
202462
  const url = appPageUrl(developerId, appId3, "app-content/data-privacy-security");
202449
202463
  await page.send("Page.setDownloadBehavior", { behavior: "allow", downloadPath: opts.downloadDir });
202450
202464
  await openForm(page, url, READY, "The Data safety page", opts, 3e3);
@@ -202455,7 +202469,7 @@ async function pullDataSafety(page, developerId, appId3, opts) {
202455
202469
  const pressed = await page.evaluate(dataSafetyScripts.export());
202456
202470
  if (pressed.pressed !== "pressed")
202457
202471
  throw new ConsoleError("server", `Data safety: Export to CSV is ${pressed.pressed}`);
202458
- const file2 = await waitForCsv(opts.downloadDir, before, sleep4);
202472
+ const file2 = await waitForCsv(opts.downloadDir, before, sleep5);
202459
202473
  if (!file2)
202460
202474
  throw new ConsoleError("server", "Data safety: Export to CSV was pressed but no file arrived in 30 s");
202461
202475
  const csv2 = await readFile6(join105(opts.downloadDir, file2), "utf8");
@@ -202464,7 +202478,7 @@ async function pullDataSafety(page, developerId, appId3, opts) {
202464
202478
  if (last.summary.answered > 0)
202465
202479
  return { ...last.summary, csv: csv2, exports: n2, blank: false };
202466
202480
  if (n2 < attempts)
202467
- await sleep4(5e3);
202481
+ await sleep5(5e3);
202468
202482
  }
202469
202483
  return { ...last.summary, csv: last.csv, exports: attempts, blank: true };
202470
202484
  }
@@ -203432,10 +203446,10 @@ function parsePolicyStatus(snap, developerId, appId3) {
203432
203446
  }
203433
203447
  async function readPolicyStatus(page, developerId, appId3, opts = {}) {
203434
203448
  await openForm(page, appPageUrl(developerId, appId3, CONSOLE_POLICY_PATHS.status), STATUS_READY, "The Policy status page", opts);
203435
- const sleep4 = sleeperOf(opts);
203449
+ const sleep5 = sleeperOf(opts);
203436
203450
  let snap = await page.evaluate(policyScripts.status());
203437
203451
  for (let i2 = 1; i2 < STATUS_TRIES && !snap.rows.length && !snap.empty && !snap.notReviewed; i2++) {
203438
- await sleep4(500);
203452
+ await sleep5(500);
203439
203453
  snap = await page.evaluate(policyScripts.status());
203440
203454
  }
203441
203455
  return parsePolicyStatus(snap, developerId, appId3);
@@ -203469,7 +203483,7 @@ function checkPolicyReply(reply) {
203469
203483
  }
203470
203484
  async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
203471
203485
  checkPolicyReply(reply);
203472
- const sleep4 = sleeperOf(opts);
203486
+ const sleep5 = sleeperOf(opts);
203473
203487
  const word = reply.kind === "appeal" ? "Appeal" : "Resubmit";
203474
203488
  const rejection = await readRejection(page, developerId, appId3, reply.issueId, opts);
203475
203489
  const button = replyButton(rejection, reply.kind);
@@ -203482,7 +203496,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
203482
203496
  for (let i2 = 0; i2 < 20 && !form; i2++) {
203483
203497
  form = await page.evaluate(policyScripts.replyForm()).catch(() => null);
203484
203498
  if (!form)
203485
- await sleep4(500);
203499
+ await sleep5(500);
203486
203500
  }
203487
203501
  if (!form)
203488
203502
  throw new UncertainWriteError(`${word} was pressed on issue ${reply.issueId} and no form with a message box appeared; nothing was typed`);
@@ -203507,7 +203521,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
203507
203521
  const sent = await page.evaluate(policyScripts.replySubmit(submit));
203508
203522
  if (sent.pressed !== "pressed")
203509
203523
  throw new ConsoleError("invalid", `${pageName}: ${submit} is ${sent.pressed}${sent.errors.length ? `: ${sent.errors.join(" | ")}` : ""}`);
203510
- await sleep4(REPLY_WAIT_MS);
203524
+ await sleep5(REPLY_WAIT_MS);
203511
203525
  const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
203512
203526
  if (after.errors.length)
203513
203527
  throw new ConsoleError("invalid", `${pageName}: Play Console didn't take it: ${after.errors.join(" | ")}`);
@@ -203515,7 +203529,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
203515
203529
  let status2 = "not listed";
203516
203530
  for (let attempt2 = 0; attempt2 < READBACK_TRIES2; attempt2++) {
203517
203531
  if (attempt2)
203518
- await sleep4(REPLY_WAIT_MS);
203532
+ await sleep5(REPLY_WAIT_MS);
203519
203533
  try {
203520
203534
  const now = await readPolicyStatus(page, developerId, appId3, opts);
203521
203535
  status2 = now.issues.find((i2) => i2.id === reply.issueId)?.status ?? "not listed";
@@ -203652,7 +203666,7 @@ async function readCard(page, developerId, appId3, opts) {
203652
203666
  }
203653
203667
  async function applyForProduction(page, developerId, appId3, answers2, opts = {}) {
203654
203668
  checkProductionAnswers(answers2);
203655
- const sleep4 = sleeperOf(opts);
203669
+ const sleep5 = sleeperOf(opts);
203656
203670
  const { access: before, applyLabel } = await readCard(page, developerId, appId3, opts);
203657
203671
  if (before.granted)
203658
203672
  throw new ConsoleError("conflict", "This account already has production access; there is nothing to apply for");
@@ -203673,7 +203687,7 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
203673
203687
  let form = null;
203674
203688
  for (let i2 = 0; i2 < 20 && (!form || sameAsBefore(form)); i2++) {
203675
203689
  if (i2)
203676
- await sleep4(500);
203690
+ await sleep5(500);
203677
203691
  form = await page.evaluate(productionScripts.questions()).catch(() => null);
203678
203692
  }
203679
203693
  if (!form)
@@ -203728,13 +203742,13 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
203728
203742
  const went = await page.evaluate(productionScripts.next(next));
203729
203743
  if (went.pressed !== "pressed")
203730
203744
  throw new ConsoleError("invalid", `${pageName}: ${next} is ${went.pressed}${went.errors.length ? `: ${went.errors.join(" | ")}` : ""}; nothing was submitted`);
203731
- await sleep4(1e3);
203745
+ await sleep5(1e3);
203732
203746
  } else
203733
203747
  throw new PageChangedError(pageName, [`no Submit or Next button (buttons: ${form.buttons.join(", ") || "none"})`], "nothing was submitted");
203734
203748
  }
203735
203749
  if (!submitted)
203736
203750
  throw new ConsoleError("server", `${pageName} kept asking (more than ${MAX_FORM_PAGES} pages); nothing was submitted`);
203737
- await sleep4(SUBMIT_WAIT_MS);
203751
+ await sleep5(SUBMIT_WAIT_MS);
203738
203752
  const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
203739
203753
  if (after.errors.length)
203740
203754
  throw new ConsoleError("invalid", `${pageName}: Play Console didn't take it: ${after.errors.join(" | ")}`);
@@ -203742,7 +203756,7 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
203742
203756
  let now = before;
203743
203757
  for (let attempt2 = 0; attempt2 < READBACK_TRIES3; attempt2++) {
203744
203758
  if (attempt2)
203745
- await sleep4(SUBMIT_WAIT_MS);
203759
+ await sleep5(SUBMIT_WAIT_MS);
203746
203760
  try {
203747
203761
  now = await readProductionAccess(page, developerId, appId3, opts);
203748
203762
  } catch (e2) {
@@ -203877,7 +203891,7 @@ function checkContentRating(opts) {
203877
203891
  }
203878
203892
  async function rateContent(page, developerId, appId3, opts) {
203879
203893
  checkContentRating(opts);
203880
- const sleep4 = sleeperOf(opts);
203894
+ const sleep5 = sleeperOf(opts);
203881
203895
  const categoryLabel = RATING_CATEGORIES[opts.category];
203882
203896
  const url = appPageUrl(developerId, appId3, "app-content/content-rating-overview");
203883
203897
  await openForm(page, url, READY_OVERVIEW, "The content rating page", opts, 3e3);
@@ -203886,7 +203900,7 @@ async function rateContent(page, developerId, appId3, opts) {
203886
203900
  throw new ConsoleError("server", "Content rating: no Start questionnaire or Edit button");
203887
203901
  let email = {};
203888
203902
  for (let i2 = 0; i2 < 30 && !("value" in email); i2++) {
203889
- await sleep4(500);
203903
+ await sleep5(500);
203890
203904
  email = await page.evaluate(ratingScripts.emailFocus()).catch(() => ({}));
203891
203905
  }
203892
203906
  if (!("value" in email))
@@ -203914,10 +203928,10 @@ async function rateContent(page, developerId, appId3, opts) {
203914
203928
  const questions = [];
203915
203929
  let answered3;
203916
203930
  for (let round = 0; round < 40 && !answered3; round++) {
203917
- await sleep4(round === 0 ? 3e3 : 900);
203931
+ await sleep5(round === 0 ? 3e3 : 900);
203918
203932
  const p2 = await page.evaluate(ratingScripts.pending());
203919
203933
  if (p2.done) {
203920
- await sleep4(QUESTION_SETTLE_MS);
203934
+ await sleep5(QUESTION_SETTLE_MS);
203921
203935
  const again = await page.evaluate(ratingScripts.pending());
203922
203936
  if (!again.done || (again.answered ?? []).length !== (p2.answered ?? []).length)
203923
203937
  continue;
@@ -203952,7 +203966,7 @@ async function rateContent(page, developerId, appId3, opts) {
203952
203966
  if (draft.pressed !== "pressed")
203953
203967
  throw new ConsoleError("invalid", `Content rating: Next to the Summary is disabled, and the questionnaire's Save is ${draft.pressed}`);
203954
203968
  for (let i2 = 0; i2 < 10 && toSummary.pressed !== "pressed"; i2++) {
203955
- await sleep4(1e3);
203969
+ await sleep5(1e3);
203956
203970
  toSummary = await page.evaluate(ratingScripts.next());
203957
203971
  }
203958
203972
  }
@@ -203963,7 +203977,7 @@ async function rateContent(page, developerId, appId3, opts) {
203963
203977
  }
203964
203978
  let summary2 = null;
203965
203979
  for (let i2 = 0; i2 < 30 && !summary2; i2++) {
203966
- await sleep4(500);
203980
+ await sleep5(500);
203967
203981
  summary2 = await page.evaluate(ratingScripts.summary()).catch(() => null);
203968
203982
  }
203969
203983
  if (!summary2)
@@ -203981,7 +203995,7 @@ async function rateContent(page, developerId, appId3, opts) {
203981
203995
  let shown3 = null;
203982
203996
  const details = await page.evaluate(formScript("viewDetails", "return { pressed: press('View details') };"));
203983
203997
  for (let i2 = 0; i2 < 20 && details.pressed === "pressed" && !shown3; i2++) {
203984
- await sleep4(500);
203998
+ await sleep5(500);
203985
203999
  shown3 = await page.evaluate(ratingScripts.summary()).catch(() => null);
203986
204000
  }
203987
204001
  const onFile = shown3 ? parseRatings(shown3) : {};
@@ -204147,7 +204161,7 @@ async function findClosedTrack(page, developerId, appId3, wanted, opts = {}) {
204147
204161
  }
204148
204162
  async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
204149
204163
  const url = testersUrl(developerId, appId3, track2.id);
204150
- const sleep4 = sleeperOf(opts);
204164
+ const sleep5 = sleeperOf(opts);
204151
204165
  const notes = [];
204152
204166
  await openForm(page, url, READY2, "the track's Testers tab", opts);
204153
204167
  let st2 = await page.evaluate(testerScripts.state());
@@ -204170,7 +204184,7 @@ async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
204170
204184
  await createList(page, plan, opts);
204171
204185
  createdList = true;
204172
204186
  for (let i2 = 0; i2 < 20 && !lists.some((l3) => l3.name === plan.list); i2++) {
204173
- await sleep4(500);
204187
+ await sleep5(500);
204174
204188
  st2 = await page.evaluate(testerScripts.state());
204175
204189
  lists = listsOf(st2);
204176
204190
  }
@@ -204209,7 +204223,7 @@ async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
204209
204223
  return { track: track2, list: plan.list, createdList, saved: true, readBack: `"${plan.list}" is ticked after a reload${createdList ? `, holding ${plan.emails.length} address(es)` : ""}`, ticked: ticked2, ...after.optInUrl ? { optInUrl: after.optInUrl } : {}, notes };
204210
204224
  }
204211
204225
  async function createList(page, plan, opts) {
204212
- const sleep4 = sleeperOf(opts);
204226
+ const sleep5 = sleeperOf(opts);
204213
204227
  const opened = await page.evaluate(testerScripts.openCreate());
204214
204228
  if (opened.pressed !== "pressed" || !opened.dialog)
204215
204229
  throw new ConsoleError("server", `Create email list is ${opened.pressed === "pressed" ? "pressed, but no dialog opened" : opened.pressed}`);
@@ -204223,7 +204237,7 @@ async function createList(page, plan, opts) {
204223
204237
  await type2("Add email addresses", plan.emails.join(", "));
204224
204238
  for (const type3 of ["keyDown", "keyUp"])
204225
204239
  await page.send("Input.dispatchKeyEvent", { type: type3, key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, ...type3 === "keyDown" ? { text: "\r" } : {} });
204226
- await sleep4(1500);
204240
+ await sleep5(1500);
204227
204241
  const filled2 = await page.evaluate(testerScripts.dialogState());
204228
204242
  const missing4 = plan.emails.filter((e2) => !filled2.added?.includes(e2));
204229
204243
  if (!filled2.open || filled2.name !== plan.list || missing4.length) {
@@ -204234,13 +204248,13 @@ async function createList(page, plan, opts) {
204234
204248
  throw new ConsoleError("invalid", `Create email list: Save changes is ${saved.pressed}`);
204235
204249
  let confirm2 = { confirmed: false, open: true };
204236
204250
  for (let i2 = 0; i2 < 10 && !confirm2.confirmed && confirm2.open; i2++) {
204237
- await sleep4(500);
204251
+ await sleep5(500);
204238
204252
  confirm2 = await page.evaluate(testerScripts.confirmShared());
204239
204253
  }
204240
204254
  if (!confirm2.confirmed)
204241
204255
  throw new ConsoleError("server", `Create email list: no confirmation to press${confirm2.text ? ` (the dialog says "${confirm2.text}")` : ""}`);
204242
204256
  for (let i2 = 0; i2 < 20; i2++) {
204243
- await sleep4(500);
204257
+ await sleep5(500);
204244
204258
  if (await page.evaluate(testerScripts.dialogGone()))
204245
204259
  return;
204246
204260
  }
@@ -204311,10 +204325,10 @@ async function stopAt(page, pageName, unknown, what = "nothing was pressed", rem
204311
204325
  throw signInError(pageName);
204312
204326
  throw new PageChangedError(pageName, unknown, what, remediation);
204313
204327
  }
204314
- async function waitUntil(page, read2, ready, sleep4, pageName, never, tries = 120) {
204328
+ async function waitUntil(page, read2, ready, sleep5, pageName, never, tries = 120) {
204315
204329
  let value2;
204316
204330
  for (let i2 = 0; i2 < tries; i2++) {
204317
- await sleep4(500);
204331
+ await sleep5(500);
204318
204332
  value2 = await read2();
204319
204333
  if (ready(value2))
204320
204334
  return value2;
@@ -204331,18 +204345,18 @@ async function readBack(what, fn2) {
204331
204345
  }
204332
204346
  }
204333
204347
  async function confirmRelease(page, developerId, appId3, trackId, o2) {
204334
- const sleep4 = sleeperOf(o2);
204348
+ const sleep5 = sleeperOf(o2);
204335
204349
  await openForm(page, appPageUrl(developerId, appId3, `tracks/${trackId}?tab=releases`), "!!button('Edit release') || !!button('Create new release')", "the track's Releases tab", o2, 3e3);
204336
204350
  const edit = await page.evaluate(reviewScripts.edit());
204337
204351
  if (edit.pressed !== "pressed") {
204338
204352
  const remediation = trackId === PRODUCTION_TRACK_ID ? "If the track has no draft release, put one there first: gplay-node promote <package> <version code> --to production --status draft --owner-approval <id> --confirm" : "If the track has no draft release, put one there first: gplay-node closed-test setup <package> --track alpha --version-code N --status draft --confirm";
204339
204353
  await stopAt(page, "the track's Releases tab", [`no Edit release (Edit release is ${edit.pressed})`], "nothing was pressed; the track may have no draft release to confirm", remediation);
204340
204354
  }
204341
- await waitUntil(page, () => page.evaluate(reviewScripts.prepared()).catch(() => false), (v2) => v2 === true, sleep4, "the release page", "the release page didn't load (no Next and Release name)");
204355
+ await waitUntil(page, () => page.evaluate(reviewScripts.prepared()).catch(() => false), (v2) => v2 === true, sleep5, "the release page", "the release page didn't load (no Next and Release name)");
204342
204356
  const next = await page.evaluate(reviewScripts.next());
204343
204357
  if (next.pressed !== "pressed")
204344
204358
  await stopAt(page, "the release page", [`Next is ${next.pressed}`]);
204345
- const review = await waitUntil(page, () => page.evaluate(reviewScripts.issues()).catch(() => ({ ready: false })), (v2) => !!v2?.ready, sleep4, "the release's Preview and confirm step", "Preview and confirm didn't load (no Save)");
204359
+ const review = await waitUntil(page, () => page.evaluate(reviewScripts.issues()).catch(() => ({ ready: false })), (v2) => !!v2?.ready, sleep5, "the release's Preview and confirm step", "Preview and confirm didn't load (no Save)");
204346
204360
  const issues = review.issues ?? [];
204347
204361
  let acknowledged = false;
204348
204362
  if (review.blocked) {
@@ -204361,7 +204375,7 @@ async function confirmRelease(page, developerId, appId3, trackId, o2) {
204361
204375
  if (ack.pressed !== "pressed")
204362
204376
  await stopAt(page, "the version-code acknowledgment", [`its Proceed is ${ack.pressed}`]);
204363
204377
  acknowledged = true;
204364
- await sleep4(3e3);
204378
+ await sleep5(3e3);
204365
204379
  if (await page.evaluate(reviewScripts.blocked()))
204366
204380
  throw new ConsoleError("server", "Play still won't save the release after the acknowledgment");
204367
204381
  }
@@ -204529,7 +204543,7 @@ async function readCountries(page, developerId, appId3, trackId, opts = {}) {
204529
204543
  }
204530
204544
  async function addCountries(page, developerId, appId3, trackId, countries2, opts = {}) {
204531
204545
  const url = countriesUrl(developerId, appId3, trackId);
204532
- const sleep4 = sleeperOf(opts);
204546
+ const sleep5 = sleeperOf(opts);
204533
204547
  await openForm(page, url, READY3, "the track's Countries / regions tab", opts, 4e3);
204534
204548
  const before = parseTargeted(await page.evaluate(countryScripts.state()));
204535
204549
  const missing4 = countries2.filter((c2) => !before.includes(c2));
@@ -204545,14 +204559,14 @@ async function addCountries(page, developerId, appId3, trackId, countries2, opts
204545
204559
  await page.send("Input.insertText", { text: name });
204546
204560
  let tick = { found: false };
204547
204561
  for (let i2 = 0; i2 < 10 && !tick.found && !tick.ambiguous; i2++) {
204548
- await sleep4(500);
204562
+ await sleep5(500);
204549
204563
  tick = await page.evaluate(countryScripts.tick(name));
204550
204564
  }
204551
204565
  if (tick.ambiguous)
204552
204566
  throw new ConsoleError("invalid", `Countries / regions: more than one row is named "${name}" (${(tick.seen ?? []).join(", ")}); nothing was saved`, { remediation: "Use the name exactly as Play Console lists it" });
204553
204567
  if (!tick.found)
204554
204568
  throw new ConsoleError("invalid", `Countries / regions: no country "${name}" (the search shows: ${(tick.seen ?? []).join(", ") || "nothing"}); nothing was saved`, { remediation: "Use the name exactly as Play Console lists it" });
204555
- await sleep4(800);
204569
+ await sleep5(800);
204556
204570
  }
204557
204571
  await pressSave(page, "Countries / regions", false, opts);
204558
204572
  const after = await readBackUntil(page, url, READY3, "the track's Countries / regions tab", async () => parseTargeted(await page.evaluate(countryScripts.state())), (t2) => countries2.every((c2) => t2.includes(c2)), opts, 4e3);
@@ -207107,7 +207121,7 @@ async function waitForReview(api4, packageName, options2 = {}) {
207107
207121
  if (options2.versionCode !== void 0 && !options2.tracks?.length)
207108
207122
  throw new GplayError("refused", "waiting for a version needs the track it's being reviewed on, like --track production: a copy on another track could already be live");
207109
207123
  const now = options2.now ?? Date.now;
207110
- const sleep4 = options2.sleep ?? ((ms2) => new Promise((done) => setTimeout(done, ms2)));
207124
+ const sleep5 = options2.sleep ?? ((ms2) => new Promise((done) => setTimeout(done, ms2)));
207111
207125
  const interval = options2.intervalMs ?? 5 * 6e4;
207112
207126
  const deadline = now() + (options2.timeoutMs ?? 24 * 60 * 6e4);
207113
207127
  const watched = /* @__PURE__ */ new Set();
@@ -207148,7 +207162,7 @@ async function waitForReview(api4, packageName, options2 = {}) {
207148
207162
  const left = deadline - now();
207149
207163
  if (left <= 0)
207150
207164
  return { outcome: "timeout", releases: last, detail: "Stopped waiting. The review may still be running; run it again to keep waiting." };
207151
- await sleep4(Math.min(interval, left));
207165
+ await sleep5(Math.min(interval, left));
207152
207166
  }
207153
207167
  }
207154
207168
  var DEFAULT_TRACKS, PHASES, REJECTION_HELP, WORST_FIRST, key3, TRANSIENT;
@@ -212629,7 +212643,7 @@ __export(store_google_host_exports, {
212629
212643
  signingFor: () => signingFor
212630
212644
  });
212631
212645
  import { createHash as createHash58, randomUUID as randomUUID14 } from "node:crypto";
212632
- import { existsSync as existsSync99, lstatSync as lstatSync31, mkdirSync as mkdirSync42, readFileSync as readFileSync111, readdirSync as readdirSync44, realpathSync as realpathSync13, renameSync as renameSync16, rmSync as rmSync27, statSync as statSync27, writeFileSync as writeFileSync41 } from "node:fs";
212646
+ import { existsSync as existsSync99, lstatSync as lstatSync31, mkdirSync as mkdirSync42, readFileSync as readFileSync111, readdirSync as readdirSync44, realpathSync as realpathSync13, renameSync as renameSync16, rmSync as rmSync27, statSync as statSync28, writeFileSync as writeFileSync41 } from "node:fs";
212633
212647
  import { join as join116, relative as relative24 } from "node:path";
212634
212648
  function readGooglePlayFacts(dir) {
212635
212649
  const path2 = join116(dir, GOOGLE_FACTS_FILE);
@@ -212713,7 +212727,7 @@ function newestAab(dir) {
212713
212727
  } catch {
212714
212728
  return false;
212715
212729
  }
212716
- }).sort((a3, b3) => statSync27(b3).mtimeMs - statSync27(a3).mtimeMs);
212730
+ }).sort((a3, b3) => statSync28(b3).mtimeMs - statSync28(a3).mtimeMs);
212717
212731
  return found[0];
212718
212732
  } catch {
212719
212733
  return void 0;
@@ -215834,10 +215848,10 @@ var init_pacing = __esm({
215834
215848
  now;
215835
215849
  sleep;
215836
215850
  next = 0;
215837
- constructor(intervalMs, now = Date.now, sleep4 = (ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2))) {
215851
+ constructor(intervalMs, now = Date.now, sleep5 = (ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2))) {
215838
215852
  this.intervalMs = intervalMs;
215839
215853
  this.now = now;
215840
- this.sleep = sleep4;
215854
+ this.sleep = sleep5;
215841
215855
  }
215842
215856
  async wait() {
215843
215857
  if (this.intervalMs <= 0)
@@ -220796,7 +220810,7 @@ var init_review = __esm({
220796
220810
  */
220797
220811
  async waitUntilDone(appRef2, options2 = {}) {
220798
220812
  const now = options2.now ?? Date.now;
220799
- const sleep4 = options2.sleep ?? ((ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2)));
220813
+ const sleep5 = options2.sleep ?? ((ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2)));
220800
220814
  const interval = options2.intervalMs ?? 6e4;
220801
220815
  const deadline = now() + (options2.timeoutMs ?? 30 * 6e4);
220802
220816
  for (; ; ) {
@@ -220808,7 +220822,7 @@ var init_review = __esm({
220808
220822
  throw new ReviewEndedError(`review ended with outcome developer-rejected, not a decision by App Review (${status2.summary}); the submission was canceled or the version pulled`, status2);
220809
220823
  if (now() + interval > deadline)
220810
220824
  throw new PendingError(`review is still ${status2.phase} (${status2.summary}); stopped waiting at the timeout`, status2);
220811
- await sleep4(interval);
220825
+ await sleep5(interval);
220812
220826
  }
220813
220827
  }
220814
220828
  /** What would block or slow a submission, most severe first. */
@@ -228173,7 +228187,7 @@ import * as __ascBuiltin049 from "node:fs";
228173
228187
  import * as __ascBuiltin131 from "node:path";
228174
228188
  function screenshotRefsFrom(dir) {
228175
228189
  const out2 = {};
228176
- const dirs = (d2) => readdirSync46(d2).filter((x2) => statSync28(join122(d2, x2)).isDirectory());
228190
+ const dirs = (d2) => readdirSync46(d2).filter((x2) => statSync29(join122(d2, x2)).isDirectory());
228177
228191
  for (const locale of dirs(dir)) {
228178
228192
  for (const type2 of dirs(join122(dir, locale))) {
228179
228193
  const files = readdirSync46(join122(dir, locale, type2)).filter((f2) => /\.(png|jpe?g)$/i.test(f2)).sort();
@@ -228292,14 +228306,14 @@ function finish(bundleId, appId3, lines2, steps) {
228292
228306
  const next = lines2.length && deferred ? `Apply this batch (one approval), then plan again: ${deferred} step(s) wait for it.${stuck.length ? ` Still open: ${stuck.join(", ")}.` : ""}` : lines2.length ? `Applying this batch (one approval) ${submits ? "submits the app for App Review" : "finishes what can be planned"}.${stuck.length ? ` Still open: ${stuck.join(", ")}.` : ""}` : stuck.length ? `Nothing to apply until ${stuck.join(", ")} ${stuck.length === 1 ? "is" : "are"} resolved.` : deferred ? "Nothing to apply yet: plan again once the deferred steps can be planned." : "Nothing to apply: every step is in place.";
228293
228307
  return { bundleId, appId: appId3, lines: lines2, steps, complete: deferred === 0 && !stuck.length, next };
228294
228308
  }
228295
- var readFileSync115, readdirSync46, statSync28, join122, STORE_STEPS, readJson10, storePrice;
228309
+ var readFileSync115, readdirSync46, statSync29, join122, STORE_STEPS, readJson10, storePrice;
228296
228310
  var init_store_plan = __esm({
228297
228311
  "../../node_modules/@wix/asc-jobs/dist/store-plan.js"() {
228298
228312
  init_define_HHP_CATALOG();
228299
228313
  init_dist3();
228300
228314
  init_actions_release();
228301
228315
  init_dist5();
228302
- ({ readFileSync: readFileSync115, readdirSync: readdirSync46, statSync: statSync28 } = __ascBuiltin049);
228316
+ ({ readFileSync: readFileSync115, readdirSync: readdirSync46, statSync: statSync29 } = __ascBuiltin049);
228303
228317
  ({ join: join122 } = __ascBuiltin131);
228304
228318
  STORE_STEPS = ["appRecord", "bundleId", "category", "price", "privacy", "medicalDevice", "privacyPublish", "publish", "submit"];
228305
228319
  readJson10 = (path2, fact) => {
@@ -230073,7 +230087,7 @@ function checkKeyDirectory(dir) {
230073
230087
  const checkout = gitCheckoutOf(dir);
230074
230088
  if (checkout)
230075
230089
  throw new AscError("refused", `${dir} is inside the git checkout ${checkout}; a private key never goes into a repository \u2014 name a directory outside it (e.g. ~/.asc-node/keys)`);
230076
- if (existsSync101(dir) && !statSync29(dir).isDirectory())
230090
+ if (existsSync101(dir) && !statSync30(dir).isDirectory())
230077
230091
  throw new AscError("invalid", `${dir} is not a directory`);
230078
230092
  return resolve78(dir);
230079
230093
  }
@@ -230117,13 +230131,13 @@ function reserveKeyFile(dir, keyId) {
230117
230131
  }
230118
230132
  };
230119
230133
  }
230120
- var createPrivateKey6, closeSync9, existsSync101, mkdirSync44, openSync8, realpathSync14, statSync29, unlinkSync7, writeSync3, basename29, dirname64, isAbsolute15, join123, resolve78, TEAM_KEY_ROLES, DOWNLOAD_ATTEMPTS, ApiKeysApi;
230134
+ var createPrivateKey6, closeSync9, existsSync101, mkdirSync44, openSync8, realpathSync14, statSync30, unlinkSync7, writeSync3, basename29, dirname64, isAbsolute15, join123, resolve78, TEAM_KEY_ROLES, DOWNLOAD_ATTEMPTS, ApiKeysApi;
230121
230135
  var init_api_keys = __esm({
230122
230136
  "../../node_modules/@wix/asc-web/dist/api-keys.js"() {
230123
230137
  init_define_HHP_CATALOG();
230124
230138
  init_dist3();
230125
230139
  ({ createPrivateKey: createPrivateKey6 } = __ascBuiltin051);
230126
- ({ closeSync: closeSync9, existsSync: existsSync101, mkdirSync: mkdirSync44, openSync: openSync8, realpathSync: realpathSync14, statSync: statSync29, unlinkSync: unlinkSync7, writeSync: writeSync3 } = __ascBuiltin133);
230140
+ ({ closeSync: closeSync9, existsSync: existsSync101, mkdirSync: mkdirSync44, openSync: openSync8, realpathSync: realpathSync14, statSync: statSync30, unlinkSync: unlinkSync7, writeSync: writeSync3 } = __ascBuiltin133);
230127
230141
  ({ basename: basename29, dirname: dirname64, isAbsolute: isAbsolute15, join: join123, resolve: resolve78 } = __ascBuiltin217);
230128
230142
  TEAM_KEY_ROLES = ["ADMIN", "APP_MANAGER", "DEVELOPER", "FINANCE", "SALES", "MARKETING", "ACCESS_TO_REPORTS", "CUSTOMER_SUPPORT", "CREATE_APPS", "CLOUD_MANAGED_APP_DISTRIBUTION", "CLOUD_MANAGED_DEVELOPER_ID"];
230129
230143
  DOWNLOAD_ATTEMPTS = 3;
@@ -230131,9 +230145,9 @@ var init_api_keys = __esm({
230131
230145
  web;
230132
230146
  sleep;
230133
230147
  /** Waits between download attempts; tests pass a no-op. */
230134
- constructor(web4, sleep4 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
230148
+ constructor(web4, sleep5 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
230135
230149
  this.web = web4;
230136
- this.sleep = sleep4;
230150
+ this.sleep = sleep5;
230137
230151
  }
230138
230152
  pages(path2) {
230139
230153
  return this.web.list(path2);
@@ -230207,13 +230221,13 @@ function scrubKeyText(text32, privateKey2) {
230207
230221
  const lines2 = privateKey2.split(/\r?\n/).map((l3) => l3.trim()).filter((l3) => l3.length > 16 && !l3.startsWith("-----"));
230208
230222
  return scrubSecrets(text32, [privateKey2, privateKey2.trim(), ...lines2]).replace(/-----BEGIN [A-Z ]*-----[\s\S]*?(-----END [A-Z ]*-----|$)/g, "[private key removed]");
230209
230223
  }
230210
- var statSync30, join124, keys, destinations, savesKey, createApiKey, revokeApiKey, API_KEY_ACTIONS;
230224
+ var statSync31, join124, keys, destinations, savesKey, createApiKey, revokeApiKey, API_KEY_ACTIONS;
230211
230225
  var init_api_key_actions = __esm({
230212
230226
  "../../node_modules/@wix/asc-web/dist/api-key-actions.js"() {
230213
230227
  init_define_HHP_CATALOG();
230214
230228
  init_dist3();
230215
230229
  init_api_keys();
230216
- ({ statSync: statSync30 } = __ascBuiltin052);
230230
+ ({ statSync: statSync31 } = __ascBuiltin052);
230217
230231
  ({ join: join124 } = __ascBuiltin134);
230218
230232
  keys = (ctx) => {
230219
230233
  if (!ctx.web)
@@ -230343,7 +230357,7 @@ var init_api_key_actions = __esm({
230343
230357
  }
230344
230358
  let mode = 0;
230345
230359
  try {
230346
- mode = statSync30(join124(p2.outputDir, `AuthKey_${key4.keyId}.p8`)).mode & 511;
230360
+ mode = statSync31(join124(p2.outputDir, `AuthKey_${key4.keyId}.p8`)).mode & 511;
230347
230361
  } catch {
230348
230362
  return { ok: false, detail: `key ${key4.keyId} is active, but its private key file is missing` };
230349
230363
  }
@@ -230532,10 +230546,10 @@ var init_portal_keys = __esm({
230532
230546
  selected;
230533
230547
  /** `developerTeam`: a Team ID or exact team name; without it the session's team is matched (developer-teams.ts).
230534
230548
  * `sleep` waits between download attempts; tests pass a no-op. */
230535
- constructor(web4, developerTeam, sleep4 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
230549
+ constructor(web4, developerTeam, sleep5 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
230536
230550
  this.web = web4;
230537
230551
  this.developerTeam = developerTeam;
230538
- this.sleep = sleep4;
230552
+ this.sleep = sleep5;
230539
230553
  }
230540
230554
  headers(accept, contentType) {
230541
230555
  return {
@@ -230813,7 +230827,7 @@ async function takeDownload(keys2, target, recovery, said) {
230813
230827
  recovery.discard();
230814
230828
  return file2.path;
230815
230829
  }
230816
- var randomUUID16, closeSync10, existsSync102, fsyncSync, mkdirSync45, openSync9, readdirSync47, statSync31, unlinkSync8, writeSync4, join125, KEYS_PAGE, api, services, named2, revokeCommand, downloadCommand, createApnsKey, revokePortalKey, downloadPortalKey, PORTAL_KEY_ACTIONS;
230830
+ var randomUUID16, closeSync10, existsSync102, fsyncSync, mkdirSync45, openSync9, readdirSync47, statSync32, unlinkSync8, writeSync4, join125, KEYS_PAGE, api, services, named2, revokeCommand, downloadCommand, createApnsKey, revokePortalKey, downloadPortalKey, PORTAL_KEY_ACTIONS;
230817
230831
  var init_portal_key_actions = __esm({
230818
230832
  "../../node_modules/@wix/asc-web/dist/portal-key-actions.js"() {
230819
230833
  init_define_HHP_CATALOG();
@@ -230822,7 +230836,7 @@ var init_portal_key_actions = __esm({
230822
230836
  init_session();
230823
230837
  init_portal_keys();
230824
230838
  ({ randomUUID: randomUUID16 } = __ascBuiltin054);
230825
- ({ closeSync: closeSync10, existsSync: existsSync102, fsyncSync, mkdirSync: mkdirSync45, openSync: openSync9, readdirSync: readdirSync47, statSync: statSync31, unlinkSync: unlinkSync8, writeSync: writeSync4 } = __ascBuiltin135);
230839
+ ({ closeSync: closeSync10, existsSync: existsSync102, fsyncSync, mkdirSync: mkdirSync45, openSync: openSync9, readdirSync: readdirSync47, statSync: statSync32, unlinkSync: unlinkSync8, writeSync: writeSync4 } = __ascBuiltin135);
230826
230840
  ({ join: join125 } = __ascBuiltin218);
230827
230841
  KEYS_PAGE = "https://developer.apple.com/account/resources/authkeys/list";
230828
230842
  api = (ctx, developerTeam) => {
@@ -230920,7 +230934,7 @@ var init_portal_key_actions = __esm({
230920
230934
  return { ok: false, detail: `key ${keyId} reads back as ${services(key4)}, not APNs` };
230921
230935
  let mode = 0;
230922
230936
  try {
230923
- mode = statSync31(join125(p2.outputDir, `AuthKey_${keyId}.p8`)).mode & 511;
230937
+ mode = statSync32(join125(p2.outputDir, `AuthKey_${keyId}.p8`)).mode & 511;
230924
230938
  } catch {
230925
230939
  return { ok: false, detail: `key ${keyId} is an APNs key, but its private key file is missing` };
230926
230940
  }
@@ -231011,7 +231025,7 @@ var init_portal_key_actions = __esm({
231011
231025
  if (applied) {
231012
231026
  let mode = 0;
231013
231027
  try {
231014
- mode = statSync31(join125(p2.outputDir, `AuthKey_${p2.keyId}.p8`)).mode & 511;
231028
+ mode = statSync32(join125(p2.outputDir, `AuthKey_${p2.keyId}.p8`)).mode & 511;
231015
231029
  } catch {
231016
231030
  return { ok: false, detail: `key ${p2.keyId}'s private key file is missing` };
231017
231031
  }
@@ -232220,7 +232234,7 @@ function preparePrivateDirectory(dir) {
232220
232234
  return path2;
232221
232235
  }
232222
232236
  mkdirSync46(path2, { recursive: true, mode: 448 });
232223
- if (statSync32(path2).mode & 63)
232237
+ if (statSync33(path2).mode & 63)
232224
232238
  throw new AscError("refused", `${path2} is not private after creating it`);
232225
232239
  return path2;
232226
232240
  }
@@ -232276,13 +232290,13 @@ async function downloadThreadAttachments(client4, threadId, outDir) {
232276
232290
  }
232277
232291
  return result;
232278
232292
  }
232279
- var lstatSync32, mkdirSync46, statSync32, writeFileSync43, basename31, join126, resolve79, MAX_NAME_ATTEMPTS, refreshKey;
232293
+ var lstatSync32, mkdirSync46, statSync33, writeFileSync43, basename31, join126, resolve79, MAX_NAME_ATTEMPTS, refreshKey;
232280
232294
  var init_review_attachments = __esm({
232281
232295
  "../../node_modules/@wix/asc-web/dist/review-attachments.js"() {
232282
232296
  init_define_HHP_CATALOG();
232283
232297
  init_dist3();
232284
232298
  init_api_keys();
232285
- ({ lstatSync: lstatSync32, mkdirSync: mkdirSync46, statSync: statSync32, writeFileSync: writeFileSync43 } = __ascBuiltin056);
232299
+ ({ lstatSync: lstatSync32, mkdirSync: mkdirSync46, statSync: statSync33, writeFileSync: writeFileSync43 } = __ascBuiltin056);
232286
232300
  ({ basename: basename31, join: join126, resolve: resolve79 } = __ascBuiltin137);
232287
232301
  MAX_NAME_ATTEMPTS = 1e4;
232288
232302
  refreshKey = (a3) => [a3.sourceType, a3.id, a3.threadId, a3.messageId ?? "", a3.reviewRejectionId ?? ""].join("|");
@@ -232447,7 +232461,7 @@ function resolveMessagesDb(raw, home2 = homedir14()) {
232447
232461
  const given = raw?.trim();
232448
232462
  const path2 = !given ? join127(home2, "Library", "Messages", "chat.db") : resolvePath2(given === "~" || given.startsWith("~/") ? join127(home2, given.slice(1)) : given);
232449
232463
  try {
232450
- if (statSync33(path2).isDirectory())
232464
+ if (statSync34(path2).isDirectory())
232451
232465
  throw new MessagesCodeError(`the Messages database path ${path2} is a directory; --db must point at chat.db`);
232452
232466
  } catch (e2) {
232453
232467
  if (e2 instanceof MessagesCodeError)
@@ -232464,7 +232478,7 @@ function resolveMessagesDb(raw, home2 = homedir14()) {
232464
232478
  async function waitForAppleCode(options2) {
232465
232479
  const query = options2.query ?? systemSqliteQuery;
232466
232480
  const now = options2.now ?? Date.now;
232467
- const sleep4 = options2.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
232481
+ const sleep5 = options2.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
232468
232482
  const pollMs = options2.pollMs ?? 2e3;
232469
232483
  const deadline = now() + options2.timeoutMs;
232470
232484
  const sql = messagesCodeQuery(options2.cutoffMs);
@@ -232484,7 +232498,7 @@ async function waitForAppleCode(options2) {
232484
232498
  if (now() + pollMs > deadline) {
232485
232499
  throw new MessagesCodeError(`no Apple verification code in Messages within ${Math.round(options2.timeoutMs / 1e3)}s (accepting messages ${options2.window}); check that the code went by SMS and that iPhone Text Message Forwarding is on for this Mac`);
232486
232500
  }
232487
- await sleep4(pollMs);
232501
+ await sleep5(pollMs);
232488
232502
  }
232489
232503
  }
232490
232504
  function parseDuration(text32) {
@@ -232497,14 +232511,14 @@ function parseDuration(text32) {
232497
232511
  total += Number(n2) * unit[u2];
232498
232512
  return total > 0 ? total : void 0;
232499
232513
  }
232500
- var execFile5, homedir14, join127, resolvePath2, statSync33, pathToFileURL8, MESSAGES_DEFAULT_SINCE_MS, MESSAGES_MAX_SINCE_MS, MESSAGES_DEFAULT_TIMEOUT_MS, REQUEST_SKEW_MS, ROW_LIMIT, SECONDS_THRESHOLD, APPLE_EPOCH_MS, SYSTEM_SQLITE, MessagesCodeError, isPrivacyError, systemSqliteQuery;
232514
+ var execFile5, homedir14, join127, resolvePath2, statSync34, pathToFileURL8, MESSAGES_DEFAULT_SINCE_MS, MESSAGES_MAX_SINCE_MS, MESSAGES_DEFAULT_TIMEOUT_MS, REQUEST_SKEW_MS, ROW_LIMIT, SECONDS_THRESHOLD, APPLE_EPOCH_MS, SYSTEM_SQLITE, MessagesCodeError, isPrivacyError, systemSqliteQuery;
232501
232515
  var init_messages_code = __esm({
232502
232516
  "../../node_modules/@wix/asc-web/dist/messages-code.js"() {
232503
232517
  init_define_HHP_CATALOG();
232504
232518
  ({ execFile: execFile5 } = __ascBuiltin057);
232505
232519
  ({ homedir: homedir14 } = __ascBuiltin138);
232506
232520
  ({ join: join127, resolve: resolvePath2 } = __ascBuiltin219);
232507
- ({ statSync: statSync33 } = __ascBuiltin37);
232521
+ ({ statSync: statSync34 } = __ascBuiltin37);
232508
232522
  ({ pathToFileURL: pathToFileURL8 } = __ascBuiltin42);
232509
232523
  MESSAGES_DEFAULT_SINCE_MS = 6e4;
232510
232524
  MESSAGES_MAX_SINCE_MS = 10 * 6e4;
@@ -232627,7 +232641,7 @@ function readSessionBundle(path2) {
232627
232641
  throw new SessionBundleError(`the session bundle is larger than ${MAX_SESSION_BUNDLE_BYTES} bytes`);
232628
232642
  return readFileSync116(path2, "utf8");
232629
232643
  }
232630
- var chmodSync4, closeSync11, constants9, fstatSync3, lstatSync33, mkdirSync47, openSync10, readFileSync116, renameSync17, rmSync28, statSync34, writeSync5, createHash67, randomBytes16, dirname65, isAbsolute16, join128, resolve80, SESSION_BUNDLE_KIND, SESSION_BUNDLE_VERSION, MAX_SESSION_BUNDLE_BYTES, SessionBundleError, isAppleDomain, SESSION_FILE_VERSION, FileSessionStore, KEYRING_HINT, SecretServiceSessionStore;
232644
+ var chmodSync4, closeSync11, constants9, fstatSync3, lstatSync33, mkdirSync47, openSync10, readFileSync116, renameSync17, rmSync28, statSync35, writeSync5, createHash67, randomBytes16, dirname65, isAbsolute16, join128, resolve80, SESSION_BUNDLE_KIND, SESSION_BUNDLE_VERSION, MAX_SESSION_BUNDLE_BYTES, SessionBundleError, isAppleDomain, SESSION_FILE_VERSION, FileSessionStore, KEYRING_HINT, SecretServiceSessionStore;
232631
232645
  var init_session_transfer = __esm({
232632
232646
  "../../node_modules/@wix/asc-web/dist/session-transfer.js"() {
232633
232647
  init_define_HHP_CATALOG();
@@ -232635,7 +232649,7 @@ var init_session_transfer = __esm({
232635
232649
  init_api_keys();
232636
232650
  init_session_lock();
232637
232651
  init_session();
232638
- ({ chmodSync: chmodSync4, closeSync: closeSync11, constants: constants9, fstatSync: fstatSync3, lstatSync: lstatSync33, mkdirSync: mkdirSync47, openSync: openSync10, readFileSync: readFileSync116, renameSync: renameSync17, rmSync: rmSync28, statSync: statSync34, writeSync: writeSync5 } = __ascBuiltin058);
232652
+ ({ chmodSync: chmodSync4, closeSync: closeSync11, constants: constants9, fstatSync: fstatSync3, lstatSync: lstatSync33, mkdirSync: mkdirSync47, openSync: openSync10, readFileSync: readFileSync116, renameSync: renameSync17, rmSync: rmSync28, statSync: statSync35, writeSync: writeSync5 } = __ascBuiltin058);
232639
232653
  ({ createHash: createHash67, randomBytes: randomBytes16 } = __ascBuiltin139);
232640
232654
  ({ dirname: dirname65, isAbsolute: isAbsolute16, join: join128, resolve: resolve80 } = __ascBuiltin220);
232641
232655
  SESSION_BUNDLE_KIND = "asc-node-web-session";
@@ -232701,7 +232715,7 @@ var init_session_transfer = __esm({
232701
232715
  }
232702
232716
  prepareDir() {
232703
232717
  mkdirSync47(this.dir, { recursive: true, mode: 448 });
232704
- if (!statSync34(this.dir).isDirectory())
232718
+ if (!statSync35(this.dir).isDirectory())
232705
232719
  throw Object.assign(new Error("not a directory"), { code: "ENOTDIR" });
232706
232720
  chmodSync4(this.dir, 448);
232707
232721
  }
@@ -233253,7 +233267,7 @@ async function startConnectServer(opts) {
233253
233267
  return closed;
233254
233268
  }
233255
233269
  const idle = async (maxWaitMs) => {
233256
- const drained = (async () => {
233270
+ const drained2 = (async () => {
233257
233271
  while (inflight) {
233258
233272
  const current = inflight;
233259
233273
  await current;
@@ -233263,14 +233277,14 @@ async function startConnectServer(opts) {
233263
233277
  return true;
233264
233278
  })();
233265
233279
  if (maxWaitMs === void 0 || !inflight)
233266
- return drained;
233280
+ return drained2;
233267
233281
  let cap2;
233268
233282
  const late = new Promise((resolve135) => {
233269
233283
  cap2 = setTimeout(() => resolve135(false), maxWaitMs);
233270
233284
  cap2.unref();
233271
233285
  });
233272
233286
  try {
233273
- return await Promise.race([drained, late]);
233287
+ return await Promise.race([drained2, late]);
233274
233288
  } finally {
233275
233289
  clearTimeout(cap2);
233276
233290
  }
@@ -234957,8 +234971,8 @@ function localFiles(inv) {
234957
234971
  }
234958
234972
  function screenshotsFrom(dir) {
234959
234973
  const out2 = {};
234960
- for (const locale of readdirSync48(dir).filter((d2) => statSync35(join130(dir, d2)).isDirectory())) {
234961
- for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync35(join130(dir, locale, d2)).isDirectory())) {
234974
+ for (const locale of readdirSync48(dir).filter((d2) => statSync36(join130(dir, d2)).isDirectory())) {
234975
+ for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync36(join130(dir, locale, d2)).isDirectory())) {
234962
234976
  const files = readdirSync48(join130(dir, locale, type2)).filter((f2) => /\.(png|jpe?g)$/i.test(f2)).sort();
234963
234977
  if (files.length)
234964
234978
  (out2[locale] ??= {})[type2] = files.map((f2) => ({ fileName: f2, ...fileRef(join130(dir, locale, type2, f2)) }));
@@ -234970,8 +234984,8 @@ function screenshotsFrom(dir) {
234970
234984
  }
234971
234985
  function previewsFrom(dir) {
234972
234986
  const out2 = {};
234973
- for (const locale of readdirSync48(dir).filter((d2) => statSync35(join130(dir, d2)).isDirectory())) {
234974
- for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync35(join130(dir, locale, d2)).isDirectory())) {
234987
+ for (const locale of readdirSync48(dir).filter((d2) => statSync36(join130(dir, d2)).isDirectory())) {
234988
+ for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync36(join130(dir, locale, d2)).isDirectory())) {
234975
234989
  const files = readdirSync48(join130(dir, locale, type2)).filter((f2) => /\.(mov|m4v|mp4)$/i.test(f2)).sort();
234976
234990
  if (files.length)
234977
234991
  (out2[locale] ??= {})[type2] = files.map((f2) => ({ fileName: f2, ...fileRef(join130(dir, locale, type2, f2)) }));
@@ -235016,7 +235030,7 @@ function batchView(b3) {
235016
235030
  const r3 = batchReport(b3);
235017
235031
  return { batch: b3.id, status: b3.status, planHash: b3.planHash.slice(0, 16), approvals: b3.approvals.map((a3) => a3.approver), decision: b3.decision, summary: r3.summary, lines: r3.items.map((i2) => `${i2.status} ${i2.action} ${i2.key}${i2.error ? ` \u2014 ${i2.error.split("\n")[0]}` : ""}`) };
235018
235032
  }
235019
- var readdirSync48, readFileSync118, statSync35, writeFileSync44, join130, sizeText2, VERSION_FLAGS, APP_INFO_FLAGS, stringFlags, REVIEW_DETAIL_OPTIONS, batchExit, RELEASE_COMMANDS;
235033
+ var readdirSync48, readFileSync118, statSync36, writeFileSync44, join130, sizeText2, VERSION_FLAGS, APP_INFO_FLAGS, stringFlags, REVIEW_DETAIL_OPTIONS, batchExit, RELEASE_COMMANDS;
235020
235034
  var init_commands_release = __esm({
235021
235035
  "../../node_modules/@wix/asc/dist/commands-release.js"() {
235022
235036
  init_define_HHP_CATALOG();
@@ -235026,7 +235040,7 @@ var init_commands_release = __esm({
235026
235040
  init_commands();
235027
235041
  init_output2();
235028
235042
  init_commands_record();
235029
- ({ readdirSync: readdirSync48, readFileSync: readFileSync118, statSync: statSync35, writeFileSync: writeFileSync44 } = __ascBuiltin064);
235043
+ ({ readdirSync: readdirSync48, readFileSync: readFileSync118, statSync: statSync36, writeFileSync: writeFileSync44 } = __ascBuiltin064);
235030
235044
  ({ join: join130 } = __ascBuiltin141);
235031
235045
  sizeText2 = ([w2, h2]) => `${w2}x${h2}`;
235032
235046
  VERSION_FLAGS = { description: "description", keywords: "keywords", "whats-new": "whatsNew", "promotional-text": "promotionalText", "marketing-url": "marketingUrl", "support-url": "supportUrl" };
@@ -236504,9 +236518,9 @@ function draftBody(inv) {
236504
236518
  }
236505
236519
  let bytes2;
236506
236520
  try {
236507
- if (!statSync36(file2).isFile())
236521
+ if (!statSync37(file2).isFile())
236508
236522
  throw new Error("not a regular file");
236509
- if (statSync36(file2).size > BODY_LIMIT)
236523
+ if (statSync37(file2).size > BODY_LIMIT)
236510
236524
  throw new UsageError(`--body-file is over the ${BODY_LIMIT}-byte limit`);
236511
236525
  bytes2 = readFileSync120(file2);
236512
236526
  } catch (e2) {
@@ -236524,7 +236538,7 @@ function draftBody(inv) {
236524
236538
  throw new UsageError("--body-file must hold a message");
236525
236539
  return body;
236526
236540
  }
236527
- var readFileSync120, statSync36, resolve84, appleIdOption2, appOptions, BODY_LIMIT, webJob, draftOptions, subscriptionColumns, WEB_REVIEW_COMMANDS;
236541
+ var readFileSync120, statSync37, resolve84, appleIdOption2, appOptions, BODY_LIMIT, webJob, draftOptions, subscriptionColumns, WEB_REVIEW_COMMANDS;
236528
236542
  var init_commands_web_review = __esm({
236529
236543
  "../../node_modules/@wix/asc/dist/commands-web-review.js"() {
236530
236544
  init_define_HHP_CATALOG();
@@ -236533,7 +236547,7 @@ var init_commands_web_review = __esm({
236533
236547
  init_commands();
236534
236548
  init_commands_web();
236535
236549
  init_output2();
236536
- ({ readFileSync: readFileSync120, statSync: statSync36 } = __ascBuiltin067);
236550
+ ({ readFileSync: readFileSync120, statSync: statSync37 } = __ascBuiltin067);
236537
236551
  ({ resolve: resolve84 } = __ascBuiltin143);
236538
236552
  appleIdOption2 = { "apple-id": { type: "string" } };
236539
236553
  appOptions = { ...appleIdOption2, app: { type: "string" } };
@@ -242310,7 +242324,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
242310
242324
  } catch (e2) {
242311
242325
  throw new AscError("invalid", `${param}: cannot read ${path2} (${e2.code ?? "unreadable"})`);
242312
242326
  }
242313
- const stat10 = statSync37(real);
242327
+ const stat10 = statSync38(real);
242314
242328
  if (o2.directory ? !stat10.isDirectory() : !stat10.isFile())
242315
242329
  throw new AscError("invalid", `${param}: ${path2} is not a ${o2.directory ? "directory" : "regular file"}`);
242316
242330
  let state;
@@ -242514,7 +242528,7 @@ ${o2.detail}` : ""}` };
242514
242528
  function enabledTools(env, o2 = {}) {
242515
242529
  return TOOLS.filter((t2) => !t2.write || env.ASC_MCP_WRITE === "1" || o2.approvals === true);
242516
242530
  }
242517
- var mkdirSync49, readFileSync124, realpathSync15, statSync37, writeFileSync47, delimiter3, isAbsolute17, join133, relative25, resolve86, sep29, READ, PLAN, APPLY, BATCH_SUMMARY_LINES, BATCH_CHANGES_PER_LINE, BATCH_CHANGE_LINES, ok2, app, reads, jobView2, noAppleId, EXIT_KINDS, notesOf2, cliResult, flag2, ACTIONS, FAMILIES, inside2, identityFile, appleIdParam, TOOLS;
242531
+ var mkdirSync49, readFileSync124, realpathSync15, statSync38, writeFileSync47, delimiter3, isAbsolute17, join133, relative25, resolve86, sep29, READ, PLAN, APPLY, BATCH_SUMMARY_LINES, BATCH_CHANGES_PER_LINE, BATCH_CHANGE_LINES, ok2, app, reads, jobView2, noAppleId, EXIT_KINDS, notesOf2, cliResult, flag2, ACTIONS, FAMILIES, inside2, identityFile, appleIdParam, TOOLS;
242518
242532
  var init_tools2 = __esm({
242519
242533
  "../../node_modules/@wix/asc-mcp/dist/tools.js"() {
242520
242534
  init_define_HHP_CATALOG();
@@ -242524,7 +242538,7 @@ var init_tools2 = __esm({
242524
242538
  init_dist6();
242525
242539
  init_dist7();
242526
242540
  init_action_catalog_generated();
242527
- ({ mkdirSync: mkdirSync49, readFileSync: readFileSync124, realpathSync: realpathSync15, statSync: statSync37, writeFileSync: writeFileSync47 } = __ascBuiltin075);
242541
+ ({ mkdirSync: mkdirSync49, readFileSync: readFileSync124, realpathSync: realpathSync15, statSync: statSync38, writeFileSync: writeFileSync47 } = __ascBuiltin075);
242528
242542
  ({ delimiter: delimiter3, isAbsolute: isAbsolute17, join: join133, relative: relative25, resolve: resolve86, sep: sep29 } = __ascBuiltin148);
242529
242543
  READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
242530
242544
  PLAN = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true };
@@ -243550,15 +243564,15 @@ var init_store_android = __esm({
243550
243564
  const developerId = developerOf(app2, clients);
243551
243565
  const appId3 = await appIdOf2(app2, clients);
243552
243566
  const gplay2 = clients;
243553
- const sleep4 = gplay2.sleep ? { sleep: gplay2.sleep } : {};
243567
+ const sleep5 = gplay2.sleep ? { sleep: gplay2.sleep } : {};
243554
243568
  const { status: status2, issue: issue3 } = await withConsole(gplay2, { developerId, appId: appId3 }, async (opened) => {
243555
243569
  const page = readOnlyConsolePage(opened);
243556
- const status3 = await readPolicyStatus(page, developerId, appId3, sleep4);
243570
+ const status3 = await readPolicyStatus(page, developerId, appId3, sleep5);
243557
243571
  const pick5 = issueId ?? status3.issues.find((i2) => NEEDS_ACTION.test(i2.status))?.id;
243558
243572
  if (!pick5)
243559
243573
  return { status: status3, issue: null };
243560
243574
  const listed = status3.issues.find((i2) => i2.id === pick5);
243561
- const rejection = await readRejection(page, developerId, appId3, pick5, sleep4);
243575
+ const rejection = await readRejection(page, developerId, appId3, pick5, sleep5);
243562
243576
  return { status: status3, issue: { id: pick5, ...listed ? { title: listed.title, status: listed.status, ...listed.deadline ? { deadline: listed.deadline } : {} } : {}, ...rejection } };
243563
243577
  });
243564
243578
  const replies = issue3 ? issue3.actions.filter((x2) => REPLY_ACTIONS.test(x2)) : [];
@@ -244742,7 +244756,7 @@ __export(apple_keys_exports, {
244742
244756
  runAppleKeys: () => runAppleKeys
244743
244757
  });
244744
244758
  import { createPublicKey as createPublicKey5 } from "node:crypto";
244745
- import { readFileSync as readFileSync125, realpathSync as realpathSync16, statSync as statSync38 } from "node:fs";
244759
+ import { readFileSync as readFileSync125, realpathSync as realpathSync16, statSync as statSync39 } from "node:fs";
244746
244760
  function readKey2(flags, kind) {
244747
244761
  const names2 = kind === "asc" ? ["asc-key-file", "asc-key-id", "asc-issuer-id"] : ["iap-key", "iap-key-id", "iap-issuer-id"];
244748
244762
  if (names2.every((name) => flags[name] === void 0)) return void 0;
@@ -244751,7 +244765,7 @@ function readKey2(flags, kind) {
244751
244765
  try {
244752
244766
  const path2 = realpathSync16(file2);
244753
244767
  assertCredentialOutsideRepo(names2[0], path2);
244754
- if (statSync38(path2).size > 16384) throw new Error("oversized");
244768
+ if (statSync39(path2).size > 16384) throw new Error("oversized");
244755
244769
  const key4 = { keyId, issuerId, key: readFileSync125(path2, "utf8") };
244756
244770
  if (!isAppStoreConnectKey(key4)) throw new Error("invalid key");
244757
244771
  return key4;
@@ -247553,7 +247567,7 @@ __export(browser_authoring_exports, {
247553
247567
  });
247554
247568
  import { createServer as createServer6 } from "node:http";
247555
247569
  import { createHash as createHash73, randomBytes as randomBytes19 } from "node:crypto";
247556
- import { existsSync as existsSync110, readdirSync as readdirSync51, readFileSync as readFileSync131, realpathSync as realpathSync18, statSync as statSync39 } from "node:fs";
247570
+ import { existsSync as existsSync110, readdirSync as readdirSync51, readFileSync as readFileSync131, realpathSync as realpathSync18, statSync as statSync40 } from "node:fs";
247557
247571
  import { join as join143, posix as posix3, relative as relative29, sep as sep31 } from "node:path";
247558
247572
  function humanMs(ms2) {
247559
247573
  return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
@@ -247569,7 +247583,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
247569
247583
  for (const name of readdirSync51(abs).sort()) {
247570
247584
  const childAbs = join143(abs, name);
247571
247585
  const childRel = posix3.join(rel2, name);
247572
- if (statSync39(childAbs).isDirectory()) {
247586
+ if (statSync40(childAbs).isDirectory()) {
247573
247587
  walk5(childAbs, childRel);
247574
247588
  } else if (/\.(ts|tsx|js|mjs|json)$/.test(name)) {
247575
247589
  files[childRel] = readFileSync131(childAbs, "utf8");
@@ -247603,7 +247617,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
247603
247617
  join143(onDisk, "index.js")
247604
247618
  ];
247605
247619
  for (const abs of candidates) {
247606
- if (!existsSync110(abs) || statSync39(abs).isDirectory()) continue;
247620
+ if (!existsSync110(abs) || statSync40(abs).isDirectory()) continue;
247607
247621
  const key4 = `/tier5-src/${relative29(tier5SrcDir, abs).split(sep31).join(posix3.sep)}`;
247608
247622
  if (key4 in files) break;
247609
247623
  files[key4] = readFileSync131(abs, "utf8");
@@ -250281,7 +250295,7 @@ ${indent}`);
250281
250295
 
250282
250296
  // src/one-app/access-cli.ts
250283
250297
  import { createHash as createHash78 } from "node:crypto";
250284
- import { existsSync as existsSync114, readFileSync as readFileSync135, rmSync as rmSync31, statSync as statSync40, writeFileSync as writeFileSync54 } from "node:fs";
250298
+ import { existsSync as existsSync114, readFileSync as readFileSync135, rmSync as rmSync31, statSync as statSync41, writeFileSync as writeFileSync54 } from "node:fs";
250285
250299
  import { join as join147, resolve as resolve95 } from "node:path";
250286
250300
  function parseArgs2(args) {
250287
250301
  let evidenceDir;
@@ -250465,7 +250479,7 @@ async function runOneAppAccess(args, io2) {
250465
250479
  let configText;
250466
250480
  let screensText;
250467
250481
  try {
250468
- for (const path2 of [configPath, screensPath]) if (!statSync40(path2).isFile()) throw new Error(`${path2} is not a file.`);
250482
+ for (const path2 of [configPath, screensPath]) if (!statSync41(path2).isFile()) throw new Error(`${path2} is not a file.`);
250469
250483
  configText = readFileSync135(configPath, "utf8");
250470
250484
  screensText = readFileSync135(screensPath, "utf8");
250471
250485
  } catch (error) {
@@ -251204,7 +251218,7 @@ __export(validate_topbar_exports, {
251204
251218
  runOneAppTopBarValidation: () => runOneAppTopBarValidation
251205
251219
  });
251206
251220
  import { createHash as createHash79 } from "node:crypto";
251207
- import { existsSync as existsSync117, readFileSync as readFileSync138, statSync as statSync41 } from "node:fs";
251221
+ import { existsSync as existsSync117, readFileSync as readFileSync138, statSync as statSync42 } from "node:fs";
251208
251222
  import { resolve as resolve97, join as join150 } from "node:path";
251209
251223
  import ts25 from "typescript";
251210
251224
  function enrichedControls(raw, views2, omit) {
@@ -251732,7 +251746,7 @@ function validate3(evidenceDir, contentDir2) {
251732
251746
  let drawerInvite = false;
251733
251747
  try {
251734
251748
  configPath = join150(contentDir2, "config.ts");
251735
- if (!statSync41(configPath).isFile()) throw new Error("config.ts is not a file.");
251749
+ if (!statSync42(configPath).isFile()) throw new Error("config.ts is not a file.");
251736
251750
  target = configActions(configPath);
251737
251751
  drawerInvite = drawerOffersInvite(readFileSync138(configPath, "utf8"));
251738
251752
  descriptorBars = screenActions2(contentDir2);
@@ -252009,7 +252023,7 @@ __export(shot_files_exports, {
252009
252023
  writeScreenShot: () => writeScreenShot
252010
252024
  });
252011
252025
  import { createHash as createHash80 } from "node:crypto";
252012
- import { mkdirSync as mkdirSync55, readdirSync as readdirSync54, readFileSync as readFileSync140, rmSync as rmSync33, statSync as statSync42 } from "node:fs";
252026
+ import { mkdirSync as mkdirSync55, readdirSync as readdirSync54, readFileSync as readFileSync140, rmSync as rmSync33, statSync as statSync43 } from "node:fs";
252013
252027
  import { basename as basename35, dirname as dirname69, join as join152, relative as relative30, resolve as resolve98, sep as sep32 } from "node:path";
252014
252028
  function writeAtomic2(file2, bytes2) {
252015
252029
  for (let attempt2 = 0; ; attempt2++) {
@@ -252117,7 +252131,7 @@ function listFiles4(root, keep) {
252117
252131
  }
252118
252132
  function mtimeOf(file2) {
252119
252133
  try {
252120
- return statSync42(file2).mtimeMs;
252134
+ return statSync43(file2).mtimeMs;
252121
252135
  } catch {
252122
252136
  return null;
252123
252137
  }
@@ -252589,7 +252603,7 @@ __export(render_cache_exports, {
252589
252603
  renderCacheKey: () => renderCacheKey
252590
252604
  });
252591
252605
  import { createHash as createHash82, randomBytes as randomBytes20 } from "node:crypto";
252592
- import { existsSync as existsSync121, lstatSync as lstatSync36, mkdirSync as mkdirSync57, readdirSync as readdirSync55, readFileSync as readFileSync143, readlinkSync as readlinkSync3, realpathSync as realpathSync19, renameSync as renameSync20, rmSync as rmSync34, statSync as statSync43, writeFileSync as writeFileSync58 } from "node:fs";
252606
+ import { existsSync as existsSync121, lstatSync as lstatSync36, mkdirSync as mkdirSync57, readdirSync as readdirSync55, readFileSync as readFileSync143, readlinkSync as readlinkSync3, realpathSync as realpathSync19, renameSync as renameSync20, rmSync as rmSync34, statSync as statSync44, writeFileSync as writeFileSync58 } from "node:fs";
252593
252607
  import { join as join155, resolve as resolve99 } from "node:path";
252594
252608
  import { fileURLToPath as fileURLToPath35 } from "node:url";
252595
252609
  function renderCacheKey(contentDir2, inputs) {
@@ -252619,7 +252633,7 @@ function renderCacheKey(contentDir2, inputs) {
252619
252633
  }
252620
252634
  function statOrNull(path2) {
252621
252635
  try {
252622
- return statSync43(path2);
252636
+ return statSync44(path2);
252623
252637
  } catch {
252624
252638
  return null;
252625
252639
  }
@@ -252684,7 +252698,7 @@ function cliFingerprint(version5, monorepo) {
252684
252698
  let entry = "";
252685
252699
  try {
252686
252700
  const file2 = fileURLToPath35(import.meta.url);
252687
- const st2 = statSync43(file2);
252701
+ const st2 = statSync44(file2);
252688
252702
  entry = `${file2}:${st2.size}:${st2.mtimeMs}`;
252689
252703
  } catch {
252690
252704
  }
@@ -252718,7 +252732,7 @@ function keepBuild(contentDir2, key4, buildDir, build3) {
252718
252732
  else renameSync20(buildDir, dest);
252719
252733
  for (const name of readdirSync55(root)) {
252720
252734
  const path2 = join155(root, name);
252721
- if (name.startsWith(".build-") ? Date.now() - statSync43(path2).mtimeMs > 36e5 : name !== key4) {
252735
+ if (name.startsWith(".build-") ? Date.now() - statSync44(path2).mtimeMs > 36e5 : name !== key4) {
252722
252736
  rmSync34(path2, { recursive: true, force: true });
252723
252737
  }
252724
252738
  }
@@ -253696,8 +253710,22 @@ var init_assets = __esm({
253696
253710
  // ../serve-cli/src/large-assets.ts
253697
253711
  var large_assets_exports = {};
253698
253712
  __export(large_assets_exports, {
253713
+ LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC: () => LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC,
253714
+ busyRetryAfterSec: () => busyRetryAfterSec,
253699
253715
  uploadLargeAssets: () => uploadLargeAssets
253700
253716
  });
253717
+ function busyRetryAfterSec(put) {
253718
+ if (put.ok || put.status !== 429 && put.status !== 503) return void 0;
253719
+ let body;
253720
+ try {
253721
+ body = JSON.parse(put.text);
253722
+ } catch {
253723
+ return void 0;
253724
+ }
253725
+ if (body.code !== "large_asset_upload_in_flight" && body.code !== "large_asset_upload_capacity") return void 0;
253726
+ const wait = typeof body.retryAfterSec === "number" && body.retryAfterSec > 0 ? body.retryAfterSec : 5;
253727
+ return wait <= LARGE_ASSET_BUSY_MAX_WAIT_SEC ? wait : void 0;
253728
+ }
253701
253729
  async function uploadLargeAssets(client4, app2, uploads) {
253702
253730
  const uploaded = [];
253703
253731
  const alreadyStored = [];
@@ -253705,9 +253733,24 @@ async function uploadLargeAssets(client4, app2, uploads) {
253705
253733
  for (const u2 of uploads) {
253706
253734
  const declaration2 = { app: app2, sha256: u2.sha256, bytes: u2.bytes, contentType: u2.contentType };
253707
253735
  const fail16 = (code3, error, hint, extra = {}) => ({ ok: false, code: code3, error, sha256: u2.sha256, names: u2.names, ...extra, hint });
253736
+ const quotaExceeded = (status2, body) => fail16(
253737
+ "large_asset_quota_exceeded",
253738
+ `this ${body.scope === "account" ? "account" : "app"} has used its large asset upload budget for the last 24 hours`,
253739
+ "wait for the 24-hour window to pass, or upload fewer or smaller large assets; already-stored assets are not charged again",
253740
+ { status: status2, body }
253741
+ );
253708
253742
  const first = await client4.largeAssetTarget(declaration2);
253709
253743
  const j2 = first.json;
253710
253744
  if (!first.ok) {
253745
+ if (j2?.code === "large_assets_unavailable" && typeof j2.limit === "number") {
253746
+ const limit = j2.limit;
253747
+ return fail16(
253748
+ "large_assets_unavailable",
253749
+ `this serve plane keeps large assets in its own store, up to ${limit} bytes each, and this one is ${u2.bytes}`,
253750
+ `make the asset smaller than ${limit} bytes, or an operator must set LARGE_ASSET_S3 and its key pair on the plane`,
253751
+ { status: first.status, body: j2 }
253752
+ );
253753
+ }
253711
253754
  if (j2?.code === "large_assets_unavailable" || j2?.error === "large_assets_unavailable") {
253712
253755
  return fail16(
253713
253756
  "large_assets_unavailable",
@@ -253724,14 +253767,7 @@ async function uploadLargeAssets(client4, app2, uploads) {
253724
253767
  { status: first.status, body: j2 }
253725
253768
  );
253726
253769
  }
253727
- if (j2?.code === "large_asset_quota_exceeded") {
253728
- return fail16(
253729
- "large_asset_quota_exceeded",
253730
- "this app has used its large asset upload budget for the last 24 hours",
253731
- "wait for the 24-hour window to pass, or upload fewer or smaller large assets; already-stored assets are not charged again",
253732
- { status: first.status, body: j2 }
253733
- );
253734
- }
253770
+ if (j2?.code === "large_asset_quota_exceeded") return quotaExceeded(first.status, j2);
253735
253771
  if (j2?.code === "large_asset_quota_contended") {
253736
253772
  return fail16(
253737
253773
  "large_asset_upload_failed",
@@ -253756,15 +253792,40 @@ async function uploadLargeAssets(client4, app2, uploads) {
253756
253792
  }
253757
253793
  let put;
253758
253794
  try {
253759
- put = await client4.putLargeAsset({
253760
- uploadUrl: j2.uploadUrl,
253761
- method: typeof j2.method === "string" ? j2.method : "PUT",
253762
- headers: j2.headers && typeof j2.headers === "object" ? j2.headers : {},
253763
- ...typeof j2.auth === "string" ? { auth: j2.auth } : {}
253764
- }, await u2.read());
253795
+ const bytes2 = await u2.read();
253796
+ for (let waited = 0; ; ) {
253797
+ put = await client4.putLargeAsset({
253798
+ uploadUrl: j2.uploadUrl,
253799
+ method: typeof j2.method === "string" ? j2.method : "PUT",
253800
+ headers: j2.headers && typeof j2.headers === "object" ? j2.headers : {},
253801
+ ...typeof j2.auth === "string" ? { auth: j2.auth } : {}
253802
+ }, bytes2);
253803
+ const wait = busyRetryAfterSec(put);
253804
+ if (wait === void 0 || waited + wait > LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC) break;
253805
+ await sleep4(wait * 1e3);
253806
+ waited += wait;
253807
+ }
253765
253808
  } catch (e2) {
253766
253809
  return fail16("large_asset_upload_failed", `upload failed: ${e2.message}`, "check the network and retry the push; already-stored assets are skipped");
253767
253810
  }
253811
+ if (!put.ok && put.status === 429) {
253812
+ const refusal2 = (() => {
253813
+ try {
253814
+ return JSON.parse(put.text);
253815
+ } catch {
253816
+ return null;
253817
+ }
253818
+ })();
253819
+ if (refusal2?.code === "large_asset_quota_exceeded") return quotaExceeded(put.status, refusal2);
253820
+ if (refusal2?.code === "large_asset_upload_rate_limited") {
253821
+ return fail16(
253822
+ "large_asset_upload_failed",
253823
+ "this account has sent too many large asset uploads in the last 10 minutes",
253824
+ `wait ${typeof refusal2.retryAfterSec === "number" ? `${refusal2.retryAfterSec} s` : "a few minutes"} and push again; already-stored assets are skipped`,
253825
+ { status: put.status, body: refusal2 }
253826
+ );
253827
+ }
253828
+ }
253768
253829
  if (!put.ok && put.status !== 412) {
253769
253830
  return fail16(
253770
253831
  "large_asset_upload_failed",
@@ -253782,9 +253843,13 @@ async function uploadLargeAssets(client4, app2, uploads) {
253782
253843
  }
253783
253844
  return { ok: true, uploaded, alreadyStored, bytesUploaded };
253784
253845
  }
253846
+ var LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC, LARGE_ASSET_BUSY_MAX_WAIT_SEC, sleep4;
253785
253847
  var init_large_assets = __esm({
253786
253848
  "../serve-cli/src/large-assets.ts"() {
253787
253849
  init_define_HHP_CATALOG();
253850
+ LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC = 360;
253851
+ LARGE_ASSET_BUSY_MAX_WAIT_SEC = 15;
253852
+ sleep4 = (ms2) => new Promise((r3) => setTimeout(r3, ms2));
253788
253853
  }
253789
253854
  });
253790
253855
 
@@ -255118,7 +255183,7 @@ __export(login_refresh_exports, {
255118
255183
  isStoredLogin: () => isStoredLogin,
255119
255184
  refreshStoredLogin: () => refreshStoredLogin
255120
255185
  });
255121
- import { closeSync as closeSync13, openSync as openSync12, statSync as statSync45, unlinkSync as unlinkSync10 } from "node:fs";
255186
+ import { closeSync as closeSync13, openSync as openSync12, statSync as statSync46, unlinkSync as unlinkSync10 } from "node:fs";
255122
255187
  function federatedTokenNeedsRefresh(token, nowSec) {
255123
255188
  if (!token) return false;
255124
255189
  const c2 = decodeControlTokenClaims(token);
@@ -255130,7 +255195,7 @@ function isStoredLogin(target, token, path2) {
255130
255195
  }
255131
255196
  async function withLock2(path2, deps, fn2, onTimeout) {
255132
255197
  const lock = `${path2}.refresh.lock`;
255133
- const sleep4 = deps.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
255198
+ const sleep5 = deps.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
255134
255199
  const started = Date.now();
255135
255200
  let acquired = false;
255136
255201
  for (; ; ) {
@@ -255140,7 +255205,7 @@ async function withLock2(path2, deps, fn2, onTimeout) {
255140
255205
  break;
255141
255206
  } catch {
255142
255207
  try {
255143
- if (Date.now() - statSync45(lock).mtimeMs > LOCK_STALE_MS) {
255208
+ if (Date.now() - statSync46(lock).mtimeMs > LOCK_STALE_MS) {
255144
255209
  unlinkSync10(lock);
255145
255210
  continue;
255146
255211
  }
@@ -255148,7 +255213,7 @@ async function withLock2(path2, deps, fn2, onTimeout) {
255148
255213
  continue;
255149
255214
  }
255150
255215
  if (Date.now() - started > (deps.lockWaitMs ?? LOCK_WAIT_MS)) return onTimeout();
255151
- await sleep4(100);
255216
+ await sleep5(100);
255152
255217
  }
255153
255218
  }
255154
255219
  try {
@@ -255799,7 +255864,7 @@ var init_package_share = __esm({
255799
255864
  });
255800
255865
 
255801
255866
  // ../../core/serve-runtime/src/rate-limit.ts
255802
- var FixedWindowRateLimiter;
255867
+ var FixedWindowRateLimiter, QueuedConcurrencyLimiter, KeyedQueuedConcurrencyLimiter;
255803
255868
  var init_rate_limit = __esm({
255804
255869
  "../../core/serve-runtime/src/rate-limit.ts"() {
255805
255870
  init_define_HHP_CATALOG();
@@ -255847,6 +255912,129 @@ var init_rate_limit = __esm({
255847
255912
  if (!first.done) this.hits.delete(first.value);
255848
255913
  }
255849
255914
  };
255915
+ QueuedConcurrencyLimiter = class {
255916
+ constructor(max, maxWaiting) {
255917
+ this.max = max;
255918
+ this.maxWaiting = maxWaiting;
255919
+ this.max = Math.max(1, max);
255920
+ }
255921
+ inUse = 0;
255922
+ waiting = [];
255923
+ /** A release fn once a slot is held, or null at once when the queue is full too. A waiter whose
255924
+ * `signal` aborts leaves the queue and gets null, so a client that went away holds no place. */
255925
+ async acquire(signal) {
255926
+ if (signal?.aborted) return null;
255927
+ if (this.inUse >= this.max) {
255928
+ if (this.waiting.length >= this.maxWaiting) return null;
255929
+ const got = await new Promise((resolve135) => {
255930
+ const turn = () => {
255931
+ signal?.removeEventListener("abort", leave);
255932
+ resolve135(true);
255933
+ };
255934
+ const leave = () => {
255935
+ const at2 = this.waiting.indexOf(turn);
255936
+ if (at2 >= 0) this.waiting.splice(at2, 1);
255937
+ resolve135(false);
255938
+ };
255939
+ this.waiting.push(turn);
255940
+ signal?.addEventListener("abort", leave, { once: true });
255941
+ });
255942
+ if (!got) return null;
255943
+ } else {
255944
+ this.inUse += 1;
255945
+ }
255946
+ let released = false;
255947
+ return () => {
255948
+ if (released) return;
255949
+ released = true;
255950
+ const next = this.waiting.shift();
255951
+ if (next) next();
255952
+ else if (this.inUse > 0) this.inUse -= 1;
255953
+ };
255954
+ }
255955
+ get active() {
255956
+ return this.inUse;
255957
+ }
255958
+ get queued() {
255959
+ return this.waiting.length;
255960
+ }
255961
+ };
255962
+ KeyedQueuedConcurrencyLimiter = class {
255963
+ constructor(max, maxWaiting) {
255964
+ this.max = max;
255965
+ this.maxWaiting = maxWaiting;
255966
+ }
255967
+ pools = /* @__PURE__ */ new Map();
255968
+ async acquire(key4, signal) {
255969
+ let pool2 = this.pools.get(key4);
255970
+ if (!pool2) this.pools.set(key4, pool2 = new QueuedConcurrencyLimiter(this.max, this.maxWaiting));
255971
+ const release4 = await pool2.acquire(signal);
255972
+ if (!release4) {
255973
+ this.forget(key4, pool2);
255974
+ return null;
255975
+ }
255976
+ let released = false;
255977
+ return () => {
255978
+ if (released) return;
255979
+ released = true;
255980
+ release4();
255981
+ this.forget(key4, pool2);
255982
+ };
255983
+ }
255984
+ forget(key4, pool2) {
255985
+ if (pool2.active === 0 && pool2.queued === 0 && this.pools.get(key4) === pool2) this.pools.delete(key4);
255986
+ }
255987
+ /** Keys with a slot held or a caller waiting. */
255988
+ get size() {
255989
+ return this.pools.size;
255990
+ }
255991
+ };
255992
+ }
255993
+ });
255994
+
255995
+ // ../../core/serve-runtime/src/releasing-body.ts
255996
+ function releasingBody(bytes2, release4, floorMs) {
255997
+ let buf = bytes2;
255998
+ let at2 = 0;
255999
+ let controller = null;
256000
+ const start2 = Date.now();
256001
+ const done = () => {
256002
+ clearInterval(check);
256003
+ buf = null;
256004
+ release4();
256005
+ };
256006
+ const check = setInterval(() => {
256007
+ const late = Date.now() - start2 - floorMs;
256008
+ if (late <= 0 || at2 >= late / 1e3 * RELEASING_BODY_MIN_BYTES_PER_SEC) return;
256009
+ try {
256010
+ controller?.error(new Error("body read too slowly"));
256011
+ } catch {
256012
+ }
256013
+ done();
256014
+ }, Math.min(1e3, floorMs));
256015
+ check.unref?.();
256016
+ return new ReadableStream({
256017
+ start(c2) {
256018
+ controller = c2;
256019
+ },
256020
+ pull(c2) {
256021
+ if (!buf) return;
256022
+ c2.enqueue(new Uint8Array(buf.subarray(at2, at2 + CHUNK)));
256023
+ at2 += CHUNK;
256024
+ if (at2 >= buf.byteLength) {
256025
+ c2.close();
256026
+ done();
256027
+ }
256028
+ },
256029
+ cancel: done
256030
+ }, { highWaterMark: 0 });
256031
+ }
256032
+ var RELEASING_BODY_MIN_BYTES_PER_SEC, CHUNK;
256033
+ var init_releasing_body = __esm({
256034
+ "../../core/serve-runtime/src/releasing-body.ts"() {
256035
+ init_define_HHP_CATALOG();
256036
+ RELEASING_BODY_MIN_BYTES_PER_SEC = 50 * 1024;
256037
+ CHUNK = 256 * 1024;
255850
256038
  }
255851
256039
  });
255852
256040
 
@@ -256222,6 +256410,8 @@ function makeServeHandler(opts) {
256222
256410
  const webwixFetch = opts.webwixFetch ?? fetch;
256223
256411
  const webwixOwnerInstances = new OwnerInstanceCache(webwixFetch);
256224
256412
  const visitorMintLimiter = new FixedWindowRateLimiter({ max: opts.visitorMintRatePerMin ?? 30, windowMs: 6e4 });
256413
+ const largeAssetReads = new QueuedConcurrencyLimiter(LARGE_ASSET_STORE_READS_PER_POD, LARGE_ASSET_STORE_READS_QUEUED);
256414
+ const largeAssetCallerReads = new KeyedQueuedConcurrencyLimiter(LARGE_ASSET_STORE_READS_PER_CALLER, LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER);
256225
256415
  const forwardVisitors = /* @__PURE__ */ new Map();
256226
256416
  const FORWARD_VISITOR_CAP = opts.forwardVisitorCap ?? 512;
256227
256417
  const webwixOwnerSites = new OwnerSitesCache(webwixFetch);
@@ -256434,7 +256624,7 @@ ${releaseId}`;
256434
256624
  const bare = new URL(request2.url);
256435
256625
  bare.searchParams.delete("release");
256436
256626
  bare.searchParams.delete("releaseSource");
256437
- return { request: new Request(bare.toString(), { method: request2.method, headers: headers2 }), dropped: true };
256627
+ return { request: new Request(bare.toString(), { method: request2.method, headers: headers2, signal: original.signal }), dropped: true };
256438
256628
  };
256439
256629
  if (/^\/v1\/app-config\/[^/]+$/.test(url.pathname)) return drop2();
256440
256630
  let servable;
@@ -256469,7 +256659,7 @@ ${releaseId}`;
256469
256659
  const headers2 = new Headers(request2.headers);
256470
256660
  headers2.set("x-himalaya-release", release4);
256471
256661
  headers2.set(RELEASE_SOURCE_HEADER, "ring");
256472
- return new Request(url.toString(), { method: request2.method, headers: headers2 });
256662
+ return new Request(url.toString(), { method: request2.method, headers: headers2, signal: request2.signal });
256473
256663
  }
256474
256664
  const corsHeaders = (request2) => {
256475
256665
  const origin = request2.headers.get("origin");
@@ -257298,7 +257488,8 @@ ${releaseId}`;
257298
257488
  const record5 = Object.values(m2?.assets ?? {}).find((a3) => a3.sha256 === sha5);
257299
257489
  if (!record5) return json6(404, { error: "asset_not_found", app: app2 });
257300
257490
  const etag = strongEtagForSha256(sha5);
257301
- const location = record5.storage === "large" ? opts.largeAssetUrl?.(sha5, { contentType: record5.contentType || "application/octet-stream" }) : void 0;
257491
+ let location = record5.storage === "large" ? opts.largeAssetUrl?.(sha5, { contentType: record5.contentType || "application/octet-stream" }) ?? void 0 : void 0;
257492
+ if (location && store.largeAssetUploadMaxBytes && store.hasAsset && await store.hasAsset(app2, sha5).catch(() => false)) location = void 0;
257302
257493
  if (!location && request2.headers.get("if-none-match") === etag) {
257303
257494
  return new Response(null, { status: 304, headers: { etag, "cache-control": BUNDLE_CACHE_CONTROL } });
257304
257495
  }
@@ -257327,11 +257518,47 @@ ${releaseId}`;
257327
257518
  }
257328
257519
  });
257329
257520
  }
257330
- const bytes2 = await store.getAsset(app2, sha5);
257331
- if (!bytes2) return json6(404, { error: "asset_not_found", app: app2 });
257332
- return new Response(bytes2, {
257521
+ const busy2 = () => new Response(JSON.stringify({ error: "large_asset_busy", code: "large_asset_busy", retryAfterSec: 2 }), {
257522
+ status: 503,
257523
+ headers: { "content-type": "application/json", "retry-after": "2", "cache-control": "no-store" }
257524
+ });
257525
+ let release4 = () => {
257526
+ };
257527
+ if (record5.storage === "large") {
257528
+ const caller = request2.headers.has("x-forwarded-for") ? visitorMintCaller(request2) : null;
257529
+ const callerSlot = caller ? await largeAssetCallerReads.acquire(caller, request2.signal) : () => {
257530
+ };
257531
+ if (!callerSlot) return request2.signal.aborted ? new Response(null, { status: 499 }) : busy2();
257532
+ const podSlot = await largeAssetReads.acquire(request2.signal);
257533
+ if (!podSlot) {
257534
+ callerSlot();
257535
+ return request2.signal.aborted ? new Response(null, { status: 499 }) : busy2();
257536
+ }
257537
+ release4 = () => {
257538
+ podSlot();
257539
+ callerSlot();
257540
+ };
257541
+ if (request2.signal.aborted) {
257542
+ release4();
257543
+ return new Response(null, { status: 499 });
257544
+ }
257545
+ }
257546
+ let bytes2;
257547
+ try {
257548
+ bytes2 = await store.getAsset(app2, sha5, record5.storage === "large" ? store.largeAssetUploadMaxBytes : INLINE_ASSET_MAX_BYTES);
257549
+ } catch (e2) {
257550
+ release4();
257551
+ throw e2;
257552
+ }
257553
+ if (!bytes2) {
257554
+ release4();
257555
+ return json6(404, { error: "asset_not_found", app: app2 });
257556
+ }
257557
+ const body = record5.storage === "large" ? releasingBody(bytes2, release4, opts.largeAssetBodyFloorMs ?? LARGE_ASSET_BODY_FLOOR_MS) : bytes2;
257558
+ return new Response(body, {
257333
257559
  status: 200,
257334
257560
  headers: {
257561
+ ...record5.storage === "large" ? { "content-length": String(bytes2.byteLength) } : {},
257335
257562
  "content-type": record5.contentType || "application/octet-stream",
257336
257563
  etag,
257337
257564
  "cache-control": BUNDLE_CACHE_CONTROL,
@@ -257462,7 +257689,7 @@ ${releaseId}`;
257462
257689
  return withCors(request2, response);
257463
257690
  };
257464
257691
  }
257465
- var JSON_CT3, VISITOR_INSTANCE_PATH;
257692
+ var LARGE_ASSET_STORE_READS_PER_POD, LARGE_ASSET_STORE_READS_QUEUED, LARGE_ASSET_STORE_READS_PER_CALLER, LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER, LARGE_ASSET_BODY_FLOOR_MS, JSON_CT3, VISITOR_INSTANCE_PATH;
257466
257693
  var init_server3 = __esm({
257467
257694
  "../../core/serve/src/server.ts"() {
257468
257695
  init_define_HHP_CATALOG();
@@ -257475,9 +257702,15 @@ var init_server3 = __esm({
257475
257702
  init_member_forward();
257476
257703
  init_package_share();
257477
257704
  init_rate_limit();
257705
+ init_releasing_body();
257478
257706
  init_wix_bridge();
257479
257707
  init_account_rung();
257480
257708
  init_wix_member_auth();
257709
+ LARGE_ASSET_STORE_READS_PER_POD = 4;
257710
+ LARGE_ASSET_STORE_READS_QUEUED = 256;
257711
+ LARGE_ASSET_STORE_READS_PER_CALLER = 2;
257712
+ LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER = 16;
257713
+ LARGE_ASSET_BODY_FLOOR_MS = 1e4;
257481
257714
  JSON_CT3 = "application/json; charset=utf-8";
257482
257715
  VISITOR_INSTANCE_PATH = "/v1/visitor/instance";
257483
257716
  }
@@ -257822,12 +258055,32 @@ async function toRequest(req, signal) {
257822
258055
  }
257823
258056
  return new Request(url, { method, headers: headers2, body, signal });
257824
258057
  }
258058
+ function drained(res) {
258059
+ return new Promise((resolve135) => {
258060
+ const done = () => {
258061
+ res.off("drain", done);
258062
+ res.off("close", done);
258063
+ resolve135();
258064
+ };
258065
+ res.on("drain", done);
258066
+ res.on("close", done);
258067
+ });
258068
+ }
257825
258069
  async function writeResponse(res, response) {
257826
258070
  res.statusCode = response.status;
257827
258071
  response.headers.forEach((value2, key4) => res.setHeader(key4, value2));
257828
- if (response.body && /^text\/event-stream\b/i.test(response.headers.get("content-type") ?? "")) {
258072
+ const streamed = !!response.body && (/^text\/event-stream\b/i.test(response.headers.get("content-type") ?? "") || Number(response.headers.get("content-length") ?? 0) > STREAM_OVER_BYTES);
258073
+ if (response.body && streamed) {
257829
258074
  res.flushHeaders();
257830
258075
  const reader = response.body.getReader();
258076
+ let bodyFailed = false;
258077
+ let wake = null;
258078
+ void reader.closed.then(() => {
258079
+ }, () => {
258080
+ bodyFailed = true;
258081
+ }).then(() => {
258082
+ wake?.();
258083
+ });
257831
258084
  let clientDisconnected = false;
257832
258085
  const onClose = () => {
257833
258086
  if (!res.writableEnded) {
@@ -257841,7 +258094,14 @@ async function writeResponse(res, response) {
257841
258094
  for (; ; ) {
257842
258095
  const { done, value: value2 } = await reader.read();
257843
258096
  if (done) break;
257844
- res.write(value2);
258097
+ if (!res.write(value2) && !res.destroyed) {
258098
+ if (!bodyFailed) await new Promise((resolve135) => {
258099
+ wake = resolve135;
258100
+ void drained(res).then(resolve135);
258101
+ });
258102
+ wake = null;
258103
+ if (bodyFailed) throw new Error("body ended while the client was not reading");
258104
+ }
257845
258105
  }
257846
258106
  } catch {
257847
258107
  if (!clientDisconnected && !res.destroyed) res.destroy();
@@ -257878,11 +258138,12 @@ function nodeAdapter(handler) {
257878
258138
  }
257879
258139
  });
257880
258140
  }
257881
- var BODYLESS;
258141
+ var BODYLESS, STREAM_OVER_BYTES;
257882
258142
  var init_node_adapter = __esm({
257883
258143
  "../../core/serve-runtime/src/node-adapter.ts"() {
257884
258144
  init_define_HHP_CATALOG();
257885
258145
  BODYLESS = /* @__PURE__ */ new Set(["GET", "HEAD", "DELETE", "OPTIONS"]);
258146
+ STREAM_OVER_BYTES = 1024 * 1024;
257886
258147
  }
257887
258148
  });
257888
258149
 
@@ -257919,7 +258180,7 @@ var init_wix_client_id = __esm({
257919
258180
  });
257920
258181
 
257921
258182
  // src/run-godot-web.ts
257922
- import { existsSync as existsSync129, readFileSync as readFileSync151, statSync as statSync47 } from "node:fs";
258183
+ import { existsSync as existsSync129, readFileSync as readFileSync151, statSync as statSync48 } from "node:fs";
257923
258184
  import { dirname as dirname73, join as join164, resolve as resolve106 } from "node:path";
257924
258185
  import { fileURLToPath as fileURLToPath38 } from "node:url";
257925
258186
  function localGodotWebDir(env = process.env) {
@@ -257957,7 +258218,7 @@ function makeGodotWebRoute(opts = {}) {
257957
258218
  const name = url.pathname.slice(LOCAL2.length);
257958
258219
  if (!/^[A-Za-z0-9._-]+$/.test(name) || name.startsWith(".")) return new Response("bad name", { status: 400 });
257959
258220
  const file2 = join164(localDir, name);
257960
- if (!existsSync129(file2) || !statSync47(file2).isFile()) return new Response("not found", { status: 404 });
258221
+ if (!existsSync129(file2) || !statSync48(file2).isFile()) return new Response("not found", { status: 404 });
257961
258222
  const ext = name.slice(name.lastIndexOf(".") + 1);
257962
258223
  const body = request2.method === "HEAD" ? null : readFileSync151(file2);
257963
258224
  return new Response(body, {
@@ -257998,53 +258259,53 @@ var init_preview_assets_generated = __esm({
257998
258259
  init_define_HHP_CATALOG();
257999
258260
  init_preview_assets_format();
258000
258261
  PREVIEW_ASSET_MANIFEST = [
258001
- { key: "assets/DashboardHost-C2sRZ5A-.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2985, sha256: "a0ae2a5382120c081eb51cee9d7664140eafb54a96a3415273a408c2e78295a0" },
258002
- { key: "assets/DevDrawer-CTtUnjva.js", contentType: "application/javascript; charset=utf-8", offset: 2993, length: 16783, sha256: "6beaa3d21144526efe3a84edad1b776c331917ea9a218cf371f305a5f76232a4" },
258003
- { key: "assets/IdiomCompare-BqTaxjwT.js", contentType: "application/javascript; charset=utf-8", offset: 19776, length: 1926, sha256: "7d688a0dcc011e235e17a6677e23f65aced177c6bd859efeb1d185be3b081e78" },
258004
- { key: "assets/LightboxViewer-1Eu5cUAp.js", contentType: "application/javascript; charset=utf-8", offset: 21702, length: 15836, sha256: "202f4db841872318f48760dc1bffb4192b8fa78f8cccd7d31c2563d49dbba81b" },
258005
- { key: "assets/OfflineReadingBar-BBifjQUW.js", contentType: "application/javascript; charset=utf-8", offset: 37538, length: 1695, sha256: "64f079274691dd71f90a8597bbaef00442afaf4c0e4e6540b3b13286d44dc41c" },
258006
- { key: "assets/PhonePreviewControl-jWOREIyb.js", contentType: "application/javascript; charset=utf-8", offset: 39233, length: 37851, sha256: "11faf320b38decd35283e132b69c44af8fb9fbb40620dabb49fb64422cea61b8" },
258007
- { key: "assets/SchemeCompare-Clur0DSZ.js", contentType: "application/javascript; charset=utf-8", offset: 77084, length: 1858, sha256: "01d66582343bb6a26a40adc8dabe1046fc8585581242f26b5da71b00248c18b0" },
258008
- { key: "assets/TopBarSearchStates-DR-nppz-.js", contentType: "application/javascript; charset=utf-8", offset: 78942, length: 4068, sha256: "e6240d4c2647378f5e2af3ccc7bbc638331cec0a51d48df25807a8c47eebb088" },
258009
- { key: "assets/WixFrogTelemetrySink-D4QaB4GR.js", contentType: "application/javascript; charset=utf-8", offset: 83010, length: 3515, sha256: "b3e84b6f688c8671a2926bae6cb008aac5ff96449cf35e98190d56154299b385" },
258262
+ { key: "assets/DashboardHost-Cnvx56Ob.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2985, sha256: "563e40974d690491860a85d088f2e8e324a64484838de0d8060e7c882d02e13b" },
258263
+ { key: "assets/DevDrawer-BPubZQvE.js", contentType: "application/javascript; charset=utf-8", offset: 2993, length: 16783, sha256: "e66ad823b9343f2c30d2eea6ccd6256b25dda239de2be8b3502f5b73a49a3798" },
258264
+ { key: "assets/IdiomCompare-C0mset0g.js", contentType: "application/javascript; charset=utf-8", offset: 19776, length: 1926, sha256: "725c64e538ac5996c849231e6d5bd99e8f397ed88d4346b439b8a77660eee6b9" },
258265
+ { key: "assets/LightboxViewer-rbfhptpA.js", contentType: "application/javascript; charset=utf-8", offset: 21702, length: 15836, sha256: "6154a530b75f8f8a013d6096a3534ae47e3273813b1e7c5ebd6a7941e38e2013" },
258266
+ { key: "assets/OfflineReadingBar-By8jHXuu.js", contentType: "application/javascript; charset=utf-8", offset: 37538, length: 1695, sha256: "186a22abc375d2865c522e016bf5b64cbf94aeda8be04145d2e6140e802c5530" },
258267
+ { key: "assets/PhonePreviewControl-BDLASTBR.js", contentType: "application/javascript; charset=utf-8", offset: 39233, length: 37851, sha256: "94c950be384153dc7862adf52490a563cf31f31b9a2ed6143d153e6064248d99" },
258268
+ { key: "assets/SchemeCompare-CwgNCeEK.js", contentType: "application/javascript; charset=utf-8", offset: 77084, length: 1858, sha256: "8c2f4892179e94088513a7e43b97cd107ddec684f6443745f68d454bdfd4f475" },
258269
+ { key: "assets/TopBarSearchStates-56aokOJi.js", contentType: "application/javascript; charset=utf-8", offset: 78942, length: 4068, sha256: "912b77d9f8c930d3b749628119d663c37c5f0d28e9dcedf62d7f64a8995edbbf" },
258270
+ { key: "assets/WixFrogTelemetrySink-DgPMgFzz.js", contentType: "application/javascript; charset=utf-8", offset: 83010, length: 3515, sha256: "99dd0cadecc7a269fdaf8adf53432a606d775a35a6648bd0a658331fe77fa406" },
258010
258271
  { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 86525, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
258011
258272
  { key: "assets/catalog-B4UJpy5D.js", contentType: "application/javascript; charset=utf-8", offset: 88717, length: 35626, sha256: "90111ffcf2d13eff399836acafd1f2b387859440a29dcd4a0afd8370915992cb" },
258012
- { key: "assets/catalogFontFaces-C2ByuSZO.js", contentType: "application/javascript; charset=utf-8", offset: 124343, length: 1111, sha256: "f91a9d75a40a3ebab7d5e4d67239c92e973ed9da550d4fbc47dc34828cad6cb3" },
258273
+ { key: "assets/catalogFontFaces-c_Aan0WX.js", contentType: "application/javascript; charset=utf-8", offset: 124343, length: 1111, sha256: "3052881c68bd649598be743c9f9dca79991aaeffec117e88b4626c1b0e4f9b2a" },
258013
258274
  { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 125454, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
258014
- { key: "assets/files-transfer-BHpHKH1c.js", contentType: "application/javascript; charset=utf-8", offset: 128021, length: 6446, sha256: "4eb649388d03e955200ece8d4a53d29708e9b8c53e103dd65193b514b20b9577" },
258275
+ { key: "assets/files-transfer-DH_Te1lQ.js", contentType: "application/javascript; charset=utf-8", offset: 128021, length: 6446, sha256: "3ce0a2eacefe78a1858f079cb1676c2f8292b4b30a277c7e78909bc133dc8d7e" },
258015
258276
  { key: "assets/frogActionMap-CTMe3Bz1.js", contentType: "application/javascript; charset=utf-8", offset: 134467, length: 1172, sha256: "9f1ce4c70a680dfb902949e1f482c7e47500b69c3350cd091b1b51d674032d53" },
258016
- { key: "assets/frogApiRules-HNImSWV_.js", contentType: "application/javascript; charset=utf-8", offset: 135639, length: 2207, sha256: "9889f84be1687b12ac98a944786cdab04e1648e10f9a823fd450b9a08f67d5be" },
258277
+ { key: "assets/frogApiRules-CuJA3rYb.js", contentType: "application/javascript; charset=utf-8", offset: 135639, length: 2207, sha256: "6903064af704ec5bec38415af85ac73f7a3d590c89588e319ad34667e13836ec" },
258017
258278
  { key: "assets/frogScreenMap-S_IRnz20.js", contentType: "application/javascript; charset=utf-8", offset: 137846, length: 1067, sha256: "22b2f71e1b06df8f1e79b890d47fe42e983d37865c2cc9be753e4121764c91e1" },
258018
258279
  { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 138913, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
258019
258280
  { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 145491, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
258020
- { key: "assets/index-C07MqSLZ.js", contentType: "application/javascript; charset=utf-8", offset: 148195, length: 1674580, sha256: "e794741a33b722a0108b688a5e86e8bcc22ec7d69a9e8cfafab5a417805523c1" },
258021
- { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1822775, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
258022
- { key: "assets/on-device-ml-D5QGvW8P.js", contentType: "application/javascript; charset=utf-8", offset: 1830526, length: 10531, sha256: "914ea54d973624e7bc82d1847444f26084ac16d69be3051b4b5938b1e35beced" },
258023
- { key: "assets/pdf-I3nRHc8p.js", contentType: "application/javascript; charset=utf-8", offset: 1841057, length: 488215, sha256: "fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9" },
258024
- { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2329272, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
258025
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2329362, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
258026
- { key: "assets/pdfDocument-CTbXvf8s.js", contentType: "application/javascript; charset=utf-8", offset: 3646396, length: 3471, sha256: "688d06558ac6fdce3a47ab5ca6340c6f7736c56da6d9b1f6794db522f1d0288a" },
258027
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3649867, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
258028
- { key: "assets/scrollLinkedRuntime-DV0KxNiC.js", contentType: "application/javascript; charset=utf-8", offset: 3652133, length: 2278, sha256: "f85cbf0089de9a2db785e680eb049a15cb7f1077f4064f996d685900e152f2cf" },
258029
- { key: "assets/webviewBridgeHost-DKmRCjDk.js", contentType: "application/javascript; charset=utf-8", offset: 3654411, length: 9889, sha256: "a89a01f153d69d37a73f81cd687b9c021c394621b84a64f1836f577ede89d817" },
258030
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3664300, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
258031
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3668910, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
258032
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4157494, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
258033
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4248418, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
258034
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4339402, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
258035
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4430382, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
258036
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4521254, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
258037
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4612234, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
258038
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4720870, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
258039
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4829954, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
258040
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4939002, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
258041
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 5046702, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
258042
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5134810, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
258043
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5141628, length: 4924, sha256: "6c358bc8ab14cafa05ee0b8092cb0b778e7d9be741a726c6a1554c3991720bfb" },
258044
- { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5146552, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
258045
- { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5158009, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
258046
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5159180, length: 24303, sha256: "7ee3dbacf4e6da69c1c7085a2423e33e2adaec933cd897fb2ee2391e3277c3ae" },
258047
- { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5183483, length: 24320, sha256: "d24f399a1fcfa7f696a0d96aadbc983d2624b45712dae9a15545f6914dbb9506" }
258281
+ { key: "assets/index-Bg3smJjV.js", contentType: "application/javascript; charset=utf-8", offset: 148195, length: 1674985, sha256: "b20fbf356ac3ed10c231df5ea69dd2f159b3b435888f00ca33c8a9535b5775a5" },
258282
+ { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1823180, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
258283
+ { key: "assets/on-device-ml-D5QGvW8P.js", contentType: "application/javascript; charset=utf-8", offset: 1830931, length: 10531, sha256: "914ea54d973624e7bc82d1847444f26084ac16d69be3051b4b5938b1e35beced" },
258284
+ { key: "assets/pdf-Dxze8Wox.js", contentType: "application/javascript; charset=utf-8", offset: 1841462, length: 488215, sha256: "c1f008be31a41521c6de7c1afad419a1f4dad53cbc2701a14738d5b22f291463" },
258285
+ { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2329677, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
258286
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2329767, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
258287
+ { key: "assets/pdfDocument-CwxGRkvL.js", contentType: "application/javascript; charset=utf-8", offset: 3646801, length: 3471, sha256: "7d56a9b20aa1a5bef30dfc900b50914e52bfcece73600b11dc73e479ed368c35" },
258288
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3650272, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
258289
+ { key: "assets/scrollLinkedRuntime-CcQ2n_a7.js", contentType: "application/javascript; charset=utf-8", offset: 3652538, length: 2278, sha256: "781ae1aafe443a355bfee10801a06a01495b8877b371bf689065e3610a36712e" },
258290
+ { key: "assets/webviewBridgeHost-BMLK1fpb.js", contentType: "application/javascript; charset=utf-8", offset: 3654816, length: 9889, sha256: "920f9bcf734ec2d42de4f7538f641b67b41f6f401e5ef6f5c2c6bbe9648a81aa" },
258291
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3664705, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
258292
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3669315, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
258293
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4157899, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
258294
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4248823, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
258295
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4339807, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
258296
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4430787, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
258297
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4521659, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
258298
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4612639, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
258299
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4721275, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
258300
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4830359, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
258301
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4939407, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
258302
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 5047107, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
258303
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5135215, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
258304
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5142033, length: 4924, sha256: "2ae7f884184c2dfc029f61ac217a82113bf46780cf2d6987198af04114cdcd9a" },
258305
+ { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5146957, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
258306
+ { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5158414, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
258307
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5159585, length: 24303, sha256: "7ee3dbacf4e6da69c1c7085a2423e33e2adaec933cd897fb2ee2391e3277c3ae" },
258308
+ { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5183888, length: 24320, sha256: "d24f399a1fcfa7f696a0d96aadbc983d2624b45712dae9a15545f6914dbb9506" }
258048
258309
  ];
258049
258310
  }
258050
258311
  });
@@ -258064,7 +258325,7 @@ __export(run_exports, {
258064
258325
  runPackage: () => runPackage,
258065
258326
  withoutProdServe: () => withoutProdServe
258066
258327
  });
258067
- import { cpSync as cpSync2, existsSync as existsSync130, lstatSync as lstatSync38, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync11, readdirSync as readdirSync60, readFileSync as readFileSync152, rmSync as rmSync38, statSync as statSync48 } from "node:fs";
258328
+ import { cpSync as cpSync2, existsSync as existsSync130, lstatSync as lstatSync38, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync11, readdirSync as readdirSync60, readFileSync as readFileSync152, rmSync as rmSync38, statSync as statSync49 } from "node:fs";
258068
258329
  import { networkInterfaces as osNetworkInterfaces, tmpdir as tmpdir12 } from "node:os";
258069
258330
  import { dirname as dirname74, join as join165 } from "node:path";
258070
258331
  import { fileURLToPath as fileURLToPath39 } from "node:url";
@@ -258110,7 +258371,7 @@ async function fetchBytes(url) {
258110
258371
  }
258111
258372
  async function resolvePackage(source2, workDir) {
258112
258373
  const isUrl2 = /^https?:\/\//i.test(source2);
258113
- if (!isUrl2 && existsSync130(source2) && statSync48(source2).isDirectory()) {
258374
+ if (!isUrl2 && existsSync130(source2) && statSync49(source2).isDirectory()) {
258114
258375
  const appDirManifest = join165(source2, "release-manifest.json");
258115
258376
  if (existsSync130(appDirManifest)) {
258116
258377
  const link4 = firstSymlink(source2);
@@ -263308,21 +263569,21 @@ async function attemptWrite(write3) {
263308
263569
  throw e2;
263309
263570
  }
263310
263571
  }
263311
- async function pollFor(find2, sleep4) {
263572
+ async function pollFor(find2, sleep5) {
263312
263573
  for (let read2 = 0; read2 < RECONCILE_READS; read2++) {
263313
- if (read2 > 0) await sleep4(RECONCILE_BASE_WAIT_MS * 2 ** (read2 - 1));
263574
+ if (read2 > 0) await sleep5(RECONCILE_BASE_WAIT_MS * 2 ** (read2 - 1));
263314
263575
  const found = await find2();
263315
263576
  if (found !== void 0) return found;
263316
263577
  }
263317
263578
  return void 0;
263318
263579
  }
263319
- async function ensure(spec, sleep4) {
263580
+ async function ensure(spec, sleep5) {
263320
263581
  let outcome = await attemptWrite(spec.write);
263321
263582
  for (let retry = 0; ; retry++) {
263322
263583
  if ("value" in outcome) return { value: outcome.value, state: "done" };
263323
263584
  let found;
263324
263585
  try {
263325
- found = await pollFor(spec.find, sleep4);
263586
+ found = await pollFor(spec.find, sleep5);
263326
263587
  } catch (error) {
263327
263588
  throw outcome.error instanceof IapCatalogWriteOutcomeUnknown ? outcome.error : error;
263328
263589
  }
@@ -263331,7 +263592,7 @@ async function ensure(spec, sleep4) {
263331
263592
  if (retry === 1 || outcome.error.kind === "conflict") {
263332
263593
  throw new UnresolvedWriteError(`could not confirm the outcome of the write (${outcome.error.message}); Apple was re-read and it is not there. Rerun apply later \u2014 it re-reads before writing, so nothing will be duplicated.`);
263333
263594
  }
263334
- if (outcome.error.retryAfterMs) await sleep4(outcome.error.retryAfterMs);
263595
+ if (outcome.error.retryAfterMs) await sleep5(outcome.error.retryAfterMs);
263335
263596
  outcome = await attemptWrite(spec.write);
263336
263597
  }
263337
263598
  }
@@ -263365,16 +263626,16 @@ async function reserveScreenshot(api4, resourceId, file2, overValid) {
263365
263626
  throw new UnresolvedWriteError(`could not confirm the review screenshot reservation (${e2.message}). Make a new plan \u2014 it replaces an unfinished reservation.`);
263366
263627
  }
263367
263628
  }
263368
- async function settledScreenshot(api4, resourceId, committed, sleep4) {
263629
+ async function settledScreenshot(api4, resourceId, committed, sleep5) {
263369
263630
  if (SETTLED_SCREENSHOT_STATES.has(committed.state)) return committed;
263370
263631
  const read2 = async () => {
263371
263632
  const current = await api4.readReviewScreenshot(resourceId);
263372
263633
  return current && SETTLED_SCREENSHOT_STATES.has(current.state) ? current : void 0;
263373
263634
  };
263374
- return await pollFor(read2, sleep4) ?? committed;
263635
+ return await pollFor(read2, sleep5) ?? committed;
263375
263636
  }
263376
263637
  async function uploadScreenshot(context, resourceId, file2) {
263377
- const { api: api4, sleep: sleep4 } = context;
263638
+ const { api: api4, sleep: sleep5 } = context;
263378
263639
  const current = await api4.readReviewScreenshot(resourceId);
263379
263640
  if (current && screenshotMatches(current, file2.checksum)) return { state: "reconciled", resourceId: current.id };
263380
263641
  const reservation = await reserveScreenshot(api4, resourceId, file2, current !== void 0 && !isScreenshotLeftover(current));
@@ -263383,45 +263644,45 @@ async function uploadScreenshot(context, resourceId, file2) {
263383
263644
  const screenshot = await api4.readReviewScreenshot(resourceId);
263384
263645
  return screenshot?.id === reservation.id && screenshot.checksum === file2.checksum ? screenshot : void 0;
263385
263646
  };
263386
- const { value: value2, state } = await ensure({ write: () => api4.commitReviewScreenshot(reservation.id, file2.checksum), find: committed }, sleep4);
263387
- const settled = await settledScreenshot(api4, resourceId, value2, sleep4);
263647
+ const { value: value2, state } = await ensure({ write: () => api4.commitReviewScreenshot(reservation.id, file2.checksum), find: committed }, sleep5);
263648
+ const settled = await settledScreenshot(api4, resourceId, value2, sleep5);
263388
263649
  if (settled.state === "FAILED") throw new UnresolvedWriteError(`Apple could not process the review screenshot: ${settled.errors.join("; ") || "no reason given"}`);
263389
263650
  return { state, resourceId: reservation.id };
263390
263651
  }
263391
263652
  async function deleteLeftoverScreenshot(context, resourceId) {
263392
- const { api: api4, sleep: sleep4 } = context;
263653
+ const { api: api4, sleep: sleep5 } = context;
263393
263654
  const stale = await api4.readReviewScreenshot(resourceId);
263394
263655
  if (!stale || !isScreenshotLeftover(stale)) return;
263395
263656
  const gone = async () => (await api4.readReviewScreenshot(resourceId))?.id !== stale.id ? true : void 0;
263396
- await ensure({ write: async () => (await api4.deleteReviewScreenshot(stale.id), true), find: gone }, sleep4);
263657
+ await ensure({ write: async () => (await api4.deleteReviewScreenshot(stale.id), true), find: gone }, sleep5);
263397
263658
  }
263398
263659
  async function upsertManagedLocalization(run4, locale, context) {
263399
263660
  const resourceId = required(run4.resourceId, "the product id");
263400
263661
  const text32 = textFor(run4.item, locale);
263401
- const { api: api4, sleep: sleep4 } = context;
263662
+ const { api: api4, sleep: sleep5 } = context;
263402
263663
  const find2 = async () => {
263403
263664
  const version5 = await findDraft(api4, resourceId);
263404
263665
  const localization2 = version5 && await findLocalization(api4, version5.id, locale, text32);
263405
263666
  return version5 && localization2 ? { version: version5, localization: localization2, outcome: "ALREADY_APPLIED" } : void 0;
263406
263667
  };
263407
- const { value: value2, state } = await ensure({ write: () => api4.managed.upsertLocalization(resourceId, text32), find: find2 }, sleep4);
263668
+ const { value: value2, state } = await ensure({ write: () => api4.managed.upsertLocalization(resourceId, text32), find: find2 }, sleep5);
263408
263669
  run4.versionId = value2.version.id;
263409
263670
  return { state: value2.outcome === "ALREADY_APPLIED" ? "reconciled" : state, resourceId: value2.localization.id };
263410
263671
  }
263411
263672
  function operationRunners(context, manifest2) {
263412
- const { api: api4, sleep: sleep4, pricing } = context;
263673
+ const { api: api4, sleep: sleep5, pricing } = context;
263413
263674
  const appId3 = manifest2.target.appleAppId;
263414
263675
  return {
263415
263676
  createProduct: async (run4) => {
263416
263677
  const { item: item2 } = run4;
263417
263678
  const newProduct = { productId: item2.productId, referenceName: item2.referenceName, type: item2.type, ...item2.reviewNote ? { reviewNote: item2.reviewNote } : {} };
263418
- const { value: value2, state } = await ensure({ write: () => api4.createProduct(appId3, newProduct), find: () => findProduct(api4, appId3, item2.productId) }, sleep4);
263679
+ const { value: value2, state } = await ensure({ write: () => api4.createProduct(appId3, newProduct), find: () => findProduct(api4, appId3, item2.productId) }, sleep5);
263419
263680
  run4.resourceId = value2.id;
263420
263681
  return { state, resourceId: value2.id };
263421
263682
  },
263422
263683
  createVersion: async (run4) => {
263423
263684
  const resourceId = required(run4.resourceId, "the product id");
263424
- const { value: value2, state } = await ensure({ write: () => api4.createVersion(resourceId), find: () => findDraft(api4, resourceId) }, sleep4);
263685
+ const { value: value2, state } = await ensure({ write: () => api4.createVersion(resourceId), find: () => findDraft(api4, resourceId) }, sleep5);
263425
263686
  run4.versionId = value2.id;
263426
263687
  run4.localizations = [];
263427
263688
  return { state, resourceId: value2.id };
@@ -263430,7 +263691,7 @@ function operationRunners(context, manifest2) {
263430
263691
  if (api4.managed) return upsertManagedLocalization(run4, op.locale, context);
263431
263692
  const versionId = required(run4.versionId, "the draft version");
263432
263693
  const text32 = textFor(run4.item, op.locale);
263433
- const { value: value2, state } = await ensure({ write: () => api4.createLocalization(versionId, text32), find: () => findLocalization(api4, versionId, text32.locale) }, sleep4);
263694
+ const { value: value2, state } = await ensure({ write: () => api4.createLocalization(versionId, text32), find: () => findLocalization(api4, versionId, text32.locale) }, sleep5);
263434
263695
  return { state, resourceId: value2.id };
263435
263696
  },
263436
263697
  updateLocalization: async (run4, op) => {
@@ -263438,7 +263699,7 @@ function operationRunners(context, manifest2) {
263438
263699
  const versionId = required(run4.versionId, "the draft version");
263439
263700
  const text32 = textFor(run4.item, op.locale);
263440
263701
  const localizationId = required(run4.localizations.find((l3) => l3.locale === text32.locale)?.id, `the ${text32.locale} localization`);
263441
- const { value: value2, state } = await ensure({ write: () => api4.updateLocalization(localizationId, text32), find: () => findLocalization(api4, versionId, text32.locale, text32) }, sleep4);
263702
+ const { value: value2, state } = await ensure({ write: () => api4.updateLocalization(localizationId, text32), find: () => findLocalization(api4, versionId, text32.locale, text32) }, sleep5);
263442
263703
  return { state, resourceId: value2.id };
263443
263704
  },
263444
263705
  setPrice: async (run4) => {
@@ -263447,7 +263708,7 @@ function operationRunners(context, manifest2) {
263447
263708
  const { point, failure: failure4 } = await pricing.resolve(resourceId, price);
263448
263709
  if (!point) throw new UnresolvedWriteError(failure4 ?? "no Apple price point");
263449
263710
  const matches2 = async () => priceMatches(await readObservedPrice(api4, resourceId), price, point.customerPrice) ? true : void 0;
263450
- const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep4);
263711
+ const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep5);
263451
263712
  return { state };
263452
263713
  },
263453
263714
  changePrice: async (run4, op) => {
@@ -263466,14 +263727,14 @@ function operationRunners(context, manifest2) {
263466
263727
  return void 0;
263467
263728
  };
263468
263729
  if (await matches2()) return { state: "reconciled" };
263469
- const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep4);
263730
+ const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep5);
263470
263731
  return { state };
263471
263732
  },
263472
263733
  setAvailability: async (run4) => {
263473
263734
  const resourceId = required(run4.resourceId, "the product id");
263474
263735
  const { territories } = run4.item;
263475
263736
  const matches2 = async () => availabilityMatches(await readObservedAvailability(api4, resourceId), territories) ? true : void 0;
263476
- const { state } = await ensure({ write: async () => (await api4.createAvailability(resourceId, territories), true), find: matches2 }, sleep4);
263737
+ const { state } = await ensure({ write: async () => (await api4.createAvailability(resourceId, territories), true), find: matches2 }, sleep5);
263477
263738
  return { state };
263478
263739
  },
263479
263740
  uploadReviewScreenshot: async (run4, op) => uploadScreenshot(context, required(run4.resourceId, "the product id"), plannedScreenshot(run4.item, op, context)),
@@ -266481,7 +266742,7 @@ __export(preflight_app_exports, {
266481
266742
  profileAccount: () => profileAccount,
266482
266743
  readXcconfigVars: () => readXcconfigVars
266483
266744
  });
266484
- import { readFileSync as readFileSync165, existsSync as existsSync139, readdirSync as readdirSync62, statSync as statSync49 } from "node:fs";
266745
+ import { readFileSync as readFileSync165, existsSync as existsSync139, readdirSync as readdirSync62, statSync as statSync50 } from "node:fs";
266485
266746
  import { createHash as createHash90 } from "node:crypto";
266486
266747
  import { dirname as dirname78, join as join178 } from "node:path";
266487
266748
  function analyze(projectYml, storeConfig, icon, account2, adopted) {
@@ -266817,7 +267078,7 @@ function playListingAssets(app2, locale = "en-US") {
266817
267078
  for (const name of names2) {
266818
267079
  const p2 = join178(dir, name);
266819
267080
  try {
266820
- if (statSync49(p2).isFile()) return { name, bytes: readFileSync165(p2) };
267081
+ if (statSync50(p2).isFile()) return { name, bytes: readFileSync165(p2) };
266821
267082
  } catch {
266822
267083
  }
266823
267084
  }
@@ -266865,7 +267126,7 @@ function listScreenshots(app2, locale = "en-US") {
266865
267126
  if (existsSync139(legacy)) {
266866
267127
  for (const deviceDir of readdirSync62(legacy)) {
266867
267128
  const d2 = join178(legacy, deviceDir);
266868
- if (!statSync49(d2).isDirectory()) continue;
267129
+ if (!statSync50(d2).isDirectory()) continue;
266869
267130
  for (const png of readdirSync62(d2).filter((n2) => n2.endsWith(".png"))) {
266870
267131
  const sz = pngSize3(readFileSync165(join178(d2, png)));
266871
267132
  if (sz) out2.push({ name: `${deviceDir}/${png}`, w: sz.w, h: sz.h });
@@ -266880,7 +267141,7 @@ function placeholderHashes2() {
266880
267141
  for (const target of readdirSync62(templateIos)) {
266881
267142
  const p2 = join178(templateIos, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
266882
267143
  try {
266883
- if (!statSync49(p2).isFile()) continue;
267144
+ if (!statSync50(p2).isFile()) continue;
266884
267145
  return [LEGACY_PLACEHOLDER_SHA2562, createHash90("sha256").update(readFileSync165(p2)).digest("hex")];
266885
267146
  } catch {
266886
267147
  }
@@ -266916,7 +267177,7 @@ async function appIconState(iosDir) {
266916
267177
  for (const target of readdirSync62(iosDir)) {
266917
267178
  const p2 = join178(iosDir, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
266918
267179
  try {
266919
- if (!statSync49(p2).isFile()) continue;
267180
+ if (!statSync50(p2).isFile()) continue;
266920
267181
  const bytes2 = readFileSync165(p2);
266921
267182
  const hash3 = createHash90("sha256").update(bytes2).digest("hex");
266922
267183
  const pixels = await pixelIssues(bytes2);
@@ -277405,7 +277666,7 @@ var init_invite_plan = __esm({
277405
277666
  });
277406
277667
 
277407
277668
  // src/one-app/header-badges-cli.ts
277408
- import { existsSync as existsSync154, lstatSync as lstatSync42, readFileSync as readFileSync183, rmSync as rmSync47, statSync as statSync52, writeFileSync as writeFileSync76 } from "node:fs";
277669
+ import { existsSync as existsSync154, lstatSync as lstatSync42, readFileSync as readFileSync183, rmSync as rmSync47, statSync as statSync53, writeFileSync as writeFileSync76 } from "node:fs";
277409
277670
  import { join as join197, resolve as resolve126 } from "node:path";
277410
277671
  function guestSignInParams(contentDir2) {
277411
277672
  const profile = screenLoadParams(contentDir2, PROFILE_AVATAR_ITEM.onTap.params.screenId) ?? {};
@@ -277509,7 +277770,7 @@ async function runOneAppHeaderBadges(args, io2) {
277509
277770
  let configLinked = false;
277510
277771
  try {
277511
277772
  configLinked = lstatSync42(configPath).isSymbolicLink();
277512
- if (!configLinked && statSync52(configPath).isFile()) configText = readFileSync183(configPath, "utf8");
277773
+ if (!configLinked && statSync53(configPath).isFile()) configText = readFileSync183(configPath, "utf8");
277513
277774
  } catch {
277514
277775
  }
277515
277776
  const declaration2 = options2.notNewApp || !configText ? void 0 : declareNewApp(configText);
@@ -277534,7 +277795,7 @@ async function runOneAppHeaderBadges(args, io2) {
277534
277795
  let screens;
277535
277796
  try {
277536
277797
  if (configLinked) throw new Error("config.ts is a symlink: refusing to read or write through it.");
277537
- if (!statSync52(configPath).isFile()) throw new Error("config.ts is not a file.");
277798
+ if (!statSync53(configPath).isFile()) throw new Error("config.ts is not a file.");
277538
277799
  screens = contentScreens(options2.contentDir);
277539
277800
  } catch (error) {
277540
277801
  return report6(io2, false, { code: "config_uninspectable", error: error instanceof Error ? error.message : String(error), ...common2 });
@@ -277707,15 +277968,39 @@ function readParts(contentDir2, name, values, key4) {
277707
277968
  const node3 = file2[key4];
277708
277969
  const shapeOk = key4 === "node" ? !!node3 && typeof node3 === "object" && !Array.isArray(node3) : Array.isArray(node3) && node3.length > 0;
277709
277970
  if (!shapeOk) throw new RecipeError(`recipes/${name}.json has no "${key4}" ${key4 === "node" ? "object" : "array"}`);
277710
- const text32 = JSON.stringify(node3).replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g, (whole, key5) => Object.hasOwn(values, key5) ? JSON.stringify(values[key5]).slice(1, -1) : whole);
277971
+ const keyed = keyedCopy(contentDir2, file2._keys);
277972
+ const authored2 = keyed ? keyCopy(node3, keyed) : node3;
277973
+ const text32 = JSON.stringify(authored2).replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g, (whole, key5) => Object.hasOwn(values, key5) ? JSON.stringify(values[key5]).slice(1, -1) : whole);
277711
277974
  const left = [...new Set([...text32.matchAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g)].map((m2) => m2[1]))];
277712
277975
  if (left.length) throw new RecipeError(`recipes/${name}.json has placeholder(s) with no value: ${left.join(", ")}`);
277713
277976
  return JSON.parse(text32);
277714
277977
  }
277978
+ function keyedCopy(contentDir2, raw) {
277979
+ if (!raw || typeof raw !== "object" || Array.isArray(raw) || !migrationLanguages(contentDir2).length) return void 0;
277980
+ let declared;
277981
+ try {
277982
+ const catalog4 = JSON.parse(readFileSync184(join198(contentDir2, "l10n", "en.json"), "utf8"));
277983
+ declared = new Set(Object.values(catalog4.messages ?? {}).map((m2) => m2?.key).filter((k3) => typeof k3 === "string" && k3 !== ""));
277984
+ } catch {
277985
+ return void 0;
277986
+ }
277987
+ const applies = new Map(Object.entries(raw).filter((e2) => typeof e2[1] === "string" && declared.has(e2[1])));
277988
+ return applies.size ? applies : void 0;
277989
+ }
277990
+ function keyCopy(value2, keys2) {
277991
+ if (typeof value2 === "string") {
277992
+ const key4 = keys2.get(value2);
277993
+ return key4 ? `$t:${key4}` : value2;
277994
+ }
277995
+ if (Array.isArray(value2)) return value2.map((item2) => keyCopy(item2, keys2));
277996
+ if (value2 && typeof value2 === "object") return Object.fromEntries(Object.entries(value2).map(([k3, v2]) => [k3, keyCopy(v2, keys2)]));
277997
+ return value2;
277998
+ }
277715
277999
  var RecipeError;
277716
278000
  var init_recipes = __esm({
277717
278001
  "src/one-app/recipes.ts"() {
277718
278002
  init_define_HHP_CATALOG();
278003
+ init_app_locale_edit();
277719
278004
  RecipeError = class extends Error {
277720
278005
  constructor(message5) {
277721
278006
  super(message5);
@@ -279158,7 +279443,8 @@ var init_generate2 = __esm({
279158
279443
  return plansSection(id, s5, index, ctx, { planIds: selectedPlanIds(st2), showBenefits: true, ...order ? { order } : {} });
279159
279444
  },
279160
279445
  // The site's first Pro Gallery galleries as cover cards (a rail, or full-width cards when the source turns its carousel off), as many as
279161
- // the source's `maxGalleries`. A card opens the template's gallery screen and View All its galleries screen: a scaffold without either
279446
+ // the source's `maxGalleries`. Like the source, which lists a member's non-hidden, non-empty galleries and shows a visitor (or a list it
279447
+ // cannot read) its empty state, the module reads for a signed-in member only. A card opens the template's gallery screen and View All its galleries screen: a scaffold without either
279162
279448
  // keeps the title and a link, as every data section does.
279163
279449
  progallery_carousel_section: (id, s5, st2, index, ctx, sectionId) => {
279164
279450
  const asked = typeof st2.maxGalleries === "number" && st2.maxGalleries >= 1 ? Math.floor(st2.maxGalleries) : void 0;
@@ -279380,14 +279666,14 @@ var init_generate2 = __esm({
279380
279666
  const goal = countOf2(obj15(display.defaultWeeklyGoal).value);
279381
279667
  const showTotal = obj15(display.totalNumberOfSessions).show !== false;
279382
279668
  const mode = str16(obj15(st2.progressCalculation).calculationMode).trim();
279383
- ctx.gap(sectionId, type2, `the section counts the member's confirmed bookings that already took place (the rule of My Bookings' "This week"), not the source's tracker service; a weekly goal of ${goal ?? "2"} is used for everyone (the source lets a member set their own), and a See All button opens My Bookings`);
279669
+ ctx.gap(sectionId, type2, `the section counts the member's confirmed bookings that already took place (the rule of My Bookings' "This week"), not the source's tracker service; a weekly goal of ${goal ?? "2"} is the default, a member picks their own from 1 to 14 as in the source but it stays on that member's device (the source keeps it in a private service a member's session cannot call, so it is not shared with the source app or the member's other devices); weeks run Monday to Sunday (the rule of My Bookings), where the source starts the week on the language's first day; the "N of G sessions this week" lines and a See All button to My Bookings are additions the source's card does not show`);
279384
279670
  ctx.gap(sectionId, type2, mode === "all" ? "the source counts every scheduled session in the week, including those still to come; the section counts only those that took place" : "the source counts only sessions marked attended; a visitor cannot read attendance, so the section counts every confirmed session that took place");
279385
279671
  if (obj15(st2.dailyActivity).enabled === true) ctx.gap(sectionId, type2, "the source shows the member's daily activity from Apple Health; the section has no health data");
279386
279672
  const svc = ctx.uses("performanceTracker", `performanceTracker${index}`, { ...goal !== void 0 ? { goal } : {}, showTotal });
279387
279673
  const children2 = [];
279388
- const title = str16(s5.title).trim();
279389
- if (s5.showTitle === true && title) children2.push(text29(`${id}.title`, title, "title3", {}, inset(0, 0, 0)));
279390
- let card2 = ctx.recipe("performance-tracker", { svc, id, signInScreen: "himi_sign_in", seeAllLabel: "See All", seeAllScreen: "himi_bookings" });
279674
+ const title = s5.showTitle === true ? str16(s5.title).trim() : "";
279675
+ let card2 = ctx.recipe("performance-tracker", { svc, id, title, signInScreen: "himi_sign_in", seeAllLabel: "See All", seeAllScreen: "himi_bookings" });
279676
+ if (!title) card2 = withoutNode(card2, `${id}.title`);
279391
279677
  if (!ctx.hasScreen("himi_sign_in")) card2 = withoutNode(card2, `${id}.signin.button`);
279392
279678
  children2.push(card2, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
279393
279679
  return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
@@ -283265,7 +283551,7 @@ var init_customer_build = __esm({
283265
283551
  });
283266
283552
 
283267
283553
  // src/site-analyze/apply.ts
283268
- import { existsSync as existsSync160, readFileSync as readFileSync191, writeFileSync as writeFileSync80, copyFileSync as copyFileSync3, mkdirSync as mkdirSync69, realpathSync as realpathSync25, statSync as statSync53 } from "node:fs";
283554
+ import { existsSync as existsSync160, readFileSync as readFileSync191, writeFileSync as writeFileSync80, copyFileSync as copyFileSync3, mkdirSync as mkdirSync69, realpathSync as realpathSync25, statSync as statSync54 } from "node:fs";
283269
283555
  import { dirname as dirname90, isAbsolute as isAbsolute21, join as join205, resolve as resolve130, sep as sep35 } from "node:path";
283270
283556
  import { spawnSync as spawnSync13 } from "node:child_process";
283271
283557
  function inRepoBakeRefusal(repoRoot2, shell) {
@@ -283618,7 +283904,7 @@ function buildMergedContract(options2) {
283618
283904
  }
283619
283905
  if (!real.startsWith(realRoot + sep35)) return void 0;
283620
283906
  try {
283621
- if (!statSync53(real).isFile()) return void 0;
283907
+ if (!statSync54(real).isFile()) return void 0;
283622
283908
  mkdirSync69(dirname90(to2), { recursive: true });
283623
283909
  copyFileSync3(real, to2);
283624
283910
  } catch {
@@ -287183,7 +287469,7 @@ function nativeCapture(devices, opts) {
287183
287469
  };
287184
287470
  const gone = /* @__PURE__ */ new Set();
287185
287471
  const read2 = opts.readFile ?? ((p2) => readFileSync195(p2));
287186
- const sleep4 = opts.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
287472
+ const sleep5 = opts.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
287187
287473
  const settleMs = opts.settleMs ?? 1e3;
287188
287474
  const maxWaitMs = opts.maxWaitMs ?? 3e4;
287189
287475
  const iosBundle = opts.iosBundleId ?? "dev.himalaya.player.dev";
@@ -287317,7 +287603,7 @@ function nativeCapture(devices, opts) {
287317
287603
  } else why = "the screen did not stop changing";
287318
287604
  if (waited >= maxWaitMs) return { frame, unsettled: `${why} within ${Math.round(maxWaitMs / 1e3)}s` };
287319
287605
  previous = frame;
287320
- await sleep4(settleMs);
287606
+ await sleep5(settleMs);
287321
287607
  }
287322
287608
  }
287323
287609
  async function open6(platform, id, link4) {
@@ -292210,7 +292496,7 @@ async function iconsCommand(ctx) {
292210
292496
  // src/commands/pull.ts
292211
292497
  init_define_HHP_CATALOG();
292212
292498
  init_cli_shared();
292213
- import { existsSync as existsSync124, readdirSync as readdirSync57, statSync as statSync44 } from "node:fs";
292499
+ import { existsSync as existsSync124, readdirSync as readdirSync57, statSync as statSync45 } from "node:fs";
292214
292500
  import { join as join159, resolve as resolve101 } from "node:path";
292215
292501
  async function pullCommand(ctx) {
292216
292502
  const { io: io2, pos, flags, print, client: client4 } = ctx;
@@ -292234,7 +292520,7 @@ async function pullCommand(ctx) {
292234
292520
  return 1;
292235
292521
  }
292236
292522
  if (existsSync124(dest)) {
292237
- if (!statSync44(dest).isDirectory()) {
292523
+ if (!statSync45(dest).isDirectory()) {
292238
292524
  io2.error(JSON.stringify({
292239
292525
  error: `${dest} exists and is not a directory`,
292240
292526
  hint: "pass --out/--name to land somewhere else, or remove the file"
@@ -293392,13 +293678,13 @@ async function packCommand(ctx) {
293392
293678
  // src/commands/import.ts
293393
293679
  init_define_HHP_CATALOG();
293394
293680
  init_cli_shared();
293395
- import { existsSync as existsSync127, readdirSync as readdirSync58, statSync as statSync46 } from "node:fs";
293681
+ import { existsSync as existsSync127, readdirSync as readdirSync58, statSync as statSync47 } from "node:fs";
293396
293682
  import { resolve as resolve104 } from "node:path";
293397
293683
  function restoreDestinationIssue(dest, force) {
293398
293684
  const link4 = symlinkDestinationIssue(dest);
293399
293685
  if (link4) return link4;
293400
293686
  if (!existsSync127(dest)) return null;
293401
- if (!statSync46(dest).isDirectory()) {
293687
+ if (!statSync47(dest).isDirectory()) {
293402
293688
  return { error: `${dest} exists and is not a directory`, hint: "pass --out/--name to land somewhere else, or remove the file" };
293403
293689
  }
293404
293690
  if (readdirSync58(dest).length > 0 && !force) {
@@ -297036,7 +297322,7 @@ async function upgradeCommand(ctx) {
297036
297322
  // src/commands/doctor.ts
297037
297323
  init_define_HHP_CATALOG();
297038
297324
  init_config();
297039
- import { statSync as statSync50, accessSync as accessSync5, constants as constants11 } from "node:fs";
297325
+ import { statSync as statSync51, accessSync as accessSync5, constants as constants11 } from "node:fs";
297040
297326
  import { join as join180 } from "node:path";
297041
297327
  init_wix_owner();
297042
297328
  init_owner_claim();
@@ -297108,7 +297394,7 @@ function executableOnPath(name, env = process.env) {
297108
297394
  for (const suffix of suffixes) {
297109
297395
  const candidate = join180(dir, `${name}${suffix}`);
297110
297396
  try {
297111
- if (!statSync50(candidate).isFile()) continue;
297397
+ if (!statSync51(candidate).isFile()) continue;
297112
297398
  if (process.platform !== "win32") accessSync5(candidate, constants11.X_OK);
297113
297399
  return true;
297114
297400
  } catch {
@@ -298624,7 +298910,7 @@ import {
298624
298910
  realpathSync as realpathSync23,
298625
298911
  renameSync as renameSync26,
298626
298912
  rmSync as rmSync43,
298627
- statSync as statSync51,
298913
+ statSync as statSync52,
298628
298914
  writeFileSync as writeFileSync68
298629
298915
  } from "node:fs";
298630
298916
  import { basename as basename41, dirname as dirname84, join as join187, relative as relative37, resolve as resolve121 } from "node:path";
@@ -298710,7 +298996,7 @@ async function l10nCommand(ctx) {
298710
298996
  return fail16("invalid_usage", { error: "name the app: --app <slug> (in a checkout) or --content <app dir>" }, 2);
298711
298997
  }
298712
298998
  const messagesDir = resolve121(dirArg);
298713
- if (!existsSync145(messagesDir) || !statSync51(messagesDir).isDirectory()) {
298999
+ if (!existsSync145(messagesDir) || !statSync52(messagesDir).isDirectory()) {
298714
299000
  return fail16("messages_dir_not_found", { error: `${dirArg} is not a directory`, dir: messagesDir }, 1);
298715
299001
  }
298716
299002
  const fileByTag = /* @__PURE__ */ new Map();