@shopify/cli 4.5.0 → 4.5.2
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.
- package/dist/{analytics-GAPN4I6R.js → analytics-M7ZU437S.js} +1 -1
- package/dist/{analytics-DMUNCDGT.js → analytics-ZRM4FEOE.js} +1 -1
- package/dist/assets/hydrogen/starter/CHANGELOG.md +8 -0
- package/dist/assets/hydrogen/starter/README.md +4 -4
- package/dist/assets/hydrogen/starter/package.json +1 -1
- package/dist/assets/hydrogen/starter/vite.config.ts +6 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-WFB3FHKV.js → chunk-23LZNWB5.js} +1 -1
- package/dist/{chunk-LMPD55L6.js → chunk-2ACN7JIZ.js} +1 -1
- package/dist/{chunk-B367FOQA.js → chunk-2TJ6LOCC.js} +1 -1
- package/dist/{chunk-KUKYAIOR.js → chunk-34SINZ7L.js} +1 -1
- package/dist/{chunk-3OE5HXHO.js → chunk-35FS2NTM.js} +1 -1
- package/dist/{chunk-P3RGC53U.js → chunk-3EJGRQTH.js} +1 -1
- package/dist/{chunk-K2CIMJJW.js → chunk-3IFZECSI.js} +1 -1
- package/dist/{chunk-SF53RKMO.js → chunk-3OCR7P3S.js} +1 -1
- package/dist/{chunk-XXUWTD7A.js → chunk-42RVM4EZ.js} +1 -1
- package/dist/{chunk-KJQAJUDU.js → chunk-4MLEL3VK.js} +1 -1
- package/dist/{chunk-JGN7YG5X.js → chunk-4P54DKG4.js} +1 -1
- package/dist/chunk-4ROX2TCK.js +1 -0
- package/dist/{chunk-RY2ESY3P.js → chunk-4UJNCOE6.js} +1 -1
- package/dist/{chunk-2MZACB7V.js → chunk-4VJ5VBSR.js} +1 -1
- package/dist/{chunk-WU6GIY22.js → chunk-523SJVNT.js} +1 -1
- package/dist/{chunk-QCBAFI6Z.js → chunk-5CV7GFWZ.js} +1 -1
- package/dist/{chunk-6I3FNLT3.js → chunk-5GVE4ILZ.js} +1 -1
- package/dist/{chunk-GOAKZ2IL.js → chunk-5N7H4PJJ.js} +1 -1
- package/dist/{chunk-F447QKVX.js → chunk-5VC4XXYH.js} +1 -1
- package/dist/{chunk-NJLSZS27.js → chunk-5VRU3BT5.js} +1 -1
- package/dist/{chunk-K7I5BGFC.js → chunk-6AWRW3GS.js} +1 -1
- package/dist/{chunk-SY2AH7C2.js → chunk-6K4DVV37.js} +1 -1
- package/dist/{chunk-ZFOWAMFK.js → chunk-6VR22Z5R.js} +1 -1
- package/dist/{chunk-2IPVQRMI.js → chunk-6ZWMXMNM.js} +1 -1
- package/dist/{chunk-ICXHUPP5.js → chunk-75DBVSVI.js} +1 -1
- package/dist/{chunk-N5U5Q2MG.js → chunk-7AY6HLQG.js} +1 -1
- package/dist/{chunk-4LML2QWN.js → chunk-7AYYQUJG.js} +1 -1
- package/dist/{chunk-J5U2FUIX.js → chunk-7KWBVZPI.js} +1 -1
- package/dist/{chunk-2MDFREEW.js → chunk-7PVNAILK.js} +1 -1
- package/dist/{chunk-I3Y6XTKN.js → chunk-7RJPTSL6.js} +1 -1
- package/dist/{chunk-PH7F4BMG.js → chunk-7TQ6HVHN.js} +1 -1
- package/dist/{chunk-KZDI2BXR.js → chunk-AAK3WGD7.js} +1 -1
- package/dist/chunk-AATUQ2AY.js +278 -0
- package/dist/{chunk-WPITBIL5.js → chunk-ADKFAPED.js} +1 -1
- package/dist/{chunk-P4243GCY.js → chunk-ANH2V6DJ.js} +1 -1
- package/dist/{chunk-N4LCWB56.js → chunk-AUAUAK6P.js} +1 -1
- package/dist/chunk-B5MFFERE.js +1 -0
- package/dist/{chunk-DLZPP33V.js → chunk-BLSWUNOK.js} +1 -1
- package/dist/{chunk-QJL3SXYA.js → chunk-BQARKSGG.js} +1 -1
- package/dist/{chunk-24RF5KN3.js → chunk-BUVP2UUA.js} +1 -1
- package/dist/{chunk-2VUG6LRN.js → chunk-BVWQZKNK.js} +1 -1
- package/dist/{chunk-UQZ7HZ47.js → chunk-CEBDKIVH.js} +1 -1
- package/dist/{chunk-3JZKWK2V.js → chunk-CX44CQFL.js} +1 -1
- package/dist/{chunk-663TS34D.js → chunk-DELISRUH.js} +1 -1
- package/dist/{chunk-UFGDNIYX.js → chunk-DI5ZPWNA.js} +1 -1
- package/dist/{chunk-QHWF3S7U.js → chunk-DIPTSBQM.js} +1 -1
- package/dist/{chunk-235JVI2J.js → chunk-DN3BB4IO.js} +2 -2
- package/dist/{chunk-FJOEHMXM.js → chunk-DZMXYETH.js} +1 -1
- package/dist/{chunk-P375IGKT.js → chunk-EAOT5CK5.js} +1 -1
- package/dist/{chunk-YYLEWVO6.js → chunk-EEEKSYWV.js} +1 -1
- package/dist/{chunk-N5YIZJ4S.js → chunk-EOJNSPIH.js} +1 -1
- package/dist/{chunk-YF4HKJB5.js → chunk-FSVSM57K.js} +1 -1
- package/dist/{chunk-PK6NOLT5.js → chunk-G6BFXMOV.js} +1 -1
- package/dist/{chunk-UTLRP527.js → chunk-GMAZ2BQY.js} +1 -1
- package/dist/{chunk-QAM7VCLV.js → chunk-HOAVZLEG.js} +1 -1
- package/dist/{chunk-A2O3MBPH.js → chunk-HQE5B2CF.js} +1 -1
- package/dist/{chunk-XZWAX4FI.js → chunk-HSVZU7MP.js} +1 -1
- package/dist/{chunk-N625VE5T.js → chunk-HYF3VJYS.js} +1 -1
- package/dist/{chunk-7ZIO3X22.js → chunk-I5X3IP6T.js} +1 -1
- package/dist/{chunk-UTPJAU5S.js → chunk-ICRQZAXP.js} +1 -1
- package/dist/{chunk-AUZCENYI.js → chunk-IIFRDOYG.js} +1 -1
- package/dist/{chunk-YJAX22JK.js → chunk-JADXT2DY.js} +1 -1
- package/dist/{chunk-VKFDDZD3.js → chunk-JOKLZMTP.js} +1 -1
- package/dist/{chunk-KNEF6NAG.js → chunk-K4APB7O3.js} +1 -1
- package/dist/{chunk-ROQXPIEZ.js → chunk-KB6H5LQJ.js} +1 -1
- package/dist/{chunk-BCEWCYZD.js → chunk-KFUOVO3X.js} +1 -1
- package/dist/{chunk-3JAC5SI7.js → chunk-KIAMA3L2.js} +1 -1
- package/dist/{chunk-XSXX75VV.js → chunk-KMQE7WFZ.js} +1 -1
- package/dist/{chunk-JC3PRJJS.js → chunk-KPNNGJAW.js} +1 -1
- package/dist/{chunk-52H2R2FU.js → chunk-KQTVJMV6.js} +1 -1
- package/dist/{chunk-7BVXGS44.js → chunk-L42FYXFW.js} +144 -144
- package/dist/{chunk-V774I3FW.js → chunk-LGFOE4XL.js} +1 -1
- package/dist/{chunk-4EYTWWYF.js → chunk-LSCDB36D.js} +1 -1
- package/dist/{chunk-BNX4MZMV.js → chunk-LVLDPYH5.js} +1 -1
- package/dist/{chunk-PVD544NN.js → chunk-LXOBFJZO.js} +1 -1
- package/dist/{chunk-VNYKNAT5.js → chunk-MC466GSO.js} +2 -2
- package/dist/{chunk-32KQKGSY.js → chunk-ML6SILEL.js} +1 -1
- package/dist/{chunk-ICHNVDFU.js → chunk-MYQTAM77.js} +1 -1
- package/dist/{chunk-H3V6Y5JO.js → chunk-N6IFIMC6.js} +1 -1
- package/dist/{chunk-S5JJL3BP.js → chunk-NGCPVRDM.js} +1 -1
- package/dist/{chunk-5O7PY44R.js → chunk-NIVGP4LB.js} +1 -1
- package/dist/{chunk-HHA322FT.js → chunk-NSADN5S2.js} +47 -47
- package/dist/{chunk-CVRAATZ5.js → chunk-NVA2354A.js} +1 -1
- package/dist/{chunk-BH34ZLZ4.js → chunk-NWH3TAHK.js} +1 -1
- package/dist/{chunk-QRETBFXI.js → chunk-NYG2VQFQ.js} +1 -1
- package/dist/{chunk-UJVYIWUI.js → chunk-OC5PD4ID.js} +1 -1
- package/dist/{chunk-AP6FNGTA.js → chunk-OCBGHOH2.js} +1 -1
- package/dist/{chunk-YT3NPMWK.js → chunk-ODSMT2ZC.js} +1 -1
- package/dist/{chunk-DKVU7LYY.js → chunk-OJZT3NA2.js} +1 -1
- package/dist/{chunk-ZZ3SMI2A.js → chunk-OMXKQY2L.js} +1 -1
- package/dist/{chunk-VUACOGOX.js → chunk-P2SBE77Z.js} +1 -1
- package/dist/{chunk-TKW3Z7XL.js → chunk-P6LVSNTT.js} +1 -1
- package/dist/{chunk-FA25RL4G.js → chunk-P7OSUECN.js} +1 -1
- package/dist/chunk-P7U6BWKN.js +1 -0
- package/dist/{chunk-6LTJMYUD.js → chunk-PEYYIWP6.js} +1 -1
- package/dist/{chunk-J2ZES5K5.js → chunk-Q7DSLGTN.js} +1 -1
- package/dist/{chunk-BU7R7NFL.js → chunk-QEVGRNUE.js} +1 -1
- package/dist/{chunk-DQOS54HN.js → chunk-QFXJNFMI.js} +1 -1
- package/dist/{chunk-7DYZVU7H.js → chunk-R6A754UW.js} +1 -1
- package/dist/{chunk-UEC23KAO.js → chunk-R7QYSC6T.js} +1 -1
- package/dist/{chunk-E4GW6OXT.js → chunk-RE652L3G.js} +1 -1
- package/dist/{chunk-KESQOMEW.js → chunk-RFOALCVH.js} +1 -1
- package/dist/{chunk-5A7EMVAP.js → chunk-RLB5QHWG.js} +1 -1
- package/dist/{chunk-RUKK4KXX.js → chunk-RTINXD5Z.js} +1 -1
- package/dist/{chunk-HP3NDE7S.js → chunk-SG5TRPJ7.js} +1 -1
- package/dist/{chunk-BBATKR3B.js → chunk-SH6Q5CLM.js} +1 -1
- package/dist/{chunk-HX3TALXV.js → chunk-SSDEWKDZ.js} +2 -2
- package/dist/{chunk-MGPLKG23.js → chunk-SZM6ANMN.js} +1 -1
- package/dist/{chunk-V66IHWQO.js → chunk-T35C6NC7.js} +1 -1
- package/dist/{chunk-BXDZX3BS.js → chunk-TB7HFPBB.js} +3 -3
- package/dist/{chunk-3NMVMCOM.js → chunk-TH6CLNGO.js} +1 -1
- package/dist/{chunk-3EQY5B4S.js → chunk-TIU7MMRT.js} +1 -1
- package/dist/{chunk-7KHYEIA7.js → chunk-TM44Z7U7.js} +1 -1
- package/dist/{chunk-BVHBMOIB.js → chunk-TNUY66EE.js} +1 -1
- package/dist/{chunk-G6YOP2SJ.js → chunk-TPGREOWO.js} +1 -1
- package/dist/{chunk-4U3NC3UU.js → chunk-TSEPNC3O.js} +1 -1
- package/dist/{chunk-TEXYUUTD.js → chunk-TTEY5PLR.js} +1 -1
- package/dist/{chunk-RY5CY3ZW.js → chunk-U3MSTPZP.js} +1 -1
- package/dist/{chunk-UGGFSV7N.js → chunk-U4HLIXRH.js} +1 -1
- package/dist/{chunk-74IG3ZE3.js → chunk-UAYIFFYJ.js} +3 -3
- package/dist/chunk-UHIP5CFI.js +1 -0
- package/dist/{chunk-H2JU5BGK.js → chunk-UHMRDG6J.js} +1 -1
- package/dist/{chunk-XA5JA7DK.js → chunk-UMB4BWCK.js} +1 -1
- package/dist/{chunk-UP7H24B3.js → chunk-UMFVRG33.js} +1 -1
- package/dist/{chunk-5EVFLUUA.js → chunk-UVIGXZMV.js} +1 -1
- package/dist/{chunk-IFVYCKX5.js → chunk-UW6YEKST.js} +1 -1
- package/dist/{chunk-BLI7DUNV.js → chunk-V6QZF5YS.js} +1 -1
- package/dist/{chunk-57IRHKV3.js → chunk-VCWESQBC.js} +1 -1
- package/dist/{chunk-AYSS2ERL.js → chunk-VGSH33QU.js} +1 -1
- package/dist/{chunk-6V37CHBZ.js → chunk-VJQJ5PTQ.js} +1 -1
- package/dist/{chunk-PFEC2NUB.js → chunk-WDSBR7KX.js} +1 -1
- package/dist/{chunk-TGM7L6RV.js → chunk-WN5VTUWJ.js} +1 -1
- package/dist/{chunk-7HZG7FBK.js → chunk-WTRKTFVE.js} +1 -1
- package/dist/{chunk-4Q54UDO3.js → chunk-X3VG75LO.js} +1 -1
- package/dist/{chunk-ZKBWEHIY.js → chunk-XCGV3IJ5.js} +1 -1
- package/dist/{chunk-RBOYWA2D.js → chunk-XDV4PRFT.js} +1 -1
- package/dist/{chunk-DBBU6OVN.js → chunk-XHTICMA7.js} +1 -1
- package/dist/{chunk-ZZWSMRKT.js → chunk-XS7WK4YK.js} +1 -1
- package/dist/{chunk-2ROG5NK3.js → chunk-XSUZPWYV.js} +1 -1
- package/dist/{chunk-7EOQVQND.js → chunk-XUAAQI5N.js} +1 -1
- package/dist/{chunk-WTYH2O47.js → chunk-XXLGM6OZ.js} +1 -1
- package/dist/{chunk-S442LGHR.js → chunk-YKNMNGV7.js} +1 -1
- package/dist/{chunk-AYKRKE6O.js → chunk-YNX4DT2O.js} +1 -1
- package/dist/{chunk-IE4SSSXU.js → chunk-YWQPSMRZ.js} +1 -1
- package/dist/{chunk-JZVNNQWE.js → chunk-YXNKDX56.js} +1 -1
- package/dist/{chunk-MSJDZLZT.js → chunk-Z33MWGCG.js} +1 -1
- package/dist/{chunk-LXZM6Z4F.js → chunk-Z6VNPAY7.js} +1 -1
- package/dist/{chunk-O7OQK2OC.js → chunk-ZAN7AZTX.js} +1 -1
- package/dist/{chunk-ABCU552E.js → chunk-ZIM2G3EP.js} +1 -1
- package/dist/{chunk-U44HRKSU.js → chunk-ZSYMRT3S.js} +1 -1
- package/dist/{chunk-TM534QSE.js → chunk-ZT4PUH7L.js} +1 -1
- package/dist/{chunk-Z66NZ2HC.js → chunk-ZUWEGJA7.js} +1 -1
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-V6ILVUUO.js → conf-store-HOA62HKK.js} +1 -1
- package/dist/configs/all.yml +3 -0
- package/dist/configs/recommended.yml +3 -0
- package/dist/data/filters.json +1 -1
- package/dist/data/objects.json +30 -3
- package/dist/data/shopify_system_translations.json +48 -4
- package/dist/{deprecations-MOEFN6OW.js → deprecations-2FTB7JEW.js} +1 -1
- package/dist/{dist-E6QKEULH.js → dist-63JMGNUL.js} +1 -1
- package/dist/dist-6TY6L7OW.js +1 -0
- package/dist/{environments-5KA3OBIZ.js → environments-XVYTKHRZ.js} +1 -1
- package/dist/{error-NYYI6HVX.js → error-SDU6RPQQ.js} +1 -1
- package/dist/{error-handler-BOESDKZA.js → error-handler-4YEBBCUH.js} +1 -1
- package/dist/{fs-XE6SBVBF.js → fs-B4UJTUCD.js} +1 -1
- package/dist/hooks/app-init.js +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{is-global-JOHCPSKZ.js → is-global-5LFZDDNH.js} +1 -1
- package/dist/{local-BTQDUX72.js → local-VTYGIJVD.js} +1 -1
- package/dist/{local-storage-WUSIVDTQ.js → local-storage-A6NBLBB2.js} +1 -1
- package/dist/{metadata-APVOKTBV.js → metadata-FREAI3KR.js} +1 -1
- package/dist/{node-package-manager-AC34ZJZD.js → node-package-manager-N5SUT2WN.js} +1 -1
- package/dist/notifications-system-P3SUTD25.js +1 -0
- package/dist/{output-EAPQ7OWD.js → output-VUR2QZPW.js} +1 -1
- package/dist/{system-D7CH26HU.js → system-OXF2P5CT.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-AXZBGWIQ.js → ui-N2C5FC3G.js} +1 -1
- package/dist/upgrade-AJ36IT7H.js +1 -0
- package/dist/{version-FAU37PQN.js → version-DSFP332V.js} +1 -1
- package/dist/version-HUOO3XOE.js +1 -0
- package/dist/{workerd-XXPWKQOM.js → workerd-KPQTFQD4.js} +1 -1
- package/oclif.manifest.json +20 -2
- package/package.json +8 -8
- package/dist/chunk-63NFEXJR.js +0 -275
- package/dist/chunk-E64BQS4D.js +0 -1
- package/dist/chunk-PLHJQQVZ.js +0 -1
- package/dist/chunk-Q3WOWDUU.js +0 -1
- package/dist/chunk-Z2Y6G2QF.js +0 -1
- package/dist/dist-2BL5GGMG.js +0 -1
- package/dist/notifications-system-4ODOESG2.js +0 -1
- package/dist/upgrade-SLPJF6LD.js +0 -1
- package/dist/version-3IYH4V5U.js +0 -1
- /package/dist/{morph-CG6HEMCQ.js → morph-QZGREMO2.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as qr}from"./chunk-VUACOGOX.js";import{a as Mt}from"./chunk-UOHNRH6E.js";import{a as Ir}from"./chunk-5EVFLUUA.js";import{a as Lr}from"./chunk-B367FOQA.js";import{a as Mr}from"./chunk-RBOYWA2D.js";import{a as kr}from"./chunk-QHWF3S7U.js";import{a as Dr}from"./chunk-4LML2QWN.js";import{b as Fr}from"./chunk-QJL3SXYA.js";import{a as Or}from"./chunk-PFEC2NUB.js";import{a as Nr}from"./chunk-DKVU7LYY.js";import{a as Pr}from"./chunk-QAM7VCLV.js";import{a as Er}from"./chunk-UTLRP527.js";import{a as br}from"./chunk-Z66NZ2HC.js";import{a as Sr}from"./chunk-JC3PRJJS.js";import{a as Ur}from"./chunk-XA5JA7DK.js";import{a as Rr}from"./chunk-VNYKNAT5.js";import{a as Tr,b as Ar,c as _r,d as Cr}from"./chunk-2IPVQRMI.js";import{a as $r}from"./chunk-6I3FNLT3.js";import{g as xr}from"./chunk-235JVI2J.js";import{a as Lo,b as ko}from"./chunk-DQOS54HN.js";import{a as gr}from"./chunk-AP6FNGTA.js";import{a as vr}from"./chunk-FA25RL4G.js";import{a as gt}from"./chunk-52H2R2FU.js";import{a as yr}from"./chunk-FJOEHMXM.js";import{c as ht,m as wt}from"./chunk-XZWAX4FI.js";import{b as wr,g as je,j as ft}from"./chunk-7ZIO3X22.js";import{c as Yo}from"./chunk-ROQXPIEZ.js";import{a as fr,b as hr,c as Ye,d as Co,e as Pt,f as Io,g as Do}from"./chunk-IE4SSSXU.js";import{a as O,b as mt}from"./chunk-BCEWCYZD.js";import{a as cr,b as lr,d as Ee,f as pr,m as Ge,n as ee,s as W,u as ur,v as dr,w as mr}from"./chunk-Q7BOSHWX.js";import{c as Wr}from"./chunk-UFGDNIYX.js";import{a as ir}from"./chunk-6LTJMYUD.js";import{a as bo,b as vt,c as te,d as So}from"./chunk-57IRHKV3.js";import{a as $o,f as Mo,g as Fo,h as xt,i as Oo,j as No,k as qo,l as Wo,m as Ho,n as Bo,o as Go,p as jo,q as Ko,v as zo,x as Vo,z as Et}from"./chunk-ZKBWEHIY.js";import{a as Uo,b as Ro,c as To,d as Ao,e as _o}from"./chunk-UTPJAU5S.js";import{a as Br}from"./chunk-KZDI2BXR.js";import{a as Eo}from"./chunk-E4GW6OXT.js";import{a as xo}from"./chunk-PLHJQQVZ.js";import{a as Hr}from"./chunk-6V37CHBZ.js";import{a as Qe}from"./chunk-BBATKR3B.js";import{Aa as Ve,F as no,Fa as Po,H as so,J as fe,R as ao,U as uo,V as mo,Z as fo,aa as ho,fa as go,g as Gr,i as Kr,ia as wo,j as zr,ja as yo,k as J,ka as vo,l as Vr,n as Yr,o as Qr,r as yt,s as Jr,u as Xr,v as Zr,w as eo,x as to,y as ro,z as oo,za as ze}from"./chunk-KJQAJUDU.js";import{O as io,P as co,Z as lo,ca as po,e as Ke,j as be,p as jr}from"./chunk-UEC23KAO.js";import{c as sr}from"./chunk-NJLSZS27.js";import{a as H}from"./chunk-2MDFREEW.js";import{$ as Yt,N as Vt,Z as de,a as Wt,c as Ht,h as Bt,l as Gt,n as jt,q as Kt,t as zt,ta as Qt,u as ke,z as De}from"./chunk-3EQY5B4S.js";import{b as ar,d as Be}from"./chunk-S5JJL3BP.js";import{a as lt,c as qt}from"./chunk-5C7HDTHJ.js";import{D as Ne,H as Zt,J as Z,O as qe,P as xe,Q as dt,R as tr,T as rr,a as Nt,i as pt,j as $e,k as M,l as F,m as Me,n as ut,o as Xt,p as Fe,u as Oe,w as ne}from"./chunk-YYLEWVO6.js";import{a as Zn}from"./chunk-7UNQOKZW.js";import{d as Jt}from"./chunk-N5U5Q2MG.js";import{d as _,g as me,l as er}from"./chunk-AUZCENYI.js";import{$a as ve,Ea as Dt,Fb as U,Gb as nr,Hb as R,Mb as Q,Na as Ie,Pb as y,Q as ct,Qb as k,Ta as X,Wa as Le,cb as $t,eb as Pe,fb as L,gb as S,jb as le,kb as pe,ma as I,mb as Ft,nb as Ot,tb as ue,ua as _e,wa as Ce}from"./chunk-BXDZX3BS.js";import{d as or,f as We,j as He}from"./chunk-MGPLKG23.js";import{a as Re}from"./chunk-NNOSZ447.js";import{d as T,f as it,g as Te,i as ce,j as Lt,k as Ae,o as kt,p as ye}from"./chunk-773TIA5M.js";import{r as Xn}from"./chunk-T6CC5WUU.js";import{e as oe,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var es=300*1e3,ts='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Qo(t,e,r=Date.now()){for(;await rs(t,e,r););}async function rs(t,e,r){let o=await je(t,e);if(!o||os(o,r))throw new _(ts);return await xe(3),o.processing}function os(t,e){return t.processing&&Date.now()-e>=es}var ns="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",ss="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",bt=3,Je=class extends yr{constructor(e,r={devPreview:!1}){super(e),this.context="App Ext. Host",this.themeId=Tr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??(e=this.devPreview?await this.createHostTheme():await this.create()),e}setTheme(e){Ar(this.adminSession.storeFqdn,e)}removeTheme(){_r(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:wr,name:this.generateThemeName(this.context),src:ns};for(let o=0;o<bt;o++){y(`Attempt ${o}/${bt}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await ft(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),y(`Waiting for theme with id "${n.id}" to be processed`),await Qo(n.id,this.adminSession),n;throw new Error}catch{y(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}y(`Theme creation failed after ${bt} retries. Creating theme using fallback theme zip`);let r=await ft({...e,src:ss},this.adminSession);if(!r)throw y("Theme creation failed. Exiting process."),new me(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var as={"theme:init":Ur,"theme:check":gr,"theme:console":vr,"theme:delete":Pr,"theme:dev":Er,"theme:duplicate":br,"theme:info":Sr,"theme:language-server":Rr,"theme:list":Cr,"theme:metafields:pull":$r,"theme:open":Ir,"theme:package":Lr,"theme:profile":kr,"theme:publish":Dr,"theme:preview":Mr,"theme:pull":Fr,"theme:push":Or,"theme:rename":Nr,"theme:share":qr},oi=as;async function Jo(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(v=>v.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[l,u]=await Promise.all([Vt(t.storeFqdn),ls(e)]),c=l.storeFqdn,[m,h]=await Promise.all([wt(l),ht(l)]),g=h?await gt(void 0,c,m):void 0,d=await cs(l,t.theme),f=d.id.toString();return Oe({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:u}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${c}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:is,options:{theme:d,adminSession:l,storefrontPassword:g,crawlerSignatureHeaders:m,themeExtensionDirectory:a,themeExtensionPort:i}}}var is=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await xr(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function cs(t,e){let r;if(e)y(`Fetching theme with provided id ${e}`),r=await je(parseInt(e,10),t);else{let o=new Je(t,{devPreview:!0});await Ne([{title:"Configuring host theme for theme app extension",task:async()=>{y("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new _("Could not find or create a host theme for theme app extensions");return r}async function ls(t){return t.developerPlatformClient?.clientName===lo.AppManagement?`https://${await ke()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await zt()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function ps(t){let e=T(t.directory,"locales");return Le([T(e,"*.json")])}async function Xo(t,e){let r=await ps(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),us(a,s,o,t,e)})),o.lastUpdated=Date.now(),y(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function us(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw k(i,n.stderr),new er.ExtendableError(i)}}p();function Xe(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function he(t,e,r,o){return F({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Xo(t,r),l=await Vr(t),u=t.outputRelativePath?ce(n):n,c=await ds(t,s,u,o),m=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(m=t.configuration.metafields),{assets:{main:Se(c)&&c[0]?.assets?.main?c[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await Ie(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:Xe(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:c,localization:a??null,metafields:m,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:l?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function ds(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),Se(s)){let a=await ms(r);return Promise.all(s.map(async i=>{let{target:l,resource:u}=i,c={...i,surface:Ve(l),root:{url:`${e}/${l}`},resource:u||{url:""}},m=a?.[l];if(!m)return c;let g=await ys(m,{target:l,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...c,...g}}))}return s}async function ms(t){try{let e=T(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function fs({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,l=e[s];if(typeof l=="string"){let g=await Ze(s,i,typeof a=="string"?a:l,r,o,n,typeof a=="string"?l:void 0);return{assets:{[g.name]:g}}}let c=e.build_manifest?.assets?.[s];if(c?.filepath){let m=await Ze(s,i,c.filepath,r,o,n,c.module);return{assets:{[m.name]:m}}}return{}}async function hs({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await Ie(T(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function gs({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,l)=>{let u=i.schema,c=s[l]?.schema,m=typeof c=="string"?c:u,h=typeof c=="string"?u:void 0;return{...i,schema:await Ze("schema",`${t}/intents/${l}/schema`,m,r,o,n,h)}}))}:{}}async function ws({target:t,url:e,extension:r,resolver:o},n,s){let a=await Ze(n,`${t}/${n}`,s,e,r,o);return{assets:{[a.name]:a}}}async function ys(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return vs(o,n)?gs(e,n):Ps(o,n)?ws(e,o,n):xs(o,n)?hs(e,o,n):fs(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function Se(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function Ze(t,e,r,o,n,s,a){let i=`${e}${Ae(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await Ie(T(n.directory,a??r))??0}}function vs(t,e){return t==="intents"&&Array.isArray(e)}function Ps(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function xs(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as Es}from"events";var Ue;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(Ue||(Ue={}));async function Zo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:Ye(t.storeFqdn,t.apiKey),mobileUrl:Io(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>he(n,e,t,r&&St(r,n.devUUID))))}}function St(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var et=class extends Es{constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=de(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(Se(n.extensionPoints)&&Se(o.extensionPoints)){let s=n.extensionPoints.reduce((l,u)=>({...l,[u.target]:u}),{});o.extensionPoints=de(o.extensionPoints,n.extensionPoints,l=>l.map(u=>{let c=s[u.target];return c?de(u,c,(m,h)=>h):u}));let{extensionPoints:a,...i}=n;return de(o,i)}return de(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){y(R`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await he(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},St(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await he(e,r,this.options,St(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(Ue.Update,e)}};p();p();var se;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(se||(se={}));function en(t,e){return(r,o,n)=>{r.url==="/extensions"&&(y("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,bs(t,e)))}}function bs(t,e){return r=>{y("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};y(R`Sending connected payload: ${U.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",As(t,e))}}function Ss(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?U.json(o).output():String(o)).join(" ");return R`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var Us={debug:t=>U.gray(t),warn:t=>U.yellow(t),error:t=>U.errorText(t)};function Rs({type:t,message:e}){let r=Ss(e);switch(t){case"debug":case"warn":case"error":return R`${Us[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function Ts(t,e){F({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(Rs(t))})}function As(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(y(R`Received websocket message with event type ${n} and data:
|
|
1
|
+
import{a as qr}from"./chunk-P2SBE77Z.js";import{a as Mt}from"./chunk-UOHNRH6E.js";import{a as Ir}from"./chunk-UVIGXZMV.js";import{a as Lr}from"./chunk-2TJ6LOCC.js";import{a as Mr}from"./chunk-XDV4PRFT.js";import{a as kr}from"./chunk-DIPTSBQM.js";import{a as Dr}from"./chunk-7AYYQUJG.js";import{b as Fr}from"./chunk-BQARKSGG.js";import{a as Or}from"./chunk-WDSBR7KX.js";import{a as Nr}from"./chunk-OJZT3NA2.js";import{a as Pr}from"./chunk-HOAVZLEG.js";import{a as Er}from"./chunk-GMAZ2BQY.js";import{a as br}from"./chunk-ZUWEGJA7.js";import{a as Sr}from"./chunk-KPNNGJAW.js";import{a as Ur}from"./chunk-UMB4BWCK.js";import{a as Rr}from"./chunk-MC466GSO.js";import{a as Tr,b as Ar,c as _r,d as Cr}from"./chunk-6ZWMXMNM.js";import{a as $r}from"./chunk-5GVE4ILZ.js";import{g as xr}from"./chunk-DN3BB4IO.js";import{a as Lo,b as ko}from"./chunk-QFXJNFMI.js";import{a as gr}from"./chunk-OCBGHOH2.js";import{a as vr}from"./chunk-P7OSUECN.js";import{a as gt}from"./chunk-KQTVJMV6.js";import{a as yr}from"./chunk-DZMXYETH.js";import{c as ht,m as wt}from"./chunk-HSVZU7MP.js";import{b as wr,g as je,j as ft}from"./chunk-I5X3IP6T.js";import{c as Yo}from"./chunk-KB6H5LQJ.js";import{a as fr,b as hr,c as Ye,d as Co,e as Pt,f as Io,g as Do}from"./chunk-YWQPSMRZ.js";import{a as O,b as mt}from"./chunk-KFUOVO3X.js";import{a as cr,b as lr,d as Ee,f as pr,m as Ge,n as ee,s as W,u as ur,v as dr,w as mr}from"./chunk-Q7BOSHWX.js";import{c as Wr}from"./chunk-DI5ZPWNA.js";import{a as ir}from"./chunk-PEYYIWP6.js";import{a as bo,b as vt,c as te,d as So}from"./chunk-VCWESQBC.js";import{a as $o,f as Mo,g as Fo,h as xt,i as Oo,j as No,k as qo,l as Wo,m as Ho,n as Bo,o as Go,p as jo,q as Ko,v as zo,x as Vo,z as Et}from"./chunk-XCGV3IJ5.js";import{a as Uo,b as Ro,c as To,d as Ao,e as _o}from"./chunk-ICRQZAXP.js";import{a as Br}from"./chunk-AAK3WGD7.js";import{a as Eo}from"./chunk-RE652L3G.js";import{a as xo}from"./chunk-UHIP5CFI.js";import{a as Hr}from"./chunk-VJQJ5PTQ.js";import{a as Qe}from"./chunk-SH6Q5CLM.js";import{Aa as Ve,F as no,Fa as Po,H as so,J as fe,R as ao,U as uo,V as mo,Z as fo,aa as ho,fa as go,g as Gr,i as Kr,ia as wo,j as zr,ja as yo,k as J,ka as vo,l as Vr,n as Yr,o as Qr,r as yt,s as Jr,u as Xr,v as Zr,w as eo,x as to,y as ro,z as oo,za as ze}from"./chunk-4MLEL3VK.js";import{O as io,P as co,Z as lo,ca as po,e as Ke,j as be,p as jr}from"./chunk-R7QYSC6T.js";import{c as sr}from"./chunk-5VRU3BT5.js";import{a as H}from"./chunk-7PVNAILK.js";import{$ as Yt,N as Vt,Z as de,a as Wt,c as Ht,h as Bt,l as Gt,n as jt,q as Kt,t as zt,ta as Qt,u as ke,z as De}from"./chunk-TIU7MMRT.js";import{b as ar,d as Be}from"./chunk-NGCPVRDM.js";import{a as lt,c as qt}from"./chunk-5C7HDTHJ.js";import{D as Ne,H as Zt,J as Z,O as qe,P as xe,Q as dt,R as tr,T as rr,a as Nt,i as pt,j as $e,k as M,l as F,m as Me,n as ut,o as Xt,p as Fe,u as Oe,w as ne}from"./chunk-EEEKSYWV.js";import{a as Zn}from"./chunk-7UNQOKZW.js";import{d as Jt}from"./chunk-7AY6HLQG.js";import{d as _,g as me,l as er}from"./chunk-IIFRDOYG.js";import{$a as ve,Ea as Dt,Fb as U,Gb as nr,Hb as R,Mb as Q,Na as Ie,Pb as y,Q as ct,Qb as k,Ta as X,Wa as Le,cb as $t,eb as Pe,fb as L,gb as S,jb as le,kb as pe,ma as I,mb as Ft,nb as Ot,tb as ue,ua as _e,wa as Ce}from"./chunk-TB7HFPBB.js";import{d as or,f as We,j as He}from"./chunk-SZM6ANMN.js";import{a as Re}from"./chunk-NNOSZ447.js";import{d as T,f as it,g as Te,i as ce,j as Lt,k as Ae,o as kt,p as ye}from"./chunk-773TIA5M.js";import{r as Xn}from"./chunk-T6CC5WUU.js";import{e as oe,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var es=300*1e3,ts='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Qo(t,e,r=Date.now()){for(;await rs(t,e,r););}async function rs(t,e,r){let o=await je(t,e);if(!o||os(o,r))throw new _(ts);return await xe(3),o.processing}function os(t,e){return t.processing&&Date.now()-e>=es}var ns="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",ss="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",bt=3,Je=class extends yr{constructor(e,r={devPreview:!1}){super(e),this.context="App Ext. Host",this.themeId=Tr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??(e=this.devPreview?await this.createHostTheme():await this.create()),e}setTheme(e){Ar(this.adminSession.storeFqdn,e)}removeTheme(){_r(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:wr,name:this.generateThemeName(this.context),src:ns};for(let o=0;o<bt;o++){y(`Attempt ${o}/${bt}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await ft(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),y(`Waiting for theme with id "${n.id}" to be processed`),await Qo(n.id,this.adminSession),n;throw new Error}catch{y(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}y(`Theme creation failed after ${bt} retries. Creating theme using fallback theme zip`);let r=await ft({...e,src:ss},this.adminSession);if(!r)throw y("Theme creation failed. Exiting process."),new me(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var as={"theme:init":Ur,"theme:check":gr,"theme:console":vr,"theme:delete":Pr,"theme:dev":Er,"theme:duplicate":br,"theme:info":Sr,"theme:language-server":Rr,"theme:list":Cr,"theme:metafields:pull":$r,"theme:open":Ir,"theme:package":Lr,"theme:profile":kr,"theme:publish":Dr,"theme:preview":Mr,"theme:pull":Fr,"theme:push":Or,"theme:rename":Nr,"theme:share":qr},oi=as;async function Jo(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(v=>v.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[l,u]=await Promise.all([Vt(t.storeFqdn),ls(e)]),c=l.storeFqdn,[m,h]=await Promise.all([wt(l),ht(l)]),g=h?await gt(void 0,c,m):void 0,d=await cs(l,t.theme),f=d.id.toString();return Oe({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:u}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${c}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:is,options:{theme:d,adminSession:l,storefrontPassword:g,crawlerSignatureHeaders:m,themeExtensionDirectory:a,themeExtensionPort:i}}}var is=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await xr(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function cs(t,e){let r;if(e)y(`Fetching theme with provided id ${e}`),r=await je(parseInt(e,10),t);else{let o=new Je(t,{devPreview:!0});await Ne([{title:"Configuring host theme for theme app extension",task:async()=>{y("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new _("Could not find or create a host theme for theme app extensions");return r}async function ls(t){return t.developerPlatformClient?.clientName===lo.AppManagement?`https://${await ke()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await zt()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function ps(t){let e=T(t.directory,"locales");return Le([T(e,"*.json")])}async function Xo(t,e){let r=await ps(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),us(a,s,o,t,e)})),o.lastUpdated=Date.now(),y(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function us(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw k(i,n.stderr),new er.ExtendableError(i)}}p();function Xe(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function he(t,e,r,o){return F({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Xo(t,r),l=await Vr(t),u=t.outputRelativePath?ce(n):n,c=await ds(t,s,u,o),m=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(m=t.configuration.metafields),{assets:{main:Se(c)&&c[0]?.assets?.main?c[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await Ie(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:Xe(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:c,localization:a??null,metafields:m,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:l?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function ds(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),Se(s)){let a=await ms(r);return Promise.all(s.map(async i=>{let{target:l,resource:u}=i,c={...i,surface:Ve(l),root:{url:`${e}/${l}`},resource:u||{url:""}},m=a?.[l];if(!m)return c;let g=await ys(m,{target:l,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...c,...g}}))}return s}async function ms(t){try{let e=T(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function fs({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,l=e[s];if(typeof l=="string"){let g=await Ze(s,i,typeof a=="string"?a:l,r,o,n,typeof a=="string"?l:void 0);return{assets:{[g.name]:g}}}let c=e.build_manifest?.assets?.[s];if(c?.filepath){let m=await Ze(s,i,c.filepath,r,o,n,c.module);return{assets:{[m.name]:m}}}return{}}async function hs({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await Ie(T(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function gs({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,l)=>{let u=i.schema,c=s[l]?.schema,m=typeof c=="string"?c:u,h=typeof c=="string"?u:void 0;return{...i,schema:await Ze("schema",`${t}/intents/${l}/schema`,m,r,o,n,h)}}))}:{}}async function ws({target:t,url:e,extension:r,resolver:o},n,s){let a=await Ze(n,`${t}/${n}`,s,e,r,o);return{assets:{[a.name]:a}}}async function ys(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return vs(o,n)?gs(e,n):Ps(o,n)?ws(e,o,n):xs(o,n)?hs(e,o,n):fs(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function Se(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function Ze(t,e,r,o,n,s,a){let i=`${e}${Ae(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await Ie(T(n.directory,a??r))??0}}function vs(t,e){return t==="intents"&&Array.isArray(e)}function Ps(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function xs(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as Es}from"events";var Ue;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(Ue||(Ue={}));async function Zo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:Ye(t.storeFqdn,t.apiKey),mobileUrl:Io(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>he(n,e,t,r&&St(r,n.devUUID))))}}function St(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var et=class extends Es{constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=de(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(Se(n.extensionPoints)&&Se(o.extensionPoints)){let s=n.extensionPoints.reduce((l,u)=>({...l,[u.target]:u}),{});o.extensionPoints=de(o.extensionPoints,n.extensionPoints,l=>l.map(u=>{let c=s[u.target];return c?de(u,c,(m,h)=>h):u}));let{extensionPoints:a,...i}=n;return de(o,i)}return de(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){y(R`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await he(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},St(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await he(e,r,this.options,St(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(Ue.Update,e)}};p();p();var se;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(se||(se={}));function en(t,e){return(r,o,n)=>{r.url==="/extensions"&&(y("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,bs(t,e)))}}function bs(t,e){return r=>{y("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};y(R`Sending connected payload: ${U.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",As(t,e))}}function Ss(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?U.json(o).output():String(o)).join(" ");return R`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var Us={debug:t=>U.gray(t),warn:t=>U.yellow(t),error:t=>U.errorText(t)};function Rs({type:t,message:e}){let r=Ss(e);switch(t){case"debug":case"warn":case"error":return R`${Us[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function Ts(t,e){F({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(Rs(t))})}function As(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(y(R`Received websocket message with event type ${n} and data:
|
|
2
2
|
${U.json(s)}
|
|
3
3
|
`,e.stdout),n===se.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===se.Dispatch){let a=_s(o,e);rn(t,a,e)}else n===se.Log&&Ts(s,e)}}function tn(t,e){return r=>{let o={event:se.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};y(R`Sending websocket update event to the websocket clients:
|
|
4
4
|
${U.json(o)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-P7U6BWKN.js";import{a as n}from"./chunk-VJQJ5PTQ.js";import{C as p,F as s,Ga as c}from"./chunk-4MLEL3VK.js";import{b as e}from"./chunk-NGCPVRDM.js";import{r as d}from"./chunk-T6CC5WUU.js";import{e as l,g as r}from"./chunk-VKWPEFWQ.js";r();var m=l(d(),1);var t,{config:b,...u}=n,o=class extends f{async run(){let{flags:a,args:i}=await this.parse(t),{app:g}=await c({directory:a.path,userProvidedConfigName:i.config});return await s(a.path),await p({directory:a.path,configName:i.config,reset:a.reset}),{app:g}}};t=o;o.summary="Activate an app configuration.";o.descriptionWithMarkdown="Sets default configuration when you run app-related CLI commands. If you omit the `config-name` parameter, then you'll be prompted to choose from the configuration files in your project.";o.description=t.descriptionWithoutMarkdown();o.usage="app config use [config] [flags]";o.flags={...e,...u};o.args={config:m.Args.string({description:"The name of the app configuration. Can be 'shopify.app.staging.toml' or simply 'staging'."})};var v=o;export{v as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as m,E as d,t as c}from"./chunk-
|
|
1
|
+
import{D as m,E as d,t as c}from"./chunk-EEEKSYWV.js";import{Eb as w,Fb as n,Hb as a}from"./chunk-TB7HFPBB.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();async function P(){let r,l=new Promise(function(e,i){r=e});await c({processes:[{prefix:"backend",action:async(e,i,s)=>{e.write("first backend message"),await new Promise(t=>setTimeout(t,1e3)),e.write("second backend message"),await new Promise(t=>setTimeout(t,1e3)),e.write("third backend message"),await new Promise(t=>setTimeout(t,1e3)),r()}},{prefix:"frontend",action:async(e,i,s)=>{await l,e.write("first frontend message"),await new Promise(t=>setTimeout(t,1e3)),e.write("second frontend message"),await new Promise(t=>setTimeout(t,1e3)),e.write("third frontend message")}}]}),await m([{title:"Installing dependencies",task:async()=>{await new Promise(e=>setTimeout(e,2e3))}},{title:"Downloading assets",task:async()=>{await new Promise(e=>setTimeout(e,2e3))}}]),await d({title:new w("Importing data"),task:async e=>{for(let i=1;i<=10;i++){await new Promise(t=>setTimeout(t,500));let s=a`Importing data ${n.italic(a`(${n.green(i.toString())} complete)`)}`;e(s)}return"completed"}})}export{P as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as I}from"./chunk-VKWPEFWQ.js";I();var o="4.5.2";export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-QEVGRNUE.js";import{b as f}from"./chunk-UAYIFFYJ.js";import{A as S,u as i,y as x}from"./chunk-EEEKSYWV.js";import{d as v}from"./chunk-IIFRDOYG.js";import{Pb as I}from"./chunk-TB7HFPBB.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();a();var m={on:"Autocorrect on. The system will automatically run commands even when you mistype them.",off:"Autocorrect off. You'll need to confirm corrections for mistyped commands."};a();function p(o=W()){return!!o.get("autocorrectEnabled")}function y(o,n=W()){n.set("autocorrectEnabled",o)}function W(){return b??(b=new C({projectName:"did-you-mean"})),b}var b;var A,s=class extends f{async run(){y(!0),i({body:m.on})}};A=s;s.summary="Enable autocorrect. Off by default.";s.descriptionWithMarkdown=`Enable autocorrect. Off by default.
|
|
2
2
|
|
|
3
3
|
When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as $}from"./chunk-J3JPJCWP.js";import{a as O}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-J3JPJCWP.js";import{a as O}from"./chunk-5VC4XXYH.js";import{a as M}from"./chunk-TM44Z7U7.js";import{a as x,l as H,n as Y}from"./chunk-DN3BB4IO.js";import{a as R}from"./chunk-2ACN7JIZ.js";import{a as G,c as y}from"./chunk-N6IFIMC6.js";import{a as S,b as L}from"./chunk-STJ3LWFL.js";import{k as A,n as I}from"./chunk-I5X3IP6T.js";import{p as D,q as E,r as _,u as P,v as C}from"./chunk-4P54DKG4.js";import{h as V,k as B}from"./chunk-75DBVSVI.js";import{O as g,ua as a}from"./chunk-TIU7MMRT.js";import{b}from"./chunk-NGCPVRDM.js";import{D as F,v as k}from"./chunk-EEEKSYWV.js";import{Wa as T}from"./chunk-TB7HFPBB.js";import{q as p}from"./chunk-773TIA5M.js";import{r as Q}from"./chunk-T6CC5WUU.js";import{e as z,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function K(e,t,o,n,r,l){let i=X(o,n,r),c=J(o,e,n,t),s=[...i,...c,{title:"Theme download complete",task:async()=>{}}];s.length>0&&await F(s,{renderOptions:{stdout:l?.stdout??process.stdout},noProgressBar:r.multiEnvironment})}function X(e,t,o){if(o.nodelete)return[];let n=new Set(e.map(i=>i.key));return t.applyIgnoreFilters([...t.files.values()]).map(({key:i})=>i).filter(i=>!n.has(i)).map(i=>({title:`Cleaning your local directory (removing ${i})`,task:async()=>t.delete(i)}))}function J(e,t,o,n){let r=o.applyIgnoreFilters(e);r=r.filter(s=>{let u=s.checksum;return o.files.get(s.key)?.checksum!==u});let l=r.map(s=>s.key),i=s=>s.total===0?"[100%]":`[${Math.round(s.current/s.total*100)}%]`;return $(l,P,(s,u)=>({title:`Downloading files from remote theme ${i({current:u,total:l.length})}`,task:async()=>Z(t,o,s,n)}))}async function Z(e,t,o,n){let r=await A(e.id,o,n);r&&await Promise.all(r.map(l=>t.write(l)))}async function N(e,t,o,n){a("theme-service:pull:setup"),R({verbose:e.verbose,noColor:e.noColor});let r=t??await g(_({store:e.store}),e.password),l=new O(r),i=await(e.development?l.find():l.fetch()),{path:c,nodelete:s,live:u,development:f,only:W,ignore:j,force:w,environment:v}=e;if(!await oe(c??p(),w??!1,v?.[0],o))return;let q=await M(r,{header:"Select a theme to open",filter:{live:u,theme:f?`${i?.id}`:e.theme}});a("theme-service:pull:setup"),await ee(q,r,{environment:v?.[0],force:w??!1,ignore:j??[],multiEnvironment:o,nodelete:s??!1,only:W??[],path:c??p()},n)}async function ee(e,t,o,n){a("theme-service:pull:file-system");let r=H(o.path,{filters:o}),[l]=await Promise.all([I(e.id,t),r.ready()]),i=x(l);a("theme-service:pull:file-system"),await K(e,t,i,r,o,n);let c=o.environment?`Environment: ${o.environment}`:"";k({headline:c,body:["The theme",...G(e),"has been pulled."],nextSteps:[[{link:{label:"View your theme",url:S(e,t)}}],[{link:{label:"Customize your theme at the theme editor",url:L(e,t)}}]]})}async function te(e){return(await T("*",{cwd:e,deep:1,onlyFiles:!1})).length===0}async function oe(e,t,o,n){return t?!0:!(!await te(e)&&!await Y(e)&&!await y(t,void 0,o,n)||await V(e)&&!await B(e)&&!await y(t,"The current Git directory has uncommitted changes.",o,n))}var h=z(Q(),1);var U,m=class extends C{async command(t,o,n,r,l){a("theme-command:pull"),await N({...t,noColor:t["no-color"]},o,n,l),a("theme-command:pull")}storeAuthScopes(){return["read_themes"]}};U=m;m.summary="Download your remote theme files locally.";m.descriptionWithMarkdown=`Retrieves theme files from Shopify.
|
|
2
2
|
|
|
3
3
|
If no theme is specified, then you're prompted to select the theme to pull from the list of the themes in your store.`;m.description=U.descriptionWithoutMarkdown();m.flags={...b,...D,...E("download"),theme:h.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),development:h.Flags.boolean({char:"d",description:"Pull theme files from your remote development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),live:h.Flags.boolean({char:"l",description:"Pull theme files from your remote live theme.",env:"SHOPIFY_FLAG_LIVE"}),nodelete:h.Flags.boolean({char:"n",description:"Prevent deleting local files that don't exist remotely.",env:"SHOPIFY_FLAG_NODELETE"}),force:h.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"})};m.multiEnvironmentsFlags=["store","password","path",["live","development","theme"]];var Le=m;export{N as a,Le as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as l,C as f,D as m,E as d,J as p,y as u}from"./chunk-
|
|
1
|
+
import{B as l,C as f,D as m,E as d,J as p,y as u}from"./chunk-TIU7MMRT.js";import{h as n}from"./chunk-ZT4PUH7L.js";import{b as g}from"./chunk-UAYIFFYJ.js";import{F as S,z as h}from"./chunk-EEEKSYWV.js";import{Ob as w}from"./chunk-TB7HFPBB.js";import{r as C}from"./chunk-T6CC5WUU.js";import{e as L,g as i}from"./chunk-VKWPEFWQ.js";i();i();var r="NEW_LOGIN";function N(e,t){let s=[],o=e[t];if(o)for(let[c,I]of Object.entries(o))s.push({label:I.identity.alias??c,value:c});return s}async function b(){let e=await p({},{forceNewSession:!0}),t=await f(e.userId);if(!t){let s=await S({message:"Enter an alias for this account (e.g. your email or a nickname)"});return await m(e.userId,s),s}return t}async function v(){let e=await l(),t=await u(),s=[];return e&&s.push(...N(e,t)),s.length>0&&s.push({label:"Log in with a different account",value:r}),s}async function y(e){if(e){let o=await d(e);if(o)return n(o),e}let t=await v(),s=r;return t.length>0&&(s=await h({message:"Which account would you like to use?",choices:t})),s===r?b():(n(s),t.find(o=>o.value===s)?.label??s)}var A=L(C(),1);var a=class e extends g{static{this.description="Logs you in to your Shopify account."}static{this.flags={alias:A.Flags.string({description:"Alias of the session you want to login to.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})}}async run(){let{flags:t}=await this.parse(e),s=await y(t.alias);w(`Current account: ${s}.`)}};export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as E}from"./chunk-
|
|
1
|
+
import{b as E}from"./chunk-NGCPVRDM.js";import{b}from"./chunk-UAYIFFYJ.js";import{M as F,N}from"./chunk-EEEKSYWV.js";import{Mb as k,T as C,Ta as w,ma as O}from"./chunk-TB7HFPBB.js";import{u as n}from"./chunk-A4SBXDZB.js";import{k as R}from"./chunk-SZM6ANMN.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{r as U}from"./chunk-T6CC5WUU.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{constructor(){this.assertions=[],this.registeredTests=[]}async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let i of this.registeredTests){this.assertions=[];let s=Date.now();try{await i.fn(),e.push({name:i.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:i.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 i=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:i,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 i=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:i,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,i){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:i??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:i??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,i){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:i??`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:i??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:i??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);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 i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,i){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:i??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,i){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:i??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:i??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:i??"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,i){this.assertions.push({description:i,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};m.description="Doctor test suite";var p=class extends m{constructor(){super(...arguments);this.themeName="";this.themePath=""}static{this.description="Tests the theme init command creates a valid theme structure"}tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let e=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(e),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let e=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(e.map(i=>this.assertFile(u(this.themePath,i))))}),this.test("theme directories exist",async()=>{let e=["sections","snippets","assets","locales"];await Promise.all(e.map(i=>this.assertDirectory(u(this.themePath,i))))}),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{this.description="Tests pushing a theme to the store creates an unpublished theme"}static{this.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 i=await this.run(e);this.assertSuccess(i);let s=this.assertJson(i,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 _(o){return{workingDirectory:o.path??y(),environment:o.environment,store:o.store,password:o.password,data:{}}}d();var a=o=>k(o),v;function J(o){v=o}function G(o){if(!v)return o;let t=/\/[^\s,)]+/g;return o.replace(t,e=>T(e,v))}function A(o,t){a(""),a(n.bold(n.cyan(`Suite: ${o}`))),a(n.dim(t))}function j(o){a(n.bold(n.blue(`Running: ${o}`)))}function q(o){let t=`(${(o.duration/1e3).toFixed(2)}s)`;if(o.status==="passed"){a(n.bold(n.green(`PASSED: ${o.name} ${n.dim(t)}`)));for(let e of I(o.assertions))a(e)}else if(o.status==="failed"){a(n.red(`FAILED: ${o.name} ${n.dim(t)}`));for(let e of I(o.assertions))a(e);o.error&&a(n.red(` Error: ${G(o.error.message)}`))}else a(n.yellow(`SKIPPED: ${o.name}`))}function S(o){let t=o.filter(h=>h.status==="passed").length,e=o.filter(h=>h.status==="failed").length,i=o.filter(h=>h.status==="skipped").length,s=o.length,r=o.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))}`),i>0&&a(` Skipped: ${n.yellow(String(i))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(o){return o.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(o){let t=[],e=_(o);J(e.workingDirectory);for(let i of Y){let s=new i,r=i.description??"Test suite";A(i.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 o extends b{static{this.description="Run all theme command doctor-release tests"}static{this.hidden=!0}static{this.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(o);(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 T}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-TPGREOWO.js";import{b as P,c as w,d as v}from"./chunk-TSEPNC3O.js";import{a as F}from"./chunk-P7U6BWKN.js";import{a as x}from"./chunk-VJQJ5PTQ.js";import{Ga as y}from"./chunk-4MLEL3VK.js";import{b as h,c as m}from"./chunk-NGCPVRDM.js";import{B as d,I as l}from"./chunk-EEEKSYWV.js";import{Pb as r}from"./chunk-TB7HFPBB.js";import{r as N}from"./chunk-T6CC5WUU.js";import{e as A,g}from"./chunk-VKWPEFWQ.js";g();var s=A(N(),1);var p,a="_start",e=class extends F{async run(){let{flags:t}=await this.parse(p),n=a,{app:c}=await y({directory:t.path,userProvidedConfigName:t.config}),o=await w(c,t.path);if(t.export!==void 0)r(`Using export ${t.export} from the --export flag.`),n=t.export;else if(o.configuration.targeting!==void 0&&o.configuration.targeting.length>0){let i=o.configuration.targeting;if(i.length>1&&l({})){let b=i.map(f=>({label:f.target,value:f.export||a}));n=await d({message:"Which target would you like to execute?",choices:b})}else n=i?.[0]?.export||a,r(`Using export '${n}'. Use the --export flag or an interactive terminal to select a different export.`)}else r(`No targeting information found. Using the default export '${n}'. Use the --export flag or an interactive terminal to select a different export.`);let u=o?.configuration.targeting?.[0]?.input_query,U=u&&`${o?.directory}/${u}`,_=await v(o,t.path,t["client-id"],t.reset,t.config);return await T({functionExtension:o,json:t.json,inputPath:t.input,export:n,stdin:"inherit",schemaPath:_,queryPath:U}),{app:c}}};p=e;e.summary="Run a function locally for testing.";e.descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";e.description=p.descriptionWithoutMarkdown();e.flags={...h,...x,...P,...m,input:s.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:s.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"})};var G=e;export{G as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as r}from"./chunk-
|
|
1
|
+
import{Q as r}from"./chunk-TIU7MMRT.js";import{b as c}from"./chunk-UAYIFFYJ.js";import{Nb as a}from"./chunk-TB7HFPBB.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var o=class extends c{static{this.description="Logs you out of the Shopify account or Partner account and store."}async run(){await r(),a("Logged out from all the accounts")}};export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-UAYIFFYJ.js";import{u as t}from"./chunk-EEEKSYWV.js";import{k as r}from"./chunk-SZM6ANMN.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static{this.description="Run CLI doctor-release tests"}static{this.hidden=!0}async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as R}from"./chunk-
|
|
1
|
+
import{n as R}from"./chunk-TIU7MMRT.js";import{a as T,b as k}from"./chunk-XXLGM6OZ.js";import{f as G}from"./chunk-7AY6HLQG.js";import{d as l}from"./chunk-IIFRDOYG.js";import{Fb as u,Hb as h,Oa as y,Pa as x,Pb as f,ka as $,ua as b,wa as g}from"./chunk-TB7HFPBB.js";import{d,i as w}from"./chunk-773TIA5M.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();function U(a){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(a);if(!t){let v=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return k(new Error(`Parsing the url ${a} failed. Supported formats are ${v.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",r=e==="github"?"github.com":e,s=t[4],i=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),o=t[7],p=o?`#${o}`:"",c=`git@${r}:${s}/${i}`,H=`https://${r}/${s}/${i}`,P=["https:/",r,s,i,n].join("/").concat(p);return T({full:P,site:r,user:s,name:i,ref:o,subDirectory:n,ssh:c,http:H})}function A(a){let t=new URL(a),e=t.hash?t.hash.slice(1):void 0,[r,s,i,...n]=t.pathname.split("/"),o=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${s}/${i}`,branch:e,filePath:o}}async function B(a,t,e,r){let s=`https://github.com/${a}/releases/download/${t}/${e}`;return G("cmd_all_timing_network_ms")(async()=>{f(h`Downloading ${u.link(e,s)}`),await $(async i=>{let n=d(i,e),o;try{if(o=await R(s,void 0,"slow-request"),!o.ok)throw new l(`Failed to download ${e}: ${o.statusText}`)}catch(c){throw new l(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let p=await o.arrayBuffer();await b(n,Buffer.from(p)),await x(n,493),await g(w(r)),await y(n,r)}),f(h`${u.successIcon()} Successfully downloaded ${u.path(r)}`)})}export{U as a,A as b,B as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
1
|
+
import{a as _}from"./chunk-TM44Z7U7.js";import{e as R}from"./chunk-N6IFIMC6.js";import{a as j}from"./chunk-KQTVJMV6.js";import{c as O,i as k,o as x}from"./chunk-HSVZU7MP.js";import{p as v,v as A}from"./chunk-4P54DKG4.js";import{b as F,c as L}from"./chunk-NGCPVRDM.js";import{J as y}from"./chunk-EEEKSYWV.js";import{d as T}from"./chunk-IIFRDOYG.js";import{$a as $,Lb as S,Pb as p,la as P,ua as g}from"./chunk-TB7HFPBB.js";import{d as m,i as w}from"./chunk-773TIA5M.js";import{r as U}from"./chunk-T6CC5WUU.js";import{e as D,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();import{fileURLToPath as I}from"node:url";async function E(...i){let e=await $("package.json",{cwd:I(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?m(w(e),"assets",...i):m(w(e),"dist","assets",...i)}async function b(i,e,s,t,n,f){let c=await O(i)?await j(f,i.storeFqdn):void 0;if(n)throw new T("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let d=await x(e,i,n,c),o=await k(d,{method:"GET",path:s,query:[],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(o.status!==200){let u=await o.text();throw new Error(`Bad response: ${o.status}: ${u}`)}let a=await o.text();t?S(a):await J(a)}async function J(i){let e=process.env.WSL_DISTRO_NAME,s=e?`//wsl$/${e}`:"",t=await E("speedscope","index.html");p(`[Theme Profile] Resolved URL to open: ${t}`);let n="liquid-profile",f=Buffer.from(i).toString("base64"),c=`speedscope.loadFileFromBase64(${JSON.stringify(n)}, ${JSON.stringify(f)})`,d=`speedscope-${Number(new Date)}-${process.pid}`,o=m(P(),`${d}.js`);p(`[Theme Profile] writing JS file to: ${o}`),await g(o,c),p(`[Theme Profile] JS file created successfully: ${o}`),t=`${s}${t}`,o=`${s}${o}`,t+=`#localProfilePath=${o}`;let a=m(P(),`${d}.html`);p(`[Theme Profile] writing HTML file to: ${a}`),await g(a,`<script>window.location=${JSON.stringify(t)}</script>`),p(`[Theme Profile] HTML file created successfully: ${a}`),a=`${s}${a}`,t=`file://${a}`,p(`[Theme Profile] Opening URL: ${t}`);let u=await y(t);p(`[Theme Profile] URL opened successfully: ${u}`)}var h=D(U(),1);var q,r=class extends A{async command(e,s){let{password:t}=e,n;e.theme?n={filter:{theme:e.theme}}:n={filter:{live:!0}};let f=await _(s,n),c=[{title:`Generating Liquid profile for ${s.storeFqdn} ${e.url}`,task:async()=>{await b(s,f.id.toString(),e.url,e.json,t,e["store-password"])}}];await R(c)}};q=r;r.summary="Profile the Liquid rendering of a theme page.";r.usage=["theme profile","theme profile --url /products/classic-leather-jacket"];r.descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
|
|
2
2
|
|
|
3
3
|
This command will open a web page with the Speedscope profiler detailing the time spent executing Liquid on the given page.`;r.description=q.descriptionWithoutMarkdown();r.flags={...F,...v,theme:h.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),url:h.Flags.string({description:"The url to be used as context",env:"SHOPIFY_FLAG_URL",default:"/"}),"store-password":h.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),...L};r.multiEnvironmentsFlags=null;var le=r;export{le as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as mt,b as ht,f as _e,g as ae,h as A,i as ce,k as yt,n as Et}from"./chunk-
|
|
1
|
+
import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as mt,b as ht,f as _e,g as ae,h as A,i as ce,k as yt,n as Et}from"./chunk-HSVZU7MP.js";import{a as M,l as ft,m as gt}from"./chunk-I5X3IP6T.js";import{s as ie,t as W}from"./chunk-4P54DKG4.js";import{a as O,b as N,e as st,g as nt,i as rt,j as ot,k as it,n as at,p as ct,q as lt,r as oe,s as $,u as dt,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as ut}from"./chunk-L42FYXFW.js";import{va as L,xa as H}from"./chunk-TIU7MMRT.js";import{b as Qe}from"./chunk-5C7HDTHJ.js";import{P as tt,u as Ke,w as _,x as te,y as et}from"./chunk-EEEKSYWV.js";import{d as se}from"./chunk-IIFRDOYG.js";import{Fb as q,Hb as ne,Mb as re,O as Ve,Pb as F,Qb as D,Ta as v,Wa as C,_ as $e,bb as ke,ma as k,ua as be,wa as Xe,ya as Ze}from"./chunk-TB7HFPBB.js";import{d as E,g as V,j as Ge,k as j}from"./chunk-773TIA5M.js";import{e as Ye,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var ns=".shopifyignore",wt=/templates\/\*(\.(json|liquid))?$/,Tt=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=Ie(s),[a=[],u=[]]=Ie(n),[m=[],c=[]]=Ie(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),u.length>0&&(l=l.concat(e.filter(B(u,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Ve(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>rs(n,i)||as(i)&&is(n,cs(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function Rt(e){let t=E(e,ns);return await v(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function Ie(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function rs(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!Tt.has(t)&&(Tt.add(t),_({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),os(t)?ke(e,t.replace(wt,"templates/**/*$1"),s):!1)}function os(e){return wt.test(e)}function is(e,t){return t.test(e)}function as(e){return e.startsWith("/")&&e.endsWith("/")}function cs(e){return new RegExp(e.slice(1,-1))}h();import St from"fs/promises";var le=class{constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await St.writeFile(this.notifyPath,t),await St.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ls from"node:events";var Ft=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ls,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await pe(e,c),p=de(c,l),f=typeof l=="string"?l:"",x=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:p,value:f,attachment:x})),l},i=C(Ft,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let p=V(e,l),f=o(p).then(()=>{let x=t.get(p);return s.add(x.key),x.value??x.attachment??""});tt(5).then(()=>{s.delete(p)}).catch(()=>{}),r(c,{fileKey:p,onContent:x=>{f.then(P=>{P&&x(P)}).catch(()=>{})},onSync:x=>{}})},u=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:p=>p()})},m=new Set(Ft.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-VDIVGBZH.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",u.bind(null))}}}h();h();var ds="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function Pt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $t(e){return(0,String.raw)`<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>${e.title}</title>
|
|
@@ -97,7 +97,7 @@ import{a as U,b as xt}from"./chunk-KRZABRYT.js";import{a as mt,b as ht,f as _e,g
|
|
|
97
97
|
})();`)}o.push("})();");let i=o.join(`
|
|
98
98
|
`);return oe(t,{getContents:()=>i,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(i),mtime:new Date})})}function Ee(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Nt(e,t){let s=js[t],n=s.get(e.key);if(n?.checksum===e.checksum)return n.content;if(s.delete(e.key),!e.value)return;let r=[`/* ${e.key} */`],o=ge(e.value??"",t)?.trimEnd();if(o&&r.push(o),r.length>1){let i=r.join(`
|
|
99
99
|
`);return s.set(e.key,{checksum:e.checksum,content:i}),i}}h();import*as Wt from"node:os";function Ws(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Wt.networkInterfaces()))for(let a of i??[]){let u=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${u}]`:u;s.add(`${c}${n}`)}return s}function Ms(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Mt(e,t){let s=Ws(e,t);return $(n=>{let r=n.node.req.headers.host,o=Ms(r);if(!o||!s.has(o))return N(n,O({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}h();function Ut(){return Bt()}function qr(){return Bt()}function Bt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Us}from"node:http";async function zr(e,t){let s=await Js(e,t);return await zs(e,s),Bs(e,s)}function Bs(e,t){let s=dt();s.use(Mt(t.options.host,t.options.port)),s.use(Jt(e,t)),s.use(Ot(e,t)),s.use(jt(e,t)),s.use(Dt(e,t));let n=Us(pt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function Js(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",u=r??9293,m=Ut(),c=vt(o);return await c.ready(),{session:await Et(e.id.toString(),s,void 0,n,i),localThemeFileSystem:m,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:u,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function zs(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{xe(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function fe(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Re=Ye(ut(),1);import Ys from"node:events";var Me=new Map,K=new Map;function zt(e,t){let s=(0,Re.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?K.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):K.delete(e)}function Ue(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(j(e))}function Oe(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${E("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,u=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let m of e.localThemeFileSystem.unsyncedFileKeys)if(Ue(m)){if(i&&r.test(m)){if(m!==o)continue}else if(a.test(m)){if(u){if(!m.startsWith(`locales/${s}.`))continue}else if(!m.includes(".default."))continue}n[m]=e.localThemeFileSystem.files.get(m)?.value??""}return n}function co(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=j(r);o(u=>{!Qs(r)&&Ue(r)&&a===".json"&&zt(r,u),xe(e,t,i,{type:"update",key:r,payload:Xs(r,t)})})},n=({fileKey:r,onSync:o})=>{K.delete(r),xe(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&zt(o,a)}else o.endsWith(".liquid")&&Xt(i)}))})}var Gs="1",Gt=new Ys;function we(e){Gt.emit("hot-reload",{...e,version:Gs})}function Jt(e,t){return $(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ye(s).searchParams;if(n){let o=lt(s);return Gt.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{_({headline:"Failed to send HotReload event.",body:a.stack})})}),we({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Re.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?te(o):o.type==="warn"?_(o):o.type==="info"?Ke(o):_({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===Vt)return k(Se()).then(o=>it(s,o,"application/javascript")).catch(o=>N(s,O({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",u=s.path.split("?")[0]??"",m=new URLSearchParams(r);if(m.delete("section_key"),m.delete("section_id"),m.delete("app_block_id"),m.delete("_fd"),m.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let p=t.localThemeFileSystem.files.get(o)?.value;if(!p)return"";c[o]=p}for(let p of l)if(p.endsWith(".json")){for(let[f,x]of K.get(p)??[])if(i.endsWith(`__${x}`)){let P=t.localThemeFileSystem.files.get(p)?.value;P&&(c[p]=P);continue}}}return ce(t.session,{method:s.method,path:u??"/",query:[...m.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:ct(s),replaceExtensionTemplates:fe(t)}).then(async l=>{if(!l.ok)throw H("theme-service:hot-reload:section:render-failed"),ae(l);return Q(t,l)}).catch(async l=>{let{status:p,statusText:f,...x}=A(L(l),"Failed to render section on Hot Reload");return H("theme-service:hot-reload:section:render-error"),a||_(x),new Response(null,{status:p,statusText:f})})}})}var ee=(e,t)=>we({themeId:String(e),type:"full",key:t});function xe(e,t,s,n){let r=()=>ee(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);we({sync:"local",themeId:o,...n}),s(()=>we({sync:"remote",themeId:o,...n}),r)}function Vs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Re.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of K)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function Xs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?Vs(e,t):[],replaceTemplates:Ue(e)?Oe(t):{},updatedFileParts:n&&Xt(n)}}var Te="hot-reload-client",Zs="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",Yt=new RegExp(`<script id="${Te}"[^>]*>[^<]*</script>`),Vt="/@shopify/theme-hot-reload";function Ne(e,t){return t.options.liveReload==="off"?e.replace(Yt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(Yt,"").replace(/<\/head>/,`<script id="${Te}" src="${Vt}" defer></script></head>`):e.includes(`<script id="${Te}"`)?e:e.replace(/<\/head>/,`<script id="${Te}" src="${Zs}" defer></script></head>`)}function Qs(e){return e.startsWith("assets/")}function Xt(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Me.get(e.key);if(o?.checksum===e.checksum||(Me.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),u=e.value,m=(c,l)=>{u=u.replace(l,"");let p=a(l),f=`${c}Tag`;n[f]=!o||p!==o[f],r[f]=p};for(let c of i){let l=ge(e.value??"",c);l&&m(c,l)}return u=a(u.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=u,n.liquid=!o||u!==o.liquid,Me.set(e.key,r),n}h();var Zt=Ye(ut(),1);function Ks(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function Qt(e,t,s){if(Ks(s)){let n=E(e,"listings",t,s);if(await v(n))return n}}async function Kt(e,t){let s=E(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,Zt.parseJSON)(n,null,!0);return r?(r.current=$e(t),JSON.stringify(r,null,2)):n}async function go(e,t){let s=E(e,"listings"),n=E(s,t);if(await v(n))return;let o=[];await v(s)&&(o=await C("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${$e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new se(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import en from"node:events";import{fileURLToPath as tn}from"node:url";var sn=250,es=["assets/**/*.*","config/**/*.json","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],b={layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Co(e,t){let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new en,a=(d,g)=>{i.emit(d,g)},u=t?.notify?new le(t.notify):void 0,m=async d=>{let g=t?.listing?await rn(e,d,t.listing):await pe(e,d),y=de(d,g);return s.set(d,M({key:d,checksum:y,value:typeof g=="string"?g:"",attachment:Buffer.isBuffer(g)?g.toString("base64"):""})),g},c=C(es,{cwd:e,deep:3,ignore:W}).then(d=>Promise.all([Rt(e),...d.map(m)])).then(([d])=>{Array.isArray(d)&&o.ignoreFromFile.push(...d)}),l=d=>V(e,d),p=d=>Le([{key:d}],o).length===0;function f(d,g,y,T){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&T===Se()){ee(g,T);return}let R=l(T);if(t?.listing&&R.startsWith(`listings/${t.listing}/`)){let w=R.replace(`listings/${t.listing}/`,"");if(w.startsWith("templates/")||w.startsWith("sections/"))R=w;else return}x(R).then(()=>{switch(d){case"add":case"change":return P(d,g,y,R);case"unlink":return ve(g,y,R,n)}}).catch(w=>{D(`Error handling file event for ${R}: ${w}`)})}function x(d){return u?.notify(d)??Promise.resolve()}let P=(d,g,y,T)=>{if(p(T))return;let R=s.get(T)?.checksum,w=m(T).then(async()=>{let S=s.get(T);if(S)return S.checksum!==R&&r.add(T),{value:S.value||void 0,attachment:S.attachment}}),I=w.then(S=>{if(S)return nn(r,n,T,g,y)(S)}).catch(_e(T,"upload"));a(d,{fileKey:T,onContent:S=>{w.then(Y=>{r.has(T)&&S(Y?.value??Y?.attachment??"")}).catch(()=>{})},onSync:(S,Y)=>{I.then(G=>{G?S():Y?.()}).catch(()=>{})}})},ve=(d,g,y,T)=>{if(p(y))return;T.delete(y),s.delete(y),r.add(y);let R=t?.noDelete?Promise.resolve():ft(Number(d),[y],g).then(async w=>{if(!w[0]?.success)throw new Error(`Failed to delete file "${y}" from remote theme.`);return r.delete(y),ts("delete",y),!0}).catch(w=>(_e(y,"delete")(w),!1));a("unlink",{fileKey:y,onSync:w=>{R.then(I=>{I&&w()}).catch(()=>{})}})},Pe=new Set(es.map(d=>E(e,d.split("/").shift()??"")));return t?.listing&&Pe.add(E(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&Pe.add(Se()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{s.delete(d),await on(e,d)},write:async d=>{let g=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&g){let y=E("listings",t.listing,d.key),T=E(e,y),R=await v(T);s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),R?await Be(e,{...d,key:y}):await Be(e,d);return}s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Be(e,d)},read:m,applyIgnoreFilters:d=>Le(d,o),addEventListener:(d,g)=>{i.on(d,g)},startWatcher:async(d,g)=>{let{default:y}=await import("./chokidar-VDIVGBZH.js"),T=y.watch([...Pe],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),R=new Map,w=(I,S)=>{let G=`${l(S)}:${I}`,ze=R.get(G);ze&&clearTimeout(ze);let ss=setTimeout(()=>{R.delete(G),f(I,d,g,S)},sn);R.set(G,ss)};T.on("add",w.bind(null,"add")).on("change",w.bind(null,"change")).on("unlink",w.bind(null,"unlink")).on("error",I=>{D(`File watcher error: ${I}`),L("theme-service:file-watcher:error")})}}}function nn(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await gt(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ee(n,s),new Error(a.join(`
|
|
100
|
-
`))}return t.delete(s)&&ee(n,s),e.delete(s),ts("update",s),!0}}async function Be(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await an(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function pe(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await v(n)){F(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function rn(e,t,s){if(t==="config/settings_data.json")return Kt(e,s);let n=await Qt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return pe(e,t)}async function on(e,t){let s=E(e,t);if(!await v(s)){F(`File ${s} can't be removed because it doesn't exist...`);return}await Ze(s)}function Ao(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],u=[],m=[],c=[],l=[];return e.forEach(p=>{let f=p.key;f.endsWith(".liquid")?b.sectionLiquidRegex.test(f)?t.push(p):b.blockLiquidRegex.test(f)?c.push(p):b.layoutLiquidRegex.test(f)?l.push(p):s.push(p):b.configSchemaRegex.test(f)?a.push(p):b.configDataRegex.test(f)?u.push(p):b.jsonRegex.test(f)?b.contextualizedJsonRegex.test(f)?i.push(p):b.sectionJsonRegex.test(f)?n.push(p):b.templateJsonRegex.test(f)?r.push(p):o.push(p):b.staticAssetRegex.test(f)&&m.push(p)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:u,staticAssetFiles:m,blockLiquidFiles:c,layoutFiles:l}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml"].includes(U(e))}async function Ho(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","
|
|
100
|
+
`))}return t.delete(s)&&ee(n,s),e.delete(s),ts("update",s),!0}}async function Be(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await an(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function pe(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await v(n)){F(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function rn(e,t,s){if(t==="config/settings_data.json")return Kt(e,s);let n=await Qt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return pe(e,t)}async function on(e,t){let s=E(e,t);if(!await v(s)){F(`File ${s} can't be removed because it doesn't exist...`);return}await Ze(s)}function Ao(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],u=[],m=[],c=[],l=[];return e.forEach(p=>{let f=p.key;f.endsWith(".liquid")?b.sectionLiquidRegex.test(f)?t.push(p):b.blockLiquidRegex.test(f)?c.push(p):b.layoutLiquidRegex.test(f)?l.push(p):s.push(p):b.configSchemaRegex.test(f)?a.push(p):b.configDataRegex.test(f)?u.push(p):b.jsonRegex.test(f)?b.contextualizedJsonRegex.test(f)?i.push(p):b.sectionJsonRegex.test(f)?n.push(p):b.templateJsonRegex.test(f)?r.push(p):o.push(p):b.staticAssetRegex.test(f)&&m.push(p)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:u,staticAssetFiles:m,blockLiquidFiles:c,layoutFiles:l}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml"].includes(U(e))}async function Ho(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function an(e){let t=cn(e);await v(t)||await Xe(t)}function cn(e){let t=Ge(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ts(e,t){re(ne`• ${ie.format(new Date)} Synced ${q.raw("\xBB")} ${e} ${t}`)}function Se(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?E(tn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function de(e,t){return t?Buffer.isBuffer(t)?Je(t):un(e)?ln(t):dn(e,t):""}function ln(e){let t=e;return t=t.replace(/\r\n/g,`
|
|
101
101
|
`),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=pn(t),Je(t)}function dn(e,t){let s=t;return Fe(e)&&(s=s.replace(/\r\n/g,`
|
|
102
102
|
`)),Je(s)}function pn(e){let t=!1,s=!1,n="";for(let r of e)r==='"'&&!s&&(t=!t),!(!t&&(r===" "||r===`
|
|
103
103
|
`))&&(n+=r,s=r==="\\"&&!s);return n}function Je(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Qe(t)}function Mo(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function un(e){return e.endsWith("/settings_data.json")}export{Mo as a,jt as b,Dt as c,Ot as d,Mt as e,qr as f,zr as g,co as h,Jt as i,ee as j,go as k,Co as l,Ao as m,Ho as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,g as c,i as p,j as f}from"./chunk-
|
|
1
|
+
import{b as a,g as c,i as p,j as f}from"./chunk-I5X3IP6T.js";import{g as h}from"./chunk-IIFRDOYG.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();i();function d(n){let e=/[^\p{Letter}\p{Number}\p{Mark}-]/gu;return n.replace(e,"-")}import{randomBytes as l}from"crypto";import{hostname as g}from"os";var T=50;function m(n){let e=g().split(".")[0],r=l(3).toString("hex"),t=`${n} ()`,s=T-t.length-r.length-1,o=d(`${r}-${e.substring(0,s)}`);return`${n} (${o})`}var u=class{constructor(e){this.adminSession=e}async findOrCreate(e,r){let t=await this.fetch(e,r);return t?this.setTheme(t.id.toString()):t=await this.create(r,e),t}async fetch(e,r){if(!this.themeId&&!e)return;let t=e&&r===a?await p(e,this.adminSession):await c(parseInt(this.themeId,10),this.adminSession);return t||this.removeTheme(),t}generateThemeName(e){return m(e)}async create(e,r){let t=r??m(this.context),s=e??a,o=await f({name:t,role:s},this.adminSession);if(!o)throw new h(`Could not create theme with name "${t}" and role "${s}"`);return this.setTheme(o.id.toString()),o}};export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as z,la as j,ma as J,na as k,oa as W,pa as A,qa as q,ra as N,sa as B,ta as L,ua as K,va as R,wa as Q,xa as O,ya as Y}from"./chunk-
|
|
1
|
+
import{$ as z,la as j,ma as J,na as k,oa as W,pa as A,qa as q,ra as N,sa as B,ta as L,ua as K,va as R,wa as Q,xa as O,ya as Y}from"./chunk-4MLEL3VK.js";import{f as v,i as X,p as c}from"./chunk-R7QYSC6T.js";import{c as G}from"./chunk-5VRU3BT5.js";import{v as U,z as w}from"./chunk-EEEKSYWV.js";import{d as E,f as $}from"./chunk-IIFRDOYG.js";import{$ as b,Hb as H,Ta as P,Y as a,qa as I,wa as D,ya as V}from"./chunk-TB7HFPBB.js";import{d as C,j as F}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Z(e){switch(e){case d.Offsite:return k;case d.CreditCard:return R;case d.CustomCreditCard:return L;case d.CustomOnsite:return N;case d.Redeemable:return A;case d.CardPresent:return O}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function ee(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Z(e.type);switch(i){case k:return x(e,t,W);case R:return x(e,t,Q);case L:return x(e,t,K);case N:return x(e,t,B);case A:return x(e,t,q);case O:return x(e,t,Y);default:throw new Error(`Unsupported extension: ${i}`)}}function x(e,t,i){let o=(e.activeVersion??e.draftVersion)?.config;if(!o)throw new Error("No config found for extension");let r=JSON.parse(o),l=i(r,t);l&&delete l.api_version;let p=e.activeVersion?.context??e.draftVersion?.context??Z(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:a(e.title.substring(0,c)),...l,targeting:[{target:`${p}`}]}]}}s();s();var fe=new Map(J.map(e=>[e[1],e[0]])),ue=(e,t)=>{let i=fe.get(e.uiType);if(!i)throw new E(`Field type ${e.uiType} is not supported`);let n={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(n.name=e.label,n.required=e.required),n},me=(e,t)=>{let o={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(o.required=e.required),e.uiType==="marketing-activity-id"&&(o.marketingActivityCreateUrl=e.marketingActivityCreateUrl,o.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),o},te=(e,t)=>t?t.map(n=>n.uiType==="commerce-object-id"||n.uiType==="marketing-activity-id"||j.includes(n.uiType)?me(n,e):ue(n,e)):[];function ie(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,n;if(e.type==="flow_trigger_discovery_webhook"){let o=JSON.parse(t);n={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:a(e.title.substring(0,c)),url:o.url}]}}else{let o=JSON.parse(t),r=te(e.type,o.fields??[]);n={extensions:[{type:e.type.replace("_definition",""),name:o.title,handle:a(e.title.substring(0,c)),description:o.description,runtime_url:o.url??i,config_page_url:o.custom_configuration_page_url,config_page_preview_url:o.custom_configuration_page_preview_url,validation_url:o.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return n}s();s();var ne=e=>{let t=e.split("#");if(t.length!==2||t.some(l=>l===""||l===void 0))throw new Error("Invalid context");let i="admin",n=ge(t[0]??""),o=de(t[1]??""),r="link";return o==="selection"?[i,`${n}-index`,`${o}-action`,r].join("."):[i,`${n}-${o}`,"action",r].join(".")},de=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},ge=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function oe(e,t,i){let n=e.activeVersion?.config??e.draftVersion?.config;if(!n)throw new Error("No config found for extension");let o=e.activeVersion?.context??e.draftVersion?.context;if(!o)throw new Error("No context found for link extension");let r=JSON.parse(n);if(i.embedded)try{let p=new URL(r.url),f=p.pathname.startsWith("/")?p.pathname.substring(1):p.pathname,u=new URL(`app://${f}`);u.search=p.search,u.hash=p.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:a(e.title.substring(0,c)),targeting:[{url:r.url,target:ne(o)}]}]}}s();var _e={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},ye={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function Ce(e){let t=new URL(e);return t.pathname+t.search+t.hash}function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:a(e.title.substring(0,c)),title:i.title,description:i.description,api_path:Ce(i.app_api_url),tactic:i.tactic,marketing_channel:_e[i.platform]??"",referring_domain:ye[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:o,...r})=>r)}]}}s();function se(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:a(e.title.substring(0,c)),pattern:i.pattern}]}}var S=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:ee},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:ie},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:re},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:se},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:oe}];function ae(e){return S.filter(t=>t.extensionTypes.some(i=>e.some(n=>n.type.toLowerCase()===i.toLowerCase())))}async function ut(e){if(e.length===1&&e[0])return e[0];let t=e.map(o=>({label:o.label,value:o.value})),i=await w({message:"Extension type to migrate",choices:t}),n=e.find(o=>o.value===i);if(n===void 0)throw new E("Invalid migration choice");return n}s();var kt=S.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),n=C(t.directory,X.extensions.directoryName,i);if(await P(n)){let o=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await w({message:`Directory "${i}" already exists. What would you like to do?`,choices:o});if(r===g.Cancel)throw new $;return{directory:n,action:r}}return await D(n),await I(C(n,v.lockFile)),{directory:n,action:g.Write}}async function xe(e){let{app:t,remoteApp:i,developerPlatformClient:n,extensionTypes:o,extensions:r,buildExtensionConfig:l,all:p}=e,f=r.filter(m=>o.includes(m.type.toLowerCase()));if(f=we(t,f),f.length===0)throw new E("No extensions to migrate");if(!p){let m=f.map(y=>({label:y.title,value:y.uuid}));f.length>1&&m.push({label:"All",value:"All"});let _=await w({message:"Extensions to migrate",choices:m});_!=="All"&&(f=[f.find(y=>y?.uuid===_)])}let u={},h=f.map(async m=>{let{directory:_,action:y}=await Ee({app:t,name:m.title}),ce=a(m.title.substring(0,c));if(u[ce]=m.uuid,y===g.Write){let M=l(m,r,t.configuration),le=C(_,"shopify.extension.toml");await new G(le,M).replace(M);let pe=C(_,v.lockFile);await V(pe)}return{extension:m,directory:C("extensions",F(_))}}),T=await Promise.all(h);be(T),await z({app:t,identifiers:{extensions:u,app:i.apiKey},command:"import-extensions",developerPlatformClient:n})}function we(e,t){let i=e.dotenv?.variables??{},n=e.allExtensions.map(o=>i[o.idEnvironmentVariableName]);return t.filter(o=>!n.includes(o.uuid))}async function At(e){let t=ae(e.extensions);await Promise.all(t.map(async i=>xe({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function be(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>H`• "${t.extension.title}" at: ${t.directory}`.value).join(`
|
|
2
2
|
`)})}s();async function Rt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:n,onlyDashboardManaged:o=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:l,extensionRegistrations:p}=r.app;return(o?l:p.concat(l)).filter(u=>{let h=n.includes(u.type.toLowerCase()),T=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(T??m)})}export{ae as a,ut as b,kt as c,xe as d,we as e,At as f,Rt as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ea,b as Sa}from"./chunk-EJDWYASP.js";import{a as bn}from"./chunk-RJ5VF3QY.js";import{a as ya}from"./chunk-7UNQOKZW.js";import{a as wa}from"./chunk-GB3YC4TI.js";import{a as wt}from"./chunk-7HZG7FBK.js";import{f as Ne}from"./chunk-N5U5Q2MG.js";import{d as qe,e as Et,f as wn,g as En,k as Sn}from"./chunk-AUZCENYI.js";import{C as ca,Db as yn,E as ua,F as fa,Fb as Tn,H as ma,Hb as St,J as da,Pb as Ie,U as un,Vb as Ge,Wb as ke,a as ea,eb as N,f as ra,fb as g,gb as y,hb as sr,ib as mn,jb as xt,kb as fe,l as na,lb as dn,m as oa,mb as De,nb as yt,ob as pn,pb as ar,rb as ha,sb as ga,t as ir,tb as hn,u as ia,ub as Be,vb as $e,wb as gn,xb as V,y as aa,z as la}from"./chunk-BXDZX3BS.js";import{e as ta,g as sa,j as pa,l as fn,u as Ue}from"./chunk-A4SBXDZB.js";import{f as nt,o as vn}from"./chunk-MGPLKG23.js";import{a as or}from"./chunk-NNOSZ447.js";import{b as an,i as ln,q as cn}from"./chunk-773TIA5M.js";import{a as xn}from"./chunk-636CTEW7.js";import{j as ba}from"./chunk-T6CC5WUU.js";import{a as xa}from"./chunk-TOLPNBZK.js";import{a as ue,c as k,e as D,g as u}from"./chunk-VKWPEFWQ.js";var Dn=k((Gu,Ln)=>{u();Ln.exports=Rn;Rn.sync=Ta;var Cn=ue("fs");function va(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function An(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:va(t,r)}function Rn(e,t,r){Cn.stat(e,function(n,o){r(n,n?!1:An(o,e,t))})}function Ta(e,t){return An(Cn.statSync(e),e,t)}});var In=k((ju,Bn)=>{u();Bn.exports=Mn;Mn.sync=Ca;var kn=ue("fs");function Mn(e,t,r){kn.stat(e,function(n,o){r(n,n?!1:_n(o,t))})}function Ca(e,t){return _n(kn.statSync(e),t)}function _n(e,t){return e.isFile()&&Aa(e,t)}function Aa(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),f=parseInt("100",8),m=parseInt("010",8),d=parseInt("001",8),p=f|m,b=r&d||r&m&&o===s||r&f&&n===i||r&p&&i===0;return b}});var On=k((Vu,Pn)=>{u();var zu=ue("fs"),vt;process.platform==="win32"||global.TESTING_WINDOWS?vt=Dn():vt=In();Pn.exports=lr;lr.sync=Ra;function lr(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){lr(e,t||{},function(i,s){i?o(i):n(s)})})}vt(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Ra(e,t){try{return vt.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hn=k((Ku,Gn)=>{u();var He=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Fn=ue("path"),La=He?";":":",Un=On(),$n=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Nn=(e,t)=>{let r=t.colon||La,n=e.match(/\//)||He&&e.match(/\\/)?[""]:[...He?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=He?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=He?o.split(r):[""];return He&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},qn=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Nn(e,t),s=[],f=d=>new Promise((p,b)=>{if(d===n.length)return t.all&&s.length?p(s):b($n(e));let S=n[d],v=/^".*"$/.test(S)?S.slice(1,-1):S,w=Fn.join(v,e),A=!v&&/^\.[\\\/]/.test(e)?e.slice(0,2)+w:w;p(m(A,d,0))}),m=(d,p,b)=>new Promise((S,v)=>{if(b===o.length)return S(f(p+1));let w=o[b];Un(d+w,{pathExt:i},(A,C)=>{if(!A&&C)if(t.all)s.push(d+w);else return S(d+w);return S(m(d,p,b+1))})});return r?f(0).then(d=>r(null,d),r):f(0)},Da=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Nn(e,t),i=[];for(let s=0;s<r.length;s++){let f=r[s],m=/^".*"$/.test(f)?f.slice(1,-1):f,d=Fn.join(m,e),p=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let b=0;b<n.length;b++){let S=p+n[b];try{if(Un.sync(S,{pathExt:o}))if(t.all)i.push(S);else return S}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw $n(e)};Gn.exports=qn;qn.sync=Da});var Wn=k((Zu,cr)=>{"use strict";u();var jn=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};cr.exports=jn;cr.exports.default=jn});var Kn=k((Ju,Xn)=>{"use strict";u();var zn=ue("path"),ka=Hn(),Ma=Wn();function Vn(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=ka.sync(e.command,{path:r[Ma({env:r})],pathExt:t?zn.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=zn.resolve(o?e.options.cwd:"",s)),s}function _a(e){return Vn(e)||Vn(e,!0)}Xn.exports=_a});var Yn=k((tf,fr)=>{"use strict";u();var ur=/([()\][%!^"`<>&|;, *?])/g;function Ba(e){return e=e.replace(ur,"^$1"),e}function Ia(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ur,"^$1"),t&&(e=e.replace(ur,"^$1")),e}fr.exports.command=Ba;fr.exports.argument=Ia});var Qn=k((nf,Zn)=>{"use strict";u();Zn.exports=/^#!(.*)/});var eo=k((sf,Jn)=>{"use strict";u();var Pa=Qn();Jn.exports=(e="")=>{let t=e.match(Pa);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var ro=k((lf,to)=>{"use strict";u();var mr=ue("fs"),Oa=eo();function Fa(e){let r=Buffer.alloc(150),n;try{n=mr.openSync(e,"r"),mr.readSync(n,r,0,150,0),mr.closeSync(n)}catch{}return Oa(r.toString())}to.exports=Fa});var so=k((uf,io)=>{"use strict";u();var Ua=ue("path"),no=Kn(),oo=Yn(),$a=ro(),Na=process.platform==="win32",qa=/\.(?:com|exe)$/i,Ga=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ha(e){e.file=no(e);let t=e.file&&$a(e.file);return t?(e.args.unshift(e.file),e.command=t,no(e)):e.file}function ja(e){if(!Na)return e;let t=Ha(e),r=!qa.test(t);if(e.options.forceShell||r){let n=Ga.test(t);e.command=Ua.normalize(e.command),e.command=oo.command(e.command),e.args=e.args.map(i=>oo.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Wa(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:ja(n)}io.exports=Wa});var co=k((mf,lo)=>{"use strict";u();var dr=process.platform==="win32";function pr(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function za(e,t){if(!dr)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=ao(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function ao(e,t){return dr&&e===1&&!t.file?pr(t.original,"spawn"):null}function Va(e,t){return dr&&e===1&&!t.file?pr(t.original,"spawnSync"):null}lo.exports={hookChildProcess:za,verifyENOENT:ao,verifyENOENTSync:Va,notFoundError:pr}});var mo=k((pf,je)=>{"use strict";u();var uo=ue("child_process"),hr=so(),gr=co();function fo(e,t,r){let n=hr(e,t,r),o=uo.spawn(n.command,n.args,n.options);return gr.hookChildProcess(o,n),o}function Xa(e,t,r){let n=hr(e,t,r),o=uo.spawnSync(n.command,n.args,n.options);return o.error=o.error||gr.verifyENOENTSync(o.status,n),o}je.exports=fo;je.exports.spawn=fo;je.exports.sync=Xa;je.exports._parse=hr;je.exports._enoent=gr});var ko=k((Zf,Do)=>{"use strict";u();var{PassThrough:bl}=ue("stream");Do.exports=function(){var e=[],t=new bl({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var Jo=k((ad,Qo)=>{u();var{EventEmitter:Zl}=ue("events"),Dt=class{constructor(){this.eventEmitter=new Zl,this.onabort=null,this.aborted=!1,this.reason=void 0}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(t,r){this.eventEmitter.removeListener(t,r)}addEventListener(t,r){this.eventEmitter.on(t,r)}dispatchEvent(t){let r={type:t,target:this},n=`on${t}`;typeof this[n]=="function"&&this[n](r),this.eventEmitter.emit(t,r)}throwIfAborted(){if(this.aborted)throw this.reason}static abort(t){let r=new st;return r.abort(),r.signal}static timeout(t){let r=new st;return setTimeout(()=>r.abort(new Error("TimeoutError")),t),r.signal}},st=class{constructor(){this.signal=new Dt}abort(t){this.signal.aborted||(this.signal.aborted=!0,t?this.signal.reason=t:this.signal.reason=new Error("AbortError"),this.signal.dispatchEvent("abort"))}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}};Qo.exports={AbortController:st,AbortSignal:Dt}});var ui=k((cp,ci)=>{"use strict";u();ci.exports=class ye{constructor(t){try{t(r=>{this.setValue(r,!1)},r=>{this.setValue(r,!0)})}catch(r){this.setValue(r,!0)}}setValue(t,r){this.val=t instanceof ye?t.val:t,this.rejected=r||(t instanceof ye?t.rejected:!1)}static valueFrom(t){if(t instanceof ye){if(t.rejected)throw t.val;return t.val}else return t}then(t){try{if(!this.rejected)return ye.resolve(t(this.val))}catch(r){return ye.reject(r)}return this}catch(t){try{if(this.rejected)return ye.resolve(t(this.val))}catch(r){return ye.reject(r)}return this}static resolve(t){return new ye(r=>{r(t)})}static reject(t){return new ye((r,n)=>{n(t)})}}});var di=k((fp,mi)=>{"use strict";u();var fi=typeof window<"u"&&window.window===window&&window.navigator,pc=fi?window.location.href:process.cwd(),hc=new RegExp("^((https|http)://)?[a-z0-9A-Z]{3}.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z].com|net|cn|cc (:s[0-9]{1-4})?/$"),Ce=mi.exports={concat(e,t){let r=e[e.length-1]==="/",n=t[0]==="/";return e+(r||n?"":"/")+(r&&n?t.substring(1):t)},resolve(e){return Ce.isAbsolute(e)?Ce.normalize(e):Ce.normalize(Ce.concat(pc,e))},normalize(e){let t=[],r=0;e.split("/").reverse().filter(o=>o!==".").forEach(o=>{o===".."?r++:r===0?t.push(o):r--});let n=t.reverse().join("/");return(fi&&n[0]==="/"?n[1]==="/"?window.location.protocol:window.location.origin:"")+n},isData:e=>e.indexOf("data:")===0,isURL:e=>hc.test(e),isAbsolute:e=>e[0]==="/"||/^[^\/]*:/.test(e),relativeToFile(e,t){return Ce.isData(e)||Ce.isAbsolute(t)?Ce.normalize(t):Ce.normalize(Ce.concat(e.split("/").slice(0,-1).join("/"),t))}}});var hi=k((dp,pi)=>{"use strict";u();pi.exports=gc;function gc(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");for(var r=e.substring(5,t).split(";"),n=r[0]||"text/plain",o=n,i=!1,s="",f=1;f<r.length;f++)r[f]=="base64"?i=!0:(o+=";"+r[f],r[f].indexOf("charset=")==0&&(s=r[f].substring(8)));!r[0]&&!s.length&&(o+=";charset=US-ASCII",s="US-ASCII");var m=unescape(e.substring(t+1)),d=i?"base64":"ascii",p=Buffer.from?Buffer.from(m,d):new Buffer(m,d);return p.type=n,p.typeFull=o,p.charset=s,p}});var yi=k((hp,$t)=>{"use strict";u();var{assign:We}=Object,Pr=typeof window<"u"&&window.window===window&&window.navigator,bc=xa().SourceMapConsumer,Ut=ui(),Ir=di(),xc=hi(),bi=Pr?null:$t.require,gi=e=>{let t=r=>r in t.cache?t.cache[r]:t.cache[r]=e(r);return t.forgetEverything=()=>{t.cache=Object.create(null)},t.cache=Object.create(null),t};function xi(e,t){let r=t?Ut:Promise,n=gi(f=>o(f,e(f)));function o(f,m){return m===void 0?n(Ir.resolve(f)):r.resolve(m).then(d=>{let p,b,S,v=w=>(S=S||i(p))(w);return p={path:f,text:d,get lines(){return b=b||d.split(`
|
|
1
|
+
import{a as Ea,b as Sa}from"./chunk-EJDWYASP.js";import{a as bn}from"./chunk-RJ5VF3QY.js";import{a as ya}from"./chunk-7UNQOKZW.js";import{a as wa}from"./chunk-GB3YC4TI.js";import{a as wt}from"./chunk-WTRKTFVE.js";import{f as Ne}from"./chunk-7AY6HLQG.js";import{d as qe,e as Et,f as wn,g as En,k as Sn}from"./chunk-IIFRDOYG.js";import{C as ca,Db as yn,E as ua,F as fa,Fb as Tn,H as ma,Hb as St,J as da,Pb as Ie,U as un,Vb as Ge,Wb as ke,a as ea,eb as N,f as ra,fb as g,gb as y,hb as sr,ib as mn,jb as xt,kb as fe,l as na,lb as dn,m as oa,mb as De,nb as yt,ob as pn,pb as ar,rb as ha,sb as ga,t as ir,tb as hn,u as ia,ub as Be,vb as $e,wb as gn,xb as V,y as aa,z as la}from"./chunk-TB7HFPBB.js";import{e as ta,g as sa,j as pa,l as fn,u as Ue}from"./chunk-A4SBXDZB.js";import{f as nt,o as vn}from"./chunk-SZM6ANMN.js";import{a as or}from"./chunk-NNOSZ447.js";import{b as an,i as ln,q as cn}from"./chunk-773TIA5M.js";import{a as xn}from"./chunk-636CTEW7.js";import{j as ba}from"./chunk-T6CC5WUU.js";import{a as xa}from"./chunk-TOLPNBZK.js";import{a as ue,c as k,e as D,g as u}from"./chunk-VKWPEFWQ.js";var Dn=k((Gu,Ln)=>{u();Ln.exports=Rn;Rn.sync=Ta;var Cn=ue("fs");function va(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function An(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:va(t,r)}function Rn(e,t,r){Cn.stat(e,function(n,o){r(n,n?!1:An(o,e,t))})}function Ta(e,t){return An(Cn.statSync(e),e,t)}});var In=k((ju,Bn)=>{u();Bn.exports=Mn;Mn.sync=Ca;var kn=ue("fs");function Mn(e,t,r){kn.stat(e,function(n,o){r(n,n?!1:_n(o,t))})}function Ca(e,t){return _n(kn.statSync(e),t)}function _n(e,t){return e.isFile()&&Aa(e,t)}function Aa(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),f=parseInt("100",8),m=parseInt("010",8),d=parseInt("001",8),p=f|m,b=r&d||r&m&&o===s||r&f&&n===i||r&p&&i===0;return b}});var On=k((Vu,Pn)=>{u();var zu=ue("fs"),vt;process.platform==="win32"||global.TESTING_WINDOWS?vt=Dn():vt=In();Pn.exports=lr;lr.sync=Ra;function lr(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){lr(e,t||{},function(i,s){i?o(i):n(s)})})}vt(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Ra(e,t){try{return vt.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hn=k((Ku,Gn)=>{u();var He=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Fn=ue("path"),La=He?";":":",Un=On(),$n=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Nn=(e,t)=>{let r=t.colon||La,n=e.match(/\//)||He&&e.match(/\\/)?[""]:[...He?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=He?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=He?o.split(r):[""];return He&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},qn=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Nn(e,t),s=[],f=d=>new Promise((p,b)=>{if(d===n.length)return t.all&&s.length?p(s):b($n(e));let S=n[d],v=/^".*"$/.test(S)?S.slice(1,-1):S,w=Fn.join(v,e),A=!v&&/^\.[\\\/]/.test(e)?e.slice(0,2)+w:w;p(m(A,d,0))}),m=(d,p,b)=>new Promise((S,v)=>{if(b===o.length)return S(f(p+1));let w=o[b];Un(d+w,{pathExt:i},(A,C)=>{if(!A&&C)if(t.all)s.push(d+w);else return S(d+w);return S(m(d,p,b+1))})});return r?f(0).then(d=>r(null,d),r):f(0)},Da=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Nn(e,t),i=[];for(let s=0;s<r.length;s++){let f=r[s],m=/^".*"$/.test(f)?f.slice(1,-1):f,d=Fn.join(m,e),p=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let b=0;b<n.length;b++){let S=p+n[b];try{if(Un.sync(S,{pathExt:o}))if(t.all)i.push(S);else return S}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw $n(e)};Gn.exports=qn;qn.sync=Da});var Wn=k((Zu,cr)=>{"use strict";u();var jn=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};cr.exports=jn;cr.exports.default=jn});var Kn=k((Ju,Xn)=>{"use strict";u();var zn=ue("path"),ka=Hn(),Ma=Wn();function Vn(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=ka.sync(e.command,{path:r[Ma({env:r})],pathExt:t?zn.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=zn.resolve(o?e.options.cwd:"",s)),s}function _a(e){return Vn(e)||Vn(e,!0)}Xn.exports=_a});var Yn=k((tf,fr)=>{"use strict";u();var ur=/([()\][%!^"`<>&|;, *?])/g;function Ba(e){return e=e.replace(ur,"^$1"),e}function Ia(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ur,"^$1"),t&&(e=e.replace(ur,"^$1")),e}fr.exports.command=Ba;fr.exports.argument=Ia});var Qn=k((nf,Zn)=>{"use strict";u();Zn.exports=/^#!(.*)/});var eo=k((sf,Jn)=>{"use strict";u();var Pa=Qn();Jn.exports=(e="")=>{let t=e.match(Pa);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var ro=k((lf,to)=>{"use strict";u();var mr=ue("fs"),Oa=eo();function Fa(e){let r=Buffer.alloc(150),n;try{n=mr.openSync(e,"r"),mr.readSync(n,r,0,150,0),mr.closeSync(n)}catch{}return Oa(r.toString())}to.exports=Fa});var so=k((uf,io)=>{"use strict";u();var Ua=ue("path"),no=Kn(),oo=Yn(),$a=ro(),Na=process.platform==="win32",qa=/\.(?:com|exe)$/i,Ga=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ha(e){e.file=no(e);let t=e.file&&$a(e.file);return t?(e.args.unshift(e.file),e.command=t,no(e)):e.file}function ja(e){if(!Na)return e;let t=Ha(e),r=!qa.test(t);if(e.options.forceShell||r){let n=Ga.test(t);e.command=Ua.normalize(e.command),e.command=oo.command(e.command),e.args=e.args.map(i=>oo.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Wa(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:ja(n)}io.exports=Wa});var co=k((mf,lo)=>{"use strict";u();var dr=process.platform==="win32";function pr(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function za(e,t){if(!dr)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=ao(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function ao(e,t){return dr&&e===1&&!t.file?pr(t.original,"spawn"):null}function Va(e,t){return dr&&e===1&&!t.file?pr(t.original,"spawnSync"):null}lo.exports={hookChildProcess:za,verifyENOENT:ao,verifyENOENTSync:Va,notFoundError:pr}});var mo=k((pf,je)=>{"use strict";u();var uo=ue("child_process"),hr=so(),gr=co();function fo(e,t,r){let n=hr(e,t,r),o=uo.spawn(n.command,n.args,n.options);return gr.hookChildProcess(o,n),o}function Xa(e,t,r){let n=hr(e,t,r),o=uo.spawnSync(n.command,n.args,n.options);return o.error=o.error||gr.verifyENOENTSync(o.status,n),o}je.exports=fo;je.exports.spawn=fo;je.exports.sync=Xa;je.exports._parse=hr;je.exports._enoent=gr});var ko=k((Zf,Do)=>{"use strict";u();var{PassThrough:bl}=ue("stream");Do.exports=function(){var e=[],t=new bl({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var Jo=k((ad,Qo)=>{u();var{EventEmitter:Zl}=ue("events"),Dt=class{constructor(){this.eventEmitter=new Zl,this.onabort=null,this.aborted=!1,this.reason=void 0}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(t,r){this.eventEmitter.removeListener(t,r)}addEventListener(t,r){this.eventEmitter.on(t,r)}dispatchEvent(t){let r={type:t,target:this},n=`on${t}`;typeof this[n]=="function"&&this[n](r),this.eventEmitter.emit(t,r)}throwIfAborted(){if(this.aborted)throw this.reason}static abort(t){let r=new st;return r.abort(),r.signal}static timeout(t){let r=new st;return setTimeout(()=>r.abort(new Error("TimeoutError")),t),r.signal}},st=class{constructor(){this.signal=new Dt}abort(t){this.signal.aborted||(this.signal.aborted=!0,t?this.signal.reason=t:this.signal.reason=new Error("AbortError"),this.signal.dispatchEvent("abort"))}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}};Qo.exports={AbortController:st,AbortSignal:Dt}});var ui=k((cp,ci)=>{"use strict";u();ci.exports=class ye{constructor(t){try{t(r=>{this.setValue(r,!1)},r=>{this.setValue(r,!0)})}catch(r){this.setValue(r,!0)}}setValue(t,r){this.val=t instanceof ye?t.val:t,this.rejected=r||(t instanceof ye?t.rejected:!1)}static valueFrom(t){if(t instanceof ye){if(t.rejected)throw t.val;return t.val}else return t}then(t){try{if(!this.rejected)return ye.resolve(t(this.val))}catch(r){return ye.reject(r)}return this}catch(t){try{if(this.rejected)return ye.resolve(t(this.val))}catch(r){return ye.reject(r)}return this}static resolve(t){return new ye(r=>{r(t)})}static reject(t){return new ye((r,n)=>{n(t)})}}});var di=k((fp,mi)=>{"use strict";u();var fi=typeof window<"u"&&window.window===window&&window.navigator,pc=fi?window.location.href:process.cwd(),hc=new RegExp("^((https|http)://)?[a-z0-9A-Z]{3}.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z].com|net|cn|cc (:s[0-9]{1-4})?/$"),Ce=mi.exports={concat(e,t){let r=e[e.length-1]==="/",n=t[0]==="/";return e+(r||n?"":"/")+(r&&n?t.substring(1):t)},resolve(e){return Ce.isAbsolute(e)?Ce.normalize(e):Ce.normalize(Ce.concat(pc,e))},normalize(e){let t=[],r=0;e.split("/").reverse().filter(o=>o!==".").forEach(o=>{o===".."?r++:r===0?t.push(o):r--});let n=t.reverse().join("/");return(fi&&n[0]==="/"?n[1]==="/"?window.location.protocol:window.location.origin:"")+n},isData:e=>e.indexOf("data:")===0,isURL:e=>hc.test(e),isAbsolute:e=>e[0]==="/"||/^[^\/]*:/.test(e),relativeToFile(e,t){return Ce.isData(e)||Ce.isAbsolute(t)?Ce.normalize(t):Ce.normalize(Ce.concat(e.split("/").slice(0,-1).join("/"),t))}}});var hi=k((dp,pi)=>{"use strict";u();pi.exports=gc;function gc(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");for(var r=e.substring(5,t).split(";"),n=r[0]||"text/plain",o=n,i=!1,s="",f=1;f<r.length;f++)r[f]=="base64"?i=!0:(o+=";"+r[f],r[f].indexOf("charset=")==0&&(s=r[f].substring(8)));!r[0]&&!s.length&&(o+=";charset=US-ASCII",s="US-ASCII");var m=unescape(e.substring(t+1)),d=i?"base64":"ascii",p=Buffer.from?Buffer.from(m,d):new Buffer(m,d);return p.type=n,p.typeFull=o,p.charset=s,p}});var yi=k((hp,$t)=>{"use strict";u();var{assign:We}=Object,Pr=typeof window<"u"&&window.window===window&&window.navigator,bc=xa().SourceMapConsumer,Ut=ui(),Ir=di(),xc=hi(),bi=Pr?null:$t.require,gi=e=>{let t=r=>r in t.cache?t.cache[r]:t.cache[r]=e(r);return t.forgetEverything=()=>{t.cache=Object.create(null)},t.cache=Object.create(null),t};function xi(e,t){let r=t?Ut:Promise,n=gi(f=>o(f,e(f)));function o(f,m){return m===void 0?n(Ir.resolve(f)):r.resolve(m).then(d=>{let p,b,S,v=w=>(S=S||i(p))(w);return p={path:f,text:d,get lines(){return b=b||d.split(`
|
|
2
2
|
`)},resolve(w){let A=v(w);if(t)try{return Ut.valueFrom(A)}catch(C){return We({},w,{error:C})}else return Promise.resolve(A)},_resolve:v}})}function i(f){let m=/\u0023 sourceMappingURL=(.+)\n?/g,d;for(;;){let S=m.exec(f.text);if(S)d=S;else break}let p=d&&d[1],b=S=>We({},S,{sourceFile:f,sourceLine:f.lines[S.line-1]||""});return p?s(f.path,p,b):b}function s(f,m,d){let p=m.startsWith("data:")?o(f,xc(m).toString()):o(Ir.relativeToFile(f,m)),b=p.then(v=>bc(JSON.parse(v.text))),S=gi(function(w){return p.then(A=>{let C=Ir.relativeToFile(A.path,w);return b.then(I=>o(C,I.sourceContentFor(w,!0)||void 0))})});return v=>b.then(w=>{let A=w.originalPositionFor(v);return A.source?S(A.source).then(C=>C._resolve(We({},v,{line:A.line,column:A.column+1,name:A.name}))):d(v)}).catch(w=>We(d(v),{sourceMapError:w}))}return We(function(m){let d=o(m);if(t)try{return Ut.valueFrom(d)}catch(p){let b={path:m,text:"",lines:[],error:p,resolve(S){return We({},S,{error:p,sourceLine:"",sourceFile:b})}};return b}return d},{resetCache:()=>n.forgetEverything(),getCache:()=>n.cache})}$t.exports=xi(function(t){return new Ut(r=>{if(Pr){let n=new XMLHttpRequest;n.open("GET",t,!1),n.send(null),r(n.responseText)}else r(bi("fs").readFileSync(t,{encoding:"utf8"}))})},!0);$t.exports.async=xi(function(t){return new Promise((r,n)=>{if(Pr){let o=new XMLHttpRequest;o.open("GET",t),o.onreadystatechange=i=>{o.readyState===4&&(o.status===200?r(o.responseText):n(new Error(o.statusText)))},o.send(null)}else bi("fs").readFile(t,{encoding:"utf8"},(o,i)=>{o?n(o):r(i)})})})});var Ei=k((bp,wi)=>{"use strict";u();wi.exports=(e,t)=>{let r=e||[],n=[],o={label:void 0,items:[r.first]};return r.forEach(i=>{let s=t(i);o.label!==s&&o.items.length?n.push(o={label:s,items:[i]}):o.items.push(i)}),n}});var vi=k((yp,$r)=>{"use strict";u();var yc=(function(){function e(t,r){var n=[],o=!0,i=!1,s=void 0;try{for(var f=t[Symbol.iterator](),m;!(o=(m=f.next()).done)&&(n.push(m.value),!(r&&n.length===r));o=!0);}catch(d){i=!0,s=d}finally{try{!o&&f.return&&f.return()}finally{if(i)throw s}}return n}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Nt="[\x1B\x9B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]",Si="\0-\b\v-\x1B\x9B\xAD\u200B\u2028\u2029\uFEFF\uFE00-\uFE0F",Ur=`
|
|
3
3
|
`+Si,wc=new RegExp("(?:"+Nt+")|["+Si+"]","g"),Or=new RegExp("(?:"+Nt+")|["+Ur+"]","g"),Fr=new RegExp("((?:"+Nt+")|[ "+Ur+"])?([^ "+Ur+"]*)","g");$r.exports={zeroWidthCharacters:Or,ansiEscapeCodes:new RegExp(Nt,"g"),strlen:e=>Array.from(e.replace(Or,"")).length,isBlank:e=>e.replace(Or,"").replace(/\s/g,"").length===0,blank:e=>Array.from(e.replace(wc,"")).map(t=>t===" "||t===`
|
|
4
4
|
`?t:" ").join(""),partition(e){for(var t,r=[];Fr.lastIndex!==e.length&&(t=Fr.exec(e));)r.push([t[1]||"",t[2]]);return Fr.lastIndex=0,r},first(e,t){let r="",n=0;for(let i of $r.exports.partition(e)){var o=yc(i,2);let s=o[0],f=o[1],m=Array.from(f).slice(0,t-n);r+=s+m.join(""),n+=m.length}return r}}});var Li=k((Ep,Ri)=>{"use strict";u();function ze(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}else return Array.from(e)}var qt=Object,Ci=vi(),Ec=Ci.first,Gt=Ci.strlen,Sc=(e,t)=>Ec(e,t-1)+"\u2026",Ti=(e,t)=>{let r=(w,A)=>w.reduce((C,I)=>I.map((R,T)=>[].concat(ze(C[T]||[]),[R])),[]).map(C=>A.apply(void 0,ze(C))),n=e.map(w=>w.map(A=>A.replace(/\n/g,"\\n"))),o=n.map(w=>w.map(Gt)),i=r(o,Math.max),s=qt.assign({delimiter:" ",minColumnWidths:i.map(w=>0),maxTotalWidth:0},t),f=Gt(s.delimiter),m=i.reduce((w,A)=>w+A,0),d=i.map(w=>w/m),p=s.maxTotalWidth-f*(i.length-1),b=Math.max(0,m-p),S=r([s.minColumnWidths,i,d],(w,A,C)=>Math.max(w,Math.floor(A-b*C))),v=o.map(w=>r([S,w],(A,C)=>A-C));return r([n,v],(w,A)=>r([w,A],(C,I)=>I>=0?s.right?" ".repeat(I)+C:C+" ".repeat(I):Sc(C,Gt(C)+I)).join(s.delimiter))},Ai=e=>qt.assign(t=>{var r;if(t[0]&&Array.isArray(t[0]))return Ti(t.map(s=>s.map((f,m)=>f===void 0?"":e.print(f,m))),e).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as B,j as C,m as P}from"./chunk-
|
|
1
|
+
import{a as B,j as C,m as P}from"./chunk-DN3BB4IO.js";import{e as g}from"./chunk-N6IFIMC6.js";import{e as U,f as _}from"./chunk-HSVZU7MP.js";import{l as v,m as w}from"./chunk-I5X3IP6T.js";import{xa as E}from"./chunk-TIU7MMRT.js";import{Pb as m}from"./chunk-TB7HFPBB.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
|
|
2
2
|
`);_(f.key,"delete")(new Error(`Failed to delete ${f.key}: ${y}`))}}),c.current+=k.length});u.push(a)}let h=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:h}}function L(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
|
|
3
3
|
${s.map(o=>`-${o.key}`).join(`
|
|
4
4
|
`)}`),s}function x(t){let e=P(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configSchemaFile,...e.staticAssetFiles]}var D=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function R(t,e,r){let s=new Set(r.map(l=>l.key)),o=D.filter(({key:l})=>!s.has(l));o.length>0&&await w(t.id,o,e)}function q(t,e,r,s,o){let l=I(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=z(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(S(a).map(d=>N(d,e,s,r.id,o).then(()=>{c.current+=d.length,d.forEach(f=>e.unsyncedFileKeys.delete(f.key))}))).then(()=>{}),h=i.reduce((a,d)=>a.then(()=>u(d)),Promise.resolve()),p=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([h,p]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function I(t,e){let r=K(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k,b as i,c as F,d as L,e as _,f as M,g as H}from"./chunk-
|
|
1
|
+
import{a as k,b as i,c as F,d as L,e as _,f as M,g as H}from"./chunk-QFXJNFMI.js";import{a as E}from"./chunk-UHIP5CFI.js";import{a as P}from"./chunk-VJQJ5PTQ.js";import{Fa as I,ga as S}from"./chunk-4MLEL3VK.js";import{O as b,P as T,Q as A}from"./chunk-R7QYSC6T.js";import{B as g,F as v,z as p}from"./chunk-EEEKSYWV.js";import{Nb as h,Qb as m,Sb as w}from"./chunk-TB7HFPBB.js";import{j as y}from"./chunk-773TIA5M.js";import{r as q}from"./chunk-T6CC5WUU.js";import{e as G,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();a();async function V(e){let t=e.map(o=>({label:o,value:o}));return await g({message:"Webhook Topic",choices:t})}async function C(e){return p({message:"Webhook ApiVersion",choices:e.map(t=>({label:t,value:t}))})}async function R(){return p({message:"Delivery method",choices:[{label:"HTTP",value:i.HTTP},{label:"Google Pub/Sub",value:i.PUBSUB},{label:"Amazon EventBridge",value:i.EVENTBRIDGE}]})}async function D(e){return(await v({message:"Address for delivery",validate:r=>{let o=r.trim();if(o.length===0)return"Address can't be empty";if(!F(o,e))return`Invalid address.
|
|
2
2
|
${c(e)}`}})).trim()}function U(e){return e===i.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:e===i.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:e===i.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function c(e){return U(e).map(t=>` \xB7 ${w(t)}`).join(`
|
|
3
3
|
`)}async function O(e,t){let{clientSecret:r,clientId:o,remoteApp:s,app:l}=e;return r&&(o||t!==i.EVENTBRIDGE)?{clientSecret:r,apiKey:o}:(S({appName:s.title,configFile:y(l.configPath)}),{clientSecret:s.apiSecretKeys.find(f=>f.secret).secret,apiKey:s.apiKey})}async function x(e,t,r){let o=await T(e,r);return t?_(t,o):C(o)}async function B(e,t,r,o){let s=await A(e,t,o);return r?M(r,t,s):V(s)}async function Y(e,t){let r=e??H(t)??await R(),o=t??await D(r);return L(o,r)}async function N(e){let t=await W(e);await z(t)}async function W(e){let t=await x(e.developerPlatformClient,e.apiVersion,e.organizationId),r=await B(e.developerPlatformClient,t,e.topic,e.organizationId),[o,s]=await Y(e.deliveryMethod,e.address),l=await O(e,s);return{topic:r,apiVersion:t,deliveryMethod:s,address:o,apiKey:l.apiKey,clientSecret:l.clientSecret,developerPlatformClient:e.developerPlatformClient,organizationId:e.organizationId}}async function z(e){let t={topic:e.topic,api_version:e.apiVersion,address:e.address,delivery_method:e.deliveryMethod,shared_secret:e.clientSecret,api_key:e.apiKey},r=await b(e.developerPlatformClient,t,e.organizationId);if(!r.success){m(`Request errors:
|
|
4
4
|
${K(r.userErrors)}`);return}if(e.deliveryMethod===i.LOCALHOST){if(await k(e.address,r.samplePayload,r.headers)){h("Localhost delivery sucessful");return}m("Localhost delivery failed");return}r.samplePayload===JSON.stringify({})&&h("Webhook has been enqueued for delivery")}function K(e){try{return e.map(t=>JSON.parse(t.message).map(r=>` \xB7 ${r}`).join(`
|