@shopify/cli-hydrogen 4.0.0-alpha.9 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/commands/hydrogen/build.d.ts +20 -0
  2. package/dist/commands/hydrogen/build.js +36 -33
  3. package/dist/commands/hydrogen/check.d.ts +18 -0
  4. package/dist/commands/hydrogen/check.js +35 -0
  5. package/dist/commands/hydrogen/dev.d.ts +14 -0
  6. package/dist/commands/hydrogen/dev.js +56 -60
  7. package/dist/commands/hydrogen/generate/route.d.ts +34 -0
  8. package/dist/commands/hydrogen/generate/route.js +165 -0
  9. package/dist/commands/hydrogen/generate/route.test.d.ts +1 -0
  10. package/dist/commands/hydrogen/generate/route.test.js +126 -0
  11. package/dist/commands/hydrogen/generate/routes.d.ts +16 -0
  12. package/dist/commands/hydrogen/generate/routes.js +22 -0
  13. package/dist/commands/hydrogen/init.d.ts +22 -0
  14. package/dist/commands/hydrogen/init.js +169 -25
  15. package/dist/commands/hydrogen/preview.d.ts +17 -0
  16. package/dist/commands/hydrogen/preview.js +2 -2
  17. package/dist/create-app.d.ts +1 -0
  18. package/dist/create-app.js +4 -0
  19. package/dist/{templates/demo-store/app/routes/($lang) → generator-templates/routes}/[robots.txt].tsx +2 -1
  20. package/dist/{templates/demo-store/app/routes/($lang) → generator-templates/routes}/[sitemap.xml].tsx +8 -6
  21. package/dist/generator-templates/routes/account/login.tsx +74 -0
  22. package/dist/generator-templates/routes/account/register.tsx +74 -0
  23. package/dist/generator-templates/routes/cart.tsx +43 -0
  24. package/dist/generator-templates/routes/collections/$collectionHandle.tsx +65 -0
  25. package/dist/{templates/demo-store/app → generator-templates}/routes/graphiql.tsx +0 -0
  26. package/dist/{templates/hello-world/app → generator-templates}/routes/index.tsx +0 -0
  27. package/dist/generator-templates/routes/pages/$pageHandle.tsx +74 -0
  28. package/dist/{templates/demo-store/app/routes/($lang) → generator-templates/routes}/policies/$policyHandle.tsx +9 -38
  29. package/dist/generator-templates/routes/policies/index.tsx +65 -0
  30. package/dist/generator-templates/routes/products/$productHandle.tsx +57 -0
  31. package/dist/hooks/init.d.ts +5 -0
  32. package/dist/utils/check-lockfile.d.ts +3 -0
  33. package/dist/utils/check-lockfile.js +78 -0
  34. package/dist/utils/check-version.d.ts +3 -0
  35. package/dist/utils/check-version.js +50 -0
  36. package/dist/utils/config.d.ts +18 -0
  37. package/dist/utils/config.js +116 -43
  38. package/dist/utils/flags.d.ts +10 -0
  39. package/dist/utils/flags.js +15 -3
  40. package/dist/utils/flags.test.d.ts +1 -0
  41. package/dist/utils/flags.test.js +18 -0
  42. package/dist/utils/log.d.ts +5 -0
  43. package/dist/utils/mini-oxygen.d.ts +11 -0
  44. package/dist/utils/mini-oxygen.js +7 -4
  45. package/dist/utils/missing-routes.d.ts +6 -0
  46. package/dist/utils/missing-routes.js +71 -0
  47. package/dist/utils/template-downloader.d.ts +11 -0
  48. package/dist/utils/template-downloader.js +66 -0
  49. package/dist/utils/transpile-ts.d.ts +16 -0
  50. package/dist/utils/transpile-ts.js +169 -0
  51. package/dist/utils/virtual-routes.d.ts +7 -0
  52. package/dist/utils/virtual-routes.js +47 -0
  53. package/dist/utils/virtual-routes.test.d.ts +1 -0
  54. package/dist/utils/virtual-routes.test.js +46 -0
  55. package/dist/virtual-routes/assets/dummy.d.ts +1 -0
  56. package/dist/virtual-routes/assets/dummy.js +1 -0
  57. package/dist/virtual-routes/assets/dummy.ts +1 -0
  58. package/dist/{templates/demo-store/dist/client → virtual-routes/assets}/favicon.svg +0 -0
  59. package/dist/virtual-routes/assets/styles.css +207 -0
  60. package/dist/virtual-routes/components/HydrogenLogoBaseBW.jsx +7 -0
  61. package/dist/virtual-routes/components/HydrogenLogoBaseColor.jsx +13 -0
  62. package/dist/virtual-routes/components/IconBanner.jsx +47 -0
  63. package/dist/virtual-routes/components/IconDiscord.jsx +4 -0
  64. package/dist/virtual-routes/components/IconError.jsx +20 -0
  65. package/dist/virtual-routes/components/IconGithub.jsx +4 -0
  66. package/dist/virtual-routes/components/IconTwitter.jsx +4 -0
  67. package/dist/virtual-routes/components/Layout.jsx +6 -0
  68. package/dist/virtual-routes/routes/graphiql.jsx +5 -0
  69. package/dist/virtual-routes/routes/index.jsx +140 -0
  70. package/dist/virtual-routes/virtual-root.jsx +38 -0
  71. package/oclif.manifest.json +1 -131
  72. package/package.json +36 -7
  73. package/dist/templates/demo-store/.cache/content-v2/sha512/02/76/13bbea15bb42b81a204b0dc5f14726e0bfa8d012a7b284f887cc2e3c92195d6b07a78f199f990b311ca5fafa9079563503cdd81808cd9b7e496d86c72732 +0 -1
  74. package/dist/templates/demo-store/.cache/content-v2/sha512/08/56/c9a478b8c5c2fbfb6eed219f0861db568eceecbb45155124491ca25125ca421aac7e1b10d29151e5294a776ae10e02e01dc2da3561da793d111c4f908502 +0 -1
  75. package/dist/templates/demo-store/.cache/content-v2/sha512/0f/d5/950a1e0708f440217f567601ee2bfed73c56ada7491058d1ebb769f9a348484d29d4c3897d848d5f9123b0cfb8be69de4ebddc9d964a368e779e2927be5b +0 -1
  76. package/dist/templates/demo-store/.cache/content-v2/sha512/10/31/47b4061a63eaedea6368416dff9248ab2e51a4bea4004882a27c1437490c8150a4709438d28bbd8fd71a7516c9af612204f6116b0604e18902b5c6f69453 +0 -1
  77. package/dist/templates/demo-store/.cache/content-v2/sha512/13/f6/b7f804d45a961ca1e392429e75ad80f23ba46cbba0e960c6a70f8de81f3f3763af59651474176798d1a1a4bd2a5109b1d441f6d1c8ba070b678b38378adf +0 -1
  78. package/dist/templates/demo-store/.cache/content-v2/sha512/28/7c/c71b0c6367bdf7307a8061fe1c4568c9f1e9603d835b6fc917fe8042535a867c37154e35376a01ad6bdb3c2d6f29b88b41902fd6f20b1227e02081682d01 +0 -1
  79. package/dist/templates/demo-store/.cache/content-v2/sha512/29/62/a788055902cff8e9403b901ebd715b56541b0ee4dc9f13cb739cd906ae89ae1fa7199831d613ab21c3ee5d84c5456608dc8707d9199ae3d8ba5e9fd7ce95 +0 -1
  80. package/dist/templates/demo-store/.cache/content-v2/sha512/2b/b2/d5a8e11c89553d08b26b4a7ba8b901de31c0b182f745f8c5d1c5aba44bf46d0d69e3d8042f5917728d0b69d5eba102e3de332f8141aef67a12d215a66843 +0 -1
  81. package/dist/templates/demo-store/.cache/content-v2/sha512/34/dd/ec66f7075936ba94dd741485089904914960fd50a4886c31783c27c27ca08852be43dea712e8aaea6f5197b83ccf1949c8a24c27ff61f5280377917d722e +0 -1
  82. package/dist/templates/demo-store/.cache/content-v2/sha512/46/04/af285aee74d96b28b24f75d7911de65e6c7bb26475ab5219fe5308028fda55060cf45650dfa09c0731ec73ece453c1e24e0c38715e8d4c5c80fd6365a1f4 +0 -1
  83. package/dist/templates/demo-store/.cache/content-v2/sha512/4e/ea/2fe739931285fa2839b54fe6c91470491475eac2d960e35ef0c6750313c08fbf2b2d784c0bb71c5fb2ef6c4a27f2202a4c29199b53bf7fd43c5721f90ecf +0 -1
  84. package/dist/templates/demo-store/.cache/content-v2/sha512/51/ab/e165384df6374c7b2d0ebebc8642ecb0e0c14f7c5b57970ec5d2e17f7d1643e0b01eda69e5ffbefde85ecba6d613bcc5175c5564e36bfb73d966c8ea4153 +0 -1
  85. package/dist/templates/demo-store/.cache/content-v2/sha512/54/b2/a99146d18769ec698b6c61e4c3e63689a24110cca7c671d926fc1320f5a2ac5cdbf143db9074dcfb383359307c50ccbe2512f2d9ee992eb53f2ed98997af +0 -1
  86. package/dist/templates/demo-store/.cache/content-v2/sha512/57/7e/37b69b357be4c488e5fca37c009c908201ac2107ddaa589143bcb108e9c5f7e4ca91a36f068b3f88bb0da655d7832bd040dcbef25d807faf0804a7f93c9a +0 -1
  87. package/dist/templates/demo-store/.cache/content-v2/sha512/6d/d8/5ad2b238dcc09122c8977b26e2a2eb94e12b1cda5181a020ec77d9364ea2efdc2ddddaf2ba766ced871d8cc33e5862fb4ae0c6591080b7523e5e779dceb5 +0 -1
  88. package/dist/templates/demo-store/.cache/content-v2/sha512/72/e4/3df1f2ae672aa3148b6afde9bd16b5371250464c301be7a4ca40e459768db712d39fb7039ce9710264f726b531b7dd346e43fe260b53789206a05f665393 +0 -1
  89. package/dist/templates/demo-store/.cache/content-v2/sha512/73/40/c822831f11f08a9ceea944d0145b072ba6164a3e2e75f98fda5437cda6dfddf9ca9450445c1f3236228d6259ac95e4cde9bb6e5996490ed00b7b13b06121 +0 -1
  90. package/dist/templates/demo-store/.cache/content-v2/sha512/73/ad/c5cb88faf344aa1be4c7f263610bbf4e5b4b4122a277e9f8adb20bdaabf46a65f647d902bf885172c5e17f16d63c69d9f0213938ad0648099d627bcdc7a3 +0 -1
  91. package/dist/templates/demo-store/.cache/content-v2/sha512/79/6a/c7905d20904ce592cd04dabc941dcfb9ae88a2936f564c6ca21dba66c7b89f44c697504d1fef3427d5121f3ce0abfc72225a25a5985cc2f823c50cb1a4e0 +0 -1
  92. package/dist/templates/demo-store/.cache/content-v2/sha512/7e/bd/739d3492efb96a9a5952538eee6f83dd7123c59a4b48538a5a554b8684ba84a1e65dd626b5aa9c6dc74c96734c46e3303ab93e6a5fcc56ecb4150c036aea +0 -1
  93. package/dist/templates/demo-store/.cache/content-v2/sha512/88/76/d18fdfbb05293909609d42368642fc6da4bd138c5864ec2f721212b52e595b84ae46f48021ed3e6240edf443f78bdea557d56d700e3da848459ea3077a80 +0 -1
  94. package/dist/templates/demo-store/.cache/content-v2/sha512/88/d0/847cc94057b70b5352a6f097d172883a789eedabfe597475672bec5495d323bc41e185cd5a6477aa691befeb69bd6f19f77b4735ebd8f230d39491bdabae +0 -1
  95. package/dist/templates/demo-store/.cache/content-v2/sha512/93/6b/e60098157f6bff8ba570cab2ffd97a14983109006f7fa87e4432728366f96dfb19e957d28754daa45f1b6cb2421d26ab59bbd5ce5a448d6102e8e662403d +0 -1
  96. package/dist/templates/demo-store/.cache/content-v2/sha512/bc/1c/74650cdfe58d3295c52501b3572b71ca4d0bcebe895291b39d63fc57d60b1924315d5b6292c825bec288196d39acf45d63688726fd77e85d99ce18e52f28 +0 -1
  97. package/dist/templates/demo-store/.cache/content-v2/sha512/bc/33/6e26ece5ac53d9eac9ac8a192ef39faf2a587a5808253c659fb1d371c477fc8074d428c8d1929b0d85dd1fec66fc79ea6b9fcb01507e2efec75fb7fbc2cc +0 -1
  98. package/dist/templates/demo-store/.cache/content-v2/sha512/cb/63/324e426b4c93a3fa8db83dab506b9abbe2d7628897dfd1369642f19d66f140c090e1c3834728d5082f8cffe846f7c54d112e11f5d934d629ed996d177a1f +0 -1
  99. package/dist/templates/demo-store/.cache/content-v2/sha512/d6/bd/656ddf1b02384b21b4fb55c615f28bba616f85c0992a8555bfbc3b0cf0692e2b3f20a534b4c3baef86e7c9ccf36b8d3a9239747b3d8422ff4dbe7dd2d0a6 +0 -1
  100. package/dist/templates/demo-store/.cache/content-v2/sha512/da/84/b6d27e02f9b109d7cff3095b08e2e2ed1802c8b6829c98f6e297d1c404059f8bacfdc278afd07e2f81cbc487318396a3775037b678ab6aff9a5231c94c0d +0 -1
  101. package/dist/templates/demo-store/.cache/content-v2/sha512/e8/ae/9b467e1d23913d4584d9417875b3cdc25f6dfed8b228f3a0c818129010b778aae1af1eb200b015ab428e79afe0ef1061262392fbdb96ed7da95efbe7f758 +0 -1
  102. package/dist/templates/demo-store/.cache/content-v2/sha512/f4/ba/e578b89fa1a4a0549fa2e68e0ba078fa8c9207c376189d1550a7ae0e54c4c0548d0a29a0cef532ca613e25832b9343e74f6a8bc7338fcc28d51e6e3d7898 +0 -1
  103. package/dist/templates/demo-store/.cache/content-v2/sha512/fb/75/9195d7f913bc6ae5a345003e0863e0c38c00e744334e2ae61feba1a3099be8207599085a8264590dbd0fd9e1fff1d58037183d106cdbc750c7ad6f979d88 +0 -1
  104. package/dist/templates/demo-store/.cache/content-v2/sha512/fd/ef/df6382410602f345da5bb420585629c22c350bc028c87eb6da71e611f381c5ccba09b435b9b5fb31d7c8beb5b8abfa87abdb874b189a3211efe61840fbac +0 -1
  105. package/dist/templates/demo-store/.cache/content-v2/sha512/fd/f3/986b7ee5ea5ad1d89af5c08de69d43c025b54381092e0a19fd7e7a1e0352552aa85c056315ce5e11a46ec75a252b1a44e2083abb73cd6df8407dfdb0ac48 +0 -1
  106. package/dist/templates/demo-store/.cache/index-v5/05/44/bebd201ef5e9e9a7c41bd789ff110691a32c7f7fbbbdd630f33d96667cd1 +0 -2
  107. package/dist/templates/demo-store/.cache/index-v5/26/b5/113aeb17f9f4ef406a1f8b143895199ca545fd0cc1e7972435a092910963 +0 -2
  108. package/dist/templates/demo-store/.cache/index-v5/2c/09/e60b5cd818510e0cbec908aae3b74175e35e446f4383e87c21489433a11e +0 -2
  109. package/dist/templates/demo-store/.cache/index-v5/38/21/c3fb7841590b85142018ba88a01045ef1249ac34211342579f0129eae294 +0 -2
  110. package/dist/templates/demo-store/.cache/index-v5/3a/98/8858fe7de4bf85d37c71adc322cc95335b498bef9a4ae41db324bf5696cc +0 -2
  111. package/dist/templates/demo-store/.cache/index-v5/3e/40/7021422a7cae2c05484b491fb5b85edd82b325e598ac9e5c6afb858049da +0 -2
  112. package/dist/templates/demo-store/.cache/index-v5/47/2f/8e9ec62247eca3464d07de774855bb30a56145adc6525b907490e0c1bda0 +0 -2
  113. package/dist/templates/demo-store/.cache/index-v5/5e/83/14bed234cd143eaf4043de721fcf4250a5adc7008e76d663365e8a322c88 +0 -2
  114. package/dist/templates/demo-store/.cache/index-v5/5f/87/f79366b4aab5423acdda7930c6c989c49dd1c6607885df3afaa5e6873c9f +0 -2
  115. package/dist/templates/demo-store/.cache/index-v5/6e/9e/dc622ea9b5c66089a08f3e8b7a0e62a29e85bab337da0a3b28d6126185ec +0 -2
  116. package/dist/templates/demo-store/.cache/index-v5/71/4c/401eb7f3b2db5e56857a3ddd90e61181e636a5d01cc569ff8671ddf7f14b +0 -2
  117. package/dist/templates/demo-store/.cache/index-v5/78/84/46021cf9ede94313b5bc2cbf2355909ae811d4879a7747f9e2341f6b5bfb +0 -2
  118. package/dist/templates/demo-store/.cache/index-v5/79/2e/b0dd8fcd37a11ecb71cfd33184651560cabda672e55e0b244fc6f825190c +0 -2
  119. package/dist/templates/demo-store/.cache/index-v5/7b/e1/807e64f6a84e568bf9163283e9d49b77b24ff24bd8eed751d9fd94ea404a +0 -2
  120. package/dist/templates/demo-store/.cache/index-v5/85/07/e0c4be5b8442583f11be2d0b6f09171d22721437456b745eb2c977294995 +0 -2
  121. package/dist/templates/demo-store/.cache/index-v5/87/4d/89bc172664efe0dc7f86d8e67559073b2900ae079bd42ae9e3c015d38ab0 +0 -2
  122. package/dist/templates/demo-store/.cache/index-v5/8c/0d/a633a8771437b330d83eef0fdd99a81c41356b2bdc81f80ec9277f92b060 +0 -2
  123. package/dist/templates/demo-store/.cache/index-v5/a3/fc/e2e503290d165b9b0e20c6880bc23ff8ec39a440482418b5103c36be66b9 +0 -2
  124. package/dist/templates/demo-store/.cache/index-v5/a5/bc/d87ab9468457cb872d6c360f8acecd05e0f88b7239b50754f120706fabd4 +0 -2
  125. package/dist/templates/demo-store/.cache/index-v5/a5/c0/8e6e4f498a17b6198e54f204247ba544e6404b282d4ce3065d85fa69a8a4 +0 -2
  126. package/dist/templates/demo-store/.cache/index-v5/af/65/89b0c9eb41779c1658ace443604fea125c524bc95cfc71c9b6300da2dc81 +0 -2
  127. package/dist/templates/demo-store/.cache/index-v5/b2/75/51549baf010c977c70017db497fd9bd20e1efa9b658a6d52761c559f9c0b +0 -2
  128. package/dist/templates/demo-store/.cache/index-v5/b3/75/d3e7a4a5df68530007409daf1d2e66ab789c8b658d1819d7e5fd183f5f57 +0 -2
  129. package/dist/templates/demo-store/.cache/index-v5/bb/db/9dc2cbdcdc6ff352f9a34463a02e198aa2123a4c2e4ef37fea8b8ccae413 +0 -2
  130. package/dist/templates/demo-store/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
  131. package/dist/templates/demo-store/.cache/index-v5/d3/ca/ff5860148f0bedafb91dab72b54462de81a32a21210324c45a051b197b48 +0 -2
  132. package/dist/templates/demo-store/.cache/index-v5/d4/55/296e80e87e2652f4cf1aebd5419fe73ef16c94ab20cd0400166d44ea1746 +0 -2
  133. package/dist/templates/demo-store/.cache/index-v5/da/7a/4b6977be684885e550a0d8fd21c955d0195371ffc3a9535a5a7b950a5ac9 +0 -2
  134. package/dist/templates/demo-store/.cache/index-v5/dd/aa/599a1cd855476ba058c63ae75a9c006ca11f7fbc2efc00b361d7f1b95cb4 +0 -2
  135. package/dist/templates/demo-store/.cache/index-v5/df/d2/bcfa3853e61309abab85dbd561dbc632ad0ea79b24f1b77c95f861eead5f +0 -2
  136. package/dist/templates/demo-store/.cache/index-v5/df/f5/cc3a1197c607eac768ab1b1cdb7b53a7f87b67c23c92da957d45a5bd0bda +0 -2
  137. package/dist/templates/demo-store/.cache/index-v5/e4/bd/743967c269ef70a14ba6b5dd223d26759eae9295d79f165c66f514b7d8d3 +0 -2
  138. package/dist/templates/demo-store/.cache/index-v5/e5/d3/0de6bfbb93ef9271b53f0ded9696291312b19ff087c2826d679ee2c74c01 +0 -2
  139. package/dist/templates/demo-store/.editorconfig +0 -8
  140. package/dist/templates/demo-store/.eslintignore +0 -4
  141. package/dist/templates/demo-store/.eslintrc.js +0 -16
  142. package/dist/templates/demo-store/.graphqlrc.yml +0 -1
  143. package/dist/templates/demo-store/.prettierignore +0 -2
  144. package/dist/templates/demo-store/_env +0 -6
  145. package/dist/templates/demo-store/_gitignore +0 -13
  146. package/dist/templates/demo-store/app/components/AccountAddressBook.tsx +0 -97
  147. package/dist/templates/demo-store/app/components/AccountDetails.tsx +0 -41
  148. package/dist/templates/demo-store/app/components/AddToCartButton.tsx +0 -42
  149. package/dist/templates/demo-store/app/components/Breadcrumbs.tsx +0 -36
  150. package/dist/templates/demo-store/app/components/Button.tsx +0 -56
  151. package/dist/templates/demo-store/app/components/Cart.tsx +0 -431
  152. package/dist/templates/demo-store/app/components/CartLoading.tsx +0 -50
  153. package/dist/templates/demo-store/app/components/CountrySelector.tsx +0 -180
  154. package/dist/templates/demo-store/app/components/Drawer.tsx +0 -115
  155. package/dist/templates/demo-store/app/components/FeaturedCollections.tsx +0 -54
  156. package/dist/templates/demo-store/app/components/FeaturedProducts.tsx +0 -116
  157. package/dist/templates/demo-store/app/components/FeaturedSection.tsx +0 -39
  158. package/dist/templates/demo-store/app/components/GenericError.tsx +0 -58
  159. package/dist/templates/demo-store/app/components/Grid.tsx +0 -44
  160. package/dist/templates/demo-store/app/components/Hero.tsx +0 -129
  161. package/dist/templates/demo-store/app/components/Icon.tsx +0 -253
  162. package/dist/templates/demo-store/app/components/Input.tsx +0 -24
  163. package/dist/templates/demo-store/app/components/Layout.tsx +0 -492
  164. package/dist/templates/demo-store/app/components/Link.tsx +0 -46
  165. package/dist/templates/demo-store/app/components/Modal.tsx +0 -46
  166. package/dist/templates/demo-store/app/components/NotFound.tsx +0 -22
  167. package/dist/templates/demo-store/app/components/OrderCard.tsx +0 -82
  168. package/dist/templates/demo-store/app/components/Pagination.tsx +0 -277
  169. package/dist/templates/demo-store/app/components/ProductCard.tsx +0 -140
  170. package/dist/templates/demo-store/app/components/ProductGallery.tsx +0 -114
  171. package/dist/templates/demo-store/app/components/ProductGrid.tsx +0 -93
  172. package/dist/templates/demo-store/app/components/ProductSwimlane.tsx +0 -30
  173. package/dist/templates/demo-store/app/components/Skeleton.tsx +0 -24
  174. package/dist/templates/demo-store/app/components/SortFilter.tsx +0 -414
  175. package/dist/templates/demo-store/app/components/Text.tsx +0 -192
  176. package/dist/templates/demo-store/app/components/index.ts +0 -28
  177. package/dist/templates/demo-store/app/data/countries.ts +0 -194
  178. package/dist/templates/demo-store/app/data/index.ts +0 -1027
  179. package/dist/templates/demo-store/app/entry.client.tsx +0 -4
  180. package/dist/templates/demo-store/app/entry.server.tsx +0 -26
  181. package/dist/templates/demo-store/app/hooks/useCartFetchers.tsx +0 -14
  182. package/dist/templates/demo-store/app/hooks/useIsHydrated.tsx +0 -12
  183. package/dist/templates/demo-store/app/lib/const.ts +0 -10
  184. package/dist/templates/demo-store/app/lib/placeholders.ts +0 -244
  185. package/dist/templates/demo-store/app/lib/seo/common.tsx +0 -367
  186. package/dist/templates/demo-store/app/lib/seo/debugger.tsx +0 -175
  187. package/dist/templates/demo-store/app/lib/seo/image.tsx +0 -32
  188. package/dist/templates/demo-store/app/lib/seo/index.ts +0 -4
  189. package/dist/templates/demo-store/app/lib/seo/seo.tsx +0 -24
  190. package/dist/templates/demo-store/app/lib/seo/types.ts +0 -84
  191. package/dist/templates/demo-store/app/lib/session.server.ts +0 -57
  192. package/dist/templates/demo-store/app/lib/type.ts +0 -21
  193. package/dist/templates/demo-store/app/lib/utils.ts +0 -310
  194. package/dist/templates/demo-store/app/root.tsx +0 -279
  195. package/dist/templates/demo-store/app/routes/($lang)/$.tsx +0 -7
  196. package/dist/templates/demo-store/app/routes/($lang)/account/__private/address/$id.tsx +0 -320
  197. package/dist/templates/demo-store/app/routes/($lang)/account/__private/edit.tsx +0 -273
  198. package/dist/templates/demo-store/app/routes/($lang)/account/__private/logout.ts +0 -25
  199. package/dist/templates/demo-store/app/routes/($lang)/account/__private/orders.$id.tsx +0 -322
  200. package/dist/templates/demo-store/app/routes/($lang)/account/__public/activate.$id.$activationToken.tsx +0 -218
  201. package/dist/templates/demo-store/app/routes/($lang)/account/__public/login.tsx +0 -197
  202. package/dist/templates/demo-store/app/routes/($lang)/account/__public/recover.tsx +0 -144
  203. package/dist/templates/demo-store/app/routes/($lang)/account/__public/register.tsx +0 -184
  204. package/dist/templates/demo-store/app/routes/($lang)/account/__public/reset.$id.$resetToken.tsx +0 -214
  205. package/dist/templates/demo-store/app/routes/($lang)/account.tsx +0 -188
  206. package/dist/templates/demo-store/app/routes/($lang)/api/countries.tsx +0 -22
  207. package/dist/templates/demo-store/app/routes/($lang)/api/products.tsx +0 -116
  208. package/dist/templates/demo-store/app/routes/($lang)/cart.tsx +0 -510
  209. package/dist/templates/demo-store/app/routes/($lang)/collections/$collectionHandle.tsx +0 -300
  210. package/dist/templates/demo-store/app/routes/($lang)/collections/all.tsx +0 -5
  211. package/dist/templates/demo-store/app/routes/($lang)/collections/index.tsx +0 -188
  212. package/dist/templates/demo-store/app/routes/($lang)/discounts.$code.tsx +0 -60
  213. package/dist/templates/demo-store/app/routes/($lang)/featured-products.tsx +0 -58
  214. package/dist/templates/demo-store/app/routes/($lang)/index.tsx +0 -241
  215. package/dist/templates/demo-store/app/routes/($lang)/journal/$journalHandle.tsx +0 -141
  216. package/dist/templates/demo-store/app/routes/($lang)/journal/index.tsx +0 -152
  217. package/dist/templates/demo-store/app/routes/($lang)/og-image.tsx +0 -19
  218. package/dist/templates/demo-store/app/routes/($lang)/pages/$pageHandle.tsx +0 -75
  219. package/dist/templates/demo-store/app/routes/($lang)/policies/index.tsx +0 -97
  220. package/dist/templates/demo-store/app/routes/($lang)/products/$productHandle.tsx +0 -551
  221. package/dist/templates/demo-store/app/routes/($lang)/products/index.tsx +0 -148
  222. package/dist/templates/demo-store/app/routes/($lang)/search.tsx +0 -198
  223. package/dist/templates/demo-store/app/styles/app.css +0 -4203
  224. package/dist/templates/demo-store/app/styles/custom-font.css +0 -13
  225. package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-Text.woff2 +0 -0
  226. package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-TextItalic.woff2 +0 -0
  227. package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
  228. package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
  229. package/dist/templates/demo-store/dist/client/build/_assets/app-PPSD2NK6.css +0 -1
  230. package/dist/templates/demo-store/dist/client/build/_assets/custom-font-WVPOFKHF.css +0 -1
  231. package/dist/templates/demo-store/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
  232. package/dist/templates/demo-store/dist/client/build/_shared/chunk-7CASD2US.js +0 -9
  233. package/dist/templates/demo-store/dist/client/build/_shared/chunk-7CASD2US.js.map +0 -7
  234. package/dist/templates/demo-store/dist/client/build/_shared/chunk-7CKXJRLM.js +0 -2
  235. package/dist/templates/demo-store/dist/client/build/_shared/chunk-7CKXJRLM.js.map +0 -7
  236. package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js +0 -2
  237. package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js.map +0 -7
  238. package/dist/templates/demo-store/dist/client/build/_shared/chunk-EW52HEI6.js +0 -133
  239. package/dist/templates/demo-store/dist/client/build/_shared/chunk-EW52HEI6.js.map +0 -7
  240. package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js +0 -2
  241. package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js.map +0 -7
  242. package/dist/templates/demo-store/dist/client/build/_shared/chunk-NIVT6A2W.js +0 -2
  243. package/dist/templates/demo-store/dist/client/build/_shared/chunk-NIVT6A2W.js.map +0 -7
  244. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SYP5DAMV.js +0 -2
  245. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SYP5DAMV.js.map +0 -7
  246. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SZCP6RSO.js +0 -7
  247. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SZCP6RSO.js.map +0 -7
  248. package/dist/templates/demo-store/dist/client/build/_shared/chunk-YCAWB56Y.js +0 -31
  249. package/dist/templates/demo-store/dist/client/build/_shared/chunk-YCAWB56Y.js.map +0 -7
  250. package/dist/templates/demo-store/dist/client/build/entry.client-3PUQSZFF.js +0 -2
  251. package/dist/templates/demo-store/dist/client/build/entry.client-3PUQSZFF.js.map +0 -7
  252. package/dist/templates/demo-store/dist/client/build/manifest-E4E22121.js +0 -1
  253. package/dist/templates/demo-store/dist/client/build/root-6BHVTOEY.js +0 -14
  254. package/dist/templates/demo-store/dist/client/build/root-6BHVTOEY.js.map +0 -7
  255. package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js +0 -2
  256. package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js.map +0 -7
  257. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[robots.txt]-KDA3EX2G.js +0 -2
  258. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[robots.txt]-KDA3EX2G.js.map +0 -7
  259. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js +0 -2
  260. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js.map +0 -7
  261. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-3WQU2LQT.js +0 -2
  262. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-3WQU2LQT.js.map +0 -7
  263. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-3XQ4BLHS.js +0 -2
  264. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-3XQ4BLHS.js.map +0 -7
  265. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js +0 -2
  266. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js.map +0 -7
  267. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-7VQDCWO5.js +0 -2
  268. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-7VQDCWO5.js.map +0 -7
  269. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-Z5BQE6J5.js +0 -2
  270. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-Z5BQE6J5.js.map +0 -7
  271. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-K6QUN2VF.js +0 -2
  272. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-K6QUN2VF.js.map +0 -7
  273. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-UV5PLPS5.js +0 -2
  274. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-UV5PLPS5.js.map +0 -7
  275. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-SZW3ORRR.js +0 -2
  276. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-SZW3ORRR.js.map +0 -7
  277. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-WOUXQWZU.js +0 -2
  278. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-WOUXQWZU.js.map +0 -7
  279. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-PRE5HSJE.js +0 -25
  280. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-PRE5HSJE.js.map +0 -7
  281. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js +0 -2
  282. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js.map +0 -7
  283. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-KIFIWUFE.js +0 -2
  284. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-KIFIWUFE.js.map +0 -7
  285. package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-3AJ7UOZX.js +0 -55
  286. package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-3AJ7UOZX.js.map +0 -7
  287. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-ORDYEBM3.js +0 -83
  288. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-ORDYEBM3.js.map +0 -7
  289. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js +0 -2
  290. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js.map +0 -7
  291. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-3AJFWRDR.js +0 -2
  292. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-3AJFWRDR.js.map +0 -7
  293. package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js +0 -2
  294. package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js.map +0 -7
  295. package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js +0 -2
  296. package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js.map +0 -7
  297. package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-4US2D5XK.js +0 -32
  298. package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-4US2D5XK.js.map +0 -7
  299. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BCHHYOJX.js +0 -2
  300. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BCHHYOJX.js.map +0 -7
  301. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-LZR4YNUM.js +0 -2
  302. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-LZR4YNUM.js.map +0 -7
  303. package/dist/templates/demo-store/dist/client/build/routes/($lang)/og-image-KUOACO4J.js +0 -2
  304. package/dist/templates/demo-store/dist/client/build/routes/($lang)/og-image-KUOACO4J.js.map +0 -7
  305. package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-5WR6PFRU.js +0 -2
  306. package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-5WR6PFRU.js.map +0 -7
  307. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-C5ATUMN6.js +0 -2
  308. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-C5ATUMN6.js.map +0 -7
  309. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-MJDYZG5P.js +0 -2
  310. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-MJDYZG5P.js.map +0 -7
  311. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-IB2WTXB6.js +0 -68
  312. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-IB2WTXB6.js.map +0 -7
  313. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-266HKDAN.js +0 -24
  314. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-266HKDAN.js.map +0 -7
  315. package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-CH57YG7S.js +0 -54
  316. package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-CH57YG7S.js.map +0 -7
  317. package/dist/templates/demo-store/dist/client/build/routes/graphiql-ZHVT5SA7.js +0 -2
  318. package/dist/templates/demo-store/dist/client/build/routes/graphiql-ZHVT5SA7.js.map +0 -7
  319. package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
  320. package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
  321. package/dist/templates/demo-store/dist/worker/index.js +0 -1385
  322. package/dist/templates/demo-store/dist/worker/index.js.map +0 -7
  323. package/dist/templates/demo-store/package.json +0 -67
  324. package/dist/templates/demo-store/playwright.config.ts +0 -109
  325. package/dist/templates/demo-store/postcss.config.js +0 -10
  326. package/dist/templates/demo-store/public/favicon.svg +0 -28
  327. package/dist/templates/demo-store/remix.env.d.ts +0 -40
  328. package/dist/templates/demo-store/remix.init/index.js +0 -25
  329. package/dist/templates/demo-store/remix.init/package.json +0 -7
  330. package/dist/templates/demo-store/server.ts +0 -73
  331. package/dist/templates/demo-store/styles/app.css +0 -182
  332. package/dist/templates/demo-store/tailwind.config.js +0 -70
  333. package/dist/templates/demo-store/tests/cart.test.ts +0 -70
  334. package/dist/templates/demo-store/tests/seo.test.ts +0 -36
  335. package/dist/templates/demo-store/tests/utils.ts +0 -100
  336. package/dist/templates/demo-store/tsconfig.json +0 -25
  337. package/dist/templates/hello-world/.cache/content-v2/sha512/13/f6/b7f804d45a961ca1e392429e75ad80f23ba46cbba0e960c6a70f8de81f3f3763af59651474176798d1a1a4bd2a5109b1d441f6d1c8ba070b678b38378adf +0 -1
  338. package/dist/templates/hello-world/.cache/content-v2/sha512/4b/d3/aedf0c5a14c0f852936adb81a3bbd15ad1d5d9964ffe11a40d56bbdb2f2a4c7588ffa1d1ee657a3c3be4f6e6194465365f5d4213ef3b4e5086aa4bf0a5a4 +0 -1
  339. package/dist/templates/hello-world/.cache/content-v2/sha512/fa/dd/9bc10a1cb1f145eabd96bdba509178e20484197fefd8469ace9f53bf277e875751db3c4dddf229807c48cbe8db19494fe2a5aab7d2a4b7ae8bebbd67509c +0 -1
  340. package/dist/templates/hello-world/.cache/index-v5/09/f6/fe4b05c4157320b8b59b3f84116195be0437d87357d743d21acd638a4606 +0 -2
  341. package/dist/templates/hello-world/.cache/index-v5/b3/75/d3e7a4a5df68530007409daf1d2e66ab789c8b658d1819d7e5fd183f5f57 +0 -2
  342. package/dist/templates/hello-world/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
  343. package/dist/templates/hello-world/.eslintignore +0 -4
  344. package/dist/templates/hello-world/.eslintrc.js +0 -6
  345. package/dist/templates/hello-world/.graphqlrc.yml +0 -1
  346. package/dist/templates/hello-world/README.md +0 -20
  347. package/dist/templates/hello-world/_env +0 -6
  348. package/dist/templates/hello-world/_gitignore +0 -8
  349. package/dist/templates/hello-world/app/components/Layout.tsx +0 -15
  350. package/dist/templates/hello-world/app/components/index.ts +0 -1
  351. package/dist/templates/hello-world/app/entry.client.tsx +0 -4
  352. package/dist/templates/hello-world/app/entry.server.tsx +0 -21
  353. package/dist/templates/hello-world/app/root.tsx +0 -212
  354. package/dist/templates/hello-world/app/routes/graphiql.tsx +0 -10
  355. package/dist/templates/hello-world/app/styles/app.css +0 -38
  356. package/dist/templates/hello-world/dist/client/build/_assets/app-NBPUE4H5.css +0 -1
  357. package/dist/templates/hello-world/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
  358. package/dist/templates/hello-world/dist/client/build/_shared/chunk-MEPKJ2VW.js +0 -2
  359. package/dist/templates/hello-world/dist/client/build/_shared/chunk-MEPKJ2VW.js.map +0 -7
  360. package/dist/templates/hello-world/dist/client/build/_shared/chunk-SYP5DAMV.js +0 -2
  361. package/dist/templates/hello-world/dist/client/build/_shared/chunk-SYP5DAMV.js.map +0 -7
  362. package/dist/templates/hello-world/dist/client/build/_shared/chunk-UWGFS4PS.js +0 -31
  363. package/dist/templates/hello-world/dist/client/build/_shared/chunk-UWGFS4PS.js.map +0 -7
  364. package/dist/templates/hello-world/dist/client/build/entry.client-YKLPLTIJ.js +0 -9
  365. package/dist/templates/hello-world/dist/client/build/entry.client-YKLPLTIJ.js.map +0 -7
  366. package/dist/templates/hello-world/dist/client/build/manifest-5BEA23FF.js +0 -1
  367. package/dist/templates/hello-world/dist/client/build/root-YMCCM3GG.js +0 -2
  368. package/dist/templates/hello-world/dist/client/build/root-YMCCM3GG.js.map +0 -7
  369. package/dist/templates/hello-world/dist/client/build/routes/graphiql-ZHVT5SA7.js +0 -2
  370. package/dist/templates/hello-world/dist/client/build/routes/graphiql-ZHVT5SA7.js.map +0 -7
  371. package/dist/templates/hello-world/dist/client/build/routes/index-TH4MKESG.js +0 -2
  372. package/dist/templates/hello-world/dist/client/build/routes/index-TH4MKESG.js.map +0 -7
  373. package/dist/templates/hello-world/dist/client/favicon.svg +0 -28
  374. package/dist/templates/hello-world/dist/worker/index.js +0 -172
  375. package/dist/templates/hello-world/dist/worker/index.js.map +0 -7
  376. package/dist/templates/hello-world/package.json +0 -41
  377. package/dist/templates/hello-world/public/favicon.svg +0 -28
  378. package/dist/templates/hello-world/remix.env.d.ts +0 -35
  379. package/dist/templates/hello-world/remix.init/index.js +0 -25
  380. package/dist/templates/hello-world/remix.init/package.json +0 -7
  381. package/dist/templates/hello-world/server.ts +0 -129
  382. package/dist/templates/hello-world/tsconfig.json +0 -25
  383. package/dist/tmp-create-app.js +0 -33
@@ -1,83 +0,0 @@
1
- import{b as d}from"/build/_shared/chunk-EW52HEI6.js";import{$ as u,E as a,G as l,H as n,P as c,aa as p}from"/build/_shared/chunk-SZCP6RSO.js";import{a as s}from"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as o}from"/build/_shared/chunk-YCAWB56Y.js";import{b as i}from"/build/_shared/chunk-SYP5DAMV.js";import{c as t}from"/build/_shared/chunk-MEPKJ2VW.js";var r=t(i());var v=({data:e})=>({title:e?.collection?.seo?.title??"Collection",description:e?.collection?.seo?.description});function m(){let{collection:e,collections:f,appliedFilters:y}=o(),g=e.metafield?.references&&s(e.metafield.references).reverse().reduce((P,h)=>[h,...P],[e]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n,{heading:e.title,children:[e?.description&&(0,r.jsx)("div",{className:"flex items-baseline justify-between w-full",children:(0,r.jsx)("div",{children:(0,r.jsx)(a,{format:!0,width:"narrow",as:"p",className:"inline-block",children:e.description})})}),(0,r.jsx)(p,{breadcrumbs:g})]}),(0,r.jsx)(l,{children:(0,r.jsx)(u,{filters:e.products.filters,appliedFilters:y,collections:f,children:(0,r.jsx)(c,{collection:e,url:`/collections/${e.handle}`,"data-test":"product-grid"},e.id)})})]})}var w=`#graphql
2
- ${d}
3
- query CollectionDetails(
4
- $handle: String!
5
- $country: CountryCode
6
- $language: LanguageCode
7
- $pageBy: Int!
8
- $cursor: String
9
- $filters: [ProductFilter!]
10
- $sortKey: ProductCollectionSortKeys!
11
- $reverse: Boolean
12
- ) @inContext(country: $country, language: $language) {
13
- collection(handle: $handle) {
14
- id
15
- handle
16
- title
17
- description
18
- seo {
19
- description
20
- title
21
- }
22
- image {
23
- id
24
- url
25
- width
26
- height
27
- altText
28
- }
29
- metafield(namespace: "breadcrumbs", key: "parents") {
30
- id
31
- value
32
- references(first: 10) {
33
- edges {
34
- node {
35
- ... on Collection {
36
- id
37
- handle
38
- title
39
- }
40
- }
41
- }
42
- }
43
- namespace
44
- key
45
- }
46
- products(
47
- first: $pageBy,
48
- after: $cursor,
49
- filters: $filters,
50
- sortKey: $sortKey,
51
- reverse: $reverse
52
- ) {
53
- filters {
54
- id
55
- label
56
- type
57
- values {
58
- id
59
- label
60
- count
61
- input
62
- }
63
- }
64
- nodes {
65
- ...ProductCard
66
- }
67
- pageInfo {
68
- hasNextPage
69
- endCursor
70
- }
71
- }
72
- }
73
- collections(first: 100) {
74
- edges {
75
- node {
76
- title
77
- handle
78
- }
79
- }
80
- }
81
- }
82
- `;export{m as default,v as meta};
83
- //# sourceMappingURL=/build/routes/($lang)/collections/$collectionHandle-ORDYEBM3.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/collections/$collectionHandle.tsx"],
4
- "sourcesContent": ["import {\n json,\n type MetaFunction,\n type SerializeFrom,\n type LoaderArgs,\n} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\nimport type {\n Collection as CollectionType,\n CollectionConnection,\n Filter,\n} from '@shopify/storefront-kit-react/storefront-api-types';\nimport {flattenConnection} from '@shopify/storefront-kit-react';\nimport invariant from 'tiny-invariant';\nimport {PageHeader, Section, Text, SortFilter, Breadcrumbs} from '~/components';\nimport {ProductGrid} from '~/components/ProductGrid';\n\nimport {PRODUCT_CARD_FRAGMENT} from '~/data';\n\nconst PAGINATION_SIZE = 48;\n\ntype VariantFilterParam = Record<string, string | boolean>;\ntype PriceFiltersQueryParam = Record<'price', {max?: number; min?: number}>;\ntype VariantOptionFiltersQueryParam = Record<\n 'variantOption',\n {name: string; value: string}\n>;\n\nexport type AppliedFilter = {\n label: string;\n urlParam: {\n key: string;\n value: string;\n };\n};\n\ntype FiltersQueryParams = Array<\n VariantFilterParam | PriceFiltersQueryParam | VariantOptionFiltersQueryParam\n>;\n\nexport type SortParam =\n | 'price-low-high'\n | 'price-high-low'\n | 'best-selling'\n | 'newest'\n | 'featured';\n\nexport async function loader({params, request, context}: LoaderArgs) {\n const {collectionHandle} = params;\n\n invariant(collectionHandle, 'Missing collectionHandle param');\n\n const searchParams = new URL(request.url).searchParams;\n const knownFilters = ['cursor', 'productVendor', 'productType'];\n const available = 'available';\n const variantOption = 'variantOption';\n const {sortKey, reverse} = getSortValuesFromParam(\n searchParams.get('sort') as SortParam,\n );\n const filters: FiltersQueryParams = [];\n const appliedFilters: AppliedFilter[] = [];\n\n for (const [key, value] of searchParams.entries()) {\n if (available === key) {\n filters.push({available: value === 'true'});\n appliedFilters.push({\n label: value === 'true' ? 'In stock' : 'Out of stock',\n urlParam: {\n key: available,\n value,\n },\n });\n } else if (knownFilters.includes(key)) {\n filters.push({[key]: value});\n appliedFilters.push({label: value, urlParam: {key, value}});\n } else if (key.includes(variantOption)) {\n const [name, val] = value.split(':');\n filters.push({variantOption: {name, value: val}});\n appliedFilters.push({label: val, urlParam: {key, value}});\n }\n }\n\n // Builds min and max price filter since we can't stack them separately into\n // the filters array. See price filters limitations:\n // https://shopify.dev/custom-storefronts/products-collections/filter-products#limitations\n if (searchParams.has('minPrice') || searchParams.has('maxPrice')) {\n const price: {min?: number; max?: number} = {};\n if (searchParams.has('minPrice')) {\n price.min = Number(searchParams.get('minPrice')) || 0;\n appliedFilters.push({\n label: `Min: $${price.min}`,\n urlParam: {key: 'minPrice', value: searchParams.get('minPrice')!},\n });\n }\n if (searchParams.has('maxPrice')) {\n price.max = Number(searchParams.get('maxPrice')) || 0;\n appliedFilters.push({\n label: `Max: $${price.max}`,\n urlParam: {key: 'maxPrice', value: searchParams.get('maxPrice')!},\n });\n }\n filters.push({\n price,\n });\n }\n\n const {collection, collections} = await context.storefront.query<{\n collection: CollectionType;\n collections: CollectionConnection;\n }>(COLLECTION_QUERY, {\n variables: {\n handle: collectionHandle,\n pageBy: PAGINATION_SIZE,\n filters,\n sortKey,\n reverse,\n country: context.storefront.i18n.country,\n language: context.storefront.i18n.language,\n },\n });\n\n if (!collection) {\n throw new Response(null, {status: 404});\n }\n\n const collectionNodes = flattenConnection(collections);\n\n return json({collection, appliedFilters, collections: collectionNodes});\n}\n\nexport const meta: MetaFunction = ({\n data,\n}: {\n data: SerializeFrom<typeof loader> | undefined;\n}) => {\n return {\n title: data?.collection?.seo?.title ?? 'Collection',\n description: data?.collection?.seo?.description,\n };\n};\n\nexport default function Collection() {\n const {collection, collections, appliedFilters} =\n useLoaderData<typeof loader>();\n const breadcrumbs =\n collection.metafield?.references &&\n flattenConnection(collection.metafield.references)\n .reverse()\n .reduce<any[]>((acc, collection) => [collection, ...acc], [collection]);\n\n return (\n <>\n <PageHeader heading={collection.title}>\n {collection?.description && (\n <div className=\"flex items-baseline justify-between w-full\">\n <div>\n <Text format width=\"narrow\" as=\"p\" className=\"inline-block\">\n {collection.description}\n </Text>\n </div>\n </div>\n )}\n\n <Breadcrumbs breadcrumbs={breadcrumbs} />\n </PageHeader>\n <Section>\n <SortFilter\n filters={collection.products.filters as Filter[]}\n appliedFilters={appliedFilters}\n collections={collections as CollectionType[]}\n >\n <ProductGrid\n key={collection.id}\n collection={collection as CollectionType}\n url={`/collections/${collection.handle}`}\n data-test=\"product-grid\"\n />\n </SortFilter>\n </Section>\n </>\n );\n}\n\nconst COLLECTION_QUERY = `#graphql\n ${PRODUCT_CARD_FRAGMENT}\n query CollectionDetails(\n $handle: String!\n $country: CountryCode\n $language: LanguageCode\n $pageBy: Int!\n $cursor: String\n $filters: [ProductFilter!]\n $sortKey: ProductCollectionSortKeys!\n $reverse: Boolean\n ) @inContext(country: $country, language: $language) {\n collection(handle: $handle) {\n id\n handle\n title\n description\n seo {\n description\n title\n }\n image {\n id\n url\n width\n height\n altText\n }\n metafield(namespace: \"breadcrumbs\", key: \"parents\") {\n id\n value\n references(first: 10) {\n edges {\n node {\n ... on Collection {\n id\n handle\n title\n }\n }\n }\n }\n namespace\n key\n }\n products(\n first: $pageBy,\n after: $cursor,\n filters: $filters,\n sortKey: $sortKey,\n reverse: $reverse\n ) {\n filters {\n id\n label\n type\n values {\n id\n label\n count\n input\n }\n }\n nodes {\n ...ProductCard\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n collections(first: 100) {\n edges {\n node {\n title\n handle\n }\n }\n }\n }\n`;\n\nfunction getSortValuesFromParam(sortParam: SortParam | null) {\n switch (sortParam) {\n case 'price-high-low':\n return {\n sortKey: 'PRICE',\n reverse: true,\n };\n case 'price-low-high':\n return {\n sortKey: 'PRICE',\n reverse: false,\n };\n case 'best-selling':\n return {\n sortKey: 'BEST_SELLING',\n reverse: false,\n };\n case 'newest':\n return {\n sortKey: 'CREATED',\n reverse: true,\n };\n case 'featured':\n return {\n sortKey: 'MANUAL',\n reverse: false,\n };\n default:\n return {\n sortKey: 'RELEVANCE',\n reverse: false,\n };\n }\n}\n"],
5
- "mappings": "6dAuJI,IAAAA,EAAA,OArBG,IAAMC,EAAqB,CAAC,CACjC,KAAAC,CACF,KAGS,CACL,MAAOA,GAAM,YAAY,KAAK,OAAS,aACvC,YAAaA,GAAM,YAAY,KAAK,WACtC,GAGa,SAARC,GAA8B,CACnC,GAAM,CAAC,WAAAC,EAAY,YAAAC,EAAa,eAAAC,CAAc,EAC5CC,EAA6B,EACzBC,EACJJ,EAAW,WAAW,YACtBK,EAAkBL,EAAW,UAAU,UAAU,EAC9C,QAAQ,EACR,OAAc,CAACM,EAAKN,IAAe,CAACA,EAAY,GAAGM,CAAG,EAAG,CAACN,CAAU,CAAC,EAE1E,SACE,oBACE,qBAACO,EAAA,CAAW,QAASP,EAAW,MAC7B,UAAAA,GAAY,gBACX,OAAC,OAAI,UAAU,6CACb,mBAAC,OACC,mBAACQ,EAAA,CAAK,OAAM,GAAC,MAAM,SAAS,GAAG,IAAI,UAAU,eAC1C,SAAAR,EAAW,YACd,EACF,EACF,KAGF,OAACS,EAAA,CAAY,YAAaL,EAAa,GACzC,KACA,OAACM,EAAA,CACC,mBAACC,EAAA,CACC,QAASX,EAAW,SAAS,QAC7B,eAAgBE,EAChB,YAAaD,EAEb,mBAACW,EAAA,CAEC,WAAYZ,EACZ,IAAK,gBAAgBA,EAAW,SAChC,YAAU,gBAHLA,EAAW,EAIlB,EACF,EACF,GACF,CAEJ,CAEA,IAAMa,EAAmB;AAAA,IACrBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
- "names": ["import_jsx_runtime", "meta", "data", "Collection", "collection", "collections", "appliedFilters", "useLoaderData", "breadcrumbs", "flattenConnection", "acc", "PageHeader", "Text", "Breadcrumbs", "Section", "SortFilter", "ProductGrid", "COLLECTION_QUERY", "PRODUCT_CARD_FRAGMENT"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as o}from"/build/_shared/chunk-MEPKJ2VW.js";var p=o((r,e)=>{e.exports={}});export default p();
2
- //# sourceMappingURL=/build/routes/($lang)/collections/all-IXDFOKCK.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["browser-route-module:routes/($lang)/collections/all.tsx?browser"],
4
- "sourcesContent": ["module.exports = {};"],
5
- "mappings": "qDAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,CAAC",
6
- "names": ["require_all", "__commonJSMin", "exports", "module"]
7
- }
@@ -1,2 +0,0 @@
1
- import{F as m,G as p,H as f,K as y,R as a,Y as C,ba as h,ca as v}from"/build/_shared/chunk-SZCP6RSO.js";import"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as g}from"/build/_shared/chunk-YCAWB56Y.js";import{b as u}from"/build/_shared/chunk-SYP5DAMV.js";import{c as d}from"/build/_shared/chunk-MEPKJ2VW.js";var t=d(u());var N=()=>({title:"All Collections"});function $(){let{collections:e}=g();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{heading:"Collections"}),(0,t.jsx)(p,{children:(0,t.jsx)(v,{connection:e,children:({endCursor:o,hasNextPage:r,hasPreviousPage:l,nextPageUrl:I,nodes:i,prevPageUrl:x,startCursor:s,nextLinkRef:L,isLoading:n})=>(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)("div",{className:"flex items-center justify-center mt-6",children:(0,t.jsx)(a,{to:x,variant:"secondary",width:"full",prefetch:"intent",disabled:!n,state:{pageInfo:{endCursor:o,hasNextPage:r,startCursor:s},nodes:i},children:n?"Loading...":"Previous products"})}),(0,t.jsx)(h,{items:i.length===3?3:2,"data-test":"collection-grid",children:i.map((c,w)=>(0,t.jsx)(b,{collection:c,loading:y(w,2)},c.id))}),r&&(0,t.jsx)("div",{className:"flex items-center justify-center mt-6",children:(0,t.jsx)(a,{ref:L,to:I,variant:"secondary",width:"full",prefetch:"intent",disabled:!n,state:{pageInfo:{endCursor:o,hasPreviousPage:l,startCursor:s},nodes:i},children:n?"Loading...":"Next products"})})]})})})]})}function b({collection:e,loading:o}){return(0,t.jsxs)(C,{to:`/collections/${e.handle}`,className:"grid gap-4",children:[(0,t.jsx)("div",{className:"card-image bg-primary/5 aspect-[3/2]",children:e?.image&&(0,t.jsx)("img",{alt:e.title,src:e.image.url,height:400,sizes:"(max-width: 32em) 100vw, 33vw",width:600,loading:o})}),(0,t.jsx)(m,{as:"h3",size:"copy",children:e.title})]})}export{$ as default,N as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/collections/index-3AJFWRDR.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/collections/index.tsx"],
4
- "sourcesContent": ["import {json, type MetaFunction, type LoaderArgs} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\nimport type {\n Collection,\n CollectionConnection,\n} from '@shopify/storefront-kit-react/storefront-api-types';\nimport {\n Grid,\n Heading,\n PageHeader,\n Section,\n Link,\n Pagination,\n getPaginationVariables,\n Button,\n} from '~/components';\nimport {getImageLoadingPriority} from '~/lib/const';\n\nconst PAGINATION_SIZE = 8;\n\nexport const loader = async ({request, context: {storefront}}: LoaderArgs) => {\n const variables = getPaginationVariables(request, PAGINATION_SIZE);\n const {collections} = await storefront.query<{\n collections: CollectionConnection;\n }>(COLLECTIONS_QUERY, {\n variables: {\n ...variables,\n country: storefront.i18n.country,\n language: storefront.i18n.language,\n },\n });\n\n return json({collections});\n};\n\nexport const meta: MetaFunction = () => {\n return {\n title: 'All Collections',\n };\n};\n\nexport default function Collections() {\n const {collections} = useLoaderData<typeof loader>();\n\n return (\n <>\n <PageHeader heading=\"Collections\" />\n <Section>\n <Pagination connection={collections}>\n {({\n endCursor,\n hasNextPage,\n hasPreviousPage,\n nextPageUrl,\n nodes,\n prevPageUrl,\n startCursor,\n nextLinkRef,\n isLoading,\n }) => (\n <>\n {hasPreviousPage && (\n <div className=\"flex items-center justify-center mt-6\">\n <Button\n to={prevPageUrl}\n variant=\"secondary\"\n width=\"full\"\n prefetch=\"intent\"\n disabled={!isLoading}\n state={{\n pageInfo: {\n endCursor,\n hasNextPage,\n startCursor,\n },\n nodes,\n }}\n >\n {isLoading ? 'Loading...' : 'Previous products'}\n </Button>\n </div>\n )}\n <Grid\n items={nodes.length === 3 ? 3 : 2}\n data-test=\"collection-grid\"\n >\n {nodes.map((collection, i) => (\n <CollectionCard\n collection={collection as Collection}\n key={collection.id}\n loading={getImageLoadingPriority(i, 2)}\n />\n ))}\n </Grid>\n {hasNextPage && (\n <div className=\"flex items-center justify-center mt-6\">\n <Button\n ref={nextLinkRef}\n to={nextPageUrl}\n variant=\"secondary\"\n width=\"full\"\n prefetch=\"intent\"\n disabled={!isLoading}\n state={{\n pageInfo: {\n endCursor,\n hasPreviousPage,\n startCursor,\n },\n nodes,\n }}\n >\n {isLoading ? 'Loading...' : 'Next products'}\n </Button>\n </div>\n )}\n </>\n )}\n </Pagination>\n </Section>\n </>\n );\n}\n\nfunction CollectionCard({\n collection,\n loading,\n}: {\n collection: Collection;\n loading?: HTMLImageElement['loading'];\n}) {\n return (\n <Link to={`/collections/${collection.handle}`} className=\"grid gap-4\">\n <div className=\"card-image bg-primary/5 aspect-[3/2]\">\n {collection?.image && (\n <img\n alt={collection.title}\n src={collection.image.url}\n height={400}\n sizes=\"(max-width: 32em) 100vw, 33vw\"\n width={600}\n loading={loading}\n />\n )}\n </div>\n <Heading as=\"h3\" size=\"copy\">\n {collection.title}\n </Heading>\n </Link>\n );\n}\n\nconst COLLECTIONS_QUERY = `#graphql\n query Collections(\n $country: CountryCode\n $language: LanguageCode\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(country: $country, language: $language) {\n collections(first: $first, last: $last, before: $startCursor, after: $endCursor) {\n nodes {\n id\n title\n description\n handle\n seo {\n description\n title\n }\n image {\n id\n url\n width\n height\n altText\n }\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n }\n }\n }\n`;\n"],
5
- "mappings": "2aA8CM,IAAAA,EAAA,OAXC,IAAMC,EAAqB,KACzB,CACL,MAAO,iBACT,GAGa,SAARC,GAA+B,CACpC,GAAM,CAAC,YAAAC,CAAW,EAAIC,EAA6B,EAEnD,SACE,oBACE,oBAACC,EAAA,CAAW,QAAQ,cAAc,KAClC,OAACC,EAAA,CACC,mBAACC,EAAA,CAAW,WAAYJ,EACrB,UAAC,CACA,UAAAK,EACA,YAAAC,EACA,gBAAAC,EACA,YAAAC,EACA,MAAAC,EACA,YAAAC,EACA,YAAAC,EACA,YAAAC,EACA,UAAAC,CACF,OACE,oBACG,UAAAN,MACC,OAAC,OAAI,UAAU,wCACb,mBAACO,EAAA,CACC,GAAIJ,EACJ,QAAQ,YACR,MAAM,OACN,SAAS,SACT,SAAU,CAACG,EACX,MAAO,CACL,SAAU,CACR,UAAAR,EACA,YAAAC,EACA,YAAAK,CACF,EACA,MAAAF,CACF,EAEC,SAAAI,EAAY,aAAe,oBAC9B,EACF,KAEF,OAACE,EAAA,CACC,MAAON,EAAM,SAAW,EAAI,EAAI,EAChC,YAAU,kBAET,SAAAA,EAAM,IAAI,CAACO,EAAYC,OACtB,OAACC,EAAA,CACC,WAAYF,EAEZ,QAASG,EAAwBF,EAAG,CAAC,GADhCD,EAAW,EAElB,CACD,EACH,EACCV,MACC,OAAC,OAAI,UAAU,wCACb,mBAACQ,EAAA,CACC,IAAKF,EACL,GAAIJ,EACJ,QAAQ,YACR,MAAM,OACN,SAAS,SACT,SAAU,CAACK,EACX,MAAO,CACL,SAAU,CACR,UAAAR,EACA,gBAAAE,EACA,YAAAI,CACF,EACA,MAAAF,CACF,EAEC,SAAAI,EAAY,aAAe,gBAC9B,EACF,GAEJ,EAEJ,EACF,GACF,CAEJ,CAEA,SAASK,EAAe,CACtB,WAAAF,EACA,QAAAI,CACF,EAGG,CACD,SACE,QAACC,EAAA,CAAK,GAAI,gBAAgBL,EAAW,SAAU,UAAU,aACvD,oBAAC,OAAI,UAAU,uCACZ,SAAAA,GAAY,UACX,OAAC,OACC,IAAKA,EAAW,MAChB,IAAKA,EAAW,MAAM,IACtB,OAAQ,IACR,MAAM,gCACN,MAAO,IACP,QAASI,EACX,EAEJ,KACA,OAACE,EAAA,CAAQ,GAAG,KAAK,KAAK,OACnB,SAAAN,EAAW,MACd,GACF,CAEJ",
6
- "names": ["import_jsx_runtime", "meta", "Collections", "collections", "useLoaderData", "PageHeader", "Section", "Pagination", "endCursor", "hasNextPage", "hasPreviousPage", "nextPageUrl", "nodes", "prevPageUrl", "startCursor", "nextLinkRef", "isLoading", "Button", "Grid", "collection", "i", "CollectionCard", "getImageLoadingPriority", "loading", "Link", "Heading"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as o}from"/build/_shared/chunk-MEPKJ2VW.js";var p=o((r,e)=>{e.exports={}});export default p();
2
- //# sourceMappingURL=/build/routes/($lang)/discounts.$code-GYKQBNLQ.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["browser-route-module:routes/($lang)/discounts.$code.tsx?browser"],
4
- "sourcesContent": ["module.exports = {};"],
5
- "mappings": "qDAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,CAAC",
6
- "names": ["require_discounts_code", "__commonJSMin", "exports", "module"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as o}from"/build/_shared/chunk-MEPKJ2VW.js";var p=o((r,e)=>{e.exports={}});export default p();
2
- //# sourceMappingURL=/build/routes/($lang)/featured-products-KNUST6DD.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["browser-route-module:routes/($lang)/featured-products.tsx?browser"],
4
- "sourcesContent": ["module.exports = {};"],
5
- "mappings": "qDAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,CAAC",
6
- "names": ["require_featured_products", "__commonJSMin", "exports", "module"]
7
- }
@@ -1,32 +0,0 @@
1
- import{b as $,d as l}from"/build/_shared/chunk-EW52HEI6.js";import{M as p,O as y,Z as h,_ as t}from"/build/_shared/chunk-SZCP6RSO.js";import"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{n as r,q as C}from"/build/_shared/chunk-YCAWB56Y.js";import{a as E,b as f}from"/build/_shared/chunk-SYP5DAMV.js";import{c as a}from"/build/_shared/chunk-MEPKJ2VW.js";var n=a(E());var e=a(f());function m(){let{primaryHero:i,secondaryHero:u,tertiaryHero:s,featuredCollections:c,featuredProducts:d}=C(),g=p([{},{},{}]);return(0,e.jsxs)(e.Fragment,{children:[i&&(0,e.jsx)(t,{...i,height:"full",top:!0,loading:"eager"}),d&&(0,e.jsx)(n.Suspense,{children:(0,e.jsx)(r,{resolve:d,children:({products:o})=>o?.nodes?(0,e.jsx)(y,{products:o.nodes,title:"Featured Products",count:4}):(0,e.jsx)(e.Fragment,{})})}),u&&(0,e.jsx)(n.Suspense,{fallback:(0,e.jsx)(t,{...g[1]}),children:(0,e.jsx)(r,{resolve:u,children:({hero:o})=>o?(0,e.jsx)(t,{...o}):(0,e.jsx)(e.Fragment,{})})}),c&&(0,e.jsx)(n.Suspense,{children:(0,e.jsx)(r,{resolve:c,children:({collections:o})=>o?.nodes?(0,e.jsx)(h,{collections:o.nodes,title:"Collections"}):(0,e.jsx)(e.Fragment,{})})}),s&&(0,e.jsx)(n.Suspense,{fallback:(0,e.jsx)(t,{...g[2]}),children:(0,e.jsx)(r,{resolve:s,children:({hero:o})=>o?(0,e.jsx)(t,{...o}):(0,e.jsx)(e.Fragment,{})})})]})}var S=`#graphql
2
- ${l}
3
- query collectionContent($handle: String, $country: CountryCode, $language: LanguageCode)
4
- @inContext(country: $country, language: $language) {
5
- hero: collection(handle: $handle) {
6
- ...CollectionContent
7
- }
8
- shop {
9
- name
10
- description
11
- }
12
- }
13
- `,T=`#graphql
14
- ${l}
15
- query collectionContent($handle: String, $country: CountryCode, $language: LanguageCode)
16
- @inContext(country: $country, language: $language) {
17
- hero: collection(handle: $handle) {
18
- ...CollectionContent
19
- }
20
- }
21
- `,_=`#graphql
22
- ${$}
23
- query homepageFeaturedProducts($country: CountryCode, $language: LanguageCode)
24
- @inContext(country: $country, language: $language) {
25
- products(first: 8) {
26
- nodes {
27
- ...ProductCard
28
- }
29
- }
30
- }
31
- `;export{m as default};
32
- //# sourceMappingURL=/build/routes/($lang)/index-4US2D5XK.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../app/routes/($lang)/index.tsx"],
4
- "sourcesContent": ["import {defer, type LoaderArgs} from '@shopify/remix-oxygen';\nimport {Suspense} from 'react';\nimport {Await, useLoaderData} from '@remix-run/react';\nimport {ProductSwimlane, FeaturedCollections, Hero} from '~/components';\nimport {COLLECTION_CONTENT_FRAGMENT, PRODUCT_CARD_FRAGMENT} from '~/data';\nimport {getHeroPlaceholder} from '~/lib/placeholders';\nimport type {\n CollectionConnection,\n Metafield,\n ProductConnection,\n} from '@shopify/storefront-kit-react/storefront-api-types';\n\ninterface HomeSeoData {\n shop: {\n name: string;\n description: string;\n };\n}\n\nexport interface CollectionHero {\n byline: Metafield;\n cta: Metafield;\n handle: string;\n heading: Metafield;\n height?: 'full';\n loading?: 'eager' | 'lazy';\n spread: Metafield;\n spreadSecondary: Metafield;\n top?: boolean;\n}\n\nexport async function loader({params, context}: LoaderArgs) {\n const {language, country} = context.storefront.i18n;\n\n if (\n params.lang &&\n params.lang.toLowerCase() !== `${language}-${country}`.toLowerCase()\n ) {\n // If the lang URL param is defined, yet we still are on `EN-US`\n // the the lang param must be invalid, send to the 404 page\n throw new Response(null, {status: 404});\n }\n\n const {shop, hero} = await context.storefront.query<{\n hero: CollectionHero;\n shop: HomeSeoData;\n }>(HOMEPAGE_SEO_QUERY, {\n variables: {handle: 'freestyle'},\n });\n\n return defer({\n shop,\n primaryHero: hero,\n // These different queries are separated to illustrate how 3rd party content\n // fetching can be optimized for both above and below the fold.\n featuredProducts: context.storefront.query<{\n products: ProductConnection;\n }>(HOMEPAGE_FEATURED_PRODUCTS_QUERY, {\n variables: {\n /**\n * Country and language properties are automatically injected\n * into all queries. Passing them is unnecessary unless you\n * want to override them from the following default:\n */\n country,\n language,\n },\n }),\n secondaryHero: context.storefront.query<{hero: CollectionHero}>(\n COLLECTION_HERO_QUERY,\n {\n variables: {\n handle: 'backcountry',\n country,\n language,\n },\n },\n ),\n featuredCollections: context.storefront.query<{\n collections: CollectionConnection;\n }>(FEATURED_COLLECTIONS_QUERY, {\n variables: {\n country,\n language,\n },\n }),\n tertiaryHero: context.storefront.query<{hero: CollectionHero}>(\n COLLECTION_HERO_QUERY,\n {\n variables: {\n handle: 'winter-2022',\n country,\n language,\n },\n },\n ),\n });\n}\n\nexport default function Homepage() {\n const {\n primaryHero,\n secondaryHero,\n tertiaryHero,\n featuredCollections,\n featuredProducts,\n } = useLoaderData<typeof loader>();\n\n // TODO: skeletons vs placeholders\n const skeletons = getHeroPlaceholder([{}, {}, {}]);\n\n // TODO: analytics\n // useServerAnalytics({\n // shopify: {\n // pageType: ShopifyAnalyticsConstants.pageType.home,\n // },\n // });\n\n return (\n <>\n {primaryHero && (\n <Hero {...primaryHero} height=\"full\" top loading=\"eager\" />\n )}\n\n {featuredProducts && (\n <Suspense>\n <Await resolve={featuredProducts}>\n {({products}) => {\n if (!products?.nodes) return <></>;\n return (\n <ProductSwimlane\n products={products.nodes}\n title=\"Featured Products\"\n count={4}\n />\n );\n }}\n </Await>\n </Suspense>\n )}\n\n {secondaryHero && (\n <Suspense fallback={<Hero {...skeletons[1]} />}>\n <Await resolve={secondaryHero}>\n {({hero}) => {\n if (!hero) return <></>;\n return <Hero {...hero} />;\n }}\n </Await>\n </Suspense>\n )}\n\n {featuredCollections && (\n <Suspense>\n <Await resolve={featuredCollections}>\n {({collections}) => {\n if (!collections?.nodes) return <></>;\n return (\n <FeaturedCollections\n collections={collections.nodes}\n title=\"Collections\"\n />\n );\n }}\n </Await>\n </Suspense>\n )}\n\n {tertiaryHero && (\n <Suspense fallback={<Hero {...skeletons[2]} />}>\n <Await resolve={tertiaryHero}>\n {({hero}) => {\n if (!hero) return <></>;\n return <Hero {...hero} />;\n }}\n </Await>\n </Suspense>\n )}\n </>\n );\n}\n\nconst HOMEPAGE_SEO_QUERY = `#graphql\n ${COLLECTION_CONTENT_FRAGMENT}\n query collectionContent($handle: String, $country: CountryCode, $language: LanguageCode)\n @inContext(country: $country, language: $language) {\n hero: collection(handle: $handle) {\n ...CollectionContent\n }\n shop {\n name\n description\n }\n }\n`;\n\nconst COLLECTION_HERO_QUERY = `#graphql\n ${COLLECTION_CONTENT_FRAGMENT}\n query collectionContent($handle: String, $country: CountryCode, $language: LanguageCode)\n @inContext(country: $country, language: $language) {\n hero: collection(handle: $handle) {\n ...CollectionContent\n }\n }\n`;\n\n// @see: https://shopify.dev/api/storefront/latest/queries/products\nexport const HOMEPAGE_FEATURED_PRODUCTS_QUERY = `#graphql\n ${PRODUCT_CARD_FRAGMENT}\n query homepageFeaturedProducts($country: CountryCode, $language: LanguageCode)\n @inContext(country: $country, language: $language) {\n products(first: 8) {\n nodes {\n ...ProductCard\n }\n }\n }\n`;\n\n// @see: https://shopify.dev/api/storefront/latest/queries/collections\nexport const FEATURED_COLLECTIONS_QUERY = `#graphql\n query homepageFeaturedCollections($country: CountryCode, $language: LanguageCode)\n @inContext(country: $country, language: $language) {\n collections(\n first: 4,\n sortKey: UPDATED_AT\n ) {\n nodes {\n id\n title\n handle\n image {\n altText\n width\n height\n url\n }\n }\n }\n }\n`;\n"],
5
- "mappings": "udACA,IAAAA,EAAuB,OAsHnB,IAAAC,EAAA,OApBW,SAARC,GAA4B,CACjC,GAAM,CACJ,YAAAC,EACA,cAAAC,EACA,aAAAC,EACA,oBAAAC,EACA,iBAAAC,CACF,EAAIC,EAA6B,EAG3BC,EAAYC,EAAmB,CAAC,CAAC,EAAG,CAAC,EAAG,CAAC,CAAC,CAAC,EASjD,SACE,oBACG,UAAAP,MACC,OAACQ,EAAA,CAAM,GAAGR,EAAa,OAAO,OAAO,IAAG,GAAC,QAAQ,QAAQ,EAG1DI,MACC,OAAC,YACC,mBAACK,EAAA,CAAM,QAASL,EACb,UAAC,CAAC,SAAAM,CAAQ,IACJA,GAAU,SAEb,OAACC,EAAA,CACC,SAAUD,EAAS,MACnB,MAAM,oBACN,MAAO,EACT,KAN2B,oBAAE,EASnC,EACF,EAGDT,MACC,OAAC,YAAS,YAAU,OAACO,EAAA,CAAM,GAAGF,EAAU,GAAI,EAC1C,mBAACG,EAAA,CAAM,QAASR,EACb,UAAC,CAAC,KAAAW,CAAI,IACAA,KACE,OAACJ,EAAA,CAAM,GAAGI,EAAM,KADL,oBAAE,EAGxB,EACF,EAGDT,MACC,OAAC,YACC,mBAACM,EAAA,CAAM,QAASN,EACb,UAAC,CAAC,YAAAU,CAAW,IACPA,GAAa,SAEhB,OAACC,EAAA,CACC,YAAaD,EAAY,MACzB,MAAM,cACR,KAL8B,oBAAE,EAQtC,EACF,EAGDX,MACC,OAAC,YAAS,YAAU,OAACM,EAAA,CAAM,GAAGF,EAAU,GAAI,EAC1C,mBAACG,EAAA,CAAM,QAASP,EACb,UAAC,CAAC,KAAAU,CAAI,IACAA,KACE,OAACJ,EAAA,CAAM,GAAGI,EAAM,KADL,oBAAE,EAGxB,EACF,GAEJ,CAEJ,CAEA,IAAMG,EAAqB;AAAA,IACvBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaEC,EAAwB;AAAA,IAC1BD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUSE,EAAmC;AAAA,IAC5CC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
- "names": ["import_react", "import_jsx_runtime", "Homepage", "primaryHero", "secondaryHero", "tertiaryHero", "featuredCollections", "featuredProducts", "useLoaderData", "skeletons", "getHeroPlaceholder", "Hero", "Await", "products", "ProductSwimlane", "hero", "collections", "FeaturedCollections", "HOMEPAGE_SEO_QUERY", "COLLECTION_CONTENT_FRAGMENT", "COLLECTION_HERO_QUERY", "HOMEPAGE_FEATURED_PRODUCTS_QUERY", "PRODUCT_CARD_FRAGMENT"]
7
- }
@@ -1,2 +0,0 @@
1
- import{G as l,H as i,J as s}from"/build/_shared/chunk-SZCP6RSO.js";import{b as d}from"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as n}from"/build/_shared/chunk-YCAWB56Y.js";import{b as r}from"/build/_shared/chunk-SYP5DAMV.js";import{c as o}from"/build/_shared/chunk-MEPKJ2VW.js";var c="/build/_assets/custom-font-WVPOFKHF.css";var e=o(r());var y={seo:{title:"Journal",description:"A description"}};var w=({data:t})=>({title:t?.article?.seo?.title??"Article",description:t?.article?.seo?.description}),H=()=>[{rel:"stylesheet",href:c}];function f(){let{article:t,formattedDate:m}=n(),{title:u,image:a,contentHtml:g,author:p}=t;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{heading:u,variant:"blogPost",children:(0,e.jsxs)("span",{children:[m," \xB7 ",p.name]})}),(0,e.jsxs)(l,{as:"article",padding:"x",children:[a&&(0,e.jsx)(d,{data:a,className:"w-full mx-auto mt-8 md:mt-16 max-w-7xl",sizes:"90vw",widths:[400,800,1200],width:"100px",loading:s,loaderOptions:{scale:2,crop:"center"}}),(0,e.jsx)("div",{dangerouslySetInnerHTML:{__html:g},className:"article"})]})]})}export{f as default,y as handle,H as links,w as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/journal/$journalHandle-BCHHYOJX.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/journal/$journalHandle.tsx"],
4
- "sourcesContent": ["import {\n json,\n type MetaFunction,\n type SerializeFrom,\n type LinksFunction,\n type LoaderArgs,\n} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\nimport {Image} from '@shopify/storefront-kit-react';\nimport {Blog} from '@shopify/storefront-kit-react/storefront-api-types';\nimport invariant from 'tiny-invariant';\nimport {PageHeader, Section} from '~/components';\nimport {ATTR_LOADING_EAGER} from '~/lib/const';\nimport styles from '../../../styles/custom-font.css';\n\nconst BLOG_HANDLE = 'journal';\n\nexport const handle = {\n seo: {\n title: 'Journal',\n description: 'A description',\n },\n};\n\nexport async function loader({params, context}: LoaderArgs) {\n const {language, country} = context.storefront.i18n;\n\n invariant(params.journalHandle, 'Missing journal handle');\n\n const {blog} = await context.storefront.query<{\n blog: Blog;\n }>(ARTICLE_QUERY, {\n variables: {\n blogHandle: BLOG_HANDLE,\n articleHandle: params.journalHandle,\n language,\n },\n });\n\n if (!blog?.articleByHandle) {\n throw new Response(null, {status: 404});\n }\n\n const article = blog.articleByHandle;\n\n const formattedDate = new Intl.DateTimeFormat(`${language}-${country}`, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(new Date(article?.publishedAt!));\n\n return json(\n {article, formattedDate},\n {\n headers: {\n // TODO cacheLong()\n },\n },\n );\n}\n\nexport const meta: MetaFunction = ({\n data,\n}: {\n data: SerializeFrom<typeof loader> | undefined;\n}) => {\n return {\n title: data?.article?.seo?.title ?? 'Article',\n description: data?.article?.seo?.description,\n };\n};\n\nexport const links: LinksFunction = () => {\n return [{rel: 'stylesheet', href: styles}];\n};\n\nexport default function Article() {\n const {article, formattedDate} = useLoaderData<typeof loader>();\n\n const {title, image, contentHtml, author} = article;\n\n return (\n <>\n <PageHeader heading={title} variant=\"blogPost\">\n <span>\n {formattedDate} &middot; {author.name}\n </span>\n </PageHeader>\n <Section as=\"article\" padding=\"x\">\n {image && (\n <Image\n data={image}\n className=\"w-full mx-auto mt-8 md:mt-16 max-w-7xl\"\n sizes=\"90vw\"\n widths={[400, 800, 1200]}\n width=\"100px\"\n loading={ATTR_LOADING_EAGER}\n loaderOptions={{\n scale: 2,\n crop: 'center',\n }}\n />\n )}\n <div\n dangerouslySetInnerHTML={{__html: contentHtml}}\n className=\"article\"\n />\n </Section>\n </>\n );\n}\n\nconst ARTICLE_QUERY = `#graphql\n query ArticleDetails(\n $language: LanguageCode\n $blogHandle: String!\n $articleHandle: String!\n ) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n articleByHandle(handle: $articleHandle) {\n title\n contentHtml\n publishedAt\n author: authorV2 {\n name\n }\n image {\n id\n altText\n url\n width\n height\n }\n seo {\n description\n title\n }\n }\n }\n }\n`;\n"],
5
- "mappings": "kcAkFI,IAAAA,EAAA,OAjEG,IAAMC,EAAS,CACpB,IAAK,CACH,MAAO,UACP,YAAa,eACf,CACF,EAuCO,IAAMC,EAAqB,CAAC,CACjC,KAAAC,CACF,KAGS,CACL,MAAOA,GAAM,SAAS,KAAK,OAAS,UACpC,YAAaA,GAAM,SAAS,KAAK,WACnC,GAGWC,EAAuB,IAC3B,CAAC,CAAC,IAAK,aAAc,KAAMC,CAAM,CAAC,EAG5B,SAARC,GAA2B,CAChC,GAAM,CAAC,QAAAC,EAAS,cAAAC,CAAa,EAAIC,EAA6B,EAExD,CAAC,MAAAC,EAAO,MAAAC,EAAO,YAAAC,EAAa,OAAAC,CAAM,EAAIN,EAE5C,SACE,oBACE,oBAACO,EAAA,CAAW,QAASJ,EAAO,QAAQ,WAClC,oBAAC,QACE,UAAAF,EAAc,SAAWK,EAAO,MACnC,EACF,KACA,QAACE,EAAA,CAAQ,GAAG,UAAU,QAAQ,IAC3B,UAAAJ,MACC,OAACK,EAAA,CACC,KAAML,EACN,UAAU,yCACV,MAAM,OACN,OAAQ,CAAC,IAAK,IAAK,IAAI,EACvB,MAAM,QACN,QAASM,EACT,cAAe,CACb,MAAO,EACP,KAAM,QACR,EACF,KAEF,OAAC,OACC,wBAAyB,CAAC,OAAQL,CAAW,EAC7C,UAAU,UACZ,GACF,GACF,CAEJ",
6
- "names": ["import_jsx_runtime", "handle", "meta", "data", "links", "custom_font_default", "Article", "article", "formattedDate", "useLoaderData", "title", "image", "contentHtml", "author", "PageHeader", "Section", "Image", "ATTR_LOADING_EAGER"]
7
- }
@@ -1,2 +0,0 @@
1
- import{G as i,H as s,K as g,Y as m,ba as c}from"/build/_shared/chunk-SZCP6RSO.js";import{b as d}from"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as r}from"/build/_shared/chunk-YCAWB56Y.js";import{b as l}from"/build/_shared/chunk-SYP5DAMV.js";import{c as n}from"/build/_shared/chunk-MEPKJ2VW.js";var e=n(l()),u="Journal",h={seo:{titleTemplate:"%s | Journal"}};var f=()=>({title:"All Journals"});function p(){let{articles:a}=r();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(s,{heading:u}),(0,e.jsx)(i,{children:(0,e.jsx)(c,{as:"ol",layout:"blog",children:a.map((t,o)=>(0,e.jsx)(y,{blogHandle:u.toLowerCase(),article:t,loading:g(o,2)},t.id))})})]})}function y({blogHandle:a,article:t,loading:o}){return(0,e.jsx)("li",{children:(0,e.jsxs)(m,{to:`/${a}/${t.handle}`,children:[t.image&&(0,e.jsx)("div",{className:"card-image aspect-[3/2]",children:(0,e.jsx)(d,{alt:t.image.altText||t.title,className:"object-cover w-full",data:t.image,height:400,loading:o,sizes:"(min-width: 768px) 50vw, 100vw",width:600,loaderOptions:{scale:2,crop:"center"}})}),(0,e.jsx)("h2",{className:"mt-4 font-medium",children:t.title}),(0,e.jsx)("span",{className:"block mt-1",children:t.publishedAt})]})},t.id)}export{p as default,h as handle,f as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/journal/index-LZR4YNUM.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/journal/index.tsx"],
4
- "sourcesContent": ["import {json, type MetaFunction, type LoaderArgs} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\nimport {flattenConnection, Image} from '@shopify/storefront-kit-react';\nimport type {\n Article,\n Blog,\n} from '@shopify/storefront-kit-react/storefront-api-types';\nimport {Grid, PageHeader, Section, Link} from '~/components';\nimport {getImageLoadingPriority, PAGINATION_SIZE} from '~/lib/const';\n\nconst BLOG_HANDLE = 'Journal';\n\nexport const handle = {\n seo: {\n titleTemplate: '%s | Journal',\n },\n};\n\nexport const loader = async ({context: {storefront}}: LoaderArgs) => {\n const {language, country} = storefront.i18n;\n const {blog} = await storefront.query<{\n blog: Blog;\n }>(BLOGS_QUERY, {\n variables: {\n blogHandle: BLOG_HANDLE,\n pageBy: PAGINATION_SIZE,\n language,\n },\n });\n\n if (!blog?.articles) {\n throw new Response('Not found', {status: 404});\n }\n\n const articles = flattenConnection(blog.articles).map((article) => {\n const {publishedAt} = article;\n return {\n ...article,\n publishedAt: new Intl.DateTimeFormat(`${language}-${country}`, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(new Date(publishedAt!)),\n };\n });\n\n return json(\n {articles},\n {\n headers: {\n // TODO cacheLong()\n },\n },\n );\n};\n\nexport const meta: MetaFunction = () => {\n return {\n title: 'All Journals',\n };\n};\n\nexport default function Journals() {\n const {articles} = useLoaderData<typeof loader>();\n\n return (\n <>\n <PageHeader heading={BLOG_HANDLE} />\n <Section>\n <Grid as=\"ol\" layout=\"blog\">\n {articles.map((article, i) => (\n <ArticleCard\n blogHandle={BLOG_HANDLE.toLowerCase()}\n article={article as Article}\n key={article.id}\n loading={getImageLoadingPriority(i, 2)}\n />\n ))}\n </Grid>\n </Section>\n </>\n );\n}\n\nfunction ArticleCard({\n blogHandle,\n article,\n loading,\n}: {\n blogHandle: string;\n article: Article;\n loading?: HTMLImageElement['loading'];\n}) {\n return (\n <li key={article.id}>\n <Link to={`/${blogHandle}/${article.handle}`}>\n {article.image && (\n <div className=\"card-image aspect-[3/2]\">\n <Image\n alt={article.image.altText || article.title}\n className=\"object-cover w-full\"\n data={article.image}\n height={400}\n loading={loading}\n sizes=\"(min-width: 768px) 50vw, 100vw\"\n width={600}\n loaderOptions={{\n scale: 2,\n crop: 'center',\n }}\n />\n </div>\n )}\n <h2 className=\"mt-4 font-medium\">{article.title}</h2>\n <span className=\"block mt-1\">{article.publishedAt}</span>\n </Link>\n </li>\n );\n}\n\nconst BLOGS_QUERY = `#graphql\nquery Blog(\n $language: LanguageCode\n $blogHandle: String!\n $pageBy: Int!\n $cursor: String\n) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n articles(first: $pageBy, after: $cursor) {\n edges {\n node {\n author: authorV2 {\n name\n }\n contentHtml\n handle\n id\n image {\n id\n altText\n url\n width\n height\n }\n publishedAt\n title\n }\n }\n }\n }\n}\n`;\n"],
5
- "mappings": "iaAkEI,IAAAA,EAAA,OAxDEC,EAAc,UAEPC,EAAS,CACpB,IAAK,CACH,cAAe,cACjB,CACF,EAwCO,IAAMC,EAAqB,KACzB,CACL,MAAO,cACT,GAGa,SAARC,GAA4B,CACjC,GAAM,CAAC,SAAAC,CAAQ,EAAIC,EAA6B,EAEhD,SACE,oBACE,oBAACC,EAAA,CAAW,QAASC,EAAa,KAClC,OAACC,EAAA,CACC,mBAACC,EAAA,CAAK,GAAG,KAAK,OAAO,OAClB,SAAAL,EAAS,IAAI,CAACM,EAASC,OACtB,OAACC,EAAA,CACC,WAAYL,EAAY,YAAY,EACpC,QAASG,EAET,QAASG,EAAwBF,EAAG,CAAC,GADhCD,EAAQ,EAEf,CACD,EACH,EACF,GACF,CAEJ,CAEA,SAASE,EAAY,CACnB,WAAAE,EACA,QAAAJ,EACA,QAAAK,CACF,EAIG,CACD,SACE,OAAC,MACC,oBAACC,EAAA,CAAK,GAAI,IAAIF,KAAcJ,EAAQ,SACjC,UAAAA,EAAQ,UACP,OAAC,OAAI,UAAU,0BACb,mBAACO,EAAA,CACC,IAAKP,EAAQ,MAAM,SAAWA,EAAQ,MACtC,UAAU,sBACV,KAAMA,EAAQ,MACd,OAAQ,IACR,QAASK,EACT,MAAM,iCACN,MAAO,IACP,cAAe,CACb,MAAO,EACP,KAAM,QACR,EACF,EACF,KAEF,OAAC,MAAG,UAAU,mBAAoB,SAAAL,EAAQ,MAAM,KAChD,OAAC,QAAK,UAAU,aAAc,SAAAA,EAAQ,YAAY,GACpD,GArBOA,EAAQ,EAsBjB,CAEJ",
6
- "names": ["import_jsx_runtime", "BLOG_HANDLE", "handle", "meta", "Journals", "articles", "useLoaderData", "PageHeader", "BLOG_HANDLE", "Section", "Grid", "article", "i", "ArticleCard", "getImageLoadingPriority", "blogHandle", "loading", "Link", "Image"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as o}from"/build/_shared/chunk-MEPKJ2VW.js";var p=o((r,e)=>{e.exports={}});export default p();
2
- //# sourceMappingURL=/build/routes/($lang)/og-image-KUOACO4J.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["browser-route-module:routes/($lang)/og-image.tsx?browser"],
4
- "sourcesContent": ["module.exports = {};"],
5
- "mappings": "qDAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,CAAC",
6
- "names": ["require_og_image", "__commonJSMin", "exports", "module"]
7
- }
@@ -1,2 +0,0 @@
1
- import{H as n}from"/build/_shared/chunk-SZCP6RSO.js";import"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as r}from"/build/_shared/chunk-YCAWB56Y.js";import{b as o}from"/build/_shared/chunk-SYP5DAMV.js";import{c as t}from"/build/_shared/chunk-MEPKJ2VW.js";var e=t(o());var g=({data:a})=>({title:a?.page?.seo?.title??"Page",description:a?.page?.seo?.description});function i(){let{page:a}=r();return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(n,{heading:a.title,children:(0,e.jsx)("div",{dangerouslySetInnerHTML:{__html:a.body},className:"prose dark:prose-invert"})})})}export{i as default,g as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/pages/$pageHandle-5WR6PFRU.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/pages/$pageHandle.tsx"],
4
- "sourcesContent": ["import {\n json,\n type MetaFunction,\n type SerializeFrom,\n type LoaderArgs,\n} from '@shopify/remix-oxygen';\nimport type {Page as PageType} from '@shopify/storefront-kit-react/storefront-api-types';\nimport {useLoaderData} from '@remix-run/react';\nimport invariant from 'tiny-invariant';\nimport {PageHeader} from '~/components';\n\nexport async function loader({request, params, context}: LoaderArgs) {\n invariant(params.pageHandle, 'Missing page handle');\n\n const {page} = await context.storefront.query<{page: PageType}>(PAGE_QUERY, {\n variables: {\n handle: params.pageHandle,\n language: context.storefront.i18n.language,\n },\n });\n\n if (!page) {\n throw new Response(null, {status: 404});\n }\n\n return json(\n {page},\n {\n headers: {\n // TODO cacheLong()\n },\n },\n );\n}\n\nexport const meta: MetaFunction = ({\n data,\n}: {\n data: SerializeFrom<typeof loader> | undefined;\n}) => {\n return {\n title: data?.page?.seo?.title ?? 'Page',\n description: data?.page?.seo?.description,\n };\n};\n\nexport default function Page() {\n const {page} = useLoaderData<typeof loader>();\n\n return (\n <>\n <PageHeader heading={page.title}>\n <div\n dangerouslySetInnerHTML={{__html: page.body}}\n className=\"prose dark:prose-invert\"\n />\n </PageHeader>\n </>\n );\n}\n\nconst PAGE_QUERY = `#graphql\n query PageDetails($language: LanguageCode, $handle: String!)\n @inContext(language: $language) {\n page(handle: $handle) {\n id\n title\n body\n seo {\n description\n title\n }\n }\n }\n`;\n"],
5
- "mappings": "wXAkDI,IAAAA,EAAA,OAfG,IAAMC,EAAqB,CAAC,CACjC,KAAAC,CACF,KAGS,CACL,MAAOA,GAAM,MAAM,KAAK,OAAS,OACjC,YAAaA,GAAM,MAAM,KAAK,WAChC,GAGa,SAARC,GAAwB,CAC7B,GAAM,CAAC,KAAAC,CAAI,EAAIC,EAA6B,EAE5C,SACE,mBACE,mBAACC,EAAA,CAAW,QAASF,EAAK,MACxB,mBAAC,OACC,wBAAyB,CAAC,OAAQA,EAAK,IAAI,EAC3C,UAAU,0BACZ,EACF,EACF,CAEJ",
6
- "names": ["import_jsx_runtime", "meta", "data", "Page", "page", "useLoaderData", "PageHeader"]
7
- }
@@ -1,2 +0,0 @@
1
- import{G as r,H as t,R as n}from"/build/_shared/chunk-SZCP6RSO.js";import"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as l}from"/build/_shared/chunk-YCAWB56Y.js";import{b as a}from"/build/_shared/chunk-SYP5DAMV.js";import{c as i}from"/build/_shared/chunk-MEPKJ2VW.js";var e=i(a());var s=({data:o})=>({title:o?.policy?.title??"Policies"});function c(){let{policy:o}=l();return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(r,{padding:"all",display:"flex",className:"flex-col items-baseline w-full gap-8 md:flex-row",children:[(0,e.jsx)(t,{heading:o.title,className:"grid items-start flex-grow gap-4 md:sticky top-36 md:w-5/12",children:(0,e.jsx)(n,{className:"justify-self-start",variant:"inline",to:"/policies",children:"\u2190 Back to Policies"})}),(0,e.jsx)("div",{className:"flex-grow w-full md:w-7/12",children:(0,e.jsx)("div",{dangerouslySetInnerHTML:{__html:o.body},className:"prose dark:prose-invert"})})]})})}export{c as default,s as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/policies/$policyHandle-C5ATUMN6.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/policies/$policyHandle.tsx"],
4
- "sourcesContent": ["import {json, type MetaFunction, type LoaderArgs} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\n\nimport {PageHeader, Section, Button} from '~/components';\nimport invariant from 'tiny-invariant';\nimport {ShopPolicy} from '@shopify/storefront-kit-react/storefront-api-types';\n\nexport async function loader({request, params, context}: LoaderArgs) {\n invariant(params.policyHandle, 'Missing policy handle');\n const handle = params.policyHandle;\n\n const policyName = handle.replace(/-([a-z])/g, (_: unknown, m1: string) =>\n m1.toUpperCase(),\n );\n\n const data = await context.storefront.query<{\n shop: Record<string, ShopPolicy>;\n }>(POLICY_CONTENT_QUERY, {\n variables: {\n privacyPolicy: false,\n shippingPolicy: false,\n termsOfService: false,\n refundPolicy: false,\n [policyName]: true,\n language: context.storefront.i18n.language,\n },\n });\n\n invariant(data, 'No data returned from Shopify API');\n const policy = data.shop?.[policyName];\n\n if (!policy) {\n throw new Response(null, {status: 404});\n }\n\n return json(\n {policy},\n {\n headers: {\n // TODO cacheLong()\n },\n },\n );\n}\n\nexport const meta: MetaFunction<typeof loader> = ({data}) => {\n return {\n title: data?.policy?.title ?? 'Policies',\n };\n};\n\nexport default function Policies() {\n const {policy} = useLoaderData<typeof loader>();\n\n return (\n <>\n <Section\n padding=\"all\"\n display=\"flex\"\n className=\"flex-col items-baseline w-full gap-8 md:flex-row\"\n >\n <PageHeader\n heading={policy.title}\n className=\"grid items-start flex-grow gap-4 md:sticky top-36 md:w-5/12\"\n >\n <Button\n className=\"justify-self-start\"\n variant=\"inline\"\n to={'/policies'}\n >\n &larr; Back to Policies\n </Button>\n </PageHeader>\n <div className=\"flex-grow w-full md:w-7/12\">\n <div\n dangerouslySetInnerHTML={{__html: policy.body}}\n className=\"prose dark:prose-invert\"\n />\n </div>\n </Section>\n </>\n );\n}\n\nconst POLICY_CONTENT_QUERY = `#graphql\n fragment Policy on ShopPolicy {\n body\n handle\n id\n title\n url\n }\n\n query PoliciesQuery(\n $language: LanguageCode\n $privacyPolicy: Boolean!\n $shippingPolicy: Boolean!\n $termsOfService: Boolean!\n $refundPolicy: Boolean!\n ) @inContext(language: $language) {\n shop {\n privacyPolicy @include(if: $privacyPolicy) {\n ...Policy\n }\n shippingPolicy @include(if: $shippingPolicy) {\n ...Policy\n }\n termsOfService @include(if: $termsOfService) {\n ...Policy\n }\n refundPolicy @include(if: $refundPolicy) {\n ...Policy\n }\n }\n }\n`;\n"],
5
- "mappings": "sYAuDI,IAAAA,EAAA,OAVG,IAAMC,EAAoC,CAAC,CAAC,KAAAC,CAAI,KAC9C,CACL,MAAOA,GAAM,QAAQ,OAAS,UAChC,GAGa,SAARC,GAA4B,CACjC,GAAM,CAAC,OAAAC,CAAM,EAAIC,EAA6B,EAE9C,SACE,mBACE,oBAACC,EAAA,CACC,QAAQ,MACR,QAAQ,OACR,UAAU,mDAEV,oBAACC,EAAA,CACC,QAASH,EAAO,MAChB,UAAU,8DAEV,mBAACI,EAAA,CACC,UAAU,qBACV,QAAQ,SACR,GAAI,YACL,mCAED,EACF,KACA,OAAC,OAAI,UAAU,6BACb,mBAAC,OACC,wBAAyB,CAAC,OAAQJ,EAAO,IAAI,EAC7C,UAAU,0BACZ,EACF,GACF,EACF,CAEJ",
6
- "names": ["import_jsx_runtime", "meta", "data", "Policies", "policy", "useLoaderData", "Section", "PageHeader", "Button"]
7
- }
@@ -1,2 +0,0 @@
1
- import{F as n,G as s,H as c,Y as l}from"/build/_shared/chunk-SZCP6RSO.js";import"/build/_shared/chunk-7CKXJRLM.js";import"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{q as r}from"/build/_shared/chunk-YCAWB56Y.js";import{b as a}from"/build/_shared/chunk-SYP5DAMV.js";import{c as i}from"/build/_shared/chunk-MEPKJ2VW.js";var e=i(a());var d=({data:t})=>({title:"Policies",description:"Policies"});function p(){let{policies:t}=r();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(c,{heading:"Policies"}),(0,e.jsx)(s,{padding:"x",className:"mb-24",children:t.map(o=>o&&(0,e.jsx)(n,{className:"font-normal text-heading",children:(0,e.jsx)(l,{to:`/policies/${o.handle}`,children:o.title})},o.id))})]})}export{p as default,d as meta};
2
- //# sourceMappingURL=/build/routes/($lang)/policies/index-MJDYZG5P.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../app/routes/($lang)/policies/index.tsx"],
4
- "sourcesContent": ["import {\n json,\n type MetaFunction,\n type SerializeFrom,\n type LoaderArgs,\n} from '@shopify/remix-oxygen';\nimport {useLoaderData} from '@remix-run/react';\nimport type {ShopPolicy} from '@shopify/storefront-kit-react/storefront-api-types';\nimport invariant from 'tiny-invariant';\n\nimport {PageHeader, Section, Heading, Link} from '~/components';\n\nexport async function loader({context: {storefront}}: LoaderArgs) {\n const data = await storefront.query<{\n shop: Record<string, ShopPolicy>;\n }>(POLICIES_QUERY);\n\n invariant(data, 'No data returned from Shopify API');\n const policies = Object.values(data.shop || {});\n\n if (policies.length === 0) {\n throw new Response('Not found', {status: 404});\n }\n\n return json(\n {\n policies,\n },\n {\n headers: {\n // TODO cacheLong()\n },\n },\n );\n}\n\nexport const meta: MetaFunction = ({\n data,\n}: {\n data: SerializeFrom<typeof loader> | undefined;\n}) => {\n return {\n title: 'Policies',\n description: 'Policies',\n };\n};\n\nexport default function Policies() {\n const {policies} = useLoaderData<typeof loader>();\n\n return (\n <>\n <PageHeader heading=\"Policies\" />\n <Section padding=\"x\" className=\"mb-24\">\n {policies.map((policy) => {\n return (\n policy && (\n <Heading className=\"font-normal text-heading\" key={policy.id}>\n <Link to={`/policies/${policy.handle}`}>{policy.title}</Link>\n </Heading>\n )\n );\n })}\n </Section>\n </>\n );\n}\n\nconst POLICIES_QUERY = `#graphql\n fragment Policy on ShopPolicy {\n id\n title\n handle\n }\n\n query PoliciesQuery {\n shop {\n privacyPolicy {\n ...Policy\n }\n shippingPolicy {\n ...Policy\n }\n termsOfService {\n ...Policy\n }\n refundPolicy {\n ...Policy\n }\n subscriptionPolicy {\n id\n title\n handle\n }\n }\n }\n`;\n"],
5
- "mappings": "6YAmDI,IAAAA,EAAA,OAfG,IAAMC,EAAqB,CAAC,CACjC,KAAAC,CACF,KAGS,CACL,MAAO,WACP,YAAa,UACf,GAGa,SAARC,GAA4B,CACjC,GAAM,CAAC,SAAAC,CAAQ,EAAIC,EAA6B,EAEhD,SACE,oBACE,oBAACC,EAAA,CAAW,QAAQ,WAAW,KAC/B,OAACC,EAAA,CAAQ,QAAQ,IAAI,UAAU,QAC5B,SAAAH,EAAS,IAAKI,GAEXA,MACE,OAACC,EAAA,CAAQ,UAAU,2BACjB,mBAACC,EAAA,CAAK,GAAI,aAAaF,EAAO,SAAW,SAAAA,EAAO,MAAM,GADLA,EAAO,EAE1D,CAGL,EACH,GACF,CAEJ",
6
- "names": ["import_jsx_runtime", "meta", "data", "Policies", "policies", "useLoaderData", "PageHeader", "Section", "policy", "Heading", "Link"]
7
- }
@@ -1,68 +0,0 @@
1
- import{a as Ae,b as $e,c as Me}from"/build/_shared/chunk-EW52HEI6.js";import{A as m,B as G,D as M,E as F,F as W,G as Ie,L as Le,O as Ne,Q as we,Y as X,a as L,b as ce,c as j,d as q,da as Te,e as x,ea as De,f as V,fa as ke,g as N,ga as Ee,h as pe,i as me,j as fe,k as ve,l as be,m as ge,n as E,o as C,p as ye,q as Y,r as A,s as $,t as xe,u as he,v as Re,w as Pe,x as z,y as Se,z as Oe}from"/build/_shared/chunk-SZCP6RSO.js";import{e as J,f as Ce}from"/build/_shared/chunk-7CKXJRLM.js";import{c as Z}from"/build/_shared/chunk-NIVT6A2W.js";import"/build/_shared/chunk-AYHDHSL7.js";import"/build/_shared/chunk-7CASD2US.js";import{a as ie,h as se,n as le,q as K,s as ue}from"/build/_shared/chunk-YCAWB56Y.js";import{a as _,b as de}from"/build/_shared/chunk-SYP5DAMV.js";import{c as k}from"/build/_shared/chunk-MEPKJ2VW.js";var D=k(_());var Fe=k(_(),1);function ee(e,o){let[r,t]=(0,Fe.useState)(e),a=ce(e);return L(()=>t(a.current),[a,t,...o]),r}function te(e={},o=null,r=[]){for(let[t,a]of Object.entries(e))Be(r,Ue(o,t),a);return r}function Ue(e,o){return e?e+"["+o+"]":o}function Be(e,o,r){if(Array.isArray(r))for(let[t,a]of r.entries())Be(e,Ue(o,t.toString()),a);else r instanceof Date?e.push([o,r.toISOString()]):typeof r=="boolean"?e.push([o,r?"1":"0"]):typeof r=="string"?e.push([o,r]):typeof r=="number"?e.push([o,`${r}`]):r==null?e.push([o,""]):te(r,o,e)}var Ve=k(_(),1);function He(e,o,r){let[t,a]=(0,Ve.useState)(r),i=e!==void 0;return[i?e:t,x(s=>(i||a(s),o?.(s)))]}var d=k(_(),1);var qe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(qe||{}),ze=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ze||{}),Ge=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ge||{}),Ke=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(Ke||{});function re(e,o=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,t=ve(o(e.options.slice()),i=>i.dataRef.current.domRef.current),a=r?t.indexOf(r):null;return a===-1&&(a=null),{options:t,activeOptionIndex:a}}var Ze={[1](e){return e.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){if(e.disabled||e.listboxState===0)return e;let o=e.activeOptionIndex,{value:r,mode:t,compare:a}=e.propsRef.current,i=e.options.findIndex(s=>{let l=s.dataRef.current.value;return N(t,{[1]:()=>r.some(c=>a(c,l)),[0]:()=>a(r,l)})});return i!==-1&&(o=i),{...e,listboxState:0,activeOptionIndex:o}},[2](e,o){return e.disabled===o.disabled?e:{...e,disabled:o.disabled}},[3](e,o){return e.orientation===o.orientation?e:{...e,orientation:o.orientation}},[4](e,o){var r;if(e.disabled||e.listboxState===1)return e;let t=re(e),a=ye(o,{resolveItems:()=>t.options,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});return{...e,...t,searchQuery:"",activeOptionIndex:a,activationTrigger:(r=o.trigger)!=null?r:1}},[5]:(e,o)=>{if(e.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,t=e.searchQuery+o.value.toLowerCase(),a=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(s=>{var l;return!s.dataRef.current.disabled&&((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(t))}),i=a?e.options.indexOf(a):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:t}:{...e,searchQuery:t,activeOptionIndex:i,activationTrigger:1}},[6](e){return e.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[7]:(e,o)=>{let r={id:o.id,dataRef:o.dataRef},t=re(e,a=>[...a,r]);if(e.activeOptionIndex===null){let{value:a,mode:i,compare:s}=e.propsRef.current,l=o.dataRef.current.value;N(i,{[1]:()=>a.some(c=>s(c,l)),[0]:()=>s(a,l)})&&(t.activeOptionIndex=t.options.indexOf(r))}return{...e,...t}},[8]:(e,o)=>{let r=re(e,t=>{let a=t.findIndex(i=>i.id===o.id);return a!==-1&&t.splice(a,1),t});return{...e,...r,activationTrigger:1}}},oe=(0,d.createContext)(null);oe.displayName="ListboxContext";function H(e){let o=(0,d.useContext)(oe);if(o===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,H),r}return o}function Ye(e,o){return N(o.type,Ze,e,o)}var We=d.Fragment,Je=$(function(e,o){let{value:r,defaultValue:t,name:a,onChange:i,by:s=(b,R)=>b===R,disabled:l=!1,horizontal:c=!1,multiple:h=!1,...S}=e,g=c?"horizontal":"vertical",y=E(o),[P,f]=He(r,i,t),v=(0,d.useReducer)(Ye,{listboxState:1,propsRef:{current:{value:P,onChange:f,mode:h?1:0,compare:x(typeof s=="string"?(b,R)=>{let T=s;return b?.[T]===R?.[T]}:s)}},labelRef:(0,d.createRef)(),buttonRef:(0,d.createRef)(),optionsRef:(0,d.createRef)(),disabled:l,orientation:g,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:u,propsRef:p,optionsRef:w,buttonRef:U},B]=v;p.current.value=P,p.current.mode=h?1:0,L(()=>{p.current.onChange=b=>N(p.current.mode,{[0](){return f(b)},[1](){let R=p.current.value.slice(),{compare:T}=p.current,ne=R.findIndex(je=>T(je,b));return ne===-1?R.push(b):R.splice(ne,1),f(R)}})},[f,p]),L(()=>B({type:2,disabled:l}),[l]),L(()=>B({type:3,orientation:g}),[g]),be([U,w],(b,R)=>{var T;B({type:1}),fe(R,me.Loose)||(b.preventDefault(),(T=U.current)==null||T.focus())},u===0);let O=(0,d.useMemo)(()=>({open:u===0,disabled:l,value:P}),[u,l,P]),I={ref:y};return d.default.createElement(oe.Provider,{value:v},d.default.createElement(Oe,{value:N(u,{[0]:z.Open,[1]:z.Closed})},a!=null&&P!=null&&te({[a]:P}).map(([b,R])=>d.default.createElement(Pe,{features:Re.Hidden,...xe({key:b,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:b,value:R})})),A({ourProps:I,theirProps:S,slot:O,defaultTag:We,name:"Listbox"})))}),Xe="button",et=$(function(e,o){var r;let[t,a]=H("Listbox.Button"),i=E(t.buttonRef,o),s=`headlessui-listbox-button-${V()}`,l=q(),c=x(v=>{switch(v.key){case m.Space:case m.Enter:case m.ArrowDown:v.preventDefault(),a({type:0}),l.nextFrame(()=>{t.propsRef.current.value||a({type:4,focus:C.First})});break;case m.ArrowUp:v.preventDefault(),a({type:0}),l.nextFrame(()=>{t.propsRef.current.value||a({type:4,focus:C.Last})});break}}),h=x(v=>{switch(v.key){case m.Space:v.preventDefault();break}}),S=x(v=>{if(he(v.currentTarget))return v.preventDefault();t.listboxState===0?(a({type:1}),l.nextFrame(()=>{var u;return(u=t.buttonRef.current)==null?void 0:u.focus({preventScroll:!0})})):(v.preventDefault(),a({type:0}))}),g=ee(()=>{if(t.labelRef.current)return[t.labelRef.current.id,s].join(" ")},[t.labelRef.current,s]),y=(0,d.useMemo)(()=>({open:t.listboxState===0,disabled:t.disabled,value:t.propsRef.current.value}),[t]),P=e,f={ref:i,id:s,type:ge(e,t.buttonRef),"aria-haspopup":!0,"aria-controls":(r=t.optionsRef.current)==null?void 0:r.id,"aria-expanded":t.disabled?void 0:t.listboxState===0,"aria-labelledby":g,disabled:t.disabled,onKeyDown:c,onKeyUp:h,onClick:S};return A({ourProps:f,theirProps:P,slot:y,defaultTag:Xe,name:"Listbox.Button"})}),tt="label",rt=$(function(e,o){let[r]=H("Listbox.Label"),t=`headlessui-listbox-label-${V()}`,a=E(r.labelRef,o),i=x(()=>{var l;return(l=r.buttonRef.current)==null?void 0:l.focus({preventScroll:!0})}),s=(0,d.useMemo)(()=>({open:r.listboxState===0,disabled:r.disabled}),[r]);return A({ourProps:{ref:a,id:t,onClick:i},theirProps:e,slot:s,defaultTag:tt,name:"Listbox.Label"})}),ot="ul",at=Y.RenderStrategy|Y.Static,nt=$(function(e,o){var r;let[t,a]=H("Listbox.Options"),i=E(t.optionsRef,o),s=`headlessui-listbox-options-${V()}`,l=q(),c=q(),h=Se(),S=(()=>h!==null?h===z.Open:t.listboxState===0)();(0,d.useEffect)(()=>{var u;let p=t.optionsRef.current;!p||t.listboxState===0&&p!==((u=pe(p))==null?void 0:u.activeElement)&&p.focus({preventScroll:!0})},[t.listboxState,t.optionsRef]);let g=x(u=>{switch(c.dispose(),u.key){case m.Space:if(t.searchQuery!=="")return u.preventDefault(),u.stopPropagation(),a({type:5,value:u.key});case m.Enter:if(u.preventDefault(),u.stopPropagation(),t.activeOptionIndex!==null){let{dataRef:p}=t.options[t.activeOptionIndex];t.propsRef.current.onChange(p.current.value)}t.propsRef.current.mode===0&&(a({type:1}),j().nextFrame(()=>{var p;return(p=t.buttonRef.current)==null?void 0:p.focus({preventScroll:!0})}));break;case N(t.orientation,{vertical:m.ArrowDown,horizontal:m.ArrowRight}):return u.preventDefault(),u.stopPropagation(),a({type:4,focus:C.Next});case N(t.orientation,{vertical:m.ArrowUp,horizontal:m.ArrowLeft}):return u.preventDefault(),u.stopPropagation(),a({type:4,focus:C.Previous});case m.Home:case m.PageUp:return u.preventDefault(),u.stopPropagation(),a({type:4,focus:C.First});case m.End:case m.PageDown:return u.preventDefault(),u.stopPropagation(),a({type:4,focus:C.Last});case m.Escape:return u.preventDefault(),u.stopPropagation(),a({type:1}),l.nextFrame(()=>{var p;return(p=t.buttonRef.current)==null?void 0:p.focus({preventScroll:!0})});case m.Tab:u.preventDefault(),u.stopPropagation();break;default:u.key.length===1&&(a({type:5,value:u.key}),c.setTimeout(()=>a({type:6}),350));break}}),y=ee(()=>{var u,p,w;return(w=(u=t.labelRef.current)==null?void 0:u.id)!=null?w:(p=t.buttonRef.current)==null?void 0:p.id},[t.labelRef.current,t.buttonRef.current]),P=(0,d.useMemo)(()=>({open:t.listboxState===0}),[t]),f=e,v={"aria-activedescendant":t.activeOptionIndex===null||(r=t.options[t.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":t.propsRef.current.mode===1?!0:void 0,"aria-labelledby":y,"aria-orientation":t.orientation,id:s,onKeyDown:g,role:"listbox",tabIndex:0,ref:i};return A({ourProps:v,theirProps:f,slot:P,defaultTag:ot,features:at,visible:S,name:"Listbox.Options"})}),it="li",st=$(function(e,o){let{disabled:r=!1,value:t,...a}=e,[i,s]=H("Listbox.Option"),l=`headlessui-listbox-option-${V()}`,c=i.activeOptionIndex!==null?i.options[i.activeOptionIndex].id===l:!1,{value:h,compare:S}=i.propsRef.current,g=N(i.propsRef.current.mode,{[1]:()=>h.some(O=>S(O,t)),[0]:()=>S(h,t)}),y=(0,d.useRef)(null),P=E(o,y);L(()=>{if(i.listboxState!==0||!c||i.activationTrigger===0)return;let O=j();return O.requestAnimationFrame(()=>{var I,b;(b=(I=y.current)==null?void 0:I.scrollIntoView)==null||b.call(I,{block:"nearest"})}),O.dispose},[y,c,i.listboxState,i.activationTrigger,i.activeOptionIndex]);let f=(0,d.useRef)({disabled:r,value:t,domRef:y});L(()=>{f.current.disabled=r},[f,r]),L(()=>{f.current.value=t},[f,t]),L(()=>{var O,I;f.current.textValue=(I=(O=y.current)==null?void 0:O.textContent)==null?void 0:I.toLowerCase()},[f,y]);let v=x(()=>i.propsRef.current.onChange(t));L(()=>(s({type:7,id:l,dataRef:f}),()=>s({type:8,id:l})),[f,l]);let u=x(O=>{if(r)return O.preventDefault();v(),i.propsRef.current.mode===0&&(s({type:1}),j().nextFrame(()=>{var I;return(I=i.buttonRef.current)==null?void 0:I.focus({preventScroll:!0})}))}),p=x(()=>{if(r)return s({type:4,focus:C.Nothing});s({type:4,focus:C.Specific,id:l})}),w=x(()=>{r||c||s({type:4,focus:C.Specific,id:l,trigger:0})}),U=x(()=>{r||!c||s({type:4,focus:C.Nothing})}),B=(0,d.useMemo)(()=>({active:c,selected:g,disabled:r}),[c,g,r]);return A({ourProps:{id:l,ref:P,role:"option",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:u,onFocus:p,onPointerMove:w,onMouseMove:w,onPointerLeave:U,onMouseLeave:U},theirProps:a,slot:B,defaultTag:it,name:"Listbox.Option"})}),Q=Object.assign(Je,{Button:et,Label:rt,Options:nt,Option:st});var n=k(de());function _e(){let{product:e,shop:o,recommended:r}=K(),{media:t,title:a,vendor:i,descriptionHtml:s}=e,{shippingPolicy:l,refundPolicy:c}=o;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ie,{padding:"x",className:"px-0",children:(0,n.jsxs)("div",{className:"grid items-start md:gap-6 lg:gap-20 md:grid-cols-2 lg:grid-cols-3",children:[(0,n.jsx)(Le,{media:t.nodes,className:"w-screen md:w-full lg:col-span-2"}),(0,n.jsx)("div",{className:"sticky md:-mb-nav md:top-nav md:-translate-y-nav md:h-screen md:pt-nav hiddenScroll md:overflow-y-scroll",children:(0,n.jsxs)("section",{className:"flex flex-col w-full max-w-xl gap-8 p-6 md:mx-auto md:max-w-sm md:px-0",children:[(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(W,{as:"h1",format:!0,className:"whitespace-normal",children:a}),i&&(0,n.jsx)(F,{className:"opacity-50 font-medium",children:i})]}),(0,n.jsx)(lt,{}),(0,n.jsxs)("div",{className:"grid gap-4 py-4",children:[s&&(0,n.jsx)(ae,{title:"Product Details",content:s}),l?.body&&(0,n.jsx)(ae,{title:"Shipping",content:Z(l.body),learnMore:`/policies/${l.handle}`}),c?.body&&(0,n.jsx)(ae,{title:"Returns",content:Z(c.body),learnMore:`/policies/${c.handle}`})]})]})})]})}),(0,n.jsx)(D.Suspense,{fallback:(0,n.jsx)(we,{className:"h-32"}),children:(0,n.jsx)(le,{errorElement:"There was a problem loading related products",resolve:r,children:h=>(0,n.jsx)(Ne,{title:"Related Products",products:h})})})]})}function lt(){let{product:e}=K(),[o]=se(),r=ue(),t=(0,D.useMemo)(()=>r.location?new URLSearchParams(r.location.search):o,[o,r]),a=e.variants.nodes[0],i=(0,D.useMemo)(()=>{let S=new URLSearchParams(t);for(let{name:g,value:y}of a.selectedOptions)t.has(g)||S.set(g,y);return S},[t,a.selectedOptions]),s=e.selectedVariant??a,l=!s?.availableForSale,c=s?.price?.amount&&s?.compareAtPrice?.amount&&s?.price?.amount<s?.compareAtPrice?.amount,h=[{merchandiseId:s.id,quantity:1}];return(0,n.jsx)("div",{className:"grid gap-10",children:(0,n.jsxs)("div",{className:"grid gap-4",children:[(0,n.jsx)(ut,{options:e.options,searchParamsWithDefaults:i}),s&&(0,n.jsxs)("div",{className:"grid items-stretch gap-4",children:[(0,n.jsx)(Te,{lines:[{merchandiseId:s.id,quantity:1}],variant:l?"secondary":"primary","data-test":"add-to-cart",children:l?(0,n.jsx)(F,{children:"Sold out"}):(0,n.jsxs)(F,{as:"span",className:"flex items-center justify-center gap-2",children:[(0,n.jsx)("span",{children:"Add to Bag"})," ",(0,n.jsx)("span",{children:"\xB7"})," ",(0,n.jsx)(J,{withoutTrailingZeros:!0,data:s?.price,as:"span"}),c&&(0,n.jsx)(J,{withoutTrailingZeros:!0,data:s?.compareAtPrice,as:"span",className:"opacity-50 strike"})]})}),!l&&(0,n.jsx)(Ce,{variantIds:[s?.id]})]})]})})}function ut({options:e,searchParamsWithDefaults:o}){let r=(0,D.useRef)(null);return(0,n.jsx)(n.Fragment,{children:e.filter(t=>t.values.length>1).map(t=>(0,n.jsxs)("div",{className:"flex flex-col flex-wrap mb-4 gap-y-2 last:mb-0",children:[(0,n.jsx)(W,{as:"legend",size:"lead",className:"min-w-[4rem]",children:t.name}),(0,n.jsx)("div",{className:"flex flex-wrap items-baseline gap-4",children:t.values.length>7?(0,n.jsx)("div",{className:"relative w-full",children:(0,n.jsx)(Q,{children:({open:a})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Q.Button,{ref:r,className:M("flex items-center justify-between w-full py-3 px-4 border border-primary",a?"rounded-b md:rounded-t md:rounded-b-none":"rounded"),children:[(0,n.jsx)("span",{children:o.get(t.name)}),(0,n.jsx)(ke,{direction:a?"up":"down"})]}),(0,n.jsx)(Q.Options,{className:M("border-primary bg-contrast absolute bottom-12 z-30 grid h-48 w-full overflow-y-scroll rounded-t border px-2 py-2 transition-[max-height] duration-150 sm:bottom-auto md:rounded-b md:rounded-t-none md:border-t-0 md:border-b",a?"max-h-48":"max-h-0"),children:t.values.map(i=>(0,n.jsx)(Q.Option,{value:i,children:({active:s})=>(0,n.jsxs)(Qe,{optionName:t.name,optionValue:i,className:M("text-primary w-full p-2 transition rounded flex justify-start items-center text-left cursor-pointer",s&&"bg-primary/10"),searchParams:o,onClick:()=>{!r?.current||r.current.click()},children:[i,o.get(t.name)===i&&(0,n.jsx)("span",{className:"ml-2",children:(0,n.jsx)(Ee,{})})]})},`option-${t.name}-${i}`))})]})})}):(0,n.jsx)(n.Fragment,{children:t.values.map(a=>{let i=o.get(t.name)===a,s=`option-${t.name}-${a}`;return(0,n.jsx)(F,{children:(0,n.jsx)(Qe,{optionName:t.name,optionValue:a,searchParams:o,className:M("leading-none py-1 border-b-[1.5px] cursor-pointer transition-all duration-200",i?"border-primary/50":"border-primary/0")})},s)})})})]},t.name))})}function Qe({optionName:e,optionValue:o,searchParams:r,children:t,...a}){let{pathname:i}=ie(),l=/\/[a-zA-Z]{2}-[a-zA-Z]{2}\//g.test(i)?`/${i.split("/").slice(2).join("/")}`:i,c=new URLSearchParams(r);return c.set(e,o),(0,n.jsx)(X,{...a,prefetch:"intent",replace:!0,to:`${l}?${c.toString()}`,children:t??o})}function ae({title:e,content:o,learnMore:r}){return(0,n.jsx)(G,{as:"div",className:"grid w-full gap-2",children:({open:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(G.Button,{className:"text-left",children:(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)(F,{size:"lead",as:"h4",children:e}),(0,n.jsx)(De,{className:M("transition-transform transform-gpu duration-200",!t&&"rotate-[45deg]")})]})}),(0,n.jsxs)(G.Panel,{className:"pb-4 pt-2 grid gap-2",children:[(0,n.jsx)("div",{className:"prose dark:prose-invert",dangerouslySetInnerHTML:{__html:o}}),r&&(0,n.jsx)("div",{className:"",children:(0,n.jsx)(X,{className:"pb-px border-b border-primary/30 text-primary/50",to:r,children:"Learn more"})})]})]})},e)}var jt=`#graphql
2
- ${Ae}
3
- ${Me}
4
- query Product(
5
- $country: CountryCode
6
- $language: LanguageCode
7
- $handle: String!
8
- $selectedOptions: [SelectedOptionInput!]!
9
- ) @inContext(country: $country, language: $language) {
10
- product(handle: $handle) {
11
- id
12
- title
13
- vendor
14
- handle
15
- descriptionHtml
16
- options {
17
- name
18
- values
19
- }
20
- selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions) {
21
- ...ProductVariantFragment
22
- }
23
- media(first: 7) {
24
- nodes {
25
- ...Media
26
- }
27
- }
28
- variants(first: 1) {
29
- nodes {
30
- ...ProductVariantFragment
31
- }
32
- }
33
- seo {
34
- description
35
- title
36
- }
37
- }
38
- shop {
39
- name
40
- shippingPolicy {
41
- body
42
- handle
43
- }
44
- refundPolicy {
45
- body
46
- handle
47
- }
48
- }
49
- }
50
- `,qt=`#graphql
51
- ${$e}
52
- query productRecommendations(
53
- $productId: ID!
54
- $count: Int
55
- $country: CountryCode
56
- $language: LanguageCode
57
- ) @inContext(country: $country, language: $language) {
58
- recommended: productRecommendations(productId: $productId) {
59
- ...ProductCard
60
- }
61
- additional: products(first: $count, sortKey: BEST_SELLING) {
62
- nodes {
63
- ...ProductCard
64
- }
65
- }
66
- }
67
- `;export{_e as default};
68
- //# sourceMappingURL=/build/routes/($lang)/products/$productHandle-IB2WTXB6.js.map