@shopify/cli 4.7.0 → 4.8.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 (324) hide show
  1. package/dist/analytics-3IIUBZ3B.js +1 -0
  2. package/dist/analytics-OOT5AB52.js +1 -0
  3. package/dist/assets/hydrogen/starter/AGENTS.md +5 -0
  4. package/dist/assets/hydrogen/starter/CHANGELOG.md +9 -0
  5. package/dist/assets/hydrogen/starter/CLAUDE.md +1 -0
  6. package/dist/assets/hydrogen/starter/package.json +3 -3
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-6ENBE43F.js → chunk-2AK44UYM.js} +1 -1
  9. package/dist/{chunk-XCBEYRQI.js → chunk-2CIZE537.js} +1 -1
  10. package/dist/{chunk-YHPBDS52.js → chunk-2EAFYCCS.js} +1 -1
  11. package/dist/{chunk-U2Z5NMXV.js → chunk-2KGPH7YG.js} +1 -1
  12. package/dist/{chunk-6VGJVXZI.js → chunk-2O224ZPO.js} +1 -1
  13. package/dist/{chunk-RY2SJVWM.js → chunk-2XDUJQQN.js} +3 -3
  14. package/dist/{chunk-GSCWZR22.js → chunk-36ROOKQB.js} +1 -1
  15. package/dist/{chunk-YIZZ5LZN.js → chunk-3DCN3N23.js} +1 -1
  16. package/dist/{chunk-YN6A26QL.js → chunk-3JXPOOFV.js} +39 -39
  17. package/dist/{chunk-KIYHEMHD.js → chunk-4QBJ5JBX.js} +15 -16
  18. package/dist/chunk-4ZNV5YSL.js +1 -0
  19. package/dist/chunk-5L63PRJL.js +2 -0
  20. package/dist/{chunk-MRCWOOSF.js → chunk-5N6HNQQ5.js} +1 -1
  21. package/dist/{chunk-4JY2P2A5.js → chunk-5SEEDOQ5.js} +1 -1
  22. package/dist/chunk-67Z34HN5.js +5 -0
  23. package/dist/chunk-6BDAJ6UD.js +5 -0
  24. package/dist/chunk-6CXG3XLP.js +1 -0
  25. package/dist/{chunk-QEB3HUQE.js → chunk-6MWWJZFN.js} +1 -1
  26. package/dist/{chunk-LRQYUWWB.js → chunk-6RQOEPEC.js} +1 -1
  27. package/dist/{chunk-LJM2DUXN.js → chunk-72ZY3KTF.js} +1 -1
  28. package/dist/{chunk-WKUGSFTB.js → chunk-742XXXGL.js} +1 -1
  29. package/dist/{chunk-37TEEITE.js → chunk-7HFHL5SO.js} +1 -1
  30. package/dist/{chunk-6VRXGEIW.js → chunk-7ISJRIPT.js} +1 -1
  31. package/dist/{chunk-CZJZCJRX.js → chunk-7LWUHQIF.js} +1 -1
  32. package/dist/{chunk-MLZLDL6B.js → chunk-7T6M7FAC.js} +1 -1
  33. package/dist/{chunk-LWJA2DQG.js → chunk-A6BMJISP.js} +1 -1
  34. package/dist/{chunk-TY4W7AYX.js → chunk-AWUX36VG.js} +1 -1
  35. package/dist/chunk-BWJIZYAG.js +1 -0
  36. package/dist/{chunk-EW55WWT7.js → chunk-BZ73NV3L.js} +1 -1
  37. package/dist/chunk-C3RUVXG2.js +6 -0
  38. package/dist/{chunk-QKGZWOOY.js → chunk-C4YLE3NS.js} +1 -1
  39. package/dist/chunk-CEYIZC3M.js +2 -0
  40. package/dist/{chunk-WCRZJY3P.js → chunk-CIWKN4HF.js} +1 -1
  41. package/dist/{chunk-P5MNNBSO.js → chunk-CULTZLC4.js} +1 -1
  42. package/dist/{chunk-X4XP2RQJ.js → chunk-CX75OKZK.js} +1 -1
  43. package/dist/{chunk-LDF4PQ3B.js → chunk-DASVZTAX.js} +46 -46
  44. package/dist/{chunk-UPJLZHHR.js → chunk-DX3JLOUA.js} +1 -1
  45. package/dist/{chunk-ZCNIR6YU.js → chunk-E55KS3GZ.js} +1 -1
  46. package/dist/{chunk-WHLGNDRE.js → chunk-E5FXOLQO.js} +1 -1
  47. package/dist/{chunk-JQ2B3VHR.js → chunk-E6N4PZZR.js} +1 -1
  48. package/dist/{chunk-CIH6LPTG.js → chunk-EB574SY6.js} +1 -1
  49. package/dist/chunk-EX5GVHGE.js +1 -0
  50. package/dist/chunk-F3NYCSXT.js +273 -0
  51. package/dist/{chunk-FWPJEL6Q.js → chunk-F6X6OXXB.js} +1 -1
  52. package/dist/{chunk-QPWMD2VR.js → chunk-FDBHQLFK.js} +1 -1
  53. package/dist/{chunk-TCTVI6PK.js → chunk-FDYW3UQC.js} +1 -1
  54. package/dist/{chunk-2SZOPJYI.js → chunk-FEDVVYK2.js} +1 -1
  55. package/dist/{chunk-SSJGWLCW.js → chunk-FJ6F4XRV.js} +1 -1
  56. package/dist/{chunk-E5T4YRGW.js → chunk-FOREMLFZ.js} +1 -1
  57. package/dist/{chunk-QXHENYJH.js → chunk-FUYDGK33.js} +1 -1
  58. package/dist/{chunk-CYOFLJ3Z.js → chunk-FX3L344E.js} +1 -1
  59. package/dist/{chunk-FCGKO2KY.js → chunk-G5XIGN5D.js} +1 -1
  60. package/dist/{chunk-HHVHVGRT.js → chunk-GAYKYEIM.js} +1 -1
  61. package/dist/{chunk-2U4P6UFZ.js → chunk-GCY7LPEF.js} +1 -1
  62. package/dist/{chunk-OORWOTAP.js → chunk-GNBRCK7L.js} +1 -1
  63. package/dist/{chunk-KOVAFUYN.js → chunk-GRPKF5ZB.js} +1 -1
  64. package/dist/{chunk-QZBSCOJV.js → chunk-GRSF7456.js} +1 -1
  65. package/dist/chunk-H2TQ4ODI.js +1 -0
  66. package/dist/{chunk-AMLWPYNA.js → chunk-H6XEESUN.js} +1 -1
  67. package/dist/{chunk-I3N6NPHF.js → chunk-HB347DXT.js} +1 -1
  68. package/dist/chunk-HFSCXTJQ.js +97 -0
  69. package/dist/chunk-HHN6KZXX.js +1 -0
  70. package/dist/{chunk-QBIVQXUJ.js → chunk-HP64ZTEJ.js} +1 -1
  71. package/dist/{chunk-U7R6LYPJ.js → chunk-IARCMH7G.js} +1 -1
  72. package/dist/{chunk-YOO7DLOT.js → chunk-IBI5UCJO.js} +1 -1
  73. package/dist/{chunk-UVQL7RUY.js → chunk-IKUSLRGD.js} +1 -1
  74. package/dist/{chunk-HLNJL4B6.js → chunk-IT4HYLTY.js} +1 -1
  75. package/dist/{chunk-GZ64KWHX.js → chunk-J4T73EAS.js} +1 -1
  76. package/dist/chunk-JG4HH54Q.js +1 -0
  77. package/dist/{chunk-DKL6N3L2.js → chunk-JIYSCWCG.js} +1 -1
  78. package/dist/chunk-JWRK5KLD.js +560 -0
  79. package/dist/{chunk-DHU57LKD.js → chunk-JX7FYWPO.js} +1 -1
  80. package/dist/{chunk-N6YTJXIS.js → chunk-K42WBNJQ.js} +1 -1
  81. package/dist/{chunk-5CR5YJTU.js → chunk-KDU7VW3L.js} +1 -1
  82. package/dist/{chunk-CTRXLZAJ.js → chunk-KWVOJWO7.js} +1 -1
  83. package/dist/{chunk-RUFQCXBX.js → chunk-LANUJ7LX.js} +1 -1
  84. package/dist/{chunk-PAAKBWSF.js → chunk-LUKQ5HLC.js} +1 -1
  85. package/dist/{chunk-3K6VHXC2.js → chunk-M2XHIN57.js} +1 -1
  86. package/dist/{chunk-TYIGOVRQ.js → chunk-MNOQAXJW.js} +1 -1
  87. package/dist/chunk-MYQUYU4U.js +2 -0
  88. package/dist/{chunk-T5JXQ7KO.js → chunk-N65F7ET2.js} +1 -1
  89. package/dist/{chunk-PWSI275S.js → chunk-N6RBRPGW.js} +1 -1
  90. package/dist/chunk-N75VOJHO.js +15 -0
  91. package/dist/{chunk-4W3UE2ZI.js → chunk-NBFMP5XQ.js} +1 -1
  92. package/dist/{chunk-CFWHR74L.js → chunk-NE3ZFSMS.js} +1 -1
  93. package/dist/{chunk-D2K2ZBKH.js → chunk-NGLMZYS7.js} +2 -2
  94. package/dist/{chunk-JQISGC7D.js → chunk-NHAUJWEG.js} +1 -1
  95. package/dist/chunk-NILETICC.js +11 -0
  96. package/dist/{chunk-SYADOUBB.js → chunk-NNZXKFOS.js} +1 -1
  97. package/dist/{chunk-E2W5OYYM.js → chunk-NQK2VCDA.js} +1 -1
  98. package/dist/{chunk-U6HYEGAE.js → chunk-NROVZETL.js} +1 -1
  99. package/dist/{chunk-TSLQZTXR.js → chunk-NW6NUGN7.js} +1 -1
  100. package/dist/{chunk-JZMRBJH3.js → chunk-O7DZXO3O.js} +1 -1
  101. package/dist/{chunk-5CADTCJE.js → chunk-OBYQSIYU.js} +1 -1
  102. package/dist/{chunk-5NO5OXYP.js → chunk-OEG3N5PG.js} +1 -1
  103. package/dist/{chunk-VRVP2GQL.js → chunk-OGBZTY2G.js} +1 -1
  104. package/dist/chunk-OMHR423H.js +1 -0
  105. package/dist/{chunk-XHZ5BWXL.js → chunk-OV6SRRXR.js} +1 -1
  106. package/dist/{chunk-2JDCVEFK.js → chunk-OVV5YGKN.js} +1 -1
  107. package/dist/{chunk-SEVSMWNX.js → chunk-OZL5FTT7.js} +1 -1
  108. package/dist/{chunk-JUKAWTYY.js → chunk-OZMQ2EJB.js} +1 -1
  109. package/dist/{chunk-7WTNEG2F.js → chunk-P57P7UAN.js} +1 -1
  110. package/dist/{chunk-JZXA3H5K.js → chunk-PATTG7YZ.js} +1 -1
  111. package/dist/{chunk-2HK4MFWP.js → chunk-PG5YNPJB.js} +1 -1
  112. package/dist/chunk-PP4L2JJ6.js +3 -0
  113. package/dist/{chunk-CZPGC2E7.js → chunk-Q5JX23QU.js} +1 -1
  114. package/dist/{chunk-L67BU25M.js → chunk-Q5KVMLBK.js} +1 -1
  115. package/dist/{chunk-ZRLEAF7M.js → chunk-Q5LIJGT7.js} +1 -1
  116. package/dist/{chunk-JQVXH26X.js → chunk-Q6ADIMJM.js} +1 -1
  117. package/dist/{chunk-YUVE2I3C.js → chunk-QERQARMC.js} +1 -1
  118. package/dist/{chunk-GLWQMLUC.js → chunk-QOV43E26.js} +1 -1
  119. package/dist/{chunk-KCS75ZM4.js → chunk-QTFUYKMF.js} +1 -1
  120. package/dist/{chunk-7DOWT5JZ.js → chunk-QTJCCOAG.js} +3 -3
  121. package/dist/{chunk-XAOYKECS.js → chunk-R6ICQT2D.js} +1 -1
  122. package/dist/{chunk-4LRG5YBS.js → chunk-R7T3LYJL.js} +1 -1
  123. package/dist/{chunk-DMXQLI35.js → chunk-RXQJCJDV.js} +1 -1
  124. package/dist/{chunk-BR6DBMQA.js → chunk-S2TLBBSS.js} +1 -1
  125. package/dist/{chunk-FULWTZS6.js → chunk-S5FOQY35.js} +1 -1
  126. package/dist/{chunk-6OFGSZD6.js → chunk-SYLHT42O.js} +1 -1
  127. package/dist/{chunk-CHMEDVDZ.js → chunk-T4AA6TSF.js} +1 -1
  128. package/dist/{chunk-XRT2W5Y2.js → chunk-T4QWK5GG.js} +1 -1
  129. package/dist/{chunk-63CIFL36.js → chunk-T7PJDT5O.js} +1 -1
  130. package/dist/{chunk-6EBLULOC.js → chunk-TEY4LRY7.js} +1 -1
  131. package/dist/{chunk-PANGX7SA.js → chunk-TFBRVLDN.js} +1 -1
  132. package/dist/{chunk-MB7E5GEY.js → chunk-TUVDJ3PG.js} +1 -1
  133. package/dist/{chunk-HZIX3DIT.js → chunk-U2DWBZK2.js} +1 -1
  134. package/dist/chunk-U53OLUOE.js +3 -0
  135. package/dist/{chunk-GKOBFX4A.js → chunk-UAETNFN4.js} +1 -1
  136. package/dist/{chunk-EOMCXBCS.js → chunk-UAFEFKAQ.js} +1 -1
  137. package/dist/{chunk-Q5DQGV3M.js → chunk-ULRJDKWQ.js} +1 -1
  138. package/dist/chunk-UZARYOLN.js +1 -0
  139. package/dist/chunk-VASGXHYA.js +1 -0
  140. package/dist/chunk-VD4XJ6BX.js +1 -0
  141. package/dist/{chunk-Y34LWI3S.js → chunk-VFM2KQRM.js} +3 -3
  142. package/dist/{chunk-CMYQXGLO.js → chunk-VSDRNYA5.js} +1 -1
  143. package/dist/{chunk-OE3F7XXU.js → chunk-VVZSYHDG.js} +1 -1
  144. package/dist/chunk-VXEYO3ZP.js +1 -0
  145. package/dist/{chunk-7JIQXGDE.js → chunk-VYDSOAV4.js} +1 -1
  146. package/dist/{chunk-DQFSKPKL.js → chunk-WBYAGS6B.js} +1 -1
  147. package/dist/chunk-WGAFCKGD.js +1 -0
  148. package/dist/{chunk-AH2ZGMDM.js → chunk-WYBTC356.js} +1 -1
  149. package/dist/{chunk-TTAPXLI5.js → chunk-XF2KTEID.js} +1 -1
  150. package/dist/{chunk-XUEMMLXK.js → chunk-XH5YGJQR.js} +1 -1
  151. package/dist/chunk-XHKWITLA.js +1705 -0
  152. package/dist/chunk-XOCB4KNX.js +2 -0
  153. package/dist/{chunk-2WJAAJVX.js → chunk-XUUAKGEX.js} +1 -1
  154. package/dist/{chunk-LQCR4TGH.js → chunk-XUYVJEZG.js} +1 -1
  155. package/dist/chunk-Y47C3LSX.js +3 -0
  156. package/dist/{chunk-KK24VGVE.js → chunk-Y5PRPHLQ.js} +1 -1
  157. package/dist/{chunk-K4KTNINH.js → chunk-YD2VQEN5.js} +1 -1
  158. package/dist/{chunk-KUNDCAQN.js → chunk-YESGYUEL.js} +1 -1
  159. package/dist/{chunk-JJJTPEMD.js → chunk-YEVGLC5X.js} +1 -1
  160. package/dist/{chunk-GMTNOCMS.js → chunk-YFINLODF.js} +3 -3
  161. package/dist/{chunk-LZ3GZ7NS.js → chunk-YKL3BLWC.js} +1 -1
  162. package/dist/{chunk-5HPBQ6U5.js → chunk-YLXPYXQP.js} +1 -1
  163. package/dist/{chunk-7AALWJAO.js → chunk-YNDIZCD2.js} +1 -1
  164. package/dist/{chunk-6WZYX5RO.js → chunk-YPWHD3NL.js} +1 -1
  165. package/dist/{chunk-4HV6A6UH.js → chunk-YSAFHVV6.js} +1 -1
  166. package/dist/{chunk-AGOEROAI.js → chunk-YZMY2CTU.js} +1 -1
  167. package/dist/{chunk-S3P5WWJD.js → chunk-Z4AFEO36.js} +1 -1
  168. package/dist/{chunk-7MHANY34.js → chunk-Z5WPP6ME.js} +1 -1
  169. package/dist/chunk-Z65E4UAP.js +1 -0
  170. package/dist/{chunk-V2HCVJYF.js → chunk-ZDRIQC7O.js} +1 -1
  171. package/dist/{chunk-2CYVZUYT.js → chunk-ZH44BDUR.js} +1 -1
  172. package/dist/{chunk-SJMTETSU.js → chunk-ZL5LU4U2.js} +1 -1
  173. package/dist/{chunk-DQCIORGH.js → chunk-ZYX7UHCQ.js} +1 -1
  174. package/dist/{chunk-ACTDYTAV.js → chunk-ZZRFG6ME.js} +114 -114
  175. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  176. package/dist/cli/commands/app/build.js +1 -1
  177. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  178. package/dist/cli/commands/app/bulk/execute.js +1 -1
  179. package/dist/cli/commands/app/bulk/status.js +1 -1
  180. package/dist/cli/commands/app/config/link.js +1 -1
  181. package/dist/cli/commands/app/config/pull.js +1 -1
  182. package/dist/cli/commands/app/config/use.js +1 -1
  183. package/dist/cli/commands/app/config/validate.js +1 -1
  184. package/dist/cli/commands/app/demo/watcher.js +1 -1
  185. package/dist/cli/commands/app/deploy.js +1 -1
  186. package/dist/cli/commands/app/dev/clean.js +1 -1
  187. package/dist/cli/commands/app/dev.js +1 -1
  188. package/dist/cli/commands/app/doctor/instructions.js +1 -0
  189. package/dist/cli/commands/app/doctor.js +1 -0
  190. package/dist/cli/commands/app/env/pull.js +1 -1
  191. package/dist/cli/commands/app/env/show.js +1 -1
  192. package/dist/cli/commands/app/execute.js +1 -1
  193. package/dist/cli/commands/app/function/build.js +1 -1
  194. package/dist/cli/commands/app/function/info.js +1 -1
  195. package/dist/cli/commands/app/function/replay.js +1 -1
  196. package/dist/cli/commands/app/function/run.js +1 -1
  197. package/dist/cli/commands/app/function/schema.js +1 -1
  198. package/dist/cli/commands/app/function/typegen.js +1 -1
  199. package/dist/cli/commands/app/generate/extension.js +1 -1
  200. package/dist/cli/commands/app/graphiql.js +1 -1
  201. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  202. package/dist/cli/commands/app/import-extensions.js +1 -1
  203. package/dist/cli/commands/app/info.js +1 -1
  204. package/dist/cli/commands/app/init.js +1 -1
  205. package/dist/cli/commands/app/logs.js +1 -1
  206. package/dist/cli/commands/app/release.js +1 -1
  207. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -0
  208. package/dist/cli/commands/app/subscription-migrations/list.js +1 -0
  209. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -0
  210. package/dist/cli/commands/app/subscription-migrations/status.js +1 -0
  211. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -0
  212. package/dist/cli/commands/app/versions/list.js +1 -1
  213. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  214. package/dist/cli/commands/auth/login.js +1 -1
  215. package/dist/cli/commands/auth/logout.js +1 -1
  216. package/dist/cli/commands/cache/clear.js +1 -1
  217. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  218. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  219. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  220. package/dist/cli/commands/debug/command-flags.js +1 -1
  221. package/dist/cli/commands/doc/fetch.js +1 -1
  222. package/dist/cli/commands/doc/search.js +1 -1
  223. package/dist/cli/commands/docs/generate.js +1 -1
  224. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  225. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  226. package/dist/cli/commands/help.js +1 -1
  227. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  228. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  229. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  230. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  231. package/dist/cli/commands/notifications/generate.js +1 -1
  232. package/dist/cli/commands/notifications/list.js +1 -1
  233. package/dist/cli/commands/organization/list.js +1 -1
  234. package/dist/cli/commands/search.js +1 -1
  235. package/dist/cli/commands/send-analytics.js +1 -1
  236. package/dist/cli/commands/theme/check.js +1 -1
  237. package/dist/cli/commands/theme/console.js +1 -1
  238. package/dist/cli/commands/theme/delete.js +1 -1
  239. package/dist/cli/commands/theme/dev.js +1 -1
  240. package/dist/cli/commands/theme/duplicate.js +1 -1
  241. package/dist/cli/commands/theme/info.js +1 -1
  242. package/dist/cli/commands/theme/init.js +1 -1
  243. package/dist/cli/commands/theme/language-server.js +1 -1
  244. package/dist/cli/commands/theme/list.js +1 -1
  245. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  246. package/dist/cli/commands/theme/open.js +1 -1
  247. package/dist/cli/commands/theme/package.js +1 -1
  248. package/dist/cli/commands/theme/preview.js +1 -1
  249. package/dist/cli/commands/theme/profile.js +1 -1
  250. package/dist/cli/commands/theme/publish.js +1 -1
  251. package/dist/cli/commands/theme/pull.js +1 -1
  252. package/dist/cli/commands/theme/push.js +1 -1
  253. package/dist/cli/commands/theme/rename.js +1 -1
  254. package/dist/cli/commands/theme/share.js +1 -1
  255. package/dist/cli/commands/upgrade.js +1 -1
  256. package/dist/cli/commands/version.js +1 -1
  257. package/dist/command-registry.js +1 -1
  258. package/dist/{conf-store-OAGJBITE.js → conf-store-ASDCTDQ4.js} +1 -1
  259. package/dist/configs/all.yml +60 -0
  260. package/dist/configs/recommended.yml +60 -0
  261. package/dist/data/filters.json +31 -2
  262. package/dist/data/setting.json +129 -4
  263. package/dist/data/shopify_system_translations.json +154 -13
  264. package/dist/{deprecations-K3NPRKBF.js → deprecations-VBQV7Q4O.js} +1 -1
  265. package/dist/dist-FZLOAKU7.js +1 -0
  266. package/dist/dist-HTY6UHG5.js +1 -0
  267. package/dist/environments-HSTNEQRG.js +1 -0
  268. package/dist/{error-YX56C43A.js → error-2LZYKRMA.js} +1 -1
  269. package/dist/error-handler-PIGEJ7BT.js +1 -0
  270. package/dist/{fs-SKHQZZTQ.js → fs-BJHNJDDK.js} +1 -1
  271. package/dist/hooks/did-you-mean.js +1 -1
  272. package/dist/hooks/hydrogen-init.js +1 -1
  273. package/dist/hooks/postrun.js +1 -1
  274. package/dist/hooks/prerun.js +1 -1
  275. package/dist/hooks/public-metadata.js +1 -1
  276. package/dist/hooks/sensitive-metadata.js +1 -1
  277. package/dist/hooks/tunnel-provider.js +1 -1
  278. package/dist/hooks/tunnel-start.js +1 -1
  279. package/dist/index.js +14 -16
  280. package/dist/{is-global-V5VORI3F.js → is-global-6SCOAJVG.js} +1 -1
  281. package/dist/{local-GX5AN6ZS.js → local-PZWPRFU7.js} +1 -1
  282. package/dist/{metadata-XUJUTBTB.js → metadata-VVBHB3HL.js} +1 -1
  283. package/dist/{node-package-manager-3WIYU7Y3.js → node-package-manager-ETYQN7OM.js} +1 -1
  284. package/dist/notifications-system-652OG5KL.js +1 -0
  285. package/dist/os-7D6NT4O3.js +1 -0
  286. package/dist/{output-X47P6ICP.js → output-74VDGYJD.js} +1 -1
  287. package/dist/{prettier-RVUAAWC7.js → prettier-EGVCP5CY.js} +1 -1
  288. package/dist/{system-SR5G7WEW.js → system-P5QIJALL.js} +1 -1
  289. package/dist/tsconfig.tsbuildinfo +1 -1
  290. package/dist/{ui-VYWSLAQ6.js → ui-H5I5YVKV.js} +1 -1
  291. package/dist/upgrade-34HSYBXI.js +1 -0
  292. package/dist/version-EKXEAF6Q.js +1 -0
  293. package/dist/{version-FK4ETQ22.js → version-J2PYO6M5.js} +1 -1
  294. package/dist/{workerd-NAPS5TA7.js → workerd-X4TGHEG3.js} +1 -1
  295. package/oclif.manifest.json +903 -133
  296. package/package.json +9 -8
  297. package/dist/analytics-6LI5GLWS.js +0 -1
  298. package/dist/analytics-UNRIIG4Y.js +0 -1
  299. package/dist/chunk-5CYJG63I.js +0 -1
  300. package/dist/chunk-6PDR2IUL.js +0 -11
  301. package/dist/chunk-F5HCSUXC.js +0 -16
  302. package/dist/chunk-H5KWM27L.js +0 -1
  303. package/dist/chunk-NEMPLS7C.js +0 -1
  304. package/dist/chunk-OUZGGWFN.js +0 -1
  305. package/dist/chunk-PIFW2R3S.js +0 -1382
  306. package/dist/chunk-QRT4A2RV.js +0 -3
  307. package/dist/chunk-R2R6JDNH.js +0 -1
  308. package/dist/chunk-RZFBGBNA.js +0 -1
  309. package/dist/chunk-V5SC2RYQ.js +0 -2
  310. package/dist/chunk-VKSR6MJG.js +0 -2
  311. package/dist/chunk-XLURZ6GL.js +0 -559
  312. package/dist/chunk-Z5K4J7HQ.js +0 -1
  313. package/dist/chunk-ZO74GSWC.js +0 -5
  314. package/dist/chunk-ZSFAURIH.js +0 -3
  315. package/dist/dist-EXJEE23W.js +0 -1
  316. package/dist/dist-S62Z6IFV.js +0 -1
  317. package/dist/environments-ALH2N36U.js +0 -1
  318. package/dist/error-handler-FDCH72NH.js +0 -1
  319. package/dist/notifications-system-RHULO564.js +0 -1
  320. package/dist/os-M6X7KOR4.js +0 -1
  321. package/dist/upgrade-PFQ7JMXG.js +0 -1
  322. package/dist/version-U4GM2LNG.js +0 -1
  323. /package/dist/{chunk-NJPL5BTN.js → chunk-YLQ3LNNY.js} +0 -0
  324. /package/dist/{morph-77RHJICZ.js → morph-BMYYMQNX.js} +0 -0
@@ -1,4 +1,4 @@
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.
1
+ import{k as P,t as F}from"./chunk-5SEEDOQ5.js";import{a as N}from"./chunk-Q7BOSHWX.js";import{a as T}from"./chunk-KWVOJWO7.js";import{Aa as h,R as H,T as q,s as $,ya as d}from"./chunk-3JXPOOFV.js";import{B as I,C as L,T as v}from"./chunk-YFINLODF.js";import{a as x}from"./chunk-VASGXHYA.js";import{h as l}from"./chunk-BWJIZYAG.js";import{Ab as c,qb as C,sb as U}from"./chunk-VFM2KQRM.js";import{t as O}from"./chunk-R6ICQT2D.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
 
@@ -1 +1 @@
1
- import{b as r}from"./chunk-L67BU25M.js";import{b as a}from"./chunk-RY2SJVWM.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var i=class extends a{static summary="Upgrades Shopify CLI.";static descriptionWithMarkdown="Upgrades Shopify CLI using your package manager.";static description=this.descriptionWithoutMarkdown();async run(){await r()}};export{i as a};
1
+ import{b as r}from"./chunk-Q5KVMLBK.js";import{b as a}from"./chunk-2XDUJQQN.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var i=class extends a{static summary="Upgrades Shopify CLI.";static descriptionWithMarkdown="Upgrades Shopify CLI using your package manager.";static description=this.descriptionWithoutMarkdown();async run(){await r()}};export{i as a};
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-DQCIORGH.js";import{a as y}from"./chunk-KOVAFUYN.js";import{a as d}from"./chunk-YY6TFARF.js";import{p}from"./chunk-4JY2P2A5.js";import{p as f,v as u}from"./chunk-OORWOTAP.js";import{b as l,f as m}from"./chunk-JJJTPEMD.js";import{E as c,z as s}from"./chunk-GMTNOCMS.js";import{a as g}from"./chunk-CTNBSUVU.js";import{e as b,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function w(o,t,i){let e=await v(o,{header:"Select a theme to publish",filter:{development:!1,live:!1,theme:t.theme}}),h=d({...e,role:"live"},o);!t.force&&!i&&!await c({message:`Do you want to make '${e.name}' the new live theme on ${o.storeFqdn}?`,confirmationMessage:`Yes, make '${e.name}' the new live theme`,cancellationMessage:"No, cancel publish"})||(await p(e.id,o),s({headline:t.environment?`Environment: ${t.environment}`:void 0,body:["The theme",...y(e),"is now live at",{link:{label:h,url:h}},{char:"."}]}))}var n=b(g(),1);var a=class extends u{static summary="Set a remote theme as the live theme.";static descriptionWithMarkdown=`Publishes an unpublished theme from your theme library.
1
+ import{a as d}from"./chunk-YY6TFARF.js";import{a as v}from"./chunk-ZYX7UHCQ.js";import{a as y}from"./chunk-GRPKF5ZB.js";import{p}from"./chunk-5SEEDOQ5.js";import{p as f,v as u}from"./chunk-GNBRCK7L.js";import{b as l,f as m}from"./chunk-YEVGLC5X.js";import{E as c,z as s}from"./chunk-YFINLODF.js";import{a as g}from"./chunk-CTNBSUVU.js";import{e as b,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function w(o,t,i){let e=await v(o,{header:"Select a theme to publish",filter:{development:!1,live:!1,theme:t.theme}}),h=d({...e,role:"live"},o);!t.force&&!i&&!await c({message:`Do you want to make '${e.name}' the new live theme on ${o.storeFqdn}?`,confirmationMessage:`Yes, make '${e.name}' the new live theme`,cancellationMessage:"No, cancel publish"})||(await p(e.id,o),s({headline:t.environment?`Environment: ${t.environment}`:void 0,body:["The theme",...y(e),"is now live at",{link:{label:h,url:h}},{char:"."}]}))}var n=b(g(),1);var a=class extends u{static summary="Set a remote theme as the live theme.";static descriptionWithMarkdown=`Publishes an unpublished theme from your theme library.
2
2
 
3
3
  If no theme ID is specified, then you're prompted to select the theme that you want to publish from the list of themes in your store.
4
4
 
@@ -1 +1 @@
1
- import{a as m}from"./chunk-ZO74GSWC.js";import{a as p}from"./chunk-NEMPLS7C.js";import{a as n}from"./chunk-KUNDCAQN.js";import{sa as r}from"./chunk-ACTDYTAV.js";import{b as s}from"./chunk-JJJTPEMD.js";import{wb as e}from"./chunk-Y34LWI3S.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
1
+ import{a as m}from"./chunk-6BDAJ6UD.js";import{a as p}from"./chunk-UZARYOLN.js";import{a as n}from"./chunk-YESGYUEL.js";import{wa as r}from"./chunk-ZZRFG6ME.js";import{b as s}from"./chunk-YEVGLC5X.js";import{wb as e}from"./chunk-VFM2KQRM.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
@@ -1,4 +1,4 @@
1
- import{c as J}from"./chunk-ZSFAURIH.js";import{b as F}from"./chunk-JZMRBJH3.js";import{a as ae}from"./chunk-CZJZCJRX.js";import{a as ne}from"./chunk-NEMPLS7C.js";import{a as z}from"./chunk-KUNDCAQN.js";import{B as Z,D as ee,d as K,e as Q,sa as te}from"./chunk-ACTDYTAV.js";import{f as T,h as X,i as B}from"./chunk-F5HCSUXC.js";import{a as k}from"./chunk-U6HYEGAE.js";import{b as H,f as O}from"./chunk-JJJTPEMD.js";import{d as E}from"./chunk-YN6A26QL.js";import{C as G,p as P,x as L,y as _}from"./chunk-KK24VGVE.js";import{D as q,F as U,H as b,J as V,z as $}from"./chunk-GMTNOCMS.js";import{h as m}from"./chunk-R2R6JDNH.js";import{a as xe}from"./chunk-CTNBSUVU.js";import{Oa as j,Ta as h,Ua as R,Wa as D,X as f,_ as M,ka as w,qa as N,rb as W,wa as g,ya as v}from"./chunk-Y34LWI3S.js";import{e as Y}from"./chunk-XAOYKECS.js";import{d as p,n as C}from"./chunk-773TIA5M.js";import{e as he,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function re(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}d();d();async function ie(e,t){let r=e?.path??"",n=p(t,r);if(!await h(n))throw new m(`
1
+ import{c as J}from"./chunk-Y47C3LSX.js";import{b as F}from"./chunk-O7DZXO3O.js";import{a as ae}from"./chunk-7LWUHQIF.js";import{a as ne}from"./chunk-UZARYOLN.js";import{a as z}from"./chunk-YESGYUEL.js";import{B as Z,D as ee,d as K,e as Q,wa as te}from"./chunk-ZZRFG6ME.js";import{b as T,d as X,e as B}from"./chunk-XOCB4KNX.js";import{a as k}from"./chunk-NROVZETL.js";import{b as H,f as O}from"./chunk-YEVGLC5X.js";import{e as E}from"./chunk-3JXPOOFV.js";import{C as G,p as P,x as L,y as _}from"./chunk-Y5PRPHLQ.js";import{D as q,F as U,H as b,J as V,z as $}from"./chunk-YFINLODF.js";import{h as m}from"./chunk-BWJIZYAG.js";import{a as xe}from"./chunk-CTNBSUVU.js";import{Oa as j,Ta as h,Ua as R,Wa as D,X as f,_ as M,ka as w,qa as N,rb as W,wa as g,ya as v}from"./chunk-VFM2KQRM.js";import{e as Y}from"./chunk-R6ICQT2D.js";import{d as p,n as C}from"./chunk-773TIA5M.js";import{e as he,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function re(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}d();d();async function ie(e,t){let r=e?.path??"",n=p(t,r);if(!await h(n))throw new m(`
2
2
  The extension is not available for ${e?.value}`);return n}async function oe({name:e,app:t}){let r=M(e),n=p(t.directory,B.extensions.directoryName,r);if(await h(n))throw new m(`
3
3
  A directory with this name (${r}) already exists.
4
4
  Choose a new name for your extension.`);return await g(n),await N(p(n,T.lockFile)),n}function A(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function se(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,n=e.extensionTemplate.supportedFlavors.find(o=>o.value===r),a=await oe({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,s={directory:a,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:n,onGetTemplateRepository:e.onGetTemplateRepository??(async(o,c)=>{await J({repoUrl:o,destination:c,shallow:!0})})};return await we(s),{directory:C(a),extensionTemplate:e.extensionTemplate}}async function we(e){try{switch(e.type){case"theme":await ge(e);break;case"function":await ve(e);break;default:await Ee(e);break}let t=p(e.directory,T.lockFile);await v(t)}catch(t){throw await v(e.directory),t}}async function ge({directory:e,url:t,type:r,name:n,extensionFlavor:a,onGetTemplateRepository:i}){return w(async s=>{let o=await I(t,a,s,i);await F(o,e,{name:n,type:r,uid:E(f(n))})})}async function ve({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=A(i?.value),c=[];c.push({title:"Generating function extension",task:async()=>{if(await w(async l=>{let u=await I(t,i,l,s);await F(u,e,{name:a,handle:f(a),flavor:i?.value,uid:E(f(a))})}),o==="javascript"){let l=ce(i?.value??"rust");await le(e,l,"!(*.graphql)")}}}),o==="javascript"&&c.push({title:"Installing additional dependencies",task:async()=>{n.usesWorkspaces&&await P({packageManager:n.packageManager,directory:n.directory});let l=Fe(o);await _(l,{packageManager:n.packageManager,type:"prod",directory:n.usesWorkspaces?e:n.directory})}}),o==="javascript"&&c.push({title:"Building GraphQL types",task:async()=>{await Q({directory:e,isJavaScript:!0},{stdout:process.stdout,stderr:process.stderr,app:r})}}),await b(c)}async function Ee({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=A(i?.value),c=[{title:"Generating extension",task:async()=>{let l=ce(i?.value??"vanilla-js");await w(async u=>{let y=await I(t,i,u,s);await F(y,e,{srcFileExtension:l,name:a,handle:f(a),flavor:i?.value??"",uid:E(f(a))})}),o==="javascript"&&await le(e,l)}},{title:"Installing dependencies",task:async()=>{let l=n.packageManager;if(n.usesWorkspaces)A(i?.value)==="javascript"&&await P({packageManager:l,directory:n.directory});else{await Te(n.directory,i?.value);let u=p(e,"package.json"),y=await ke(u);await _(y,{packageManager:l,type:"prod",directory:n.directory}),await v(u)}}}];c.push({title:"Update shared type definition",task:async()=>{await ee(r)}}),await b(c)}function ce(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function Fe(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${K}.0.0`}),t}async function le(e,t,r="*"){let n=await D(p(e,"src",r)),a=[];for(let i of n)a.push(j(i,`${i}.${t}`));await Promise.all(a)}async function Te(e,t){t==="typescript-react"&&await G(e,{"@types/react":X.reactTypes})}async function ke(e){if(!await h(e))return[];let t=await L(e);return Object.entries(t?.dependencies??{}).map(([r,n])=>({name:r,version:n}))}async function I(e,t,r,n){let a=p(r,"download");return await g(a),await n(e,a),ie(t,a)}d();function Pe(e,t=[]){let r=[...e.map(a=>({label:a.name,value:a.identifier,group:a.group||"Other",sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(a=>({label:`${a.name} (limit reached)`,value:a.identifier,group:a.group||"Other",disabled:!0,sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER}))],n=(a,i)=>a.sortPriority===i.sortPriority?a.label.localeCompare(i.label):a.sortPriority-i.sortPriority;return r.sort(n)}var _e=async e=>{let t=e.extensionTemplates,r=e.templateType,n=e.extensionFlavor;if(!r){if(n&&(t=t.filter(c=>c.supportedFlavors.map(l=>l.value).includes(n))),t.length===0)throw new m("You have reached the limit for the number of extensions you can create.");r=await U({message:"Type of extension?",choices:Pe(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let a=t.find(c=>c.identifier===r),i=e.name||await pe(e.directory,a.defaultName),s=e.extensionFlavor??await be(a);return{extensionTemplate:a,extensionContent:{name:i,flavor:s}}};async function pe(e,t,r=1){let n=t.includes(" ")?" ":"-",a=r<=1?t:`${t}${n}${r}`,i=p(e,f(a));return R(i)?pe(e,t,r+1):V({message:"Name your extension:",defaultValue:a})}async function be(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:q({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var de=_e;async function Oe(e){let{app:t,developerPlatformClient:r,remoteApp:n,specifications:a,template:i}=e,s=a.map(ye=>ye.identifier),{templates:o,groupOrder:c}=await re(r,n,s,{requestedTemplate:i}),l=await Ae(o,c,a,t,e),u=await de(l);await Se(u,i);let y=Ce(u,t,e,r),fe=await se(y);Me(fe,e.project.packageManager)}async function Ae(e,t,r,n,a){let i=await Re(a.template,n,e,r);Ne(i,a.flavor);let{validTemplates:s,templatesOverlimit:o}=Ie(e,r,n);return{templateType:i?.identifier,name:a.name,extensionFlavor:a.flavor,directory:p(a.directory,"extensions"),app:n,extensionTemplates:s??[],unavailableExtensions:o??[],reset:a.reset,groupOrder:t}}function Ie(e,t,r){return ae(e,a=>!ue(r,t,a)?"validTemplates":"templatesOverlimit")}function ue(e,t,r){let n=r.type,a=t.find(s=>s.identifier===n||s.externalIdentifier===n);return e.extensionsForType({identifier:n,externalIdentifier:n}).length>=(a?.registrationLimit??1)}async function Se(e,t){let{extensionContent:r}=e;return k.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Ce(e,t,r,n){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:n}}function Me(e,t){let r=je(e.extensionTemplate,e.directory,t);$(r)}function Ne(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(n=>n.value);if(!r.includes(t))throw new m("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}function je(e,t,r){let n={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&n.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:W(r,"shopify app dev")}]),e.supportLinks[0]&&n.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),n}async function Re(e,t,r,n){if(!e)return;let a=r.find(i=>i.identifier===e);if(!a){let i=await Y(),s=r.map(c=>c.identifier),o=i?"You might need to enable some flags on your Organization or App":void 0;throw new m(`Unknown extension type: ${e}.
@@ -1,4 +1,4 @@
1
- import{a as fo}from"./chunk-RJ5VF3QY.js";import{h as ho,k as po}from"./chunk-R2R6JDNH.js";import{a as Ic}from"./chunk-CX5CC6P5.js";import{Ab as Ve,Ra as Qr,Sa as cr,sb as Fe}from"./chunk-Y34LWI3S.js";import{f as mo}from"./chunk-XAOYKECS.js";import{a as uo,b as lo}from"./chunk-DPNZWBT5.js";import{i as ar}from"./chunk-773TIA5M.js";import{c as g,e as Zr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ke=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ke;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ke&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function Co(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hn(r,e[n]),r.push(t[++n]);return new se(r)}q._=Co;var fn=new se("+");function Do(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(fn),hn(r,e[n]),r.push(fn,Tt(t[++n]));return zc(r),new se(r)}q.str=Do;function hn(t,e){e instanceof se?t.push(...e._items):e instanceof Ke?t.push(e):t.push(Uc(e))}q.addCodeArg=hn;function zc(t){let e=1;for(;e<t.length-1;){if(t[e]===fn){let r=Fc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Fc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ke||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ke))return`"${t}${e.slice(1)}`}function Vc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Do`${t}${e}`}q.strConcat=Vc;function Uc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Lc(t){return new se(Tt(t))}q.stringify=Lc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Kc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):Co`[${t}]`}q.getProperty=Kc;function Gc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Gc;function Hc(t){return new se(t.toString())}q.regexpCode=Hc});var yn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),pn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},fr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(fr||(Q.UsedValueState=fr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var hr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=hr;var pr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=pr;var Wc=(0,Z._)`\n`,mn=class extends hr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Wc:Z.nil}}get(){return this._scope}name(e){return new pr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,fr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new pn(l);c.set(l,fr.Completed)})}return o}};Q.ValueScope=mn});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=yn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var gr=yn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return gr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return gr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return gr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return gr.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_n=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},mr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return _r(e,this.rhs)}},gn=class extends mr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},$n=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},wn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},En=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Jc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>We(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Sn=class extends Rt{},st=class extends Ne{};st.kind="else";var Ge=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return _r(e,this.condition),this.else&&We(e,this.else.names),e}};Ge.kind="if";var He=class extends Ne{};He.kind="for";var bn=class extends He{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return We(super.names,this.iteration.names)}},Pn=class extends He{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=_r(super.names,this.from);return _r(e,this.to)}},yr=class extends He{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return We(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var Nn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&We(e,this.catch.names),this.finally&&We(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var In=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
1
+ import{a as fo}from"./chunk-RJ5VF3QY.js";import{h as ho,k as po}from"./chunk-BWJIZYAG.js";import{a as Ic}from"./chunk-CX5CC6P5.js";import{Ab as Ve,Ra as Qr,Sa as cr,sb as Fe}from"./chunk-VFM2KQRM.js";import{f as mo}from"./chunk-R6ICQT2D.js";import{a as uo,b as lo}from"./chunk-DPNZWBT5.js";import{i as ar}from"./chunk-773TIA5M.js";import{c as g,e as Zr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ke=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ke;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ke&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function Co(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hn(r,e[n]),r.push(t[++n]);return new se(r)}q._=Co;var fn=new se("+");function Do(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(fn),hn(r,e[n]),r.push(fn,Tt(t[++n]));return zc(r),new se(r)}q.str=Do;function hn(t,e){e instanceof se?t.push(...e._items):e instanceof Ke?t.push(e):t.push(Uc(e))}q.addCodeArg=hn;function zc(t){let e=1;for(;e<t.length-1;){if(t[e]===fn){let r=Fc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Fc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ke||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ke))return`"${t}${e.slice(1)}`}function Vc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Do`${t}${e}`}q.strConcat=Vc;function Uc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Lc(t){return new se(Tt(t))}q.stringify=Lc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Kc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):Co`[${t}]`}q.getProperty=Kc;function Gc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Gc;function Hc(t){return new se(t.toString())}q.regexpCode=Hc});var yn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),pn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},fr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(fr||(Q.UsedValueState=fr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var hr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=hr;var pr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=pr;var Wc=(0,Z._)`\n`,mn=class extends hr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Wc:Z.nil}}get(){return this._scope}name(e){return new pr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,fr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new pn(l);c.set(l,fr.Completed)})}return o}};Q.ValueScope=mn});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=yn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var gr=yn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return gr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return gr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return gr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return gr.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_n=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},mr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return _r(e,this.rhs)}},gn=class extends mr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},$n=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},wn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},En=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Jc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>We(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Sn=class extends Rt{},st=class extends Ne{};st.kind="else";var Ge=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return _r(e,this.condition),this.else&&We(e,this.else.names),e}};Ge.kind="if";var He=class extends Ne{};He.kind="for";var bn=class extends He{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return We(super.names,this.iteration.names)}},Pn=class extends He{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=_r(super.names,this.from);return _r(e,this.to)}},yr=class extends He{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return We(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var Nn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&We(e,this.catch.names),this.finally&&We(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var In=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
2
  `:""},this._extScope=e,this._scope=new le.Scope({parent:e}),this._nodes=[new Sn]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new _n(e,o,n)),o}const(e,r,n){return this._def(le.varKinds.const,e,r,n)}let(e,r,n){return this._def(le.varKinds.let,e,r,n)}var(e,r,n){return this._def(le.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new mr(e,r,n))}add(e,r){return this._leafNode(new gn(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==O.nil&&this._leafNode(new En(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,O.addCodeArg)(r,s));return r.push("}"),new O._Code(r)}if(e,r,n){if(this._blockNode(new Ge(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ge(e))}else(){return this._elseNode(new st)}endIf(){return this._endBlockNode(Ge,st)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new bn(e),r)}forRange(e,r,n,s,o=this.opts.es5?le.varKinds.var:le.varKinds.let){let i=this._scope.toName(e);return this._for(new Pn(o,i,r,n),()=>s(i))}forOf(e,r,n,s=le.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof O.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,O._)`${i}.length`,a=>{this.var(o,(0,O._)`${i}[${a}]`),n(o)})}return this._for(new yr("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?le.varKinds.var:le.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,O._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new yr("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(He)}label(e){return this._leafNode(new $n(e))}break(e){return this._leafNode(new vn(e))}return(e){let r=new qt;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(qt)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new Nn;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new At(o),r(o)}return n&&(this._currNode=s.finally=new Ct,this.code(n)),this._endBlockNode(At,Ct)}throw(e){return this._leafNode(new wn(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=O.nil,n,s){return this._blockNode(new jt(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(jt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ge))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=In;function We(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function _r(t,e){return e instanceof O._CodeOrName?We(t,e.names):t}function ot(t,e,r){if(t instanceof O.Name)return n(t);if(!s(t))return t;return new O._Code(t._items.reduce((o,i)=>(i instanceof O.Name&&(i=n(i)),i instanceof O._Code?o.push(...i._items):o.push(i),o),[]));function n(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function s(o){return o instanceof O._Code&&o._items.some(i=>i instanceof O.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Jc(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Mo(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,O._)`!${On(t)}`}P.not=Mo;var Yc=xo(P.operators.AND);function Bc(...t){return t.reduce(Yc)}P.and=Bc;var Xc=xo(P.operators.OR);function Zc(...t){return t.reduce(Xc)}P.or=Zc;function xo(t){return(e,r)=>e===O.nil?r:r===O.nil?e:(0,O._)`${On(e)} ${t} ${On(r)}`}function On(t){return t instanceof O.Name?t:(0,O._)`(${t})`}});var k=g(N=>{"use strict";u();Object.defineProperty(N,"__esModule",{value:!0});N.checkStrictMode=N.getErrorPath=N.Type=N.useFunc=N.setEvaluated=N.evaluatedPropsToName=N.mergeEvaluated=N.eachItem=N.unescapeJsonPointer=N.escapeJsonPointer=N.escapeFragment=N.unescapeFragment=N.schemaRefOrVal=N.schemaHasRulesButRef=N.schemaHasRules=N.checkUnknownRules=N.alwaysValidSchema=N.toHash=void 0;var C=b(),Qc=kt();function eu(t){let e={};for(let r of t)e[r]=!0;return e}N.toHash=eu;function tu(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Vo(t,e),!Uo(e,t.self.RULES.all))}N.alwaysValidSchema=tu;function Vo(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||Go(t,`unknown keyword: "${o}"`)}N.checkUnknownRules=Vo;function Uo(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}N.schemaHasRules=Uo;function ru(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}N.schemaHasRulesButRef=ru;function nu({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,C._)`${r}`}return(0,C._)`${t}${e}${(0,C.getProperty)(n)}`}N.schemaRefOrVal=nu;function su(t){return Lo(decodeURIComponent(t))}N.unescapeFragment=su;function ou(t){return encodeURIComponent(kn(t))}N.escapeFragment=ou;function kn(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}N.escapeJsonPointer=kn;function Lo(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}N.unescapeJsonPointer=Lo;function iu(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}N.eachItem=iu;function zo({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof C.Name?(o instanceof C.Name?t(s,o,i):e(s,o,i),i):o instanceof C.Name?(e(s,i,o),o):r(o,i);return a===C.Name&&!(c instanceof C.Name)?n(s,c):c}}N.mergeEvaluated={props:zo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,C._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,C._)`${r} || {}`).code((0,C._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,C._)`${r} || {}`),Rn(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Ko}),items:zo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,C._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,C._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Ko(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,C._)`{}`);return e!==void 0&&Rn(t,r,e),r}N.evaluatedPropsToName=Ko;function Rn(t,e,r){Object.keys(r).forEach(n=>t.assign((0,C._)`${e}${(0,C.getProperty)(n)}`,!0))}N.setEvaluated=Rn;var Fo={};function au(t,e){return t.scopeValue("func",{ref:e,code:Fo[e.code]||(Fo[e.code]=new Qc._Code(e.code))})}N.useFunc=au;var Tn;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Tn||(N.Type=Tn={}));function cu(t,e,r){if(t instanceof C.Name){let n=e===Tn.Num;return r?n?(0,C._)`"[" + ${t} + "]"`:(0,C._)`"['" + ${t} + "']"`:n?(0,C._)`"/" + ${t}`:(0,C._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,C.getProperty)(t).toString():"/"+kn(t)}N.getErrorPath=cu;function Go(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}N.checkStrictMode=Go});var Ie=g(jn=>{"use strict";u();Object.defineProperty(jn,"__esModule",{value:!0});var H=b(),uu={data:new H.Name("data"),valCxt:new H.Name("valCxt"),instancePath:new H.Name("instancePath"),parentData:new H.Name("parentData"),parentDataProperty:new H.Name("parentDataProperty"),rootData:new H.Name("rootData"),dynamicAnchors:new H.Name("dynamicAnchors"),vErrors:new H.Name("vErrors"),errors:new H.Name("errors"),this:new H.Name("this"),self:new H.Name("self"),scope:new H.Name("scope"),json:new H.Name("json"),jsonPos:new H.Name("jsonPos"),jsonLen:new H.Name("jsonLen"),jsonPart:new H.Name("jsonPart")};jn.default=uu});var Dt=g(W=>{"use strict";u();Object.defineProperty(W,"__esModule",{value:!0});W.extendErrors=W.resetErrorsCount=W.reportExtraError=W.reportError=W.keyword$DataError=W.keywordError=void 0;var R=b(),$r=k(),Y=Ie();W.keywordError={message:({keyword:t})=>(0,R.str)`must pass "${t}" keyword validation`};W.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,R.str)`"${t}" keyword must be ${e} ($data)`:(0,R.str)`"${t}" keyword is invalid ($data)`};function lu(t,e=W.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:i,allErrors:a}=s,c=Jo(t,e,r);n??(i||a)?Ho(o,c):Wo(s,(0,R._)`[${c}]`)}W.reportError=lu;function du(t,e=W.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:i}=n,a=Jo(t,e,r);Ho(s,a),o||i||Wo(n,Y.default.vErrors)}W.reportExtraError=du;function fu(t,e){t.assign(Y.default.errors,e),t.if((0,R._)`${Y.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,R._)`${Y.default.vErrors}.length`,e),()=>t.assign(Y.default.vErrors,null)))}W.resetErrorsCount=fu;function hu({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",s,Y.default.errors,a=>{t.const(i,(0,R._)`${Y.default.vErrors}[${a}]`),t.if((0,R._)`${i}.instancePath === undefined`,()=>t.assign((0,R._)`${i}.instancePath`,(0,R.strConcat)(Y.default.instancePath,o.errorPath))),t.assign((0,R._)`${i}.schemaPath`,(0,R.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,R._)`${i}.schema`,r),t.assign((0,R._)`${i}.data`,n))})}W.extendErrors=hu;function Ho(t,e){let r=t.const("err",e);t.if((0,R._)`${Y.default.vErrors} === null`,()=>t.assign(Y.default.vErrors,(0,R._)`[${r}]`),(0,R._)`${Y.default.vErrors}.push(${r})`),t.code((0,R._)`${Y.default.errors}++`)}function Wo(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,R._)`new ${t.ValidationError}(${e})`):(r.assign((0,R._)`${n}.errors`,e),r.return(!1))}var Je={keyword:new R.Name("keyword"),schemaPath:new R.Name("schemaPath"),params:new R.Name("params"),propertyName:new R.Name("propertyName"),message:new R.Name("message"),schema:new R.Name("schema"),parentSchema:new R.Name("parentSchema")};function Jo(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,R._)`{}`:pu(t,e,r)}function pu(t,e,r={}){let{gen:n,it:s}=t,o=[mu(s,r),yu(t,r)];return _u(t,e,o),n.object(...o)}function mu({errorPath:t},{instancePath:e}){let r=e?(0,R.str)`${t}${(0,$r.getErrorPath)(e,$r.Type.Str)}`:t;return[Y.default.instancePath,(0,R.strConcat)(Y.default.instancePath,r)]}function yu({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,R.str)`${e}/${t}`;return r&&(s=(0,R.str)`${s}${(0,$r.getErrorPath)(r,$r.Type.Str)}`),[Je.schemaPath,s]}function _u(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=t,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;n.push([Je.keyword,s],[Je.params,typeof e=="function"?e(t):e||(0,R._)`{}`]),c.messages&&n.push([Je.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Je.schema,i],[Je.parentSchema,(0,R._)`${d}${f}`],[Y.default.data,o]),l&&n.push([Je.propertyName,l])}});var Bo=g(it=>{"use strict";u();Object.defineProperty(it,"__esModule",{value:!0});it.boolOrEmptySchema=it.topBoolOrEmptySchema=void 0;var gu=Dt(),$u=b(),vu=Ie(),wu={message:"boolean schema is false"};function Eu(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Yo(t,!1):typeof r=="object"&&r.$async===!0?e.return(vu.default.data):(e.assign((0,$u._)`${n}.errors`,null),e.return(!0))}it.topBoolOrEmptySchema=Eu;function Su(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Yo(t)):r.var(e,!0)}it.boolOrEmptySchema=Su;function Yo(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,gu.reportError)(s,wu,void 0,e)}});var qn=g(at=>{"use strict";u();Object.defineProperty(at,"__esModule",{value:!0});at.getRules=at.isJSONType=void 0;var bu=["string","number","integer","boolean","null","object","array"],Pu=new Set(bu);function Nu(t){return typeof t=="string"&&Pu.has(t)}at.isJSONType=Nu;function Iu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}at.getRules=Iu});var An=g(Re=>{"use strict";u();Object.defineProperty(Re,"__esModule",{value:!0});Re.shouldUseRule=Re.shouldUseGroup=Re.schemaHasRulesForType=void 0;function Ou({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Xo(t,n)}Re.schemaHasRulesForType=Ou;function Xo(t,e){return e.rules.some(r=>Zo(t,r))}Re.shouldUseGroup=Xo;function Zo(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Re.shouldUseRule=Zo});var Mt=g(J=>{"use strict";u();Object.defineProperty(J,"__esModule",{value:!0});J.reportTypeError=J.checkDataTypes=J.checkDataType=J.coerceAndCheckDataType=J.getJSONTypes=J.getSchemaTypes=J.DataType=void 0;var Tu=qn(),ku=An(),Ru=Dt(),S=b(),Qo=k(),ct;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ct||(J.DataType=ct={}));function ju(t){let e=ei(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}J.getSchemaTypes=ju;function ei(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Tu.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}J.getJSONTypes=ei;function qu(t,e){let{gen:r,data:n,opts:s}=t,o=Au(e,s.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,ku.schemaHasRulesForType)(t,e[0]));if(i){let a=Dn(e,n,s.strictNumbers,ct.Wrong);r.if(a,()=>{o.length?Cu(t,e,o):Mn(t)})}return i}J.coerceAndCheckDataType=qu;var ti=new Set(["string","number","integer","boolean","null"]);function Au(t,e){return e?t.filter(r=>ti.has(r)||e==="array"&&r==="array"):[]}function Cu(t,e,r){let{gen:n,data:s,opts:o}=t,i=n.let("dataType",(0,S._)`typeof ${s}`),a=n.let("coerced",(0,S._)`undefined`);o.coerceTypes==="array"&&n.if((0,S._)`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,S._)`${s}[0]`).assign(i,(0,S._)`typeof ${s}`).if(Dn(e,s,o.strictNumbers),()=>n.assign(a,s))),n.if((0,S._)`${a} !== undefined`);for(let l of r)(ti.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),Mn(t),n.endIf(),n.if((0,S._)`${a} !== undefined`,()=>{n.assign(s,a),Du(t,a)});function c(l){switch(l){case"string":n.elseIf((0,S._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,S._)`"" + ${s}`).elseIf((0,S._)`${s} === null`).assign(a,(0,S._)`""`);return;case"number":n.elseIf((0,S._)`${i} == "boolean" || ${s} === null
3
3
  || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,S._)`+${s}`);return;case"integer":n.elseIf((0,S._)`${i} === "boolean" || ${s} === null
4
4
  || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,S._)`+${s}`);return;case"boolean":n.elseIf((0,S._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,S._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,S._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,S._)`${i} === "string" || ${i} === "number"
@@ -1 +1 @@
1
- import{b as E}from"./chunk-JJJTPEMD.js";import{b}from"./chunk-RY2SJVWM.js";import{Q as F,R as N}from"./chunk-GMTNOCMS.js";import{a as U}from"./chunk-CTNBSUVU.js";import{S as C,Ta as w,ma as O,xb as k}from"./chunk-Y34LWI3S.js";import{i as n}from"./chunk-B4OMIONW.js";import{j as R}from"./chunk-XAOYKECS.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{static description="Doctor test suite";context;assertions=[];registeredTests=[];async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let o of this.registeredTests){this.assertions=[];let s=Date.now();try{await o.fn(),e.push({name:o.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:o.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let o=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:o,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let o=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:o,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,o){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:o??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:o??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,o){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:o??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:o??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:o??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,o){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:o??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,o){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:o??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:o??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:o??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,o){this.assertions.push({description:o,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};var p=class extends m{static description="Tests the theme init command creates a valid theme structure";themeName="";themePath="";tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let t=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(t),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let t=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(t.map(e=>this.assertFile(u(this.themePath,e))))}),this.test("theme directories exist",async()=>{let t=["sections","snippets","assets","locales"];await Promise.all(t.map(e=>this.assertDirectory(u(this.themePath,e))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static description="Tests pushing a theme to the store creates an unpublished theme";static requiresStore=!0;tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let o=await this.run(e);this.assertSuccess(o);let s=this.assertJson(o,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(i){return{workingDirectory:i.path??y(),environment:i.environment,store:i.store,password:i.password,data:{}}}d();var a=i=>k(i),v;function J(i){v=i}function G(i){if(!v)return i;let t=/\/[^\s,)]+/g;return i.replace(t,e=>T(e,v))}function A(i,t){a(""),a(n.bold(n.cyan(`Suite: ${i}`))),a(n.dim(t))}function j(i){a(n.bold(n.blue(`Running: ${i}`)))}function q(i){let t=`(${(i.duration/1e3).toFixed(2)}s)`;if(i.status==="passed"){a(n.bold(n.green(`PASSED: ${i.name} ${n.dim(t)}`)));for(let e of I(i.assertions))a(e)}else if(i.status==="failed"){a(n.red(`FAILED: ${i.name} ${n.dim(t)}`));for(let e of I(i.assertions))a(e);i.error&&a(n.red(` Error: ${G(i.error.message)}`))}else a(n.yellow(`SKIPPED: ${i.name}`))}function S(i){let t=i.filter(h=>h.status==="passed").length,e=i.filter(h=>h.status==="failed").length,o=i.filter(h=>h.status==="skipped").length,s=i.length,r=i.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),o>0&&a(` Skipped: ${n.yellow(String(o))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(i){return i.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(i){let t=[],e=_(i);J(e.workingDirectory);for(let o of Y){let s=new o,r=o.description??"Test suite";A(o.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class i extends b{static description="Run all theme command doctor-release tests";static hidden=!0;static flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})};async run(){if(!R())return;let{flags:t}=await this.parse(i);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};
1
+ import{b as E}from"./chunk-YEVGLC5X.js";import{b}from"./chunk-2XDUJQQN.js";import{Q as F,R as N}from"./chunk-YFINLODF.js";import{a as U}from"./chunk-CTNBSUVU.js";import{S as C,Ta as w,ma as O,xb as k}from"./chunk-VFM2KQRM.js";import{i as n}from"./chunk-B4OMIONW.js";import{j as R}from"./chunk-R6ICQT2D.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{static description="Doctor test suite";context;assertions=[];registeredTests=[];async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let o of this.registeredTests){this.assertions=[];let s=Date.now();try{await o.fn(),e.push({name:o.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:o.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let o=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:o,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let o=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:o,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,o){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:o??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:o??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,o){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:o??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:o??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:o??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,o){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:o??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,o){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:o??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:o??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:o??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,o){this.assertions.push({description:o,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};var p=class extends m{static description="Tests the theme init command creates a valid theme structure";themeName="";themePath="";tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let t=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(t),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let t=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(t.map(e=>this.assertFile(u(this.themePath,e))))}),this.test("theme directories exist",async()=>{let t=["sections","snippets","assets","locales"];await Promise.all(t.map(e=>this.assertDirectory(u(this.themePath,e))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static description="Tests pushing a theme to the store creates an unpublished theme";static requiresStore=!0;tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let o=await this.run(e);this.assertSuccess(o);let s=this.assertJson(o,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(i){return{workingDirectory:i.path??y(),environment:i.environment,store:i.store,password:i.password,data:{}}}d();var a=i=>k(i),v;function J(i){v=i}function G(i){if(!v)return i;let t=/\/[^\s,)]+/g;return i.replace(t,e=>T(e,v))}function A(i,t){a(""),a(n.bold(n.cyan(`Suite: ${i}`))),a(n.dim(t))}function j(i){a(n.bold(n.blue(`Running: ${i}`)))}function q(i){let t=`(${(i.duration/1e3).toFixed(2)}s)`;if(i.status==="passed"){a(n.bold(n.green(`PASSED: ${i.name} ${n.dim(t)}`)));for(let e of I(i.assertions))a(e)}else if(i.status==="failed"){a(n.red(`FAILED: ${i.name} ${n.dim(t)}`));for(let e of I(i.assertions))a(e);i.error&&a(n.red(` Error: ${G(i.error.message)}`))}else a(n.yellow(`SKIPPED: ${i.name}`))}function S(i){let t=i.filter(h=>h.status==="passed").length,e=i.filter(h=>h.status==="failed").length,o=i.filter(h=>h.status==="skipped").length,s=i.length,r=i.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),o>0&&a(` Skipped: ${n.yellow(String(o))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(i){return i.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(i){let t=[],e=_(i);J(e.workingDirectory);for(let o of Y){let s=new o,r=o.description??"Test suite";A(o.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class i extends b{static description="Run all theme command doctor-release tests";static hidden=!0;static flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})};async run(){if(!R())return;let{flags:t}=await this.parse(i);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-HZIX3DIT.js";import{a as e}from"./chunk-6EBLULOC.js";import{a as o}from"./chunk-WCRZJY3P.js";import{b as i}from"./chunk-RY2SJVWM.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static description="View all the available UI kit components";static hiddenAliases=["kitchen-sink all"];static hidden=!0;async run(){await o(),await e(),await s()}};export{t as a};
1
+ import{a as s}from"./chunk-U2DWBZK2.js";import{a as e}from"./chunk-TEY4LRY7.js";import{a as o}from"./chunk-CIWKN4HF.js";import{b as i}from"./chunk-2XDUJQQN.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static description="View all the available UI kit components";static hiddenAliases=["kitchen-sink all"];static hidden=!0;async run(){await o(),await e(),await s()}};export{t as a};
@@ -0,0 +1 @@
1
+ import{A as s,y as d,z as a}from"./chunk-YFINLODF.js";import{wb as r}from"./chunk-VFM2KQRM.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();function l(e){let i=e.status==="success"?{schemaVersion:1,...e.submission}:{schemaVersion:1,...e.submission,failure:e.failure};return JSON.stringify(i,null,2)}function p(e){return JSON.stringify({schemaVersion:1,outcomes:e.outcomes},null,2)}function D(e){f(e)}function R(e,i){return i.json?r(l(e)):e.status==="failed"?S(e):i.watch?d({headline:"Subscription migration operations.",body:e.submission.operations.map(({operation:o})=>c(o))}):f(e.submission),e.status==="failed"?1:0}function v(e,i){let o=e.outcomes.some(({status:n})=>n==="failed");return i.json?r(p(e)):o?s({headline:"Some subscription migration operations could not be canceled.",body:m(e.outcomes)}):a({headline:"Subscription migration operations canceled.",body:m(e.outcomes)}),o?1:0}function f(e){let i=e.action==="schedule"?"scheduled":"unscheduled";a({headline:`Subscription migrations ${i}.`,body:[`Shops: ${e.total}`,"Operation IDs:",...e.operations.map(({operation:o})=>o.id),"Save every operation ID. You will need them to check or cancel this submission."]})}function S(e){if(e.failure.type==="operations"){s({headline:"Some subscription migration operations failed.",body:["Failed operation IDs:",...e.failure.operationIds,"Terminal operation outcomes:",...e.submission.operations.map(({operation:o})=>c(o)),"Save every operation ID. You will need them to inspect this submission."]});return}let i=e.submission.operations.map(({operation:o})=>o.id);s({headline:i.length===0?"Subscription migration submission failed.":"Some subscription migration operations were accepted before submission failed.",body:[...i.length===0?["Accepted operation IDs: None."]:["Accepted operation IDs:",...i],`Batch index: ${e.failure.batchIndex}`,"Errors:",...e.failure.userErrors.map(({message:o})=>o),...i.length===0?[]:["Save every accepted operation ID. You will need them to check or cancel accepted operations."]]})}function m(e){let i=e.filter(n=>n.status==="success"),o=e.filter(n=>n.status==="failed");return[...i.length===0?["Canceled operations: None."]:["Canceled operations:",...i.map(({operation:n})=>c(n))],...o.length===0?[]:["Failed operations:",...o.map(({operationId:n,operation:u,userErrors:b})=>{let h=u?` (returned status: ${u.status})`:"";return`${n}: ${b.map(({message:g})=>g).join("; ")}${h}`})]]}function c(e){return`${e.id}: ${e.status} (${e.results.edges.length}/${e.total} settled)`}export{D as a,R as b,v as c};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-TTAPXLI5.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends Error{type;constructor(e,p){super(p),this.type=e}},i=r=>async()=>r,s=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var d="cloudflare",v=i({name:d});export{o as a,s as b,d as c,v as d};
1
+ import{b as n}from"./chunk-XF2KTEID.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends Error{type;constructor(e,p){super(p),this.type=e}},i=r=>async()=>r,s=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var d="cloudflare",v=i({name:d});export{o as a,s as b,d as c,v as d};
@@ -1,4 +1,4 @@
1
- import{a as V}from"./chunk-WHLGNDRE.js";import{a as N}from"./chunk-CZPGC2E7.js";import{a as F}from"./chunk-DQCIORGH.js";import{k as q,l as H,n as I}from"./chunk-MLZLDL6B.js";import{a as Y}from"./chunk-QPWMD2VR.js";import{a as y,c as U}from"./chunk-KOVAFUYN.js";import{b as L}from"./chunk-QEB3HUQE.js";import{a as p,b as w}from"./chunk-YY6TFARF.js";import{b as g,c as x,d as M,f as _,j as R,n as j,p as D}from"./chunk-4JY2P2A5.js";import{r as k}from"./chunk-OORWOTAP.js";import{aa as B}from"./chunk-PIFW2R3S.js";import{S as b,wa as a,xa as O}from"./chunk-YN6A26QL.js";import{A as d,B as C,E as P,z as f}from"./chunk-GMTNOCMS.js";import{h as S}from"./chunk-R2R6JDNH.js";import{wb as $}from"./chunk-Y34LWI3S.js";import{f as T,q as l}from"./chunk-773TIA5M.js";import{e as z,g as v}from"./chunk-VKWPEFWQ.js";v();var A=z(B(),1);async function Te(e,t,r,o){let n=e.environment?.[0],s=t??await b(k({store:e.store}),e.password);if(e.strict){let m=e.json?"json":"text",{offenses:c}=await L(e.path??l(),m);if(c.length>0&&c.filter(J=>J.severity===A.Severity.ERROR).length>0)throw O(new S(n?`[${n}] Theme check failed. Please fix the errors before pushing.`:"Theme check failed. Please fix the errors before pushing."))}a("theme-service:push:setup"),Y({verbose:e.verbose,noColor:e.noColor});let i=e.force??!1,h=e.path?T(e.path):l();if(!await I(h)&&!await U(i,void 0,n,r))return;e.listing&&await q(h,e.listing);let u=await Z(s,e,r);u&&(a("theme-service:push:setup"),await W(u,s,{allowLive:e.allowLive??!1,environment:n,force:i,ignore:e.ignore??[],json:e.json??!1,multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:h,publish:e.publish??!1,listing:e.listing},o))}async function W(e,t,r,o){a("theme-service:push:file-system");let n=await j(e.id,t),s=H(r.path,{filters:r,listing:r.listing});a("theme-service:push:file-system");let{uploadResults:i,renderThemeSyncProgress:h}=V(e,t,n,s,r,o);await h(),r.publish&&await D(e.id,t),await G(i,e,t,r)}function E(e){for(let[t,r]of e.entries())if(!r.success)return!0;return!1}async function G(e,t,r,o){o.json?K(t,r,e,o.environment):o.publish?Q(r,e,o.environment):X(t,r,e,o.environment)}function K(e,t,r,o){let n={environment:o,theme:{id:e.id,name:e.name,role:e.role,shop:t.storeFqdn,editor_url:w(e,t),preview_url:p(e,t)}};if(E(r)){let i=`${o?`[${o}] `:""}The theme '${e.name}' was pushed with errors`;n.theme.warning=i;let h={};for(let[u,m]of r.entries())!m.success&&m.errors?.asset&&(h[u]=m.errors.asset);Object.keys(h).length>0&&(n.theme.errors=h)}$(JSON.stringify(n))}function Q(e,t,r){let o=r?[{subdued:`Environment: ${r}
1
+ import{a as V}from"./chunk-E5FXOLQO.js";import{k as q,l as H,n as I}from"./chunk-7T6M7FAC.js";import{a as Y}from"./chunk-FDBHQLFK.js";import{b as L}from"./chunk-6MWWJZFN.js";import{a as p,b as w}from"./chunk-YY6TFARF.js";import{a as N}from"./chunk-Q5JX23QU.js";import{a as F}from"./chunk-ZYX7UHCQ.js";import{a as y,c as U}from"./chunk-GRPKF5ZB.js";import{b as g,c as x,d as M,f as _,j as R,n as j,p as D}from"./chunk-5SEEDOQ5.js";import{r as k}from"./chunk-GNBRCK7L.js";import{aa as B}from"./chunk-F3NYCSXT.js";import{T as b,xa as a,ya as O}from"./chunk-3JXPOOFV.js";import{A as d,B as C,E as P,z as f}from"./chunk-YFINLODF.js";import{h as S}from"./chunk-BWJIZYAG.js";import{wb as $}from"./chunk-VFM2KQRM.js";import{f as T,q as l}from"./chunk-773TIA5M.js";import{e as z,g as v}from"./chunk-VKWPEFWQ.js";v();var A=z(B(),1);async function Te(e,t,r,o){let n=e.environment?.[0],s=t??await b(k({store:e.store}),e.password);if(e.strict){let m=e.json?"json":"text",{offenses:c}=await L(e.path??l(),m);if(c.length>0&&c.filter(J=>J.severity===A.Severity.ERROR).length>0)throw O(new S(n?`[${n}] Theme check failed. Please fix the errors before pushing.`:"Theme check failed. Please fix the errors before pushing."))}a("theme-service:push:setup"),Y({verbose:e.verbose,noColor:e.noColor});let i=e.force??!1,h=e.path?T(e.path):l();if(!await I(h)&&!await U(i,void 0,n,r))return;e.listing&&await q(h,e.listing);let u=await Z(s,e,r);u&&(a("theme-service:push:setup"),await W(u,s,{allowLive:e.allowLive??!1,environment:n,force:i,ignore:e.ignore??[],json:e.json??!1,multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:h,publish:e.publish??!1,listing:e.listing},o))}async function W(e,t,r,o){a("theme-service:push:file-system");let n=await j(e.id,t),s=H(r.path,{filters:r,listing:r.listing});a("theme-service:push:file-system");let{uploadResults:i,renderThemeSyncProgress:h}=V(e,t,n,s,r,o);await h(),r.publish&&await D(e.id,t),await G(i,e,t,r)}function E(e){for(let[t,r]of e.entries())if(!r.success)return!0;return!1}async function G(e,t,r,o){o.json?K(t,r,e,o.environment):o.publish?Q(r,e,o.environment):X(t,r,e,o.environment)}function K(e,t,r,o){let n={environment:o,theme:{id:e.id,name:e.name,role:e.role,shop:t.storeFqdn,editor_url:w(e,t),preview_url:p(e,t)}};if(E(r)){let i=`${o?`[${o}] `:""}The theme '${e.name}' was pushed with errors`;n.theme.warning=i;let h={};for(let[u,m]of r.entries())!m.success&&m.errors?.asset&&(h[u]=m.errors.asset);Object.keys(h).length>0&&(n.theme.errors=h)}$(JSON.stringify(n))}function Q(e,t,r){let o=r?[{subdued:`Environment: ${r}
2
2
 
3
3
  `}]:[];E(t)?d({body:[...o,`Your theme was published with errors and is now live at https://${e.storeFqdn}`]}):f({body:[...o,`Your theme is now live at https://${e.storeFqdn}`]})}function X(e,t,r,o){let n=o?[{subdued:`Environment: ${o}
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as E,b as C}from"./chunk-DQCIORGH.js";import{a as J}from"./chunk-QPWMD2VR.js";import{a as p}from"./chunk-KOVAFUYN.js";import{a as v}from"./chunk-YY6TFARF.js";import{r as S}from"./chunk-4JY2P2A5.js";import{p as h,r as D,v as N}from"./chunk-OORWOTAP.js";import{b as q,c as F,f as O}from"./chunk-JJJTPEMD.js";import{S as b}from"./chunk-YN6A26QL.js";import{B as m,E as T,W as d,z as w}from"./chunk-GMTNOCMS.js";import{a as P}from"./chunk-CTNBSUVU.js";import{wb as n}from"./chunk-Y34LWI3S.js";import{e as M,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function x(t,o,e){let{name:r,verbose:u,noColor:l,json:a,force:A}=e,y=d()||A;if(J({verbose:u,noColor:l}),y&&!o){let i="A theme ID is required to duplicate a theme, specify one with the --theme flag";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}let s=o?await C(t,o):await E(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!s){let i=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(s?.role==="development"){let i="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(!y&&!await T({message:`Do you want to duplicate '${s.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${s.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let I=await S(s.id,r,t);a?j(s,t,I):Y(s,t,I)}function Y(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(u=>u.message).join(", ");m({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
1
+ import{a as J}from"./chunk-FDBHQLFK.js";import{a as v}from"./chunk-YY6TFARF.js";import{a as E,b as C}from"./chunk-ZYX7UHCQ.js";import{a as p}from"./chunk-GRPKF5ZB.js";import{r as S}from"./chunk-5SEEDOQ5.js";import{p as h,r as D,v as N}from"./chunk-GNBRCK7L.js";import{b as q,c as F,f as O}from"./chunk-YEVGLC5X.js";import{T as b}from"./chunk-3JXPOOFV.js";import{B as m,E as T,W as d,z as w}from"./chunk-YFINLODF.js";import{a as P}from"./chunk-CTNBSUVU.js";import{wb as n}from"./chunk-VFM2KQRM.js";import{e as M,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function x(t,o,e){let{name:r,verbose:u,noColor:l,json:a,force:A}=e,y=d()||A;if(J({verbose:u,noColor:l}),y&&!o){let i="A theme ID is required to duplicate a theme, specify one with the --theme flag";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}let s=o?await C(t,o):await E(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!s){let i=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(s?.role==="development"){let i="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(!y&&!await T({message:`Do you want to duplicate '${s.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${s.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let I=await S(s.id,r,t);a?j(s,t,I):Y(s,t,I)}function Y(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(u=>u.message).join(", ");m({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
2
2
  Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?w({body:["The theme",...p(t),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:v(e.theme,o)}}]]}):m({body:["The theme",...p(t),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
3
3
  Request ID: `,{subdued:e.requestId}]:[]]})}function j(t,o,e){if(e.userErrors&&e.userErrors.length>0)n(JSON.stringify({message:`The theme '${t.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId}));else if(e.theme){let{id:r,name:u,role:l}=e.theme,a={theme:{id:r,name:u,role:l,shop:o.storeFqdn}};n(JSON.stringify(a))}else n(JSON.stringify({message:`The theme '${t.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}))}var f=M(P(),1);var g=class t extends N{static summary="Duplicates a theme from your theme library.";static usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];static descriptionWithMarkdown=`If you want to duplicate your local theme, you need to run \`shopify theme push\` first.
4
4
 
@@ -1 +1 @@
1
- import{c as m,d as f,e as p}from"./chunk-ZCNIR6YU.js";import{d as c,f as w,j as T}from"./chunk-4JY2P2A5.js";import{g as d}from"./chunk-OORWOTAP.js";import{F as u}from"./chunk-GMTNOCMS.js";import{h as l}from"./chunk-R2R6JDNH.js";import{T as i}from"./chunk-Y34LWI3S.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();async function A(e,r){let n=await m(e),t=new p(r.filter),a=e.storeFqdn;if(t.any())return f(a,n,t)[0];let y=r.header??"",h=n.map(o=>{let S=o.id.toString()===d()?" [current]":"";return{value:async()=>o,label:`${o.name}${S}`,group:i(o.role)}});return r.create&&h.unshift(g(e)),(await u({message:y,choices:h}))()}async function B(e,r){return(await m(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await m(e),t=new p(r),a=e.storeFqdn;return t.any()?f(a,n,t):[]}function g(e){return{value:async()=>{let r=c,n=await w("Name of the new theme"),t=await T({name:n,role:r},e);if(!t)throw new l("The theme could not be created.");return t},label:"[Create a new theme]",group:i(c)}}export{A as a,B as b,C as c};
1
+ import{c as m,d as f,e as p}from"./chunk-E55KS3GZ.js";import{d as c,f as w,j as T}from"./chunk-5SEEDOQ5.js";import{g as d}from"./chunk-GNBRCK7L.js";import{F as u}from"./chunk-YFINLODF.js";import{h as l}from"./chunk-BWJIZYAG.js";import{T as i}from"./chunk-VFM2KQRM.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();async function A(e,r){let n=await m(e),t=new p(r.filter),a=e.storeFqdn;if(t.any())return f(a,n,t)[0];let y=r.header??"",h=n.map(o=>{let S=o.id.toString()===d()?" [current]":"";return{value:async()=>o,label:`${o.name}${S}`,group:i(o.role)}});return r.create&&h.unshift(g(e)),(await u({message:y,choices:h}))()}async function B(e,r){return(await m(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await m(e),t=new p(r),a=e.storeFqdn;return t.any()?f(a,n,t):[]}function g(e){return{value:async()=>{let r=c,n=await w("Name of the new theme"),t=await T({name:n,role:r},e);if(!t)throw new l("The theme could not be created.");return t},label:"[Create a new theme]",group:i(c)}}export{A as a,B as b,C as c};