cloudcommerce 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/action.yml +11 -3
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/~fallback.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +6 -6
- package/packages/api/lib/api.js +1 -1
- package/packages/api/lib/api.js.map +1 -1
- package/packages/api/package.json +1 -1
- package/packages/api/src/api.ts +1 -1
- package/packages/apps/affilate-program/package.json +2 -2
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/google-analytics/lib/google-analytics-events.js +4 -4
- package/packages/apps/google-analytics/lib/google-analytics-events.js.map +1 -1
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/google-analytics/src/google-analytics-events.ts +4 -4
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/package.json +2 -2
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/package.json +4 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +1 -1
- package/packages/events/package.json +2 -2
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/passport/package.json +2 -2
- package/packages/ssr/lib/analytics/send-to-ga4.js +44 -0
- package/packages/ssr/lib/analytics/send-to-ga4.js.map +1 -0
- package/packages/ssr/lib/analytics/send-to-meta.js +44 -0
- package/packages/ssr/lib/analytics/send-to-meta.js.map +1 -0
- package/packages/ssr/lib/analytics/send-to-tiktok.js +44 -0
- package/packages/ssr/lib/analytics/send-to-tiktok.js.map +1 -0
- package/packages/ssr/lib/analytics-events.js +52 -24
- package/packages/ssr/lib/analytics-events.js.map +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +16 -3
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +6 -5
- package/packages/ssr/src/analytics/send-to-ga4.ts +56 -0
- package/packages/ssr/src/analytics/send-to-meta.ts +50 -0
- package/packages/ssr/src/analytics/send-to-tiktok.ts +49 -0
- package/packages/ssr/src/analytics-events.ts +57 -27
- package/packages/ssr/src/firebase/serve-storefront.ts +17 -3
- package/packages/storefront/dist/client/_astro/AccountPage.700be123.js +1 -0
- package/packages/storefront/dist/client/_astro/{CartSidebar.8151e4ee.js → CartSidebar.430b55df.js} +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.06e0f831.js +1 -0
- package/packages/storefront/dist/client/_astro/{Prices.311303d8.js → Prices.0e829c31.js} +1 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +1 -0
- package/packages/storefront/dist/client/_astro/QuantitySelector.ebf60845.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +4 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +1 -0
- package/packages/storefront/dist/client/_astro/client.41b42098.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +1 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +1 -0
- package/packages/storefront/dist/client/_astro/{format-money.8962a5ab.js → format-money.9cf6b04d.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.57d8d9d0.js → hoisted.085a62c9.js} +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.799e5593.js +1 -0
- package/packages/storefront/dist/client/_astro/{i18n.78f362d9.js → i18n.29216eeb.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.bfbd75a8.js → img.4f23a3dd.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.570b84fe.js +1 -0
- package/packages/storefront/dist/client/_astro/index.8ac1db99.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.3c447a07.js → modules-info.55780599.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.01410784.js +1 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.d9f601dd.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-analytics.d0c184ef.js → use-analytics.cc95e346.js} +1 -1
- package/packages/storefront/dist/client/_astro/{use-product-card.e0990572.js → use-product-card.437911bb.js} +1 -1
- package/packages/storefront/dist/server/chunks/{CartSidebar_03b51b57.mjs → CartSidebar_eab28771.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +147 -0
- package/packages/storefront/dist/server/chunks/{_.._4def02ff.mjs → _.._5a781fb3.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_2ee873cf.mjs → account_519edb70.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_66a9c838.mjs → assets-service_a9d9ab5f.mjs} +58 -10
- package/packages/storefront/dist/server/chunks/{astro_8447f017.mjs → astro_d98f7186.mjs} +7 -1
- package/packages/storefront/dist/server/chunks/{index_5dcbbe32.mjs → index_10e14f85.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_37bacd45.mjs → index_5e3ed8a0.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_b3ae36f1.mjs → node_1119b0d1.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__80fd1c60.mjs → __93ade2dd.mjs} +485 -224
- package/packages/storefront/dist/server/chunks/pages/account_e5d410a7.mjs +28 -0
- package/packages/storefront/dist/server/chunks/pages/{index_8e1d063c.mjs → index_7e25afc1.mjs} +29 -8
- package/packages/storefront/dist/server/chunks/pages/node_bd378ac0.mjs +93 -0
- package/packages/storefront/dist/server/chunks/pages/{~fallback_6ff698cd.mjs → ~fallback_73578d2f.mjs} +16 -6
- package/packages/storefront/dist/server/chunks/{~fallback_7c4b84d5.mjs → ~fallback_41122b9b.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +8 -8
- package/packages/storefront/dist/server/{manifest_2019b8a9.mjs → manifest_6bc0c00d.mjs} +2 -2
- package/packages/storefront/dist/server/renderers.mjs +5 -3
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/src/lib/assets/forms.css +35 -30
- package/packages/storefront/src/lib/components/Carousel.vue +3 -1
- package/packages/storefront/src/lib/components/CarouselControl.vue +1 -1
- package/packages/storefront/src/lib/components/Drawer.vue +45 -7
- package/packages/storefront/src/lib/components/globals/Fade.vue +1 -1
- package/packages/storefront/src/lib/composables/use-product-shelf.ts +1 -1
- package/packages/storefront/src/lib/scripts/vbeta-app.ts +25 -15
- package/packages/storefront/src/lib/ssr-context.ts +11 -8
- package/packages/storefront/src/lib/state/search-engine.ts +101 -0
- package/packages/storefront/src/lib/state/shopping-cart.ts +52 -65
- package/packages/storefront/src/lib/state/use-analytics.ts +2 -1
- package/packages/storefront/src/lib/state/use-storage.ts +5 -2
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/ssr/lib/analytics-providers/google-analytics.js +0 -48
- package/packages/ssr/lib/analytics-providers/google-analytics.js.map +0 -1
- package/packages/ssr/lib/analytics-providers/meta-conversions-api.js +0 -44
- package/packages/ssr/lib/analytics-providers/meta-conversions-api.js.map +0 -1
- package/packages/ssr/src/analytics-providers/google-analytics.ts +0 -67
- package/packages/ssr/src/analytics-providers/meta-conversions-api.ts +0 -57
- package/packages/storefront/dist/client/_astro/AccountPage.6ead88b1.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.46474cda.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.fbca6881.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.d66f9f7e.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.9536b4c1.js +0 -1
- package/packages/storefront/dist/client/_astro/QuantitySelector.e74e368a.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.83b73e0b.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.06f4d486.js +0 -4
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.dd1a60ce.js +0 -1
- package/packages/storefront/dist/client/_astro/_slug_.52cde7a0.css +0 -1
- package/packages/storefront/dist/client/_astro/client.7c1b0374.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.2d173cc1.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_12falx.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_15pqnO.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_t3guw.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.c385a436.js +0 -1
- package/packages/storefront/dist/client/_astro/headphone_T2Jjc.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1CG18r.webp +0 -0
- package/packages/storefront/dist/client/_astro/hoisted.f16496bc.js +0 -1
- package/packages/storefront/dist/client/_astro/index.e02b88b7.js +0 -1
- package/packages/storefront/dist/client/_astro/index.e20e07e3.js +0 -1
- package/packages/storefront/dist/client/_astro/logo_1UBsBq.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1K5PE9.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1KIIl1.avif +0 -0
- package/packages/storefront/dist/client/_astro/name.3cd31c8b.js +0 -1
- package/packages/storefront/dist/client/_astro/passion_LHbe9.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_Z23MeUb.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1f5opX.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_IUskt.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Uxfdf.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z15uApA.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1Ap1Im.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1JT1HB.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_ZY9mtN.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_tMFW0.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1TgQXS.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_2Nm1z.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_DIqwR.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z1IKDb2.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z29FI4V.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z2kFHGk.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_ZkpPFI.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_jXzBi.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_x1l16.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_1TSfW7.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect89_Z1re32x.webp +0 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.6b03b120.js +0 -1
- package/packages/storefront/dist/client/~fallback.html +0 -74
- package/packages/storefront/dist/client/~index.html +0 -120
- package/packages/storefront/dist/server/chunks/SearchModal_2afca4fe.mjs +0 -18
- package/packages/storefront/dist/server/chunks/pages/account_bfd9a66a.mjs +0 -21
- package/packages/storefront/dist/server/chunks/pages/node_530334cf.mjs +0 -160
- package/packages/storefront/dist/server/images.dist.csv +0 -30
- package/packages/storefront/dist/server/images.src.csv +0 -11
- package/packages/storefront/dist/server/static-builds.csv +0 -66
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
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
3
|
import api from '@cloudcommerce/api';
|
|
3
4
|
import { EventEmitter } from 'node:events';
|
|
4
|
-
import fs, {
|
|
5
|
-
import { resolve, join } from 'node:path';
|
|
5
|
+
import fs, { copyFileSync } from 'node:fs';
|
|
6
|
+
import { resolve, join, basename as basename$1 } from 'node:path';
|
|
6
7
|
import config from '@cloudcommerce/config';
|
|
7
8
|
import { img, price, formatMoney, randomObjectId, nickname, inStock, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue, gridTitle, specValueByText } from '@ecomplus/utils';
|
|
8
9
|
import 'clsx';
|
|
9
10
|
/* empty css */import { renderSync, parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
|
|
10
11
|
import mime from 'mime/lite.js';
|
|
11
|
-
import {
|
|
12
|
+
import { i as isESMImportedImage, g as getImage$1 } from '../astro/assets-service_a9d9ab5f.mjs';
|
|
13
|
+
import imageSize from 'image-size';
|
|
14
|
+
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';
|
|
12
15
|
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrRenderTeleport, ssrRenderVNode, ssrInterpolate, ssrRenderSuspense } from 'vue/server-renderer';
|
|
13
|
-
import { watchDebounced, useTimeout, promiseTimeout, onClickOutside, watchOnce, useElementHover, useUrlSearchParams } from '@vueuse/core';
|
|
16
|
+
import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, onClickOutside, watchOnce, useElementHover, createReusableTemplate, useUrlSearchParams } from '@vueuse/core';
|
|
14
17
|
import mitt from 'mitt';
|
|
15
18
|
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
16
19
|
|
|
@@ -22,6 +25,75 @@ const _export_sfc = (sfc, props) => {
|
|
|
22
25
|
return target;
|
|
23
26
|
};
|
|
24
27
|
|
|
28
|
+
const $$Astro$h = createAstro("https://demo.ecomplus.app");
|
|
29
|
+
const $$Image = createComponent(async ($$result, $$props, $$slots) => {
|
|
30
|
+
const Astro2 = $$result.createAstro($$Astro$h, $$props, $$slots);
|
|
31
|
+
Astro2.self = $$Image;
|
|
32
|
+
const props = Astro2.props;
|
|
33
|
+
if (props.alt === void 0 || props.alt === null) {
|
|
34
|
+
throw new AstroError(ImageMissingAlt);
|
|
35
|
+
}
|
|
36
|
+
if (typeof props.width === "string") {
|
|
37
|
+
props.width = parseInt(props.width);
|
|
38
|
+
}
|
|
39
|
+
if (typeof props.height === "string") {
|
|
40
|
+
props.height = parseInt(props.height);
|
|
41
|
+
}
|
|
42
|
+
const image = await getImage(props);
|
|
43
|
+
const additionalAttributes = {};
|
|
44
|
+
if (image.srcSet.values.length > 0) {
|
|
45
|
+
additionalAttributes.srcset = image.srcSet.attribute;
|
|
46
|
+
}
|
|
47
|
+
return renderTemplate`${maybeRenderHead()}<img${addAttribute(image.src, "src")}${spreadAttributes(additionalAttributes)}${spreadAttributes(image.attributes)}>`;
|
|
48
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/node_modules/astro/components/Image.astro", void 0);
|
|
49
|
+
|
|
50
|
+
const $$Astro$g = createAstro("https://demo.ecomplus.app");
|
|
51
|
+
const $$Picture$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
52
|
+
const Astro2 = $$result.createAstro($$Astro$g, $$props, $$slots);
|
|
53
|
+
Astro2.self = $$Picture$1;
|
|
54
|
+
const defaultFormats = ["webp"];
|
|
55
|
+
const defaultFallbackFormat = "png";
|
|
56
|
+
const specialFormatsFallback = ["gif", "svg", "jpg", "jpeg"];
|
|
57
|
+
const { formats = defaultFormats, pictureAttributes = {}, fallbackFormat, ...props } = Astro2.props;
|
|
58
|
+
if (props.alt === void 0 || props.alt === null) {
|
|
59
|
+
throw new AstroError(ImageMissingAlt);
|
|
60
|
+
}
|
|
61
|
+
const optimizedImages = await Promise.all(
|
|
62
|
+
formats.map(
|
|
63
|
+
async (format) => await getImage({ ...props, format, widths: props.widths, densities: props.densities })
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat;
|
|
67
|
+
if (!fallbackFormat && isESMImportedImage(props.src) && specialFormatsFallback.includes(props.src.format)) {
|
|
68
|
+
resultFallbackFormat = props.src.format;
|
|
69
|
+
}
|
|
70
|
+
const fallbackImage = await getImage({
|
|
71
|
+
...props,
|
|
72
|
+
format: resultFallbackFormat,
|
|
73
|
+
widths: props.widths,
|
|
74
|
+
densities: props.densities
|
|
75
|
+
});
|
|
76
|
+
const imgAdditionalAttributes = {};
|
|
77
|
+
const sourceAdditionaAttributes = {};
|
|
78
|
+
if (props.sizes) {
|
|
79
|
+
sourceAdditionaAttributes.sizes = props.sizes;
|
|
80
|
+
}
|
|
81
|
+
if (fallbackImage.srcSet.values.length > 0) {
|
|
82
|
+
imgAdditionalAttributes.srcset = fallbackImage.srcSet.attribute;
|
|
83
|
+
}
|
|
84
|
+
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttributes)}>
|
|
85
|
+
${Object.entries(optimizedImages).map(([_, image]) => {
|
|
86
|
+
const srcsetAttribute = props.densities || !props.densities && !props.widths ? `${image.src}${image.srcSet.values.length > 0 ? ", " + image.srcSet.attribute : ""}` : image.srcSet.attribute;
|
|
87
|
+
return renderTemplate`<source${addAttribute(srcsetAttribute, "srcset")}${addAttribute("image/" + image.options.format, "type")}${spreadAttributes(sourceAdditionaAttributes)}>`;
|
|
88
|
+
})}
|
|
89
|
+
<img${addAttribute(fallbackImage.src, "src")}${spreadAttributes(imgAdditionalAttributes)}${spreadAttributes(fallbackImage.attributes)}>
|
|
90
|
+
</picture>`;
|
|
91
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/node_modules/astro/components/Picture.astro", void 0);
|
|
92
|
+
|
|
93
|
+
const imageConfig = {"service":{"entrypoint":"astro/assets/services/sharp","config":{}},"domains":[],"remotePatterns":[],"endpoint":"astro/assets/endpoint/node"};
|
|
94
|
+
const assetsDir = new URL("file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/dist/client/");
|
|
95
|
+
const getImage = async (options) => await getImage$1(options, imageConfig);
|
|
96
|
+
|
|
25
97
|
global.__storefrontCMS = (fs, resolvePath) => {
|
|
26
98
|
const { STOREFRONT_BASE_DIR } = process.env;
|
|
27
99
|
let baseDir;
|
|
@@ -224,7 +296,7 @@ const loadRouteContext = async (Astro, {
|
|
|
224
296
|
const { slug } = Astro.params;
|
|
225
297
|
if (isHomepage) {
|
|
226
298
|
cmsContent = await config.getContent("pages/home");
|
|
227
|
-
} else if (slug) {
|
|
299
|
+
} else if (slug && typeof slug === "string") {
|
|
228
300
|
if (contentCollection) {
|
|
229
301
|
cmsContent = await config.getContent(`${contentCollection}/${slug}`);
|
|
230
302
|
} else if (slug.startsWith("_api/") || slug === "_analytics") {
|
|
@@ -339,7 +411,9 @@ const $$ViewTransitions = createComponent(async ($$result, $$props, $$slots) =>
|
|
|
339
411
|
const Astro2 = $$result.createAstro($$Astro$f, $$props, $$slots);
|
|
340
412
|
Astro2.self = $$ViewTransitions;
|
|
341
413
|
const { fallback = "animate" } = Astro2.props;
|
|
342
|
-
return renderTemplate`<meta name="astro-view-transitions-enabled" content="true"
|
|
414
|
+
return renderTemplate`<meta name="astro-view-transitions-enabled" content="true">
|
|
415
|
+
<meta name="astro-view-transitions-fallback"${addAttribute(fallback, "content")}>
|
|
416
|
+
`;
|
|
343
417
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/ViewTransitions.astro", void 0);
|
|
344
418
|
|
|
345
419
|
var __freeze$4 = Object.freeze;
|
|
@@ -468,7 +542,7 @@ window.$isCmsPreview = true;`;
|
|
|
468
542
|
url: `https://${domain}/`,
|
|
469
543
|
logo: `https://${domain}${settings.logo}`
|
|
470
544
|
});
|
|
471
|
-
return renderTemplate(_c || (_c = __template$4(['<meta charset="UTF-8"
|
|
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)));
|
|
472
546
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", "self");
|
|
473
547
|
|
|
474
548
|
function has(value) {
|
|
@@ -705,54 +779,6 @@ const createPictureGetter = (getImage) => {
|
|
|
705
779
|
};
|
|
706
780
|
};
|
|
707
781
|
|
|
708
|
-
const { STOREFRONT_BASE_DIR } = process.env;
|
|
709
|
-
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
710
|
-
const builtImages = [];
|
|
711
|
-
const manifestFilepath = join(baseDir, "dist/server/images.dist.csv");
|
|
712
|
-
try {
|
|
713
|
-
readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
|
|
714
|
-
const [filename, width, height] = line.split(",");
|
|
715
|
-
builtImages.push({
|
|
716
|
-
filename,
|
|
717
|
-
width: Number(width),
|
|
718
|
-
height: Number(height)
|
|
719
|
-
});
|
|
720
|
-
});
|
|
721
|
-
} catch (err) {
|
|
722
|
-
if (global.$renderStorefront) {
|
|
723
|
-
console.error(err);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
builtImages.sort((a, b) => {
|
|
727
|
-
if (a.width < b.width)
|
|
728
|
-
return -1;
|
|
729
|
-
return 1;
|
|
730
|
-
});
|
|
731
|
-
const getBuiltImage = async ({ src, width, format }) => {
|
|
732
|
-
const filename = src.replace(/^.*\//, "").replace(/.\w+(\?.*)?$/, "");
|
|
733
|
-
const filenameRegExp = new RegExp(`[_.][a-z0-9]+\\.${format}$`, "i");
|
|
734
|
-
const matchFilename = (_builtImage) => {
|
|
735
|
-
return filename === _builtImage.filename.replace(filenameRegExp, "");
|
|
736
|
-
};
|
|
737
|
-
let builtImage = builtImages.find((_builtImage) => {
|
|
738
|
-
return _builtImage.width >= width && matchFilename(_builtImage);
|
|
739
|
-
});
|
|
740
|
-
if (!builtImage) {
|
|
741
|
-
builtImage = builtImages.find(matchFilename);
|
|
742
|
-
}
|
|
743
|
-
if (builtImage) {
|
|
744
|
-
return {
|
|
745
|
-
src: `/_astro/${builtImage.filename}`,
|
|
746
|
-
width: builtImage.width,
|
|
747
|
-
height: builtImage.height
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
console.warn(`Could not match built ${format} image for ${src} ${width}px`);
|
|
751
|
-
return { src, width };
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
const getBuiltPicture = createPictureGetter(getBuiltImage);
|
|
755
|
-
|
|
756
782
|
const getAspectRatio = (src, tryImageSize) => {
|
|
757
783
|
if (typeof src === "string") {
|
|
758
784
|
src = tryImageSize(src);
|
|
@@ -905,27 +931,31 @@ const $$Astro$d = createAstro("https://demo.ecomplus.app");
|
|
|
905
931
|
const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
906
932
|
const Astro2 = $$result.createAstro($$Astro$d, $$props, $$slots);
|
|
907
933
|
Astro2.self = $$Picture;
|
|
908
|
-
const
|
|
909
|
-
const
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
934
|
+
const deployRand = ({}).DEPLOY_RAND;
|
|
935
|
+
const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
|
|
936
|
+
const getImageFilepath = (src) => {
|
|
937
|
+
const filepath = resolve(process.env.STOREFRONT_BASE_DIR, `public${src}`);
|
|
938
|
+
if (({}).BUILD_OUTPUT === "static") {
|
|
939
|
+
try {
|
|
940
|
+
copyFileSync(filepath, resolve(
|
|
941
|
+
process.env.STOREFRONT_BASE_DIR,
|
|
942
|
+
({}).BUILD_OUT_DIR || "dist/client",
|
|
943
|
+
"_astro",
|
|
944
|
+
basename$1(filepath)
|
|
945
|
+
));
|
|
946
|
+
} catch (err) {
|
|
947
|
+
console.error(err);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
return filepath;
|
|
951
|
+
};
|
|
920
952
|
const tryImageSize = (src) => {
|
|
921
953
|
let dimensions = {};
|
|
922
954
|
if (typeof src === "string" && src.startsWith("/")) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
})
|
|
926
|
-
|
|
927
|
-
const { width, height } = originalImage;
|
|
928
|
-
dimensions = { width, height };
|
|
955
|
+
try {
|
|
956
|
+
dimensions = imageSize(getImageFilepath(src));
|
|
957
|
+
} catch (e) {
|
|
958
|
+
dimensions = {};
|
|
929
959
|
}
|
|
930
960
|
}
|
|
931
961
|
return dimensions;
|
|
@@ -938,18 +968,62 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
938
968
|
} = await useSSRPicture({
|
|
939
969
|
...Astro2.props,
|
|
940
970
|
tryImageSize,
|
|
941
|
-
getPicture:
|
|
971
|
+
getPicture: createPictureGetter(async (imageOptions) => {
|
|
972
|
+
let imageMetadata;
|
|
973
|
+
if (imageOptions.src.startsWith("/")) {
|
|
974
|
+
const imageFilepath = getImageFilepath(imageOptions.src);
|
|
975
|
+
const { width: width2, height: height2 } = tryImageSize(imageOptions.src);
|
|
976
|
+
if (width2 && height2) {
|
|
977
|
+
const mimeType = mime.getType(imageFilepath);
|
|
978
|
+
if (mimeType?.startsWith("image/")) {
|
|
979
|
+
imageMetadata = {
|
|
980
|
+
src: imageFilepath,
|
|
981
|
+
width: width2,
|
|
982
|
+
height: height2,
|
|
983
|
+
// @ts-ignore
|
|
984
|
+
format: mimeType.replace("image/", "")
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
const {
|
|
990
|
+
src,
|
|
991
|
+
attributes: { width, height }
|
|
992
|
+
} = await getImage({
|
|
993
|
+
...imageOptions,
|
|
994
|
+
src: imageMetadata || imageOptions.src
|
|
995
|
+
});
|
|
996
|
+
return { src, width, height };
|
|
997
|
+
}),
|
|
942
998
|
assetsPrefix: Astro2.locals.assetsPrefix
|
|
943
999
|
});
|
|
944
|
-
|
|
945
|
-
|
|
1000
|
+
if (imgAttrs) {
|
|
1001
|
+
imgAttrs.src += versionSuffix;
|
|
1002
|
+
}
|
|
1003
|
+
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}>
|
|
1004
|
+
${sources.map((attrs) => {
|
|
1005
|
+
if (versionSuffix) {
|
|
1006
|
+
attrs.srcset = attrs.srcset.replace(/\s(\w+)$/, `${versionSuffix} $1`);
|
|
1007
|
+
}
|
|
1008
|
+
return renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`;
|
|
1009
|
+
})}
|
|
1010
|
+
${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}
|
|
1011
|
+
</picture>`;
|
|
1012
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Picture.astro", void 0);
|
|
946
1013
|
|
|
947
1014
|
const $$Astro$c = createAstro("https://demo.ecomplus.app");
|
|
948
1015
|
const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
|
|
949
1016
|
const Astro2 = $$result.createAstro($$Astro$c, $$props, $$slots);
|
|
950
1017
|
Astro2.self = $$BaseBody;
|
|
951
1018
|
const { settings } = Astro2.locals.routeContext;
|
|
952
|
-
return renderTemplate`${maybeRenderHead()}<body style="visibility:hidden" class="!visible"> <!-- Prevent FOUC -->
|
|
1019
|
+
return renderTemplate`${maybeRenderHead()}<body style="visibility:hidden" class="!visible"> <!-- Prevent FOUC -->
|
|
1020
|
+
<div id="teleported-overlap" class="relative z-[59]"></div>
|
|
1021
|
+
<div id="teleported-top" class="relative z-[19]"></div>
|
|
1022
|
+
${renderSlot($$result, $$slots["default"])}
|
|
1023
|
+
${renderSlot($$result, $$slots["before-body-end"])}
|
|
1024
|
+
<div id="teleported-bottom" class="relative z-[19]"></div>
|
|
1025
|
+
${settings.icon && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": settings.icon, "alt": "Icon", "formats": ["png"], "widths": [32, 192, 512], "sizes": "32px", "class": "hidden absolute", "style": "bottom: -1000px", "hasImg": false })}`}
|
|
1026
|
+
</body>`;
|
|
953
1027
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro", void 0);
|
|
954
1028
|
|
|
955
1029
|
const $$Astro$b = createAstro("https://demo.ecomplus.app");
|
|
@@ -958,7 +1032,16 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
958
1032
|
Astro2.self = $$Base$1;
|
|
959
1033
|
const { getContent } = Astro2.locals.routeContext;
|
|
960
1034
|
const { customCode } = await getContent("layout");
|
|
961
|
-
return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate`
|
|
1035
|
+
return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate`
|
|
1036
|
+
${renderSlot($$result2, $$slots["base-head"])}
|
|
1037
|
+
${customCode?.css && renderTemplate`<style>{customCode.css}</style>`}${customCode?.htmlHead && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlHead)}` })}`}${renderSlot($$result2, $$slots["base-head-scripts"])}
|
|
1038
|
+
${renderSlot($$result2, $$slots["before-head-end"])}
|
|
1039
|
+
` })}
|
|
1040
|
+
${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`
|
|
1041
|
+
${renderSlot($$result2, $$slots["default"])}
|
|
1042
|
+
${customCode?.htmlBody && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlBody)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}
|
|
1043
|
+
${renderSlot($$result2, $$slots["before-body-end"])}
|
|
1044
|
+
` })}`;
|
|
962
1045
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
|
|
963
1046
|
|
|
964
1047
|
var __freeze$3 = Object.freeze;
|
|
@@ -976,7 +1059,13 @@ const $$Astro$9 = createAstro("https://demo.ecomplus.app");
|
|
|
976
1059
|
const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
977
1060
|
const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
|
|
978
1061
|
Astro2.self = $$Base;
|
|
979
|
-
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
|
|
1062
|
+
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
|
|
1063
|
+
${renderSlot($$result3, $$slots["base-head"])}
|
|
1064
|
+
` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
${renderSlot($$result2, $$slots["default"])}
|
|
1068
|
+
` })}`;
|
|
980
1069
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
|
|
981
1070
|
|
|
982
1071
|
const checkObjNotNull = (obj) => {
|
|
@@ -1340,8 +1429,10 @@ const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
|
|
|
1340
1429
|
}
|
|
1341
1430
|
}
|
|
1342
1431
|
const state = reactive(persistedValue || initialValue);
|
|
1343
|
-
|
|
1432
|
+
watchDebounced(state, () => {
|
|
1344
1433
|
storage.setItem(key, JSON.stringify(state));
|
|
1434
|
+
}, {
|
|
1435
|
+
debounce: 50
|
|
1345
1436
|
});
|
|
1346
1437
|
return state;
|
|
1347
1438
|
};
|
|
@@ -1425,73 +1516,29 @@ const storageKey$1 = "ecomShoppingCart";
|
|
|
1425
1516
|
const emptyCart = {
|
|
1426
1517
|
items: []
|
|
1427
1518
|
};
|
|
1428
|
-
const
|
|
1429
|
-
const cartItems = computed(() => {
|
|
1430
|
-
return cart.items.map((item) => {
|
|
1431
|
-
let finalPrice = item.kit_product?.price && item.kit_product.pack_quantity ? item.kit_product.price / item.kit_product.pack_quantity : item.price;
|
|
1432
|
-
if (Array.isArray(item.customizations)) {
|
|
1433
|
-
item.customizations.forEach((customization) => {
|
|
1434
|
-
if (customization.add_to_price) {
|
|
1435
|
-
const { type, addition } = customization.add_to_price;
|
|
1436
|
-
finalPrice += type === "fixed" ? addition : item.price * (addition / 100);
|
|
1437
|
-
}
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
item.final_price = finalPrice;
|
|
1441
|
-
const min = item.min_quantity || 1;
|
|
1442
|
-
const max = item.max_quantity;
|
|
1443
|
-
if (typeof item.quantity !== "number" || Number.isNaN(item.quantity) || item.quantity < min) {
|
|
1444
|
-
item.quantity = min;
|
|
1445
|
-
} else if (max && item.quantity > max) {
|
|
1446
|
-
item.quantity = max;
|
|
1447
|
-
}
|
|
1448
|
-
return item;
|
|
1449
|
-
});
|
|
1450
|
-
});
|
|
1451
|
-
const subtotal = computed(() => {
|
|
1452
|
-
return cartItems.value.reduce((acc, item) => {
|
|
1453
|
-
return acc + item.quantity * (item.final_price || item.price);
|
|
1454
|
-
}, 0);
|
|
1455
|
-
});
|
|
1519
|
+
const shoppingCart = useStorage(storageKey$1, emptyCart);
|
|
1456
1520
|
const totalItems = computed(() => {
|
|
1457
|
-
return
|
|
1521
|
+
return shoppingCart.items.reduce((acc, item) => {
|
|
1458
1522
|
return acc + item.quantity;
|
|
1459
1523
|
}, 0);
|
|
1460
1524
|
});
|
|
1461
|
-
const shoppingCart = computed({
|
|
1462
|
-
get() {
|
|
1463
|
-
return {
|
|
1464
|
-
...cart,
|
|
1465
|
-
subtotal: subtotal.value
|
|
1466
|
-
};
|
|
1467
|
-
},
|
|
1468
|
-
set(newCart) {
|
|
1469
|
-
Object.assign(cart, newCart, {
|
|
1470
|
-
subtotal: subtotal.value
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
});
|
|
1474
1525
|
const addCartItem = (newItem) => {
|
|
1475
|
-
|
|
1476
|
-
const upsertedItem = addCartItem$1(cartObj, newItem);
|
|
1477
|
-
if (upsertedItem) {
|
|
1478
|
-
shoppingCart.value.items = cartObj.items;
|
|
1479
|
-
}
|
|
1526
|
+
addCartItem$1(shoppingCart, newItem);
|
|
1480
1527
|
};
|
|
1481
1528
|
const removeCartItem = (itemId) => {
|
|
1482
|
-
for (let i = 0; i < shoppingCart.
|
|
1483
|
-
const item = shoppingCart.
|
|
1529
|
+
for (let i = 0; i < shoppingCart.items.length; i++) {
|
|
1530
|
+
const item = shoppingCart.items[i];
|
|
1484
1531
|
if (item._id === itemId) {
|
|
1485
|
-
shoppingCart.
|
|
1532
|
+
shoppingCart.items.splice(i, 1);
|
|
1486
1533
|
break;
|
|
1487
1534
|
}
|
|
1488
1535
|
}
|
|
1489
1536
|
};
|
|
1490
1537
|
const addProductToCart = (product, variationId, quantity) => addCartItem(parseProduct(product, variationId, quantity));
|
|
1491
1538
|
const cartEmitter = mitt();
|
|
1492
|
-
const cloneItems = () => shoppingCart.
|
|
1539
|
+
const cloneItems = () => shoppingCart.items.map((item) => ({ ...item }));
|
|
1493
1540
|
let oldItems = cloneItems();
|
|
1494
|
-
|
|
1541
|
+
const emitCartEvents = useDebounceFn((items) => {
|
|
1495
1542
|
["addCartItem", "removeCartItem"].forEach((evName) => {
|
|
1496
1543
|
const isAdd = evName === "addCartItem";
|
|
1497
1544
|
const baseItems = isAdd ? items : oldItems;
|
|
@@ -1510,7 +1557,32 @@ watchDebounced(shoppingCart, ({ items }) => {
|
|
|
1510
1557
|
});
|
|
1511
1558
|
});
|
|
1512
1559
|
oldItems = cloneItems();
|
|
1513
|
-
},
|
|
1560
|
+
}, 200);
|
|
1561
|
+
watch(shoppingCart.items, (items) => {
|
|
1562
|
+
items.forEach((item) => {
|
|
1563
|
+
let finalPrice = item.kit_product?.price && item.kit_product.pack_quantity ? item.kit_product.price / item.kit_product.pack_quantity : item.price;
|
|
1564
|
+
if (Array.isArray(item.customizations)) {
|
|
1565
|
+
item.customizations.forEach((customization) => {
|
|
1566
|
+
if (customization.add_to_price) {
|
|
1567
|
+
const { type, addition } = customization.add_to_price;
|
|
1568
|
+
finalPrice += type === "fixed" ? addition : item.price * (addition / 100);
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
item.final_price = finalPrice;
|
|
1573
|
+
const min = item.min_quantity || 1;
|
|
1574
|
+
const max = item.max_quantity;
|
|
1575
|
+
if (typeof item.quantity !== "number" || Number.isNaN(item.quantity) || item.quantity < min) {
|
|
1576
|
+
item.quantity = min;
|
|
1577
|
+
} else if (max && item.quantity > max) {
|
|
1578
|
+
item.quantity = max;
|
|
1579
|
+
}
|
|
1580
|
+
});
|
|
1581
|
+
shoppingCart.subtotal = items.reduce((acc, item) => {
|
|
1582
|
+
return acc + item.quantity * (item.final_price || item.price);
|
|
1583
|
+
}, 0);
|
|
1584
|
+
emitCartEvents(items);
|
|
1585
|
+
});
|
|
1514
1586
|
({
|
|
1515
1587
|
on: cartEmitter.on,
|
|
1516
1588
|
off: cartEmitter.off
|
|
@@ -1667,10 +1739,15 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1667
1739
|
__name: "Drawer",
|
|
1668
1740
|
props: {
|
|
1669
1741
|
modelValue: { type: Boolean, default: false },
|
|
1742
|
+
isHidden: { type: Boolean, default: false },
|
|
1670
1743
|
placement: { default: "start" },
|
|
1671
1744
|
position: { default: "fixed" },
|
|
1745
|
+
animation: { default: "slide" },
|
|
1672
1746
|
hasCloseButton: { type: Boolean, default: true },
|
|
1673
|
-
|
|
1747
|
+
anchorEl: {},
|
|
1748
|
+
backdropTarget: { default: "#teleported-top" },
|
|
1749
|
+
maxWidth: {},
|
|
1750
|
+
class: {}
|
|
1674
1751
|
},
|
|
1675
1752
|
emits: ["update:modelValue"],
|
|
1676
1753
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -1681,6 +1758,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1681
1758
|
const drawer = ref(null);
|
|
1682
1759
|
const outsideClickListener = (ev) => {
|
|
1683
1760
|
if (!drawer.value?.contains(ev.target)) {
|
|
1761
|
+
if (props.anchorEl?.contains(ev.target))
|
|
1762
|
+
return;
|
|
1684
1763
|
close();
|
|
1685
1764
|
}
|
|
1686
1765
|
};
|
|
@@ -1707,6 +1786,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1707
1786
|
}
|
|
1708
1787
|
});
|
|
1709
1788
|
const slideTo = computed(() => {
|
|
1789
|
+
if (props.animation !== "slide")
|
|
1790
|
+
return null;
|
|
1710
1791
|
switch (props.placement) {
|
|
1711
1792
|
case "start":
|
|
1712
1793
|
return "left";
|
|
@@ -1718,13 +1799,36 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1718
1799
|
return "up";
|
|
1719
1800
|
}
|
|
1720
1801
|
});
|
|
1802
|
+
const animationClassName = ref(null);
|
|
1803
|
+
if (props.animation === "scale") {
|
|
1804
|
+
watch(toRef(props, "modelValue"), (isShown) => {
|
|
1805
|
+
if (!isShown) {
|
|
1806
|
+
animationClassName.value = "transition scale-90";
|
|
1807
|
+
} else {
|
|
1808
|
+
nextTick(() => {
|
|
1809
|
+
setTimeout(() => {
|
|
1810
|
+
animationClassName.value = "transition";
|
|
1811
|
+
setTimeout(() => {
|
|
1812
|
+
if (props.modelValue)
|
|
1813
|
+
animationClassName.value = "";
|
|
1814
|
+
}, 300);
|
|
1815
|
+
}, 50);
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
}, { immediate: true });
|
|
1819
|
+
}
|
|
1820
|
+
const customClassList = computed(() => {
|
|
1821
|
+
if (Array.isArray(props.class))
|
|
1822
|
+
return props.class;
|
|
1823
|
+
return [props.class];
|
|
1824
|
+
});
|
|
1721
1825
|
const isFixed = computed(() => {
|
|
1722
1826
|
return props.position === "fixed";
|
|
1723
1827
|
});
|
|
1724
1828
|
const isPlacementX = computed(() => {
|
|
1725
1829
|
return props.placement === "start" || props.placement === "end";
|
|
1726
1830
|
});
|
|
1727
|
-
const __returned__ = { props, emit, close, drawer, outsideClickListener, escClickListener, scrollbarWidth, slideTo, isFixed, isPlacementX };
|
|
1831
|
+
const __returned__ = { props, emit, close, drawer, outsideClickListener, escClickListener, scrollbarWidth, slideTo, animationClassName, customClassList, isFixed, isPlacementX };
|
|
1728
1832
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1729
1833
|
return __returned__;
|
|
1730
1834
|
}
|
|
@@ -1739,15 +1843,21 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1739
1843
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1740
1844
|
if (_push2) {
|
|
1741
1845
|
if ($props.modelValue) {
|
|
1742
|
-
_push2(`<dialog
|
|
1846
|
+
_push2(`<dialog style="${ssrRenderStyle([
|
|
1847
|
+
!$props.isHidden ? null : { display: "none" },
|
|
1848
|
+
{
|
|
1849
|
+
maxWidth: $props.maxWidth ? `min(${$props.maxWidth}, calc(100vw - ${$setup.scrollbarWidth}px))` : !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1850
|
+
}
|
|
1851
|
+
])}" class="${ssrRenderClass([[
|
|
1743
1852
|
$props.position,
|
|
1853
|
+
$setup.isPlacementX ? "m-0" : "mx-auto",
|
|
1854
|
+
$setup.isPlacementX && !$props.maxWidth ? "max-w-sm" : null,
|
|
1744
1855
|
$setup.isFixed ? `top-0 ${$setup.isPlacementX ? "h-screen" : "max-h-screen"}` : null,
|
|
1745
1856
|
$setup.isFixed && $props.placement !== "end" ? "left-0" : null,
|
|
1746
1857
|
$setup.isFixed && $props.placement === "end" ? "left-auto right-0" : null,
|
|
1747
|
-
$setup.
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
})}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1858
|
+
$setup.animationClassName,
|
|
1859
|
+
...$setup.customClassList
|
|
1860
|
+
], "z-40 w-screen p-0"])}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1751
1861
|
if ($props.hasCloseButton) {
|
|
1752
1862
|
_push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2 z-30"])}" data-drawer-close${_scopeId}>`);
|
|
1753
1863
|
ssrRenderSlot(_ctx.$slots, "close", {}, () => {
|
|
@@ -1759,46 +1869,53 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1759
1869
|
}
|
|
1760
1870
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1761
1871
|
_push2(`</div>`);
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
if (
|
|
1767
|
-
|
|
1872
|
+
if ($props.backdropTarget) {
|
|
1873
|
+
ssrRenderTeleport(_push2, (_push3) => {
|
|
1874
|
+
_push3(ssrRenderComponent(_component_Fade, null, {
|
|
1875
|
+
default: withCtx((_2, _push4, _parent3, _scopeId2) => {
|
|
1876
|
+
if (_push4) {
|
|
1877
|
+
if ($props.modelValue && !$props.isHidden) {
|
|
1878
|
+
_push4(`<div class="fixed left-0 top-0 z-30 h-screen w-screen bg-black/50" data-drawer-backdrop${_scopeId2}></div>`);
|
|
1879
|
+
} else {
|
|
1880
|
+
_push4(`<!---->`);
|
|
1881
|
+
}
|
|
1768
1882
|
} else {
|
|
1769
|
-
|
|
1883
|
+
return [
|
|
1884
|
+
$props.modelValue && !$props.isHidden ? (openBlock(), createBlock("div", {
|
|
1885
|
+
key: 0,
|
|
1886
|
+
class: "fixed left-0 top-0 z-30 h-screen w-screen bg-black/50",
|
|
1887
|
+
"data-drawer-backdrop": ""
|
|
1888
|
+
})) : createCommentVNode("", true)
|
|
1889
|
+
];
|
|
1770
1890
|
}
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
];
|
|
1779
|
-
}
|
|
1780
|
-
}),
|
|
1781
|
-
_: 1
|
|
1782
|
-
}, _parent2, _scopeId));
|
|
1783
|
-
}, $props.backdropTarget, false, _parent2);
|
|
1891
|
+
}),
|
|
1892
|
+
_: 1
|
|
1893
|
+
}, _parent2, _scopeId));
|
|
1894
|
+
}, $props.backdropTarget, false, _parent2);
|
|
1895
|
+
} else {
|
|
1896
|
+
_push2(`<!---->`);
|
|
1897
|
+
}
|
|
1784
1898
|
_push2(`</dialog>`);
|
|
1785
1899
|
} else {
|
|
1786
1900
|
_push2(`<!---->`);
|
|
1787
1901
|
}
|
|
1788
1902
|
} else {
|
|
1789
1903
|
return [
|
|
1790
|
-
$props.modelValue ? (openBlock(), createBlock("dialog", {
|
|
1904
|
+
$props.modelValue ? withDirectives((openBlock(), createBlock("dialog", {
|
|
1791
1905
|
key: 0,
|
|
1792
1906
|
ref: "drawer",
|
|
1793
|
-
class: ["z-
|
|
1907
|
+
class: ["z-40 w-screen p-0", [
|
|
1794
1908
|
$props.position,
|
|
1909
|
+
$setup.isPlacementX ? "m-0" : "mx-auto",
|
|
1910
|
+
$setup.isPlacementX && !$props.maxWidth ? "max-w-sm" : null,
|
|
1795
1911
|
$setup.isFixed ? `top-0 ${$setup.isPlacementX ? "h-screen" : "max-h-screen"}` : null,
|
|
1796
1912
|
$setup.isFixed && $props.placement !== "end" ? "left-0" : null,
|
|
1797
1913
|
$setup.isFixed && $props.placement === "end" ? "left-auto right-0" : null,
|
|
1798
|
-
$setup.
|
|
1914
|
+
$setup.animationClassName,
|
|
1915
|
+
...$setup.customClassList
|
|
1799
1916
|
]],
|
|
1800
1917
|
style: {
|
|
1801
|
-
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1918
|
+
maxWidth: $props.maxWidth ? `min(${$props.maxWidth}, calc(100vw - ${$setup.scrollbarWidth}px))` : !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1802
1919
|
},
|
|
1803
1920
|
open: $props.modelValue,
|
|
1804
1921
|
"data-drawer": $props.placement
|
|
@@ -1818,19 +1935,24 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1818
1935
|
], 10, ["onClick"])) : createCommentVNode("", true),
|
|
1819
1936
|
renderSlot$1(_ctx.$slots, "default")
|
|
1820
1937
|
]),
|
|
1821
|
-
(openBlock(), createBlock(Teleport, {
|
|
1938
|
+
$props.backdropTarget ? (openBlock(), createBlock(Teleport, {
|
|
1939
|
+
key: 0,
|
|
1940
|
+
to: $props.backdropTarget
|
|
1941
|
+
}, [
|
|
1822
1942
|
createVNode(_component_Fade, null, {
|
|
1823
1943
|
default: withCtx(() => [
|
|
1824
|
-
$props.modelValue ? (openBlock(), createBlock("div", {
|
|
1944
|
+
$props.modelValue && !$props.isHidden ? (openBlock(), createBlock("div", {
|
|
1825
1945
|
key: 0,
|
|
1826
|
-
class: "fixed left-0 top-0 z-
|
|
1946
|
+
class: "fixed left-0 top-0 z-30 h-screen w-screen bg-black/50",
|
|
1827
1947
|
"data-drawer-backdrop": ""
|
|
1828
1948
|
})) : createCommentVNode("", true)
|
|
1829
1949
|
]),
|
|
1830
1950
|
_: 1
|
|
1831
1951
|
})
|
|
1832
|
-
], 8, ["to"]))
|
|
1833
|
-
], 14, ["open", "data-drawer"]))
|
|
1952
|
+
], 8, ["to"])) : createCommentVNode("", true)
|
|
1953
|
+
], 14, ["open", "data-drawer"])), [
|
|
1954
|
+
[vShow, !$props.isHidden]
|
|
1955
|
+
]) : createCommentVNode("", true)
|
|
1834
1956
|
];
|
|
1835
1957
|
}
|
|
1836
1958
|
}),
|
|
@@ -2123,7 +2245,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2123
2245
|
}
|
|
2124
2246
|
});
|
|
2125
2247
|
function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2126
|
-
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
|
|
2248
|
+
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col bg-white" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
|
|
2127
2249
|
ssrRenderList($props.categoryTrees, (categoryTree, i) => {
|
|
2128
2250
|
_push(ssrRenderComponent($setup["ShopSidenavCategory"], {
|
|
2129
2251
|
key: i,
|
|
@@ -2271,7 +2393,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2271
2393
|
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2272
2394
|
if (_push3) {
|
|
2273
2395
|
_push3(ssrRenderComponent($setup["PopoverPanel"], {
|
|
2274
|
-
class: ["text-base-700 absolute left-1/2 top-3 z-
|
|
2396
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-50 -translate-x-1/2 !transform rounded bg-white px-6 py-4 text-base shadow", $setup.countMenuCols === 1 ? "w-60" : $setup.countMenuCols === 2 ? `w-screen ${$setup.categoryPicture ? "max-w-lg" : "max-w-sm"}` : $setup.countMenuCols === 3 ? `w-screen ${$setup.categoryPicture ? "max-w-xl" : "max-w-md"}` : $setup.countMenuCols < 6 ? "w-screen max-w-3xl" : "w-screen max-w-5xl"]
|
|
2275
2397
|
}, {
|
|
2276
2398
|
default: withCtx(({ close }, _push4, _parent4, _scopeId3) => {
|
|
2277
2399
|
if (_push4) {
|
|
@@ -2381,7 +2503,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2381
2503
|
} else {
|
|
2382
2504
|
return [
|
|
2383
2505
|
createVNode($setup["PopoverPanel"], {
|
|
2384
|
-
class: ["text-base-700 absolute left-1/2 top-3 z-
|
|
2506
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-50 -translate-x-1/2 !transform rounded bg-white px-6 py-4 text-base shadow", $setup.countMenuCols === 1 ? "w-60" : $setup.countMenuCols === 2 ? `w-screen ${$setup.categoryPicture ? "max-w-lg" : "max-w-sm"}` : $setup.countMenuCols === 3 ? `w-screen ${$setup.categoryPicture ? "max-w-xl" : "max-w-md"}` : $setup.countMenuCols < 6 ? "w-screen max-w-3xl" : "w-screen max-w-5xl"]
|
|
2385
2507
|
}, {
|
|
2386
2508
|
default: withCtx(({ close }) => [
|
|
2387
2509
|
createVNode("div", { class: "flex w-full gap-6" }, [
|
|
@@ -2479,7 +2601,7 @@ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2479
2601
|
createVNode(_component_Fade, null, {
|
|
2480
2602
|
default: withCtx(() => [
|
|
2481
2603
|
createVNode($setup["PopoverPanel"], {
|
|
2482
|
-
class: ["text-base-700 absolute left-1/2 top-3 z-
|
|
2604
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-50 -translate-x-1/2 !transform rounded bg-white px-6 py-4 text-base shadow", $setup.countMenuCols === 1 ? "w-60" : $setup.countMenuCols === 2 ? `w-screen ${$setup.categoryPicture ? "max-w-lg" : "max-w-sm"}` : $setup.countMenuCols === 3 ? `w-screen ${$setup.categoryPicture ? "max-w-xl" : "max-w-md"}` : $setup.countMenuCols < 6 ? "w-screen max-w-3xl" : "w-screen max-w-5xl"]
|
|
2483
2605
|
}, {
|
|
2484
2606
|
default: withCtx(({ close }) => [
|
|
2485
2607
|
createVNode("div", { class: "flex w-full gap-6" }, [
|
|
@@ -3306,8 +3428,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3306
3428
|
},
|
|
3307
3429
|
setup(__props, { expose: __expose }) {
|
|
3308
3430
|
__expose();
|
|
3309
|
-
const SearchModal = defineAsyncComponent(() => import('../
|
|
3310
|
-
const CartSidebar = defineAsyncComponent(() => import('../
|
|
3431
|
+
const SearchModal = defineAsyncComponent(() => import('../SearchModal_f66549d4.mjs'));
|
|
3432
|
+
const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_eab28771.mjs'));
|
|
3311
3433
|
const props = __props;
|
|
3312
3434
|
const header = ref(null);
|
|
3313
3435
|
const {
|
|
@@ -3322,6 +3444,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3322
3444
|
watchOnce(isSearchOpen, () => {
|
|
3323
3445
|
isSearchOpenOnce.value = true;
|
|
3324
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
|
+
};
|
|
3325
3458
|
const isCartOpen = ref(false);
|
|
3326
3459
|
const isCartOpenOnce = ref(false);
|
|
3327
3460
|
watchOnce(isCartOpen, () => {
|
|
@@ -3342,12 +3475,13 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3342
3475
|
delayedTotalItems.value = newTotalItems;
|
|
3343
3476
|
}, { immediate: true });
|
|
3344
3477
|
});
|
|
3345
|
-
const __returned__ = { SearchModal, CartSidebar, props, header, isSticky, positionY, categoryTrees, inlineMenuTrees, isSidenavOpen, isSearchOpen, isSearchOpenOnce, isCartOpen, isCartOpenOnce, isMounted, delayedTotalItems, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
|
|
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 };
|
|
3346
3479
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3347
3480
|
return __returned__;
|
|
3348
3481
|
}
|
|
3349
3482
|
});
|
|
3350
3483
|
function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3484
|
+
const _component_Fade = resolveComponent("Fade");
|
|
3351
3485
|
const _component_Skeleton = resolveComponent("Skeleton");
|
|
3352
3486
|
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
3353
3487
|
ref: "header",
|
|
@@ -3361,7 +3495,40 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3361
3495
|
], "text-3xl transition-colors"])}"></i></button></div>`);
|
|
3362
3496
|
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
3363
3497
|
_push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ class: "hidden lg:block" }, { inlineMenuTrees: $setup.inlineMenuTrees }), null, _parent));
|
|
3364
|
-
_push(`<div class="text-base-800 flex basis-1/4 items-center justify-end gap-3 px-2 lg:gap-4"><
|
|
3498
|
+
_push(`<div class="text-base-800 flex basis-1/4 items-center justify-end gap-3 px-2 lg:gap-4"><form action="/s" method="get" class="relative"><label for="HeaderSearch" class="sr-only">${ssrInterpolate("Buscar produtos")}</label>`);
|
|
3499
|
+
_push(ssrRenderComponent(_component_Fade, null, {
|
|
3500
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3501
|
+
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>`);
|
|
3503
|
+
} else {
|
|
3504
|
+
return [
|
|
3505
|
+
withDirectives(createVNode("div", { class: "absolute -right-0.5 -top-2 flex items-stretch" }, [
|
|
3506
|
+
createVNode("div", { class: "hidden w-12 bg-gradient-to-r from-transparent to-white sm:block" }),
|
|
3507
|
+
withDirectives(createVNode("input", {
|
|
3508
|
+
ref: "searchInput",
|
|
3509
|
+
type: "search",
|
|
3510
|
+
id: "HeaderSearch",
|
|
3511
|
+
name: "term",
|
|
3512
|
+
"onUpdate:modelValue": ($event) => $setup.searchTerm = $event,
|
|
3513
|
+
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
|
+
placeholder: `${"Buscar produtos"} ...`
|
|
3515
|
+
}, null, 8, ["onUpdate:modelValue", "placeholder"]), [
|
|
3516
|
+
[
|
|
3517
|
+
vModelText,
|
|
3518
|
+
$setup.searchTerm,
|
|
3519
|
+
void 0,
|
|
3520
|
+
{ trim: true }
|
|
3521
|
+
]
|
|
3522
|
+
])
|
|
3523
|
+
], 512), [
|
|
3524
|
+
[vShow, $setup.isSearchOpen]
|
|
3525
|
+
])
|
|
3526
|
+
];
|
|
3527
|
+
}
|
|
3528
|
+
}),
|
|
3529
|
+
_: 1
|
|
3530
|
+
}, _parent));
|
|
3531
|
+
_push(`<button type="submit"${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="${ssrRenderClass([$setup.isSearchOpen && "text-primary-600 -translate-x-2", "i-magnifying-glass hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"])}"></i></button></form>`);
|
|
3365
3532
|
_push(ssrRenderComponent($setup["AccountMenu"], { class: "hidden sm:block" }, {
|
|
3366
3533
|
button: withCtx(({ open }, _push2, _parent2, _scopeId) => {
|
|
3367
3534
|
if (_push2) {
|
|
@@ -3396,10 +3563,10 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3396
3563
|
}, {
|
|
3397
3564
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3398
3565
|
if (_push2) {
|
|
3399
|
-
_push2(ssrRenderComponent($setup["ShopSidenav"], mergeProps({ class: "
|
|
3566
|
+
_push2(ssrRenderComponent($setup["ShopSidenav"], mergeProps({ class: "pt-6" }, { categoryTrees: $setup.categoryTrees }), null, _parent2, _scopeId));
|
|
3400
3567
|
} else {
|
|
3401
3568
|
return [
|
|
3402
|
-
createVNode($setup["ShopSidenav"], mergeProps({ class: "
|
|
3569
|
+
createVNode($setup["ShopSidenav"], mergeProps({ class: "pt-6" }, { categoryTrees: $setup.categoryTrees }), null, 16)
|
|
3403
3570
|
];
|
|
3404
3571
|
}
|
|
3405
3572
|
}),
|
|
@@ -3408,8 +3575,13 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3408
3575
|
_push(ssrRenderComponent($setup["Drawer"], {
|
|
3409
3576
|
modelValue: $setup.isSearchOpen,
|
|
3410
3577
|
"onUpdate:modelValue": ($event) => $setup.isSearchOpen = $event,
|
|
3578
|
+
"is-hidden": !$setup.searchTerm || $setup.searchTerm.length < 2,
|
|
3411
3579
|
"has-close-button": false,
|
|
3412
|
-
|
|
3580
|
+
"anchor-el": $setup.searchInput?.parentElement,
|
|
3581
|
+
placement: "top",
|
|
3582
|
+
animation: "scale",
|
|
3583
|
+
"max-width": "55rem",
|
|
3584
|
+
class: "bg-white lg:mt-24 lg:bg-transparent"
|
|
3413
3585
|
}, {
|
|
3414
3586
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3415
3587
|
if (_push2) {
|
|
@@ -3418,13 +3590,14 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3418
3590
|
_push2(`<div class="container mx-auto"${_scopeId}>`);
|
|
3419
3591
|
_push2(ssrRenderComponent(_component_Skeleton, {
|
|
3420
3592
|
class: "p-6",
|
|
3421
|
-
"is-large": ""
|
|
3593
|
+
"is-large": "",
|
|
3594
|
+
"is-bold": ""
|
|
3422
3595
|
}, null, _parent2, _scopeId));
|
|
3423
3596
|
_push2(`</div>`);
|
|
3424
3597
|
},
|
|
3425
3598
|
default: () => {
|
|
3426
3599
|
if ($setup.isSearchOpenOnce) {
|
|
3427
|
-
_push2(ssrRenderComponent($setup["SearchModal"],
|
|
3600
|
+
_push2(ssrRenderComponent($setup["SearchModal"], { term: $setup.searchTerm }, null, _parent2, _scopeId));
|
|
3428
3601
|
} else {
|
|
3429
3602
|
_push2(`<!---->`);
|
|
3430
3603
|
}
|
|
@@ -3438,12 +3611,16 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3438
3611
|
createVNode("div", { class: "container mx-auto" }, [
|
|
3439
3612
|
createVNode(_component_Skeleton, {
|
|
3440
3613
|
class: "p-6",
|
|
3441
|
-
"is-large": ""
|
|
3614
|
+
"is-large": "",
|
|
3615
|
+
"is-bold": ""
|
|
3442
3616
|
})
|
|
3443
3617
|
])
|
|
3444
3618
|
]),
|
|
3445
3619
|
default: withCtx(() => [
|
|
3446
|
-
$setup.isSearchOpenOnce ? (openBlock(), createBlock($setup["SearchModal"], {
|
|
3620
|
+
$setup.isSearchOpenOnce ? (openBlock(), createBlock($setup["SearchModal"], {
|
|
3621
|
+
key: 0,
|
|
3622
|
+
term: $setup.searchTerm
|
|
3623
|
+
}, null, 8, ["term"])) : createCommentVNode("", true)
|
|
3447
3624
|
]),
|
|
3448
3625
|
_: 1
|
|
3449
3626
|
}))
|
|
@@ -3458,16 +3635,19 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3458
3635
|
modelValue: $setup.isCartOpen,
|
|
3459
3636
|
"onUpdate:modelValue": ($event) => $setup.isCartOpen = $event,
|
|
3460
3637
|
placement: "end",
|
|
3461
|
-
"backdrop-target": "#teleported-overlap"
|
|
3638
|
+
"backdrop-target": "#teleported-overlap",
|
|
3639
|
+
class: "shadow"
|
|
3462
3640
|
}, {
|
|
3463
3641
|
default: withCtx((_, _push3, _parent2, _scopeId) => {
|
|
3464
3642
|
if (_push3) {
|
|
3465
3643
|
ssrRenderSuspense(_push3, {
|
|
3466
3644
|
fallback: () => {
|
|
3645
|
+
_push3(`<div class="h-full bg-white"${_scopeId}>`);
|
|
3467
3646
|
_push3(ssrRenderComponent(_component_Skeleton, {
|
|
3468
3647
|
class: "px-6 pt-16",
|
|
3469
3648
|
"is-bold": ""
|
|
3470
3649
|
}, null, _parent2, _scopeId));
|
|
3650
|
+
_push3(`</div>`);
|
|
3471
3651
|
},
|
|
3472
3652
|
default: () => {
|
|
3473
3653
|
if ($setup.isCartOpenOnce) {
|
|
@@ -3484,10 +3664,12 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3484
3664
|
return [
|
|
3485
3665
|
(openBlock(), createBlock(Suspense, null, {
|
|
3486
3666
|
fallback: withCtx(() => [
|
|
3487
|
-
createVNode(
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3667
|
+
createVNode("div", { class: "h-full bg-white" }, [
|
|
3668
|
+
createVNode(_component_Skeleton, {
|
|
3669
|
+
class: "px-6 pt-16",
|
|
3670
|
+
"is-bold": ""
|
|
3671
|
+
})
|
|
3672
|
+
])
|
|
3491
3673
|
]),
|
|
3492
3674
|
default: withCtx(() => [
|
|
3493
3675
|
$setup.isCartOpenOnce ? (openBlock(), createBlock($setup["CartSidebar"], {
|
|
@@ -3535,7 +3717,13 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3535
3717
|
field: "categories",
|
|
3536
3718
|
value: categories?.map(({ _id, ...c }) => c)
|
|
3537
3719
|
});
|
|
3538
|
-
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2(["
|
|
3720
|
+
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2(["\n ", "\n ", "\n\n<script>", "<\/script>\n", ""])), 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" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
|
|
3721
|
+
${maybeRenderHead()}<a href="/">
|
|
3722
|
+
${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
|
|
3723
|
+
${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}
|
|
3724
|
+
` })}
|
|
3725
|
+
</a>
|
|
3726
|
+
` })}` })))}`;
|
|
3539
3727
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
|
|
3540
3728
|
|
|
3541
3729
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
@@ -3873,7 +4061,13 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3873
4061
|
}
|
|
3874
4062
|
}
|
|
3875
4063
|
}
|
|
3876
|
-
return renderTemplate`${renderComponent($$result, "ShopFooter", ShopFooter, { "stamps": stamps, "categories": mainCategories, "categoriesColTitle": categoriesList?.title, "pageLinks": pageLinks, "pagesColTitle": pagesList?.title }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
|
|
4064
|
+
return renderTemplate`${renderComponent($$result, "ShopFooter", ShopFooter, { "stamps": stamps, "categories": mainCategories, "categoriesColTitle": categoriesList?.title, "pageLinks": pageLinks, "pagesColTitle": pagesList?.title }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
|
|
4065
|
+
${maybeRenderHead()}<a href="/">
|
|
4066
|
+
${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
|
|
4067
|
+
${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "loading": "lazy", "class": "max-w-[150px]" })}
|
|
4068
|
+
` })}
|
|
4069
|
+
</a>
|
|
4070
|
+
` })}` })}`;
|
|
3877
4071
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageFooter.astro", void 0);
|
|
3878
4072
|
|
|
3879
4073
|
const useProductShelf = (props) => {
|
|
@@ -4097,7 +4291,8 @@ const $$BannerPictures = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4097
4291
|
if (!mobileWidths?.length) {
|
|
4098
4292
|
mobileWidths = [640, 1024];
|
|
4099
4293
|
}
|
|
4100
|
-
return renderTemplate`${img && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": img, "alt": alt || "", "widths": widths, "fetchpriority": index === 0 ? "high" : "low", "loading": index === 0 ? "eager" : "lazy", "class": `${mobileImg ? "hidden md:block " : ""}mx-auto text-sm text-opacity-70 ${className}` })}`}
|
|
4294
|
+
return renderTemplate`${img && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": img, "alt": alt || "", "widths": widths, "fetchpriority": index === 0 ? "high" : "low", "loading": index === 0 ? "eager" : "lazy", "class": `${mobileImg ? "hidden md:block " : ""}mx-auto text-sm text-opacity-70 ${className}` })}`}
|
|
4295
|
+
${mobileImg && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": mobileImg, "alt": alt || "", "widths": mobileWidths, "fetchpriority": index === 0 ? "high" : "low", "loading": index === 0 ? "eager" : "lazy", "class": `md:hidden mx-auto text-sm text-opacity-70 ${mobileClass}` })}`}`;
|
|
4101
4296
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/BannerPictures.astro", void 0);
|
|
4102
4297
|
|
|
4103
4298
|
const useBanner = (props) => {
|
|
@@ -4229,7 +4424,13 @@ const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4229
4424
|
const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
|
|
4230
4425
|
Astro2.self = $$BannersGrid;
|
|
4231
4426
|
const { banners } = Astro2.props;
|
|
4232
|
-
return renderTemplate`${maybeRenderHead()}<section class="ui-section">
|
|
4427
|
+
return renderTemplate`${maybeRenderHead()}<section class="ui-section">
|
|
4428
|
+
<ul class="flex flex-wrap lg:flex-nowrap gap-4">
|
|
4429
|
+
${banners.map((banner) => renderTemplate`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
|
|
4430
|
+
${renderComponent($$result, "Banner", Banner, { ...banner }, { "picture": ($$result2) => renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { ...banner, "slot": "picture" })}` })}
|
|
4431
|
+
</li>`)}
|
|
4432
|
+
</ul>
|
|
4433
|
+
</section>`;
|
|
4233
4434
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro", void 0);
|
|
4234
4435
|
|
|
4235
4436
|
const emitGtagEvent = async (name, _params) => {
|
|
@@ -4725,11 +4926,11 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4725
4926
|
_push(`<article${ssrRenderAttrs(mergeProps({
|
|
4726
4927
|
ref: "card",
|
|
4727
4928
|
"data-sku": $setup.product.sku,
|
|
4728
|
-
class: "group relative mx-auto h-full max-w-[350px] py-3"
|
|
4929
|
+
class: "group relative mx-auto h-full max-w-[350px] px-0.5 py-3 hover:z-[1]"
|
|
4729
4930
|
}, _attrs))}>`);
|
|
4730
4931
|
_push(ssrRenderComponent(_component_ALink, {
|
|
4731
4932
|
href: $setup.link,
|
|
4732
|
-
class: "flex h-full flex-col overflow-hidden rounded ring-black/5 group-hover:shadow group-hover:ring-1"
|
|
4933
|
+
class: "flex h-full flex-col overflow-hidden rounded bg-white ring-black/5 group-hover:shadow group-hover:ring-1"
|
|
4733
4934
|
}, {
|
|
4734
4935
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
4735
4936
|
if (_push2) {
|
|
@@ -4760,7 +4961,7 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4760
4961
|
} else {
|
|
4761
4962
|
_push2(`<!---->`);
|
|
4762
4963
|
}
|
|
4763
|
-
_push2(`<div class="relative z-10 flex grow flex-col justify-between
|
|
4964
|
+
_push2(`<div class="relative z-10 flex grow flex-col justify-between p-4"${_scopeId}>`);
|
|
4764
4965
|
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent($props.headingTag), {
|
|
4765
4966
|
class: ["ui-link line-clamp-2 no-underline", [
|
|
4766
4967
|
$setup.isActive ? "text-base-700" : "text-base-500",
|
|
@@ -4826,7 +5027,7 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4826
5027
|
createVNode("strong", null, toDisplayString($setup.discountPercentage), 1),
|
|
4827
5028
|
createTextVNode("% ")
|
|
4828
5029
|
])) : createCommentVNode("", true),
|
|
4829
|
-
createVNode("div", { class: "relative z-10 flex grow flex-col justify-between
|
|
5030
|
+
createVNode("div", { class: "relative z-10 flex grow flex-col justify-between p-4" }, [
|
|
4830
5031
|
(openBlock(), createBlock(resolveDynamicComponent($props.headingTag), {
|
|
4831
5032
|
class: ["ui-link line-clamp-2 no-underline", [
|
|
4832
5033
|
$setup.isActive ? "text-base-700" : "text-base-500",
|
|
@@ -4887,6 +5088,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
4887
5088
|
__expose();
|
|
4888
5089
|
let __temp, __restore;
|
|
4889
5090
|
const props = __props;
|
|
5091
|
+
const [
|
|
5092
|
+
DefineCarouselControl,
|
|
5093
|
+
ReuseCarouselControl
|
|
5094
|
+
] = createReusableTemplate();
|
|
4890
5095
|
const {
|
|
4891
5096
|
title,
|
|
4892
5097
|
titleLink,
|
|
@@ -4897,7 +5102,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
4897
5102
|
[__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
|
|
4898
5103
|
}
|
|
4899
5104
|
const listName = title.value || `Shelf ${useId()}`;
|
|
4900
|
-
const __returned__ = { props, title, titleLink, fetching, products, listName, ProductCard };
|
|
5105
|
+
const __returned__ = { props, DefineCarouselControl, ReuseCarouselControl, title, titleLink, fetching, products, listName, ProductCard };
|
|
4901
5106
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
4902
5107
|
return __returned__;
|
|
4903
5108
|
}
|
|
@@ -4931,24 +5136,44 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4931
5136
|
_push(ssrRenderComponent(_component_Carousel, { class: "group/shelf" }, {
|
|
4932
5137
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
4933
5138
|
if (_push2) {
|
|
4934
|
-
_push2(
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
5139
|
+
_push2(ssrRenderComponent($setup["DefineCarouselControl"], null, {
|
|
5140
|
+
default: withCtx(({ isPrev }, _push3, _parent3, _scopeId2) => {
|
|
5141
|
+
if (_push3) {
|
|
5142
|
+
_push3(ssrRenderComponent(_component_CarouselControl, {
|
|
5143
|
+
style: $setup.products.length > 2 ? null : { display: "none" },
|
|
5144
|
+
class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
|
|
5145
|
+
"is-prev": isPrev
|
|
5146
|
+
}, null, _parent3, _scopeId2));
|
|
5147
|
+
} else {
|
|
5148
|
+
return [
|
|
5149
|
+
withDirectives(createVNode(_component_CarouselControl, {
|
|
5150
|
+
class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
|
|
5151
|
+
"is-prev": isPrev
|
|
5152
|
+
}, null, 8, ["class", "is-prev"]), [
|
|
5153
|
+
[vShow, $setup.products.length > 2]
|
|
5154
|
+
])
|
|
5155
|
+
];
|
|
5156
|
+
}
|
|
5157
|
+
}),
|
|
5158
|
+
_: 1
|
|
5159
|
+
}, _parent2, _scopeId));
|
|
5160
|
+
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], { "is-prev": true }, null, _parent2, _scopeId));
|
|
5161
|
+
_push2(ssrRenderComponent($setup["ReuseCarouselControl"], null, null, _parent2, _scopeId));
|
|
4941
5162
|
} else {
|
|
4942
5163
|
return [
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
5164
|
+
createVNode($setup["DefineCarouselControl"], null, {
|
|
5165
|
+
default: withCtx(({ isPrev }) => [
|
|
5166
|
+
withDirectives(createVNode(_component_CarouselControl, {
|
|
5167
|
+
class: ["uno-nxxji7", isPrev ? "!-left-4" : "!-right-4"],
|
|
5168
|
+
"is-prev": isPrev
|
|
5169
|
+
}, null, 8, ["class", "is-prev"]), [
|
|
5170
|
+
[vShow, $setup.products.length > 2]
|
|
5171
|
+
])
|
|
5172
|
+
]),
|
|
5173
|
+
_: 1
|
|
5174
|
+
}),
|
|
5175
|
+
createVNode($setup["ReuseCarouselControl"], { "is-prev": true }),
|
|
5176
|
+
createVNode($setup["ReuseCarouselControl"])
|
|
4952
5177
|
];
|
|
4953
5178
|
}
|
|
4954
5179
|
}),
|
|
@@ -5061,9 +5286,30 @@ const $$Breadcrumbs = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
5061
5286
|
const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
|
|
5062
5287
|
Astro2.self = $$Breadcrumbs;
|
|
5063
5288
|
const { breadcrumbs, inlineJSONLd } = await useBreadcrumbs(Astro2.props);
|
|
5064
|
-
return renderTemplate`${breadcrumbs.length > 0 && renderTemplate`${maybeRenderHead()}<section${addAttribute(`ui-section-slim ${breadcrumbs.length > 1 ? "" : "hidden lg:block"}`, "class")}
|
|
5065
|
-
|
|
5066
|
-
|
|
5289
|
+
return renderTemplate`${breadcrumbs.length > 0 && renderTemplate`${maybeRenderHead()}<section${addAttribute(`ui-section-slim ${breadcrumbs.length > 1 ? "" : "hidden lg:block"}`, "class")}>
|
|
5290
|
+
<nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm">
|
|
5291
|
+
<ol class="flex items-center gap-1 text-base-600">
|
|
5292
|
+
<li>
|
|
5293
|
+
<a href="/" class="hover:text-primary">
|
|
5294
|
+
<span class="sr-only"> Home </span>
|
|
5295
|
+
<i class="i-home"></i>
|
|
5296
|
+
</a>
|
|
5297
|
+
</li>
|
|
5298
|
+
${breadcrumbs.map(
|
|
5299
|
+
({ name, link }, i) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${i + 1 < breadcrumbs.length ? renderTemplate`<li class="text-base-300">
|
|
5300
|
+
<i class="i-chevron-right"></i>
|
|
5301
|
+
</li><li class="whitespace-nowrap">
|
|
5302
|
+
<a${addAttribute(link, "href")} class="hover:text-primary">${name}</a>
|
|
5303
|
+
</li>` : renderTemplate`<li class="hidden lg:block text-base-300">
|
|
5304
|
+
<i class="i-chevron-right"></i>
|
|
5305
|
+
</li><li class="hidden lg:block whitespace-nowrap overflow-hidden text-ellipsis">
|
|
5306
|
+
<span class="text-base-500">${name}</span>
|
|
5307
|
+
</li>`}` })}`
|
|
5308
|
+
)}
|
|
5309
|
+
</ol>
|
|
5310
|
+
</nav>
|
|
5311
|
+
${inlineJSONLd && renderTemplate(_a$1 || (_a$1 = __template$1(['<script type="application/ld+json">', "<\/script>"])), unescapeHTML(inlineJSONLd))}
|
|
5312
|
+
</section>`}`;
|
|
5067
5313
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Breadcrumbs.astro", void 0);
|
|
5068
5314
|
|
|
5069
5315
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
@@ -6012,7 +6258,8 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
6012
6258
|
}
|
|
6013
6259
|
});
|
|
6014
6260
|
const { isHomepage } = routeContext;
|
|
6015
|
-
return renderTemplate`${maybeRenderHead()}<article class="my-9 md:my-12">
|
|
6261
|
+
return renderTemplate`${maybeRenderHead()}<article class="my-9 md:my-12">
|
|
6262
|
+
${sections.map(async ({ type, props }) => {
|
|
6016
6263
|
switch (type) {
|
|
6017
6264
|
case "product-shelf":
|
|
6018
6265
|
return isHomepage ? renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
|
|
@@ -6024,13 +6271,16 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
6024
6271
|
return renderTemplate`${renderComponent($$result, "DocDescription", DocDescription, {})}`;
|
|
6025
6272
|
case "product-details":
|
|
6026
6273
|
const { hasDescription, hasSpecifications, ...detailsProps } = props;
|
|
6027
|
-
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
|
|
6274
|
+
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`
|
|
6275
|
+
${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
|
+
` })}`;
|
|
6028
6277
|
case "c:foo":
|
|
6029
6278
|
return renderTemplate`<div${addAttribute(props.foo, "data-foo")}></div>`;
|
|
6030
6279
|
default:
|
|
6031
6280
|
return renderTemplate`<div${addAttribute(type, "data-section")}></div>`;
|
|
6032
6281
|
}
|
|
6033
|
-
})}
|
|
6282
|
+
})}
|
|
6283
|
+
</article>`;
|
|
6034
6284
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Sections.astro", void 0);
|
|
6035
6285
|
|
|
6036
6286
|
var __freeze = Object.freeze;
|
|
@@ -6056,7 +6306,10 @@ const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
6056
6306
|
api.get("grids"),
|
|
6057
6307
|
fetchingApiContext
|
|
6058
6308
|
]);
|
|
6059
|
-
return renderTemplate`${maybeRenderHead()}<main>
|
|
6309
|
+
return renderTemplate`${maybeRenderHead()}<main>
|
|
6310
|
+
${renderComponent($$result, "SharedData", $$SharedData, { "field": "grids", "value": grids })}
|
|
6311
|
+
${renderComponent($$result, "Sections", $$Sections, {})}
|
|
6312
|
+
</main>`;
|
|
6060
6313
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro", void 0);
|
|
6061
6314
|
|
|
6062
6315
|
const $$Astro = createAstro("https://demo.ecomplus.app");
|
|
@@ -6079,7 +6332,15 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
6079
6332
|
}
|
|
6080
6333
|
loadError = err;
|
|
6081
6334
|
}
|
|
6082
|
-
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
|
|
6335
|
+
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
|
|
6336
|
+
${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`
|
|
6337
|
+
|
|
6338
|
+
${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
|
|
6339
|
+
${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}
|
|
6340
|
+
${renderComponent($$result2, "PageFooter", $$PageFooter, {})}
|
|
6341
|
+
` })}`}
|
|
6342
|
+
${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
|
|
6343
|
+
</html>`;
|
|
6083
6344
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", void 0);
|
|
6084
6345
|
|
|
6085
6346
|
const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
|
|
@@ -6093,4 +6354,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
6093
6354
|
url: $$url
|
|
6094
6355
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
6095
6356
|
|
|
6096
|
-
export { $$BaseHead as $, Banner as B, CheckoutLink as C, FooterStamps as F,
|
|
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 };
|