cloudcommerce 0.22.0 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/.editorconfig +13 -0
  2. package/.gitmodules +3 -0
  3. package/.vscode/settings.json +2 -1
  4. package/CHANGELOG.md +28 -0
  5. package/ecomplus-stores/barra-doce/.devcontainer/devcontainer.json +30 -0
  6. package/ecomplus-stores/barra-doce/.editorconfig +13 -0
  7. package/ecomplus-stores/barra-doce/.eslintrc.cjs +3 -0
  8. package/ecomplus-stores/barra-doce/.firebaserc +5 -0
  9. package/ecomplus-stores/barra-doce/.github/build-and-deploy +1 -0
  10. package/ecomplus-stores/barra-doce/.github/renovate.json +5 -0
  11. package/ecomplus-stores/barra-doce/.github/workflows/build-and-deploy.yml +36 -0
  12. package/ecomplus-stores/barra-doce/.github/workflows/calibreapp-image-actions.yml +23 -0
  13. package/ecomplus-stores/barra-doce/.gitpod.yml +12 -0
  14. package/ecomplus-stores/barra-doce/.nvmrc +1 -0
  15. package/ecomplus-stores/barra-doce/.vscode/extensions.json +8 -0
  16. package/ecomplus-stores/barra-doce/.vscode/launch.json +11 -0
  17. package/ecomplus-stores/barra-doce/.vscode/settings.json +10 -0
  18. package/ecomplus-stores/barra-doce/LICENSE.md +230 -0
  19. package/ecomplus-stores/barra-doce/README.md +31 -0
  20. package/ecomplus-stores/barra-doce/SETUP.md +117 -0
  21. package/ecomplus-stores/{iluminim/README.pt-BR.md → barra-doce/SETUP.pt-BR.md} +5 -1
  22. package/ecomplus-stores/barra-doce/functions/config.json +3 -0
  23. package/ecomplus-stores/barra-doce/functions/example.env +10 -0
  24. package/ecomplus-stores/barra-doce/functions/many/index.js +14 -0
  25. package/ecomplus-stores/barra-doce/functions/many/package.json +22 -0
  26. package/ecomplus-stores/barra-doce/functions/ssr/.eslintrc.cjs +6 -0
  27. package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +4 -0
  28. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
  29. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
  30. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +37 -0
  31. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +33 -0
  32. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +48 -0
  33. package/ecomplus-stores/barra-doce/functions/ssr/index.js +18 -0
  34. package/ecomplus-stores/barra-doce/functions/ssr/package.json +31 -0
  35. package/ecomplus-stores/barra-doce/functions/ssr/public/admin/.gitkeep +2 -0
  36. package/ecomplus-stores/barra-doce/functions/ssr/public/assets/.gitkeep +2 -0
  37. package/ecomplus-stores/barra-doce/functions/ssr/public/img/icon.png +0 -0
  38. package/ecomplus-stores/barra-doce/functions/ssr/public/img/large-icon.png +0 -0
  39. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner-forma-decora.jpg +0 -0
  40. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner2.webp +0 -0
  41. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  42. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/headphone.webp +0 -0
  43. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo-barradoce.webp +0 -0
  44. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo.png +0 -0
  45. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/og-image.png +0 -0
  46. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/passion.webp +0 -0
  47. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect8589.png +0 -0
  48. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect859.png +0 -0
  49. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect89.webp +0 -0
  50. package/ecomplus-stores/barra-doce/functions/ssr/public/robots.txt +8 -0
  51. package/ecomplus-stores/barra-doce/functions/ssr/scripts/build.sh +14 -0
  52. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +65 -0
  53. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +104 -0
  54. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +64 -0
  55. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +25 -0
  56. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +35 -0
  57. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +51 -0
  58. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +53 -0
  59. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +96 -0
  60. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +117 -0
  61. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +60 -0
  62. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +6 -0
  63. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +136 -0
  64. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderMenu.vue +58 -0
  65. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +88 -0
  66. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +61 -0
  67. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenavCategory.vue +80 -0
  68. package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +13 -0
  69. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Base.astro +15 -0
  70. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Checkout.astro +0 -0
  71. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +38 -0
  72. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +10 -0
  73. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +29 -0
  74. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Sections.astro +29 -0
  75. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +18 -0
  76. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +40 -0
  77. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/_vue.ts +3 -0
  78. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +0 -0
  79. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +0 -0
  80. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/fallback.astro +25 -0
  81. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +35 -0
  82. package/ecomplus-stores/barra-doce/functions/ssr/src/scripts/InlineScripts.astro +10 -0
  83. package/ecomplus-stores/barra-doce/functions/ssr/tailwind.config.cjs +19 -0
  84. package/ecomplus-stores/barra-doce/functions/ssr/tsconfig.json +12 -0
  85. package/ecomplus-stores/barra-doce/functions/ssr/uno.config.cjs +5 -0
  86. package/ecomplus-stores/barra-doce/functions/with-apps/index.js +12 -0
  87. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +22 -0
  88. package/ecomplus-stores/barra-doce/package.json +28 -0
  89. package/ecomplus-stores/barra-doce/scripts/install.sh +14 -0
  90. package/ecomplus-stores/iluminim/.editorconfig +13 -0
  91. package/ecomplus-stores/iluminim/README.md +11 -93
  92. package/ecomplus-stores/iluminim/SETUP.md +117 -0
  93. package/ecomplus-stores/iluminim/SETUP.pt-BR.md +117 -0
  94. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  95. package/ecomplus-stores/iluminim/functions/ssr/package.json +6 -6
  96. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
  97. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +2 -2
  98. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +4 -2
  99. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +6 -1
  100. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  101. package/ecomplus-stores/iluminim/package.json +1 -1
  102. package/package.json +6 -6
  103. package/packages/api/package.json +1 -1
  104. package/packages/apps/affilate-program/package.json +1 -1
  105. package/packages/apps/correios/package.json +1 -1
  106. package/packages/apps/custom-payment/package.json +1 -1
  107. package/packages/apps/custom-shipping/package.json +1 -1
  108. package/packages/apps/datafrete/package.json +1 -1
  109. package/packages/apps/discounts/package.json +1 -1
  110. package/packages/apps/emails/package.json +1 -1
  111. package/packages/apps/fb-conversions/package.json +2 -2
  112. package/packages/apps/flash-courier/package.json +1 -1
  113. package/packages/apps/frenet/package.json +1 -1
  114. package/packages/apps/galaxpay/package.json +1 -1
  115. package/packages/apps/google-analytics/package.json +1 -1
  116. package/packages/apps/jadlog/package.json +1 -1
  117. package/packages/apps/loyalty-points/package.json +1 -1
  118. package/packages/apps/melhor-envio/package.json +1 -1
  119. package/packages/apps/mercadopago/package.json +1 -1
  120. package/packages/apps/pagarme/package.json +1 -1
  121. package/packages/apps/paghiper/package.json +1 -1
  122. package/packages/apps/pix/package.json +1 -1
  123. package/packages/apps/tiny-erp/package.json +1 -1
  124. package/packages/apps/webhooks/package.json +1 -1
  125. package/packages/cli/lib/build.js +15 -4
  126. package/packages/cli/lib/cli.js +3 -3
  127. package/packages/cli/package.json +1 -1
  128. package/packages/cli/src/build.ts +17 -4
  129. package/packages/cli/src/cli.ts +3 -3
  130. package/packages/config/package.json +1 -1
  131. package/packages/emails/package.json +1 -1
  132. package/packages/events/package.json +1 -1
  133. package/packages/feeds/package.json +1 -1
  134. package/packages/firebase/package.json +1 -1
  135. package/packages/i18n/lib/dirname.js +3 -1
  136. package/packages/i18n/lib/dirname.js.map +1 -1
  137. package/packages/i18n/package.json +1 -1
  138. package/packages/i18n/scripts/build-txt.mjs +2 -1
  139. package/packages/i18n/src/dirname.ts +3 -1
  140. package/packages/modules/package.json +1 -1
  141. package/packages/passport/package.json +1 -1
  142. package/packages/ssr/package.json +2 -2
  143. package/packages/storefront/astro.config.mjs +2 -1
  144. package/packages/storefront/dist/client/_astro/HeroSlider.cea1f361.js +1 -0
  145. package/packages/storefront/dist/client/_astro/{ProductShelf.9e290480.js → ProductShelf.35614736.js} +1 -1
  146. package/packages/storefront/dist/client/_astro/ShopHeader.dbe9c1f1.js +4 -0
  147. package/packages/storefront/dist/client/_astro/{_...slug_.c85b8978.css → _...slug_.c13e0486.css} +1 -1
  148. package/packages/storefront/dist/client/assets/.gitkeep +2 -0
  149. package/packages/storefront/dist/client/sw.js +1 -1
  150. package/packages/storefront/dist/server/chunks/{_...7e1df40a.mjs → _...fac94758.mjs} +3 -3
  151. package/packages/storefront/dist/server/chunks/{account@_@astro.5f1dba7a.mjs → account@_@astro.460623ee.mjs} +3 -3
  152. package/packages/storefront/dist/server/chunks/{astro.2d3ebf0f.mjs → astro.e0968ba7.mjs} +201 -156
  153. package/packages/storefront/dist/server/chunks/{endpoint@_@js.80de0568.mjs → endpoint@_@js.35380ea5.mjs} +3 -3
  154. package/packages/storefront/dist/server/chunks/{fallback@_@astro.02a45b47.mjs → fallback@_@astro.dbc26d2d.mjs} +3 -3
  155. package/packages/storefront/dist/server/chunks/{index@_@astro.7cb07e52.mjs → index@_@astro.c91e679e.mjs} +3 -3
  156. package/packages/storefront/dist/server/chunks/{index@_@astro.23b50301.mjs → index@_@astro.fec107b9.mjs} +3 -3
  157. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.4358f614.mjs → _...slug_.astro.2e2d4770.mjs} +81 -39
  158. package/packages/storefront/dist/server/chunks/pages/{account.astro.afae5a12.mjs → account.astro.0003ca94.mjs} +1 -1
  159. package/packages/storefront/dist/server/chunks/pages/{endpoint.js.60fd21aa.mjs → endpoint.js.6f0f4ede.mjs} +1 -1
  160. package/packages/storefront/dist/server/chunks/pages/{fallback.astro.e5566925.mjs → fallback.astro.fc8bc7e7.mjs} +2 -2
  161. package/packages/storefront/dist/server/chunks/pages/{index.astro.5bc6b9d8.mjs → index.astro.03adcc55.mjs} +6 -6
  162. package/packages/storefront/dist/server/entry.mjs +9 -9
  163. package/packages/storefront/dist/server/renderers.mjs +2 -2
  164. package/packages/storefront/package.json +5 -5
  165. package/packages/storefront/src/lib/$storefront.d.ts +1 -0
  166. package/packages/storefront/src/lib/components/SharedData.astro +13 -0
  167. package/packages/storefront/src/lib/composables/use-prices.ts +1 -1
  168. package/packages/storefront/src/lib/composables/use-shop-header-submenu.ts +10 -1
  169. package/packages/storefront/src/lib/composables/use-shop-header.ts +13 -13
  170. package/packages/storefront/src/lib/layouts/BaseHead.astro +1 -1
  171. package/packages/storefront/src/lib/layouts/use-page-header.ts +14 -2
  172. package/packages/storefront/src/lib/ssr-context.ts +1 -0
  173. package/packages/types/package.json +1 -1
  174. package/pnpm-workspace.yaml +2 -0
  175. package/packages/storefront/dist/client/_astro/HeroSlider.0890631f.js +0 -1
  176. package/packages/storefront/dist/client/_astro/ShopHeader.82ae97a5.js +0 -4
  177. package/packages/storefront/dist/client/assets/cms-preview.css +0 -274
  178. package/packages/storefront/dist/client/assets/cms.css +0 -114
  179. package/packages/storefront/dist/client/assets/cvv.png +0 -0
  180. package/packages/storefront/dist/client/assets/img-placeholder.png +0 -0
  181. package/packages/storefront/dist/client/assets/payments.png +0 -0
  182. package/packages/storefront/dist/client/assets/ssl-safe.png +0 -0
@@ -8,7 +8,7 @@ import sizeOf from 'image-size';
8
8
  import 'magic-string';
9
9
  import mime from 'mime';
10
10
  import 'node:stream';
11
- import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.2d3ebf0f.mjs';
11
+ import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.e0968ba7.mjs';
12
12
  import api from '@cloudcommerce/api';
13
13
  import { EventEmitter } from 'node:events';
14
14
  import fs from 'node:fs';
@@ -274,7 +274,8 @@ if (!globalThis.$storefront) {
274
274
  settings: {},
275
275
  onLoad(callback) {
276
276
  emitter.on("load", callback);
277
- }
277
+ },
278
+ data: {}
278
279
  };
279
280
  }
280
281
  const setResponseCache = (Astro, maxAge, sMaxAge) => {
@@ -404,13 +405,13 @@ const loadRouteContext = async (Astro, {
404
405
 
405
406
  const pwaInfo = {"pwaInDevEnvironment":false,"webManifest":{"href":"/manifest.webmanifest","useCredentials":false,"linkTag":"<link rel=\"manifest\" href=\"/manifest.webmanifest\">"}};
406
407
 
407
- var __freeze$1 = Object.freeze;
408
- var __defProp$1 = Object.defineProperty;
409
- var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
410
- var _a$1;
411
- const $$Astro$8 = createAstro("https://ecom2-demo.web.app");
408
+ var __freeze$2 = Object.freeze;
409
+ var __defProp$2 = Object.defineProperty;
410
+ var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
411
+ var _a$2;
412
+ const $$Astro$9 = createAstro("https://ecom2-demo.web.app");
412
413
  const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
413
- const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
414
+ const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
414
415
  Astro2.self = $$BaseHead;
415
416
  const deployRand = ({}).DEPLOY_RAND || "_";
416
417
  const getIconUrl = (size) => {
@@ -461,7 +462,7 @@ window.ECOM_LANG = '${lang}';
461
462
  window.ECOM_CURRENCY = '${currency}';
462
463
  window.ECOM_CURRENCY_SYMBOL = '${currencySymbol}';
463
464
  window.ECOM_COUNTRY_CODE = '${countryCode}';
464
- window.$storefront = ${JSON.stringify({ settings })};`;
465
+ window.$storefront = ${JSON.stringify({ settings, data: {} })};`;
465
466
  if (apiContext.error) {
466
467
  const { message, statusCode } = apiContext.error;
467
468
  const url = Astro2.url.pathname;
@@ -511,7 +512,7 @@ window.$isCmsPreview = true;`;
511
512
  url: `https://${domain}/`,
512
513
  logo: `https://${domain}${settings.logo}`
513
514
  });
514
- return renderTemplate(_a$1 || (_a$1 = __template$1(['<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\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>"])), 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?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
515
+ return renderTemplate(_a$2 || (_a$2 = __template$2(['<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\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>"])), 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?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
515
516
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", void 0);
516
517
 
517
518
  function isRemoteImage(src) {
@@ -600,7 +601,7 @@ async function getImage(transform) {
600
601
  }
601
602
  let loader = (_a = globalThis.astroImage) == null ? void 0 : _a.loader;
602
603
  if (!loader) {
603
- const { default: mod } = await import('./endpoint.js.60fd21aa.mjs').then(n => n.s).catch(() => {
604
+ const { default: mod } = await import('./endpoint.js.6f0f4ede.mjs').then(n => n.s).catch(() => {
604
605
  throw new Error(
605
606
  "[@astrojs/image] Builtin image loader not found. (Did you remember to add the integration to your Astro config?)"
606
607
  );
@@ -828,9 +829,9 @@ const useSSRPicture = async (params) => {
828
829
  };
829
830
  };
830
831
 
831
- const $$Astro$7 = createAstro("https://ecom2-demo.web.app");
832
+ const $$Astro$8 = createAstro("https://ecom2-demo.web.app");
832
833
  const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
833
- const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
834
+ const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
834
835
  Astro2.self = $$Picture;
835
836
  const deployRand = ({}).DEPLOY_RAND;
836
837
  const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
@@ -872,9 +873,9 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
872
873
  </picture>`;
873
874
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Picture.astro", void 0);
874
875
 
875
- const $$Astro$6 = createAstro("https://ecom2-demo.web.app");
876
+ const $$Astro$7 = createAstro("https://ecom2-demo.web.app");
876
877
  const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
877
- const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
878
+ const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
878
879
  Astro2.self = $$BaseBody;
879
880
  const { settings } = Astro2.locals.routeContext;
880
881
  return renderTemplate`${maybeRenderHead()}<body>
@@ -887,9 +888,9 @@ const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
887
888
  </body>`;
888
889
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro", void 0);
889
890
 
890
- const $$Astro$5 = createAstro("https://ecom2-demo.web.app");
891
+ const $$Astro$6 = createAstro("https://ecom2-demo.web.app");
891
892
  const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
892
- const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
893
+ const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
893
894
  Astro2.self = $$Base$1;
894
895
  const { getContent } = Astro2.locals.routeContext;
895
896
  const { custom_code: customCodeContent } = await getContent("layout");
@@ -907,20 +908,20 @@ ${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2)
907
908
  ` })}`;
908
909
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
909
910
 
910
- var __freeze = Object.freeze;
911
- var __defProp = Object.defineProperty;
912
- var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
913
- var _a;
914
- const $$Astro$4 = createAstro("https://ecom2-demo.web.app");
911
+ var __freeze$1 = Object.freeze;
912
+ var __defProp$1 = Object.defineProperty;
913
+ var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
914
+ var _a$1;
915
+ const $$Astro$5 = createAstro("https://ecom2-demo.web.app");
915
916
  const $$InlineScripts = createComponent(async ($$result, $$props, $$slots) => {
916
- const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
917
+ const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
917
918
  Astro2.self = $$InlineScripts;
918
- return renderTemplate(_a || (_a = __template(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
919
+ return renderTemplate(_a$1 || (_a$1 = __template$1(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
919
920
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/scripts/InlineScripts.astro", void 0);
920
921
 
921
- const $$Astro$3 = createAstro("https://ecom2-demo.web.app");
922
+ const $$Astro$4 = createAstro("https://ecom2-demo.web.app");
922
923
  const $$Base = createComponent(async ($$result, $$props, $$slots) => {
923
- const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
924
+ const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
924
925
  Astro2.self = $$Base;
925
926
  return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
926
927
  ${renderSlot($$result3, $$slots["base-head"])}
@@ -1054,7 +1055,7 @@ const usePitchBar = (props) => {
1054
1055
  };
1055
1056
  };
1056
1057
 
1057
- const usePageHeader = async ({ routeContext }) => {
1058
+ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
1058
1059
  const { apiState, getContent } = routeContext;
1059
1060
  const layoutContent = await getContent("layout");
1060
1061
  const {
@@ -1065,7 +1066,18 @@ const usePageHeader = async ({ routeContext }) => {
1065
1066
  let { categories } = apiState;
1066
1067
  if (!categories) {
1067
1068
  try {
1068
- categories = (await api.get("categories")).data.result;
1069
+ categories = (await api.get("categories", {
1070
+ fields: listedCategoryFields || [
1071
+ "name",
1072
+ "slug",
1073
+ "parent.name",
1074
+ "parent.slug",
1075
+ "icon.url",
1076
+ "icon.size",
1077
+ "pictures.0.url",
1078
+ "pictures.0.size"
1079
+ ]
1080
+ })).data.result;
1069
1081
  } catch (err) {
1070
1082
  categories = [];
1071
1083
  console.error(err);
@@ -1084,6 +1096,21 @@ const usePageHeader = async ({ routeContext }) => {
1084
1096
  };
1085
1097
  };
1086
1098
 
1099
+ var __freeze = Object.freeze;
1100
+ var __defProp = Object.defineProperty;
1101
+ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
1102
+ var _a;
1103
+ const $$Astro$3 = createAstro("https://ecom2-demo.web.app");
1104
+ const $$SharedData = createComponent(async ($$result, $$props, $$slots) => {
1105
+ const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
1106
+ Astro2.self = $$SharedData;
1107
+ const { field, value } = Astro2.props;
1108
+ global.$storefront.data[field] = value;
1109
+ let inlineClientJS = `
1110
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`;
1111
+ return renderTemplate(_a || (_a = __template(["<script>", "<\/script>"])), unescapeHTML(inlineClientJS));
1112
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/SharedData.astro", void 0);
1113
+
1087
1114
  const carouselKey = Symbol("carousel");
1088
1115
 
1089
1116
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
@@ -1683,7 +1710,7 @@ const filterMainCategories = (categories, featuredSlugs) => {
1683
1710
  const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = false) => {
1684
1711
  const subcategories = categories.filter(({ name, slug, parent }) => {
1685
1712
  if (name && slug && parent) {
1686
- return parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
1713
+ return parent._id && parent._id === parentCategory._id || parent.slug && parent.slug === parentCategory.slug;
1687
1714
  }
1688
1715
  return false;
1689
1716
  });
@@ -1698,7 +1725,7 @@ const filterSubcategories = (categories, parentCategory, isAlphabeticalSort = fa
1698
1725
  };
1699
1726
  const useShopHeader = ({
1700
1727
  header,
1701
- categories,
1728
+ categories = globalThis.$storefront.data.categories || [],
1702
1729
  menuCategorySlugs,
1703
1730
  menuRandomCategories = 7,
1704
1731
  isAlphabeticalSortSubmenu
@@ -2180,15 +2207,16 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2180
2207
  if (!$setup.isOpen && $props.categoryTree.icon) {
2181
2208
  _push(ssrRenderComponent(_component_AImg, {
2182
2209
  picture: $props.categoryTree.icon,
2210
+ alt: $props.categoryTree.name,
2183
2211
  class: "w-auto h-5 inline mr-3"
2184
2212
  }, null, _parent));
2185
2213
  } else {
2186
2214
  _push(`<!---->`);
2187
2215
  }
2188
2216
  _push(`<h3 class="${ssrRenderClass([$setup.isOpen ? "ml-4 text-base" : null, "inline"])}">${ssrInterpolate($props.categoryTree.name)}</h3></summary><ul class="${ssrRenderClass([$setup.isFaded ? "opacity-20" : "opacity-100", "mt-2 transition-opacity"])}" tabindex="-1"><!--[-->`);
2189
- ssrRenderList($props.categoryTree.subcategories, (subcategoryTree) => {
2217
+ ssrRenderList($props.categoryTree.subcategories, (subcategoryTree, i) => {
2190
2218
  _push(ssrRenderComponent(_component_ShopSidenavCategory, {
2191
- key: subcategoryTree._id,
2219
+ key: i,
2192
2220
  "category-tree": subcategoryTree
2193
2221
  }, null, _parent));
2194
2222
  });
@@ -2198,6 +2226,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2198
2226
  if (!$setup.isOpen && $props.categoryTree.icon) {
2199
2227
  _push(ssrRenderComponent(_component_AImg, {
2200
2228
  picture: $props.categoryTree.icon,
2229
+ alt: $props.categoryTree.name,
2201
2230
  class: "w-auto h-5 inline mr-3"
2202
2231
  }, null, _parent));
2203
2232
  } else {
@@ -2238,9 +2267,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2238
2267
  });
2239
2268
  function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2240
2269
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-full" }, _attrs))}><nav class="py-4 grow"><ul class="relative h-full"><!--[-->`);
2241
- ssrRenderList($props.categoryTrees, (categoryTree) => {
2270
+ ssrRenderList($props.categoryTrees, (categoryTree, i) => {
2242
2271
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
2243
- key: categoryTree._id,
2272
+ key: i,
2244
2273
  "category-tree": categoryTree
2245
2274
  }, null, _parent));
2246
2275
  });
@@ -2286,7 +2315,16 @@ _sfc_main$6.setup = (props, ctx) => {
2286
2315
  const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
2287
2316
 
2288
2317
  const useShopHeaderSubmenu = (props) => {
2289
- const categoryPicture = computed(() => props.categoryTree.pictures?.[0]);
2318
+ const categoryPicture = computed(() => {
2319
+ const picture = props.categoryTree.pictures?.[0];
2320
+ if (picture && !picture.alt) {
2321
+ return {
2322
+ alt: props.categoryTree.name,
2323
+ ...picture
2324
+ };
2325
+ }
2326
+ return void 0;
2327
+ });
2290
2328
  const subcategoriesWithChild = computed(() => {
2291
2329
  return props.categoryTree.subcategories.filter(({ subcategories }) => subcategories.length);
2292
2330
  });
@@ -2429,7 +2467,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2429
2467
  ])) : createCommentVNode("", true),
2430
2468
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2431
2469
  return openBlock(), createBlock("div", {
2432
- key: subcategory._id,
2470
+ key: i,
2433
2471
  class: "flex-1"
2434
2472
  }, [
2435
2473
  createVNode("a", {
@@ -2501,7 +2539,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2501
2539
  ])) : createCommentVNode("", true),
2502
2540
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2503
2541
  return openBlock(), createBlock("div", {
2504
- key: subcategory._id,
2542
+ key: i,
2505
2543
  class: "flex-1"
2506
2544
  }, [
2507
2545
  createVNode("a", {
@@ -2586,7 +2624,7 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2586
2624
  ])) : createCommentVNode("", true),
2587
2625
  (openBlock(true), createBlock(Fragment$1, null, renderList($setup.subcategoryCols, (subcategory, i) => {
2588
2626
  return openBlock(), createBlock("div", {
2589
- key: subcategory._id,
2627
+ key: i,
2590
2628
  class: "flex-1"
2591
2629
  }, [
2592
2630
  createVNode("a", {
@@ -3543,11 +3581,15 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3543
3581
  const { routeContext } = Astro2.locals;
3544
3582
  const { settings, isHomepage } = routeContext;
3545
3583
  const LogoHeading = isHomepage ? "h1" : "h2";
3546
- const { pitchBar, shopHeader } = await usePageHeader({ routeContext });
3584
+ const {
3585
+ pitchBar,
3586
+ shopHeader: { categories, ...shopHeader }
3587
+ } = await usePageHeader({ routeContext });
3547
3588
  return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate`
3548
3589
  ${pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`}
3549
3590
  ${pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`}
3550
3591
 
3592
+ ${renderComponent($$result, "SharedData", $$SharedData, { "field": "categories", "value": categories?.map(({ _id, ...c }) => c) })}
3551
3593
  ${renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
3552
3594
  ${maybeRenderHead()}<a href="/">
3553
3595
  ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result4) => renderTemplate`${renderComponent($$result4, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}
@@ -1,4 +1,4 @@
1
- import { c as createAstro, a as createComponent, r as renderTemplate } from '../astro.2d3ebf0f.mjs';
1
+ import { c as createAstro, a as createComponent, r as renderTemplate } from '../astro.e0968ba7.mjs';
2
2
  import 'path-to-regexp';
3
3
  import 'cookie';
4
4
  import '@astrojs/internal-helpers/path';
@@ -1,6 +1,6 @@
1
1
  import mime from 'mime';
2
2
  import sharp$1 from 'sharp';
3
- import { B as BaseSSRService, i as isOutputFormatSupportsAlpha } from './_...slug_.astro.4358f614.mjs';
3
+ import { B as BaseSSRService, i as isOutputFormatSupportsAlpha } from './_...slug_.astro.2e2d4770.mjs';
4
4
 
5
5
  class SharpService extends BaseSSRService {
6
6
  async transform(inputBuffer, transform) {
@@ -1,5 +1,5 @@
1
- import { c as createAstro, a as createComponent, r as renderTemplate, m as maybeRenderHead, d as addAttribute, b as renderComponent } from '../astro.2d3ebf0f.mjs';
2
- import { l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.4358f614.mjs';
1
+ import { c as createAstro, a as createComponent, r as renderTemplate, m as maybeRenderHead, d as addAttribute, b as renderComponent } from '../astro.e0968ba7.mjs';
2
+ import { l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.2e2d4770.mjs';
3
3
  import 'path-to-regexp';
4
4
  import 'cookie';
5
5
  import '@astrojs/internal-helpers/path';
@@ -1,5 +1,5 @@
1
- import { c as createAstro, a as createComponent, r as renderTemplate, b as renderComponent, m as maybeRenderHead, d as addAttribute, u as unescapeHTML, F as Fragment$1 } from '../astro.2d3ebf0f.mjs';
2
- import { c as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, d as CarouselControl, e as availableExtraDiscount, f as installmentsOption, g as discountOption, h as loyaltyPointsPrograms, j as addProductToCart, l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.4358f614.mjs';
1
+ import { c as createAstro, a as createComponent, r as renderTemplate, b as renderComponent, m as maybeRenderHead, d as addAttribute, u as unescapeHTML, F as Fragment$1 } from '../astro.e0968ba7.mjs';
2
+ import { c as $$Picture, p as parseShippingPhrase, _ as _export_sfc, C as Carousel, d as CarouselControl, e as availableExtraDiscount, f as installmentsOption, g as discountOption, h as loyaltyPointsPrograms, j as addProductToCart, l as loadRouteContext, $ as $$BaseHead, a as $$PageHeader, b as $$Base } from './_...slug_.astro.2e2d4770.mjs';
3
3
  import { ref, shallowReactive, computed, useSSRContext, defineComponent, mergeProps, createVNode, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, withDirectives, vShow, openBlock, createBlock, Fragment, renderList, resolveComponent, createCommentVNode, withModifiers, withAsyncContext } from 'vue';
4
4
  import api from '@cloudcommerce/api';
5
5
  import { inStock, price, name, img, onPromotion } from '@ecomplus/utils';
@@ -288,11 +288,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
288
288
  });
289
289
  function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
290
290
  _push(`<div${ssrRenderAttrs(mergeProps({
291
- class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 md:grid-cols-2 items-center" : null]
291
+ class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
292
292
  }, _attrs))}>`);
293
293
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.href ? "a-link" : "span"), {
294
294
  href: $props.href,
295
- class: $setup.hasHeader ? "basis-1/2 grow-0 md:order-last" : null
295
+ class: $setup.hasHeader ? "sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover" : "[&_img]:max-w-full"
296
296
  }, {
297
297
  default: withCtx((_, _push2, _parent2, _scopeId) => {
298
298
  if (_push2) {
@@ -306,7 +306,7 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
306
306
  _: 3
307
307
  }), _parent);
308
308
  if ($setup.hasHeader) {
309
- _push(`<div class="basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0">`);
309
+ _push(`<div class="p-12 xl:ps-32 mb-3 sm:mb-0">`);
310
310
  if ($setup.parsedTitle) {
311
311
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.headingTag), { class: "ui-title mt-1" }, {
312
312
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -641,7 +641,7 @@ const usePrices = (props) => {
641
641
  return 1;
642
642
  }
643
643
  const minInstallment = installmentsObject.value.min_installment || 5;
644
- const maxInstallmentsNumber = Math.round(salePrice.value / minInstallment);
644
+ const maxInstallmentsNumber = Math.floor(salePrice.value / minInstallment);
645
645
  return Math.min(maxInstallmentsNumber, installmentsObject.value.max_number);
646
646
  });
647
647
  const monthlyInterest = computed(() => {
@@ -3,7 +3,7 @@ import { webcrypto } from 'node:crypto';
3
3
  import { ByteLengthQueuingStrategy, CountQueuingStrategy, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, TransformStream, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter } from 'node:stream/web';
4
4
  import { File, FormData, Headers, Request, Response, fetch } from 'undici';
5
5
  import { setTimeout as setTimeout$1, clearTimeout as clearTimeout$1 } from 'node:timers';
6
- import { N as NodeApp, g as deserializeManifest } from './chunks/astro.2d3ebf0f.mjs';
6
+ import { N as NodeApp, g as deserializeManifest } from './chunks/astro.e0968ba7.mjs';
7
7
  import { Readable } from 'stream';
8
8
  import https from 'https';
9
9
  import path from 'path';
@@ -26,7 +26,7 @@ import 'html-escaper';
26
26
  import 'vue';
27
27
  import 'vue/server-renderer';
28
28
  import '@ecomplus/utils';
29
- import './chunks/pages/_...slug_.astro.4358f614.mjs';
29
+ import './chunks/pages/_...slug_.astro.2e2d4770.mjs';
30
30
  import 'node:fs/promises';
31
31
  import 'node:path';
32
32
  import 'node:url';
@@ -2825,13 +2825,13 @@ const adapter = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2825
2825
  start
2826
2826
  }, Symbol.toStringTag, { value: 'Module' }));
2827
2827
 
2828
- const _page0 = () => import('./chunks/endpoint@_@js.80de0568.mjs');
2829
- const _page1 = () => import('./chunks/index@_@astro.23b50301.mjs');
2830
- const _page2 = () => import('./chunks/fallback@_@astro.02a45b47.mjs');
2831
- const _page3 = () => import('./chunks/index@_@astro.7cb07e52.mjs');
2832
- const _page4 = () => import('./chunks/account@_@astro.5f1dba7a.mjs');
2833
- const _page5 = () => import('./chunks/_...7e1df40a.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.0_sharp@0.32.3/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5]]);
2834
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.0_sharp@0.32.3/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c85b8978.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c85b8978.css"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c85b8978.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-demo.web.app","base":"/","compressHTML":false,"markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,n)=>{let s=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),s();break}});for(let e of n.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account.astro.afae5a12.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.e5566925.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.0_sharp@0.32.3/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.80de0568.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.23b50301.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.02a45b47.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.7cb07e52.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.5f1dba7a.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...7e1df40a.mjs","~/components/PitchBar.vue":"_astro/PitchBar.ed85833a.js","@astrojs/vue/client.js":"_astro/client.0fb6b44e.js","/astro/hoisted.js?q=0":"_astro/hoisted.572313d6.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","~/components/HeroSlider.vue":"_astro/HeroSlider.0890631f.js","~/components/ProductShelf.vue":"_astro/ProductShelf.9e290480.js","~/components/ShopHeader.vue":"_astro/ShopHeader.82ae97a5.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.84207480.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_...slug_.c85b8978.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.62c97a79.js","/_astro/HeroSlider.0890631f.js","/_astro/PitchBar.ed85833a.js","/_astro/ProductShelf.9e290480.js","/_astro/ShopHeader.82ae97a5.js","/_astro/_plugin-vue_export-helper.4cb7dd76.js","/_astro/api.4984c5be.js","/_astro/client.0fb6b44e.js","/_astro/firebase-app.84207480.js","/_astro/hoisted.572313d6.js","/_astro/img.abbe849f.js","/_astro/index.b93f3d06.js","/_astro/preload-helper.cf010ec4.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]}), {
2828
+ const _page0 = () => import('./chunks/endpoint@_@js.35380ea5.mjs');
2829
+ const _page1 = () => import('./chunks/index@_@astro.fec107b9.mjs');
2830
+ const _page2 = () => import('./chunks/fallback@_@astro.dbc26d2d.mjs');
2831
+ const _page3 = () => import('./chunks/index@_@astro.c91e679e.mjs');
2832
+ const _page4 = () => import('./chunks/account@_@astro.460623ee.mjs');
2833
+ const _page5 = () => import('./chunks/_...fac94758.mjs');const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5]]);
2834
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.572313d6.js"}],"styles":[{"type":"external","src":"/_astro/_...slug_.c13e0486.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-demo.web.app","base":"/","compressHTML":false,"markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/fallback.astro",{"propagation":"none","containsHead":true}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,n)=>{let s=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),s();break}});for(let e of n.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account.astro.0003ca94.mjs","/src/pages/fallback.astro":"chunks/pages/fallback.astro.fc8bc7e7.mjs","\u0000@astro-page:../../node_modules/.pnpm/@astrojs+image@0.17.2_astro@2.9.2_sharp@0.32.4/node_modules/@astrojs/image/dist/endpoint@_@js":"chunks/endpoint@_@js.35380ea5.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index@_@astro.fec107b9.mjs","\u0000@astro-page:src/pages/fallback@_@astro":"chunks/fallback@_@astro.dbc26d2d.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index@_@astro.c91e679e.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account@_@astro.460623ee.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_...fac94758.mjs","~/components/PitchBar.vue":"_astro/PitchBar.ed85833a.js","@astrojs/vue/client.js":"_astro/client.0fb6b44e.js","~/components/ProductShelf.vue":"_astro/ProductShelf.35614736.js","~/components/HeroSlider.vue":"_astro/HeroSlider.cea1f361.js","/astro/hoisted.js?q=0":"_astro/hoisted.572313d6.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.a7b12eab.js","~/components/ShopHeader.vue":"_astro/ShopHeader.dbe9c1f1.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.84207480.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_...slug_.c13e0486.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-5e0bf4e4.js","/_astro/Carousel.62c97a79.js","/_astro/HeroSlider.cea1f361.js","/_astro/PitchBar.ed85833a.js","/_astro/ProductShelf.35614736.js","/_astro/ShopHeader.dbe9c1f1.js","/_astro/_plugin-vue_export-helper.4cb7dd76.js","/_astro/api.4984c5be.js","/_astro/client.0fb6b44e.js","/_astro/firebase-app.84207480.js","/_astro/hoisted.572313d6.js","/_astro/img.abbe849f.js","/_astro/index.b93f3d06.js","/_astro/preload-helper.cf010ec4.js","/_astro/session-utm.744b0db3.js","/_astro/workbox-window.prod.es5.a7b12eab.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]}), {
2835
2835
  pageMap,
2836
2836
  renderers,
2837
2837
  });
@@ -1,8 +1,8 @@
1
- import { h as server_default } from './chunks/astro.2d3ebf0f.mjs';
1
+ import { h as server_default } from './chunks/astro.e0968ba7.mjs';
2
2
  import { useSSRContext, defineComponent, computed, mergeProps, h, createSSRApp } from 'vue';
3
3
  import { ssrRenderSlotInner, ssrRenderAttrs, ssrRenderSlot, renderToString } from 'vue/server-renderer';
4
4
  import { img, imgSizes, i18n, formatMoney } from '@ecomplus/utils';
5
- import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.4358f614.mjs';
5
+ import { _ as _export_sfc } from './chunks/pages/_...slug_.astro.2e2d4770.mjs';
6
6
  import 'path-to-regexp';
7
7
  import 'cookie';
8
8
  import '@astrojs/internal-helpers/path';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.22.0",
4
+ "version": "0.22.2",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -43,17 +43,17 @@
43
43
  "@iconify-json/logos": "^1.1.33",
44
44
  "@vite-pwa/astro": "^0.1.1",
45
45
  "@vueuse/core": "10.2.1",
46
- "astro": "2.9.0",
46
+ "astro": "2.9.2",
47
47
  "chroma-js": "^2.4.2",
48
48
  "dotenv": "^16.3.1",
49
49
  "firebase": "^9.23.0",
50
50
  "image-size": "^1.0.2",
51
51
  "mime": "^3.0.0",
52
52
  "semver": "^7.5.4",
53
- "sharp": "^0.32.3",
53
+ "sharp": "^0.32.4",
54
54
  "tailwindcss": "^3.3.3",
55
- "unocss": "^0.53.5",
56
- "vite": "^4.4.4",
55
+ "unocss": "^0.53.6",
56
+ "vite": "^4.4.6",
57
57
  "vite-plugin-pwa": "^0.16.4",
58
58
  "vue": "^3.3.4"
59
59
  },
@@ -25,4 +25,5 @@ export type $Storefront = {
25
25
  doc: CollectionSet,
26
26
  timestamp: number,
27
27
  },
28
+ data: Record<string, any>,
28
29
  };
@@ -0,0 +1,13 @@
1
+ ---
2
+ export interface Props {
3
+ field: string;
4
+ value: any;
5
+ }
6
+
7
+ const { field, value } = Astro.props;
8
+ global.$storefront.data[field] = value;
9
+ let inlineClientJS = `
10
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`;
11
+ ---
12
+
13
+ <script is:inline set:html={inlineClientJS} />
@@ -88,7 +88,7 @@ const usePrices = (props: Props) => {
88
88
  return 1;
89
89
  }
90
90
  const minInstallment = installmentsObject.value.min_installment || 5;
91
- const maxInstallmentsNumber = Math.round(salePrice.value / minInstallment);
91
+ const maxInstallmentsNumber = Math.floor(salePrice.value / minInstallment);
92
92
  return Math.min(maxInstallmentsNumber, installmentsObject.value.max_number);
93
93
  });
94
94
  const monthlyInterest = computed(() => {
@@ -7,7 +7,16 @@ export interface Props {
7
7
  }
8
8
 
9
9
  const useShopHeaderSubmenu = (props: Props) => {
10
- const categoryPicture = computed(() => props.categoryTree.pictures?.[0]);
10
+ const categoryPicture = computed(() => {
11
+ const picture = props.categoryTree.pictures?.[0];
12
+ if (picture && !picture.alt) {
13
+ return {
14
+ alt: props.categoryTree.name,
15
+ ...picture,
16
+ };
17
+ }
18
+ return undefined;
19
+ });
11
20
  const subcategoriesWithChild = computed(() => {
12
21
  return props.categoryTree.subcategories
13
22
  .filter(({ subcategories }) => subcategories.length);