cloudcommerce 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/.gitmodules +0 -3
  3. package/.vscode/settings.json +1 -2
  4. package/CHANGELOG.md +50 -0
  5. package/action.yml +2 -2
  6. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  7. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  8. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  9. package/ecomplus-stores/barra-doce/package.json +2 -2
  10. package/package.json +7 -7
  11. package/packages/api/lib/api.d.ts +2 -2
  12. package/packages/api/package.json +1 -1
  13. package/packages/api/types.d.ts +4 -1
  14. package/packages/apps/affilate-program/package.json +1 -1
  15. package/packages/apps/correios/package.json +1 -1
  16. package/packages/apps/custom-payment/package.json +1 -1
  17. package/packages/apps/custom-shipping/package.json +1 -1
  18. package/packages/apps/datafrete/package.json +1 -1
  19. package/packages/apps/discounts/package.json +1 -1
  20. package/packages/apps/emails/package.json +1 -1
  21. package/packages/apps/fb-conversions/package.json +1 -1
  22. package/packages/apps/flash-courier/package.json +1 -1
  23. package/packages/apps/frenet/package.json +1 -1
  24. package/packages/apps/galaxpay/package.json +1 -1
  25. package/packages/apps/google-analytics/package.json +1 -1
  26. package/packages/apps/jadlog/package.json +1 -1
  27. package/packages/apps/loyalty-points/package.json +1 -1
  28. package/packages/apps/mandae/package.json +1 -1
  29. package/packages/apps/melhor-envio/package.json +1 -1
  30. package/packages/apps/mercadopago/package.json +1 -1
  31. package/packages/apps/pagarme/package.json +1 -1
  32. package/packages/apps/pagarme-v5/package.json +1 -1
  33. package/packages/apps/paghiper/package.json +1 -1
  34. package/packages/apps/pix/package.json +1 -1
  35. package/packages/apps/tiny-erp/package.json +1 -1
  36. package/packages/apps/webhooks/package.json +1 -1
  37. package/packages/cli/config/firestore.rules +4 -1
  38. package/packages/cli/lib/cli.js +30 -9
  39. package/packages/cli/package.json +2 -1
  40. package/packages/cli/src/cli.ts +37 -9
  41. package/packages/config/package.json +1 -1
  42. package/packages/emails/package.json +1 -1
  43. package/packages/eslint/package.json +3 -3
  44. package/packages/events/package.json +1 -1
  45. package/packages/feeds/package.json +1 -1
  46. package/packages/firebase/package.json +1 -1
  47. package/packages/i18n/package.json +1 -1
  48. package/packages/modules/package.json +1 -1
  49. package/packages/passport/package.json +1 -1
  50. package/packages/ssr/package.json +5 -5
  51. package/packages/storefront/.auto-imports.d.ts +1 -0
  52. package/packages/storefront/client.d.ts +1 -0
  53. package/packages/storefront/config/storefront.tailwind.cjs +21 -20
  54. package/packages/storefront/config/storefront.unocss.cjs +11 -0
  55. package/packages/storefront/dist/client/_astro/{AccountPage.700be123.js → AccountPage.j0C5JBLY.js} +1 -1
  56. package/packages/storefront/dist/client/_astro/{CartSidebar.430b55df.js → CartSidebar.1kUFk9Xn.js} +1 -1
  57. package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +1 -0
  58. package/packages/storefront/dist/client/_astro/{PitchBar.06e0f831.js → PitchBar.FelC04wE.js} +1 -1
  59. package/packages/storefront/dist/client/_astro/{Prices.0e829c31.js → Prices.PuQc6C7F.js} +1 -1
  60. package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +1 -0
  61. package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +7 -0
  62. package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +1 -0
  63. package/packages/storefront/dist/client/_astro/{QuantitySelector.ebf60845.js → QuantitySelector.YNmWjN8y.js} +1 -1
  64. package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +1 -0
  65. package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +1 -0
  66. package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +10 -0
  67. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +1 -0
  68. package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +1 -0
  69. package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +1 -0
  70. package/packages/storefront/dist/client/_astro/customer-session._VkzXnXT.js +7 -0
  71. package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +1 -0
  72. package/packages/storefront/dist/client/_astro/{firebase-app.992a296f.js → firebase-app.cPMfoOsn.js} +1 -1
  73. package/packages/storefront/dist/client/_astro/{format-money.9cf6b04d.js → format-money.FMQXgKHB.js} +1 -1
  74. package/packages/storefront/dist/client/_astro/{hoisted.c90fc6ab.js → hoisted.B6fKrLPR.js} +1 -1
  75. package/packages/storefront/dist/client/_astro/{hoisted.54eaab04.js → hoisted._FbzheVm.js} +1 -1
  76. package/packages/storefront/dist/client/_astro/{i18n.29216eeb.js → i18n.m7SpISxy.js} +1 -1
  77. package/packages/storefront/dist/client/_astro/{img.4f23a3dd.js → img.zh-Drf-O.js} +1 -1
  78. package/packages/storefront/dist/client/_astro/{index-61e5ac61.bdc8d0cd.js → index-dd468b12.D5s8VdAL.js} +92 -107
  79. package/packages/storefront/dist/client/_astro/{index.570b84fe.js → index.5PN-EYMS.js} +1 -1
  80. package/packages/storefront/dist/client/_astro/index.XrHFaN2F.js +1 -0
  81. package/packages/storefront/dist/client/_astro/{modules-info.55780599.js → modules-info.sD0tdb2b.js} +1 -1
  82. package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +1 -0
  83. package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.c157838f.js → photoswipe-lightbox.esm.dZBqKD9u.js} +1 -1
  84. package/packages/storefront/dist/client/_astro/{photoswipe.01431ec7.js → photoswipe.0V7m2jWu.js} +1 -2
  85. package/packages/storefront/dist/client/_astro/{photoswipe.esm.92c2d901.js → photoswipe.esm.Ylh9TGkz.js} +1 -1
  86. package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +1 -0
  87. package/packages/storefront/dist/client/_astro/{shopping-cart.d9f601dd.js → shopping-cart.A-1jhlKi.js} +1 -1
  88. package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +1 -0
  89. package/packages/storefront/dist/client/_astro/{use-product-card.437911bb.js → use-product-card.erbOV6Fv.js} +1 -1
  90. package/packages/storefront/dist/client/robots.txt +1 -0
  91. package/packages/storefront/dist/server/chunks/{CartSidebar_eab28771.mjs → CartSidebar_hAgJQJgm.mjs} +1 -1
  92. package/packages/storefront/dist/server/chunks/SearchModal_eWb5SdQM.mjs +351 -0
  93. package/packages/storefront/dist/server/chunks/{_.._5a781fb3.mjs → _.._S7DDBn_b.mjs} +1 -1
  94. package/packages/storefront/dist/server/chunks/{account_519edb70.mjs → account_3ySmGzMc.mjs} +1 -1
  95. package/packages/storefront/dist/server/chunks/astro/{assets-service_a9d9ab5f.mjs → assets-service_QlOZG8ov.mjs} +1 -1
  96. package/packages/storefront/dist/server/chunks/{astro_d98f7186.mjs → astro_zcC1GStV.mjs} +17 -34
  97. package/packages/storefront/dist/server/chunks/{index_5e3ed8a0.mjs → index_nIwq11oA.mjs} +1 -1
  98. package/packages/storefront/dist/server/chunks/{index_10e14f85.mjs → index_uAR5ZV4d.mjs} +1 -1
  99. package/packages/storefront/dist/server/chunks/{node_1119b0d1.mjs → node_2VvC7trl.mjs} +1 -1
  100. package/packages/storefront/dist/server/chunks/pages/{__93ade2dd.mjs → __MSibDuuV.mjs} +652 -255
  101. package/packages/storefront/dist/server/chunks/pages/{account_e5d410a7.mjs → account_iG-YqJ5q.mjs} +3 -2
  102. package/packages/storefront/dist/server/chunks/pages/{index_7e25afc1.mjs → index_BtDyKPh_.mjs} +3 -2
  103. package/packages/storefront/dist/server/chunks/pages/{node_bd378ac0.mjs → node_bKqL47eZ.mjs} +2 -2
  104. package/packages/storefront/dist/server/chunks/pages/{~fallback_73578d2f.mjs → ~fallback_73R5VA6j.mjs} +3 -2
  105. package/packages/storefront/dist/server/chunks/{photoswipe_9528923e.mjs → photoswipe_IcWDJiwc.mjs} +1 -1
  106. package/packages/storefront/dist/server/chunks/{~fallback_41122b9b.mjs → ~fallback_7q1dqY4e.mjs} +1 -1
  107. package/packages/storefront/dist/server/entry.mjs +970 -93
  108. package/packages/storefront/dist/server/manifest_dSwvaOdW.mjs +195 -0
  109. package/packages/storefront/dist/server/renderers.mjs +2 -2
  110. package/packages/storefront/package.json +13 -13
  111. package/packages/storefront/src/helpers/sf-utils.ts +37 -6
  112. package/packages/storefront/src/lib/composables/use-search-container.ts +48 -0
  113. package/packages/storefront/src/lib/composables/use-search-modal.ts +31 -27
  114. package/packages/storefront/src/lib/composables/use-shop-header.ts +78 -1
  115. package/packages/storefront/src/lib/composables/use-sticky-header.ts +2 -0
  116. package/packages/storefront/src/lib/layouts/BaseHead.astro +8 -1
  117. package/packages/storefront/src/lib/layouts/use-page-main.ts +15 -0
  118. package/packages/storefront/src/lib/scripts/firestore.ts +27 -0
  119. package/packages/storefront/src/lib/ssr-context.ts +14 -0
  120. package/packages/storefront/src/lib/state/search-engine.ts +80 -27
  121. package/packages/storefront/src/lib/state/use-analytics.ts +36 -21
  122. package/packages/test-base/package.json +1 -1
  123. package/packages/types/package.json +1 -1
  124. package/ecomplus-stores/monocard/.devcontainer/devcontainer.json +0 -30
  125. package/ecomplus-stores/monocard/.editorconfig +0 -13
  126. package/ecomplus-stores/monocard/.eslintrc.cjs +0 -3
  127. package/ecomplus-stores/monocard/.firebaserc +0 -5
  128. package/ecomplus-stores/monocard/.github/build-and-deploy +0 -1
  129. package/ecomplus-stores/monocard/.github/renovate.json +0 -5
  130. package/ecomplus-stores/monocard/.github/workflows/build-and-deploy.yml +0 -37
  131. package/ecomplus-stores/monocard/.github/workflows/calibreapp-image-actions.yml +0 -23
  132. package/ecomplus-stores/monocard/.gitpod.yml +0 -12
  133. package/ecomplus-stores/monocard/.idx/dev.nix +0 -24
  134. package/ecomplus-stores/monocard/.nvmrc +0 -1
  135. package/ecomplus-stores/monocard/.vscode/extensions.json +0 -8
  136. package/ecomplus-stores/monocard/.vscode/launch.json +0 -11
  137. package/ecomplus-stores/monocard/.vscode/settings.json +0 -13
  138. package/ecomplus-stores/monocard/LICENSE.md +0 -230
  139. package/ecomplus-stores/monocard/README.md +0 -31
  140. package/ecomplus-stores/monocard/SETUP.md +0 -129
  141. package/ecomplus-stores/monocard/SETUP.pt-BR.md +0 -129
  142. package/ecomplus-stores/monocard/functions/config.json +0 -3
  143. package/ecomplus-stores/monocard/functions/example.env +0 -10
  144. package/ecomplus-stores/monocard/functions/many/index.js +0 -14
  145. package/ecomplus-stores/monocard/functions/many/package.json +0 -22
  146. package/ecomplus-stores/monocard/functions/ssr/.eslintrc.cjs +0 -6
  147. package/ecomplus-stores/monocard/functions/ssr/astro.config.mjs +0 -4
  148. package/ecomplus-stores/monocard/functions/ssr/content/blog/.gitkeep +0 -0
  149. package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/terms.json +0 -11
  150. package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/trocas.json +0 -11
  151. package/ecomplus-stores/monocard/functions/ssr/content/layout.json +0 -52
  152. package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +0 -20
  153. package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +0 -18
  154. package/ecomplus-stores/monocard/functions/ssr/content/settings.json +0 -78
  155. package/ecomplus-stores/monocard/functions/ssr/index.js +0 -18
  156. package/ecomplus-stores/monocard/functions/ssr/package.json +0 -36
  157. package/ecomplus-stores/monocard/functions/ssr/public/admin/.gitkeep +0 -0
  158. package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/img_1.png +0 -0
  159. package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/img_1.webp +0 -0
  160. package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/phone-nfc.json +0 -1
  161. package/ecomplus-stores/monocard/functions/ssr/public/img/icon.png +0 -0
  162. package/ecomplus-stores/monocard/functions/ssr/public/img/large-icon.png +0 -0
  163. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/card-phone.png +0 -0
  164. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/devices.jpg +0 -0
  165. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  166. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/edit-suit.jpg +0 -0
  167. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/favicon.png +0 -0
  168. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/icon.png +0 -0
  169. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/large-icon.png +0 -0
  170. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-arcelor-mittal.webp +0 -0
  171. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-azul.webp +0 -0
  172. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-banco-pan.webp +0 -0
  173. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-brinks.webp +0 -0
  174. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-mastercard.webp +0 -0
  175. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-pfizer.webp +0 -0
  176. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-prudential.webp +0 -0
  177. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-unimed.webp +0 -0
  178. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo.webp +0 -0
  179. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/mockup-editar.png +0 -0
  180. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/og-image.png +0 -0
  181. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/padronagem-tilada.png +0 -0
  182. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/qrcode-camera.png +0 -0
  183. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/sua-logo-aqui.png +0 -0
  184. package/ecomplus-stores/monocard/functions/ssr/public/robots.txt +0 -6
  185. package/ecomplus-stores/monocard/functions/ssr/scripts/build.sh +0 -14
  186. package/ecomplus-stores/monocard/functions/ssr/src/assets/card.css +0 -99
  187. package/ecomplus-stores/monocard/functions/ssr/src/assets/style.css +0 -79
  188. package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +0 -97
  189. package/ecomplus-stores/monocard/functions/ssr/src/components/AccountPage.vue +0 -62
  190. package/ecomplus-stores/monocard/functions/ssr/src/components/Banner.vue +0 -59
  191. package/ecomplus-stores/monocard/functions/ssr/src/components/BannersGrid.astro +0 -25
  192. package/ecomplus-stores/monocard/functions/ssr/src/components/Breadcrumbs.astro +0 -44
  193. package/ecomplus-stores/monocard/functions/ssr/src/components/CartItem.vue +0 -64
  194. package/ecomplus-stores/monocard/functions/ssr/src/components/CartSidebar.vue +0 -69
  195. package/ecomplus-stores/monocard/functions/ssr/src/components/CasesGrid.astro +0 -49
  196. package/ecomplus-stores/monocard/functions/ssr/src/components/CheckoutPage.vue +0 -33
  197. package/ecomplus-stores/monocard/functions/ssr/src/components/Collapse.vue +0 -19
  198. package/ecomplus-stores/monocard/functions/ssr/src/components/DemoVideo.vue +0 -10
  199. package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +0 -28
  200. package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +0 -286
  201. package/ecomplus-stores/monocard/functions/ssr/src/components/FeaturesSection.astro +0 -28
  202. package/ecomplus-stores/monocard/functions/ssr/src/components/FooterStamps.vue +0 -63
  203. package/ecomplus-stores/monocard/functions/ssr/src/components/ImagesGallery.vue +0 -154
  204. package/ecomplus-stores/monocard/functions/ssr/src/components/LoginForm.vue +0 -107
  205. package/ecomplus-stores/monocard/functions/ssr/src/components/LottiePhoneNFC.vue +0 -20
  206. package/ecomplus-stores/monocard/functions/ssr/src/components/MonocardCustomizer.vue +0 -261
  207. package/ecomplus-stores/monocard/functions/ssr/src/components/PitchBar.vue +0 -61
  208. package/ecomplus-stores/monocard/functions/ssr/src/components/Prices.vue +0 -95
  209. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductCard.vue +0 -117
  210. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductDetails.vue +0 -122
  211. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductShelf.vue +0 -57
  212. package/ecomplus-stores/monocard/functions/ssr/src/components/ProductSpecifications.vue +0 -42
  213. package/ecomplus-stores/monocard/functions/ssr/src/components/SearchModal.vue +0 -6
  214. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +0 -71
  215. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +0 -137
  216. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeaderMenu.vue +0 -92
  217. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenav.vue +0 -64
  218. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenavCategory.vue +0 -77
  219. package/ecomplus-stores/monocard/functions/ssr/src/components/SkuSelector.vue +0 -58
  220. package/ecomplus-stores/monocard/functions/ssr/src/env.d.ts +0 -13
  221. package/ecomplus-stores/monocard/functions/ssr/src/layouts/Base.astro +0 -15
  222. package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +0 -53
  223. package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageHeader.astro +0 -35
  224. package/ecomplus-stores/monocard/functions/ssr/src/main/Fallback.astro +0 -10
  225. package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +0 -95
  226. package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +0 -52
  227. package/ecomplus-stores/monocard/functions/ssr/src/main/Wildcard.astro +0 -18
  228. package/ecomplus-stores/monocard/functions/ssr/src/pages/[...slug].astro +0 -42
  229. package/ecomplus-stores/monocard/functions/ssr/src/pages/_vue.ts +0 -10
  230. package/ecomplus-stores/monocard/functions/ssr/src/pages/app/account.astro +0 -34
  231. package/ecomplus-stores/monocard/functions/ssr/src/pages/app/index.astro +0 -62
  232. package/ecomplus-stores/monocard/functions/ssr/src/pages/comprar/index.astro +0 -52
  233. package/ecomplus-stores/monocard/functions/ssr/src/pages/index.astro +0 -32
  234. package/ecomplus-stores/monocard/functions/ssr/src/pages/~fallback.astro +0 -23
  235. package/ecomplus-stores/monocard/functions/ssr/src/scripts/InlineScripts.astro +0 -10
  236. package/ecomplus-stores/monocard/functions/ssr/tailwind.config.cjs +0 -18
  237. package/ecomplus-stores/monocard/functions/ssr/tsconfig.json +0 -12
  238. package/ecomplus-stores/monocard/functions/ssr/uno.config.cjs +0 -5
  239. package/ecomplus-stores/monocard/functions/with-apps/index.js +0 -12
  240. package/ecomplus-stores/monocard/functions/with-apps/package.json +0 -22
  241. package/ecomplus-stores/monocard/package.json +0 -31
  242. package/ecomplus-stores/monocard/scripts/install.sh +0 -24
  243. package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +0 -1
  244. package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +0 -1
  245. package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +0 -1
  246. package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +0 -1
  247. package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +0 -1
  248. package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +0 -4
  249. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +0 -1
  250. package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +0 -1
  251. package/packages/storefront/dist/client/_astro/client.41b42098.js +0 -1
  252. package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +0 -1
  253. package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +0 -1
  254. package/packages/storefront/dist/client/_astro/index.8ac1db99.js +0 -1
  255. package/packages/storefront/dist/client/_astro/name.01410784.js +0 -1
  256. package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +0 -1
  257. package/packages/storefront/dist/client/_astro/use-analytics.cc95e346.js +0 -1
  258. package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +0 -147
  259. package/packages/storefront/dist/server/manifest_221d806b.mjs +0 -1069
  260. /package/packages/storefront/dist/client/_astro/{afetch.f4507208.js → afetch.5c8VmT0-.js} +0 -0
  261. /package/packages/storefront/dist/client/_astro/{img-sizes.41e0efe4.js → img-sizes.gxAI9JNh.js} +0 -0
  262. /package/packages/storefront/dist/client/_astro/{price.04ceb6c4.js → price.Easct8WC.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import '@astrojs/internal-helpers/path';
2
- import { e as createAstro, f as createComponent, A as AstroError, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot, F as Fragment } from '../astro_d98f7186.mjs';
2
+ import { e as createAstro, f as createComponent, A as AstroError, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot, F as Fragment } from '../astro_zcC1GStV.mjs';
3
+ import 'kleur/colors';
3
4
  import api from '@cloudcommerce/api';
4
5
  import { EventEmitter } from 'node:events';
5
6
  import fs, { copyFileSync } from 'node:fs';
@@ -7,13 +8,14 @@ import { resolve, join, basename as basename$1 } from 'node:path';
7
8
  import config from '@cloudcommerce/config';
8
9
  import { img, price, formatMoney, randomObjectId, nickname, inStock, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue, gridTitle, specValueByText } from '@ecomplus/utils';
9
10
  import 'clsx';
10
- /* empty css */import { renderSync, parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
11
+ /* empty css */
12
+ import { renderSync, parse, ELEMENT_NODE, walkSync } from 'ultrahtml';
11
13
  import mime from 'mime/lite.js';
12
- import { i as isESMImportedImage, g as getImage$1 } from '../astro/assets-service_a9d9ab5f.mjs';
14
+ import { i as isESMImportedImage, g as getImage$1 } from '../astro/assets-service_QlOZG8ov.mjs';
13
15
  import imageSize from 'image-size';
14
16
  import { reactive, computed, shallowRef, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, withDirectives, createVNode, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, watch, ref, toRef, nextTick, withModifiers, renderSlot as renderSlot$1, Teleport, resolveDynamicComponent, onMounted, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, inject, provide } from 'vue';
15
17
  import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrRenderTeleport, ssrRenderVNode, ssrInterpolate, ssrRenderSuspense } from 'vue/server-renderer';
16
- import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, onClickOutside, watchOnce, useElementHover, createReusableTemplate, useUrlSearchParams } from '@vueuse/core';
18
+ import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, watchOnce, onClickOutside, useElementHover, createReusableTemplate, useUrlSearchParams } from '@vueuse/core';
17
19
  import mitt from 'mitt';
18
20
  import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
19
21
 
@@ -94,6 +96,24 @@ const imageConfig = {"service":{"entrypoint":"astro/assets/services/sharp","conf
94
96
  const assetsDir = new URL("file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/dist/client/");
95
97
  const getImage = async (options) => await getImage$1(options, imageConfig);
96
98
 
99
+ let id = -1;
100
+ const useId = () => String(++id);
101
+ const clearAccents = (str) => {
102
+ return str.replace(/[ÁáÃãÂâÀà]/g, "a").replace(/[ÉéÊê]/g, "e").replace(/[Íí]/g, "i").replace(/[ÕõÓóÔô]/g, "o").replace(/[Úú]/g, "u").replace(/[Çç]/g, "c");
103
+ };
104
+ const slugify = (str) => {
105
+ return clearAccents(str.trim()).toLowerCase().replace(/[\W\r\n]/gm, "-").replace(/-{2,}/g, "-").replace(/(^-)|(-$)/g, "");
106
+ };
107
+ const toLowerCaseAccents = (str) => {
108
+ return str.toLowerCase().replace(/Á/g, "á").replace(/Ã/g, "ã").replace(/Â/g, "â").replace(/À/g, "à").replace(/É/g, "é").replace(/Ê/g, "ê").replace(/Í/g, "í").replace(/Õ/g, "õ").replace(/Ó/g, "ó").replace(/Ô/g, "ô").replace(/Ú/g, "ú").replace(/Ç/g, "ç");
109
+ };
110
+ const termify = (str) => {
111
+ return toLowerCaseAccents(str.trim()).replace(/[\r\n]/gm, " ").replace(/[^\w-&%áãâàéêíõóôúç]/g, " ").replace(/\s{2,}/g, " ");
112
+ };
113
+ const getSearchUrl = (term, baseUrl = "/s/") => {
114
+ return `${baseUrl}${encodeURIComponent(termify(term))}`;
115
+ };
116
+
97
117
  global.__storefrontCMS = (fs, resolvePath) => {
98
118
  const { STOREFRONT_BASE_DIR } = process.env;
99
119
  let baseDir;
@@ -174,37 +194,34 @@ const _getConfig = () => {
174
194
  const {
175
195
  ECOM_STORE_ID,
176
196
  VITE_ECOM_STORE_ID,
177
- PROD,
178
- } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://demo.ecomplus.app","ASSETS_PREFIX":undefined},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
197
+ PROD
198
+ } = Object.assign({"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}, { ECOM_STORE_ID: process.env.ECOM_STORE_ID }) || process.env;
179
199
  if (VITE_ECOM_STORE_ID) {
180
200
  config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
181
201
  } else if (ECOM_STORE_ID) {
182
202
  config.set({ storeId: Number(ECOM_STORE_ID) });
183
203
  }
184
-
185
204
  const {
186
205
  domain,
187
206
  primaryColor,
188
207
  secondaryColor,
189
208
  settings,
190
- getContent,
209
+ getContent
191
210
  } = global.__storefrontCMS(fs, resolve);
192
211
  config.set({ settingsContent: settings });
193
-
194
212
  let { storeId } = config.get();
195
213
  if (!storeId) {
196
- const configFilepath = join(process.cwd(), 'config.json');
214
+ const configFilepath = join(process.cwd(), "config.json");
197
215
  try {
198
- const mergeConfig = JSON.parse(fs.readFileSync(configFilepath), 'utf8');
216
+ const mergeConfig = JSON.parse(fs.readFileSync(configFilepath), "utf8");
199
217
  if (mergeConfig.storeId) {
200
218
  storeId = mergeConfig.storeId;
201
219
  }
202
220
  } catch {
203
- //
204
221
  }
205
222
  if (!storeId && !PROD) {
206
223
  storeId = 1011;
207
- console.warn('> `storeId` is not set, using fallback 1011 for dev only\n');
224
+ console.warn("> `storeId` is not set, using fallback 1011 for dev only\n");
208
225
  }
209
226
  if (storeId) {
210
227
  config.set({ storeId });
@@ -214,9 +231,8 @@ const _getConfig = () => {
214
231
  lang,
215
232
  countryCode,
216
233
  currency,
217
- currencySymbol,
234
+ currencySymbol
218
235
  } = config.get();
219
-
220
236
  return {
221
237
  storeId,
222
238
  lang,
@@ -227,7 +243,7 @@ const _getConfig = () => {
227
243
  primaryColor,
228
244
  secondaryColor,
229
245
  settings,
230
- getContent,
246
+ getContent
231
247
  };
232
248
  };
233
249
 
@@ -278,6 +294,14 @@ const loadRouteContext = async (Astro, {
278
294
  urlPath = urlPath.replace("/~preview", "");
279
295
  }
280
296
  const isHomepage = urlPath === "/";
297
+ const isSearchPage = !isHomepage && (urlPath.startsWith("/s/") || urlPath === "/s");
298
+ let searchPageTerm;
299
+ if (isSearchPage) {
300
+ const pathTerm = urlPath.split("/")[2];
301
+ if (typeof pathTerm === "string") {
302
+ searchPageTerm = termify(decodeURIComponent(pathTerm));
303
+ }
304
+ }
281
305
  const config = getConfig();
282
306
  globalThis.$storefront.settings = config.settings;
283
307
  let cmsContent = { sections: [] };
@@ -296,6 +320,8 @@ const loadRouteContext = async (Astro, {
296
320
  const { slug } = Astro.params;
297
321
  if (isHomepage) {
298
322
  cmsContent = await config.getContent("pages/home");
323
+ } else if (isSearchPage) {
324
+ cmsContent = await config.getContent("pages/search");
299
325
  } else if (slug && typeof slug === "string") {
300
326
  if (contentCollection) {
301
327
  cmsContent = await config.getContent(`${contentCollection}/${slug}`);
@@ -391,11 +417,14 @@ const loadRouteContext = async (Astro, {
391
417
  const routeContext = {
392
418
  ...config,
393
419
  isHomepage,
420
+ isSearchPage,
421
+ searchPageTerm,
394
422
  cmsContent,
395
423
  fetchingApiContext,
396
424
  apiContext,
397
425
  apiState,
398
426
  isPreview
427
+ // Astro,
399
428
  };
400
429
  Astro.locals.routeContext = routeContext;
401
430
  emitter$1.emit("load", routeContext);
@@ -426,12 +455,13 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
426
455
  Astro2.self = $$BaseHead;
427
456
  const isPWA = pwaInfo !== false;
428
457
  const hasViewTransitions = Astro2.props.hasViewTransitions !== false && !Astro2.url.pathname.startsWith("/app/");
429
- const deployRand = ({}).DEPLOY_RAND || "_";
458
+ const deployRand = {"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.DEPLOY_RAND || "_";
430
459
  const getIconUrl = (size) => {
431
460
  return `/_image?f=png&w=${size}&h=${size}&href=${encodeURIComponent(settings.icon)}&V=${deployRand}`;
432
461
  };
433
462
  const {
434
463
  storeId,
464
+ searchPageTerm,
435
465
  cmsContent,
436
466
  fetchingApiContext,
437
467
  apiContext,
@@ -450,7 +480,13 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
450
480
  }
451
481
  const apiDoc = apiContext.doc;
452
482
  const state = apiDoc || cmsContent || {};
453
- const title = state.meta_title || state.metaTitle || state.name && `${state.name} | ${settings.name}` || state.title && `${state.title} | ${settings.name}` || settings.name;
483
+ let title = state.meta_title || state.metaTitle || state.name && `${state.name} | ${settings.name}` || state.title && `${state.title} | ${settings.name}` || settings.name;
484
+ if (searchPageTerm) {
485
+ title = title.replace("$term", searchPageTerm);
486
+ if (!title.includes(searchPageTerm)) {
487
+ title = `${searchPageTerm} | ${title}`;
488
+ }
489
+ }
454
490
  const description = state.meta_description || state.metaDescription || state.short_description || settings.description;
455
491
  const favicon = settings.icon ? getIconUrl(32) : "/favicon.ico";
456
492
  const shortcutIcon = settings.icon ? getIconUrl(192) : null;
@@ -542,7 +578,7 @@ window.$isCmsPreview = true;`;
542
578
  url: `https://${domain}/`,
543
579
  logo: `https://${domain}${settings.logo}`
544
580
  });
545
- return renderTemplate(_c || (_c = __template$4(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n\n<script", ">", '<\/script>\n<script type="application/ld+json">', "<\/script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "23j4qrxj"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$4(["<script>", "<\/script>"])), unescapeHTML(contextInlineClientJS)));
581
+ return renderTemplate(_c || (_c = __template$4(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n", "\n\n<script", ">", '</script>\n<script type="application/ld+json">', "</script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "23j4qrxj"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$4(["<script>", "</script>"])), unescapeHTML(contextInlineClientJS)));
546
582
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", "self");
547
583
 
548
584
  function has(value) {
@@ -931,15 +967,15 @@ const $$Astro$d = createAstro("https://demo.ecomplus.app");
931
967
  const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
932
968
  const Astro2 = $$result.createAstro($$Astro$d, $$props, $$slots);
933
969
  Astro2.self = $$Picture;
934
- const deployRand = ({}).DEPLOY_RAND;
935
- const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
970
+ const deployRand = {"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.DEPLOY_RAND;
971
+ const versionSuffix = {"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
936
972
  const getImageFilepath = (src) => {
937
973
  const filepath = resolve(process.env.STOREFRONT_BASE_DIR, `public${src}`);
938
- if (({}).BUILD_OUTPUT === "static") {
974
+ if ({"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.BUILD_OUTPUT === "static") {
939
975
  try {
940
976
  copyFileSync(filepath, resolve(
941
977
  process.env.STOREFRONT_BASE_DIR,
942
- ({}).BUILD_OUT_DIR || "dist/client",
978
+ {"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.BUILD_OUT_DIR || "dist/client",
943
979
  "_astro",
944
980
  basename$1(filepath)
945
981
  ));
@@ -1148,12 +1184,6 @@ const setSocialNetworks = () => {
1148
1184
  global.$storefront.onLoad(() => setSocialNetworks());
1149
1185
  }
1150
1186
 
1151
- let id = -1;
1152
- const useId = () => String(++id);
1153
- const slugify = (str) => {
1154
- return str.toLowerCase().trim().replace(/[ÁáÃãÂâÀà]/g, "a").replace(/[Éé]/g, "e").replace(/[Íí]/g, "i").replace(/[ÓóÔô]/g, "o").replace(/[Úú]/g, "u").replace(/[Çç]/g, "c").replace(/[\W\r\n]/gm, "-").replace(/-{2,}/g, "-").replace(/(^-)|(-$)/g, "");
1155
- };
1156
-
1157
1187
  const emptyInfo = {
1158
1188
  list_payments: {},
1159
1189
  calculate_shipping: {},
@@ -1296,7 +1326,7 @@ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
1296
1326
  };
1297
1327
  };
1298
1328
 
1299
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
1329
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
1300
1330
  __name: "PitchBar",
1301
1331
  props: {
1302
1332
  slides: {}
@@ -1313,7 +1343,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1313
1343
  return __returned__;
1314
1344
  }
1315
1345
  });
1316
- function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1346
+ function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1317
1347
  const _component_Carousel = resolveComponent("Carousel");
1318
1348
  const _component_ALink = resolveComponent("ALink");
1319
1349
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -1406,13 +1436,13 @@ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1406
1436
  }, _parent));
1407
1437
  _push(`</div></div>`);
1408
1438
  }
1409
- const _sfc_setup$r = _sfc_main$r.setup;
1410
- _sfc_main$r.setup = (props, ctx) => {
1439
+ const _sfc_setup$t = _sfc_main$t.setup;
1440
+ _sfc_main$t.setup = (props, ctx) => {
1411
1441
  const ssrContext = useSSRContext();
1412
1442
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
1413
- return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
1443
+ return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
1414
1444
  };
1415
- const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
1445
+ const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
1416
1446
 
1417
1447
  const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
1418
1448
  if (!storage) {
@@ -1512,11 +1542,12 @@ const parseProduct = (product, variationId, quantity) => {
1512
1542
  return item;
1513
1543
  };
1514
1544
 
1515
- const storageKey$1 = "ecomShoppingCart";
1545
+ const storageKey$2 = "ecomShoppingCart";
1516
1546
  const emptyCart = {
1547
+ subtotal: 0,
1517
1548
  items: []
1518
1549
  };
1519
- const shoppingCart = useStorage(storageKey$1, emptyCart);
1550
+ const shoppingCart = useStorage(storageKey$2, emptyCart);
1520
1551
  const totalItems = computed(() => {
1521
1552
  return shoppingCart.items.reduce((acc, item) => {
1522
1553
  return acc + item.quantity;
@@ -1681,6 +1712,7 @@ const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = fa
1681
1712
  const useShopHeader = (props) => {
1682
1713
  const {
1683
1714
  header,
1715
+ searchInput,
1684
1716
  categories = globalThis.$storefront.data.categories || [],
1685
1717
  menuCategorySlugs,
1686
1718
  menuRandomCategories = 7,
@@ -1722,6 +1754,56 @@ const useShopHeader = (props) => {
1722
1754
  }
1723
1755
  return false;
1724
1756
  });
1757
+ const isSearchOpen = ref(false);
1758
+ const isSearchOpenOnce = ref(false);
1759
+ watchOnce(isSearchOpen, () => {
1760
+ isSearchOpenOnce.value = true;
1761
+ });
1762
+ const searchTerm = ref("");
1763
+ let urlSearchQ;
1764
+ const quickSearchTerm = computed(() => {
1765
+ if (searchTerm.value && searchTerm.value.length >= 2 && searchTerm.value !== urlSearchQ) {
1766
+ return searchTerm.value;
1767
+ }
1768
+ return "";
1769
+ });
1770
+ const toggleSearch = (ev) => {
1771
+ ev.preventDefault();
1772
+ if (isSearchOpen.value && searchTerm.value) {
1773
+ window.location.href = getSearchUrl(searchTerm.value);
1774
+ return;
1775
+ }
1776
+ isSearchOpen.value = !isSearchOpen.value;
1777
+ if (isSearchOpen.value && searchInput) {
1778
+ setTimeout(() => {
1779
+ if (!searchInput.value)
1780
+ return;
1781
+ const { length } = searchTerm.value;
1782
+ searchInput.value.setSelectionRange(length, length);
1783
+ searchInput.value.focus();
1784
+ }, 50);
1785
+ }
1786
+ };
1787
+ const isCartOpen = ref(false);
1788
+ const isCartOpenOnce = ref(false);
1789
+ watchOnce(isCartOpen, () => {
1790
+ isCartOpenOnce.value = true;
1791
+ });
1792
+ const delayedCartItems = ref(0);
1793
+ const handleOnMounted = () => {
1794
+ watch(totalItems, (newTotalItems, prevTotalItems) => {
1795
+ if (typeof prevTotalItems === "number") {
1796
+ if (prevTotalItems < newTotalItems) {
1797
+ isCartOpen.value = true;
1798
+ } else if (prevTotalItems && !newTotalItems) {
1799
+ isCartOpen.value = false;
1800
+ }
1801
+ }
1802
+ delayedCartItems.value = newTotalItems;
1803
+ }, {
1804
+ immediate: true
1805
+ });
1806
+ };
1725
1807
  return {
1726
1808
  isSticky,
1727
1809
  staticHeight,
@@ -1731,11 +1813,20 @@ const useShopHeader = (props) => {
1731
1813
  getSubcategories,
1732
1814
  getCategoryTree,
1733
1815
  categoryTrees,
1734
- inlineMenuTrees
1816
+ inlineMenuTrees,
1817
+ isSearchOpen,
1818
+ isSearchOpenOnce,
1819
+ searchTerm,
1820
+ quickSearchTerm,
1821
+ toggleSearch,
1822
+ isCartOpen,
1823
+ isCartOpenOnce,
1824
+ cartTotalItems: delayedCartItems,
1825
+ handleOnMounted
1735
1826
  };
1736
1827
  };
1737
1828
 
1738
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
1829
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1739
1830
  __name: "Drawer",
1740
1831
  props: {
1741
1832
  modelValue: { type: Boolean, default: false },
@@ -1833,7 +1924,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
1833
1924
  return __returned__;
1834
1925
  }
1835
1926
  });
1836
- function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1927
+ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1837
1928
  const _component_Fade = resolveComponent("Fade");
1838
1929
  _push(ssrRenderComponent(_component_Fade, mergeProps({
1839
1930
  slide: $setup.slideTo,
@@ -1932,7 +2023,7 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1932
2023
  renderSlot$1(_ctx.$slots, "close", {}, () => [
1933
2024
  createVNode("i", { class: "i-close text-base-400 hover:text-base-600 text-3xl" })
1934
2025
  ])
1935
- ], 10, ["onClick"])) : createCommentVNode("", true),
2026
+ ], 2)) : createCommentVNode("", true),
1936
2027
  renderSlot$1(_ctx.$slots, "default")
1937
2028
  ]),
1938
2029
  $props.backdropTarget ? (openBlock(), createBlock(Teleport, {
@@ -1959,15 +2050,15 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1959
2050
  _: 3
1960
2051
  }, _parent));
1961
2052
  }
1962
- const _sfc_setup$q = _sfc_main$q.setup;
1963
- _sfc_main$q.setup = (props, ctx) => {
2053
+ const _sfc_setup$s = _sfc_main$s.setup;
2054
+ _sfc_main$s.setup = (props, ctx) => {
1964
2055
  const ssrContext = useSSRContext();
1965
2056
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
1966
- return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
2057
+ return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
1967
2058
  };
1968
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
2059
+ const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
1969
2060
 
1970
- const storageKey = "ecomSession";
2061
+ const storageKey$1 = "ecomSession";
1971
2062
  const emptySession = {
1972
2063
  customer: {
1973
2064
  display_name: "",
@@ -1975,7 +2066,7 @@ const emptySession = {
1975
2066
  },
1976
2067
  auth: null
1977
2068
  };
1978
- const session = useStorage(storageKey, emptySession);
2069
+ const session = useStorage(storageKey$1, emptySession);
1979
2070
  const isAuthenticated = computed(() => {
1980
2071
  const { auth } = session;
1981
2072
  return auth && new Date(auth.expires).getTime() - Date.now() > 1e3 * 10;
@@ -1997,14 +2088,14 @@ const isLogged = computed(() => {
1997
2088
  const logout = () => {
1998
2089
  session.auth = emptySession.auth;
1999
2090
  session.customer = emptySession.customer;
2000
- localStorage.removeItem(storageKey);
2091
+ localStorage.removeItem(storageKey$1);
2001
2092
  firebaseAuth.signOut();
2002
2093
  };
2003
2094
  const initializeFirebaseAuth = (canWaitIdle) => {
2004
2095
  return;
2005
2096
  };
2006
2097
 
2007
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
2098
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2008
2099
  __name: "AccountLink",
2009
2100
  props: {
2010
2101
  to: {},
@@ -2039,20 +2130,20 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2039
2130
  return __returned__;
2040
2131
  }
2041
2132
  });
2042
- function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2133
+ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2043
2134
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
2044
2135
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
2045
2136
  _push(`</a>`);
2046
2137
  }
2047
- const _sfc_setup$p = _sfc_main$p.setup;
2048
- _sfc_main$p.setup = (props, ctx) => {
2138
+ const _sfc_setup$r = _sfc_main$r.setup;
2139
+ _sfc_main$r.setup = (props, ctx) => {
2049
2140
  const ssrContext = useSSRContext();
2050
2141
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
2051
- return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
2142
+ return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
2052
2143
  };
2053
- const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
2144
+ const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
2054
2145
 
2055
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
2146
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2056
2147
  __name: "SocialNetworkIcon",
2057
2148
  props: {
2058
2149
  as: { default: "i" },
@@ -2088,18 +2179,18 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2088
2179
  return __returned__;
2089
2180
  }
2090
2181
  });
2091
- function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2182
+ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2092
2183
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
2093
2184
  }
2094
- const _sfc_setup$o = _sfc_main$o.setup;
2095
- _sfc_main$o.setup = (props, ctx) => {
2185
+ const _sfc_setup$q = _sfc_main$q.setup;
2186
+ _sfc_main$q.setup = (props, ctx) => {
2096
2187
  const ssrContext = useSSRContext();
2097
2188
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
2098
- return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
2189
+ return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
2099
2190
  };
2100
- const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
2191
+ const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
2101
2192
 
2102
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
2193
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2103
2194
  __name: "SocialNetworkLink",
2104
2195
  props: {
2105
2196
  network: {},
@@ -2125,7 +2216,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
2125
2216
  return __returned__;
2126
2217
  }
2127
2218
  });
2128
- function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2219
+ function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2129
2220
  const _component_ALink = resolveComponent("ALink");
2130
2221
  _push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
2131
2222
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -2146,15 +2237,15 @@ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2146
2237
  _: 3
2147
2238
  }, _parent));
2148
2239
  }
2149
- const _sfc_setup$n = _sfc_main$n.setup;
2150
- _sfc_main$n.setup = (props, ctx) => {
2240
+ const _sfc_setup$p = _sfc_main$p.setup;
2241
+ _sfc_main$p.setup = (props, ctx) => {
2151
2242
  const ssrContext = useSSRContext();
2152
2243
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
2153
- return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
2244
+ return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
2154
2245
  };
2155
- const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
2246
+ const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
2156
2247
 
2157
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
2248
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2158
2249
  __name: "ShopSidenavCategory",
2159
2250
  props: {
2160
2251
  categoryTree: {}
@@ -2177,7 +2268,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2177
2268
  return __returned__;
2178
2269
  }
2179
2270
  });
2180
- function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2271
+ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2181
2272
  const _component_AImg = resolveComponent("AImg");
2182
2273
  const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
2183
2274
  _push(`<li${ssrRenderAttrs(mergeProps({ class: "text-base-800 text-lg" }, _attrs))}>`);
@@ -2215,15 +2306,15 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2215
2306
  }
2216
2307
  _push(`</li>`);
2217
2308
  }
2218
- const _sfc_setup$m = _sfc_main$m.setup;
2219
- _sfc_main$m.setup = (props, ctx) => {
2309
+ const _sfc_setup$o = _sfc_main$o.setup;
2310
+ _sfc_main$o.setup = (props, ctx) => {
2220
2311
  const ssrContext = useSSRContext();
2221
2312
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
2222
- return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
2313
+ return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
2223
2314
  };
2224
- const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
2315
+ const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
2225
2316
 
2226
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
2317
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
2227
2318
  __name: "ShopSidenav",
2228
2319
  props: {
2229
2320
  categoryTrees: {}
@@ -2244,7 +2335,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2244
2335
  return __returned__;
2245
2336
  }
2246
2337
  });
2247
- function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2338
+ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2248
2339
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col bg-white" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
2249
2340
  ssrRenderList($props.categoryTrees, (categoryTree, i) => {
2250
2341
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
@@ -2285,13 +2376,13 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2285
2376
  });
2286
2377
  _push(`<!--]--></ul></footer></aside>`);
2287
2378
  }
2288
- const _sfc_setup$l = _sfc_main$l.setup;
2289
- _sfc_main$l.setup = (props, ctx) => {
2379
+ const _sfc_setup$n = _sfc_main$n.setup;
2380
+ _sfc_main$n.setup = (props, ctx) => {
2290
2381
  const ssrContext = useSSRContext();
2291
2382
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
2292
- return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
2383
+ return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
2293
2384
  };
2294
- const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
2385
+ const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
2295
2386
 
2296
2387
  const useShopHeaderSubmenu = (props) => {
2297
2388
  const categoryPicture = computed(() => {
@@ -2340,7 +2431,7 @@ const useShopHeaderSubmenu = (props) => {
2340
2431
  };
2341
2432
  };
2342
2433
 
2343
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
2434
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2344
2435
  __name: "ShopHeaderSubmenu",
2345
2436
  props: {
2346
2437
  categoryTree: {},
@@ -2369,7 +2460,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2369
2460
  return __returned__;
2370
2461
  }
2371
2462
  });
2372
- function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2463
+ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2373
2464
  const _component_Fade = resolveComponent("Fade");
2374
2465
  const _component_AImg = resolveComponent("AImg");
2375
2466
  _push(ssrRenderComponent($setup["Popover"], _attrs, {
@@ -2683,15 +2774,15 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2683
2774
  _: 3
2684
2775
  }, _parent));
2685
2776
  }
2686
- const _sfc_setup$k = _sfc_main$k.setup;
2687
- _sfc_main$k.setup = (props, ctx) => {
2777
+ const _sfc_setup$m = _sfc_main$m.setup;
2778
+ _sfc_main$m.setup = (props, ctx) => {
2688
2779
  const ssrContext = useSSRContext();
2689
2780
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
2690
- return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
2781
+ return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
2691
2782
  };
2692
- const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
2783
+ const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
2693
2784
 
2694
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
2785
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2695
2786
  __name: "ShopHeaderMenu",
2696
2787
  props: {
2697
2788
  inlineMenuTrees: {}
@@ -2707,7 +2798,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2707
2798
  return __returned__;
2708
2799
  }
2709
2800
  });
2710
- function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2801
+ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2711
2802
  _push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "text-base-700 flex gap-4 xl:gap-5"])}"><!--[-->`);
2712
2803
  ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
2713
2804
  _push(`<li>`);
@@ -2751,15 +2842,15 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2751
2842
  });
2752
2843
  _push(`<!--]--></ul></nav>`);
2753
2844
  }
2754
- const _sfc_setup$j = _sfc_main$j.setup;
2755
- _sfc_main$j.setup = (props, ctx) => {
2845
+ const _sfc_setup$l = _sfc_main$l.setup;
2846
+ _sfc_main$l.setup = (props, ctx) => {
2756
2847
  const ssrContext = useSSRContext();
2757
2848
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
2758
- return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
2849
+ return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
2759
2850
  };
2760
- const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
2851
+ const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
2761
2852
 
2762
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
2853
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2763
2854
  __name: "AccountMenu",
2764
2855
  setup(__props, { expose: __expose }) {
2765
2856
  __expose();
@@ -2786,7 +2877,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2786
2877
  return __returned__;
2787
2878
  }
2788
2879
  });
2789
- function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2880
+ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2790
2881
  const _component_Fade = resolveComponent("Fade");
2791
2882
  const _component_ALink = resolveComponent("ALink");
2792
2883
  _push(ssrRenderComponent($setup["Menu"], mergeProps({
@@ -3410,17 +3501,18 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3410
3501
  _: 3
3411
3502
  }, _parent));
3412
3503
  }
3413
- const _sfc_setup$i = _sfc_main$i.setup;
3414
- _sfc_main$i.setup = (props, ctx) => {
3504
+ const _sfc_setup$k = _sfc_main$k.setup;
3505
+ _sfc_main$k.setup = (props, ctx) => {
3415
3506
  const ssrContext = useSSRContext();
3416
3507
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
3417
- return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
3508
+ return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
3418
3509
  };
3419
- const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
3510
+ const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
3420
3511
 
3421
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
3512
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3422
3513
  __name: "ShopHeader",
3423
3514
  props: {
3515
+ searchInput: {},
3424
3516
  categories: {},
3425
3517
  menuCategorySlugs: {},
3426
3518
  menuRandomCategories: {},
@@ -3428,59 +3520,38 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
3428
3520
  },
3429
3521
  setup(__props, { expose: __expose }) {
3430
3522
  __expose();
3431
- const SearchModal = defineAsyncComponent(() => import('../SearchModal_f66549d4.mjs'));
3432
- const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_eab28771.mjs'));
3523
+ const SearchModal = defineAsyncComponent(() => import('../SearchModal_eWb5SdQM.mjs'));
3524
+ const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_hAgJQJgm.mjs'));
3433
3525
  const props = __props;
3434
3526
  const header = ref(null);
3527
+ const searchInput = ref(null);
3435
3528
  const {
3436
3529
  isSticky,
3437
3530
  positionY,
3438
3531
  categoryTrees,
3439
- inlineMenuTrees
3440
- } = useShopHeader({ ...props, header });
3532
+ inlineMenuTrees,
3533
+ isSearchOpen,
3534
+ isSearchOpenOnce,
3535
+ searchTerm,
3536
+ quickSearchTerm,
3537
+ toggleSearch,
3538
+ isCartOpen,
3539
+ isCartOpenOnce,
3540
+ cartTotalItems,
3541
+ handleOnMounted
3542
+ } = useShopHeader({ ...props, header, searchInput });
3441
3543
  const isSidenavOpen = ref(false);
3442
- const isSearchOpen = ref(false);
3443
- const isSearchOpenOnce = ref(false);
3444
- watchOnce(isSearchOpen, () => {
3445
- isSearchOpenOnce.value = true;
3446
- });
3447
- const searchTerm = ref("");
3448
- const searchInput = ref(null);
3449
- const toggleSearch = (ev) => {
3450
- isSearchOpen.value = !isSearchOpen.value;
3451
- if (isSearchOpen.value) {
3452
- ev.preventDefault();
3453
- nextTick(() => searchInput.value?.focus());
3454
- } else if (!searchTerm.value) {
3455
- ev.preventDefault();
3456
- }
3457
- };
3458
- const isCartOpen = ref(false);
3459
- const isCartOpenOnce = ref(false);
3460
- watchOnce(isCartOpen, () => {
3461
- isCartOpenOnce.value = true;
3462
- });
3463
3544
  const isMounted = ref(false);
3464
- const delayedTotalItems = ref(0);
3465
3545
  onMounted(() => {
3466
3546
  isMounted.value = true;
3467
- watch(totalItems, (newTotalItems, prevTotalItems) => {
3468
- if (typeof prevTotalItems === "number") {
3469
- if (prevTotalItems < newTotalItems) {
3470
- isCartOpen.value = true;
3471
- } else if (prevTotalItems && !newTotalItems) {
3472
- isCartOpen.value = false;
3473
- }
3474
- }
3475
- delayedTotalItems.value = newTotalItems;
3476
- }, { immediate: true });
3547
+ handleOnMounted();
3477
3548
  });
3478
- const __returned__ = { SearchModal, CartSidebar, props, header, isSticky, positionY, categoryTrees, inlineMenuTrees, isSidenavOpen, isSearchOpen, isSearchOpenOnce, searchTerm, searchInput, toggleSearch, isCartOpen, isCartOpenOnce, isMounted, delayedTotalItems, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
3549
+ const __returned__ = { SearchModal, CartSidebar, props, header, searchInput, isSticky, positionY, categoryTrees, inlineMenuTrees, isSearchOpen, isSearchOpenOnce, searchTerm, quickSearchTerm, toggleSearch, isCartOpen, isCartOpenOnce, cartTotalItems, handleOnMounted, isSidenavOpen, isMounted, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
3479
3550
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3480
3551
  return __returned__;
3481
3552
  }
3482
3553
  });
3483
- function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3554
+ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3484
3555
  const _component_Fade = resolveComponent("Fade");
3485
3556
  const _component_Skeleton = resolveComponent("Skeleton");
3486
3557
  _push(`<header${ssrRenderAttrs(mergeProps({
@@ -3499,7 +3570,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3499
3570
  _push(ssrRenderComponent(_component_Fade, null, {
3500
3571
  default: withCtx((_, _push2, _parent2, _scopeId) => {
3501
3572
  if (_push2) {
3502
- _push2(`<div style="${ssrRenderStyle($setup.isSearchOpen ? null : { display: "none" })}" class="absolute -right-0.5 -top-2 flex items-stretch"${_scopeId}><div class="hidden w-12 bg-gradient-to-r from-transparent to-white sm:block"${_scopeId}></div><input type="search" id="HeaderSearch" name="term"${ssrRenderAttr("value", $setup.searchTerm)} class="to-primary-50 border-primary/20 border-1 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen"${ssrRenderAttr("placeholder", `${"Buscar produtos"} ...`)}${_scopeId}></div>`);
3573
+ _push2(`<div style="${ssrRenderStyle($setup.isSearchOpen ? null : { display: "none" })}" class="absolute -right-0.5 -top-2 flex items-stretch"${_scopeId}><div class="hidden w-12 bg-gradient-to-r from-transparent to-white sm:block"${_scopeId}></div><input type="search" id="HeaderSearch" name="q"${ssrRenderAttr("value", $setup.searchTerm)} class="to-primary-50 border-primary/20 border-1 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen"${ssrRenderAttr("placeholder", `${"Buscar produtos"} ...`)}${_scopeId}></div>`);
3503
3574
  } else {
3504
3575
  return [
3505
3576
  withDirectives(createVNode("div", { class: "absolute -right-0.5 -top-2 flex items-stretch" }, [
@@ -3508,7 +3579,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3508
3579
  ref: "searchInput",
3509
3580
  type: "search",
3510
3581
  id: "HeaderSearch",
3511
- name: "term",
3582
+ name: "q",
3512
3583
  "onUpdate:modelValue": ($event) => $setup.searchTerm = $event,
3513
3584
  class: "to-primary-50 border-primary/20 border-1 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen",
3514
3585
  placeholder: `${"Buscar produtos"} ...`
@@ -3544,8 +3615,8 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3544
3615
  _: 1
3545
3616
  }, _parent));
3546
3617
  _push(`<a${ssrRenderAttr("href", _ctx.$settings.cartUrl || "/app/")}${ssrRenderAttr("aria-label", "Abrir carrinho")} class="group relative" role="button"><i class="i-shopping-bag group-hover:text-primary h-7 w-7 group-hover:scale-110 group-active:scale-125"></i>`);
3547
- if ($setup.delayedTotalItems) {
3548
- _push(`<span class="ui-badge-pill-sm absolute -right-1.5 -top-1">${ssrInterpolate($setup.delayedTotalItems)}</span>`);
3618
+ if ($setup.cartTotalItems) {
3619
+ _push(`<span class="ui-badge-pill-sm absolute -right-1.5 -top-1">${ssrInterpolate($setup.cartTotalItems)}</span>`);
3549
3620
  } else {
3550
3621
  _push(`<!---->`);
3551
3622
  }
@@ -3575,13 +3646,14 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3575
3646
  _push(ssrRenderComponent($setup["Drawer"], {
3576
3647
  modelValue: $setup.isSearchOpen,
3577
3648
  "onUpdate:modelValue": ($event) => $setup.isSearchOpen = $event,
3578
- "is-hidden": !$setup.searchTerm || $setup.searchTerm.length < 2,
3649
+ "is-hidden": !$setup.quickSearchTerm,
3579
3650
  "has-close-button": false,
3580
3651
  "anchor-el": $setup.searchInput?.parentElement,
3652
+ position: "absolute",
3581
3653
  placement: "top",
3582
3654
  animation: "scale",
3583
3655
  "max-width": "55rem",
3584
- class: "bg-white lg:mt-24 lg:bg-transparent"
3656
+ class: ["bg-transparent lg:mt-12", $setup.isSticky ? "mt-2 md:mt-3" : "mt-3 sm:mt-4 md:mt-5"]
3585
3657
  }, {
3586
3658
  default: withCtx((_, _push2, _parent2, _scopeId) => {
3587
3659
  if (_push2) {
@@ -3597,7 +3669,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3597
3669
  },
3598
3670
  default: () => {
3599
3671
  if ($setup.isSearchOpenOnce) {
3600
- _push2(ssrRenderComponent($setup["SearchModal"], { term: $setup.searchTerm }, null, _parent2, _scopeId));
3672
+ _push2(ssrRenderComponent($setup["SearchModal"], { term: $setup.quickSearchTerm }, null, _parent2, _scopeId));
3601
3673
  } else {
3602
3674
  _push2(`<!---->`);
3603
3675
  }
@@ -3619,7 +3691,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3619
3691
  default: withCtx(() => [
3620
3692
  $setup.isSearchOpenOnce ? (openBlock(), createBlock($setup["SearchModal"], {
3621
3693
  key: 0,
3622
- term: $setup.searchTerm
3694
+ term: $setup.quickSearchTerm
3623
3695
  }, null, 8, ["term"])) : createCommentVNode("", true)
3624
3696
  ]),
3625
3697
  _: 1
@@ -3690,13 +3762,13 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3690
3762
  }
3691
3763
  _push(`</header>`);
3692
3764
  }
3693
- const _sfc_setup$h = _sfc_main$h.setup;
3694
- _sfc_main$h.setup = (props, ctx) => {
3765
+ const _sfc_setup$j = _sfc_main$j.setup;
3766
+ _sfc_main$j.setup = (props, ctx) => {
3695
3767
  const ssrContext = useSSRContext();
3696
3768
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
3697
- return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
3769
+ return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
3698
3770
  };
3699
- const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
3771
+ const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
3700
3772
 
3701
3773
  var __freeze$2 = Object.freeze;
3702
3774
  var __defProp$2 = Object.defineProperty;
@@ -3726,7 +3798,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3726
3798
  ` })}` })))}`;
3727
3799
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
3728
3800
 
3729
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
3801
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
3730
3802
  __name: "PaymentMethodFlag",
3731
3803
  props: {
3732
3804
  as: { default: "i" },
@@ -3762,22 +3834,22 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
3762
3834
  return __returned__;
3763
3835
  }
3764
3836
  });
3765
- function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3837
+ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3766
3838
  if (!$setup.iconClassName) {
3767
3839
  _push(`<b${ssrRenderAttrs(mergeProps({ class: "mb-1 text-[57%] leading-none tracking-tighter text-black" }, _attrs))}>${ssrInterpolate($setup.props.flag)}</b>`);
3768
3840
  } else {
3769
3841
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
3770
3842
  }
3771
3843
  }
3772
- const _sfc_setup$g = _sfc_main$g.setup;
3773
- _sfc_main$g.setup = (props, ctx) => {
3844
+ const _sfc_setup$i = _sfc_main$i.setup;
3845
+ _sfc_main$i.setup = (props, ctx) => {
3774
3846
  const ssrContext = useSSRContext();
3775
3847
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PaymentMethodFlag.vue");
3776
- return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
3848
+ return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
3777
3849
  };
3778
- const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
3850
+ const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
3779
3851
 
3780
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
3852
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
3781
3853
  __name: "FooterStamps",
3782
3854
  props: {
3783
3855
  stamps: {}
@@ -3789,7 +3861,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3789
3861
  return __returned__;
3790
3862
  }
3791
3863
  });
3792
- function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3864
+ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3793
3865
  const _component_ALink = resolveComponent("ALink");
3794
3866
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex flex-wrap items-start justify-between gap-5 lg:flex-nowrap"><ul class="mx-auto flex items-center gap-x-6 gap-y-3 overflow-x-auto md:mx-0 md:flex-wrap md:overflow-hidden lg:gap-x-8"><!--[-->`);
3795
3867
  ssrRenderList($props.stamps, (stamp, i) => {
@@ -3869,7 +3941,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3869
3941
  flag: paymentMethod
3870
3942
  }, null, _parent));
3871
3943
  });
3872
- _push(`<!--]--></div></div><div class="mt-7 justify-between gap-4 text-center text-xs md:flex md:text-left"><div class="mb-3 md:mb-0"> @ ${ssrInterpolate(( new Date()).getFullYear())} ${ssrInterpolate(_ctx.$settings.corporateName)} ${ssrInterpolate(_ctx.$settings.address ? `/ ${_ctx.$settings.address}` : "")} / ${ssrInterpolate(_ctx.$settings.docNumber)}</div>`);
3944
+ _push(`<!--]--></div></div><div class="mt-7 justify-between gap-4 text-center text-xs md:flex md:text-left"><div class="mb-3 md:mb-0"> @ ${ssrInterpolate((/* @__PURE__ */ new Date()).getFullYear())} ${ssrInterpolate(_ctx.$settings.corporateName)} ${ssrInterpolate(_ctx.$settings.address ? `/ ${_ctx.$settings.address}` : "")} / ${ssrInterpolate(_ctx.$settings.docNumber)}</div>`);
3873
3945
  _push(ssrRenderComponent(_component_ALink, {
3874
3946
  href: "https://www.ecomplus.io/",
3875
3947
  class: "italic text-[#37003c]"
@@ -3888,15 +3960,15 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3888
3960
  }, _parent));
3889
3961
  _push(`</div></div>`);
3890
3962
  }
3891
- const _sfc_setup$f = _sfc_main$f.setup;
3892
- _sfc_main$f.setup = (props, ctx) => {
3963
+ const _sfc_setup$h = _sfc_main$h.setup;
3964
+ _sfc_main$h.setup = (props, ctx) => {
3893
3965
  const ssrContext = useSSRContext();
3894
3966
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FooterStamps.vue");
3895
- return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
3967
+ return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
3896
3968
  };
3897
- const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
3969
+ const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
3898
3970
 
3899
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
3971
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
3900
3972
  __name: "ShopFooter",
3901
3973
  props: {
3902
3974
  stamps: {},
@@ -3914,9 +3986,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3914
3986
  return __returned__;
3915
3987
  }
3916
3988
  });
3917
- function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3989
+ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3918
3990
  const _component_ALink = resolveComponent("ALink");
3919
- _push(`<footer${ssrRenderAttrs(mergeProps({ class: "bg-base-50 border-base-100 w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
3991
+ _push(`<footer${ssrRenderAttrs(mergeProps({ class: "bg-base-50 border-base-100 mt-auto w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
3920
3992
  ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
3921
3993
  if (_ctx.$settings.description) {
3922
3994
  _push(`<div class="prose"><p>${ssrInterpolate(_ctx.$settings.description)}</p></div>`);
@@ -4012,13 +4084,13 @@ function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4012
4084
  _push(ssrRenderComponent($setup["FooterStamps"], { stamps: $props.stamps }, null, _parent));
4013
4085
  _push(`</footer>`);
4014
4086
  }
4015
- const _sfc_setup$e = _sfc_main$e.setup;
4016
- _sfc_main$e.setup = (props, ctx) => {
4087
+ const _sfc_setup$g = _sfc_main$g.setup;
4088
+ _sfc_main$g.setup = (props, ctx) => {
4017
4089
  const ssrContext = useSSRContext();
4018
4090
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopFooter.vue");
4019
- return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
4091
+ return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
4020
4092
  };
4021
- const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
4093
+ const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
4022
4094
 
4023
4095
  const $$Astro$7 = createAstro("https://demo.ecomplus.app");
4024
4096
  const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
@@ -4138,6 +4210,178 @@ const useProductShelf = (props) => {
4138
4210
  };
4139
4211
  };
4140
4212
 
4213
+ const storageKey = "ecomSeachHistory";
4214
+ const searchHistory = useStorage(storageKey, []);
4215
+ for (let i = 0; i < searchHistory.length; i++) {
4216
+ if (typeof searchHistory[i] !== "string") {
4217
+ searchHistory.splice(i, 1);
4218
+ i -= 1;
4219
+ }
4220
+ }
4221
+ const search = async ({
4222
+ term,
4223
+ params,
4224
+ fields,
4225
+ url = "search/v1"
4226
+ }) => {
4227
+ if (typeof term === "string") {
4228
+ term = term.trim();
4229
+ if (term.length < 2) {
4230
+ return { data: { result: [], meta: null } };
4231
+ }
4232
+ }
4233
+ const response = await api.get(url, {
4234
+ fields,
4235
+ params: !term ? params : {
4236
+ ...params,
4237
+ term
4238
+ }
4239
+ });
4240
+ if (term && response.data.result.length) {
4241
+ const termStr = term;
4242
+ const completeTermIndex = searchHistory.findIndex((_term) => {
4243
+ return _term.includes(termStr) && !_term.replace(termStr, "").includes(" ");
4244
+ });
4245
+ if (completeTermIndex > -1) {
4246
+ const completeTerm = searchHistory[completeTermIndex];
4247
+ searchHistory.splice(completeTermIndex, 1);
4248
+ searchHistory.unshift(completeTerm);
4249
+ } else {
4250
+ const termIndex = searchHistory.findIndex((_term) => termStr.startsWith(_term));
4251
+ if (termIndex > -1) {
4252
+ searchHistory.splice(termIndex, 1);
4253
+ }
4254
+ searchHistory.unshift(term);
4255
+ }
4256
+ while (searchHistory.length > 20) {
4257
+ searchHistory.pop();
4258
+ }
4259
+ }
4260
+ return response;
4261
+ };
4262
+ class SearchEngine {
4263
+ fields;
4264
+ term = ref("");
4265
+ isWithCount = ref(true);
4266
+ isWithBuckets = ref(true);
4267
+ params = shallowReactive({});
4268
+ pageSize = ref(24);
4269
+ pageNumber = ref(1);
4270
+ #isFetching = ref(false);
4271
+ isFetching = computed(() => this.#isFetching.value);
4272
+ #wasFetched = ref(false);
4273
+ wasFetched = computed(() => this.#wasFetched.value);
4274
+ #fetching = ref(null);
4275
+ #fulfillFetching;
4276
+ fetching = computed(() => this.#fetching.value);
4277
+ #fetchError = ref(null);
4278
+ fetchError = computed(() => this.#fetchError.value);
4279
+ products = shallowReactive([]);
4280
+ meta = shallowReactive({
4281
+ offset: 0,
4282
+ limit: 0,
4283
+ fields: [],
4284
+ sort: [],
4285
+ query: {}
4286
+ });
4287
+ #search;
4288
+ constructor({
4289
+ fields,
4290
+ debounce = 150
4291
+ } = {}) {
4292
+ this.fields = fields;
4293
+ this.#search = useDebounceFn((opts) => {
4294
+ this.#isFetching.value = true;
4295
+ return search(opts);
4296
+ }, debounce);
4297
+ watch([this.term, this.params, this.pageSize], () => {
4298
+ this.pageNumber.value = 1;
4299
+ });
4300
+ watch(this.pageNumber, () => {
4301
+ this.#wasFetched.value = false;
4302
+ });
4303
+ }
4304
+ async fetch(term) {
4305
+ if (term && term !== this.term.value) {
4306
+ this.term.value = term;
4307
+ this.pageNumber.value = 1;
4308
+ }
4309
+ const limit = this.pageSize.value;
4310
+ const offset = limit * (this.pageNumber.value - 1);
4311
+ if (!this.#fetching.value) {
4312
+ this.#fetching.value = new Promise((resolve) => {
4313
+ this.#fulfillFetching = resolve;
4314
+ });
4315
+ }
4316
+ let response;
4317
+ try {
4318
+ response = await this.#search({
4319
+ term: this.term.value,
4320
+ params: {
4321
+ ...this.params,
4322
+ limit,
4323
+ offset,
4324
+ count: this.isWithCount.value || void 0,
4325
+ buckets: this.isWithBuckets.value || void 0
4326
+ },
4327
+ fields: this.fields
4328
+ });
4329
+ } catch (err) {
4330
+ if (this.#fulfillFetching) {
4331
+ this.#fetchError.value = err;
4332
+ this.#fulfillFetching();
4333
+ }
4334
+ throw err;
4335
+ }
4336
+ if (response) {
4337
+ this.#isFetching.value = false;
4338
+ this.#wasFetched.value = true;
4339
+ const { data } = response;
4340
+ if (data.meta) {
4341
+ this.products.splice(0);
4342
+ Object.assign(this.meta, data.meta);
4343
+ }
4344
+ data.result.forEach((item) => this.products.push(item));
4345
+ if (this.#fulfillFetching) {
4346
+ this.#fulfillFetching();
4347
+ }
4348
+ }
4349
+ }
4350
+ }
4351
+
4352
+ const useSearchContainer = (props) => {
4353
+ let { term, searchEngine } = props;
4354
+ if (props.ssrError && false) {
4355
+ console.error(new Error(`SSR search error: ${props.ssrError}`));
4356
+ if (window.location.pathname.startsWith("/s/")) {
4357
+ window.location.href = `/s?q=${encodeURIComponent(term || "")}`;
4358
+ }
4359
+ }
4360
+ const products = shallowReactive(props.products || []);
4361
+ if (!searchEngine) {
4362
+ searchEngine = new SearchEngine({ debounce: 50 });
4363
+ if (term === void 0 && false) {
4364
+ term = new URLSearchParams(window.location.search).get("q") || null;
4365
+ }
4366
+ if (term !== void 0) {
4367
+ searchEngine.term.value = term;
4368
+ }
4369
+ }
4370
+ if (!searchEngine.wasFetched.value && !props.products) {
4371
+ searchEngine.fetch().catch(console.error);
4372
+ }
4373
+ watch(searchEngine.products, () => {
4374
+ products.splice(0);
4375
+ searchEngine?.products.forEach((item) => products.push(item));
4376
+ });
4377
+ return {
4378
+ searchEngine,
4379
+ fetching: searchEngine.fetching.value,
4380
+ isFetching: searchEngine.isFetching,
4381
+ products
4382
+ };
4383
+ };
4384
+
4141
4385
  const now = Date.now();
4142
4386
  const parseBanners = (banners) => {
4143
4387
  const validBanners = [];
@@ -4226,6 +4470,18 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
4226
4470
  };
4227
4471
  return;
4228
4472
  }
4473
+ if (type === "search-container") {
4474
+ const props = { ...sectionContent };
4475
+ if (routeContext.searchPageTerm !== void 0) {
4476
+ props.term = routeContext.searchPageTerm || null;
4477
+ const { searchEngine, fetching } = useSearchContainer(props);
4478
+ await fetching;
4479
+ props.products = searchEngine.products;
4480
+ props.ssrError = searchEngine.fetchError.value?.message;
4481
+ }
4482
+ sections[index] = { type, props };
4483
+ return;
4484
+ }
4229
4485
  if (type === "banners-grid") {
4230
4486
  sections[index] = {
4231
4487
  type,
@@ -4316,7 +4572,7 @@ const useBanner = (props) => {
4316
4572
  };
4317
4573
  };
4318
4574
 
4319
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
4575
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4320
4576
  __name: "Banner",
4321
4577
  props: {
4322
4578
  img: {},
@@ -4343,7 +4599,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4343
4599
  return __returned__;
4344
4600
  }
4345
4601
  });
4346
- function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4602
+ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4347
4603
  const _component_ALink = resolveComponent("ALink");
4348
4604
  _push(`<div${ssrRenderAttrs(mergeProps({
4349
4605
  class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
@@ -4411,13 +4667,13 @@ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4411
4667
  }
4412
4668
  _push(`</div>`);
4413
4669
  }
4414
- const _sfc_setup$d = _sfc_main$d.setup;
4415
- _sfc_main$d.setup = (props, ctx) => {
4670
+ const _sfc_setup$f = _sfc_main$f.setup;
4671
+ _sfc_main$f.setup = (props, ctx) => {
4416
4672
  const ssrContext = useSSRContext();
4417
4673
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
4418
- return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
4674
+ return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
4419
4675
  };
4420
- const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
4676
+ const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
4421
4677
 
4422
4678
  const $$Astro$5 = createAstro("https://demo.ecomplus.app");
4423
4679
  const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
@@ -4712,7 +4968,7 @@ const usePrices = (props) => {
4712
4968
  };
4713
4969
  };
4714
4970
 
4715
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
4971
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4716
4972
  __name: "Prices",
4717
4973
  props: {
4718
4974
  isBig: { type: Boolean },
@@ -4747,7 +5003,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4747
5003
  return __returned__;
4748
5004
  }
4749
5005
  });
4750
- function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5006
+ function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4751
5007
  const _component_Fade = resolveComponent("Fade");
4752
5008
  _push(`<div${ssrRenderAttrs(mergeProps({
4753
5009
  class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]", $props.isBig ? "text-lg" : null]
@@ -4877,15 +5133,15 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4877
5133
  }, _parent));
4878
5134
  _push(`</div>`);
4879
5135
  }
4880
- const _sfc_setup$c = _sfc_main$c.setup;
4881
- _sfc_main$c.setup = (props, ctx) => {
5136
+ const _sfc_setup$e = _sfc_main$e.setup;
5137
+ _sfc_main$e.setup = (props, ctx) => {
4882
5138
  const ssrContext = useSSRContext();
4883
5139
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
4884
- return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
5140
+ return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
4885
5141
  };
4886
- const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
5142
+ const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
4887
5143
 
4888
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
5144
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4889
5145
  __name: "ProductCard",
4890
5146
  props: {
4891
5147
  product: {},
@@ -4920,7 +5176,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4920
5176
  return __returned__;
4921
5177
  }
4922
5178
  });
4923
- function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5179
+ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4924
5180
  const _component_ALink = resolveComponent("ALink");
4925
5181
  const _component_AImg = resolveComponent("AImg");
4926
5182
  _push(`<article${ssrRenderAttrs(mergeProps({
@@ -5063,15 +5319,15 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5063
5319
  }, _parent));
5064
5320
  _push(`</article>`);
5065
5321
  }
5066
- const _sfc_setup$b = _sfc_main$b.setup;
5067
- _sfc_main$b.setup = (props, ctx) => {
5322
+ const _sfc_setup$d = _sfc_main$d.setup;
5323
+ _sfc_main$d.setup = (props, ctx) => {
5068
5324
  const ssrContext = useSSRContext();
5069
5325
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductCard.vue");
5070
- return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
5326
+ return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
5071
5327
  };
5072
- const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
5328
+ const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
5073
5329
 
5074
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
5330
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
5075
5331
  __name: "ProductShelf",
5076
5332
  props: {
5077
5333
  collectionId: {},
@@ -5107,7 +5363,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5107
5363
  return __returned__;
5108
5364
  }
5109
5365
  });
5110
- function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5366
+ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5111
5367
  const _component_ALink = resolveComponent("ALink");
5112
5368
  const _component_Carousel = resolveComponent("Carousel");
5113
5369
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -5141,13 +5397,13 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5141
5397
  if (_push3) {
5142
5398
  _push3(ssrRenderComponent(_component_CarouselControl, {
5143
5399
  style: $setup.products.length > 2 ? null : { display: "none" },
5144
- class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
5400
+ class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
5145
5401
  "is-prev": isPrev
5146
5402
  }, null, _parent3, _scopeId2));
5147
5403
  } else {
5148
5404
  return [
5149
5405
  withDirectives(createVNode(_component_CarouselControl, {
5150
- class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
5406
+ class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
5151
5407
  "is-prev": isPrev
5152
5408
  }, null, 8, ["class", "is-prev"]), [
5153
5409
  [vShow, $setup.products.length > 2]
@@ -5164,7 +5420,7 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5164
5420
  createVNode($setup["DefineCarouselControl"], null, {
5165
5421
  default: withCtx(({ isPrev }) => [
5166
5422
  withDirectives(createVNode(_component_CarouselControl, {
5167
- class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
5423
+ class: ["uno-c36cp5", isPrev ? "!-left-4" : "!-right-4"],
5168
5424
  "is-prev": isPrev
5169
5425
  }, null, 8, ["class", "is-prev"]), [
5170
5426
  [vShow, $setup.products.length > 2]
@@ -5209,13 +5465,13 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5209
5465
  }, _parent));
5210
5466
  _push(`</section>`);
5211
5467
  }
5212
- const _sfc_setup$a = _sfc_main$a.setup;
5213
- _sfc_main$a.setup = (props, ctx) => {
5468
+ const _sfc_setup$c = _sfc_main$c.setup;
5469
+ _sfc_main$c.setup = (props, ctx) => {
5214
5470
  const ssrContext = useSSRContext();
5215
5471
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductShelf.vue");
5216
- return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
5472
+ return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
5217
5473
  };
5218
- const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
5474
+ const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
5219
5475
 
5220
5476
  const useBreadcrumbs = async (props = {}) => {
5221
5477
  const { settings, apiContext, data } = globalThis.$storefront;
@@ -5312,7 +5568,7 @@ const $$Breadcrumbs = createComponent(async ($$result, $$props, $$slots) => {
5312
5568
  </section>`}`;
5313
5569
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Breadcrumbs.astro", void 0);
5314
5570
 
5315
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5571
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
5316
5572
  __name: "ContentClearfix",
5317
5573
  props: {
5318
5574
  html: {}
@@ -5326,18 +5582,18 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5326
5582
  return __returned__;
5327
5583
  }
5328
5584
  });
5329
- function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5585
+ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5330
5586
  _push(`<article${ssrRenderAttrs(mergeProps({ class: "prose !max-w-full overflow-x-auto" }, _attrs))}><div class="[&amp;_iframe]:max-w-full [&amp;_img]:max-w-full [&amp;_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
5331
5587
  }
5332
- const _sfc_setup$9 = _sfc_main$9.setup;
5333
- _sfc_main$9.setup = (props, ctx) => {
5588
+ const _sfc_setup$b = _sfc_main$b.setup;
5589
+ _sfc_main$b.setup = (props, ctx) => {
5334
5590
  const ssrContext = useSSRContext();
5335
5591
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
5336
- return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
5592
+ return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
5337
5593
  };
5338
- const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
5594
+ const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
5339
5595
 
5340
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5596
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5341
5597
  __name: "Collapse",
5342
5598
  props: {
5343
5599
  title: {}
@@ -5349,20 +5605,20 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5349
5605
  return __returned__;
5350
5606
  }
5351
5607
  });
5352
- function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5608
+ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5353
5609
  _push(`<details${ssrRenderAttrs(mergeProps({ class: "[&_i]:open:rotate-180" }, _attrs))}><summary role="button" class="text-base-700 hover:text-base-800 [&amp;&gt;i]:hover:text-primary my-4 list-none text-2xl font-medium lowercase md:my-5"><i class="i-chevron-down mr-1"></i><span>${ssrInterpolate($props.title)}</span></summary>`);
5354
5610
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
5355
5611
  _push(`</details>`);
5356
5612
  }
5357
- const _sfc_setup$8 = _sfc_main$8.setup;
5358
- _sfc_main$8.setup = (props, ctx) => {
5613
+ const _sfc_setup$a = _sfc_main$a.setup;
5614
+ _sfc_main$a.setup = (props, ctx) => {
5359
5615
  const ssrContext = useSSRContext();
5360
5616
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Collapse.vue");
5361
- return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
5617
+ return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
5362
5618
  };
5363
- const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
5619
+ const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
5364
5620
 
5365
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5621
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5366
5622
  __name: "DocDescription",
5367
5623
  props: {
5368
5624
  apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -5377,7 +5633,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5377
5633
  return __returned__;
5378
5634
  }
5379
5635
  });
5380
- function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5636
+ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5381
5637
  if ($setup.html) {
5382
5638
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
5383
5639
  _push(ssrRenderComponent($setup["Collapse"], {
@@ -5400,15 +5656,15 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5400
5656
  _push(`<!---->`);
5401
5657
  }
5402
5658
  }
5403
- const _sfc_setup$7 = _sfc_main$7.setup;
5404
- _sfc_main$7.setup = (props, ctx) => {
5659
+ const _sfc_setup$9 = _sfc_main$9.setup;
5660
+ _sfc_main$9.setup = (props, ctx) => {
5405
5661
  const ssrContext = useSSRContext();
5406
5662
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocDescription.vue");
5407
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
5663
+ return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
5408
5664
  };
5409
- const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
5665
+ const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
5410
5666
 
5411
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5667
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5412
5668
  __name: "CheckoutLink",
5413
5669
  props: {
5414
5670
  to: { default: "cart" },
@@ -5463,20 +5719,20 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5463
5719
  return __returned__;
5464
5720
  }
5465
5721
  });
5466
- function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5722
+ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5467
5723
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
5468
5724
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
5469
5725
  _push(`</a>`);
5470
5726
  }
5471
- const _sfc_setup$6 = _sfc_main$6.setup;
5472
- _sfc_main$6.setup = (props, ctx) => {
5727
+ const _sfc_setup$8 = _sfc_main$8.setup;
5728
+ _sfc_main$8.setup = (props, ctx) => {
5473
5729
  const ssrContext = useSSRContext();
5474
5730
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
5475
- return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
5731
+ return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
5476
5732
  };
5477
- const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
5733
+ const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
5478
5734
 
5479
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5735
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5480
5736
  __name: "QuantitySelectorControl",
5481
5737
  props: {
5482
5738
  isMinus: { type: Boolean }
@@ -5493,7 +5749,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5493
5749
  return __returned__;
5494
5750
  }
5495
5751
  });
5496
- function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5752
+ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5497
5753
  _push(`<button${ssrRenderAttrs(mergeProps({
5498
5754
  type: "button",
5499
5755
  class: "leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 h-12 w-10 text-xl disabled:opacity-40",
@@ -5510,16 +5766,16 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5510
5766
  }, _push, _parent);
5511
5767
  _push(`</button>`);
5512
5768
  }
5513
- const _sfc_setup$5 = _sfc_main$5.setup;
5514
- _sfc_main$5.setup = (props, ctx) => {
5769
+ const _sfc_setup$7 = _sfc_main$7.setup;
5770
+ _sfc_main$7.setup = (props, ctx) => {
5515
5771
  const ssrContext = useSSRContext();
5516
5772
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
5517
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
5773
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
5518
5774
  };
5519
- const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
5775
+ const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
5520
5776
 
5521
5777
  const quantitySelectorKey = Symbol("quantitySelector");
5522
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5778
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5523
5779
  __name: "QuantitySelector",
5524
5780
  props: {
5525
5781
  modelValue: { default: 1 },
@@ -5568,7 +5824,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5568
5824
  return __returned__;
5569
5825
  }
5570
5826
  });
5571
- function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5827
+ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5572
5828
  _push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
5573
5829
  ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
5574
5830
  _push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
@@ -5605,15 +5861,15 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5605
5861
  }, _push, _parent);
5606
5862
  _push(`</div></div>`);
5607
5863
  }
5608
- const _sfc_setup$4 = _sfc_main$4.setup;
5609
- _sfc_main$4.setup = (props, ctx) => {
5864
+ const _sfc_setup$6 = _sfc_main$6.setup;
5865
+ _sfc_main$6.setup = (props, ctx) => {
5610
5866
  const ssrContext = useSSRContext();
5611
5867
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
5612
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
5868
+ return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
5613
5869
  };
5614
- const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
5870
+ const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
5615
5871
 
5616
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5872
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5617
5873
  __name: "ImagesGallery",
5618
5874
  props: {
5619
5875
  pictures: {}
@@ -5633,7 +5889,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5633
5889
  // @ts-ignore
5634
5890
  import('photoswipe/lightbox'),
5635
5891
  import('photoswipe'),
5636
- !document.getElementById(styleId) && import('../photoswipe_9528923e.mjs')
5892
+ !document.getElementById(styleId) && import('../photoswipe_IcWDJiwc.mjs')
5637
5893
  ]).then(([
5638
5894
  { default: PhotoSwipeLightbox },
5639
5895
  { default: pswpModule },
@@ -5670,7 +5926,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5670
5926
  return __returned__;
5671
5927
  }
5672
5928
  });
5673
- function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5929
+ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5674
5930
  const _component_Carousel = resolveComponent("Carousel");
5675
5931
  const _component_AImg = resolveComponent("AImg");
5676
5932
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -5850,13 +6106,13 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
5850
6106
  }
5851
6107
  _push(`</div></div>`);
5852
6108
  }
5853
- const _sfc_setup$3 = _sfc_main$3.setup;
5854
- _sfc_main$3.setup = (props, ctx) => {
6109
+ const _sfc_setup$5 = _sfc_main$5.setup;
6110
+ _sfc_main$5.setup = (props, ctx) => {
5855
6111
  const ssrContext = useSSRContext();
5856
6112
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ImagesGallery.vue");
5857
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
6113
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
5858
6114
  };
5859
- const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
6115
+ const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
5860
6116
 
5861
6117
  const useSkuSelector = (props) => {
5862
6118
  let grids = shallowReactive(globalThis.$storefront.data.grids);
@@ -5966,7 +6222,7 @@ const useSkuSelector = (props) => {
5966
6222
  };
5967
6223
  };
5968
6224
 
5969
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6225
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5970
6226
  __name: "SkuSelector",
5971
6227
  props: {
5972
6228
  variations: {},
@@ -5994,7 +6250,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5994
6250
  return __returned__;
5995
6251
  }
5996
6252
  });
5997
- function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6253
+ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5998
6254
  _push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
5999
6255
  ssrRenderList($setup.variationsGrids, (options, gridId) => {
6000
6256
  _push(`<div><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
@@ -6021,15 +6277,15 @@ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6021
6277
  });
6022
6278
  _push(`<!--]--></div>`);
6023
6279
  }
6024
- const _sfc_setup$2 = _sfc_main$2.setup;
6025
- _sfc_main$2.setup = (props, ctx) => {
6280
+ const _sfc_setup$4 = _sfc_main$4.setup;
6281
+ _sfc_main$4.setup = (props, ctx) => {
6026
6282
  const ssrContext = useSSRContext();
6027
6283
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SkuSelector.vue");
6028
- return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
6284
+ return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
6029
6285
  };
6030
- const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
6286
+ const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
6031
6287
 
6032
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6288
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
6033
6289
  __name: "ProductDetails",
6034
6290
  props: {
6035
6291
  product: { default: () => globalThis.$storefront.apiContext?.doc }
@@ -6082,7 +6338,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6082
6338
  return __returned__;
6083
6339
  }
6084
6340
  });
6085
- function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6341
+ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6086
6342
  const _component_Fade = resolveComponent("Fade");
6087
6343
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
6088
6344
  if ($setup.product.pictures?.length) {
@@ -6092,7 +6348,7 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6092
6348
  } else {
6093
6349
  _push(`<!---->`);
6094
6350
  }
6095
- _push(`</div><div class="top-0 py-4 lg:sticky"><h1 class="ui-text-brand text-base-700 text-xl">${ssrInterpolate($setup.title)}</h1>`);
6351
+ _push(`</div><div class="lg:sticky-header:translate-y-14 top-0 py-4 transition-transform lg:sticky"><h1 class="ui-text-brand text-secondary-900 text-lg">${ssrInterpolate($setup.title)}</h1>`);
6096
6352
  if ($setup.isActive) {
6097
6353
  _push(`<div class="mt-5">`);
6098
6354
  _push(ssrRenderComponent($setup["Prices"], {
@@ -6171,15 +6427,15 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6171
6427
  ssrRenderSlot(_ctx.$slots, "description", {}, null, _push, _parent);
6172
6428
  _push(`</div></section>`);
6173
6429
  }
6174
- const _sfc_setup$1 = _sfc_main$1.setup;
6175
- _sfc_main$1.setup = (props, ctx) => {
6430
+ const _sfc_setup$3 = _sfc_main$3.setup;
6431
+ _sfc_main$3.setup = (props, ctx) => {
6176
6432
  const ssrContext = useSSRContext();
6177
6433
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductDetails.vue");
6178
- return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
6434
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
6179
6435
  };
6180
- const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
6436
+ const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
6181
6437
 
6182
- const _sfc_main = /* @__PURE__ */ defineComponent({
6438
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6183
6439
  __name: "ProductSpecifications",
6184
6440
  props: {
6185
6441
  product: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -6200,7 +6456,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
6200
6456
  return __returned__;
6201
6457
  }
6202
6458
  });
6203
- function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6459
+ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6204
6460
  if ($setup.hasSpecs) {
6205
6461
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
6206
6462
  _push(ssrRenderComponent($setup["Collapse"], {
@@ -6236,13 +6492,148 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
6236
6492
  _push(`<!---->`);
6237
6493
  }
6238
6494
  }
6495
+ const _sfc_setup$2 = _sfc_main$2.setup;
6496
+ _sfc_main$2.setup = (props, ctx) => {
6497
+ const ssrContext = useSSRContext();
6498
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductSpecifications.vue");
6499
+ return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
6500
+ };
6501
+ const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
6502
+
6503
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6504
+ __name: "ProductGrid",
6505
+ props: {
6506
+ collectionId: {},
6507
+ searchQuery: {},
6508
+ sort: {},
6509
+ title: {},
6510
+ titleLink: {},
6511
+ isShuffle: { type: Boolean },
6512
+ limit: {},
6513
+ page: {},
6514
+ products: {}
6515
+ },
6516
+ async setup(__props, { expose: __expose }) {
6517
+ __expose();
6518
+ let __temp, __restore;
6519
+ const props = __props;
6520
+ const {
6521
+ title,
6522
+ titleLink,
6523
+ fetching,
6524
+ products
6525
+ } = useProductShelf(props);
6526
+ {
6527
+ [__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
6528
+ }
6529
+ const __returned__ = { props, title, titleLink, fetching, products, ProductCard };
6530
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6531
+ return __returned__;
6532
+ }
6533
+ });
6534
+ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6535
+ const _component_ALink = resolveComponent("ALink");
6536
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
6537
+ if ($setup.title) {
6538
+ _push(`<div class="mx-auto mb-2 max-w-prose text-center"><h2 class="ui-text-brand text-3xl">`);
6539
+ _push(ssrRenderComponent(_component_ALink, {
6540
+ href: $setup.titleLink,
6541
+ class: $setup.titleLink ? "ui-link" : "text-base-700"
6542
+ }, {
6543
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6544
+ if (_push2) {
6545
+ _push2(`${ssrInterpolate($setup.title)}`);
6546
+ } else {
6547
+ return [
6548
+ createTextVNode(toDisplayString($setup.title), 1)
6549
+ ];
6550
+ }
6551
+ }),
6552
+ _: 1
6553
+ }, _parent));
6554
+ _push(`</h2></div>`);
6555
+ } else {
6556
+ _push(`<!---->`);
6557
+ }
6558
+ _push(`<ul class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4"><!--[-->`);
6559
+ ssrRenderList($setup.products, (product) => {
6560
+ _push(`<li>`);
6561
+ _push(ssrRenderComponent($setup["ProductCard"], { product }, null, _parent));
6562
+ _push(`</li>`);
6563
+ });
6564
+ _push(`<!--]--></ul></section>`);
6565
+ }
6566
+ const _sfc_setup$1 = _sfc_main$1.setup;
6567
+ _sfc_main$1.setup = (props, ctx) => {
6568
+ const ssrContext = useSSRContext();
6569
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductGrid.vue");
6570
+ return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
6571
+ };
6572
+ const ProductGrid = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
6573
+
6574
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6575
+ __name: "SearchContainer",
6576
+ props: {
6577
+ searchEngine: {},
6578
+ term: {},
6579
+ sort: {},
6580
+ products: {},
6581
+ ssrError: {}
6582
+ },
6583
+ async setup(__props, { expose: __expose }) {
6584
+ __expose();
6585
+ let __temp, __restore;
6586
+ const props = __props;
6587
+ const {
6588
+ // searchEngine,
6589
+ fetching,
6590
+ isFetching,
6591
+ products
6592
+ } = useSearchContainer(props);
6593
+ {
6594
+ [__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
6595
+ }
6596
+ const __returned__ = { props, fetching, isFetching, products, ProductGrid };
6597
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6598
+ return __returned__;
6599
+ }
6600
+ });
6601
+ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6602
+ const _component_Skeleton = resolveComponent("Skeleton");
6603
+ const _component_Fade = resolveComponent("Fade");
6604
+ _push(`<!--[-->`);
6605
+ if ($setup.isFetching) {
6606
+ _push(`<div class="ui-section relative min-h-[300px]">`);
6607
+ _push(ssrRenderComponent(_component_Skeleton, {
6608
+ class: "absolute top-0 w-full",
6609
+ "is-bold": "",
6610
+ "is-large": ""
6611
+ }, null, _parent));
6612
+ _push(`</div>`);
6613
+ } else {
6614
+ _push(`<!---->`);
6615
+ }
6616
+ _push(ssrRenderComponent(_component_Fade, { "is-leave-to": false }, {
6617
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6618
+ if (_push2) {
6619
+ _push2(ssrRenderComponent($setup["ProductGrid"], { products: $setup.products }, null, _parent2, _scopeId));
6620
+ } else {
6621
+ return [
6622
+ createVNode($setup["ProductGrid"], { products: $setup.products }, null, 8, ["products"])
6623
+ ];
6624
+ }
6625
+ }),
6626
+ _: 1
6627
+ }, _parent));
6628
+ _push(`<!--]-->`);
6629
+ }
6239
6630
  const _sfc_setup = _sfc_main.setup;
6240
6631
  _sfc_main.setup = (props, ctx) => {
6241
6632
  const ssrContext = useSSRContext();
6242
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductSpecifications.vue");
6633
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchContainer.vue");
6243
6634
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
6244
6635
  };
6245
- const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
6636
+ const SearchContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
6246
6637
 
6247
6638
  const $$Astro$3 = createAstro("https://demo.ecomplus.app");
6248
6639
  const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
@@ -6274,6 +6665,12 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
6274
6665
  return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
6275
6666
  ${renderComponent($$result2, "ProductDetails", ProductDetails, { ...detailsProps, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ProductDetails.vue", "client:component-export": "default" }, { "description": ($$result3) => renderTemplate`${renderComponent($$result3, "Fragment", Fragment, { "slot": "description" }, { "default": ($$result4) => renderTemplate`${hasDescription && renderTemplate`${renderComponent($$result4, "DocDescription", DocDescription, {})}`}${hasSpecifications && renderTemplate`${renderComponent($$result4, "ProductSpecifications", ProductSpecifications, {})}`}` })}` })}
6276
6667
  ` })}`;
6668
+ case "search-container":
6669
+ return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
6670
+ <article class="min-h-[500px]">
6671
+ ${renderComponent($$result2, "SearchContainer", SearchContainer, { ...props, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/SearchContainer.vue", "client:component-export": "default" })}
6672
+ </article>
6673
+ ` })}`;
6277
6674
  case "c:foo":
6278
6675
  return renderTemplate`<div${addAttribute(props.foo, "data-foo")}></div>`;
6279
6676
  default:
@@ -6354,4 +6751,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
6354
6751
  url: $$url
6355
6752
  }, Symbol.toStringTag, { value: 'Module' }));
6356
6753
 
6357
- export { $$BaseHead as $, Banner as B, CheckoutLink as C, FooterStamps as F, ProductShelf as P, QuantitySelector as Q, _export_sfc as _, $$Picture as a, $$Base as b, $$BannerPictures as c, $$Sections as d, $$PageHeader as e, $$PageFooter as f, assetsDir as g, useStorage as h, imageConfig as i, Prices as j, freeShippingFromValue as k, loadRouteContext as l, ____slug_ as m, parseProduct as p, removeCartItem as r, shoppingCart as s, totalItems as t, usePageHero as u };
6754
+ export { $$BaseHead as $, Banner as B, CheckoutLink as C, FooterStamps as F, ProductShelf as P, QuantitySelector as Q, SearchEngine as S, _export_sfc as _, $$Picture as a, $$Base as b, $$BannerPictures as c, $$Sections as d, $$PageHeader as e, $$PageFooter as f, assetsDir as g, clearAccents as h, imageConfig as i, getSearchUrl as j, Prices as k, loadRouteContext as l, freeShippingFromValue as m, shoppingCart as n, ____slug_ as o, parseProduct as p, removeCartItem as r, searchHistory as s, totalItems as t, usePageHero as u };