@shopify/cli 4.6.0 → 4.7.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 (426) hide show
  1. package/dist/analytics-6LI5GLWS.js +1 -0
  2. package/dist/analytics-UNRIIG4Y.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-4YCMEC5R.js → chunk-2CYVZUYT.js} +1 -1
  5. package/dist/{chunk-C256W7D2.js → chunk-2HK4MFWP.js} +3 -3
  6. package/dist/chunk-2JDCVEFK.js +1 -0
  7. package/dist/chunk-2SZOPJYI.js +1 -0
  8. package/dist/chunk-2U4P6UFZ.js +6 -0
  9. package/dist/{chunk-TAFOSPBW.js → chunk-2WJAAJVX.js} +1 -1
  10. package/dist/chunk-37TEEITE.js +2 -0
  11. package/dist/chunk-3K6VHXC2.js +4 -0
  12. package/dist/chunk-4HV6A6UH.js +8 -0
  13. package/dist/chunk-4JY2P2A5.js +1 -0
  14. package/dist/chunk-4LRG5YBS.js +3 -0
  15. package/dist/chunk-4W3UE2ZI.js +1 -0
  16. package/dist/chunk-5CADTCJE.js +25 -0
  17. package/dist/chunk-5CR5YJTU.js +11 -0
  18. package/dist/chunk-5CYJG63I.js +1 -0
  19. package/dist/chunk-5HBIIYSK.js +1 -0
  20. package/dist/chunk-5HPBQ6U5.js +1 -0
  21. package/dist/chunk-5NO5OXYP.js +15 -0
  22. package/dist/chunk-63CIFL36.js +6 -0
  23. package/dist/chunk-6EBLULOC.js +1 -0
  24. package/dist/{chunk-FMTPUYSH.js → chunk-6ENBE43F.js} +1 -1
  25. package/dist/chunk-6OFGSZD6.js +1 -0
  26. package/dist/chunk-6PDR2IUL.js +11 -0
  27. package/dist/chunk-6VGJVXZI.js +3 -0
  28. package/dist/{chunk-ILQXBASM.js → chunk-6VRXGEIW.js} +1 -1
  29. package/dist/chunk-6WZYX5RO.js +1 -0
  30. package/dist/chunk-7AALWJAO.js +7 -0
  31. package/dist/chunk-7DOWT5JZ.js +20 -0
  32. package/dist/chunk-7JIQXGDE.js +9 -0
  33. package/dist/chunk-7MHANY34.js +1 -0
  34. package/dist/chunk-7WTNEG2F.js +3 -0
  35. package/dist/chunk-7Y7AZRL3.js +10 -0
  36. package/dist/chunk-ACTDYTAV.js +317 -0
  37. package/dist/{chunk-Y2PC2BBJ.js → chunk-AEUCDGTB.js} +4 -4
  38. package/dist/chunk-AGOEROAI.js +10 -0
  39. package/dist/{chunk-WPRAJ25Z.js → chunk-AH2ZGMDM.js} +1 -1
  40. package/dist/chunk-AMLWPYNA.js +4 -0
  41. package/dist/chunk-B4OMIONW.js +5 -0
  42. package/dist/chunk-BR6DBMQA.js +5 -0
  43. package/dist/chunk-CFWHR74L.js +1 -0
  44. package/dist/chunk-CHMEDVDZ.js +15 -0
  45. package/dist/chunk-CIH6LPTG.js +6 -0
  46. package/dist/chunk-CMYQXGLO.js +1 -0
  47. package/dist/chunk-CTRXLZAJ.js +1 -0
  48. package/dist/{chunk-WWX265PC.js → chunk-CYOFLJ3Z.js} +1 -1
  49. package/dist/{chunk-HSKB5OTM.js → chunk-CZJZCJRX.js} +1 -1
  50. package/dist/chunk-CZPGC2E7.js +1 -0
  51. package/dist/{chunk-2I62GKIH.js → chunk-D2K2ZBKH.js} +8 -8
  52. package/dist/chunk-DHU57LKD.js +1 -0
  53. package/dist/chunk-DKL6N3L2.js +1 -0
  54. package/dist/chunk-DMXQLI35.js +1 -0
  55. package/dist/chunk-DPNZWBT5.js +1 -0
  56. package/dist/{chunk-QU5NL2QT.js → chunk-DQCIORGH.js} +1 -1
  57. package/dist/chunk-DQFSKPKL.js +6 -0
  58. package/dist/{chunk-6Q5VRSRN.js → chunk-E2W5OYYM.js} +1 -1
  59. package/dist/chunk-E5T4YRGW.js +1 -0
  60. package/dist/chunk-EOMCXBCS.js +5 -0
  61. package/dist/{chunk-LWRDNTAD.js → chunk-EW55WWT7.js} +1 -1
  62. package/dist/{chunk-6UTUJKKC.js → chunk-F5HCSUXC.js} +5 -5
  63. package/dist/{chunk-W2GMKXM7.js → chunk-FCGKO2KY.js} +1 -1
  64. package/dist/{chunk-7CPECP5P.js → chunk-FULWTZS6.js} +1 -1
  65. package/dist/chunk-FWPJEL6Q.js +3 -0
  66. package/dist/chunk-GKOBFX4A.js +1 -0
  67. package/dist/chunk-GLWQMLUC.js +1 -0
  68. package/dist/chunk-GMTNOCMS.js +375 -0
  69. package/dist/chunk-GSCWZR22.js +1 -0
  70. package/dist/chunk-GZ64KWHX.js +8 -0
  71. package/dist/{chunk-72GN655L.js → chunk-H5KWM27L.js} +1 -1
  72. package/dist/chunk-HHVHVGRT.js +1 -0
  73. package/dist/{chunk-EBZ6MDEM.js → chunk-HLNJL4B6.js} +1 -1
  74. package/dist/{chunk-OUUOML3D.js → chunk-HZIX3DIT.js} +1 -1
  75. package/dist/chunk-I3N6NPHF.js +2 -0
  76. package/dist/chunk-JD5P5RAJ.js +1 -0
  77. package/dist/chunk-JJJTPEMD.js +1 -0
  78. package/dist/{chunk-KRZABRYT.js → chunk-JLGA3B7P.js} +1 -1
  79. package/dist/chunk-JQ2B3VHR.js +7 -0
  80. package/dist/{chunk-VZKR2YFM.js → chunk-JQISGC7D.js} +1 -1
  81. package/dist/chunk-JQVXH26X.js +6 -0
  82. package/dist/{chunk-ERCJPRN3.js → chunk-JUKAWTYY.js} +1 -1
  83. package/dist/{chunk-JHRZCUBE.js → chunk-JZMRBJH3.js} +1 -1
  84. package/dist/chunk-JZXA3H5K.js +1 -0
  85. package/dist/chunk-K4KTNINH.js +1 -0
  86. package/dist/chunk-KCS75ZM4.js +1 -0
  87. package/dist/{chunk-AJ6VOBXU.js → chunk-KIYHEMHD.js} +7 -7
  88. package/dist/chunk-KK24VGVE.js +6 -0
  89. package/dist/{chunk-6BX62FFE.js → chunk-KOVAFUYN.js} +1 -1
  90. package/dist/{chunk-QG7TELFC.js → chunk-KUNDCAQN.js} +1 -1
  91. package/dist/{chunk-3NO6PWNL.js → chunk-L67BU25M.js} +1 -1
  92. package/dist/{chunk-4KZRP2JP.js → chunk-LDF4PQ3B.js} +18 -18
  93. package/dist/chunk-LFOBYEWG.js +1 -0
  94. package/dist/chunk-LJM2DUXN.js +1 -0
  95. package/dist/{chunk-XWPPBOGF.js → chunk-LQ7ENG4V.js} +1 -1
  96. package/dist/chunk-LQCR4TGH.js +3 -0
  97. package/dist/{chunk-UM3OHLCX.js → chunk-LRQYUWWB.js} +1 -1
  98. package/dist/{chunk-CXWLHQKA.js → chunk-LWJA2DQG.js} +1 -1
  99. package/dist/{chunk-IKYZ5L3F.js → chunk-LZ3GZ7NS.js} +1 -1
  100. package/dist/chunk-MB7E5GEY.js +2 -0
  101. package/dist/{chunk-XERJY4IG.js → chunk-MLZLDL6B.js} +8 -8
  102. package/dist/chunk-MRCWOOSF.js +8 -0
  103. package/dist/chunk-N6YTJXIS.js +18 -0
  104. package/dist/chunk-NEMPLS7C.js +1 -0
  105. package/dist/chunk-OE3F7XXU.js +4 -0
  106. package/dist/chunk-OORWOTAP.js +3 -0
  107. package/dist/chunk-OUZGGWFN.js +1 -0
  108. package/dist/chunk-P5MNNBSO.js +1 -0
  109. package/dist/chunk-PAAKBWSF.js +1 -0
  110. package/dist/{chunk-5EFQILLF.js → chunk-PANGX7SA.js} +1 -1
  111. package/dist/{chunk-DODCPRXT.js → chunk-PIFW2R3S.js} +1 -1
  112. package/dist/chunk-PWSI275S.js +7 -0
  113. package/dist/chunk-Q5DQGV3M.js +1 -0
  114. package/dist/chunk-QBIVQXUJ.js +6 -0
  115. package/dist/chunk-QEB3HUQE.js +19 -0
  116. package/dist/{chunk-E3RDAVJT.js → chunk-QKGZWOOY.js} +1 -1
  117. package/dist/chunk-QPWMD2VR.js +1 -0
  118. package/dist/chunk-QRT4A2RV.js +3 -0
  119. package/dist/chunk-QXHENYJH.js +2 -0
  120. package/dist/{chunk-FPWLEGKZ.js → chunk-QZBSCOJV.js} +1 -1
  121. package/dist/chunk-R2R6JDNH.js +1 -0
  122. package/dist/chunk-RUFQCXBX.js +16 -0
  123. package/dist/chunk-RY2SJVWM.js +12 -0
  124. package/dist/chunk-RZFBGBNA.js +1 -0
  125. package/dist/chunk-S3P5WWJD.js +1 -0
  126. package/dist/chunk-SEVSMWNX.js +1 -0
  127. package/dist/chunk-SJMTETSU.js +32 -0
  128. package/dist/chunk-SSJGWLCW.js +28 -0
  129. package/dist/chunk-SYADOUBB.js +7 -0
  130. package/dist/chunk-T5JXQ7KO.js +1 -0
  131. package/dist/chunk-TCTVI6PK.js +1 -0
  132. package/dist/chunk-TSLQZTXR.js +1 -0
  133. package/dist/chunk-TTAPXLI5.js +1 -0
  134. package/dist/{chunk-MDXSLAIC.js → chunk-TY4W7AYX.js} +1 -1
  135. package/dist/chunk-TYIGOVRQ.js +3 -0
  136. package/dist/{chunk-B6SY4BIK.js → chunk-U2Z5NMXV.js} +1 -1
  137. package/dist/{chunk-KGZH4RFA.js → chunk-U6HYEGAE.js} +1 -1
  138. package/dist/chunk-U7R6LYPJ.js +5 -0
  139. package/dist/chunk-UPJLZHHR.js +4 -0
  140. package/dist/chunk-UVQL7RUY.js +1 -0
  141. package/dist/chunk-V2HCVJYF.js +1 -0
  142. package/dist/chunk-V5SC2RYQ.js +2 -0
  143. package/dist/chunk-VKSR6MJG.js +2 -0
  144. package/dist/chunk-VRVP2GQL.js +5 -0
  145. package/dist/{chunk-XGRVAPLR.js → chunk-WCRZJY3P.js} +1 -1
  146. package/dist/{chunk-XGCJWCC4.js → chunk-WHLGNDRE.js} +1 -1
  147. package/dist/{chunk-E3RQCWSC.js → chunk-WKUGSFTB.js} +3 -3
  148. package/dist/chunk-X4XP2RQJ.js +1 -0
  149. package/dist/chunk-XAOYKECS.js +1 -0
  150. package/dist/chunk-XCBEYRQI.js +3 -0
  151. package/dist/chunk-XHZ5BWXL.js +5 -0
  152. package/dist/{chunk-2JFZ6GZC.js → chunk-XLURZ6GL.js} +52 -52
  153. package/dist/chunk-XRT2W5Y2.js +10 -0
  154. package/dist/chunk-XUEMMLXK.js +1 -0
  155. package/dist/chunk-Y34LWI3S.js +19 -0
  156. package/dist/chunk-YHPBDS52.js +16 -0
  157. package/dist/{chunk-JS3X6BDT.js → chunk-YIZZ5LZN.js} +1 -1
  158. package/dist/chunk-YN6A26QL.js +836 -0
  159. package/dist/chunk-YOO7DLOT.js +1 -0
  160. package/dist/chunk-YUVE2I3C.js +1 -0
  161. package/dist/chunk-YY6TFARF.js +1 -0
  162. package/dist/chunk-Z5K4J7HQ.js +1 -0
  163. package/dist/chunk-ZCNIR6YU.js +1 -0
  164. package/dist/{chunk-OTT73YUA.js → chunk-ZO74GSWC.js} +1 -1
  165. package/dist/{chunk-5Y2VD4I3.js → chunk-ZRLEAF7M.js} +1 -1
  166. package/dist/chunk-ZSFAURIH.js +3 -0
  167. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  168. package/dist/cli/commands/app/build.js +1 -1
  169. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  170. package/dist/cli/commands/app/bulk/execute.js +1 -1
  171. package/dist/cli/commands/app/bulk/status.js +1 -1
  172. package/dist/cli/commands/app/config/link.js +1 -1
  173. package/dist/cli/commands/app/config/pull.js +1 -1
  174. package/dist/cli/commands/app/config/use.js +1 -1
  175. package/dist/cli/commands/app/config/validate.js +1 -1
  176. package/dist/cli/commands/app/demo/watcher.js +1 -1
  177. package/dist/cli/commands/app/deploy.js +1 -1
  178. package/dist/cli/commands/app/dev/clean.js +1 -1
  179. package/dist/cli/commands/app/dev.js +1 -1
  180. package/dist/cli/commands/app/env/pull.js +1 -1
  181. package/dist/cli/commands/app/env/show.js +1 -1
  182. package/dist/cli/commands/app/execute.js +1 -1
  183. package/dist/cli/commands/app/function/build.js +1 -1
  184. package/dist/cli/commands/app/function/info.js +1 -1
  185. package/dist/cli/commands/app/function/replay.js +1 -1
  186. package/dist/cli/commands/app/function/run.js +1 -1
  187. package/dist/cli/commands/app/function/schema.js +1 -1
  188. package/dist/cli/commands/app/function/typegen.js +1 -1
  189. package/dist/cli/commands/app/generate/extension.js +1 -1
  190. package/dist/cli/commands/app/graphiql.js +1 -1
  191. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  192. package/dist/cli/commands/app/import-extensions.js +1 -1
  193. package/dist/cli/commands/app/info.js +1 -1
  194. package/dist/cli/commands/app/init.js +1 -1
  195. package/dist/cli/commands/app/logs.js +1 -1
  196. package/dist/cli/commands/app/release.js +1 -1
  197. package/dist/cli/commands/app/versions/list.js +1 -1
  198. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  199. package/dist/cli/commands/auth/login.js +1 -1
  200. package/dist/cli/commands/auth/logout.js +1 -1
  201. package/dist/cli/commands/cache/clear.js +1 -1
  202. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  203. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  204. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  205. package/dist/cli/commands/debug/command-flags.js +1 -1
  206. package/dist/cli/commands/doc/fetch.js +1 -1
  207. package/dist/cli/commands/doc/search.js +1 -1
  208. package/dist/cli/commands/docs/generate.js +1 -1
  209. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  210. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  211. package/dist/cli/commands/help.js +1 -1
  212. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  213. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  214. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  215. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  216. package/dist/cli/commands/notifications/generate.js +1 -1
  217. package/dist/cli/commands/notifications/list.js +1 -1
  218. package/dist/cli/commands/organization/list.js +1 -1
  219. package/dist/cli/commands/search.js +1 -1
  220. package/dist/cli/commands/send-analytics.d.ts +5 -0
  221. package/dist/cli/commands/send-analytics.js +1 -0
  222. package/dist/cli/commands/theme/check.js +1 -1
  223. package/dist/cli/commands/theme/console.js +1 -1
  224. package/dist/cli/commands/theme/delete.js +1 -1
  225. package/dist/cli/commands/theme/dev.js +1 -1
  226. package/dist/cli/commands/theme/duplicate.js +1 -1
  227. package/dist/cli/commands/theme/info.js +1 -1
  228. package/dist/cli/commands/theme/init.js +1 -1
  229. package/dist/cli/commands/theme/language-server.js +1 -1
  230. package/dist/cli/commands/theme/list.js +1 -1
  231. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  232. package/dist/cli/commands/theme/open.js +1 -1
  233. package/dist/cli/commands/theme/package.js +1 -1
  234. package/dist/cli/commands/theme/preview.js +1 -1
  235. package/dist/cli/commands/theme/profile.js +1 -1
  236. package/dist/cli/commands/theme/publish.js +1 -1
  237. package/dist/cli/commands/theme/pull.js +1 -1
  238. package/dist/cli/commands/theme/push.js +1 -1
  239. package/dist/cli/commands/theme/rename.js +1 -1
  240. package/dist/cli/commands/theme/share.js +1 -1
  241. package/dist/cli/commands/upgrade.js +1 -1
  242. package/dist/cli/commands/version.js +1 -1
  243. package/dist/cli/help.js +1 -1
  244. package/dist/cli/services/doctor-release/theme/tests/init.js +4 -8
  245. package/dist/cli/services/doctor-release/theme/tests/push.js +3 -4
  246. package/dist/command-registry.js +1 -1
  247. package/dist/conf-store-OAGJBITE.js +1 -0
  248. package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
  249. package/dist/deprecations-K3NPRKBF.js +1 -0
  250. package/dist/dist-EXJEE23W.js +1 -0
  251. package/dist/dist-S62Z6IFV.js +1 -0
  252. package/dist/environments-ALH2N36U.js +1 -0
  253. package/dist/error-YX56C43A.js +1 -0
  254. package/dist/error-handler-FDCH72NH.js +1 -0
  255. package/dist/fs-SKHQZZTQ.js +1 -0
  256. package/dist/hooks/did-you-mean.js +1 -1
  257. package/dist/hooks/hydrogen-init.js +1 -1
  258. package/dist/hooks/postrun.js +1 -1
  259. package/dist/hooks/prerun.js +2 -1
  260. package/dist/hooks/public-metadata.js +1 -1
  261. package/dist/hooks/sensitive-metadata.js +1 -1
  262. package/dist/hooks/tunnel-provider.js +1 -1
  263. package/dist/hooks/tunnel-start.js +1 -1
  264. package/dist/index.d.ts +1 -1
  265. package/dist/index.js +15 -15
  266. package/dist/is-global-V5VORI3F.js +1 -0
  267. package/dist/lib-M72BVWQ3.js +1 -0
  268. package/dist/local-GX5AN6ZS.js +1 -0
  269. package/dist/metadata-XUJUTBTB.js +1 -0
  270. package/dist/{morph-ABSWZEVT.js → morph-77RHJICZ.js} +1 -1
  271. package/dist/node-package-manager-3WIYU7Y3.js +1 -0
  272. package/dist/notifications-system-RHULO564.js +1 -0
  273. package/dist/os-M6X7KOR4.js +1 -0
  274. package/dist/output-X47P6ICP.js +1 -0
  275. package/dist/{prettier-6ZMB2MMO.js → prettier-RVUAAWC7.js} +1 -1
  276. package/dist/system-SR5G7WEW.js +1 -0
  277. package/dist/tsconfig.tsbuildinfo +1 -1
  278. package/dist/ui-VYWSLAQ6.js +1 -0
  279. package/dist/upgrade-PFQ7JMXG.js +1 -0
  280. package/dist/version-FK4ETQ22.js +1 -0
  281. package/dist/version-U4GM2LNG.js +1 -0
  282. package/dist/workerd-NAPS5TA7.js +18 -0
  283. package/oclif.manifest.json +146 -120
  284. package/package.json +7 -8
  285. package/dist/analytics-6S5JVSRO.js +0 -1
  286. package/dist/analytics-E252SR3P.js +0 -1
  287. package/dist/chunk-2MCH43SL.js +0 -11
  288. package/dist/chunk-2SNT7U7B.js +0 -1
  289. package/dist/chunk-2VIUGNYO.js +0 -1
  290. package/dist/chunk-2Y6CYLKF.js +0 -1
  291. package/dist/chunk-3EHRA4LA.js +0 -1
  292. package/dist/chunk-3EPQ6UOK.js +0 -25
  293. package/dist/chunk-3TFUSDHY.js +0 -370
  294. package/dist/chunk-46NA23I7.js +0 -3
  295. package/dist/chunk-47URTBZF.js +0 -9
  296. package/dist/chunk-4FEBSLSU.js +0 -1
  297. package/dist/chunk-4HB4VZJQ.js +0 -4
  298. package/dist/chunk-4JARSKED.js +0 -32
  299. package/dist/chunk-4P7PWLUN.js +0 -1
  300. package/dist/chunk-53ZA2HD3.js +0 -1
  301. package/dist/chunk-57YF2UNT.js +0 -1
  302. package/dist/chunk-5JPV3HPJ.js +0 -1
  303. package/dist/chunk-5LJ5H4TD.js +0 -7
  304. package/dist/chunk-6FJBCRVK.js +0 -15
  305. package/dist/chunk-6SXB44CE.js +0 -1
  306. package/dist/chunk-6YCGMS7X.js +0 -28
  307. package/dist/chunk-7HAFBCL3.js +0 -2
  308. package/dist/chunk-7XPFLQEM.js +0 -1
  309. package/dist/chunk-A3JE5LX3.js +0 -7
  310. package/dist/chunk-A4SBXDZB.js +0 -14
  311. package/dist/chunk-B2WK53GH.js +0 -1
  312. package/dist/chunk-B34VYVGV.js +0 -1
  313. package/dist/chunk-BBEHNPKK.js +0 -7
  314. package/dist/chunk-BCTMBKAU.js +0 -7
  315. package/dist/chunk-BGUHH7AW.js +0 -10
  316. package/dist/chunk-DHU767C3.js +0 -1
  317. package/dist/chunk-DKHMLETG.js +0 -1
  318. package/dist/chunk-EJDWYASP.js +0 -1
  319. package/dist/chunk-ELJ7SKMH.js +0 -1
  320. package/dist/chunk-EQTULRM7.js +0 -2
  321. package/dist/chunk-ESZS7L6O.js +0 -11
  322. package/dist/chunk-ET2O5DAS.js +0 -1
  323. package/dist/chunk-EZ7EBYDT.js +0 -684
  324. package/dist/chunk-EZNJDFFK.js +0 -28
  325. package/dist/chunk-F34LB7M4.js +0 -20
  326. package/dist/chunk-FE24P4UQ.js +0 -6
  327. package/dist/chunk-FT4HLDK7.js +0 -1
  328. package/dist/chunk-G3YYMKWG.js +0 -3
  329. package/dist/chunk-G7QW5OSQ.js +0 -6
  330. package/dist/chunk-GCDEDRY7.js +0 -3
  331. package/dist/chunk-GEE5MXHT.js +0 -5
  332. package/dist/chunk-H4MYBJ6C.js +0 -1
  333. package/dist/chunk-HDXBZLHH.js +0 -8
  334. package/dist/chunk-HT6MOPLW.js +0 -1
  335. package/dist/chunk-HZXY7RWJ.js +0 -19
  336. package/dist/chunk-IDAWPBJM.js +0 -4
  337. package/dist/chunk-IDLDQ2JB.js +0 -1
  338. package/dist/chunk-IYU72M55.js +0 -3
  339. package/dist/chunk-J3IHP46B.js +0 -3
  340. package/dist/chunk-J4KJQHNS.js +0 -1
  341. package/dist/chunk-JIBLEZ57.js +0 -18
  342. package/dist/chunk-JIKIYMCT.js +0 -1
  343. package/dist/chunk-JJTGHARS.js +0 -3
  344. package/dist/chunk-JQP3ZCAG.js +0 -1
  345. package/dist/chunk-K7IZMKBR.js +0 -5
  346. package/dist/chunk-KO4FB4QU.js +0 -1
  347. package/dist/chunk-KPRKIZ5M.js +0 -3
  348. package/dist/chunk-KUN74JD4.js +0 -4
  349. package/dist/chunk-KURWC4A5.js +0 -16
  350. package/dist/chunk-L3D2CASO.js +0 -1
  351. package/dist/chunk-L7DZTIHJ.js +0 -1
  352. package/dist/chunk-LBDAYBIF.js +0 -1
  353. package/dist/chunk-LH3RIIOB.js +0 -8
  354. package/dist/chunk-LWWBU7ET.js +0 -6
  355. package/dist/chunk-M4BEPPA3.js +0 -1
  356. package/dist/chunk-M4YPMHIM.js +0 -1
  357. package/dist/chunk-M5KKLAM6.js +0 -3
  358. package/dist/chunk-MBLHXPGK.js +0 -1
  359. package/dist/chunk-MDHJJVXA.js +0 -2
  360. package/dist/chunk-NA2ERJIJ.js +0 -1
  361. package/dist/chunk-NOKCVDYD.js +0 -317
  362. package/dist/chunk-O6XSWAP2.js +0 -4
  363. package/dist/chunk-OB62WVZ5.js +0 -16
  364. package/dist/chunk-OT52JOML.js +0 -1
  365. package/dist/chunk-P7XC5HS2.js +0 -1
  366. package/dist/chunk-PALG4SNB.js +0 -1
  367. package/dist/chunk-PB37BTPE.js +0 -6
  368. package/dist/chunk-PWYRKTJ4.js +0 -1
  369. package/dist/chunk-PXSX63RF.js +0 -1
  370. package/dist/chunk-QDPDB5EP.js +0 -3
  371. package/dist/chunk-QV53BSQP.js +0 -6
  372. package/dist/chunk-QXXA2EQY.js +0 -15
  373. package/dist/chunk-QZ5FMWZS.js +0 -1
  374. package/dist/chunk-R26GJEH3.js +0 -1
  375. package/dist/chunk-RTW4RZWH.js +0 -6
  376. package/dist/chunk-SEV3S3WH.js +0 -8
  377. package/dist/chunk-STJ3LWFL.js +0 -1
  378. package/dist/chunk-TAV2ENJY.js +0 -1
  379. package/dist/chunk-TQNALMQH.js +0 -3
  380. package/dist/chunk-TUJNCWHZ.js +0 -1
  381. package/dist/chunk-U564K7SX.js +0 -1
  382. package/dist/chunk-UKQ7NE5V.js +0 -1
  383. package/dist/chunk-V65P572N.js +0 -10
  384. package/dist/chunk-VFIVXK53.js +0 -2
  385. package/dist/chunk-VVFPW4ZQ.js +0 -2
  386. package/dist/chunk-VYITPC34.js +0 -11
  387. package/dist/chunk-W4X3635B.js +0 -1
  388. package/dist/chunk-WEEYQX3M.js +0 -1
  389. package/dist/chunk-WO7LKJCJ.js +0 -1
  390. package/dist/chunk-WR2ZQGUR.js +0 -1
  391. package/dist/chunk-WW7TENNA.js +0 -1
  392. package/dist/chunk-XGMPC7KK.js +0 -2
  393. package/dist/chunk-Y4QC2YVE.js +0 -1
  394. package/dist/chunk-YNJZ2VXV.js +0 -5
  395. package/dist/chunk-Z5DDPQ26.js +0 -3
  396. package/dist/chunk-ZK7VJZ6V.js +0 -6
  397. package/dist/chunk-ZLT4DPHN.js +0 -5
  398. package/dist/chunk-ZOBQKNGK.js +0 -1
  399. package/dist/chunk-ZTE46E4Z.js +0 -153
  400. package/dist/conf-store-N5P2ZEAD.js +0 -1
  401. package/dist/custom-oclif-loader-4ZAXX5MR.js +0 -1
  402. package/dist/deprecations-4TY4DNME.js +0 -1
  403. package/dist/dist-6ZJS4I57.js +0 -1
  404. package/dist/dist-7W2KJOYN.js +0 -1
  405. package/dist/environments-TR5WW2MD.js +0 -1
  406. package/dist/error-VJQM4MFE.js +0 -1
  407. package/dist/error-handler-IYGE3Z72.js +0 -1
  408. package/dist/fs-EOQL26C3.js +0 -1
  409. package/dist/hooks/app-init.d.ts +0 -9
  410. package/dist/hooks/app-init.js +0 -1
  411. package/dist/is-global-RQCPBQA3.js +0 -1
  412. package/dist/is-wsl-UEMXYJPN.js +0 -1
  413. package/dist/lib-JKLF33A7.js +0 -1
  414. package/dist/local-TW3HCZ2S.js +0 -1
  415. package/dist/local-storage-T6FKS53K.js +0 -1
  416. package/dist/metadata-TYZDEER5.js +0 -1
  417. package/dist/node-package-manager-6SWUZILX.js +0 -1
  418. package/dist/notifications-system-SMHMV2UW.js +0 -1
  419. package/dist/output-JG5I2TEL.js +0 -1
  420. package/dist/system-D4Z32GDS.js +0 -1
  421. package/dist/ui-6M3XZ6MR.js +0 -1
  422. package/dist/upgrade-EKAG4IV7.js +0 -1
  423. package/dist/version-6UBWZCNS.js +0 -1
  424. package/dist/version-XRU7TEAI.js +0 -1
  425. package/dist/workerd-LXBSJULF.js +0 -18
  426. /package/dist/{chunk-VDN6MEYI.js → chunk-NJPL5BTN.js} +0 -0
@@ -0,0 +1 @@
1
+ import{g as n}from"./chunk-VKWPEFWQ.js";n();var t;function r(){return t??={currentCommandId:""},t}function o(){return r().currentCommandId}function d(e){r().currentCommandId=e}export{o as a,d as b};
@@ -0,0 +1 @@
1
+ import{g as o}from"./chunk-JJJTPEMD.js";import{b as s}from"./chunk-RY2SJVWM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
@@ -1 +1 @@
1
- import{n as c,o as m}from"./chunk-A4SBXDZB.js";import{g as F}from"./chunk-VKWPEFWQ.js";F();F();F();function o(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var S=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,B=["\x1B","\x9B"],E=e=>`${B[0]}[${e}m`,y=(e,t,a)=>{let i=[];e=[...e];for(let f of e){let s=f;f.includes(";")&&(f=f.split(";")[0][0]+"0");let r=m.codes.get(Number.parseInt(f,10));if(r){let n=e.indexOf(r.toString());n===-1?i.push(E(t?r:s)):e.splice(n,1)}else if(t){i.push(E(0));break}else i.push(E(s))}if(t&&(i=i.filter((f,s)=>i.indexOf(f)===s),a!==void 0)){let f=E(m.codes.get(Number.parseInt(a,10)));i=i.reduce((s,r)=>r===f?[r,...s]:[...s,r],[])}return i.join("")};function p(e,t,a){let i=[...e],f=[],s=typeof a=="number"?a:i.length,r=!1,n,u=0,l="";for(let[h,x]of i.entries()){let b=!1;if(B.includes(x)){let A=/\d[^m]*/.exec(e.slice(h,h+18));n=A&&A.length>0?A[0]:void 0,u<s&&(r=!0,n!==void 0&&f.push(n))}else r&&x==="m"&&(r=!1,b=!0);if(!r&&!b&&u++,!S.test(x)&&o(x.codePointAt())&&(u++,typeof a!="number"&&s++),u>t&&u<=s)l+=x;else if(u===t&&!r&&n!==void 0)l=y(f);else if(u>=s){l+=y(f,!0,n);break}}return l}function g(e,t,a){if(e.charAt(t)===" ")return t;let i=a?1:-1;for(let f=0;f<=3;f++){let s=t+f*i;if(e.charAt(s)===" ")return s}return t}function C(e,t,a={}){let{position:i="end",space:f=!1,preferTruncationOnSpace:s=!1}=a,{truncationCharacter:r="\u2026"}=a;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return r;let n=c(e);if(n<=t)return e;if(i==="start"){if(s){let u=g(e,n-t+1,!0);return r+p(e,u,n).trim()}return f===!0&&(r+=" "),r+p(e,n-t+c(r),n)}if(i==="middle"){f===!0&&(r=` ${r} `);let u=Math.floor(t/2);if(s){let l=g(e,u),h=g(e,n-(t-u)+1,!0);return p(e,0,l)+r+p(e,h,n).trim()}return p(e,0,u)+r+p(e,n-(t-u)+c(r),n)}if(i==="end"){if(s){let u=g(e,t-1);return p(e,0,u)+r}return f===!0&&(r=` ${r}`),p(e,0,t-c(r))+r}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{o as a,C as b};
1
+ import{e as c,f as m}from"./chunk-7Y7AZRL3.js";import{g as F}from"./chunk-VKWPEFWQ.js";F();F();F();function o(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var S=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,B=["\x1B","\x9B"],E=e=>`${B[0]}[${e}m`,y=(e,t,a)=>{let i=[];e=[...e];for(let f of e){let s=f;f.includes(";")&&(f=f.split(";")[0][0]+"0");let r=m.codes.get(Number.parseInt(f,10));if(r){let n=e.indexOf(r.toString());n===-1?i.push(E(t?r:s)):e.splice(n,1)}else if(t){i.push(E(0));break}else i.push(E(s))}if(t&&(i=i.filter((f,s)=>i.indexOf(f)===s),a!==void 0)){let f=E(m.codes.get(Number.parseInt(a,10)));i=i.reduce((s,r)=>r===f?[r,...s]:[...s,r],[])}return i.join("")};function p(e,t,a){let i=[...e],f=[],s=typeof a=="number"?a:i.length,r=!1,n,u=0,l="";for(let[h,x]of i.entries()){let b=!1;if(B.includes(x)){let A=/\d[^m]*/.exec(e.slice(h,h+18));n=A&&A.length>0?A[0]:void 0,u<s&&(r=!0,n!==void 0&&f.push(n))}else r&&x==="m"&&(r=!1,b=!0);if(!r&&!b&&u++,!S.test(x)&&o(x.codePointAt())&&(u++,typeof a!="number"&&s++),u>t&&u<=s)l+=x;else if(u===t&&!r&&n!==void 0)l=y(f);else if(u>=s){l+=y(f,!0,n);break}}return l}function g(e,t,a){if(e.charAt(t)===" ")return t;let i=a?1:-1;for(let f=0;f<=3;f++){let s=t+f*i;if(e.charAt(s)===" ")return s}return t}function C(e,t,a={}){let{position:i="end",space:f=!1,preferTruncationOnSpace:s=!1}=a,{truncationCharacter:r="\u2026"}=a;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return r;let n=c(e);if(n<=t)return e;if(i==="start"){if(s){let u=g(e,n-t+1,!0);return r+p(e,u,n).trim()}return f===!0&&(r+=" "),r+p(e,n-t+c(r),n)}if(i==="middle"){f===!0&&(r=` ${r} `);let u=Math.floor(t/2);if(s){let l=g(e,u),h=g(e,n-(t-u)+1,!0);return p(e,0,l)+r+p(e,h,n).trim()}return p(e,0,u)+r+p(e,n-(t-u)+c(r),n)}if(i==="end"){if(s){let u=g(e,t-1);return p(e,0,u)+r}return f===!0&&(r=` ${r}`),p(e,0,t-c(r))+r}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{o as a,C as b};
@@ -0,0 +1,3 @@
1
+ import{b as R}from"./chunk-J3JPJCWP.js";import{a as O}from"./chunk-CZPGC2E7.js";import{a as M}from"./chunk-DQCIORGH.js";import{a as x,l as H,n as Y}from"./chunk-MLZLDL6B.js";import{a as U}from"./chunk-QPWMD2VR.js";import{a as G,c as p}from"./chunk-KOVAFUYN.js";import{a as S,b as L}from"./chunk-YY6TFARF.js";import{k as A,n as I}from"./chunk-4JY2P2A5.js";import{p as D,q as E,r as P,u as _,v as C}from"./chunk-OORWOTAP.js";import{h as $,k as V}from"./chunk-ZSFAURIH.js";import{b}from"./chunk-JJJTPEMD.js";import{S as g,wa as m}from"./chunk-YN6A26QL.js";import{H as F,z as k}from"./chunk-GMTNOCMS.js";import{a as z}from"./chunk-CTNBSUVU.js";import{Wa as T}from"./chunk-Y34LWI3S.js";import{q as f}from"./chunk-773TIA5M.js";import{e as j,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();async function B(e,t,o,n,r,l){let i=Q(o,n,r),a=X(o,e,n,t),s=[...i,...a,{title:"Theme download complete",task:async()=>{}}];s.length>0&&await F(s,{renderOptions:{stdout:l?.stdout??process.stdout},noProgressBar:r.multiEnvironment})}function Q(e,t,o){if(o.nodelete)return[];let n=new Set(e.map(i=>i.key));return t.applyIgnoreFilters([...t.files.values()]).map(({key:i})=>i).filter(i=>!n.has(i)).map(i=>({title:`Cleaning your local directory (removing ${i})`,task:async()=>t.delete(i)}))}function X(e,t,o,n){let r=o.applyIgnoreFilters(e);r=r.filter(s=>{let h=s.checksum;return o.files.get(s.key)?.checksum!==h});let l=r.map(s=>s.key),i=s=>s.total===0?"[100%]":`[${Math.round(s.current/s.total*100)}%]`;return R(l,_,(s,h)=>({title:`Downloading files from remote theme ${i({current:h,total:l.length})}`,task:async()=>J(t,o,s,n)}))}async function J(e,t,o,n){let r=await A(e.id,o,n);r&&await Promise.all(r.map(l=>t.write(l)))}async function K(e,t,o,n){m("theme-service:pull:setup"),U({verbose:e.verbose,noColor:e.noColor});let r=t??await g(P({store:e.store}),e.password),l=new O(r),i=await(e.development?l.find():l.fetch()),{path:a,nodelete:s,live:h,development:u,only:q,ignore:N,force:y,environment:w}=e;if(!await te(a??f(),y??!1,w?.[0],o))return;let W=await M(r,{header:"Select a theme to open",filter:{live:h,theme:u?`${i?.id}`:e.theme}});m("theme-service:pull:setup"),await Z(W,r,{environment:w?.[0],force:y??!1,ignore:N??[],multiEnvironment:o,nodelete:s??!1,only:q??[],path:a??f()},n)}async function Z(e,t,o,n){m("theme-service:pull:file-system");let r=H(o.path,{filters:o}),[l]=await Promise.all([I(e.id,t),r.ready()]),i=x(l);m("theme-service:pull:file-system"),await B(e,t,i,r,o,n);let a=o.environment?`Environment: ${o.environment}`:"";k({headline:a,body:["The theme",...G(e),"has been pulled."],nextSteps:[[{link:{label:"View your theme",url:S(e,t)}}],[{link:{label:"Customize your theme at the theme editor",url:L(e,t)}}]]})}async function ee(e){return(await T("*",{cwd:e,deep:1,onlyFiles:!1})).length===0}async function te(e,t,o,n){return t?!0:!(!await ee(e)&&!await Y(e)&&!await p(t,void 0,o,n)||await $(e)&&!await V(e)&&!await p(t,"The current Git directory has uncommitted changes.",o,n))}var d=j(z(),1);var v=class extends C{static summary="Download your remote theme files locally.";static descriptionWithMarkdown=`Retrieves theme files from Shopify.
2
+
3
+ If no theme is specified, then you're prompted to select the theme to pull from the list of the themes in your store.`;static description=this.descriptionWithoutMarkdown();static flags={...b,...D,...E("download"),theme:d.Flags.string({char:"t",description:"Theme ID or name of the remote theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_THEME_ID"}),development:d.Flags.boolean({char:"d",description:"Pull theme files from your remote development theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),live:d.Flags.boolean({char:"l",description:"Pull theme files from your remote live theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_LIVE"}),nodelete:d.Flags.boolean({char:"n",description:"Prevent deleting local files that don't exist remotely.",env:"SHOPIFY_FLAG_NODELETE"}),force:d.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=["store","password","path",["live","development","theme"]];static nonTTYFlagRequirements(){return[{flags:["theme","development","live"]}]}async command(t,o,n,r,l){m("theme-command:pull"),await K({...t,noColor:t["no-color"]},o,n,l),m("theme-command:pull")}storeAuthScopes(){return["read_themes"]}};export{K as a,v as b};
@@ -1 +1 @@
1
- import{K as i}from"./chunk-6YCGMS7X.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
1
+ import{O as i}from"./chunk-GMTNOCMS.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
@@ -1,4 +1,4 @@
1
- import{m as E}from"./chunk-ZTE46E4Z.js";import{Fb as $,Hb as T,Pb as O,Ta as V,ma as N}from"./chunk-3TFUSDHY.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
1
+ import{h as E}from"./chunk-R2R6JDNH.js";import{Ab as O,Ta as V,ma as N,qb as $,sb as T}from"./chunk-Y34LWI3S.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
2
  `);let s;for(;(s=C.exec(r))!=null;){let a=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
3
3
  `),t=t.replace(/\\r/g,"\r")),n[a]=t}return n}function U(e){e=e||{};let n=x(e);e.path=n;let r=l.configDotenv(e);if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=A(e).split(","),a=s.length,t;for(let o=0;o<a;o++)try{let i=s[o].trim(),f=M(r,i);t=l.decrypt(f.ciphertext,f.key);break}catch(i){if(o+1>=a)throw i}return l.parse(t)}function B(e){console.log(`[dotenv@${D}][WARN] ${e}`)}function v(e){console.log(`[dotenv@${D}][DEBUG] ${e}`)}function j(e){console.log(`[dotenv@${D}] ${e}`)}function A(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function M(e,n){let r;try{r=new URL(n)}catch(i){if(i.code==="ERR_INVALID_URL"){let f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw i}let s=r.password;if(!s){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let a=r.searchParams.get("environment");if(!a){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let t=`DOTENV_VAULT_${a.toUpperCase()}`,o=e.parsed[t];if(!o){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:o,key:s}}function x(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)b.existsSync(r)&&(n=r.endsWith(".vault")?r:`${r}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=y.resolve(process.cwd(),".env.vault");return b.existsSync(n)?n:null}function k(e){return e[0]==="~"?y.join(q.homedir(),e.slice(1)):e}function W(e){let n=!!(e&&e.debug),r=e&&"quiet"in e?e.quiet:!0;(n||!r)&&j("Loading env from encrypted .env.vault");let s=l._parseVault(e),a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),l.populate(a,s,e),{parsed:s}}function G(e){let n=y.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug),a=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?r=e.encoding:s&&v("No encoding is specified. UTF-8 is used by default");let t=[n];if(e&&e.path)if(!Array.isArray(e.path))t=[k(e.path)];else{t=[];for(let u of e.path)t.push(k(u))}let o,i={};for(let u of t)try{let c=l.parse(b.readFileSync(u,{encoding:r}));l.populate(i,c,e)}catch(c){s&&v(`Failed to load ${u} ${c.message}`),o=c}let f=process.env;if(e&&e.processEnv!=null&&(f=e.processEnv),l.populate(f,i,e),s||!a){let u=Object.keys(i).length,c=[];for(let p of t)try{let h=y.relative(process.cwd(),p);c.push(h)}catch(h){s&&v(`Failed to load ${p} ${h.message}`),o=h}j(`injecting env (${u}) from ${c.join(",")}`)}return o?{parsed:i,error:o}:{parsed:i}}function J(e){if(A(e).length===0)return l.configDotenv(e);let n=x(e);return n?l._configVault(e):(B(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),l.configDotenv(e))}function Q(e,n){let r=Buffer.from(n.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=F.createDecipheriv("aes-256-gcm",r,a);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let i=o instanceof RangeError,f=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||f){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw o}}function H(e,n,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof n!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(n))Object.prototype.hasOwnProperty.call(e,t)?(a===!0&&(e[t]=n[t]),s&&v(a===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=n[t]}var l={configDotenv:G,_configVault:W,_parseVault:U,config:J,decrypt:Q,parse:S,populate:H};d.exports.configDotenv=l.configDotenv;d.exports._configVault=l._configVault;d.exports._parseVault=l._parseVault;d.exports.config=l.config;d.exports.decrypt=l.decrypt;d.exports.parse=l.parse;d.exports.populate=l.populate;d.exports=l});m();var L=Y(K());async function oe(e){if(O(T`Reading the .env file at ${$.path(e)}`),!await V(e))throw new E(`The environment file at ${e} does not exist.`);let n=await N(e);return{path:e,variables:(0,L.parse)(n)}}function se(e,n){let r=[],s=e===null?[]:e.split(`
4
4
  `),a=[],t;for(let o of s){if(t){if(o.endsWith(t.quote)){let u=_(t.key,t.value+o.slice(0,-1),t.quote),c=n[t.key];c&&(a.push(t.key),u=_(t.key,c)),r.push(u),t=void 0}else t.value+=`${o}
@@ -1,4 +1,4 @@
1
- import{k as P,t as F}from"./chunk-HT6MOPLW.js";import{a as N}from"./chunk-Q7BOSHWX.js";import{a as T}from"./chunk-PXSX63RF.js";import{M as H,O as q,n as $,sa as d,ua as h}from"./chunk-EZ7EBYDT.js";import{P as v,x as I,y as L}from"./chunk-6YCGMS7X.js";import{a as x}from"./chunk-M4BEPPA3.js";import{m as l}from"./chunk-ZTE46E4Z.js";import{Fb as C,Hb as U,Pb as c}from"./chunk-3TFUSDHY.js";import{t as O}from"./chunk-J3IHP46B.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();p();function D(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,o);for(let[r,o]of Object.entries(e.replaceExtensionTemplates??[])){let n=r.split("/")[0];t.append(`replace_extension_templates[${n}][${r}]`,o)}return t.append("_method",e.method),t}function w(){return{"User-Agent":`Shopify CLI; v=${x}`}}function k(e){return delete e.cookie,delete e.authorization,e}p();function S(e){let t={};return e.split(";").forEach(r=>{let o=r.match(/(.*?)=(.*)$/)??[],n=o[1]?.trim(),s=o[2]?.trim()??"";n&&(t[n]=s)}),t}function E(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var y=class extends l{};async function Re(e){return F(e)}async function be(e,t,r){let o=M(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),h("theme-service:storefront-session:check-storefront-password");let s={"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded",...r},a=await $(`${o}/password`,{headers:s,body:n.toString(),method:"POST",redirect:"manual"});if(a.status===429)throw d(new l(`Too many incorrect password attempts. Please try again after ${a.headers.get("retry-after")} seconds.`));return B(a,o)}async function j(e,t,r,o,n={}){let s={},a=await G(e,r,n),i=M(t);if(s._shopify_essential=a,h(`theme-service:storefront-session:is-password-protected:${!!o}`),!o)return s;let u=await ee(a,e,i,o,n);return{...s,...u}}async function G(e,t,r,o=1){let n=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${n}`;h("theme-service:storefront-session:get-session-essential-cookie");let a={...r,...w()},i=await $(s,{method:"HEAD",redirect:"manual",headers:a}),u=i.headers.raw()["set-cookie"]??[],f=_(u,"_shopify_essential");if(!f){if(c(`Failed to obtain _shopify_essential cookie.
1
+ import{k as P,t as F}from"./chunk-4JY2P2A5.js";import{a as N}from"./chunk-Q7BOSHWX.js";import{a as T}from"./chunk-CTRXLZAJ.js";import{Q as H,S as q,r as $,xa as d,za as h}from"./chunk-YN6A26QL.js";import{B as I,C as L,T as v}from"./chunk-GMTNOCMS.js";import{a as x}from"./chunk-5CYJG63I.js";import{h as l}from"./chunk-R2R6JDNH.js";import{Ab as c,qb as C,sb as U}from"./chunk-Y34LWI3S.js";import{t as O}from"./chunk-XAOYKECS.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();p();function D(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,o);for(let[r,o]of Object.entries(e.replaceExtensionTemplates??[])){let n=r.split("/")[0];t.append(`replace_extension_templates[${n}][${r}]`,o)}return t.append("_method",e.method),t}function w(){return{"User-Agent":`Shopify CLI; v=${x}`}}function k(e){return delete e.cookie,delete e.authorization,e}p();function S(e){let t={};return e.split(";").forEach(r=>{let o=r.match(/(.*?)=(.*)$/)??[],n=o[1]?.trim(),s=o[2]?.trim()??"";n&&(t[n]=s)}),t}function E(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var y=class extends l{};async function Re(e){return F(e)}async function be(e,t,r){let o=M(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),h("theme-service:storefront-session:check-storefront-password");let s={"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded",...r},a=await $(`${o}/password`,{headers:s,body:n.toString(),method:"POST",redirect:"manual"});if(a.status===429)throw d(new l(`Too many incorrect password attempts. Please try again after ${a.headers.get("retry-after")} seconds.`));return B(a,o)}async function j(e,t,r,o,n={}){let s={},a=await G(e,r,n),i=M(t);if(s._shopify_essential=a,h(`theme-service:storefront-session:is-password-protected:${!!o}`),!o)return s;let u=await ee(a,e,i,o,n);return{...s,...u}}async function G(e,t,r,o=1){let n=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${n}`;h("theme-service:storefront-session:get-session-essential-cookie");let a={...r,...w()},i=await $(s,{method:"HEAD",redirect:"manual",headers:a}),u=i.headers.raw()["set-cookie"]??[],f=_(u,"_shopify_essential");if(!f){if(c(`Failed to obtain _shopify_essential cookie.
2
2
 
3
3
  -Request ID: ${i.headers.get("x-request-id")??"unknown"}
4
4
 
@@ -0,0 +1,2 @@
1
+ import{Ab as n,Ta as o,qb as e,sb as r,ua as d,wa as f}from"./chunk-Y34LWI3S.js";import{d as i}from"./chunk-773TIA5M.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
2
+ *`)),t}export{c as a};
@@ -1,4 +1,4 @@
1
- import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as ft,b as ht,f as _e,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-IKYZ5L3F.js";import{a as M,l as gt,m as yt}from"./chunk-HT6MOPLW.js";import{s as ie,t as W}from"./chunk-Z5DDPQ26.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-DODCPRXT.js";import{b as Ke,sa as L,ua as H}from"./chunk-EZ7EBYDT.js";import{P as st,u as et,w as _,x as te,y as tt}from"./chunk-6YCGMS7X.js";import{m as se}from"./chunk-ZTE46E4Z.js";import{Fb as j,Hb as ne,Mb as re,O as Xe,Pb as F,Qb as D,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,ua as be,wa as Ze,ya as Qe}from"./chunk-3TFUSDHY.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as f}from"./chunk-VKWPEFWQ.js";f();f();f();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=Ie(s),[a=[],p=[]]=Ie(n),[m=[],c=[]]=Ie(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,h=>h.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function Ie(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),_({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}f();import Ft from"fs/promises";var le=class{constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};f();f();f();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),h=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:h,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),h=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{h.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}f();f();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
1
+ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-LZ3GZ7NS.js";import{a as M,l as gt,m as yt}from"./chunk-4JY2P2A5.js";import{s as ie,t as W}from"./chunk-OORWOTAP.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-PIFW2R3S.js";import{b as Ke,xa as L,za as H}from"./chunk-YN6A26QL.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-GMTNOCMS.js";import{h as se}from"./chunk-R2R6JDNH.js";import{Ab as F,Bb as D,O as Xe,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-Y34LWI3S.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],p=[]]=_e(n),[m=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),f=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:f,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),f=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{f.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <title>${e.title}</title>
@@ -66,11 +66,11 @@ import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as ft,b as ht,f as _e,g
66
66
  </div>
67
67
  </div>
68
68
  </body>
69
- </html>`}f();f();var ps=/<head(\s[^>]*)?>/i,qe="https://cdn.shopify.com/storefront",ms=`${qe}/standard-events.js`,fs=`${qe}/standard-events.dev.js`,kt=`${qe}/standard-events-inspector.js`,_t="shopify-cli-standard-events-inspector",hs=new RegExp(`<script\\b[^>]*(?:\\bid=["']${je(_t)}["']|\\bsrc=["']${je(kt)}["'])[^>]*>`,"i"),gs=new RegExp(je(ms),"g");function pe(e){return hs.test(e)?e:e.replace(ps,t=>`${t}<script id="${_t}" src="${kt}" defer></script>`)}function It(e){return e.replace(gs,fs)}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}f();var Lt=80;function X(e,t,s){if(!ys(e)||s.type==="theme-extension")return;let n=e.path.length>Lt?`${e.path.substring(0,Lt)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=Es(t.status),p=e.method.padStart(6);re(ne`• ${ie.format(new Date)} Request ${j.raw("\xBB")} ${p} ${a(String(t.status))} ${n} ${j.gray(i)}`)}function ys(e){let t=[z,J,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=q(n);return!s.includes(r)}function Es(e){return e<300?j.green:e<400?j.yellow:j.errorText}var J="/cdn/",z="/ext/cdn/",Ce="/api/collect",Ts=/^\/cart\//,xs=/^\/cart(\/|\.js|\.json|$)/,Ae=/^\/checkouts\/(?!internal\/)/,jt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,Ss=new RegExp(`^${J}`),Rs=new RegExp(`^${z}`),ws=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Fs=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",Ce,"/cdn-cgi/challenge-platform"],qt="_shopify_essential",Ps=new RegExp(`${qt}=([^;]*)(;|$)`);function Ct(e,t){return $(async s=>{if(Fs.some(n=>s.path.startsWith(n)))return null;if(vs(s)){let n=s.path.split("?")[0]??"";return De(s,t).then(async r=>{if(X(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=Z(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=A(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&_(a),new Response(r.message,{status:o,statusText:i})})}})}function vs(e){if(e.method!=="GET"||e.path.match(Ts)||e.path.match(Ae)||e.path.match(jt)||e.path.match(Ss)||e.path.match(Rs))return!0;let[t]=e.path.split("?"),s=q(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function $s(e){let[t]=e.split("?");return!(xs.test(t)||Ae.test(t)||jt.test(t))}function me(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function bs(e){return ws.test(e.path)}function Z(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${me(t)}${Ce}`,r=new RegExp(n,"g");s=s.replace(r,`$1${Ce}`);let o=new RegExp(`(https?:)?//${me(t)}${J}`,"g");s=s.replace(o,J);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),p=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),m=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,u)=>{let h=u&&p.has(u),T=u&&m.has(u)&&l.startsWith("extensions/");return U(u).startsWith("image/")?c:T?`${z}${l}`:h?`${J}${l}`:c}),t.options.standardEventsDevBundle&&(s=It(s)),s}function ks(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${me(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function _s(e,t){let s=new RegExp(`Domain=${me(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function Q(e,t,s){let n=Ht(e,t);if(n.status>=300&&n.status<400)return n;t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let i=await n.text();return i=Z(i,e),i=ks(i,e),e.options.standardEventsInspector&&(i=pe(i)),s&&(i=s(i)??i),new Response(i,n)}var At=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Ht(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let i of At)s.headers.delete(i);s.headers.delete("access-control-allow-origin"),s.headers.delete("access-control-allow-credentials"),s.headers.delete("access-control-allow-methods"),s.headers.delete("access-control-allow-headers"),s.headers.delete("access-control-expose-headers"),s.headers.delete("access-control-max-age");let n=s.headers.get("Link");n&&s.headers.set("Link",Z(n,e));let r=s.headers.get("Location");if(r){let i=new URL(r,"https://shopify.dev");Ae.test(i.pathname)||(i.searchParams.delete("_fd"),i.searchParams.delete("pb"),s.headers.set("Location",i.href.replace(i.origin,"")))}let o=s.headers.getSetCookie();if(o?.length){s.headers.set("Set-Cookie",_s(o,e).join(","));let i=o.join(",").match(Ps)?.[1];i&&(e.session.sessionCookies[qt]=i)}return s}function He(e){let t=nt(e);for(let n of At)delete t[n];delete t["upgrade-insecure-requests"];let s=rt(e);return s&&(t["X-Forwarded-For"]=s),t}function De(e,t){let s=e.path.replace(new RegExp(z,"g"),"/"),n=e.path.startsWith(z)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=ot(e),i=He(e);return bs(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=ht({...i,...ft(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:Et(t.session,{headers:i}),...t.type==="theme"&&$s(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>Ht(t,a)).catch(a=>{throw ae(L(a),r)})}var Oe=0,Is=5;function Ot(e,t){return $(s=>{let[n="/",r=""]=s.path.split("?");return js(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Dt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
70
- `)}))}):ce(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:He(s),replaceExtensionTemplates:he(t),replaceTemplates:Ne(t,n,it(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ls(s)){let a=await qs(s,t,i);if(a)return X(s,a,t),a}return X(s,i,t),Q(t,i,a=>(Cs(i,a,String(e.id)),Oe=0,We(a,t)))}).catch(async i=>{if(i instanceof fe&&(F(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),H("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Oe++,Oe>Is&&(tt(new se(i.getMessage())),process.exit(1)),await t.session.refresh();let h=new URLSearchParams(r),T=new URLSearchParams([...h].filter(([Pe])=>!Pe.startsWith("__sfr"))),v=n+(T.toString()?`?${T}`:"");return new Response(null,{status:302,headers:{Location:v}})}let{status:a,statusText:p,cause:m,...c}=A(i,"Failed to render storefront"),[l,...u]=c.headline.split(`
69
+ </html>`}h();h();var ps=/<head(\s[^>]*)?>/i,qe="https://cdn.shopify.com/storefront",ms=`${qe}/standard-events.js`,hs=`${qe}/standard-events.dev.js`,kt=`${qe}/standard-events-inspector.js`,It="shopify-cli-standard-events-inspector",fs=new RegExp(`<script\\b[^>]*(?:\\bid=["']${je(It)}["']|\\bsrc=["']${je(kt)}["'])[^>]*>`,"i"),gs=new RegExp(je(ms),"g");function pe(e){return fs.test(e)?e:e.replace(ps,t=>`${t}<script id="${It}" src="${kt}" defer></script>`)}function _t(e){return e.replace(gs,hs)}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}h();var Lt=80;function X(e,t,s){if(!ys(e)||s.type==="theme-extension")return;let n=e.path.length>Lt?`${e.path.substring(0,Lt)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=Es(t.status),p=e.method.padStart(6);re(ne`• ${ie.format(new Date)} Request ${j.raw("\xBB")} ${p} ${a(String(t.status))} ${n} ${j.gray(i)}`)}function ys(e){let t=[z,J,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=q(n);return!s.includes(r)}function Es(e){return e<300?j.green:e<400?j.yellow:j.errorText}var J="/cdn/",z="/ext/cdn/",Ce="/api/collect",Ts=/^\/cart\//,xs=/^\/cart(\/|\.js|\.json|$)/,Ae=/^\/checkouts\/(?!internal\/)/,jt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,Ss=new RegExp(`^${J}`),Rs=new RegExp(`^${z}`),ws=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Fs=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",Ce,"/cdn-cgi/challenge-platform"],qt="_shopify_essential",Ps=new RegExp(`${qt}=([^;]*)(;|$)`);function Ct(e,t){return $(async s=>{if(Fs.some(n=>s.path.startsWith(n)))return null;if(vs(s)){let n=s.path.split("?")[0]??"";return De(s,t).then(async r=>{if(X(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=Z(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=A(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&I(a),new Response(r.message,{status:o,statusText:i})})}})}function vs(e){if(e.method!=="GET"||e.path.match(Ts)||e.path.match(Ae)||e.path.match(jt)||e.path.match(Ss)||e.path.match(Rs))return!0;let[t]=e.path.split("?"),s=q(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function $s(e){let[t]=e.split("?");return!(xs.test(t)||Ae.test(t)||jt.test(t))}function me(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function bs(e){return ws.test(e.path)}function Z(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${me(t)}${Ce}`,r=new RegExp(n,"g");s=s.replace(r,`$1${Ce}`);let o=new RegExp(`(https?:)?//${me(t)}${J}`,"g");s=s.replace(o,J);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),p=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),m=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,u)=>{let f=u&&p.has(u),T=u&&m.has(u)&&l.startsWith("extensions/");return U(u).startsWith("image/")?c:T?`${z}${l}`:f?`${J}${l}`:c}),t.options.standardEventsDevBundle&&(s=_t(s)),s}function ks(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${me(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function Is(e,t){let s=new RegExp(`Domain=${me(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function Q(e,t,s){let n=Ht(e,t);if(n.status>=300&&n.status<400)return n;t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let i=await n.text();return i=Z(i,e),i=ks(i,e),e.options.standardEventsInspector&&(i=pe(i)),s&&(i=s(i)??i),new Response(i,n)}var At=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Ht(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let i of At)s.headers.delete(i);s.headers.delete("access-control-allow-origin"),s.headers.delete("access-control-allow-credentials"),s.headers.delete("access-control-allow-methods"),s.headers.delete("access-control-allow-headers"),s.headers.delete("access-control-expose-headers"),s.headers.delete("access-control-max-age");let n=s.headers.get("Link");n&&s.headers.set("Link",Z(n,e));let r=s.headers.get("Location");if(r){let i=new URL(r,"https://shopify.dev");Ae.test(i.pathname)||(i.searchParams.delete("_fd"),i.searchParams.delete("pb"),s.headers.set("Location",i.href.replace(i.origin,"")))}let o=s.headers.getSetCookie();if(o?.length){s.headers.set("Set-Cookie",Is(o,e).join(","));let i=o.join(",").match(Ps)?.[1];i&&(e.session.sessionCookies[qt]=i)}return s}function He(e){let t=nt(e);for(let n of At)delete t[n];delete t["upgrade-insecure-requests"];let s=rt(e);return s&&(t["X-Forwarded-For"]=s),t}function De(e,t){let s=e.path.replace(new RegExp(z,"g"),"/"),n=e.path.startsWith(z)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=ot(e),i=He(e);return bs(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=ft({...i,...ht(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:Et(t.session,{headers:i}),...t.type==="theme"&&$s(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>Ht(t,a)).catch(a=>{throw ae(L(a),r)})}var Oe=0,_s=5;function Ot(e,t){return $(s=>{let[n="/",r=""]=s.path.split("?");return js(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Dt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
70
+ `)}))}):ce(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:He(s),replaceExtensionTemplates:fe(t),replaceTemplates:Ne(t,n,it(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ls(s)){let a=await qs(s,t,i);if(a)return X(s,a,t),a}return X(s,i,t),Q(t,i,a=>(Cs(i,a,String(e.id)),Oe=0,We(a,t)))}).catch(async i=>{if(i instanceof he&&(F(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),H("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Oe++,Oe>_s&&(tt(new se(i.getMessage())),process.exit(1)),await t.session.refresh();let f=new URLSearchParams(r),T=new URLSearchParams([...f].filter(([Pe])=>!Pe.startsWith("__sfr"))),v=n+(T.toString()?`?${T}`:"");return new Response(null,{status:302,headers:{Location:v}})}let{status:a,statusText:p,cause:m,...c}=A(i,"Failed to render storefront"),[l,...u]=c.headline.split(`
71
71
  `);return te(c),Dt(t,{status:a,statusText:p},{title:l,header:l,errors:[{message:[...u,m.message].join("<br>"),code:m.stack?.replace(`${m.message}
72
- `,"")??""}]})})})}function Dt(e,t,s){let n=We(bt(s),e);return e.options.standardEventsInspector&&(n=pe(n)),H("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ls(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function js(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function qs(e,t,s){F(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await De(e,t).catch(r=>new Response(null,A(r)));if(n.status<400)return F(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?Q(t,n):n;F(`Proxy status: ${n.status}. Returning render error.`)}function Cs(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new fe(s,n,e)}var fe=class extends Error{constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
73
- `)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};f();f();function ge(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}f();function ye(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var As={stylesheet:new Map,javascript:new Map};function Nt(e,t){return $(async s=>{if(s.method!=="GET")return;if(Ns(s,t))return Ws(s,t);let{file:n,fileKey:r,isUnsynced:o}=Os(s,t);if(!r)return;let i=U(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ct(s,"X-Local-Asset","true"),!n){o&&N(s,O({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(Z(n.value,t)):Buffer.from(n.attachment??"","base64");return oe(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Hs=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,Ds=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Os(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=E("assets",o),a=r.files.get(i),p=r.unsyncedFileKeys.has(i);if(a||p)return{file:a,isUnsynced:p,fileKey:i}}};return s(Hs,t.localThemeFileSystem)??s(Ds,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Ns(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Ws(e,t){switch(ye(e).pathname.split("/").at(-1)){case"styles.css":return Ms(t,e);case"block-scripts.js":return Me(t,e,"block");case"snippet-scripts.js":return Me(t,e,"snippet");case"scripts.js":return Me(t,e,"section");case void 0:break;default:break}}function Ms(e,t){let s=Ee(e,"section"),n=Ee(e,"block"),r=Ee(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
72
+ `,"")??""}]})})})}function Dt(e,t,s){let n=We(bt(s),e);return e.options.standardEventsInspector&&(n=pe(n)),H("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ls(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function js(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function qs(e,t,s){F(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await De(e,t).catch(r=>new Response(null,A(r)));if(n.status<400)return F(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?Q(t,n):n;F(`Proxy status: ${n.status}. Returning render error.`)}function Cs(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new he(s,n,e)}var he=class extends Error{response;expectedThemeId;actualThemeId;constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
73
+ `)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};h();h();function ge(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}h();function ye(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var As={stylesheet:new Map,javascript:new Map};function Nt(e,t){return $(async s=>{if(s.method!=="GET")return;if(Ns(s,t))return Ws(s,t);let{file:n,fileKey:r,isUnsynced:o}=Os(s,t);if(!r)return;let i=U(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ct(s,"X-Local-Asset","true"),!n){o&&N(s,O({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(Z(n.value,t)):Buffer.from(n.attachment??"","base64");return oe(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Hs=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,Ds=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Os(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=E("assets",o),a=r.files.get(i),p=r.unsyncedFileKeys.has(i);if(a||p)return{file:a,isUnsynced:p,fileKey:i}}};return s(Hs,t.localThemeFileSystem)??s(Ds,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Ns(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Ws(e,t){switch(ye(e).pathname.split("/").at(-1)){case"styles.css":return Ms(t,e);case"block-scripts.js":return Me(t,e,"block");case"snippet-scripts.js":return Me(t,e,"snippet");case"scripts.js":return Me(t,e,"section");case void 0:break;default:break}}function Ms(e,t){let s=Ee(e,"section"),n=Ee(e,"block"),r=Ee(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
74
74
  `];for(let[,a]of[...s,...n,...r]){let p=Wt(a,"stylesheet");p&&o.push(p)}let i=o.join(`
75
75
  `);return oe(t,{getContents:()=>i,getMeta:()=>({type:"text/css",size:Buffer.byteLength(i),mtime:new Date})})}function Me(e,t,s){let n=Ee(e,s),r=`${s}s`,o=[`
76
76
  /*** GENERATED LOCALLY ***/
@@ -96,8 +96,8 @@ import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as ft,b as ht,f as _e,g
96
96
  }
97
97
  })();`)}o.push("})();");let i=o.join(`
98
98
  `);return oe(t,{getContents:()=>i,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(i),mtime:new Date})})}function Ee(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Wt(e,t){let s=As[t],n=s.get(e.key);if(n?.checksum===e.checksum)return n.content;if(s.delete(e.key),!e.value)return;let r=[`/* ${e.key} */`],o=ge(e.value??"",t)?.trimEnd();if(o&&r.push(o),r.length>1){let i=r.join(`
99
- `);return s.set(e.key,{checksum:e.checksum,content:i}),i}}f();import*as Mt from"node:os";function Us(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Mt.networkInterfaces()))for(let a of i??[]){let p=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${p}]`:p;s.add(`${c}${n}`)}return s}function Bs(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Ut(e,t){let s=Us(e,t);return $(n=>{let r=n.node.req.headers.host,o=Bs(r);if(!o||!s.has(o))return N(n,O({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}f();function Bt(){return Jt()}function Cr(){return Jt()}function Jt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Js}from"node:http";async function Gr(e,t){let s=await Ys(e,t);return await Gs(e,s),zs(e,s)}function zs(e,t){let s=ut();s.use(Ut(t.options.host,t.options.port)),s.use(zt(e,t)),s.use(Nt(e,t)),s.use(Ct(e,t)),s.use(Ot(e,t));let n=Js(pt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function Ys(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",p=r??9293,m=Bt(),c=vt(o);return await c.ready(),{session:await Tt(e.id.toString(),s,void 0,n,i),localThemeFileSystem:m,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:p,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function Gs(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Te(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function he(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Re=Ge(mt(),1);import Vs from"node:events";var Ue=new Map,K=new Map;function Yt(e,t){let s=(0,Re.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?K.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):K.delete(e)}function Be(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(q(e))}function Ne(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${E("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,p=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let m of e.localThemeFileSystem.unsyncedFileKeys)if(Be(m)){if(i&&r.test(m)){if(m!==o)continue}else if(a.test(m)){if(p){if(!m.startsWith(`locales/${s}.`))continue}else if(!m.includes(".default."))continue}n[m]=e.localThemeFileSystem.files.get(m)?.value??""}return n}function uo(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=q(r);o(p=>{!en(r)&&Be(r)&&a===".json"&&Yt(r,p),Te(e,t,i,{type:"update",key:r,payload:Qs(r,t)})})},n=({fileKey:r,onSync:o})=>{K.delete(r),Te(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&Yt(o,a)}else o.endsWith(".liquid")&&Zt(i)}))})}var Xs="1",Vt=new Vs;function Se(e){Vt.emit("hot-reload",{...e,version:Xs})}function zt(e,t){return $(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ye(s).searchParams;if(n){let o=dt(s);return Vt.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{_({headline:"Failed to send HotReload event.",body:a.stack})})}),Se({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Re.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?te(o):o.type==="warn"?_(o):o.type==="info"?et(o):_({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===Xt)return k(we()).then(o=>at(s,o,"application/javascript")).catch(o=>N(s,O({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",p=s.path.split("?")[0]??"",m=new URLSearchParams(r);if(m.delete("section_key"),m.delete("section_id"),m.delete("app_block_id"),m.delete("_fd"),m.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let u=t.localThemeFileSystem.files.get(o)?.value;if(!u)return"";c[o]=u}for(let u of l)if(u.endsWith(".json")){for(let[h,T]of K.get(u)??[])if(i.endsWith(`__${T}`)){let v=t.localThemeFileSystem.files.get(u)?.value;v&&(c[u]=v);continue}}}return ce(t.session,{method:s.method,path:p??"/",query:[...m.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:lt(s),replaceExtensionTemplates:he(t)}).then(async l=>{if(!l.ok)throw H("theme-service:hot-reload:section:render-failed"),ae(l);return Q(t,l)}).catch(async l=>{let{status:u,statusText:h,...T}=A(L(l),"Failed to render section on Hot Reload");return H("theme-service:hot-reload:section:render-error"),a||_(T),new Response(null,{status:u,statusText:h})})}})}var ee=(e,t)=>Se({themeId:String(e),type:"full",key:t});function Te(e,t,s,n){let r=()=>ee(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Se({sync:"local",themeId:o,...n}),s(()=>Se({sync:"remote",themeId:o,...n}),r)}function Zs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Re.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of K)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function Qs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?Zs(e,t):[],replaceTemplates:Be(e)?Ne(t):{},updatedFileParts:n&&Zt(n)}}var xe="hot-reload-client",Ks="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",Gt=new RegExp(`<script id="${xe}"[^>]*>[^<]*</script>`),Xt="/@shopify/theme-hot-reload";function We(e,t){return t.options.liveReload==="off"?e.replace(Gt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(Gt,"").replace(/<\/head>/,`<script id="${xe}" src="${Xt}" defer></script></head>`):e.includes(`<script id="${xe}"`)?e:e.replace(/<\/head>/,`<script id="${xe}" src="${Ks}" defer></script></head>`)}function en(e){return e.startsWith("assets/")}function Zt(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ue.get(e.key);if(o?.checksum===e.checksum||(Ue.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),p=e.value,m=(c,l)=>{p=p.replace(l,"");let u=a(l),h=`${c}Tag`;n[h]=!o||u!==o[h],r[h]=u};for(let c of i){let l=ge(e.value??"",c);l&&m(c,l)}return p=a(p.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=p,n.liquid=!o||p!==o.liquid,Ue.set(e.key,r),n}f();var Qt=Ge(mt(),1);function tn(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function Kt(e,t,s){if(tn(s)){let n=E(e,"listings",t,s);if(await P(n))return n}}async function es(e,t){let s=E(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,Qt.parseJSON)(n,null,!0);return r?(r.current=$e(t),JSON.stringify(r,null,2)):n}async function Eo(e,t){let s=E(e,"listings"),n=E(s,t);if(await P(n))return;let o=[];await P(s)&&(o=await C("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${$e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new se(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import sn from"node:events";import{fileURLToPath as nn}from"node:url";var rn=250,ts=["assets/**/*.*","config/**/*.json","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],b={layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Ho(e,t){let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new sn,a=(d,g)=>{i.emit(d,g)},p=t?.notify?new le(t.notify):void 0,m=async d=>{let g=t?.listing?await an(e,d,t.listing):await ue(e,d),y=de(d,g);return s.set(d,M({key:d,checksum:y,value:typeof g=="string"?g:"",attachment:Buffer.isBuffer(g)?g.toString("base64"):""})),g},c=C(ts,{cwd:e,deep:3,ignore:W}).then(d=>Promise.all([wt(e),...d.map(m)])).then(([d])=>{Array.isArray(d)&&o.ignoreFromFile.push(...d)}),l=d=>V(e,d),u=d=>Le([{key:d}],o).length===0;function h(d,g,y,x){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&x===we()){ee(g,x);return}let R=l(x);if(t?.listing&&R.startsWith(`listings/${t.listing}/`)){let S=R.replace(`listings/${t.listing}/`,"");if(S.startsWith("templates/")||S.startsWith("sections/"))R=S;else return}T(R).then(()=>{switch(d){case"add":case"change":return v(d,g,y,R);case"unlink":return Pe(g,y,R,n)}}).catch(S=>{D(`Error handling file event for ${R}: ${S}`)})}function T(d){return p?.notify(d)??Promise.resolve()}let v=(d,g,y,x)=>{if(u(x))return;let R=s.get(x)?.checksum,S=m(x).then(async()=>{let w=s.get(x);if(w)return w.checksum!==R&&r.add(x),{value:w.value||void 0,attachment:w.attachment}}),I=S.then(w=>{if(w)return on(r,n,x,g,y)(w)}).catch(_e(x,"upload"));a(d,{fileKey:x,onContent:w=>{S.then(Y=>{r.has(x)&&w(Y?.value??Y?.attachment??"")}).catch(()=>{})},onSync:(w,Y)=>{I.then(G=>{G?w():Y?.()}).catch(()=>{})}})},Pe=(d,g,y,x)=>{if(u(y))return;x.delete(y),s.delete(y),r.add(y);let R=t?.noDelete?Promise.resolve():gt(Number(d),[y],g).then(async S=>{if(!S[0]?.success)throw new Error(`Failed to delete file "${y}" from remote theme.`);return r.delete(y),ss("delete",y),!0}).catch(S=>(_e(y,"delete")(S),!1));a("unlink",{fileKey:y,onSync:S=>{R.then(I=>{I&&S()}).catch(()=>{})}})},ve=new Set(ts.map(d=>E(e,d.split("/").shift()??"")));return t?.listing&&ve.add(E(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&ve.add(we()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{s.delete(d),await cn(e,d)},write:async d=>{let g=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&g){let y=E("listings",t.listing,d.key),x=E(e,y),R=await P(x);s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),R?await Je(e,{...d,key:y}):await Je(e,d);return}s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Je(e,d)},read:m,applyIgnoreFilters:d=>Le(d,o),addEventListener:(d,g)=>{i.on(d,g)},startWatcher:async(d,g)=>{let{default:y}=await import("./chokidar-5RWEYTNQ.js"),x=y.watch([...ve],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),R=new Map,S=(I,w)=>{let G=`${l(w)}:${I}`,Ye=R.get(G);Ye&&clearTimeout(Ye);let ns=setTimeout(()=>{R.delete(G),h(I,d,g,w)},rn);R.set(G,ns)};x.on("add",S.bind(null,"add")).on("change",S.bind(null,"change")).on("unlink",S.bind(null,"unlink")).on("error",I=>{D(`File watcher error: ${I}`),L("theme-service:file-watcher:error")})}}}function on(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await yt(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ee(n,s),new Error(a.join(`
100
- `))}return t.delete(s)&&ee(n,s),e.delete(s),ss("update",s),!0}}async function Je(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await ln(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function ue(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await P(n)){F(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function an(e,t,s){if(t==="config/settings_data.json")return es(e,s);let n=await Kt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return ue(e,t)}async function cn(e,t){let s=E(e,t);if(!await P(s)){F(`File ${s} can't be removed because it doesn't exist...`);return}await Qe(s)}function Do(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],p=[],m=[],c=[],l=[];return e.forEach(u=>{let h=u.key;h.endsWith(".liquid")?b.sectionLiquidRegex.test(h)?t.push(u):b.blockLiquidRegex.test(h)?c.push(u):b.layoutLiquidRegex.test(h)?l.push(u):s.push(u):b.configSchemaRegex.test(h)?a.push(u):b.configDataRegex.test(h)?p.push(u):b.jsonRegex.test(h)?b.contextualizedJsonRegex.test(h)?i.push(u):b.sectionJsonRegex.test(h)?n.push(u):b.templateJsonRegex.test(h)?r.push(u):o.push(u):b.staticAssetRegex.test(h)&&m.push(u)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:p,staticAssetFiles:m,blockLiquidFiles:c,layoutFiles:l}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml"].includes(U(e))}async function Oo(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function ln(e){let t=dn(e);await P(t)||await Ze(t)}function dn(e){let t=Ve(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ss(e,t){re(ne`• ${ie.format(new Date)} Synced ${j.raw("\xBB")} ${e} ${t}`)}function we(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?E(nn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function de(e,t){return t?Buffer.isBuffer(t)?ze(t):fn(e)?un(t):pn(e,t):""}function un(e){let t=e;return t=t.replace(/\r\n/g,`
99
+ `);return s.set(e.key,{checksum:e.checksum,content:i}),i}}h();import*as Mt from"node:os";function Us(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Mt.networkInterfaces()))for(let a of i??[]){let p=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${p}]`:p;s.add(`${c}${n}`)}return s}function Bs(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Ut(e,t){let s=Us(e,t);return $(n=>{let r=n.node.req.headers.host,o=Bs(r);if(!o||!s.has(o))return N(n,O({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}h();function Bt(){return Jt()}function Cr(){return Jt()}function Jt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Js}from"node:http";async function Gr(e,t){let s=await Ys(e,t);return await Gs(e,s),zs(e,s)}function zs(e,t){let s=ut();s.use(Ut(t.options.host,t.options.port)),s.use(zt(e,t)),s.use(Nt(e,t)),s.use(Ct(e,t)),s.use(Ot(e,t));let n=Js(pt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function Ys(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",p=r??9293,m=Bt(),c=vt(o);return await c.ready(),{session:await Tt(e.id.toString(),s,void 0,n,i),localThemeFileSystem:m,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:p,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function Gs(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Te(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function fe(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Re=Ge(mt(),1);import Vs from"node:events";var Ue=new Map,K=new Map;function Yt(e,t){let s=(0,Re.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?K.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):K.delete(e)}function Be(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(q(e))}function Ne(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${E("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,p=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let m of e.localThemeFileSystem.unsyncedFileKeys)if(Be(m)){if(i&&r.test(m)){if(m!==o)continue}else if(a.test(m)){if(p){if(!m.startsWith(`locales/${s}.`))continue}else if(!m.includes(".default."))continue}n[m]=e.localThemeFileSystem.files.get(m)?.value??""}return n}function uo(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=q(r);o(p=>{!en(r)&&Be(r)&&a===".json"&&Yt(r,p),Te(e,t,i,{type:"update",key:r,payload:Qs(r,t)})})},n=({fileKey:r,onSync:o})=>{K.delete(r),Te(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&Yt(o,a)}else o.endsWith(".liquid")&&Zt(i)}))})}var Xs="1",Vt=new Vs;function Se(e){Vt.emit("hot-reload",{...e,version:Xs})}function zt(e,t){return $(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ye(s).searchParams;if(n){let o=dt(s);return Vt.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{I({headline:"Failed to send HotReload event.",body:a.stack})})}),Se({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Re.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?te(o):o.type==="warn"?I(o):o.type==="info"?et(o):I({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===Xt)return k(we()).then(o=>at(s,o,"application/javascript")).catch(o=>N(s,O({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",p=s.path.split("?")[0]??"",m=new URLSearchParams(r);if(m.delete("section_key"),m.delete("section_id"),m.delete("app_block_id"),m.delete("_fd"),m.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let u=t.localThemeFileSystem.files.get(o)?.value;if(!u)return"";c[o]=u}for(let u of l)if(u.endsWith(".json")){for(let[f,T]of K.get(u)??[])if(i.endsWith(`__${T}`)){let v=t.localThemeFileSystem.files.get(u)?.value;v&&(c[u]=v);continue}}}return ce(t.session,{method:s.method,path:p??"/",query:[...m.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:lt(s),replaceExtensionTemplates:fe(t)}).then(async l=>{if(!l.ok)throw H("theme-service:hot-reload:section:render-failed"),ae(l);return Q(t,l)}).catch(async l=>{let{status:u,statusText:f,...T}=A(L(l),"Failed to render section on Hot Reload");return H("theme-service:hot-reload:section:render-error"),a||I(T),new Response(null,{status:u,statusText:f})})}})}var ee=(e,t)=>Se({themeId:String(e),type:"full",key:t});function Te(e,t,s,n){let r=()=>ee(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Se({sync:"local",themeId:o,...n}),s(()=>Se({sync:"remote",themeId:o,...n}),r)}function Zs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Re.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of K)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function Qs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?Zs(e,t):[],replaceTemplates:Be(e)?Ne(t):{},updatedFileParts:n&&Zt(n)}}var xe="hot-reload-client",Ks="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",Gt=new RegExp(`<script id="${xe}"[^>]*>[^<]*</script>`),Xt="/@shopify/theme-hot-reload";function We(e,t){return t.options.liveReload==="off"?e.replace(Gt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(Gt,"").replace(/<\/head>/,`<script id="${xe}" src="${Xt}" defer></script></head>`):e.includes(`<script id="${xe}"`)?e:e.replace(/<\/head>/,`<script id="${xe}" src="${Ks}" defer></script></head>`)}function en(e){return e.startsWith("assets/")}function Zt(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ue.get(e.key);if(o?.checksum===e.checksum||(Ue.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),p=e.value,m=(c,l)=>{p=p.replace(l,"");let u=a(l),f=`${c}Tag`;n[f]=!o||u!==o[f],r[f]=u};for(let c of i){let l=ge(e.value??"",c);l&&m(c,l)}return p=a(p.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=p,n.liquid=!o||p!==o.liquid,Ue.set(e.key,r),n}h();var Qt=Ge(mt(),1);function tn(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function Kt(e,t,s){if(tn(s)){let n=E(e,"listings",t,s);if(await P(n))return n}}async function es(e,t){let s=E(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,Qt.parseJSON)(n,null,!0);return r?(r.current=$e(t),JSON.stringify(r,null,2)):n}async function Eo(e,t){let s=E(e,"listings"),n=E(s,t);if(await P(n))return;let o=[];await P(s)&&(o=await C("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${$e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new se(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import sn from"node:events";import{fileURLToPath as nn}from"node:url";var rn=250,ts=["assets/**/*.*","config/**/*.json","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],b={layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Ho(e,t){let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new sn,a=(d,g)=>{i.emit(d,g)},p=t?.notify?new le(t.notify):void 0,m=async d=>{let g=t?.listing?await an(e,d,t.listing):await ue(e,d),y=de(d,g);return s.set(d,M({key:d,checksum:y,value:typeof g=="string"?g:"",attachment:Buffer.isBuffer(g)?g.toString("base64"):""})),g},c=C(ts,{cwd:e,deep:3,ignore:W}).then(d=>Promise.all([wt(e),...d.map(m)])).then(([d])=>{Array.isArray(d)&&o.ignoreFromFile.push(...d)}),l=d=>V(e,d),u=d=>Le([{key:d}],o).length===0;function f(d,g,y,x){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&x===we()){ee(g,x);return}let R=l(x);if(t?.listing&&R.startsWith(`listings/${t.listing}/`)){let S=R.replace(`listings/${t.listing}/`,"");if(S.startsWith("templates/")||S.startsWith("sections/"))R=S;else return}T(R).then(()=>{switch(d){case"add":case"change":return v(d,g,y,R);case"unlink":return Pe(g,y,R,n)}}).catch(S=>{D(`Error handling file event for ${R}: ${S}`)})}function T(d){return p?.notify(d)??Promise.resolve()}let v=(d,g,y,x)=>{if(u(x))return;let R=s.get(x)?.checksum,S=m(x).then(async()=>{let w=s.get(x);if(w)return w.checksum!==R&&r.add(x),{value:w.value||void 0,attachment:w.attachment}}),_=S.then(w=>{if(w)return on(r,n,x,g,y)(w)}).catch(Ie(x,"upload"));a(d,{fileKey:x,onContent:w=>{S.then(Y=>{r.has(x)&&w(Y?.value??Y?.attachment??"")}).catch(()=>{})},onSync:(w,Y)=>{_.then(G=>{G?w():Y?.()}).catch(()=>{})}})},Pe=(d,g,y,x)=>{if(u(y))return;x.delete(y),s.delete(y),r.add(y);let R=t?.noDelete?Promise.resolve():gt(Number(d),[y],g).then(async S=>{if(!S[0]?.success)throw new Error(`Failed to delete file "${y}" from remote theme.`);return r.delete(y),ss("delete",y),!0}).catch(S=>(Ie(y,"delete")(S),!1));a("unlink",{fileKey:y,onSync:S=>{R.then(_=>{_&&S()}).catch(()=>{})}})},ve=new Set(ts.map(d=>E(e,d.split("/").shift()??"")));return t?.listing&&ve.add(E(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&ve.add(we()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{s.delete(d),await cn(e,d)},write:async d=>{let g=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&g){let y=E("listings",t.listing,d.key),x=E(e,y),R=await P(x);s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),R?await Je(e,{...d,key:y}):await Je(e,d);return}s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Je(e,d)},read:m,applyIgnoreFilters:d=>Le(d,o),addEventListener:(d,g)=>{i.on(d,g)},startWatcher:async(d,g)=>{let{default:y}=await import("./chokidar-5RWEYTNQ.js"),x=y.watch([...ve],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),R=new Map,S=(_,w)=>{let G=`${l(w)}:${_}`,Ye=R.get(G);Ye&&clearTimeout(Ye);let ns=setTimeout(()=>{R.delete(G),f(_,d,g,w)},rn);R.set(G,ns)};x.on("add",S.bind(null,"add")).on("change",S.bind(null,"change")).on("unlink",S.bind(null,"unlink")).on("error",_=>{D(`File watcher error: ${_}`),L("theme-service:file-watcher:error")})}}}function on(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await yt(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ee(n,s),new Error(a.join(`
100
+ `))}return t.delete(s)&&ee(n,s),e.delete(s),ss("update",s),!0}}async function Je(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await ln(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function ue(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await P(n)){F(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function an(e,t,s){if(t==="config/settings_data.json")return es(e,s);let n=await Kt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return ue(e,t)}async function cn(e,t){let s=E(e,t);if(!await P(s)){F(`File ${s} can't be removed because it doesn't exist...`);return}await Qe(s)}function Do(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],p=[],m=[],c=[],l=[];return e.forEach(u=>{let f=u.key;f.endsWith(".liquid")?b.sectionLiquidRegex.test(f)?t.push(u):b.blockLiquidRegex.test(f)?c.push(u):b.layoutLiquidRegex.test(f)?l.push(u):s.push(u):b.configSchemaRegex.test(f)?a.push(u):b.configDataRegex.test(f)?p.push(u):b.jsonRegex.test(f)?b.contextualizedJsonRegex.test(f)?i.push(u):b.sectionJsonRegex.test(f)?n.push(u):b.templateJsonRegex.test(f)?r.push(u):o.push(u):b.staticAssetRegex.test(f)&&m.push(u)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:p,staticAssetFiles:m,blockLiquidFiles:c,layoutFiles:l}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml"].includes(U(e))}async function Oo(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function ln(e){let t=dn(e);await P(t)||await Ze(t)}function dn(e){let t=Ve(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ss(e,t){re(ne`• ${ie.format(new Date)} Synced ${j.raw("\xBB")} ${e} ${t}`)}function we(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?E(nn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function de(e,t){return t?Buffer.isBuffer(t)?ze(t):hn(e)?un(t):pn(e,t):""}function un(e){let t=e;return t=t.replace(/\r\n/g,`
101
101
  `),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=mn(t),ze(t)}function pn(e,t){let s=t;return Fe(e)&&(s=s.replace(/\r\n/g,`
102
102
  `)),ze(s)}function mn(e){let t=!1,s=!1,n="";for(let r of e)r==='"'&&!s&&(t=!t),!(!t&&(r===" "||r===`
103
- `))&&(n+=r,s=r==="\\"&&!s);return n}function ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Ke(t)}function Bo(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function fn(e){return e.endsWith("/settings_data.json")}export{Bo as a,Ct as b,Ot as c,Nt as d,Ut as e,Cr as f,Gr as g,uo as h,zt as i,ee as j,Eo as k,Ho as l,Do as m,Oo as n};
103
+ `))&&(n+=r,s=r==="\\"&&!s);return n}function ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Ke(t)}function Bo(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function hn(e){return e.endsWith("/settings_data.json")}export{Bo as a,Ct as b,Ot as c,Nt as d,Ut as e,Cr as f,Gr as g,uo as h,zt as i,ee as j,Eo as k,Ho as l,Do as m,Oo as n};
@@ -0,0 +1,8 @@
1
+ import{a as u}from"./chunk-CZPGC2E7.js";import{a as y}from"./chunk-DQCIORGH.js";import{a as w}from"./chunk-KOVAFUYN.js";import{a as v,b as f}from"./chunk-YY6TFARF.js";import{p as d,v as c}from"./chunk-OORWOTAP.js";import{b as p}from"./chunk-JJJTPEMD.js";import{N as m,y as s}from"./chunk-GMTNOCMS.js";import{a as E}from"./chunk-CTNBSUVU.js";import{e as T,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function g(t,e){let r=new u(t),F=(await(e.development?r.find():r.fetch()))?.id,n=await y(t,{header:"Select a theme to open",filter:{live:e.live,theme:e.development?`${F}`:e.theme}}),l=v(n,t),a=f(n,t);s({body:["Preview information for theme",...w(n),`
2
+
3
+ `,{list:{items:[{link:{label:"Preview your theme",url:l}},{link:{label:"Customize your theme at the theme editor",url:a}}]}}]}),e.editor?await m(a):await m(l)}var o=T(E(),1);var h=class extends c{static summary="Opens the preview of your remote theme.";static descriptionWithMarkdown=`Returns links that let you preview the specified theme. The following links are returned:
4
+
5
+ - A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin.
6
+ - A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with other developers.
7
+
8
+ If you don't specify a theme, then you're prompted to select the theme to open from the list of the themes in your store.`;static description=this.descriptionWithoutMarkdown();static flags={...p,...d,development:o.Flags.boolean({char:"d",description:"Open your development theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),editor:o.Flags.boolean({char:"E",description:"Open the theme editor for the specified theme in the browser.",env:"SHOPIFY_FLAG_EDITOR"}),live:o.Flags.boolean({char:"l",description:"Open your live (published) theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_LIVE"}),theme:o.Flags.string({char:"t",description:"Theme ID or name of the remote theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_THEME_ID"})};static multiEnvironmentsFlags=null;static nonTTYFlagRequirements(){return[{flags:["theme","development","live"]}]}async command(e,r){await g(r,e)}};export{h as a};
@@ -0,0 +1,18 @@
1
+ import{c as ee,e as ne,f as te,g as oe}from"./chunk-V5SC2RYQ.js";import{a as J,c as Z,d as Q,e as X}from"./chunk-TY4W7AYX.js";import{b as I}from"./chunk-CZJZCJRX.js";import{a as q}from"./chunk-NEMPLS7C.js";import{a as j}from"./chunk-KUNDCAQN.js";import{D as G,G as K,V as W,g as Y,sa as H}from"./chunk-ACTDYTAV.js";import{a as z}from"./chunk-U6HYEGAE.js";import{b as V}from"./chunk-JJJTPEMD.js";import{E as U,H as B,M as $,x as O,y as F,z as M}from"./chunk-GMTNOCMS.js";import{d as L}from"./chunk-JQISGC7D.js";import{h,j as N}from"./chunk-R2R6JDNH.js";import{a as ce}from"./chunk-CTNBSUVU.js";import{Ca as R,Cb as C,L as D,rb as S,wa as E,xb as A}from"./chunk-Y34LWI3S.js";import{d as x,i as T}from"./chunk-773TIA5M.js";import{e as pe,g}from"./chunk-VKWPEFWQ.js";g();g();g();async function ie(e){let n,t;e.bundlePath&&(n=await X(e.developerPlatformClient,{id:e.apiKey,apiKey:e.apiKey,organizationId:e.organizationId}),await Q(n,e.bundlePath));let o={appManifest:e.appManifest,appId:e.appId,apiKey:e.apiKey,name:e.name,organizationId:e.organizationId,skipPublish:!e.release,message:e.message,versionTag:e.version,commitReference:e.commitReference};n&&(o.bundleUrl=n),e.appModules.length>0&&(o.appModules=e.appModules);let a=await e.developerPlatformClient.deploy(o);if(!a.appDeploy.appVersion){let i=ue(a.appDeploy.userErrors??[],e.appModuleRegistrationIds,e.appModules,{version:e.version});throw new h({bold:"Version couldn't be created."},null,[],i)}return a.appDeploy.userErrors?.length>0&&(t=a.appDeploy.userErrors.map(i=>i.message).join(", ")),{validationErrors:a.appDeploy.appVersion.appModuleVersions.filter(i=>i.validationErrors.length>0).map(i=>({uuid:i.registrationUuid,errors:i.validationErrors})),versionTag:a.appDeploy.appVersion.versionTag,location:a.appDeploy.appVersion.location,message:a.appDeploy.appVersion.message,deployError:t}}var v=`
2
+ Validation errors`,k=`
3
+ `;function ue(e,n,t,o={}){let a=l=>l.details?.some(y=>y.extension_id)??!1,s=(l,y)=>{let b=l.details?.find(_=>typeof _.extension_id<"u")?.extension_id??"";return Object.values(y).includes(b.toString())},i=l=>{let y=l.on?l.on[0]:void 0;return t.some(b=>b.uid===y?.user_identifier)},[d,u]=I(e,l=>i(l)),[p,c]=I(u,l=>a(l)),[f,r]=I(p,l=>s(l,n));return[...me(c,{version:o.version}),...fe(f,n),...he(r),...ge(d,t)]}function me(e,n={}){return e.length>0?e.filter(t=>t.field&&t.field.includes("version_tag")&&t.message==="has already been taken").length>0&&n.version?[{body:["An app version with the name",{userInput:n.version},"already exists. Deploy again with a different version name."]}]:e.length===1?[{body:e[0]?.message??""}]:[{body:{list:{items:e.map(t=>t.message)}}}]:[]}function fe(e,n){return e.reduce((t,o)=>{let a=(o.field??["unknown"]).join(".").replace("extension_points","extensions.targeting"),s=a==="base"?o.message:`${a}: ${o.message}`,i=o.details.find(r=>typeof r.extension_title<"u")?.extension_title,d=o.details.find(r=>typeof r.specification_identifier<"u")?.specification_identifier,u=o.details.find(r=>typeof r.extension_id<"u")?.extension_id?.toString(),c=Object.keys(n).find(r=>n[r]===u)??i;d==="webhook_subscription"&&(c="Webhook Subscription");let f=t.find(r=>r.title===c);if(f){let r=f.body,m=o.category==="invalid"?r.find(l=>l.list.title===v):r.find(l=>l.list.title===k);m?m.list.items.includes(s)||m.list.items.push(s):r.push({list:{title:o.category==="invalid"?v:k,items:[s]}})}else t.push({title:c,body:[{list:{title:o.category==="invalid"?v:k,items:[s]}}]});return t.forEach(r=>{r.body.sort((m,l)=>m.list.title===v?1:l.list.title===v?-1:0)}),t},[])}function ge(e,n){return e.reduce((t,o)=>{let s=(o.on?o.on[0]:void 0)?.user_identifier,i=n.find(r=>r.uid===s),d=s?`Extension with uid: ${s}`:"Unknown Extension",u=i?.handle??d,c=`${(o.field??["unknown"]).join(".")}: ${o.message}`,f=t.find(r=>r.title===u);if(f){let m=f.body.find(l=>l.list.title===v);m&&(m.list.items.includes(c)||m.list.items.push(c))}else t.push({title:u,body:[{list:{title:v,items:[c]}}]});return t},[])}function he(e){return e.reduce((n,t)=>{let o=t.details.find(s=>typeof s.extension_title<"u")?.extension_title,a=n.find(s=>s.title===o);return a?a.errorCount+=1:n.push({title:o,errorCount:1}),n},[]).map(n=>({title:n.title,body:`
4
+ ${n.errorCount} error${n.errorCount>1?"s":""} found in your extensions. Fix these issues and try deploying again.`}))}g();async function ae(e){let n=x(e.app.directory,".shopify","deploy-bundle");await R(n,{force:!0}),await E(n),await J(e.appManifest,n),e.skipBuild||await Y(e.app);let t=e.app.allExtensions.map(a=>({prefix:a.localIdentifier,action:async(s,i,d)=>{await a.buildForBundle({stderr:i,stdout:s,signal:d,app:e.app,environment:"production",skipBuild:e.skipBuild},n)}}));if(await O({processes:t,showTimestamps:!1}),e.app.allExtensions.some(a=>a.hasDeploySteps))return await Z(n,e.bundlePath),e.bundlePath}async function ye(e){let{app:n,remoteApp:t,developerPlatformClient:o,noRelease:a,allowUpdates:s,allowDeletes:i,extensions:d}=e,u=[a,s,i].some(Boolean),p=[`App can't be deployed until Partner Dashboard managed extensions are added to your version or removed from your app:
5
+ `,d.map(m=>` - ${m.title}`).join(`
6
+ `)],c=[`
7
+
8
+ Run `,{command:"shopify app import-extensions"}," to add legacy extensions."];if(u||!$())throw new h(p,c);let f=[`
9
+
10
+ Run `,{command:"shopify app import-extensions"}," to add legacy extensions now?"];if(await U({message:[...p,...f],confirmationMessage:"Yes, add legacy extensions and deploy",cancellationMessage:"No, don't add legacy extensions"}))return await te({app:n,remoteApp:t,developerPlatformClient:o,extensions:d}),G(n);throw new N}async function we(e){let{app:n,remoteApp:t,developerPlatformClient:o}=e,a=await oe({developerPlatformClient:o,apiKey:t.apiKey,organizationId:t.organizationId,extensionTypes:ee,onlyDashboardManaged:!0}),s=ne(e.app,a);return s.length===0?n:ye({...e,extensions:s})}async function se(e){let{remoteApp:n,developerPlatformClient:t,noRelease:o,allowUpdates:a,allowDeletes:s}=e,i=await we({app:e.app,remoteApp:n,developerPlatformClient:t,noRelease:o,allowUpdates:a,allowDeletes:s}),{deployIdentifiers:d,didMigrateExtensionsToDevDash:u}=await W({...e,app:i,developerPlatformClient:t,allowUpdates:a,allowDeletes:s}),p=!o,c=n.apiKey;C(),p?A(`Releasing a new app version as part of ${n.title}`):A(`Creating a new app version as part of ${n.title}`),C();let f,r=x(e.app.directory,".shopify",`deploy-bundle.${t.bundleFormat}`);await E(T(r));let m=await i.manifest(be(i,d.appModuleUuids)),l=await ae({app:i,appManifest:m,bundlePath:r,skipBuild:e.skipBuild}),y;return p?y="Releasing an app version":y="Creating an app version",await B([{title:"Running validation",task:async()=>{await i.preDeployValidation()}},{title:y,task:async()=>{let _=await Promise.all(i.allExtensions.flatMap(de=>de.bundleConfig({appModuleUuids:d.appModuleUuids,developerPlatformClient:t,apiKey:c,appConfiguration:i.configuration})));f=await ie({appManifest:m,appId:n.id,apiKey:c,name:i.name,organizationId:n.organizationId,bundlePath:l,appModules:D(_),release:p,developerPlatformClient:t,appModuleRegistrationIds:d.appModuleRegistrationIds,message:e.message,version:e.version,commitReference:e.commitReference})}}]),await ve({app:i,project:e.project,release:p,uploadExtensionsBundleResult:f,didMigrateExtensionsToDevDash:u}),{app:i}}async function ve({app:e,project:n,release:t,uploadExtensionsBundleResult:o,didMigrateExtensionsToDevDash:a}){let s=[{link:{label:o.versionTag??"version",url:o.location}},o.message?`
11
+ ${o.message}`:""],i=[];if(a){let d=await K(e.directory),u=Object.values(d).filter(c=>c!==d[e.configuration.client_id]),p=[];u.length>0&&p.push("\u2022 Map extension IDs to other copies of your app by running",{command:S(n.packageManager,"shopify app deploy")},"for: ",{list:{items:u}}),p.push("\u2022 Commit to source control to ensure your extension IDs aren't regenerated on the next deploy."),i=[{title:"Next steps",body:p},{title:"Reference",body:["\u2022 ",{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}]}return t?o.deployError?F({headline:"New version created, but not released.",body:[...s,`
12
+
13
+ ${o.deployError}`],customSections:i}):M({headline:"New version released to users.",body:s,customSections:i}):M({headline:"New version created.",body:s,customSections:i,nextSteps:[["Run",{command:S(n.packageManager,"shopify app release",`--version=${o.versionTag}`)},"to release this version to users."]]})}function be(e,n){return Object.fromEntries(e.allExtensions.filter(t=>t.isUUIDStrategyExtension).map(t=>[t.localIdentifier,n[t.localIdentifier]]))}g();function re(e){if(typeof e>"u")return;let n=["Invalid version name:",{userInput:e}],t=100;if(e.length>t)throw new h(n,`Version name must be ${t} characters or less.`);let o=[".",".."];if(o.find(s=>e===s))throw new h(n,`Version name may not be any of: ${o.map(s=>`'${s}'`).join(" , ")}`);let a=/^[a-zA-Z0-9.\-_]+$/;if(!e.match(a))throw new h(n,["Version name can only contain alphanumeric characters, periods, hyphens, and underscores"])}g();function le(e){if(typeof e>"u")return;let n=["Invalid message:",{userInput:e}],t=200;if(e.length>t)throw new h(n,`Message name must be ${t} characters or less.`)}var w=pe(ce(),1);var P=class e extends q{static summary="Deploy your Shopify app.";static descriptionWithMarkdown=`[Builds the app](https://shopify.dev/docs/api/shopify-cli/app/app-build), then deploys your app configuration and extensions.
14
+
15
+ This command creates an app version, which is a snapshot of your app configuration and all extensions. This version is then released to users.
16
+
17
+ This command doesn't deploy your [web app](https://shopify.dev/docs/apps/tools/cli/structure#web-components). You need to [deploy your web app](https://shopify.dev/docs/apps/deployment/web) to your own hosting solution.
18
+ `;static description=this.descriptionWithoutMarkdown();static flags={...V,...j,"allow-updates":w.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. In non-interactive environments, provide this flag, --allow-deletes, or --no-release.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":w.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. In non-interactive environments, provide this flag, --allow-updates, or --no-release.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),"no-release":w.Flags.boolean({hidden:!1,description:"Creates a version but doesn't release it - it's not made available to merchants. With this flag, a user confirmation is not required. In non-interactive environments, provide this flag, --allow-updates, or --allow-deletes.",env:"SHOPIFY_FLAG_NO_RELEASE",default:!1,exclusive:["allow-updates","allow-deletes"]}),"no-build":w.Flags.boolean({description:"Use with caution: Skips building any elements of the app that require building. You should ensure your app has been prepared in advance, such as by running `shopify app build` or by caching build artifacts.",env:"SHOPIFY_FLAG_NO_BUILD",default:!1}),message:w.Flags.string({hidden:!1,description:"Optional message that will be associated with this version. This is for internal use only and won't be available externally.",env:"SHOPIFY_FLAG_MESSAGE"}),version:w.Flags.string({hidden:!1,description:"Optional version tag that will be associated with this app version. If not provided, an auto-generated identifier will be generated for this app version.",env:"SHOPIFY_FLAG_VERSION"}),"source-control-url":w.Flags.string({hidden:!1,description:"URL associated with the new app version.",env:"SHOPIFY_FLAG_SOURCE_CONTROL_URL"})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes","no-release"]}]}async run(){let{flags:n}=await this.parse(e);await z.addPublicMetadata(()=>({cmd_deploy_flag_message_used:!!n.message,cmd_deploy_flag_version_used:!!n.version,cmd_deploy_flag_source_url_used:!!n["source-control-url"]})),re(n.version),le(n.message);let t=n["client-id"];await L(()=>({cmd_app_reset_used:n.reset}));let{app:o,project:a,remoteApp:s,developerPlatformClient:i,organization:d}=await H({directory:n.path,clientId:t,forceRelink:n.reset,userProvidedConfigName:n.config}),u=n["no-release"]||n["allow-updates"],p=n["no-release"]||n["allow-deletes"];return{app:(await se({app:o,project:a,remoteApp:s,organization:d,developerPlatformClient:i,reset:n.reset,allowUpdates:u,allowDeletes:p,noRelease:n["no-release"],message:n.message,version:n.version,commitReference:n["source-control-url"],skipBuild:n["no-build"]})).app}}};export{P as a};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-TSLQZTXR.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
@@ -0,0 +1,4 @@
1
+ import{a as f}from"./chunk-NEMPLS7C.js";import{a as o}from"./chunk-KUNDCAQN.js";import{pa as c,sa as s}from"./chunk-ACTDYTAV.js";import{b as n,f as r}from"./chunk-JJJTPEMD.js";import{a as u}from"./chunk-CTNBSUVU.js";import{e as g,g as a}from"./chunk-VKWPEFWQ.js";a();var i=g(u(),1);var t=class p extends f{static summary="Fetch your app configuration from the Developer Dashboard.";static descriptionWithMarkdown=`Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a new app with this command to start with a default configuration file.
2
+
3
+ For more information on the format of the created TOML configuration file, refer to the [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration) page.
4
+ `;static description=this.descriptionWithoutMarkdown();static flags={...n,...o,"organization-id":i.Flags.string({hidden:!0,env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]}),"client-id":r(o["client-id"]),"file-name":i.Flags.string({hidden:!1,description:"The name of the app configuration file to create or overwrite.",env:"SHOPIFY_FLAG_APP_CONFIG_FILE_NAME",exclusive:["config"]}),force:i.Flags.boolean({hidden:!1,description:"Overwrite an existing configuration file without prompting.",env:"SHOPIFY_FLAG_FORCE",dependsOn:["file-name"]})};async run(){let{flags:e}=await this.parse(p),d={directory:e.path,apiKey:e["client-id"],organizationId:e["organization-id"],configName:e.config,fileName:e["file-name"],force:e.force??!1},l=await c(d),{app:m}=await s({directory:e.path,clientId:void 0,forceRelink:!1,userProvidedConfigName:l.configFileName});return{app:m}}};export{t as a};
@@ -0,0 +1,3 @@
1
+ import{a as oe}from"./chunk-6VRXGEIW.js";import{d as ie}from"./chunk-JJJTPEMD.js";import{a as ne,b as se}from"./chunk-RY2SJVWM.js";import{Aa as V,C as w,J as C,S as L,a as K,xa as Q,za as U}from"./chunk-YN6A26QL.js";import{e as x}from"./chunk-AGOEROAI.js";import{A as N,B as I,E as te,a as W,x as ee}from"./chunk-GMTNOCMS.js";import{d as X,e as Z}from"./chunk-JQISGC7D.js";import{h as F,k as re}from"./chunk-R2R6JDNH.js";import{a as Ie}from"./chunk-CTNBSUVU.js";import{Ab as h,Fa as J,Ua as _,qb as R,sb as l}from"./chunk-Y34LWI3S.js";import{d as z,f as k,i as Y,q as $}from"./chunk-773TIA5M.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var q={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?J(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${Y(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},ae="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var pe=new _e,ce,ue,me,de;function S(){return ce??=new x({projectName:"shopify-cli-theme-conf"}),ce}function O(){return ue??=new x({projectName:"shopify-cli-development-theme-config"}),ue}function j(){return me??=new x({projectName:"shopify-cli-repl-theme-config"}),me}function D(){return de??=new x({projectName:"shopify-cli-theme-store-password"}),de}function M(t=S()){return pe.getStore()?.store??t.get("themeStore")}function fe(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),O().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),O().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),O().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),j().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),j().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),j().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),D().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),D().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),D().delete(e)}function v(t=S()){let e=M(t);if(!e)throw new re("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function he(t,e){return pe.run({store:t},e)}function le(t){let e=t.store??M();if(!e)throw Q(new F("A store is required",`Specify the store passing ${l`${R.genericShellCommand(`--${q.store.name}=example.myshopify.com`)}`.value} or set the ${l`${R.genericShellCommand(q.store.env)}`.value} environment variable.`));return fe(e),e}f();f();var Se="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var B="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,ge;function P(){return ge??=new x({projectName:Fe}),ge}function b(t){return`${B}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function G(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${B}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=G(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=G(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=G(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var H=class extends se{static baseFlags=ie;environmentsFilename(){return Se}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(U(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){N({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(ne(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await oe(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),te(s)}async runConcurrent(e){let o=new W,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await ee({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await he(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();U(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
2
+
3
+ ${A.message}`,I({body:[A.message]}))}}})),abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}createSequentialGroups(e){let o=[];return e.forEach(r=>{let n=o.find(i=>!i.some(s=>s.flags.store===r.flags.store));n?n.push(r):o.push([r])}),o}async createSession(e,o){let r=le({store:e.store}),n=e.password;return n?await L(r,n):o??await this.storeAuthSessionForTheme({store:r})??await L(r,n)}async storeAuthSessionForTheme(e){let o=this.storeAuthScopes();if(!o)return;let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!r||n)return;let i=w(r),s=Ae(i);if(s)return this.adminSessionFromStoreAuthSession(s,i,o)}storeAuthSessionsForTheme(e){let o=this.storeAuthScopes();if(!o)return new Map;let r=new Set(e.filter(({store:n,password:i})=>typeof n=="string"&&!i).map(({store:n})=>w(n)));return r.size===0?new Map:new Map(we().map(n=>{let i=w(n.store);if(!r.has(i))return;let s=this.adminSessionFromStoreAuthSession(n,i,o);return s?[i,s]:void 0}).filter(n=>n!==void 0))}storeAuthSessionFromCache(e,o){let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!(!r||n))return o.get(w(r))}adminSessionFromStoreAuthSession(e,o,r){if(ve(e)){h(`Ignoring stored store auth session for ${o}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){h(`Ignoring stored store auth session for ${o}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return h(`Using stored store auth session for ${o} (scopes: ${e.scopes.join(", ")}).`),C(e.userId),{token:e.accessToken,storeFqdn:o}}expandImpliedStoreAuthScopes(e){let o=new Set(e);for(let r of e){let n=r.match(/^(unauthenticated_)?write_(.*)$/);n&&o.add(`${n[1]??""}read_${n[2]}`)}return o}hasRequiredStoreAuthScopes(e,o){let r=this.expandImpliedStoreAuthScopes(e);return o.every(n=>r.has(n))}validConfig(e,o,r,n){let i=o.filter(s=>Array.isArray(s)?!s.some(a=>this.hasRequiredFlag(e,a,n)):!this.hasRequiredFlag(e,s,n)).map(s=>Array.isArray(s)?s.join(" or "):s);return i.length>0?(N({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:i}}]}),i):!0}hasRequiredFlag(e,o,r){return o==="password"&&r?!0:!!e[o]}errorOnGlobalPath(){let e=z($(),"shopify.theme.toml"),o=_(e);I({body:["Can't use `--path` flag with multiple environments.",...o?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."]]})}async logAnalyticsData(e){if(!e)return;let o=V();await X(()=>({store_fqdn_hash:K(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(o.timings),cmd_theme_errors:JSON.stringify(o.errors),cmd_theme_retries:JSON.stringify(o.retries),cmd_theme_events:JSON.stringify(o.events)})),await Z(()=>({store_fqdn:e.storeFqdn}))}};export{B as a,we as b,Ae as c,wt as d,At as e,M as f,He as g,ze as h,Ye as i,Je as j,We as k,Ke as l,Qe as m,Ve as n,Xe as o,q as p,qe as q,le as r,ct as s,ut as t,mt as u,H as v};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-TSLQZTXR.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
@@ -0,0 +1 @@
1
+ import{a as d,b as f,c as g,d as x,g as C}from"./chunk-V5SC2RYQ.js";import{a as c}from"./chunk-NEMPLS7C.js";import{a as l}from"./chunk-KUNDCAQN.js";import{sa as m}from"./chunk-ACTDYTAV.js";import{b as p}from"./chunk-JJJTPEMD.js";import{z as s}from"./chunk-GMTNOCMS.js";import{a as I}from"./chunk-CTNBSUVU.js";import{e as y,g as r}from"./chunk-VKWPEFWQ.js";r();var h=y(I(),1);var o=class u extends c{static description="Import dashboard-managed extensions into your app.";static flags={...p,...l,"client-id":h.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};async run(){let{flags:i}=await this.parse(u),e=await m({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),t=await C({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=d(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let a=await f(n);await x({...e,extensions:t,extensionTypes:a.extensionTypes,buildExtensionConfig:a.buildExtensionConfig})}return{app:e.app}}};export{o as a};
@@ -0,0 +1 @@
1
+ import{a as l,c as b,d as D,e as _}from"./chunk-ZCNIR6YU.js";import{g as T,p as y,v as O}from"./chunk-OORWOTAP.js";import{b as L,c as S}from"./chunk-JJJTPEMD.js";import{e as d}from"./chunk-AGOEROAI.js";import{y as v}from"./chunk-GMTNOCMS.js";import{a as G}from"./chunk-CTNBSUVU.js";import{Ab as a,sb as s,wb as F}from"./chunk-Y34LWI3S.js";import{e as $,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();var w;function f(){return w??=new d({projectName:"shopify-cli-host-theme-conf"}),w}function E(t){return a(s`Getting host theme...`),f().get(t)}function Y(t,e){a(s`Setting host theme...`),f().set(t,e)}function C(t){a(s`Removing host theme...`),f().delete(t)}function j(t,e){return{title:t,body:{tabularData:e}}}async function I(t,e){let r=e.storeFqdn,p=new _({...l.reduce((n,i)=>(n[i]=t.role===i,n),{}),theme:t.id?.toString()??t.name}),m=await b(e),x=T(),H=E(r);if(p.any()&&(m=D(r,m,p)),t.json)return F(JSON.stringify(m,null,2));let A=m.map(({id:n,name:i,role:g})=>{let c="";return g&&(c=`[${g}]`,[x,H].includes(`${n}`)&&(c+=" [current]")),[i,c,`#${n}`]}),R=[["name","role","id"],["\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],...A];v({customSections:[...t.environment?[{title:`${r} theme library`,body:[{subdued:`Environment name: ${t.environment}`}]}]:[],j("",R)]})}var h=$(G(),1);var u=class extends O{static description="Lists the themes in your store, along with their IDs and statuses.";static flags={...L,...S,...y,role:h.Flags.custom({description:"Only list themes with the given role.",options:l,env:"SHOPIFY_FLAG_ROLE"})(),name:h.Flags.string({description:"Only list themes that contain the given name.",env:"SHOPIFY_FLAG_NAME"}),id:h.Flags.integer({description:"Only list theme with the given ID.",env:"SHOPIFY_FLAG_ID"})};static multiEnvironmentsFlags=["store","password"];async command(e,r){await I(e,r)}};export{E as a,Y as b,C as c,u as d};
@@ -1 +1 @@
1
- import{o as n}from"./chunk-G7QW5OSQ.js";import{D as s}from"./chunk-6YCGMS7X.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
1
+ import{o as n}from"./chunk-KK24VGVE.js";import{H as s}from"./chunk-GMTNOCMS.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
@@ -1,4 +1,4 @@
1
- import{a as kw,b as h4,c as m4}from"./chunk-F3TMLDLC.js";import{a as Iw}from"./chunk-IWOTLFOY.js";import{a as d4}from"./chunk-FFSDGRAN.js";import{wa as p4,xa as xw}from"./chunk-EZ7EBYDT.js";import{g as ww}from"./chunk-ZTE46E4Z.js";import{q as Sw}from"./chunk-TR4OWSEX.js";import{a as ae,b as Ae,c as T,d as Xm,e as ia,f as Zm,g as y}from"./chunk-VKWPEFWQ.js";var tg=T(eg=>{"use strict";y();Object.defineProperty(eg,"__esModule",{value:!0});eg.deepGet=g4;function g4(t,e){return e.reduce((r,i)=>r?.[i],t)}});var Aw=T(rs=>{"use strict";y();Object.defineProperty(rs,"__esModule",{value:!0});rs.first=y4;rs.last=_4;rs.findLast=v4;rs.findLastIndex=rg;rs.findLastAndIndex=b4;function y4(t){return t[0]}function _4(t,e=0){return t[t.length-1+e]}function v4(t,e){return t[rg(t,e)]}function rg(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}function b4(t,e){let r=rg(t,e);return[t[r],r]}});var Ew=T(($ie,Tw)=>{"use strict";y();var S4=kw();Tw.exports=function(e){return e!=null&&typeof e=="object"&&S4(e)===!1}});var ig=T((Gie,Ow)=>{"use strict";y();var w4=kw(),x4=Ew(),Hie=Array.prototype.slice;Ow.exports=na;function na(t,e){if(!(this instanceof na))return typeof e=="number"?new na(t).fromIndex(e):new na(t,e);this.str=t||"",this.lineToIndex=k4(this.str),e=e||{},this.origin=typeof e.origin>"u"?1:e.origin}na.prototype.fromIndex=function(t){if(t<0||t>=this.str.length||isNaN(t))return null;var e=I4(t,this.lineToIndex);return{line:e+this.origin,col:t-this.lineToIndex[e]+this.origin}};na.prototype.toIndex=function(t,e){if(typeof e>"u")return w4(t)&&t.length>=2?this.toIndex(t[0],t[1]):x4(t)&&"line"in t&&("col"in t||"column"in t)?this.toIndex(t.line,"col"in t?t.col:t.column):-1;if(isNaN(t)||isNaN(e))return-1;if(t-=this.origin,e-=this.origin,t>=0&&e>=0&&t<this.lineToIndex.length){var r=this.lineToIndex[t],i=t===this.lineToIndex.length-1?this.str.length:this.lineToIndex[t+1];if(e<i-r)return r+e}return-1};function k4(t){for(var e=t.split(`
1
+ import{a as kw,b as h4,c as m4}from"./chunk-F3TMLDLC.js";import{a as Iw}from"./chunk-IWOTLFOY.js";import{a as d4}from"./chunk-FFSDGRAN.js";import{Ba as p4,Ca as xw,l as ww}from"./chunk-YN6A26QL.js";import{q as Sw}from"./chunk-TR4OWSEX.js";import{a as ae,b as Ae,c as T,d as Xm,e as ia,f as Zm,g as y}from"./chunk-VKWPEFWQ.js";var tg=T(eg=>{"use strict";y();Object.defineProperty(eg,"__esModule",{value:!0});eg.deepGet=g4;function g4(t,e){return e.reduce((r,i)=>r?.[i],t)}});var Aw=T(rs=>{"use strict";y();Object.defineProperty(rs,"__esModule",{value:!0});rs.first=y4;rs.last=_4;rs.findLast=v4;rs.findLastIndex=rg;rs.findLastAndIndex=b4;function y4(t){return t[0]}function _4(t,e=0){return t[t.length-1+e]}function v4(t,e){return t[rg(t,e)]}function rg(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}function b4(t,e){let r=rg(t,e);return[t[r],r]}});var Ew=T(($ie,Tw)=>{"use strict";y();var S4=kw();Tw.exports=function(e){return e!=null&&typeof e=="object"&&S4(e)===!1}});var ig=T((Gie,Ow)=>{"use strict";y();var w4=kw(),x4=Ew(),Hie=Array.prototype.slice;Ow.exports=na;function na(t,e){if(!(this instanceof na))return typeof e=="number"?new na(t).fromIndex(e):new na(t,e);this.str=t||"",this.lineToIndex=k4(this.str),e=e||{},this.origin=typeof e.origin>"u"?1:e.origin}na.prototype.fromIndex=function(t){if(t<0||t>=this.str.length||isNaN(t))return null;var e=I4(t,this.lineToIndex);return{line:e+this.origin,col:t-this.lineToIndex[e]+this.origin}};na.prototype.toIndex=function(t,e){if(typeof e>"u")return w4(t)&&t.length>=2?this.toIndex(t[0],t[1]):x4(t)&&"line"in t&&("col"in t||"column"in t)?this.toIndex(t.line,"col"in t?t.col:t.column):-1;if(isNaN(t)||isNaN(e))return-1;if(t-=this.origin,e-=this.origin,t>=0&&e>=0&&t<this.lineToIndex.length){var r=this.lineToIndex[t],i=t===this.lineToIndex.length-1?this.str.length:this.lineToIndex[t+1];if(e<i-r)return r+e}return-1};function k4(t){for(var e=t.split(`
2
2
  `),r=new Array(e.length),i=0,n=0,s=e.length;n<s;n++)r[n]=i,i+=e[n].length+1;return r}function I4(t,e){if(t>=e[e.length-1])return e.length-1;for(var r=0,i=e.length-2,n;r<i;)if(n=r+(i-r>>1),t<e[n])i=n-1;else if(t>=e[n+1])r=n+1;else{r=n;break}return r}});var Lw=T(sa=>{"use strict";y();var A4=sa&&sa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sa,"__esModule",{value:!0});sa.getPosition=T4;sa.getOffset=E4;var Nw=A4(ig());function T4(t,e){let r=(0,Nw.default)(t,{origin:0}).fromIndex(Math.min(e,t.length-1));return{index:e,line:r?r.line:-1,character:r?r.col:-1}}function E4(t,e,r){return(0,Nw.default)(t,{origin:1}).toIndex(e,r)}});var pl=T(fl=>{"use strict";y();Object.defineProperty(fl,"__esModule",{value:!0});fl.isError=N4;fl.asError=L4;var O4={1:"Invalid symbol found in the input.",2:"Invalid number format detected.",3:"Property name expected but not found.",4:"A value was expected but not found.",5:"Colon `:` expected after the property name.",6:"Comma `,` expected between elements and properties.",7:"Closing brace `}` expected.",8:"Closing bracket `]` expected.",9:"End of file expected.",10:"Invalid comment token found.",11:"Unexpected end of comment.",12:"Unexpected end of string.",13:"Unexpected end of number.",14:"Invalid Unicode escape sequence.",15:"Invalid escape character found.",16:"Invalid character found in the input."};function N4(t){return t instanceof Error}function L4(t){return t instanceof Error?t:typeof t=="string"?new Error(t):t&&typeof t=="object"&&"error"in t?new Error(P4(t)):t&&typeof t.toString=="function"?new Error(t.toString()):new Error("An unknown error occurred")}function P4(t){return O4[t.error]||"Unknown parse error."}});var sg=T(ng=>{"use strict";y();Object.defineProperty(ng,"__esModule",{value:!0});ng.assertNever=q4;function q4(t){throw new Error(`We should never reach this code, you are missing a case for ${t}`)}});var og=T(hl=>{"use strict";y();Object.defineProperty(hl,"__esModule",{value:!0});hl.memo=C4;hl.memoize=R4;var ag=Symbol("Unset");function C4(t){let e=ag,r=(...i)=>(e===ag&&(e=t(...i)),e);return r.clearCache=()=>{e=ag},r}function R4(t,e){let r={},i=(...n)=>{let s=e(...n);return r[s]||(r[s]=t(...n)),r[s]};return i.force=(...n)=>(i.invalidate(...n),i(...n)),i.invalidate=(...n)=>{let s=e(...n);delete r[s]},i.clearCache=()=>{r={}},i}});var cg=T(ug=>{"use strict";y();Object.defineProperty(ug,"__esModule",{value:!0});ug.indexBy=M4;function M4(t,e){let r={};for(let i of e)r[t(i)]=i;return r}});function is(t,e=!1){let r=t.length,i=0,n="",s=0,a=16,o=0,u=0,l=0,f=0,h=0;function p(w,_){let A=0,E=0;for(;A<w||!_;){let O=t.charCodeAt(i);if(O>=48&&O<=57)E=E*16+O-48;else if(O>=65&&O<=70)E=E*16+O-65+10;else if(O>=97&&O<=102)E=E*16+O-97+10;else break;i++,A++}return A<w&&(E=-1),E}function m(w){i=w,n="",s=0,a=16,h=0}function v(){let w=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&aa(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&aa(t.charCodeAt(i)))for(i++;i<t.length&&aa(t.charCodeAt(i));)i++;else return h=3,t.substring(w,i);let _=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&aa(t.charCodeAt(i))){for(i++;i<t.length&&aa(t.charCodeAt(i));)i++;_=i}else h=3;return t.substring(w,_)}function S(){let w="",_=i;for(;;){if(i>=r){w+=t.substring(_,i),h=2;break}let A=t.charCodeAt(i);if(A===34){w+=t.substring(_,i),i++;break}if(A===92){if(w+=t.substring(_,i),i++,i>=r){h=2;break}switch(t.charCodeAt(i++)){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
3
3
  `;break;case 114:w+="\r";break;case 116:w+=" ";break;case 117:let O=p(4,!0);O>=0?w+=String.fromCharCode(O):h=4;break;default:h=5}_=i;continue}if(A>=0&&A<=31)if(qo(A)){w+=t.substring(_,i),h=2;break}else h=6;i++}return w}function b(){if(n="",h=0,s=i,u=o,f=l,i>=r)return s=r,a=17;let w=t.charCodeAt(i);if(lg(w)){do i++,n+=String.fromCharCode(w),w=t.charCodeAt(i);while(lg(w));return a=15}if(qo(w))return i++,n+=String.fromCharCode(w),w===13&&t.charCodeAt(i)===10&&(i++,n+=`
4
4
  `),o++,l=i,a=14;switch(w){case 123:return i++,a=1;case 125:return i++,a=2;case 91:return i++,a=3;case 93:return i++,a=4;case 58:return i++,a=6;case 44:return i++,a=5;case 34:return i++,n=S(),a=10;case 47:let _=i-1;if(t.charCodeAt(i+1)===47){for(i+=2;i<r&&!qo(t.charCodeAt(i));)i++;return n=t.substring(_,i),a=12}if(t.charCodeAt(i+1)===42){i+=2;let A=r-1,E=!1;for(;i<A;){let O=t.charCodeAt(i);if(O===42&&t.charCodeAt(i+1)===47){i+=2,E=!0;break}i++,qo(O)&&(O===13&&t.charCodeAt(i)===10&&i++,o++,l=i)}return E||(i++,h=1),n=t.substring(_,i),a=13}return n+=String.fromCharCode(w),i++,a=16;case 45:if(n+=String.fromCharCode(w),i++,i===r||!aa(t.charCodeAt(i)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=v(),a=11;default:for(;i<r&&g(w);)i++,w=t.charCodeAt(i);if(s!==i){switch(n=t.substring(s,i),n){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return n+=String.fromCharCode(w),i++,a=16}}function g(w){if(lg(w)||qo(w))return!1;switch(w){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function k(){let w;do w=b();while(w>=12&&w<=15);return w}return{setPosition:m,getPosition:()=>i,scan:e?k:b,getToken:()=>a,getTokenValue:()=>n,getTokenOffset:()=>s,getTokenLength:()=>i-s,getTokenStartLine:()=>u,getTokenStartCharacter:()=>s-f,getTokenError:()=>h}}function lg(t){return t===32||t===9}function qo(t){return t===10||t===13}function aa(t){return t>=48&&t<=57}var Pw,dl=Ae(()=>{"use strict";y();(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(Pw||(Pw={}))});var Or,oa,fg,qw,Cw=Ae(()=>{y();Or=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),oa=200,fg={" ":{"\n":new Array(oa).fill(0).map((t,e)=>`
@@ -0,0 +1,7 @@
1
+ import{p,v as d}from"./chunk-OORWOTAP.js";import{a as u}from"./chunk-QKGZWOOY.js";import{aa as w}from"./chunk-PIFW2R3S.js";import{b as l}from"./chunk-JJJTPEMD.js";import{z as f}from"./chunk-GMTNOCMS.js";import{h as i}from"./chunk-R2R6JDNH.js";import{Ta as c,ma as h}from"./chunk-Y34LWI3S.js";import{f as r,n as m}from"./chunk-773TIA5M.js";import{e as _,g as o}from"./chunk-VKWPEFWQ.js";o();o();var g=_(w(),1),P=["assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function y(e){let t=await k(e),s=`${e}/${t}`,n=`${e}/(${P})`;await u({inputDirectory:e,outputZipPath:s,matchFilePattern:n}),f({body:["Your local theme was packaged in",{filePath:m(s)}]})}async function k(e){let t=r(e,"config/settings_schema.json");if(!await c(t))throw new i("Provide a config/settings_schema.json to package your theme.");let s=await v(t);if(s===void 0||s.theme_name===void 0)throw new i("Provide a theme_info.theme_name configuration in config/settings_schema.json.");return`${[s.theme_name,s.theme_version].filter(Boolean).join("-")}.zip`}async function v(e){let t=(0,g.parseJSON)(await h(e),null,!0);if(!t)throw new i("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(s=>s.name==="theme_info")}var a=class extends d{static summary="Package your theme into a .zip file, ready to upload to the Online Store.";static descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
2
+
3
+ Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
4
+
5
+ The package includes the \`listings\` directory if present (required for multi-preset themes per [Theme Store requirements](https://shopify.dev/docs/storefronts/themes/store/requirements#adding-presets-to-your-theme-zip-submission)).
6
+
7
+ The ZIP file uses the name \`theme_name-theme_version.zip\`, based on parameters in your [settings_schema.json](https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json) file.`;static description=this.descriptionWithoutMarkdown();static flags={...l,path:p.path};static multiEnvironmentsFlags=null;async command(t){await y(t.path)}};export{a};
@@ -0,0 +1 @@
1
+ import{b as n}from"./chunk-RY2SJVWM.js";import{y as t}from"./chunk-GMTNOCMS.js";import{j as r}from"./chunk-XAOYKECS.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static description="Run CLI doctor-release tests";static hidden=!0;async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
@@ -0,0 +1,6 @@
1
+ import{a as f}from"./chunk-DQCIORGH.js";import{a as p}from"./chunk-KOVAFUYN.js";import{f as c,o as v}from"./chunk-4JY2P2A5.js";import{p as l,v as d}from"./chunk-OORWOTAP.js";import{b as s,f as h}from"./chunk-JJJTPEMD.js";import{z as a}from"./chunk-GMTNOCMS.js";import{a as w}from"./chunk-CTNBSUVU.js";import{e as F,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function u(e,n){let m=e.name??await c("New name for the theme"),i=await f(n,{header:"Select a theme to rename",filter:{theme:e.theme,development:e.development,live:e.live}});await v(i.id,{name:m},n),a({body:[...e.environment?[{subdued:`Environment: ${e.environment}
2
+
3
+ `}]:[],"The theme",...p(i),"was renamed to",`'${m}'`]})}var t=F(w(),1);var o=class extends d{static summary="Renames an existing theme.";static descriptionWithMarkdown=`Renames a theme in your store.
4
+
5
+ If no theme is specified, then you're prompted to select the theme that you want to rename from the list of themes in your store.
6
+ `;static description=this.descriptionWithoutMarkdown();static flags={...s,...l,name:h(t.Flags.string({char:"n",description:"The new name for the theme.",env:"SHOPIFY_FLAG_NEW_NAME",required:!1})),development:t.Flags.boolean({char:"d",description:"Rename your development theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),theme:t.Flags.string({char:"t",description:"Theme ID or name of the remote theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_THEME_ID"}),live:t.Flags.boolean({char:"l",description:"Rename your remote live theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_LIVE"})};static multiEnvironmentsFlags=["store","password","name",["live","development","theme"]];static nonTTYFlagRequirements(){return[{flags:["theme","development","live"]}]}async command(n,m){await u(n,m)}};export{o as a};
@@ -0,0 +1,19 @@
1
+ import{p as C,v as Y}from"./chunk-OORWOTAP.js";import{$ as re,aa as H}from"./chunk-PIFW2R3S.js";import{b as U}from"./chunk-JJJTPEMD.js";import{r as L}from"./chunk-KK24VGVE.js";import{y as w,z as E}from"./chunk-GMTNOCMS.js";import{h as P}from"./chunk-R2R6JDNH.js";import{a as oe}from"./chunk-CTNBSUVU.js";import{$a as A,Ab as j,N as I,Ta as N,ua as T,wb as p,xb as $,yb as G}from"./chunk-Y34LWI3S.js";import{d as O,f as _,p as b}from"./chunk-773TIA5M.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(H(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&_(e.path)===_(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new P(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function W(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
2
+ `).slice(t,n+1),s=o.length===1;return o.map((c,a)=>{let u=t+a+1,m=s?c.trim():c;return`${u} ${m}`}).join(`
3
+ `)}function fe(e){switch(e){case r.Severity.ERROR:return{error:`
4
+ [error]:`};case r.Severity.WARNING:return{warn:`
5
+ [warning]:`};case r.Severity.INFO:return{info:`
6
+ [info]:`}}}function he(e,t){return e.map((i,o)=>{let{message:s,uri:c,start:a,end:u,check:m,severity:d}=i,f=t.get(c),x=f===void 0?[]:[`
7
+
8
+ ${ue(f,a.line,u.line)}`],S=o===e.length-1?"":`
9
+
10
+ `;return[fe(d),{bold:m},{subdued:`
11
+ ${s}`},...x,S]}).flat()}var de=(e,t)=>e.severity-t.severity;function q(e){let t=e.reduce((n,i)=>{let{uri:o}=i,s=r.path.fsPath(o);return n[s]??=[],n[s].push(i),n},{});return Object.keys(t).reduce((n,i)=>(n[i]=t[i].sort(de),n),{})}function B(e){return e.reduce((t,n)=>(!Object.prototype.hasOwnProperty.call(t,n.severity)&&(t[n.severity]=0),t[n.severity]++,t),{})}function M(e,t,n){let i=[`${n.length} files inspected`];if(e.length===0)i.push("with no offenses found.");else{i.push(`with ${e.length} total offenses found across ${Object.keys(t).length} files.`);let o=B(e);o[r.Severity.ERROR]&&i.push(`
12
+ ${o[r.Severity.ERROR]} errors.`),o[r.Severity.WARNING]&&i.push(`
13
+ ${o[r.Severity.WARNING]} warnings.`),o[r.Severity.INFO]&&i.push(`
14
+ ${o[r.Severity.INFO]} info issues.`)}return i}function D(e,t,n,i){let o=ae(n);Object.keys(e).sort().forEach(c=>{let a=c.replace(t,"").slice(1);w({headline:i?`[${i}] ${a}`:a,body:he(e[c],o)})})}function J(e,t){return Object.entries(e).map(([n,i])=>{let o=i.map(c=>({check:c.check,severity:W(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=B(i);return{environment:t,path:n,offenses:o,errorCount:s[r.Severity.ERROR]??0,warningCount:s[r.Severity.WARNING]??0,infoCount:s[r.Severity.INFO]??0}})}function V(e,t){t||process.exit(0);let n=ce(t),i=n!==void 0&&e.some(o=>o.severity<=n);process.exit(i?1:0)}function me(e){return e.split(`
15
+ `).map(t=>`# ${t}`).join(`
16
+ `)}async function z(e){let t=".theme-check.yml",n=O(e,t);if(await N(n)){$(`${t} already exists at ${e}`);return}let{settings:i}=await(0,r.loadConfig)(void 0,e),o=me(l.default.stringify(i)),s=l.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await T(n,`${s}${o}`),G(`Created ${t} at ${e}`)}var pe=async(e,t)=>{let n=(0,r.applyFixToString)(e.source,t),i=r.path.fsPath(e.uri);await T(i,n)};async function K(e,t){await(0,r.autofix)(e,t,pe)}async function Q(e,t,n){let{ignore:i,settings:o,rootUri:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c={extends:[],ignore:I(i??[]),rootUri:s,...o},a=n?{[n]:c}:c;p(l.default.stringify(a))}async function X(e,t,n){let{settings:i,ignore:o,checks:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c=I(o??[]),u=Object.keys(i).reduce((d,f)=>{let{severity:x,enabled:S,...ee}=i[f];if(!S)return d;let te=W(x??r.Severity.INFO),g=s.find(ie=>ie.meta.code===f),ne=g&&g.meta?{description:g.meta.docs.description,doc:g.meta.docs.url}:{};return d[f]={severity:te,...ne,ignored_patterns:`[${c.join(", ")}]`,...ee},d},{}),m=n?{[n]:u}:u;p(l.default.stringify(m))}function Z(e){return"_handle"in e&&typeof e._handle=="object"&&e._handle!==null&&typeof e._handle.setBlocking=="function"}var h=k(oe(),1);var y=k(H(),1);var R=class extends Y{static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionWithoutMarkdown();static flags={...U,path:C.path,"auto-correct":h.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:h.Flags.string({char:"C",required:!1,description:`Use the config provided, overriding .theme-check.yml if present
17
+ Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
18
+ theme-check:recommended, theme-check:all
19
+ For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":h.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:h.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:h.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:h.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:h.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:h.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:C.environment};static multiEnvironmentsFlags=["path"];async command(t,n,i){let o=t.path,s=t.environment?.[0],a=t.config?.startsWith(":")&&y.LegacyIdentifiers.has(t.config.slice(1))?y.LegacyIdentifiers.get(t.config.slice(1)):t.config;if(t.init){await z(o);return}if(t.version){let d=await A(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:b(import.meta.url)}),f="unknown";d&&(f=await L(d)??"unknown"),p(f);return}if(t.print){await Q(o,a,s);return}if(t.list){await X(o,a,s);return}let{offenses:u,theme:m}=await le(o,t.output,a,s);if(t["auto-correct"]&&await K(m,u),!i)return V(u,t["fail-level"])}};async function le(e,t,n,i){let{offenses:o,theme:s}=await F(n,()=>(0,y.themeCheckRun)(e,n,a=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&j(a)})),c=q(o);if(t==="text"&&(D(c,e,s,i),(o.length?w:E)({headline:i?`[${i}] Theme Check Summary.`:"Theme Check Summary.",body:M(o,c,s)})),t==="json"){let a=process.stdout;Z(a)&&a._handle.setBlocking(!0),p(JSON.stringify(J(c,i)))}return{offenses:o,theme:s}}export{R as a,le as b};