@shopify/cli 3.72.1 → 3.73.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 (149) hide show
  1. package/dist/assets/hydrogen/starter/CHANGELOG.md +814 -0
  2. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +1 -1
  3. package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +3 -4
  4. package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +113 -44
  5. package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +8 -3
  6. package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +6 -5
  7. package/dist/assets/hydrogen/starter/app/lib/variants.ts +3 -3
  8. package/dist/assets/hydrogen/starter/app/routes/account_.logout.tsx +1 -1
  9. package/dist/assets/hydrogen/starter/app/routes/cart.tsx +9 -16
  10. package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +1 -10
  11. package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +1 -10
  12. package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +50 -119
  13. package/dist/assets/hydrogen/starter/app/routes/search.tsx +42 -38
  14. package/dist/assets/hydrogen/starter/app/styles/app.css +25 -1
  15. package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +23 -20
  16. package/dist/assets/hydrogen/starter/guides/search/search.md +27 -25
  17. package/dist/assets/hydrogen/starter/package.json +3 -3
  18. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +177 -194
  19. package/dist/assets/hydrogen/tailwind/tailwind.css +1 -1
  20. package/dist/{chokidar-OESTCX4H.js → chokidar-5LLC6S6D.js} +47 -90
  21. package/dist/{chunk-VSLR7ET4.js → chunk-25IMI7TH.js} +8 -46
  22. package/dist/{chunk-NCKQIOV4.js → chunk-3HBRMIPY.js} +28 -50
  23. package/dist/{chunk-4DZKSJ2R.js → chunk-3OXCI3HX.js} +1402 -1989
  24. package/dist/{chunk-NX2KGZ2W.js → chunk-5OFJTURZ.js} +4 -4
  25. package/dist/{chunk-YITJ52BH.js → chunk-65GSOZHL.js} +7 -7
  26. package/dist/{chunk-5BCHJBAS.js → chunk-66HLUVKV.js} +4 -4
  27. package/dist/{chunk-J6WHIPSP.js → chunk-6PEBJVBW.js} +3 -3
  28. package/dist/{chunk-XVNW332R.js → chunk-75LV6AQS.js} +6 -10
  29. package/dist/{chunk-4ERNAW5E.js → chunk-7RKRCUFA.js} +16518 -24140
  30. package/dist/{chunk-FGSRYMBN.js → chunk-AFPOP3K5.js} +67 -104
  31. package/dist/{chunk-2HGYYNE5.js → chunk-B5EXYCV3.js} +5 -9
  32. package/dist/{chunk-NB4NLOEJ.js → chunk-BUFIEXZ5.js} +11 -20
  33. package/dist/{chunk-EQQFJ434.js → chunk-CEIZT2W3.js} +4 -4
  34. package/dist/{chunk-522OB3EU.js → chunk-CFIKVUNW.js} +2 -2
  35. package/dist/{chunk-KYB6A4PE.js → chunk-CRHXI6PS.js} +13 -23
  36. package/dist/{chunk-QBE6MS4X.js → chunk-ELTOJBOJ.js} +4 -5
  37. package/dist/{chunk-NUP5TATA.js → chunk-EZQWZ57B.js} +2 -2
  38. package/dist/{chunk-HAURZWLZ.js → chunk-F7D333WQ.js} +3 -3
  39. package/dist/{chunk-UBB7JKND.js → chunk-G2ZZKGSV.js} +2 -2
  40. package/dist/{chunk-CBBS4CV7.js → chunk-G5R6YD27.js} +8 -13
  41. package/dist/{chunk-REXJJC44.js → chunk-GDLROW57.js} +3 -3
  42. package/dist/{chunk-TQTXTCOI.js → chunk-I25PGLBO.js} +3 -3
  43. package/dist/{chunk-OXKHBIW7.js → chunk-IG5SOACB.js} +29 -34
  44. package/dist/{chunk-2FXFMB2U.js → chunk-IRHYYIN7.js} +4 -4
  45. package/dist/{chunk-OWLPHMUA.js → chunk-J673ZU5S.js} +4 -4
  46. package/dist/{chunk-U2VX4Q6V.js → chunk-JORKLY7M.js} +68 -49
  47. package/dist/{chunk-K6Y4FYT5.js → chunk-K7HGDAI4.js} +17 -20
  48. package/dist/{chunk-MTXNEHKM.js → chunk-KF2D6QHZ.js} +39 -68
  49. package/dist/{chunk-QBDNLBUG.js → chunk-KMWARALD.js} +5 -5
  50. package/dist/{chunk-E7MQ72JO.js → chunk-KTNFE44J.js} +111 -84
  51. package/dist/{chunk-BYPQXSAL.js → chunk-KUM3DVPF.js} +17 -13
  52. package/dist/{chunk-B2HZKGLW.js → chunk-KZBL6BQ7.js} +4 -4
  53. package/dist/{chunk-WNDN5FAY.js → chunk-MHUINF7I.js} +3 -3
  54. package/dist/{chunk-YDFZISQ3.js → chunk-NFQLKURK.js} +41 -68
  55. package/dist/{chunk-7JVASAC6.js → chunk-O77L7CCL.js} +4 -4
  56. package/dist/{chunk-SNOECVP4.js → chunk-OAZFIMJ3.js} +2 -2
  57. package/dist/{chunk-OYHBLPKV.js → chunk-OE3IXTC5.js} +38 -60
  58. package/dist/{chunk-HLKMRAT5.js → chunk-ONOLOXLM.js} +5 -5
  59. package/dist/{chunk-POZ5MGPT.js → chunk-PKR7KJ6P.js} +2 -3
  60. package/dist/{chunk-YG5QRMVT.js → chunk-PRWEHR2C.js} +3 -3
  61. package/dist/{chunk-72RTT46Y.js → chunk-QNK2EAZ3.js} +5 -5
  62. package/dist/{chunk-3G3CTE4U.js → chunk-RCA7PFH4.js} +4 -4
  63. package/dist/{chunk-OG2XEFVO.js → chunk-RK7JAMCI.js} +6 -6
  64. package/dist/{chunk-QRNLG3CD.js → chunk-SANP6FPA.js} +6 -6
  65. package/dist/{chunk-OJOHMVV7.js → chunk-SBPFWO4S.js} +294 -448
  66. package/dist/{chunk-O5K4AU7Q.js → chunk-SHWOPMLQ.js} +3 -4
  67. package/dist/{chunk-6Z7SI3ZW.js → chunk-SUUVDRTQ.js} +6 -7
  68. package/dist/{chunk-HHAGWNRI.js → chunk-TEHNKBLD.js} +6 -7
  69. package/dist/{chunk-XHR6UC4Y.js → chunk-VPNXQGG6.js} +4 -4
  70. package/dist/{chunk-MWLLV4UV.js → chunk-X5FJXK25.js} +9 -9
  71. package/dist/{chunk-PMUQTGZJ.js → chunk-X7YTIMNN.js} +4 -6
  72. package/dist/{chunk-PC7RDKJJ.js → chunk-XAGT2UNE.js} +3 -3
  73. package/dist/{chunk-7Q3MMWAC.js → chunk-XE5EOEBL.js} +2 -2
  74. package/dist/{chunk-VVD57NWZ.js → chunk-YP7WU5EU.js} +5 -5
  75. package/dist/{chunk-G2WBIWNF.js → chunk-YPTEMDFR.js} +5 -5
  76. package/dist/{chunk-4PXLANQP.js → chunk-ZENVITME.js} +4 -4
  77. package/dist/{chunk-HSTSRNLJ.js → chunk-ZX3L2JKV.js} +64 -86
  78. package/dist/cli/commands/auth/logout.js +28 -28
  79. package/dist/cli/commands/auth/logout.test.js +30 -30
  80. package/dist/cli/commands/cache/clear.js +27 -27
  81. package/dist/cli/commands/debug/command-flags.js +27 -27
  82. package/dist/cli/commands/docs/generate.js +27 -27
  83. package/dist/cli/commands/docs/generate.test.js +28 -28
  84. package/dist/cli/commands/help.js +27 -27
  85. package/dist/cli/commands/kitchen-sink/async.js +28 -28
  86. package/dist/cli/commands/kitchen-sink/async.test.js +29 -29
  87. package/dist/cli/commands/kitchen-sink/index.js +30 -30
  88. package/dist/cli/commands/kitchen-sink/index.test.js +31 -31
  89. package/dist/cli/commands/kitchen-sink/prompts.js +28 -28
  90. package/dist/cli/commands/kitchen-sink/prompts.test.js +29 -29
  91. package/dist/cli/commands/kitchen-sink/static.js +28 -28
  92. package/dist/cli/commands/kitchen-sink/static.test.js +29 -29
  93. package/dist/cli/commands/notifications/generate.js +28 -28
  94. package/dist/cli/commands/notifications/list.js +28 -28
  95. package/dist/cli/commands/search.js +28 -28
  96. package/dist/cli/commands/upgrade.js +28 -28
  97. package/dist/cli/commands/upgrade.test.js +3 -3
  98. package/dist/cli/commands/version.js +28 -28
  99. package/dist/cli/commands/version.test.js +29 -29
  100. package/dist/cli/services/commands/notifications.js +21 -21
  101. package/dist/cli/services/commands/search.js +15 -15
  102. package/dist/cli/services/commands/search.test.js +16 -16
  103. package/dist/cli/services/commands/version.js +16 -16
  104. package/dist/cli/services/commands/version.test.js +18 -18
  105. package/dist/cli/services/kitchen-sink/async.js +15 -15
  106. package/dist/cli/services/kitchen-sink/prompts.js +15 -15
  107. package/dist/cli/services/kitchen-sink/static.js +15 -15
  108. package/dist/cli/services/upgrade.js +17 -17
  109. package/dist/cli/services/upgrade.test.js +20 -20
  110. package/dist/configs/all.yml +12 -0
  111. package/dist/configs/recommended.yml +15 -0
  112. package/dist/configs/theme-app-extension.yml +3 -0
  113. package/dist/{custom-oclif-loader-MUOL3HPQ.js → custom-oclif-loader-V3IB4SYZ.js} +15 -15
  114. package/dist/data/latest.json +1 -1
  115. package/dist/data/manifest_theme.json +1 -0
  116. package/dist/data/preset.json +66 -0
  117. package/dist/data/preset_blocks.json +20 -13
  118. package/dist/data/section.json +1 -15
  119. package/dist/data/setting.json +1 -1
  120. package/dist/data/theme_block.json +1 -15
  121. package/dist/{del-K5ZJEWTD.js → del-P2RS6GN2.js} +9 -9
  122. package/dist/{devtools-KYKGATNX.js → devtools-K7FXBBFZ.js} +3 -3
  123. package/dist/error-handler-WK3AZ7A2.js +38 -0
  124. package/dist/hooks/postrun.js +22 -22
  125. package/dist/hooks/prerun.js +22 -22
  126. package/dist/{http-proxy-GGTVQ6CU.js → http-proxy-FXWKYHZ3.js} +14 -24
  127. package/dist/index.js +7229 -7321
  128. package/dist/lib-JVEIEXYB.js +6 -0
  129. package/dist/lib-QZGSY5YB.js +13 -0
  130. package/dist/{local-YCARFR7T.js → local-3ERK45M5.js} +15 -15
  131. package/dist/{magic-string.es-3RXPUXZF.js → magic-string.es-PJMYOE6F.js} +49 -96
  132. package/dist/{morph-SEECJQ2W.js → morph-OSHCID2F.js} +261 -347
  133. package/dist/{multipart-parser-QKUAJJP5.js → multipart-parser-WSNBP656.js} +8 -7
  134. package/dist/{node-NSRIJ2KL.js → node-2KLEBSMO.js} +31 -31
  135. package/dist/{node-package-manager-TLCUDNS2.js → node-package-manager-QIM24GB3.js} +19 -17
  136. package/dist/{npa-RLWNZ3BM.js → npa-TM76BGG3.js} +10 -16
  137. package/dist/{open-MZGVNFZO.js → open-BHIF7E3E.js} +3 -3
  138. package/dist/out-JR4DWQ2G.js +7 -0
  139. package/dist/{path-NDLRQPLA.js → path-2HZUSAGR.js} +3 -3
  140. package/dist/{source-map-7AAPWPHZ.js → source-map-QCVC46UY.js} +2 -2
  141. package/dist/tsconfig.tsbuildinfo +1 -1
  142. package/dist/{ui-5AEI3FU6.js → ui-5AHG256I.js} +15 -15
  143. package/dist/{workerd-SW7QDYB6.js → workerd-MSNALKI2.js} +30 -30
  144. package/oclif.manifest.json +81 -1
  145. package/package.json +8 -8
  146. package/dist/error-handler-MOT24ECB.js +0 -38
  147. package/dist/lib-PPXZBVZX.js +0 -6
  148. package/dist/lib-XYCLX35G.js +0 -13
  149. package/dist/out-MHEKZJWS.js +0 -7
@@ -0,0 +1,6 @@
1
+ import {
2
+ require_lib
3
+ } from "./chunk-B5EXYCV3.js";
4
+ import "./chunk-PKR7KJ6P.js";
5
+ export default require_lib();
6
+ //# sourceMappingURL=lib-JVEIEXYB.js.map
@@ -0,0 +1,13 @@
1
+ import {
2
+ require_lib
3
+ } from "./chunk-SBPFWO4S.js";
4
+ import "./chunk-G5R6YD27.js";
5
+ import "./chunk-OAZFIMJ3.js";
6
+ import "./chunk-G2ZZKGSV.js";
7
+ import "./chunk-MHUINF7I.js";
8
+ import "./chunk-XE5EOEBL.js";
9
+ import "./chunk-CRHXI6PS.js";
10
+ import "./chunk-BUFIEXZ5.js";
11
+ import "./chunk-PKR7KJ6P.js";
12
+ export default require_lib();
13
+ //# sourceMappingURL=lib-QZGSY5YB.js.map
@@ -22,20 +22,20 @@ import {
22
22
  themeToken,
23
23
  useEmbeddedThemeCLI,
24
24
  useThemebundling
25
- } from "./chunk-4DZKSJ2R.js";
26
- import "./chunk-2HGYYNE5.js";
27
- import "./chunk-XVNW332R.js";
28
- import "./chunk-K6Y4FYT5.js";
29
- import "./chunk-OJOHMVV7.js";
30
- import "./chunk-CBBS4CV7.js";
31
- import "./chunk-SNOECVP4.js";
32
- import "./chunk-UBB7JKND.js";
33
- import "./chunk-WNDN5FAY.js";
34
- import "./chunk-7Q3MMWAC.js";
35
- import "./chunk-KYB6A4PE.js";
36
- import "./chunk-NB4NLOEJ.js";
37
- import "./chunk-522OB3EU.js";
38
- import "./chunk-POZ5MGPT.js";
25
+ } from "./chunk-3OXCI3HX.js";
26
+ import "./chunk-B5EXYCV3.js";
27
+ import "./chunk-75LV6AQS.js";
28
+ import "./chunk-K7HGDAI4.js";
29
+ import "./chunk-SBPFWO4S.js";
30
+ import "./chunk-G5R6YD27.js";
31
+ import "./chunk-OAZFIMJ3.js";
32
+ import "./chunk-G2ZZKGSV.js";
33
+ import "./chunk-MHUINF7I.js";
34
+ import "./chunk-XE5EOEBL.js";
35
+ import "./chunk-CRHXI6PS.js";
36
+ import "./chunk-BUFIEXZ5.js";
37
+ import "./chunk-CFIKVUNW.js";
38
+ import "./chunk-PKR7KJ6P.js";
39
39
  export {
40
40
  alwaysLogAnalytics,
41
41
  alwaysLogMetrics,
@@ -61,4 +61,4 @@ export {
61
61
  useEmbeddedThemeCLI,
62
62
  useThemebundling
63
63
  };
64
- //# sourceMappingURL=local-YCARFR7T.js.map
64
+ //# sourceMappingURL=local-3ERK45M5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_cjs_shims
3
- } from "./chunk-POZ5MGPT.js";
3
+ } from "./chunk-PKR7KJ6P.js";
4
4
 
5
5
  // ../../node_modules/.pnpm/magic-string@0.30.10/node_modules/magic-string/dist/magic-string.es.mjs
6
6
  init_cjs_shims();
@@ -108,17 +108,14 @@ var BitSet = class _BitSet {
108
108
  return this.intro + this.content + this.outro;
109
109
  }
110
110
  trimEnd(rx) {
111
- if (this.outro = this.outro.replace(rx, ""), this.outro.length)
112
- return !0;
111
+ if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
113
112
  let trimmed = this.content.replace(rx, "");
114
113
  if (trimmed.length)
115
114
  return trimmed !== this.content && (this.split(this.start + trimmed.length).edit("", void 0, !0), this.edited && this.edit(trimmed, this.storeName, !0)), !0;
116
- if (this.edit("", void 0, !0), this.intro = this.intro.replace(rx, ""), this.intro.length)
117
- return !0;
115
+ if (this.edit("", void 0, !0), this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
118
116
  }
119
117
  trimStart(rx) {
120
- if (this.intro = this.intro.replace(rx, ""), this.intro.length)
121
- return !0;
118
+ if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
122
119
  let trimmed = this.content.replace(rx, "");
123
120
  if (trimmed.length) {
124
121
  if (trimmed !== this.content) {
@@ -126,8 +123,7 @@ var BitSet = class _BitSet {
126
123
  this.edited && newChunk.edit(trimmed, this.storeName, !0), this.edit("", void 0, !0);
127
124
  }
128
125
  return !0;
129
- } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(rx, ""), this.outro.length)
130
- return !0;
126
+ } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
131
127
  }
132
128
  };
133
129
  function getBtoa() {
@@ -165,8 +161,7 @@ function getRelativePath(from, to) {
165
161
  fromParts.shift(), toParts.shift();
166
162
  if (fromParts.length) {
167
163
  let i = fromParts.length;
168
- for (; i--; )
169
- fromParts[i] = "..";
164
+ for (; i--; ) fromParts[i] = "..";
170
165
  }
171
166
  return fromParts.concat(toParts).join("/");
172
167
  }
@@ -204,8 +199,7 @@ var wordRegex = /\w/, Mappings = class {
204
199
  }
205
200
  let segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
206
201
  nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.advance(content.slice(previousContentLineEnd + 1));
207
- } else
208
- this.pending && (this.rawSegments.push(this.pending), this.advance(content));
202
+ } else this.pending && (this.rawSegments.push(this.pending), this.advance(content));
209
203
  this.pending = null;
210
204
  }
211
205
  addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
@@ -221,8 +215,7 @@ var wordRegex = /\w/, Mappings = class {
221
215
  this.pending = null;
222
216
  }
223
217
  advance(str) {
224
- if (!str)
225
- return;
218
+ if (!str) return;
226
219
  let lines = str.split(`
227
220
  `);
228
221
  if (lines.length > 1) {
@@ -261,20 +254,17 @@ var wordRegex = /\w/, Mappings = class {
261
254
  this.sourcemapLocations.add(char);
262
255
  }
263
256
  append(content) {
264
- if (typeof content != "string")
265
- throw new TypeError("outro content must be a string");
257
+ if (typeof content != "string") throw new TypeError("outro content must be a string");
266
258
  return this.outro += content, this;
267
259
  }
268
260
  appendLeft(index, content) {
269
- if (typeof content != "string")
270
- throw new TypeError("inserted content must be a string");
261
+ if (typeof content != "string") throw new TypeError("inserted content must be a string");
271
262
  this._split(index);
272
263
  let chunk = this.byEnd[index];
273
264
  return chunk ? chunk.appendLeft(content) : this.intro += content, this;
274
265
  }
275
266
  appendRight(index, content) {
276
- if (typeof content != "string")
277
- throw new TypeError("inserted content must be a string");
267
+ if (typeof content != "string") throw new TypeError("inserted content must be a string");
278
268
  this._split(index);
279
269
  let chunk = this.byStart[index];
280
270
  return chunk ? chunk.appendRight(content) : this.outro += content, this;
@@ -324,8 +314,7 @@ var wordRegex = /\w/, Mappings = class {
324
314
  }
325
315
  indent(indentStr, options) {
326
316
  let pattern = /^[^\r\n]/gm;
327
- if (isObject(indentStr) && (options = indentStr, indentStr = void 0), indentStr === void 0 && (this._ensureindentStr(), indentStr = this.indentStr || " "), indentStr === "")
328
- return this;
317
+ if (isObject(indentStr) && (options = indentStr, indentStr = void 0), indentStr === void 0 && (this._ensureindentStr(), indentStr = this.indentStr || " "), indentStr === "") return this;
329
318
  options = options || {};
330
319
  let isExcluded = {};
331
320
  options.exclude && (typeof options.exclude[0] == "number" ? [options.exclude] : options.exclude).forEach((exclusion) => {
@@ -369,12 +358,10 @@ var wordRegex = /\w/, Mappings = class {
369
358
  ), warned.insertRight = !0), this.prependRight(index, content);
370
359
  }
371
360
  move(start, end, index) {
372
- if (index >= start && index <= end)
373
- throw new Error("Cannot move a selection inside itself");
361
+ if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
374
362
  this._split(start), this._split(end), this._split(index);
375
363
  let first = this.byStart[start], last = this.byEnd[end], oldLeft = first.previous, oldRight = last.next, newRight = this.byStart[index];
376
- if (!newRight && last === this.lastChunk)
377
- return this;
364
+ if (!newRight && last === this.lastChunk) return this;
378
365
  let newLeft = newRight ? newRight.previous : this.lastChunk;
379
366
  return oldLeft && (oldLeft.next = oldRight), oldRight && (oldRight.previous = oldLeft), newLeft && (newLeft.next = first), newRight && (newRight.previous = last), first.previous || (this.firstChunk = last.next), last.next || (this.lastChunk = first.previous, this.lastChunk.next = null), first.previous = newLeft, last.next = newRight || null, newLeft || (this.firstChunk = first), newRight || (this.lastChunk = last), this;
380
367
  }
@@ -382,14 +369,10 @@ var wordRegex = /\w/, Mappings = class {
382
369
  return options = options || {}, this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
383
370
  }
384
371
  update(start, end, content, options) {
385
- if (typeof content != "string")
386
- throw new TypeError("replacement content must be a string");
387
- for (; start < 0; )
388
- start += this.original.length;
389
- for (; end < 0; )
390
- end += this.original.length;
391
- if (end > this.original.length)
392
- throw new Error("end is out of bounds");
372
+ if (typeof content != "string") throw new TypeError("replacement content must be a string");
373
+ for (; start < 0; ) start += this.original.length;
374
+ for (; end < 0; ) end += this.original.length;
375
+ if (end > this.original.length) throw new Error("end is out of bounds");
393
376
  if (start === end)
394
377
  throw new Error(
395
378
  "Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead"
@@ -422,35 +405,27 @@ var wordRegex = /\w/, Mappings = class {
422
405
  return this;
423
406
  }
424
407
  prepend(content) {
425
- if (typeof content != "string")
426
- throw new TypeError("outro content must be a string");
408
+ if (typeof content != "string") throw new TypeError("outro content must be a string");
427
409
  return this.intro = content + this.intro, this;
428
410
  }
429
411
  prependLeft(index, content) {
430
- if (typeof content != "string")
431
- throw new TypeError("inserted content must be a string");
412
+ if (typeof content != "string") throw new TypeError("inserted content must be a string");
432
413
  this._split(index);
433
414
  let chunk = this.byEnd[index];
434
415
  return chunk ? chunk.prependLeft(content) : this.intro = content + this.intro, this;
435
416
  }
436
417
  prependRight(index, content) {
437
- if (typeof content != "string")
438
- throw new TypeError("inserted content must be a string");
418
+ if (typeof content != "string") throw new TypeError("inserted content must be a string");
439
419
  this._split(index);
440
420
  let chunk = this.byStart[index];
441
421
  return chunk ? chunk.prependRight(content) : this.outro = content + this.outro, this;
442
422
  }
443
423
  remove(start, end) {
444
- for (; start < 0; )
445
- start += this.original.length;
446
- for (; end < 0; )
447
- end += this.original.length;
448
- if (start === end)
449
- return this;
450
- if (start < 0 || end > this.original.length)
451
- throw new Error("Character is out of bounds");
452
- if (start > end)
453
- throw new Error("end must be greater than start");
424
+ for (; start < 0; ) start += this.original.length;
425
+ for (; end < 0; ) end += this.original.length;
426
+ if (start === end) return this;
427
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
428
+ if (start > end) throw new Error("end must be greater than start");
454
429
  this._split(start), this._split(end);
455
430
  let chunk = this.byStart[start];
456
431
  for (; chunk; )
@@ -458,16 +433,11 @@ var wordRegex = /\w/, Mappings = class {
458
433
  return this;
459
434
  }
460
435
  reset(start, end) {
461
- for (; start < 0; )
462
- start += this.original.length;
463
- for (; end < 0; )
464
- end += this.original.length;
465
- if (start === end)
466
- return this;
467
- if (start < 0 || end > this.original.length)
468
- throw new Error("Character is out of bounds");
469
- if (start > end)
470
- throw new Error("end must be greater than start");
436
+ for (; start < 0; ) start += this.original.length;
437
+ for (; end < 0; ) end += this.original.length;
438
+ if (start === end) return this;
439
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
440
+ if (start > end) throw new Error("end must be greater than start");
471
441
  this._split(start), this._split(end);
472
442
  let chunk = this.byStart[start];
473
443
  for (; chunk; )
@@ -475,48 +445,38 @@ var wordRegex = /\w/, Mappings = class {
475
445
  return this;
476
446
  }
477
447
  lastChar() {
478
- if (this.outro.length)
479
- return this.outro[this.outro.length - 1];
448
+ if (this.outro.length) return this.outro[this.outro.length - 1];
480
449
  let chunk = this.lastChunk;
481
450
  do {
482
- if (chunk.outro.length)
483
- return chunk.outro[chunk.outro.length - 1];
484
- if (chunk.content.length)
485
- return chunk.content[chunk.content.length - 1];
486
- if (chunk.intro.length)
487
- return chunk.intro[chunk.intro.length - 1];
451
+ if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
452
+ if (chunk.content.length) return chunk.content[chunk.content.length - 1];
453
+ if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
488
454
  } while (chunk = chunk.previous);
489
455
  return this.intro.length ? this.intro[this.intro.length - 1] : "";
490
456
  }
491
457
  lastLine() {
492
458
  let lineIndex = this.outro.lastIndexOf(n);
493
- if (lineIndex !== -1)
494
- return this.outro.substr(lineIndex + 1);
459
+ if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
495
460
  let lineStr = this.outro, chunk = this.lastChunk;
496
461
  do {
497
462
  if (chunk.outro.length > 0) {
498
- if (lineIndex = chunk.outro.lastIndexOf(n), lineIndex !== -1)
499
- return chunk.outro.substr(lineIndex + 1) + lineStr;
463
+ if (lineIndex = chunk.outro.lastIndexOf(n), lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
500
464
  lineStr = chunk.outro + lineStr;
501
465
  }
502
466
  if (chunk.content.length > 0) {
503
- if (lineIndex = chunk.content.lastIndexOf(n), lineIndex !== -1)
504
- return chunk.content.substr(lineIndex + 1) + lineStr;
467
+ if (lineIndex = chunk.content.lastIndexOf(n), lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
505
468
  lineStr = chunk.content + lineStr;
506
469
  }
507
470
  if (chunk.intro.length > 0) {
508
- if (lineIndex = chunk.intro.lastIndexOf(n), lineIndex !== -1)
509
- return chunk.intro.substr(lineIndex + 1) + lineStr;
471
+ if (lineIndex = chunk.intro.lastIndexOf(n), lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
510
472
  lineStr = chunk.intro + lineStr;
511
473
  }
512
474
  } while (chunk = chunk.previous);
513
475
  return lineIndex = this.intro.lastIndexOf(n), lineIndex !== -1 ? this.intro.substr(lineIndex + 1) + lineStr : this.intro + lineStr;
514
476
  }
515
477
  slice(start = 0, end = this.original.length) {
516
- for (; start < 0; )
517
- start += this.original.length;
518
- for (; end < 0; )
519
- end += this.original.length;
478
+ for (; start < 0; ) start += this.original.length;
479
+ for (; end < 0; ) end += this.original.length;
520
480
  let result = "", chunk = this.firstChunk;
521
481
  for (; chunk && (chunk.start > start || chunk.end <= start); ) {
522
482
  if (chunk.start < end && chunk.end >= end)
@@ -544,12 +504,10 @@ var wordRegex = /\w/, Mappings = class {
544
504
  return clone.remove(0, start), clone.remove(end, clone.original.length), clone;
545
505
  }
546
506
  _split(index) {
547
- if (this.byStart[index] || this.byEnd[index])
548
- return;
507
+ if (this.byStart[index] || this.byEnd[index]) return;
549
508
  let chunk = this.lastSearchedChunk, searchForward = index > chunk.end;
550
509
  for (; chunk; ) {
551
- if (chunk.contains(index))
552
- return this._splitChunk(chunk, index);
510
+ if (chunk.contains(index)) return this._splitChunk(chunk, index);
553
511
  chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
554
512
  }
555
513
  }
@@ -592,13 +550,11 @@ var wordRegex = /\w/, Mappings = class {
592
550
  }
593
551
  trimEndAborted(charType) {
594
552
  let rx = new RegExp((charType || "\\s") + "+$");
595
- if (this.outro = this.outro.replace(rx, ""), this.outro.length)
596
- return !0;
553
+ if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
597
554
  let chunk = this.lastChunk;
598
555
  do {
599
556
  let end = chunk.end, aborted = chunk.trimEnd(rx);
600
- if (chunk.end !== end && (this.lastChunk === chunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted)
601
- return !0;
557
+ if (chunk.end !== end && (this.lastChunk === chunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted) return !0;
602
558
  chunk = chunk.previous;
603
559
  } while (chunk);
604
560
  return !1;
@@ -608,13 +564,11 @@ var wordRegex = /\w/, Mappings = class {
608
564
  }
609
565
  trimStartAborted(charType) {
610
566
  let rx = new RegExp("^" + (charType || "\\s") + "+");
611
- if (this.intro = this.intro.replace(rx, ""), this.intro.length)
612
- return !0;
567
+ if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
613
568
  let chunk = this.firstChunk;
614
569
  do {
615
570
  let end = chunk.end, aborted = chunk.trimStart(rx);
616
- if (chunk.end !== end && (chunk === this.lastChunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted)
617
- return !0;
571
+ if (chunk.end !== end && (chunk === this.lastChunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted) return !0;
618
572
  chunk = chunk.next;
619
573
  } while (chunk);
620
574
  return !1;
@@ -774,8 +728,7 @@ var wordRegex = /\w/, Mappings = class {
774
728
  }), Object.keys(indentStringCounts).sort((a, b) => indentStringCounts[a] - indentStringCounts[b])[0] || " ";
775
729
  }
776
730
  indent(indentStr) {
777
- if (arguments.length || (indentStr = this.getIndentString()), indentStr === "")
778
- return this;
731
+ if (arguments.length || (indentStr = this.getIndentString()), indentStr === "") return this;
779
732
  let trailingNewline = !this.intro || this.intro.slice(-1) === `
780
733
  `;
781
734
  return this.sources.forEach((source, i) => {
@@ -840,4 +793,4 @@ export {
840
793
  SourceMap,
841
794
  MagicString as default
842
795
  };
843
- //# sourceMappingURL=magic-string.es-3RXPUXZF.js.map
796
+ //# sourceMappingURL=magic-string.es-PJMYOE6F.js.map