cloudcommerce 0.33.4 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- 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/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/monocard/functions/many/package.json +3 -3
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
- package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/monocard/package.json +2 -2
- package/package.json +2 -2
- package/packages/api/lib/api.js +5 -2
- package/packages/api/lib/api.js.map +1 -1
- package/packages/api/package.json +1 -1
- package/packages/api/src/api.ts +5 -2
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/lib-mjs/deadlines/range-6.mjs +633 -633
- 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 +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firebase.json +5 -0
- package/packages/cli/package.json +1 -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 +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/checkout.js +4 -6
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js +3 -0
- package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/modules/src/firebase/checkout.ts +4 -6
- package/packages/modules/src/firebase/functions-checkout/handle-order-transaction.ts +3 -0
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/.auto-imports.d.ts +1 -1
- package/packages/storefront/astro.config.mjs +5 -10
- package/packages/storefront/config/astro/mock-pwa-info.mjs +2 -0
- package/packages/storefront/dist/client/_astro/AccountPage.6ead88b1.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.8151e4ee.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.46474cda.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.fbca6881.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.311303d8.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.d66f9f7e.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.9536b4c1.js +1 -0
- package/packages/storefront/dist/client/_astro/QuantitySelector.e74e368a.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.83b73e0b.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.06f4d486.js +4 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.dd1a60ce.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.52cde7a0.css +1 -0
- package/packages/storefront/dist/client/_astro/afetch.f4507208.js +1 -0
- package/packages/storefront/dist/client/_astro/client.7c1b0374.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.2d173cc1.js +1 -0
- 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 +1 -0
- package/packages/storefront/dist/client/_astro/firebase-app.992a296f.js +16 -0
- package/packages/storefront/dist/client/_astro/format-money.8962a5ab.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.57d8d9d0.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.f16496bc.js +1 -0
- package/packages/storefront/dist/client/_astro/i18n.78f362d9.js +1 -0
- package/packages/storefront/dist/client/_astro/img-sizes.41e0efe4.js +1 -0
- package/packages/storefront/dist/client/_astro/img.bfbd75a8.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.3f59f3c7.js → index-61e5ac61.bdc8d0cd.js} +129 -99
- package/packages/storefront/dist/client/_astro/index.e02b88b7.js +1 -0
- package/packages/storefront/dist/client/_astro/index.e20e07e3.js +1 -0
- 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/modules-info.3c447a07.js +1 -0
- package/packages/storefront/dist/client/_astro/name.3cd31c8b.js +1 -0
- package/packages/storefront/dist/client/_astro/photoswipe-lightbox.esm.c157838f.js +4 -0
- package/packages/storefront/dist/client/_astro/photoswipe.01431ec7.js +2 -0
- package/packages/storefront/dist/client/_astro/photoswipe.esm.92c2d901.js +4 -0
- package/packages/storefront/dist/client/_astro/price.04ceb6c4.js +1 -0
- package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +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_Z1JT1HB.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_tMFW0.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_Z2kFHGk.avif +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/sf-utils.b04e1813.js +1 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.6b03b120.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.d0c184ef.js +1 -0
- package/packages/storefront/dist/client/_astro/use-product-card.e0990572.js +1 -0
- package/packages/storefront/dist/client/robots.txt +1 -1
- package/packages/storefront/dist/client/~fallback.html +21 -14
- package/packages/storefront/dist/client/~index.html +43 -36
- package/packages/storefront/dist/server/chunks/CartSidebar_03b51b57.mjs +203 -0
- package/packages/storefront/dist/server/chunks/SearchModal_2afca4fe.mjs +18 -0
- package/packages/storefront/dist/server/chunks/_.._4def02ff.mjs +6 -0
- package/packages/storefront/dist/server/chunks/account_2ee873cf.mjs +6 -0
- package/packages/storefront/dist/server/chunks/astro/assets-service_66a9c838.mjs +496 -0
- package/packages/storefront/dist/server/chunks/{astro.708269c6.mjs → astro_8447f017.mjs} +208 -1878
- package/packages/storefront/dist/server/chunks/index_37bacd45.mjs +6 -0
- package/packages/storefront/dist/server/chunks/index_5dcbbe32.mjs +6 -0
- package/packages/storefront/dist/server/chunks/node_b3ae36f1.mjs +6 -0
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0808946e.mjs → __80fd1c60.mjs} +1781 -950
- package/packages/storefront/dist/server/chunks/pages/account_bfd9a66a.mjs +21 -0
- package/packages/storefront/dist/server/chunks/pages/index_8e1d063c.mjs +295 -0
- package/packages/storefront/dist/server/chunks/pages/node_530334cf.mjs +160 -0
- package/packages/storefront/dist/server/chunks/pages/~fallback_6ff698cd.mjs +30 -0
- package/packages/storefront/dist/server/chunks/photoswipe_9528923e.mjs +3 -0
- package/packages/storefront/dist/server/chunks/~fallback_7c4b84d5.mjs +6 -0
- package/packages/storefront/dist/server/entry.mjs +1012 -2526
- package/packages/storefront/dist/server/images.dist.csv +30 -30
- package/packages/storefront/dist/server/manifest_2019b8a9.mjs +1069 -0
- package/packages/storefront/dist/server/renderers.mjs +335 -51
- package/packages/storefront/dist/server/static-builds.csv +66 -51
- package/packages/storefront/package.json +4 -5
- package/packages/storefront/src/env.d.ts +1 -1
- package/packages/storefront/src/images/get-built-image.ts +36 -8
- package/packages/storefront/src/images/get-built-picture.ts +3 -130
- package/packages/storefront/src/images/picture-base.ts +135 -0
- package/packages/storefront/src/images/use-ssr-picture.ts +18 -10
- package/packages/storefront/src/lib/components/Picture.astro +47 -4
- package/packages/storefront/src/lib/scripts/vbeta-app.ts +4 -1
- package/packages/storefront/src/lib/state/modules-info.ts +5 -1
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/pnpm-workspace.yaml +0 -2
- package/packages/storefront/dist/client/_astro/Carousel.4bf71bce.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.05b12b39.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.fe108a14.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.2c821b77.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.78eb0a61.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.46d8a51c.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.3694a82b.js +0 -4
- package/packages/storefront/dist/client/_astro/_...slug_.a4a7a874.css +0 -1
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.ee681fa8.js +0 -1
- package/packages/storefront/dist/client/_astro/api.a2eda23e.js +0 -1
- package/packages/storefront/dist/client/_astro/client.e6d9439a.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
- package/packages/storefront/dist/client/_astro/format-money.923559cc.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.648beb9d.js +0 -1
- package/packages/storefront/dist/client/_astro/img.ec6ba316.js +0 -1
- package/packages/storefront/dist/client/_astro/index.fadf28bd.js +0 -1
- package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
- package/packages/storefront/dist/client/_astro/modules-info.df822732.js +0 -1
- package/packages/storefront/dist/client/_astro/preload-helper.cf010ec4.js +0 -1
- package/packages/storefront/dist/client/_astro/rect8589_1ND0he.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1mIaKd.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z2a06Gx.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z2nulUU.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_ZH7hsH.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1IVKep.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1zkdb4.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_CnIof.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z1OtQaE.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_flB3g.png +0 -0
- package/packages/storefront/dist/client/_astro/session-utm.744b0db3.js +0 -1
- package/packages/storefront/dist/client/_astro/workbox-window.prod.es5.a7b12eab.js +0 -2
- package/packages/storefront/dist/client/manifest.webmanifest +0 -1
- package/packages/storefront/dist/client/sw.js +0 -1
- package/packages/storefront/dist/client/workbox-1b331600.js +0 -1
- package/packages/storefront/dist/server/chunks/CartSidebar.4179ad81.mjs +0 -386
- package/packages/storefront/dist/server/chunks/SearchModal.146ce2f7.mjs +0 -37
- package/packages/storefront/dist/server/chunks/_...05c626ea.mjs +0 -28
- package/packages/storefront/dist/server/chunks/account@_@astro.5eaddaf8.mjs +0 -28
- package/packages/storefront/dist/server/chunks/index@_@astro.25a343cc.mjs +0 -28
- package/packages/storefront/dist/server/chunks/index@_@astro.2d2f2e33.mjs +0 -28
- package/packages/storefront/dist/server/chunks/pages/account.astro.32e7e6ef.mjs +0 -23
- package/packages/storefront/dist/server/chunks/pages/index.astro.d4145872.mjs +0 -186
- package/packages/storefront/dist/server/chunks/pages/~fallback.astro.84d4765b.mjs +0 -49
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.86d710c3.mjs +0 -28
- package/packages/storefront/dist/server/manifest.webmanifest +0 -1
- package/packages/storefront/dist/server/registerSW.js +0 -1
- /package/packages/storefront/dist/client/_astro/{headphone_1Ekzdh.avif → headphone_T2Jjc.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{headphone_Z1GbHcH.webp → headphone_Z1CG18r.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{passion_1LvKlp.webp → passion_LHbe9.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{passion_2PSWs.avif → passion_Z23MeUb.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_1A8K2Q.webp → rect8589_1f5opX.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_ZorpIx.webp → rect8589_IUskt.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_Z1NFjiR.avif → rect8589_Z1Ap1Im.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_LhopI.avif → rect8589_ZY9mtN.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_1CcLjM.avif → rect859_1TgQXS.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_299fN7.avif → rect859_2Nm1z.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_sLbkT.webp → rect859_Z29FI4V.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_rsWaw.webp → rect859_ZkpPFI.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect89_1yf5jS.avif → rect89_1TSfW7.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect89_GQBli.webp → rect89_Z1re32x.webp} +0 -0
package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0808946e.mjs → __80fd1c60.mjs}
RENAMED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as createAstro, e as createComponent, r as renderTemplate, f as addAttribute, u as unescapeHTML, g as renderComponent, h as createTransitionScope, s as spreadAttributes, i as renderSlotToString, j as renderAllHeadContent, m as maybeRenderHead, k as renderSlot, F as Fragment } from '../astro_8447f017.mjs';
|
|
2
2
|
import api from '@cloudcommerce/api';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import fs, { readFileSync } from 'node:fs';
|
|
5
5
|
import { resolve, join } from 'node:path';
|
|
6
6
|
import config from '@cloudcommerce/config';
|
|
7
|
-
import { img, price, formatMoney, randomObjectId, nickname, inStock, name, onPromotion, categoriesList } from '@ecomplus/utils';
|
|
8
|
-
import
|
|
9
|
-
/* empty css
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { ssrRenderAttrs,
|
|
7
|
+
import { img, price, formatMoney, randomObjectId, nickname, inStock, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue, gridTitle, specValueByText } from '@ecomplus/utils';
|
|
8
|
+
import 'clsx';
|
|
9
|
+
/* empty css */import { renderSync, parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
|
|
10
|
+
import mime from 'mime/lite.js';
|
|
11
|
+
import { reactive, computed, shallowRef, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, withDirectives, createVNode, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, watch, ref, toRef, withModifiers, renderSlot as renderSlot$1, Teleport, resolveDynamicComponent, onMounted, createTextVNode, toDisplayString, defineAsyncComponent, Suspense, createSlots, shallowReactive, withAsyncContext, inject, provide } from 'vue';
|
|
12
|
+
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';
|
|
14
|
+
import mitt from 'mitt';
|
|
13
15
|
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
14
16
|
|
|
15
17
|
const _export_sfc = (sfc, props) => {
|
|
@@ -84,8 +86,8 @@ global.__storefrontCMS = (fs, resolvePath) => {
|
|
|
84
86
|
settings = {};
|
|
85
87
|
}
|
|
86
88
|
const { domain } = settings;
|
|
87
|
-
const primaryColor = settings.
|
|
88
|
-
const secondaryColor = settings.
|
|
89
|
+
const primaryColor = settings.primaryColor || '#137c5c';
|
|
90
|
+
const secondaryColor = settings.secondaryColor || primaryColor;
|
|
89
91
|
|
|
90
92
|
return {
|
|
91
93
|
domain,
|
|
@@ -101,7 +103,7 @@ const _getConfig = () => {
|
|
|
101
103
|
ECOM_STORE_ID,
|
|
102
104
|
VITE_ECOM_STORE_ID,
|
|
103
105
|
PROD,
|
|
104
|
-
} = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://
|
|
106
|
+
} = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://demo.ecomplus.app","ASSETS_PREFIX":undefined},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
|
|
105
107
|
if (VITE_ECOM_STORE_ID) {
|
|
106
108
|
config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
|
|
107
109
|
} else if (ECOM_STORE_ID) {
|
|
@@ -179,11 +181,19 @@ if (!globalThis.$storefront) {
|
|
|
179
181
|
}
|
|
180
182
|
const setResponseCache = (Astro, maxAge, sMaxAge) => {
|
|
181
183
|
const headerName = "Cache-Control" ;
|
|
182
|
-
let cacheControl =
|
|
183
|
-
if (
|
|
184
|
-
cacheControl
|
|
184
|
+
let cacheControl = null;
|
|
185
|
+
if (globalThis.$storefrontCacheController) {
|
|
186
|
+
cacheControl = globalThis.$storefrontCacheController(Astro, maxAge, sMaxAge);
|
|
187
|
+
} else {
|
|
188
|
+
cacheControl = `public, max-age=${maxAge}, must-revalidate`;
|
|
189
|
+
if (sMaxAge)
|
|
190
|
+
cacheControl += `, s-maxage=${sMaxAge}`;
|
|
191
|
+
if (sMaxAge || maxAge >= 60)
|
|
192
|
+
cacheControl += `, stale-while-revalidate=604800`;
|
|
193
|
+
}
|
|
194
|
+
if (cacheControl) {
|
|
195
|
+
Astro.response.headers.set(headerName, cacheControl);
|
|
185
196
|
}
|
|
186
|
-
Astro.response.headers.set(headerName, cacheControl);
|
|
187
197
|
};
|
|
188
198
|
const loadRouteContext = async (Astro, {
|
|
189
199
|
contentCollection,
|
|
@@ -217,8 +227,8 @@ const loadRouteContext = async (Astro, {
|
|
|
217
227
|
} else if (slug) {
|
|
218
228
|
if (contentCollection) {
|
|
219
229
|
cmsContent = await config.getContent(`${contentCollection}/${slug}`);
|
|
220
|
-
} else if (slug.startsWith("
|
|
221
|
-
const err = new Error(
|
|
230
|
+
} else if (slug.startsWith("_api/") || slug === "_analytics") {
|
|
231
|
+
const err = new Error(`/${slug} route not implemented on SSR directly`);
|
|
222
232
|
Astro.response.status = 501;
|
|
223
233
|
err.responseHTML = `<head></head><body>${err.message}</body>`;
|
|
224
234
|
throw err;
|
|
@@ -291,12 +301,20 @@ const loadRouteContext = async (Astro, {
|
|
|
291
301
|
throw err;
|
|
292
302
|
}
|
|
293
303
|
Astro.response.headers.set("X-Load-Took", String(Date.now() - startedAt));
|
|
304
|
+
{
|
|
305
|
+
const { assetsPrefix } = config.settings;
|
|
306
|
+
if (assetsPrefix && assetsPrefix.startsWith("https://")) {
|
|
307
|
+
const cdnURL = assetsPrefix.replace(/(https:\/\/[^/]+).*/, "$1");
|
|
308
|
+
Astro.response.headers.set("Link", `<${cdnURL}/>; rel=preconnect`);
|
|
309
|
+
}
|
|
310
|
+
Astro.locals.assetsPrefix = assetsPrefix || "";
|
|
311
|
+
}
|
|
294
312
|
if (urlPath === "/~fallback") {
|
|
295
313
|
setResponseCache(Astro, 3600, 86400);
|
|
296
314
|
} else if (isHomepage) {
|
|
297
|
-
setResponseCache(Astro, 180
|
|
315
|
+
setResponseCache(Astro, 180);
|
|
298
316
|
} else {
|
|
299
|
-
setResponseCache(Astro, 120,
|
|
317
|
+
setResponseCache(Astro, 120, 180);
|
|
300
318
|
}
|
|
301
319
|
const routeContext = {
|
|
302
320
|
...config,
|
|
@@ -312,24 +330,28 @@ const loadRouteContext = async (Astro, {
|
|
|
312
330
|
return routeContext;
|
|
313
331
|
};
|
|
314
332
|
|
|
315
|
-
|
|
333
|
+
/* eslint-disable */
|
|
334
|
+
|
|
335
|
+
const pwaInfo = false;
|
|
316
336
|
|
|
317
|
-
const $$Astro$
|
|
337
|
+
const $$Astro$f = createAstro("https://demo.ecomplus.app");
|
|
318
338
|
const $$ViewTransitions = createComponent(async ($$result, $$props, $$slots) => {
|
|
319
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
339
|
+
const Astro2 = $$result.createAstro($$Astro$f, $$props, $$slots);
|
|
320
340
|
Astro2.self = $$ViewTransitions;
|
|
321
341
|
const { fallback = "animate" } = Astro2.props;
|
|
322
342
|
return renderTemplate`<meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback"${addAttribute(fallback, "content")}>`;
|
|
323
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/
|
|
343
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/ViewTransitions.astro", void 0);
|
|
324
344
|
|
|
325
345
|
var __freeze$4 = Object.freeze;
|
|
326
346
|
var __defProp$4 = Object.defineProperty;
|
|
327
347
|
var __template$4 = (cooked, raw) => __freeze$4(__defProp$4(cooked, "raw", { value: __freeze$4(raw || cooked.slice()) }));
|
|
328
|
-
var
|
|
329
|
-
const $$Astro$
|
|
348
|
+
var _b, _c;
|
|
349
|
+
const $$Astro$e = createAstro("https://demo.ecomplus.app");
|
|
330
350
|
const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
331
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
351
|
+
const Astro2 = $$result.createAstro($$Astro$e, $$props, $$slots);
|
|
332
352
|
Astro2.self = $$BaseHead;
|
|
353
|
+
const isPWA = pwaInfo !== false;
|
|
354
|
+
const hasViewTransitions = Astro2.props.hasViewTransitions !== false && !Astro2.url.pathname.startsWith("/app/");
|
|
333
355
|
const deployRand = ({}).DEPLOY_RAND || "_";
|
|
334
356
|
const getIconUrl = (size) => {
|
|
335
357
|
return `/_image?f=png&w=${size}&h=${size}&href=${encodeURIComponent(settings.icon)}&V=${deployRand}`;
|
|
@@ -354,8 +376,8 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
354
376
|
}
|
|
355
377
|
const apiDoc = apiContext.doc;
|
|
356
378
|
const state = apiDoc || cmsContent || {};
|
|
357
|
-
const title = state.meta_title || state.name || state.title || settings.name;
|
|
358
|
-
const description = state.meta_description || state.short_description || settings.description;
|
|
379
|
+
const title = state.meta_title || state.metaTitle || state.name && `${state.name} | ${settings.name}` || state.title && `${state.title} | ${settings.name}` || settings.name;
|
|
380
|
+
const description = state.meta_description || state.metaDescription || state.short_description || settings.description;
|
|
359
381
|
const favicon = settings.icon ? getIconUrl(32) : "/favicon.ico";
|
|
360
382
|
const shortcutIcon = settings.icon ? getIconUrl(192) : null;
|
|
361
383
|
const canonicalUrl = new URL(Astro2.url.pathname, Astro2.site || `https://${domain}`);
|
|
@@ -367,13 +389,18 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
367
389
|
ogImage = picture && picture.url;
|
|
368
390
|
}
|
|
369
391
|
if (!ogImage) {
|
|
370
|
-
if (metatagsContent?.
|
|
371
|
-
ogImage = metatagsContent.
|
|
392
|
+
if (metatagsContent?.ogImage) {
|
|
393
|
+
ogImage = metatagsContent.ogImage.charAt(0) === "/" ? `https://${domain}${metatagsContent.ogImage}` : metatagsContent.ogImage;
|
|
372
394
|
}
|
|
373
395
|
} else {
|
|
374
396
|
ogImage = ogImage.replace(/(\w+\.)?(ecoms\d)\.com/i, "$2-nyc3.nyc3.cdn.digitaloceanspaces.com");
|
|
375
397
|
}
|
|
376
398
|
let inlineClientJS = `
|
|
399
|
+
window._emitApiContext = (id = null) => {
|
|
400
|
+
console.log('[ctx] emit ' + id);
|
|
401
|
+
window.dispatchEvent(new Event('storefront:apiContext'));
|
|
402
|
+
window._emitedContextId = id;
|
|
403
|
+
};
|
|
377
404
|
window.ECOM_STORE_ID = ${storeId};
|
|
378
405
|
window.ECOM_LANG = '${lang}';
|
|
379
406
|
window.ECOM_CURRENCY = '${currency}';
|
|
@@ -389,6 +416,7 @@ setTimeout(() => {
|
|
|
389
416
|
window.location.replace("/~fallback?status=${statusCode}&url=${encodeURIComponent(url)}");
|
|
390
417
|
}, 1);`;
|
|
391
418
|
}
|
|
419
|
+
let contextInlineClientJS;
|
|
392
420
|
if (apiDoc) {
|
|
393
421
|
if (typeof apiDoc.price === "number") {
|
|
394
422
|
apiDoc.price = price(apiDoc);
|
|
@@ -410,18 +438,24 @@ setTimeout(() => {
|
|
|
410
438
|
}
|
|
411
439
|
return nestedDoc;
|
|
412
440
|
};
|
|
413
|
-
|
|
441
|
+
inlineClientJS += `
|
|
442
|
+
window._firstLoadContextId = '${apiDoc._id}';`;
|
|
443
|
+
contextInlineClientJS = `
|
|
414
444
|
$storefront.apiContext = ${JSON.stringify({
|
|
415
445
|
resource: apiContext.resource,
|
|
416
446
|
doc: minifyApiDoc({ ...apiDoc }),
|
|
417
447
|
timestamp: Date.now()
|
|
418
448
|
})};
|
|
419
|
-
$storefront.context /* DEPRECATED */ = $storefront.apiContext
|
|
449
|
+
$storefront.context /* DEPRECATED */ = $storefront.apiContext;
|
|
450
|
+
_emitApiContext('${apiDoc._id}');`;
|
|
420
451
|
} else {
|
|
421
|
-
|
|
452
|
+
inlineClientJS += `
|
|
453
|
+
window._firstLoadContextId = null;`;
|
|
454
|
+
contextInlineClientJS = `
|
|
422
455
|
$storefront.apiContext = null;
|
|
423
456
|
delete $storefront.apiContext;
|
|
424
|
-
delete $storefront.context
|
|
457
|
+
delete $storefront.context;
|
|
458
|
+
_emitApiContext();`;
|
|
425
459
|
}
|
|
426
460
|
if (isPreview) {
|
|
427
461
|
inlineClientJS += `
|
|
@@ -434,8 +468,8 @@ window.$isCmsPreview = true;`;
|
|
|
434
468
|
url: `https://${domain}/`,
|
|
435
469
|
logo: `https://${domain}${settings.logo}`
|
|
436
470
|
});
|
|
437
|
-
return renderTemplate(
|
|
438
|
-
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro",
|
|
471
|
+
return renderTemplate(_c || (_c = __template$4(['<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="theme-color"', '><link rel="icon" type="image/png"', ' sizes="32x32">', "<title>", '</title><meta name="description"', '><meta name="author"', '><meta name="generator"', '><link rel="canonical"', ">", '<meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta property="og:site_name"', '><meta property="og:url"', '><meta property="og:title"', '><meta property="og:description"', '><meta property="og:type" content="website"><meta property="og:locale"', ">", "", '<meta name="twitter:card" content="summary">', '<meta name="ecom-store-id"', ">", "<script", ">", '<\/script><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?.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
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", "self");
|
|
439
473
|
|
|
440
474
|
function has(value) {
|
|
441
475
|
return typeof value === "string";
|
|
@@ -573,46 +607,6 @@ const Head = createComponent({
|
|
|
573
607
|
}
|
|
574
608
|
});
|
|
575
609
|
|
|
576
|
-
const { STOREFRONT_BASE_DIR } = process.env;
|
|
577
|
-
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
578
|
-
const builtImages = [];
|
|
579
|
-
const manifestFilepath = join(baseDir, "dist/server/images.dist.csv");
|
|
580
|
-
readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
|
|
581
|
-
const [filename, width, height] = line.split(",");
|
|
582
|
-
builtImages.push({
|
|
583
|
-
filename,
|
|
584
|
-
width: Number(width),
|
|
585
|
-
height: Number(height)
|
|
586
|
-
});
|
|
587
|
-
});
|
|
588
|
-
builtImages.sort((a, b) => {
|
|
589
|
-
if (a.width < b.width)
|
|
590
|
-
return -1;
|
|
591
|
-
return 1;
|
|
592
|
-
});
|
|
593
|
-
const getBuiltImage = async ({ src, width, format }) => {
|
|
594
|
-
const filename = src.replace(/^.*\//, "").replace(/.\w+(\?.*)?$/, "");
|
|
595
|
-
const filenameRegExp = new RegExp(`[_.][a-z0-9]+\\.${format}$`, "i");
|
|
596
|
-
const matchFilename = (_builtImage) => {
|
|
597
|
-
return filename === _builtImage.filename.replace(filenameRegExp, "");
|
|
598
|
-
};
|
|
599
|
-
let builtImage = builtImages.find((_builtImage) => {
|
|
600
|
-
return _builtImage.width >= width && matchFilename(_builtImage);
|
|
601
|
-
});
|
|
602
|
-
if (!builtImage) {
|
|
603
|
-
builtImage = builtImages.find(matchFilename);
|
|
604
|
-
}
|
|
605
|
-
if (builtImage) {
|
|
606
|
-
return {
|
|
607
|
-
src: `/_astro/${builtImage.filename}`,
|
|
608
|
-
width: builtImage.width,
|
|
609
|
-
height: builtImage.height
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
console.warn(`Could not match built ${format} image for ${src} ${width}px`);
|
|
613
|
-
return { src, width };
|
|
614
|
-
};
|
|
615
|
-
|
|
616
610
|
function removeQueryString(src) {
|
|
617
611
|
const index = src.lastIndexOf("?");
|
|
618
612
|
return index > 0 ? src.substring(0, index) : src;
|
|
@@ -642,7 +636,7 @@ async function resolveAspectRatio({ src, aspectRatio }) {
|
|
|
642
636
|
if (typeof src === "string") {
|
|
643
637
|
return parseAspectRatio(aspectRatio);
|
|
644
638
|
}
|
|
645
|
-
throw new Error('Custom (faster) `Picture.
|
|
639
|
+
throw new Error('Custom (faster) `Picture.runtime.astro` works only with string ("remote") src');
|
|
646
640
|
}
|
|
647
641
|
async function resolveFormats({ src, formats }) {
|
|
648
642
|
const unique = new Set(formats);
|
|
@@ -653,60 +647,111 @@ async function resolveFormats({ src, formats }) {
|
|
|
653
647
|
}
|
|
654
648
|
return Array.from(unique).filter(Boolean);
|
|
655
649
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
650
|
+
const createPictureGetter = (getImage) => {
|
|
651
|
+
return async (params) => {
|
|
652
|
+
const {
|
|
653
|
+
src,
|
|
654
|
+
alt,
|
|
655
|
+
widths,
|
|
656
|
+
fit,
|
|
657
|
+
position,
|
|
658
|
+
background
|
|
659
|
+
} = params;
|
|
660
|
+
if (!src) {
|
|
661
|
+
throw new Error("[@astrojs/image] `src` is required");
|
|
662
|
+
}
|
|
663
|
+
if (!widths || !Array.isArray(widths)) {
|
|
664
|
+
throw new Error("[@astrojs/image] at least one `width` is required. ex: `widths={[100]}`");
|
|
665
|
+
}
|
|
666
|
+
const aspectRatio = await resolveAspectRatio(params);
|
|
667
|
+
if (!aspectRatio) {
|
|
668
|
+
throw new Error("`aspectRatio` must be provided for remote images");
|
|
669
|
+
}
|
|
670
|
+
const allFormats = await resolveFormats(params);
|
|
671
|
+
const lastFormat = allFormats[allFormats.length - 1];
|
|
672
|
+
const maxWidth = Math.max(...widths);
|
|
673
|
+
let image;
|
|
674
|
+
async function getSource(format) {
|
|
675
|
+
const imgs = await Promise.all(
|
|
676
|
+
widths.map(async (width) => {
|
|
677
|
+
const img = await getImage({
|
|
678
|
+
src,
|
|
679
|
+
alt,
|
|
680
|
+
format,
|
|
681
|
+
width,
|
|
682
|
+
height: width / aspectRatio,
|
|
683
|
+
fit,
|
|
684
|
+
position,
|
|
685
|
+
background,
|
|
686
|
+
aspectRatio
|
|
687
|
+
});
|
|
688
|
+
if (format === lastFormat && width === maxWidth) {
|
|
689
|
+
image = img;
|
|
690
|
+
}
|
|
691
|
+
return `${img.src} ${width}w`;
|
|
692
|
+
})
|
|
693
|
+
);
|
|
694
|
+
return {
|
|
695
|
+
type: mime.getType(format) || format,
|
|
696
|
+
srcset: imgs.join(",")
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
const sources = await Promise.all(allFormats.map((format) => getSource(format)));
|
|
700
|
+
return {
|
|
701
|
+
sources,
|
|
702
|
+
// @ts-ignore
|
|
703
|
+
image
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
|
|
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);
|
|
670
724
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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);
|
|
674
742
|
}
|
|
675
|
-
|
|
676
|
-
const lastFormat = allFormats[allFormats.length - 1];
|
|
677
|
-
const maxWidth = Math.max(...widths);
|
|
678
|
-
let image;
|
|
679
|
-
async function getSource(format) {
|
|
680
|
-
const imgs = await Promise.all(
|
|
681
|
-
widths.map(async (width) => {
|
|
682
|
-
const img = await getBuiltImage({
|
|
683
|
-
src,
|
|
684
|
-
alt,
|
|
685
|
-
format,
|
|
686
|
-
width,
|
|
687
|
-
fit,
|
|
688
|
-
position,
|
|
689
|
-
background,
|
|
690
|
-
aspectRatio
|
|
691
|
-
});
|
|
692
|
-
if (format === lastFormat && width === maxWidth) {
|
|
693
|
-
image = img;
|
|
694
|
-
}
|
|
695
|
-
return `${img.src} ${width}w`;
|
|
696
|
-
})
|
|
697
|
-
);
|
|
743
|
+
if (builtImage) {
|
|
698
744
|
return {
|
|
699
|
-
|
|
700
|
-
|
|
745
|
+
src: `/_astro/${builtImage.filename}`,
|
|
746
|
+
width: builtImage.width,
|
|
747
|
+
height: builtImage.height
|
|
701
748
|
};
|
|
702
749
|
}
|
|
703
|
-
|
|
704
|
-
return {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
};
|
|
709
|
-
}
|
|
750
|
+
console.warn(`Could not match built ${format} image for ${src} ${width}px`);
|
|
751
|
+
return { src, width };
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
const getBuiltPicture = createPictureGetter(getBuiltImage);
|
|
710
755
|
|
|
711
756
|
const getAspectRatio = (src, tryImageSize) => {
|
|
712
757
|
if (typeof src === "string") {
|
|
@@ -732,6 +777,7 @@ const useSSRPicture = async (params) => {
|
|
|
732
777
|
hasImg = true,
|
|
733
778
|
tryImageSize,
|
|
734
779
|
getPicture,
|
|
780
|
+
assetsPrefix,
|
|
735
781
|
...attrs
|
|
736
782
|
} = params;
|
|
737
783
|
let aspectRatio;
|
|
@@ -827,6 +873,12 @@ const useSSRPicture = async (params) => {
|
|
|
827
873
|
});
|
|
828
874
|
delete image.width;
|
|
829
875
|
delete image.height;
|
|
876
|
+
if (assetsPrefix && image.src?.charAt(0) === "/") {
|
|
877
|
+
image.src = `${assetsPrefix}${image.src}`;
|
|
878
|
+
sources.forEach((source) => {
|
|
879
|
+
source.srcset = `${assetsPrefix}${source.srcset}`.replace(/,\//g, `,${assetsPrefix}/`);
|
|
880
|
+
});
|
|
881
|
+
}
|
|
830
882
|
const pictureAttrs = {};
|
|
831
883
|
if (!hasImg) {
|
|
832
884
|
pictureAttrs["data-alt"] = alt;
|
|
@@ -849,9 +901,9 @@ const useSSRPicture = async (params) => {
|
|
|
849
901
|
};
|
|
850
902
|
};
|
|
851
903
|
|
|
852
|
-
const $$Astro$
|
|
904
|
+
const $$Astro$d = createAstro("https://demo.ecomplus.app");
|
|
853
905
|
const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
854
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
906
|
+
const Astro2 = $$result.createAstro($$Astro$d, $$props, $$slots);
|
|
855
907
|
Astro2.self = $$Picture;
|
|
856
908
|
const { STOREFRONT_BASE_DIR } = process.env;
|
|
857
909
|
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
@@ -886,49 +938,45 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
886
938
|
} = await useSSRPicture({
|
|
887
939
|
...Astro2.props,
|
|
888
940
|
tryImageSize,
|
|
889
|
-
getPicture: getBuiltPicture
|
|
941
|
+
getPicture: getBuiltPicture,
|
|
942
|
+
assetsPrefix: Astro2.locals.assetsPrefix
|
|
890
943
|
});
|
|
891
|
-
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}
|
|
944
|
+
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}> ${sources.map((attrs) => renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`)} ${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`} </picture>`;
|
|
892
945
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/images/Picture.runtime.astro", void 0);
|
|
893
946
|
|
|
894
|
-
|
|
895
|
-
var __defProp$3 = Object.defineProperty;
|
|
896
|
-
var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
|
|
897
|
-
var _a$3;
|
|
898
|
-
const $$Astro$d = createAstro("https://ecom2-demo.web.app");
|
|
947
|
+
const $$Astro$c = createAstro("https://demo.ecomplus.app");
|
|
899
948
|
const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
|
|
900
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
949
|
+
const Astro2 = $$result.createAstro($$Astro$c, $$props, $$slots);
|
|
901
950
|
Astro2.self = $$BaseBody;
|
|
902
951
|
const { settings } = Astro2.locals.routeContext;
|
|
903
|
-
|
|
904
|
-
return renderTemplate`${maybeRenderHead()}<body style="visibility:hidden" class="!visible"><!-- Prevent FOUC -->${contextInlineClientJS && renderTemplate(_a$3 || (_a$3 = __template$3(["<script>", "<\/script>"])), unescapeHTML(contextInlineClientJS))}<div id="teleported-overlap" class="relative z-[59]"></div><div id="teleported-top" class="relative z-[19]"></div>${renderSlot($$result, $$slots["default"])}${renderSlot($$result, $$slots["before-body-end"])}<div id="teleported-bottom" class="relative z-[19]"></div>${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 })}`}</body>`;
|
|
952
|
+
return renderTemplate`${maybeRenderHead()}<body style="visibility:hidden" class="!visible"> <!-- Prevent FOUC --> <div id="teleported-overlap" class="relative z-[59]"></div> <div id="teleported-top" class="relative z-[19]"></div> ${renderSlot($$result, $$slots["default"])} ${renderSlot($$result, $$slots["before-body-end"])} <div id="teleported-bottom" class="relative z-[19]"></div> ${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 })}`} </body>`;
|
|
905
953
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro", void 0);
|
|
906
954
|
|
|
907
|
-
const $$Astro$
|
|
955
|
+
const $$Astro$b = createAstro("https://demo.ecomplus.app");
|
|
908
956
|
const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
|
|
909
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
957
|
+
const Astro2 = $$result.createAstro($$Astro$b, $$props, $$slots);
|
|
910
958
|
Astro2.self = $$Base$1;
|
|
911
959
|
const { getContent } = Astro2.locals.routeContext;
|
|
912
|
-
const {
|
|
913
|
-
return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate
|
|
960
|
+
const { customCode } = await getContent("layout");
|
|
961
|
+
return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate` ${renderSlot($$result2, $$slots["base-head"])} ${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"])} ${renderSlot($$result2, $$slots["before-head-end"])} ` })} ${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate` ${renderSlot($$result2, $$slots["default"])} ${customCode?.htmlBody && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlBody)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])} ${renderSlot($$result2, $$slots["before-body-end"])} ` })}`;
|
|
914
962
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
|
|
915
963
|
|
|
916
|
-
var __freeze$
|
|
917
|
-
var __defProp$
|
|
918
|
-
var __template$
|
|
919
|
-
var _a$
|
|
920
|
-
const $$Astro$
|
|
964
|
+
var __freeze$3 = Object.freeze;
|
|
965
|
+
var __defProp$3 = Object.defineProperty;
|
|
966
|
+
var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
|
|
967
|
+
var _a$3;
|
|
968
|
+
const $$Astro$a = createAstro("https://demo.ecomplus.app");
|
|
921
969
|
const $$InlineScripts = createComponent(async ($$result, $$props, $$slots) => {
|
|
922
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
970
|
+
const Astro2 = $$result.createAstro($$Astro$a, $$props, $$slots);
|
|
923
971
|
Astro2.self = $$InlineScripts;
|
|
924
|
-
return renderTemplate(_a$
|
|
972
|
+
return renderTemplate(_a$3 || (_a$3 = __template$3(['<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>'])));
|
|
925
973
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/scripts/InlineScripts.astro", void 0);
|
|
926
974
|
|
|
927
|
-
const $$Astro$
|
|
975
|
+
const $$Astro$9 = createAstro("https://demo.ecomplus.app");
|
|
928
976
|
const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
929
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
977
|
+
const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
|
|
930
978
|
Astro2.self = $$Base;
|
|
931
|
-
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate
|
|
979
|
+
return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate` ${renderSlot($$result3, $$slots["base-head"])} ` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate` ${renderSlot($$result2, $$slots["default"])} ` })}`;
|
|
932
980
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
|
|
933
981
|
|
|
934
982
|
const checkObjNotNull = (obj) => {
|
|
@@ -986,9 +1034,7 @@ let userAgent;
|
|
|
986
1034
|
{
|
|
987
1035
|
userAgent = "";
|
|
988
1036
|
}
|
|
989
|
-
|
|
990
|
-
const isIOS = /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream;
|
|
991
|
-
const isMobile = isIOS || /Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
|
1037
|
+
const isMobile = /Android|iPhone|iPad|iPod|webOS/i.test(userAgent);
|
|
992
1038
|
|
|
993
1039
|
const networkNames = [
|
|
994
1040
|
"whatsapp",
|
|
@@ -1015,6 +1061,9 @@ const setSocialNetworks = () => {
|
|
|
1015
1061
|
|
|
1016
1062
|
let id = -1;
|
|
1017
1063
|
const useId = () => String(++id);
|
|
1064
|
+
const slugify = (str) => {
|
|
1065
|
+
return str.toLowerCase().trim().replace(/[ÁáÃãÂâÀà]/g, "a").replace(/[Éé]/g, "e").replace(/[Íí]/g, "i").replace(/[ÓóÔô]/g, "o").replace(/[Úú]/g, "u").replace(/[Çç]/g, "c").replace(/[\W\r\n]/gm, "-").replace(/-{2,}/g, "-").replace(/(^-)|(-$)/g, "");
|
|
1066
|
+
};
|
|
1018
1067
|
|
|
1019
1068
|
const emptyInfo = {
|
|
1020
1069
|
list_payments: {},
|
|
@@ -1066,8 +1115,8 @@ const useCmsPreview = (filename) => {
|
|
|
1066
1115
|
|
|
1067
1116
|
const parseLayoutContent = (layoutContent) => {
|
|
1068
1117
|
const pitchBar = { slides: [] };
|
|
1069
|
-
if (layoutContent.header?.
|
|
1070
|
-
pitchBar.slides = layoutContent.header.
|
|
1118
|
+
if (layoutContent.header?.pitchBar) {
|
|
1119
|
+
pitchBar.slides = layoutContent.header.pitchBar;
|
|
1071
1120
|
}
|
|
1072
1121
|
return pitchBar;
|
|
1073
1122
|
};
|
|
@@ -1091,7 +1140,12 @@ const usePitchBar = (props) => {
|
|
|
1091
1140
|
const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
|
|
1092
1141
|
const { apiState, getContent } = routeContext;
|
|
1093
1142
|
const layoutContent = await getContent("layout");
|
|
1094
|
-
const {
|
|
1143
|
+
const {
|
|
1144
|
+
header: {
|
|
1145
|
+
inlineMenuCategories,
|
|
1146
|
+
isAlphabeticalSortSubmenu
|
|
1147
|
+
}
|
|
1148
|
+
} = layoutContent;
|
|
1095
1149
|
const pitchBar = parseLayoutContent(layoutContent);
|
|
1096
1150
|
let { categories } = apiState;
|
|
1097
1151
|
if (!categories && listedCategoryFields !== null) {
|
|
@@ -1114,9 +1168,9 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
|
|
|
1114
1168
|
}
|
|
1115
1169
|
const shopHeader = {
|
|
1116
1170
|
categories,
|
|
1117
|
-
menuCategorySlugs:
|
|
1118
|
-
menuRandomCategories:
|
|
1119
|
-
isAlphabeticalSortSubmenu
|
|
1171
|
+
menuCategorySlugs: inlineMenuCategories?.featured,
|
|
1172
|
+
menuRandomCategories: inlineMenuCategories?.random,
|
|
1173
|
+
isAlphabeticalSortSubmenu
|
|
1120
1174
|
};
|
|
1121
1175
|
return {
|
|
1122
1176
|
pitchBar,
|
|
@@ -1153,267 +1207,7 @@ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
|
|
|
1153
1207
|
};
|
|
1154
1208
|
};
|
|
1155
1209
|
|
|
1156
|
-
const _sfc_main$
|
|
1157
|
-
__name: "CarouselControl",
|
|
1158
|
-
props: {
|
|
1159
|
-
isPrev: { type: Boolean, default: false }
|
|
1160
|
-
},
|
|
1161
|
-
setup(__props, { expose: __expose }) {
|
|
1162
|
-
__expose();
|
|
1163
|
-
const { changeSlide } = inject(carouselKey);
|
|
1164
|
-
const __returned__ = { changeSlide };
|
|
1165
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1166
|
-
return __returned__;
|
|
1167
|
-
}
|
|
1168
|
-
});
|
|
1169
|
-
function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1170
|
-
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
1171
|
-
type: "button",
|
|
1172
|
-
"aria-label": !$props.isPrev ? "Pr\xF3ximo" : "Anterior",
|
|
1173
|
-
class: ["group absolute top-0 z-1", !$props.isPrev ? "right-0" : "left-0"],
|
|
1174
|
-
"data-carousel-control": !$props.isPrev ? "next" : "previous"
|
|
1175
|
-
}, _attrs))}>`);
|
|
1176
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
1177
|
-
_push(`<i class="${ssrRenderClass([!$props.isPrev ? "i-chevron-right group-active:translate-x-1" : "i-chevron-left group-active:-translate-x-1", "m-0"])}"></i>`);
|
|
1178
|
-
}, _push, _parent);
|
|
1179
|
-
_push(`</button>`);
|
|
1180
|
-
}
|
|
1181
|
-
const _sfc_setup$i = _sfc_main$i.setup;
|
|
1182
|
-
_sfc_main$i.setup = (props, ctx) => {
|
|
1183
|
-
const ssrContext = useSSRContext();
|
|
1184
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
|
|
1185
|
-
return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
|
|
1186
|
-
};
|
|
1187
|
-
const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
|
|
1188
|
-
|
|
1189
|
-
const carouselKey = Symbol("carousel");
|
|
1190
|
-
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1191
|
-
__name: "Carousel",
|
|
1192
|
-
props: {
|
|
1193
|
-
as: { default: "ul" },
|
|
1194
|
-
modelValue: { default: 1 },
|
|
1195
|
-
autoplay: {}
|
|
1196
|
-
},
|
|
1197
|
-
emits: [
|
|
1198
|
-
"update:modelValue"
|
|
1199
|
-
],
|
|
1200
|
-
setup(__props, { expose: __expose, emit }) {
|
|
1201
|
-
__expose();
|
|
1202
|
-
const props = __props;
|
|
1203
|
-
const currentIndex = ref(0);
|
|
1204
|
-
watch(toRef(props, "modelValue"), (modelValue) => {
|
|
1205
|
-
currentIndex.value = modelValue - 1;
|
|
1206
|
-
}, { immediate: true });
|
|
1207
|
-
watch(currentIndex, (current, previous) => {
|
|
1208
|
-
if (current !== previous) {
|
|
1209
|
-
emit("update:modelValue", current + 1);
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
const wrapper = ref(null);
|
|
1213
|
-
const { x: currentPos, isScrolling, arrivedState } = useScroll(wrapper);
|
|
1214
|
-
const isBoundLeft = computed(() => arrivedState.left);
|
|
1215
|
-
const isBoundRight = computed(() => arrivedState.right);
|
|
1216
|
-
const slidesWidth = ref([]);
|
|
1217
|
-
const wrapperScrollWidth = ref(0);
|
|
1218
|
-
const wrapperVisibleWidth = ref(0);
|
|
1219
|
-
const indexCount = ref(0);
|
|
1220
|
-
const calcWrapperWidth = () => {
|
|
1221
|
-
if (!wrapper.value)
|
|
1222
|
-
return;
|
|
1223
|
-
wrapperScrollWidth.value = wrapper.value.scrollWidth;
|
|
1224
|
-
wrapperVisibleWidth.value = wrapper.value.offsetWidth;
|
|
1225
|
-
};
|
|
1226
|
-
const calcSlidesWidth = () => {
|
|
1227
|
-
if (!wrapper.value)
|
|
1228
|
-
return;
|
|
1229
|
-
let childNodes = [...wrapper.value.children];
|
|
1230
|
-
if (childNodes.length === 1 && childNodes[0].tagName.endsWith("SLOT")) {
|
|
1231
|
-
childNodes = [...childNodes[0].children];
|
|
1232
|
-
}
|
|
1233
|
-
slidesWidth.value = childNodes.map((node) => ({
|
|
1234
|
-
offsetLeft: node.offsetLeft,
|
|
1235
|
-
width: node.offsetWidth
|
|
1236
|
-
}));
|
|
1237
|
-
};
|
|
1238
|
-
const calcNextOffsetLeft = (direction) => {
|
|
1239
|
-
let nextSlideIndex = currentIndex.value + direction;
|
|
1240
|
-
if (nextSlideIndex >= slidesWidth.value.length) {
|
|
1241
|
-
return 0;
|
|
1242
|
-
}
|
|
1243
|
-
if (nextSlideIndex < 0) {
|
|
1244
|
-
nextSlideIndex = slidesWidth.value.length + nextSlideIndex;
|
|
1245
|
-
}
|
|
1246
|
-
const { offsetLeft, width } = slidesWidth.value[nextSlideIndex] || {};
|
|
1247
|
-
if (!width) {
|
|
1248
|
-
return 0;
|
|
1249
|
-
}
|
|
1250
|
-
return offsetLeft;
|
|
1251
|
-
};
|
|
1252
|
-
const calcCurrentIndex = () => {
|
|
1253
|
-
const getCurrentIndex = slidesWidth.value.findIndex((slide) => {
|
|
1254
|
-
return Math.abs(slide.offsetLeft - currentPos.value) <= 5;
|
|
1255
|
-
});
|
|
1256
|
-
if (getCurrentIndex > -1) {
|
|
1257
|
-
currentIndex.value = getCurrentIndex || 0;
|
|
1258
|
-
}
|
|
1259
|
-
};
|
|
1260
|
-
const calcIndexCount = () => {
|
|
1261
|
-
const maxPos = wrapperScrollWidth.value - wrapperVisibleWidth.value;
|
|
1262
|
-
indexCount.value = slidesWidth.value.findIndex(({ offsetLeft }) => offsetLeft >= maxPos - 5);
|
|
1263
|
-
};
|
|
1264
|
-
let autoplayTimer;
|
|
1265
|
-
const restartAutoplay = () => {
|
|
1266
|
-
if (props.autoplay) {
|
|
1267
|
-
clearTimeout(autoplayTimer);
|
|
1268
|
-
autoplayTimer = setTimeout(() => {
|
|
1269
|
-
changeSlide(1);
|
|
1270
|
-
}, props.autoplay);
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
const changeSlide = (direction, isPageScroll = true) => {
|
|
1274
|
-
if (slidesWidth.value.length < 2) {
|
|
1275
|
-
return;
|
|
1276
|
-
}
|
|
1277
|
-
if (isPageScroll && (direction === 1 || direction === -1)) {
|
|
1278
|
-
let pageStep = 0;
|
|
1279
|
-
let pageStepWidth = 0;
|
|
1280
|
-
for (let i = currentIndex.value; i < slidesWidth.value.length; i++) {
|
|
1281
|
-
const { width } = slidesWidth.value[i] || {};
|
|
1282
|
-
if (width) {
|
|
1283
|
-
pageStep += 1;
|
|
1284
|
-
pageStepWidth += width;
|
|
1285
|
-
if (pageStepWidth >= wrapperVisibleWidth.value) {
|
|
1286
|
-
break;
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
if (pageStep) {
|
|
1291
|
-
direction = direction > 0 ? pageStep : -pageStep;
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
const nextOffsetLeft = calcNextOffsetLeft(direction);
|
|
1295
|
-
wrapper.value?.scrollTo({ left: nextOffsetLeft, behavior: "smooth" });
|
|
1296
|
-
restartAutoplay();
|
|
1297
|
-
};
|
|
1298
|
-
watch(isScrolling, (_isScrolling) => {
|
|
1299
|
-
if (_isScrolling) {
|
|
1300
|
-
clearTimeout(autoplayTimer);
|
|
1301
|
-
} else {
|
|
1302
|
-
calcCurrentIndex();
|
|
1303
|
-
restartAutoplay();
|
|
1304
|
-
}
|
|
1305
|
-
});
|
|
1306
|
-
const carousel = ref(null);
|
|
1307
|
-
const isHovered = useElementHover(carousel);
|
|
1308
|
-
watch(isHovered, (_isHovered) => {
|
|
1309
|
-
if (_isHovered) {
|
|
1310
|
-
clearTimeout(autoplayTimer);
|
|
1311
|
-
} else {
|
|
1312
|
-
restartAutoplay();
|
|
1313
|
-
}
|
|
1314
|
-
});
|
|
1315
|
-
const calcOnInit = () => {
|
|
1316
|
-
if (!wrapper.value) {
|
|
1317
|
-
return;
|
|
1318
|
-
}
|
|
1319
|
-
calcWrapperWidth();
|
|
1320
|
-
calcSlidesWidth();
|
|
1321
|
-
calcCurrentIndex();
|
|
1322
|
-
calcIndexCount();
|
|
1323
|
-
};
|
|
1324
|
-
const onResize = useDebounceFn(() => {
|
|
1325
|
-
if (!wrapper.value)
|
|
1326
|
-
return;
|
|
1327
|
-
wrapper.value.scrollLeft = 0;
|
|
1328
|
-
calcOnInit();
|
|
1329
|
-
}, 400);
|
|
1330
|
-
onMounted(() => {
|
|
1331
|
-
calcOnInit();
|
|
1332
|
-
});
|
|
1333
|
-
onBeforeUnmount(() => {
|
|
1334
|
-
clearTimeout(autoplayTimer);
|
|
1335
|
-
});
|
|
1336
|
-
provide(carouselKey, {
|
|
1337
|
-
autoplay: toRef(props, "autoplay"),
|
|
1338
|
-
changeSlide,
|
|
1339
|
-
isBoundLeft,
|
|
1340
|
-
isBoundRight
|
|
1341
|
-
});
|
|
1342
|
-
const __returned__ = { carouselKey, props, emit, currentIndex, wrapper, currentPos, isScrolling, arrivedState, isBoundLeft, isBoundRight, slidesWidth, wrapperScrollWidth, wrapperVisibleWidth, indexCount, calcWrapperWidth, calcSlidesWidth, calcNextOffsetLeft, calcCurrentIndex, calcIndexCount, get autoplayTimer() {
|
|
1343
|
-
return autoplayTimer;
|
|
1344
|
-
}, set autoplayTimer(v) {
|
|
1345
|
-
autoplayTimer = v;
|
|
1346
|
-
}, restartAutoplay, changeSlide, carousel, isHovered, calcOnInit, onResize, CarouselControl };
|
|
1347
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1348
|
-
return __returned__;
|
|
1349
|
-
}
|
|
1350
|
-
});
|
|
1351
|
-
function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1352
|
-
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
1353
|
-
ref: "carousel",
|
|
1354
|
-
class: "relative",
|
|
1355
|
-
"data-carousel": ""
|
|
1356
|
-
}, _attrs))}>`);
|
|
1357
|
-
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), {
|
|
1358
|
-
ref: "wrapper",
|
|
1359
|
-
class: "flex overflow-x-scroll overflow-y-hidden list-none m-0 p-0 snap-x snap-mandatory scroll-smooth [&>*]:snap-start [&>*]:outline-none",
|
|
1360
|
-
style: { "scrollbar-width": "none", "-webkit-overflow-scrolling": "touch", "-ms-overflow-style": "none" },
|
|
1361
|
-
"data-carousel-wrapper": ""
|
|
1362
|
-
}, {
|
|
1363
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1364
|
-
if (_push2) {
|
|
1365
|
-
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
1366
|
-
} else {
|
|
1367
|
-
return [
|
|
1368
|
-
renderSlot$1(_ctx.$slots, "default")
|
|
1369
|
-
];
|
|
1370
|
-
}
|
|
1371
|
-
}),
|
|
1372
|
-
_: 3
|
|
1373
|
-
}), _parent);
|
|
1374
|
-
ssrRenderSlot(_ctx.$slots, "controls", {
|
|
1375
|
-
changeSlide: $setup.changeSlide,
|
|
1376
|
-
isBoundLeft: $setup.isBoundLeft,
|
|
1377
|
-
isBoundRight: $setup.isBoundRight,
|
|
1378
|
-
currentPage: $setup.currentIndex + 1,
|
|
1379
|
-
pageCount: $setup.indexCount + 1
|
|
1380
|
-
}, () => {
|
|
1381
|
-
_push(ssrRenderComponent($setup["CarouselControl"], { "is-prev": "" }, {
|
|
1382
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1383
|
-
if (_push2) {
|
|
1384
|
-
ssrRenderSlot(_ctx.$slots, "previous", {}, null, _push2, _parent2, _scopeId);
|
|
1385
|
-
} else {
|
|
1386
|
-
return [
|
|
1387
|
-
renderSlot$1(_ctx.$slots, "previous")
|
|
1388
|
-
];
|
|
1389
|
-
}
|
|
1390
|
-
}),
|
|
1391
|
-
_: 3
|
|
1392
|
-
}, _parent));
|
|
1393
|
-
_push(ssrRenderComponent($setup["CarouselControl"], null, {
|
|
1394
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1395
|
-
if (_push2) {
|
|
1396
|
-
ssrRenderSlot(_ctx.$slots, "next", {}, null, _push2, _parent2, _scopeId);
|
|
1397
|
-
} else {
|
|
1398
|
-
return [
|
|
1399
|
-
renderSlot$1(_ctx.$slots, "next")
|
|
1400
|
-
];
|
|
1401
|
-
}
|
|
1402
|
-
}),
|
|
1403
|
-
_: 3
|
|
1404
|
-
}, _parent));
|
|
1405
|
-
}, _push, _parent);
|
|
1406
|
-
_push(`</div>`);
|
|
1407
|
-
}
|
|
1408
|
-
const _sfc_setup$h = _sfc_main$h.setup;
|
|
1409
|
-
_sfc_main$h.setup = (props, ctx) => {
|
|
1410
|
-
const ssrContext = useSSRContext();
|
|
1411
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
|
|
1412
|
-
return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
|
|
1413
|
-
};
|
|
1414
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
|
|
1415
|
-
|
|
1416
|
-
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1210
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
1417
1211
|
__name: "PitchBar",
|
|
1418
1212
|
props: {
|
|
1419
1213
|
slides: {}
|
|
@@ -1425,34 +1219,36 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1425
1219
|
parsedContents,
|
|
1426
1220
|
countValidSlides
|
|
1427
1221
|
} = usePitchBar(props);
|
|
1428
|
-
const __returned__ = { props, parsedContents, countValidSlides
|
|
1222
|
+
const __returned__ = { props, parsedContents, countValidSlides };
|
|
1429
1223
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1430
1224
|
return __returned__;
|
|
1431
1225
|
}
|
|
1432
1226
|
});
|
|
1433
|
-
function _sfc_ssrRender$
|
|
1227
|
+
function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1228
|
+
const _component_Carousel = resolveComponent("Carousel");
|
|
1434
1229
|
const _component_ALink = resolveComponent("ALink");
|
|
1435
|
-
|
|
1436
|
-
_push(
|
|
1230
|
+
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
1231
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-20" }, _attrs))}><div class="container mx-auto px-3 py-1 md:w-2/3">`);
|
|
1232
|
+
_push(ssrRenderComponent(_component_Carousel, {
|
|
1437
1233
|
autoplay: $setup.countValidSlides > 1 ? 7e3 : void 0
|
|
1438
1234
|
}, {
|
|
1439
1235
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1440
1236
|
if (_push2) {
|
|
1441
|
-
_push2(`<div style="${ssrRenderStyle($setup.countValidSlides > 1 ? null : { display: "none" })}" class="text-xl leading-none
|
|
1442
|
-
_push2(ssrRenderComponent(
|
|
1443
|
-
class: "
|
|
1237
|
+
_push2(`<div style="${ssrRenderStyle($setup.countValidSlides > 1 ? null : { display: "none" })}" class="text-base-400 text-xl leading-none"${_scopeId}>`);
|
|
1238
|
+
_push2(ssrRenderComponent(_component_CarouselControl, {
|
|
1239
|
+
class: "bg-base-100 hover:text-base-700 pr-2",
|
|
1444
1240
|
"is-prev": ""
|
|
1445
1241
|
}, null, _parent2, _scopeId));
|
|
1446
|
-
_push2(ssrRenderComponent(
|
|
1242
|
+
_push2(ssrRenderComponent(_component_CarouselControl, { class: "bg-base-100 hover:text-base-700 pl-2" }, null, _parent2, _scopeId));
|
|
1447
1243
|
_push2(`</div>`);
|
|
1448
1244
|
} else {
|
|
1449
1245
|
return [
|
|
1450
|
-
withDirectives(createVNode("div", { class: "text-xl leading-none
|
|
1451
|
-
createVNode(
|
|
1452
|
-
class: "
|
|
1246
|
+
withDirectives(createVNode("div", { class: "text-base-400 text-xl leading-none" }, [
|
|
1247
|
+
createVNode(_component_CarouselControl, {
|
|
1248
|
+
class: "bg-base-100 hover:text-base-700 pr-2",
|
|
1453
1249
|
"is-prev": ""
|
|
1454
1250
|
}),
|
|
1455
|
-
createVNode(
|
|
1251
|
+
createVNode(_component_CarouselControl, { class: "bg-base-100 hover:text-base-700 pl-2" })
|
|
1456
1252
|
], 512), [
|
|
1457
1253
|
[vShow, $setup.countValidSlides > 1]
|
|
1458
1254
|
])
|
|
@@ -1463,7 +1259,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1463
1259
|
if (_push2) {
|
|
1464
1260
|
_push2(`<!--[-->`);
|
|
1465
1261
|
ssrRenderList($props.slides, (slide, i) => {
|
|
1466
|
-
_push2(`<li class="shrink-0 basis-full
|
|
1262
|
+
_push2(`<li class="h-full shrink-0 basis-full text-center"${_scopeId}>`);
|
|
1467
1263
|
_push2(ssrRenderComponent(_component_ALink, {
|
|
1468
1264
|
href: slide.href,
|
|
1469
1265
|
target: slide.target,
|
|
@@ -1472,7 +1268,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1472
1268
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
1473
1269
|
if (_push3) {
|
|
1474
1270
|
if ($setup.parsedContents[i]) {
|
|
1475
|
-
_push3(`<span class="prose text-
|
|
1271
|
+
_push3(`<span class="prose text-base-800 text-sm"${_scopeId2}>${$setup.parsedContents[i]}</span>`);
|
|
1476
1272
|
} else {
|
|
1477
1273
|
_push3(`<!---->`);
|
|
1478
1274
|
}
|
|
@@ -1481,7 +1277,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1481
1277
|
$setup.parsedContents[i] ? (openBlock(), createBlock("span", {
|
|
1482
1278
|
key: 0,
|
|
1483
1279
|
innerHTML: $setup.parsedContents[i],
|
|
1484
|
-
class: "prose text-
|
|
1280
|
+
class: "prose text-base-800 text-sm"
|
|
1485
1281
|
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1486
1282
|
];
|
|
1487
1283
|
}
|
|
@@ -1496,7 +1292,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1496
1292
|
(openBlock(true), createBlock(Fragment$1, null, renderList($props.slides, (slide, i) => {
|
|
1497
1293
|
return openBlock(), createBlock("li", {
|
|
1498
1294
|
key: i,
|
|
1499
|
-
class: "shrink-0 basis-full
|
|
1295
|
+
class: "h-full shrink-0 basis-full text-center"
|
|
1500
1296
|
}, [
|
|
1501
1297
|
createVNode(_component_ALink, {
|
|
1502
1298
|
href: slide.href,
|
|
@@ -1507,7 +1303,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1507
1303
|
$setup.parsedContents[i] ? (openBlock(), createBlock("span", {
|
|
1508
1304
|
key: 0,
|
|
1509
1305
|
innerHTML: $setup.parsedContents[i],
|
|
1510
|
-
class: "prose text-
|
|
1306
|
+
class: "prose text-base-800 text-sm"
|
|
1511
1307
|
}, null, 8, ["innerHTML"])) : createCommentVNode("", true)
|
|
1512
1308
|
]),
|
|
1513
1309
|
_: 2
|
|
@@ -1521,13 +1317,13 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1521
1317
|
}, _parent));
|
|
1522
1318
|
_push(`</div></div>`);
|
|
1523
1319
|
}
|
|
1524
|
-
const _sfc_setup$
|
|
1525
|
-
_sfc_main$
|
|
1320
|
+
const _sfc_setup$r = _sfc_main$r.setup;
|
|
1321
|
+
_sfc_main$r.setup = (props, ctx) => {
|
|
1526
1322
|
const ssrContext = useSSRContext();
|
|
1527
1323
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
|
|
1528
|
-
return _sfc_setup$
|
|
1324
|
+
return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
|
|
1529
1325
|
};
|
|
1530
|
-
const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1326
|
+
const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
|
|
1531
1327
|
|
|
1532
1328
|
const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
|
|
1533
1329
|
if (!storage) {
|
|
@@ -1692,6 +1488,33 @@ const removeCartItem = (itemId) => {
|
|
|
1692
1488
|
}
|
|
1693
1489
|
};
|
|
1694
1490
|
const addProductToCart = (product, variationId, quantity) => addCartItem(parseProduct(product, variationId, quantity));
|
|
1491
|
+
const cartEmitter = mitt();
|
|
1492
|
+
const cloneItems = () => shoppingCart.value.items.map((item) => ({ ...item }));
|
|
1493
|
+
let oldItems = cloneItems();
|
|
1494
|
+
watchDebounced(shoppingCart, ({ items }) => {
|
|
1495
|
+
["addCartItem", "removeCartItem"].forEach((evName) => {
|
|
1496
|
+
const isAdd = evName === "addCartItem";
|
|
1497
|
+
const baseItems = isAdd ? items : oldItems;
|
|
1498
|
+
const compareItems = isAdd ? oldItems : items;
|
|
1499
|
+
baseItems.forEach((baseItem) => {
|
|
1500
|
+
if (!baseItem.quantity)
|
|
1501
|
+
return;
|
|
1502
|
+
const compareItem = compareItems.find(({ _id }) => _id === baseItem._id);
|
|
1503
|
+
const compareQnt = compareItem?.quantity || 0;
|
|
1504
|
+
if (baseItem.quantity > compareQnt) {
|
|
1505
|
+
cartEmitter.emit(evName, {
|
|
1506
|
+
...baseItem,
|
|
1507
|
+
quantity: baseItem.quantity - compareQnt
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
});
|
|
1512
|
+
oldItems = cloneItems();
|
|
1513
|
+
}, { debounce: 200 });
|
|
1514
|
+
({
|
|
1515
|
+
on: cartEmitter.on,
|
|
1516
|
+
off: cartEmitter.off
|
|
1517
|
+
});
|
|
1695
1518
|
|
|
1696
1519
|
const useStickyHeader = (props) => {
|
|
1697
1520
|
const {
|
|
@@ -1705,7 +1528,10 @@ const useStickyHeader = (props) => {
|
|
|
1705
1528
|
canCreateHeightDiv: true,
|
|
1706
1529
|
...props
|
|
1707
1530
|
};
|
|
1708
|
-
const { ready, start } = useTimeout(100, {
|
|
1531
|
+
const { ready, start } = useTimeout(100, {
|
|
1532
|
+
controls: true,
|
|
1533
|
+
immediate: false
|
|
1534
|
+
});
|
|
1709
1535
|
const staticHeight = ref(0);
|
|
1710
1536
|
const staticY = ref(0);
|
|
1711
1537
|
const { y: _y } = { y: ref(0) };
|
|
@@ -1837,7 +1663,7 @@ const useShopHeader = (props) => {
|
|
|
1837
1663
|
};
|
|
1838
1664
|
};
|
|
1839
1665
|
|
|
1840
|
-
const _sfc_main$
|
|
1666
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
1841
1667
|
__name: "Drawer",
|
|
1842
1668
|
props: {
|
|
1843
1669
|
modelValue: { type: Boolean, default: false },
|
|
@@ -1846,12 +1672,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1846
1672
|
hasCloseButton: { type: Boolean, default: true },
|
|
1847
1673
|
backdropTarget: { default: "#teleported-top" }
|
|
1848
1674
|
},
|
|
1849
|
-
emits: [
|
|
1850
|
-
|
|
1851
|
-
],
|
|
1852
|
-
setup(__props, { expose: __expose, emit }) {
|
|
1675
|
+
emits: ["update:modelValue"],
|
|
1676
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1853
1677
|
__expose();
|
|
1854
1678
|
const props = __props;
|
|
1679
|
+
const emit = __emit;
|
|
1855
1680
|
const close = () => emit("update:modelValue", false);
|
|
1856
1681
|
const drawer = ref(null);
|
|
1857
1682
|
const outsideClickListener = (ev) => {
|
|
@@ -1904,7 +1729,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1904
1729
|
return __returned__;
|
|
1905
1730
|
}
|
|
1906
1731
|
});
|
|
1907
|
-
function _sfc_ssrRender$
|
|
1732
|
+
function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
1908
1733
|
const _component_Fade = resolveComponent("Fade");
|
|
1909
1734
|
_push(ssrRenderComponent(_component_Fade, mergeProps({
|
|
1910
1735
|
slide: $setup.slideTo,
|
|
@@ -1920,7 +1745,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1920
1745
|
$setup.isFixed && $props.placement !== "end" ? "left-0" : null,
|
|
1921
1746
|
$setup.isFixed && $props.placement === "end" ? "left-auto right-0" : null,
|
|
1922
1747
|
$setup.isPlacementX ? "max-w-sm" : null
|
|
1923
|
-
], "w-screen
|
|
1748
|
+
], "z-50 m-0 w-screen p-0 shadow"])}" style="${ssrRenderStyle({
|
|
1924
1749
|
maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
|
|
1925
1750
|
})}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
|
|
1926
1751
|
if ($props.hasCloseButton) {
|
|
@@ -1939,7 +1764,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1939
1764
|
default: withCtx((_2, _push4, _parent3, _scopeId2) => {
|
|
1940
1765
|
if (_push4) {
|
|
1941
1766
|
if ($props.modelValue) {
|
|
1942
|
-
_push4(`<div class="fixed
|
|
1767
|
+
_push4(`<div class="fixed left-0 top-0 z-40 h-screen w-screen bg-black/50" data-drawer-backdrop${_scopeId2}></div>`);
|
|
1943
1768
|
} else {
|
|
1944
1769
|
_push4(`<!---->`);
|
|
1945
1770
|
}
|
|
@@ -1947,7 +1772,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1947
1772
|
return [
|
|
1948
1773
|
$props.modelValue ? (openBlock(), createBlock("div", {
|
|
1949
1774
|
key: 0,
|
|
1950
|
-
class: "fixed
|
|
1775
|
+
class: "fixed left-0 top-0 z-40 h-screen w-screen bg-black/50",
|
|
1951
1776
|
"data-drawer-backdrop": ""
|
|
1952
1777
|
})) : createCommentVNode("", true)
|
|
1953
1778
|
];
|
|
@@ -1965,7 +1790,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1965
1790
|
$props.modelValue ? (openBlock(), createBlock("dialog", {
|
|
1966
1791
|
key: 0,
|
|
1967
1792
|
ref: "drawer",
|
|
1968
|
-
class: ["w-screen
|
|
1793
|
+
class: ["z-50 m-0 w-screen p-0 shadow", [
|
|
1969
1794
|
$props.position,
|
|
1970
1795
|
$setup.isFixed ? `top-0 ${$setup.isPlacementX ? "h-screen" : "max-h-screen"}` : null,
|
|
1971
1796
|
$setup.isFixed && $props.placement !== "end" ? "left-0" : null,
|
|
@@ -1998,7 +1823,7 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
1998
1823
|
default: withCtx(() => [
|
|
1999
1824
|
$props.modelValue ? (openBlock(), createBlock("div", {
|
|
2000
1825
|
key: 0,
|
|
2001
|
-
class: "fixed
|
|
1826
|
+
class: "fixed left-0 top-0 z-40 h-screen w-screen bg-black/50",
|
|
2002
1827
|
"data-drawer-backdrop": ""
|
|
2003
1828
|
})) : createCommentVNode("", true)
|
|
2004
1829
|
]),
|
|
@@ -2012,13 +1837,13 @@ function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2012
1837
|
_: 3
|
|
2013
1838
|
}, _parent));
|
|
2014
1839
|
}
|
|
2015
|
-
const _sfc_setup$
|
|
2016
|
-
_sfc_main$
|
|
1840
|
+
const _sfc_setup$q = _sfc_main$q.setup;
|
|
1841
|
+
_sfc_main$q.setup = (props, ctx) => {
|
|
2017
1842
|
const ssrContext = useSSRContext();
|
|
2018
1843
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
|
|
2019
|
-
return _sfc_setup$
|
|
1844
|
+
return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
|
|
2020
1845
|
};
|
|
2021
|
-
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1846
|
+
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
|
|
2022
1847
|
|
|
2023
1848
|
const storageKey = "ecomSession";
|
|
2024
1849
|
const emptySession = {
|
|
@@ -2053,15 +1878,15 @@ const logout = () => {
|
|
|
2053
1878
|
localStorage.removeItem(storageKey);
|
|
2054
1879
|
firebaseAuth.signOut();
|
|
2055
1880
|
};
|
|
2056
|
-
const initializeFirebaseAuth = (canWaitIdle
|
|
1881
|
+
const initializeFirebaseAuth = (canWaitIdle) => {
|
|
2057
1882
|
return;
|
|
2058
1883
|
};
|
|
2059
1884
|
|
|
2060
|
-
const _sfc_main$
|
|
1885
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
2061
1886
|
__name: "AccountLink",
|
|
2062
1887
|
props: {
|
|
2063
1888
|
to: {},
|
|
2064
|
-
accountUrl: { default: globalThis.$storefront
|
|
1889
|
+
accountUrl: { default: globalThis.$storefront?.settings.accountUrl || "/app/account" },
|
|
2065
1890
|
returnUrl: { default: globalThis.location?.href },
|
|
2066
1891
|
isSignUp: { type: Boolean }
|
|
2067
1892
|
},
|
|
@@ -2076,14 +1901,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2076
1901
|
} else {
|
|
2077
1902
|
url += "?";
|
|
2078
1903
|
}
|
|
2079
|
-
return `${url}return_url=${props.returnUrl}
|
|
1904
|
+
return props.returnUrl ? `${url}return_url=${props.returnUrl}` : url;
|
|
2080
1905
|
}
|
|
2081
1906
|
const { settings } = globalThis.$storefront;
|
|
2082
|
-
if (props.to === "orders" && settings.
|
|
2083
|
-
return settings.
|
|
1907
|
+
if (props.to === "orders" && settings.ordersUrl) {
|
|
1908
|
+
return settings.ordersUrl;
|
|
2084
1909
|
}
|
|
2085
|
-
if (props.to === "favorites" && settings.
|
|
2086
|
-
return settings.
|
|
1910
|
+
if (props.to === "favorites" && settings.favoritesUrl) {
|
|
1911
|
+
return settings.favoritesUrl;
|
|
2087
1912
|
}
|
|
2088
1913
|
return `${url}/${props.to}`;
|
|
2089
1914
|
});
|
|
@@ -2092,20 +1917,20 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2092
1917
|
return __returned__;
|
|
2093
1918
|
}
|
|
2094
1919
|
});
|
|
2095
|
-
function _sfc_ssrRender$
|
|
1920
|
+
function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2096
1921
|
_push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
|
|
2097
1922
|
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
2098
1923
|
_push(`</a>`);
|
|
2099
1924
|
}
|
|
2100
|
-
const _sfc_setup$
|
|
2101
|
-
_sfc_main$
|
|
1925
|
+
const _sfc_setup$p = _sfc_main$p.setup;
|
|
1926
|
+
_sfc_main$p.setup = (props, ctx) => {
|
|
2102
1927
|
const ssrContext = useSSRContext();
|
|
2103
1928
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
|
|
2104
|
-
return _sfc_setup$
|
|
1929
|
+
return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
|
|
2105
1930
|
};
|
|
2106
|
-
const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1931
|
+
const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
|
|
2107
1932
|
|
|
2108
|
-
const _sfc_main$
|
|
1933
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2109
1934
|
__name: "SocialNetworkIcon",
|
|
2110
1935
|
props: {
|
|
2111
1936
|
as: { default: "i" },
|
|
@@ -2141,18 +1966,18 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2141
1966
|
return __returned__;
|
|
2142
1967
|
}
|
|
2143
1968
|
});
|
|
2144
|
-
function _sfc_ssrRender$
|
|
1969
|
+
function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2145
1970
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
|
|
2146
1971
|
}
|
|
2147
|
-
const _sfc_setup$
|
|
2148
|
-
_sfc_main$
|
|
1972
|
+
const _sfc_setup$o = _sfc_main$o.setup;
|
|
1973
|
+
_sfc_main$o.setup = (props, ctx) => {
|
|
2149
1974
|
const ssrContext = useSSRContext();
|
|
2150
1975
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
|
|
2151
|
-
return _sfc_setup$
|
|
1976
|
+
return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
|
|
2152
1977
|
};
|
|
2153
|
-
const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1978
|
+
const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
|
|
2154
1979
|
|
|
2155
|
-
const _sfc_main$
|
|
1980
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2156
1981
|
__name: "SocialNetworkLink",
|
|
2157
1982
|
props: {
|
|
2158
1983
|
network: {},
|
|
@@ -2178,7 +2003,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2178
2003
|
return __returned__;
|
|
2179
2004
|
}
|
|
2180
2005
|
});
|
|
2181
|
-
function _sfc_ssrRender$
|
|
2006
|
+
function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2182
2007
|
const _component_ALink = resolveComponent("ALink");
|
|
2183
2008
|
_push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
|
|
2184
2009
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
@@ -2199,15 +2024,15 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2199
2024
|
_: 3
|
|
2200
2025
|
}, _parent));
|
|
2201
2026
|
}
|
|
2202
|
-
const _sfc_setup$
|
|
2203
|
-
_sfc_main$
|
|
2027
|
+
const _sfc_setup$n = _sfc_main$n.setup;
|
|
2028
|
+
_sfc_main$n.setup = (props, ctx) => {
|
|
2204
2029
|
const ssrContext = useSSRContext();
|
|
2205
2030
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
|
|
2206
|
-
return _sfc_setup$
|
|
2031
|
+
return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
|
|
2207
2032
|
};
|
|
2208
|
-
const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2033
|
+
const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
|
|
2209
2034
|
|
|
2210
|
-
const _sfc_main$
|
|
2035
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
2211
2036
|
__name: "ShopSidenavCategory",
|
|
2212
2037
|
props: {
|
|
2213
2038
|
categoryTree: {}
|
|
@@ -2230,17 +2055,17 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2230
2055
|
return __returned__;
|
|
2231
2056
|
}
|
|
2232
2057
|
});
|
|
2233
|
-
function _sfc_ssrRender$
|
|
2058
|
+
function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2234
2059
|
const _component_AImg = resolveComponent("AImg");
|
|
2235
2060
|
const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
|
|
2236
|
-
_push(`<li${ssrRenderAttrs(mergeProps({ class: "text-
|
|
2061
|
+
_push(`<li${ssrRenderAttrs(mergeProps({ class: "text-base-800 text-lg" }, _attrs))}>`);
|
|
2237
2062
|
if ($props.categoryTree.subcategories.length) {
|
|
2238
|
-
_push(`<details class="
|
|
2063
|
+
_push(`<details class="z-10 overflow-y-auto overflow-x-hidden bg-white open:absolute open:left-0 open:top-0 open:h-full open:w-full"><summary class="${ssrRenderClass([$setup.isOpen ? "bg-base-100" : null, "active:bg-base-100 cursor-pointer list-none px-6 py-3 transition-colors"])}"><i class="${ssrRenderClass(!$setup.isOpen ? "i-arrow-right float-right mb-0 mt-1 text-xl text-base-500" : "i-arrow-right rotate-180 text-lg")}"></i>`);
|
|
2239
2064
|
if (!$setup.isOpen && $props.categoryTree.icon) {
|
|
2240
2065
|
_push(ssrRenderComponent(_component_AImg, {
|
|
2241
2066
|
picture: $props.categoryTree.icon,
|
|
2242
2067
|
alt: $props.categoryTree.name,
|
|
2243
|
-
class: "
|
|
2068
|
+
class: "mr-3 inline h-5 w-auto"
|
|
2244
2069
|
}, null, _parent));
|
|
2245
2070
|
} else {
|
|
2246
2071
|
_push(`<!---->`);
|
|
@@ -2252,14 +2077,14 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2252
2077
|
"category-tree": subcategoryTree
|
|
2253
2078
|
}, null, _parent));
|
|
2254
2079
|
});
|
|
2255
|
-
_push(`<!--]--><li><a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="block px-6 py-3 text-base underline
|
|
2080
|
+
_push(`<!--]--><li><a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="active:bg-base-200 block px-6 py-3 text-base underline">${ssrInterpolate("Ver toda a categoria $1".replace("$1", $props.categoryTree.name))}</a></li></ul></details>`);
|
|
2256
2081
|
} else {
|
|
2257
|
-
_push(`<a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="block px-6 py-3
|
|
2082
|
+
_push(`<a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="active:bg-base-200 block px-6 py-3">`);
|
|
2258
2083
|
if (!$setup.isOpen && $props.categoryTree.icon) {
|
|
2259
2084
|
_push(ssrRenderComponent(_component_AImg, {
|
|
2260
2085
|
picture: $props.categoryTree.icon,
|
|
2261
2086
|
alt: $props.categoryTree.name,
|
|
2262
|
-
class: "
|
|
2087
|
+
class: "mr-3 inline h-5 w-auto"
|
|
2263
2088
|
}, null, _parent));
|
|
2264
2089
|
} else {
|
|
2265
2090
|
_push(`<!---->`);
|
|
@@ -2268,15 +2093,15 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2268
2093
|
}
|
|
2269
2094
|
_push(`</li>`);
|
|
2270
2095
|
}
|
|
2271
|
-
const _sfc_setup$
|
|
2272
|
-
_sfc_main$
|
|
2096
|
+
const _sfc_setup$m = _sfc_main$m.setup;
|
|
2097
|
+
_sfc_main$m.setup = (props, ctx) => {
|
|
2273
2098
|
const ssrContext = useSSRContext();
|
|
2274
2099
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
|
|
2275
|
-
return _sfc_setup$
|
|
2100
|
+
return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
|
|
2276
2101
|
};
|
|
2277
|
-
const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2102
|
+
const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
|
|
2278
2103
|
|
|
2279
|
-
const _sfc_main$
|
|
2104
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2280
2105
|
__name: "ShopSidenav",
|
|
2281
2106
|
props: {
|
|
2282
2107
|
categoryTrees: {}
|
|
@@ -2297,25 +2122,25 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2297
2122
|
return __returned__;
|
|
2298
2123
|
}
|
|
2299
2124
|
});
|
|
2300
|
-
function _sfc_ssrRender$
|
|
2301
|
-
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col
|
|
2125
|
+
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"><!--[-->`);
|
|
2302
2127
|
ssrRenderList($props.categoryTrees, (categoryTree, i) => {
|
|
2303
2128
|
_push(ssrRenderComponent($setup["ShopSidenavCategory"], {
|
|
2304
2129
|
key: i,
|
|
2305
2130
|
"category-tree": categoryTree
|
|
2306
2131
|
}, null, _parent));
|
|
2307
2132
|
});
|
|
2308
|
-
_push(`<!--]--></ul></nav><footer class="text-base"><div class="flex items-center px-2 py-4
|
|
2309
|
-
_push(ssrRenderComponent($setup["AccountLink"], { class: "
|
|
2133
|
+
_push(`<!--]--></ul></nav><footer class="text-base"><div class="bg-base-100 flex items-center px-2 py-4">`);
|
|
2134
|
+
_push(ssrRenderComponent($setup["AccountLink"], { class: "flex grow items-center gap-3 p-2" }, {
|
|
2310
2135
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
2311
2136
|
if (_push2) {
|
|
2312
|
-
_push2(`<i class="i-user-circle text-
|
|
2137
|
+
_push2(`<i class="i-user-circle text-base-500 m-0 text-4xl"${_scopeId}></i><span class="leading-tight"${_scopeId}>${ssrInterpolate(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`)} <small class="text-primary block font-semibold lowercase"${_scopeId}>${ssrInterpolate("Meus pedidos")}, ${ssrInterpolate("Minha conta")}</small></span>`);
|
|
2313
2138
|
} else {
|
|
2314
2139
|
return [
|
|
2315
|
-
createVNode("i", { class: "i-user-circle text-
|
|
2140
|
+
createVNode("i", { class: "i-user-circle text-base-500 m-0 text-4xl" }),
|
|
2316
2141
|
createVNode("span", { class: "leading-tight" }, [
|
|
2317
2142
|
createTextVNode(toDisplayString(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`) + " ", 1),
|
|
2318
|
-
createVNode("small", { class: "block
|
|
2143
|
+
createVNode("small", { class: "text-primary block font-semibold lowercase" }, toDisplayString("Meus pedidos") + ", " + toDisplayString("Minha conta"))
|
|
2319
2144
|
])
|
|
2320
2145
|
];
|
|
2321
2146
|
}
|
|
@@ -2323,28 +2148,28 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2323
2148
|
_: 1
|
|
2324
2149
|
}, _parent));
|
|
2325
2150
|
if ($setup.isLogged) {
|
|
2326
|
-
_push(`<button class="p-2 text-right
|
|
2151
|
+
_push(`<button class="text-base-800 p-2 text-right"><span class="text-base-600">${ssrInterpolate("Sair")}</span><i class="i-arrow-right-on-rectangle ml-1 text-lg"></i></button>`);
|
|
2327
2152
|
} else {
|
|
2328
2153
|
_push(`<!---->`);
|
|
2329
2154
|
}
|
|
2330
|
-
_push(`</div><ul class="flex gap-3 p-4
|
|
2155
|
+
_push(`</div><ul class="bg-base-200 text-base-700 flex gap-3 p-4 text-xl"><!--[-->`);
|
|
2331
2156
|
ssrRenderList($setup.socialNetworks, (href, network) => {
|
|
2332
2157
|
_push(`<li>`);
|
|
2333
2158
|
_push(ssrRenderComponent($setup["SocialNetworkLink"], {
|
|
2334
2159
|
network,
|
|
2335
|
-
class: "
|
|
2160
|
+
class: "active:text-primary p-1"
|
|
2336
2161
|
}, null, _parent));
|
|
2337
2162
|
_push(`</li>`);
|
|
2338
2163
|
});
|
|
2339
2164
|
_push(`<!--]--></ul></footer></aside>`);
|
|
2340
2165
|
}
|
|
2341
|
-
const _sfc_setup$
|
|
2342
|
-
_sfc_main$
|
|
2166
|
+
const _sfc_setup$l = _sfc_main$l.setup;
|
|
2167
|
+
_sfc_main$l.setup = (props, ctx) => {
|
|
2343
2168
|
const ssrContext = useSSRContext();
|
|
2344
2169
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
|
|
2345
|
-
return _sfc_setup$
|
|
2170
|
+
return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
|
|
2346
2171
|
};
|
|
2347
|
-
const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2172
|
+
const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
|
|
2348
2173
|
|
|
2349
2174
|
const useShopHeaderSubmenu = (props) => {
|
|
2350
2175
|
const categoryPicture = computed(() => {
|
|
@@ -2393,7 +2218,7 @@ const useShopHeaderSubmenu = (props) => {
|
|
|
2393
2218
|
};
|
|
2394
2219
|
};
|
|
2395
2220
|
|
|
2396
|
-
const _sfc_main$
|
|
2221
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2397
2222
|
__name: "ShopHeaderSubmenu",
|
|
2398
2223
|
props: {
|
|
2399
2224
|
categoryTree: {},
|
|
@@ -2422,12 +2247,13 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2422
2247
|
return __returned__;
|
|
2423
2248
|
}
|
|
2424
2249
|
});
|
|
2425
|
-
function _sfc_ssrRender$
|
|
2250
|
+
function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2426
2251
|
const _component_Fade = resolveComponent("Fade");
|
|
2427
2252
|
const _component_AImg = resolveComponent("AImg");
|
|
2428
2253
|
_push(ssrRenderComponent($setup["Popover"], _attrs, {
|
|
2429
2254
|
default: withCtx(({ open }, _push2, _parent2, _scopeId) => {
|
|
2430
2255
|
if (_push2) {
|
|
2256
|
+
_push2(`<a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} role="button"${_scopeId}>`);
|
|
2431
2257
|
_push2(ssrRenderComponent($setup["PopoverButton"], { class: "outline-none" }, {
|
|
2432
2258
|
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2433
2259
|
if (_push3) {
|
|
@@ -2440,16 +2266,16 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2440
2266
|
}),
|
|
2441
2267
|
_: 2
|
|
2442
2268
|
}, _parent2, _scopeId));
|
|
2443
|
-
_push2(
|
|
2269
|
+
_push2(`</a><div class="relative"${_scopeId}>`);
|
|
2444
2270
|
_push2(ssrRenderComponent(_component_Fade, null, {
|
|
2445
2271
|
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2446
2272
|
if (_push3) {
|
|
2447
2273
|
_push3(ssrRenderComponent($setup["PopoverPanel"], {
|
|
2448
|
-
class: ["absolute
|
|
2274
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-20 -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"]
|
|
2449
2275
|
}, {
|
|
2450
2276
|
default: withCtx(({ close }, _push4, _parent4, _scopeId3) => {
|
|
2451
2277
|
if (_push4) {
|
|
2452
|
-
_push4(`<div class="flex gap-6
|
|
2278
|
+
_push4(`<div class="flex w-full gap-6"${_scopeId3}>`);
|
|
2453
2279
|
if ($setup.subcategoryLinks.length) {
|
|
2454
2280
|
_push4(`<ul class="flex-1"${_scopeId3}><!--[-->`);
|
|
2455
2281
|
ssrRenderList($setup.subcategoryLinks, (subcategory, i) => {
|
|
@@ -2461,7 +2287,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2461
2287
|
}
|
|
2462
2288
|
_push4(`<!--[-->`);
|
|
2463
2289
|
ssrRenderList($setup.subcategoryCols, (subcategory, i) => {
|
|
2464
|
-
_push4(`<div class="flex-1"${_scopeId3}><a${ssrRenderAttr("href", `/${subcategory.slug}`)} class="hover:text-primary"${_scopeId3}><h3${_scopeId3}>${ssrInterpolate(subcategory.name)}</h3></a><ul class="text-
|
|
2290
|
+
_push4(`<div class="flex-1"${_scopeId3}><a${ssrRenderAttr("href", `/${subcategory.slug}`)} class="hover:text-primary"${_scopeId3}><h3${_scopeId3}>${ssrInterpolate(subcategory.name)}</h3></a><ul class="text-base-600 mb-1.5 mt-1 text-sm"${_scopeId3}><!--[-->`);
|
|
2465
2291
|
ssrRenderList(subcategory.subcategories, (nestedSubcategory, ii) => {
|
|
2466
2292
|
_push4(`<li class="mb-0.5"${_scopeId3}><a${ssrRenderAttr("href", `/${nestedSubcategory.slug}`)} class="hover:text-primary hover:underline"${_scopeId3}><h3${_scopeId3}>${ssrInterpolate(nestedSubcategory.name)}</h3></a></li>`);
|
|
2467
2293
|
});
|
|
@@ -2478,10 +2304,10 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2478
2304
|
} else {
|
|
2479
2305
|
_push4(`<!---->`);
|
|
2480
2306
|
}
|
|
2481
|
-
_push4(`</div><a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="
|
|
2307
|
+
_push4(`</div><a${ssrRenderAttr("href", `/${$props.categoryTree.slug}`)} class="text-base-600 mt-1 block text-xs leading-snug underline"${_scopeId3}>${ssrInterpolate("Ver toda a categoria $1".replace("$1", $props.categoryTree.name))}</a><button class="hidden"${_scopeId3}></button>`);
|
|
2482
2308
|
} else {
|
|
2483
2309
|
return [
|
|
2484
|
-
createVNode("div", { class: "flex gap-6
|
|
2310
|
+
createVNode("div", { class: "flex w-full gap-6" }, [
|
|
2485
2311
|
$setup.subcategoryLinks.length ? (openBlock(), createBlock("ul", {
|
|
2486
2312
|
key: 0,
|
|
2487
2313
|
class: "flex-1"
|
|
@@ -2511,7 +2337,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2511
2337
|
}, [
|
|
2512
2338
|
createVNode("h3", null, toDisplayString(subcategory.name), 1)
|
|
2513
2339
|
], 8, ["href"]),
|
|
2514
|
-
createVNode("ul", { class: "text-
|
|
2340
|
+
createVNode("ul", { class: "text-base-600 mb-1.5 mt-1 text-sm" }, [
|
|
2515
2341
|
(openBlock(true), createBlock(Fragment$1, null, renderList(subcategory.subcategories, (nestedSubcategory, ii) => {
|
|
2516
2342
|
return openBlock(), createBlock("li", {
|
|
2517
2343
|
key: `${i}-${ii}`,
|
|
@@ -2540,7 +2366,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2540
2366
|
]),
|
|
2541
2367
|
createVNode("a", {
|
|
2542
2368
|
href: `/${$props.categoryTree.slug}`,
|
|
2543
|
-
class: "
|
|
2369
|
+
class: "text-base-600 mt-1 block text-xs leading-snug underline"
|
|
2544
2370
|
}, toDisplayString("Ver toda a categoria $1".replace("$1", $props.categoryTree.name)), 9, ["href"]),
|
|
2545
2371
|
createVNode("button", {
|
|
2546
2372
|
ref: "close",
|
|
@@ -2555,10 +2381,10 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2555
2381
|
} else {
|
|
2556
2382
|
return [
|
|
2557
2383
|
createVNode($setup["PopoverPanel"], {
|
|
2558
|
-
class: ["absolute
|
|
2384
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-20 -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"]
|
|
2559
2385
|
}, {
|
|
2560
2386
|
default: withCtx(({ close }) => [
|
|
2561
|
-
createVNode("div", { class: "flex gap-6
|
|
2387
|
+
createVNode("div", { class: "flex w-full gap-6" }, [
|
|
2562
2388
|
$setup.subcategoryLinks.length ? (openBlock(), createBlock("ul", {
|
|
2563
2389
|
key: 0,
|
|
2564
2390
|
class: "flex-1"
|
|
@@ -2588,7 +2414,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2588
2414
|
}, [
|
|
2589
2415
|
createVNode("h3", null, toDisplayString(subcategory.name), 1)
|
|
2590
2416
|
], 8, ["href"]),
|
|
2591
|
-
createVNode("ul", { class: "text-
|
|
2417
|
+
createVNode("ul", { class: "text-base-600 mb-1.5 mt-1 text-sm" }, [
|
|
2592
2418
|
(openBlock(true), createBlock(Fragment$1, null, renderList(subcategory.subcategories, (nestedSubcategory, ii) => {
|
|
2593
2419
|
return openBlock(), createBlock("li", {
|
|
2594
2420
|
key: `${i}-${ii}`,
|
|
@@ -2617,7 +2443,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2617
2443
|
]),
|
|
2618
2444
|
createVNode("a", {
|
|
2619
2445
|
href: `/${$props.categoryTree.slug}`,
|
|
2620
|
-
class: "
|
|
2446
|
+
class: "text-base-600 mt-1 block text-xs leading-snug underline"
|
|
2621
2447
|
}, toDisplayString("Ver toda a categoria $1".replace("$1", $props.categoryTree.name)), 9, ["href"]),
|
|
2622
2448
|
createVNode("button", {
|
|
2623
2449
|
ref: "close",
|
|
@@ -2635,12 +2461,17 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2635
2461
|
_push2(`</div>`);
|
|
2636
2462
|
} else {
|
|
2637
2463
|
return [
|
|
2638
|
-
createVNode(
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2464
|
+
createVNode("a", {
|
|
2465
|
+
href: `/${$props.categoryTree.slug}`,
|
|
2466
|
+
role: "button"
|
|
2467
|
+
}, [
|
|
2468
|
+
createVNode($setup["PopoverButton"], { class: "outline-none" }, {
|
|
2469
|
+
default: withCtx(() => [
|
|
2470
|
+
renderSlot$1(_ctx.$slots, "button", { open })
|
|
2471
|
+
]),
|
|
2472
|
+
_: 2
|
|
2473
|
+
}, 1024)
|
|
2474
|
+
], 8, ["href"]),
|
|
2644
2475
|
createVNode("div", {
|
|
2645
2476
|
class: "relative",
|
|
2646
2477
|
ref: "panel"
|
|
@@ -2648,10 +2479,10 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2648
2479
|
createVNode(_component_Fade, null, {
|
|
2649
2480
|
default: withCtx(() => [
|
|
2650
2481
|
createVNode($setup["PopoverPanel"], {
|
|
2651
|
-
class: ["absolute
|
|
2482
|
+
class: ["text-base-700 absolute left-1/2 top-3 z-20 -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"]
|
|
2652
2483
|
}, {
|
|
2653
2484
|
default: withCtx(({ close }) => [
|
|
2654
|
-
createVNode("div", { class: "flex gap-6
|
|
2485
|
+
createVNode("div", { class: "flex w-full gap-6" }, [
|
|
2655
2486
|
$setup.subcategoryLinks.length ? (openBlock(), createBlock("ul", {
|
|
2656
2487
|
key: 0,
|
|
2657
2488
|
class: "flex-1"
|
|
@@ -2681,7 +2512,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2681
2512
|
}, [
|
|
2682
2513
|
createVNode("h3", null, toDisplayString(subcategory.name), 1)
|
|
2683
2514
|
], 8, ["href"]),
|
|
2684
|
-
createVNode("ul", { class: "text-
|
|
2515
|
+
createVNode("ul", { class: "text-base-600 mb-1.5 mt-1 text-sm" }, [
|
|
2685
2516
|
(openBlock(true), createBlock(Fragment$1, null, renderList(subcategory.subcategories, (nestedSubcategory, ii) => {
|
|
2686
2517
|
return openBlock(), createBlock("li", {
|
|
2687
2518
|
key: `${i}-${ii}`,
|
|
@@ -2710,7 +2541,7 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2710
2541
|
]),
|
|
2711
2542
|
createVNode("a", {
|
|
2712
2543
|
href: `/${$props.categoryTree.slug}`,
|
|
2713
|
-
class: "
|
|
2544
|
+
class: "text-base-600 mt-1 block text-xs leading-snug underline"
|
|
2714
2545
|
}, toDisplayString("Ver toda a categoria $1".replace("$1", $props.categoryTree.name)), 9, ["href"]),
|
|
2715
2546
|
createVNode("button", {
|
|
2716
2547
|
ref: "close",
|
|
@@ -2730,15 +2561,15 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2730
2561
|
_: 3
|
|
2731
2562
|
}, _parent));
|
|
2732
2563
|
}
|
|
2733
|
-
const _sfc_setup$
|
|
2734
|
-
_sfc_main$
|
|
2564
|
+
const _sfc_setup$k = _sfc_main$k.setup;
|
|
2565
|
+
_sfc_main$k.setup = (props, ctx) => {
|
|
2735
2566
|
const ssrContext = useSSRContext();
|
|
2736
2567
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
|
|
2737
|
-
return _sfc_setup$
|
|
2568
|
+
return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
|
|
2738
2569
|
};
|
|
2739
|
-
const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2570
|
+
const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
|
|
2740
2571
|
|
|
2741
|
-
const _sfc_main$
|
|
2572
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2742
2573
|
__name: "ShopHeaderMenu",
|
|
2743
2574
|
props: {
|
|
2744
2575
|
inlineMenuTrees: {}
|
|
@@ -2754,8 +2585,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2754
2585
|
return __returned__;
|
|
2755
2586
|
}
|
|
2756
2587
|
});
|
|
2757
|
-
function _sfc_ssrRender$
|
|
2758
|
-
_push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "flex gap-4 xl:gap-5
|
|
2588
|
+
function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2589
|
+
_push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "text-base-700 flex gap-4 xl:gap-5"])}"><!--[-->`);
|
|
2759
2590
|
ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
|
|
2760
2591
|
_push(`<li>`);
|
|
2761
2592
|
if (categoryTree.subcategories.length) {
|
|
@@ -2765,9 +2596,9 @@ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2765
2596
|
_push2(`<span class="hover:text-primary group"${_scopeId}><h3 class="${ssrRenderClass([[
|
|
2766
2597
|
$props.inlineMenuTrees.length < 7 ? "decoration-2" : null,
|
|
2767
2598
|
open ? "underline" : null
|
|
2768
|
-
], "group-hover:underline
|
|
2599
|
+
], "inline group-hover:underline"])}"${_scopeId}>${ssrInterpolate(categoryTree.name)}</h3>`);
|
|
2769
2600
|
if ($setup.hasOneLevelSubcategories) {
|
|
2770
|
-
_push2(`<i class="${ssrRenderClass([open ? "rotate-180" : null, "i-chevron-down
|
|
2601
|
+
_push2(`<i class="${ssrRenderClass([open ? "rotate-180" : null, "i-chevron-down text-base-400 group-hover:text-primary-subtle ml-1 transition-transform"])}"${_scopeId}></i>`);
|
|
2771
2602
|
} else {
|
|
2772
2603
|
_push2(`<!---->`);
|
|
2773
2604
|
}
|
|
@@ -2776,14 +2607,14 @@ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2776
2607
|
return [
|
|
2777
2608
|
createVNode("span", { class: "hover:text-primary group" }, [
|
|
2778
2609
|
createVNode("h3", {
|
|
2779
|
-
class: ["group-hover:underline
|
|
2610
|
+
class: ["inline group-hover:underline", [
|
|
2780
2611
|
$props.inlineMenuTrees.length < 7 ? "decoration-2" : null,
|
|
2781
2612
|
open ? "underline" : null
|
|
2782
2613
|
]]
|
|
2783
2614
|
}, toDisplayString(categoryTree.name), 3),
|
|
2784
2615
|
$setup.hasOneLevelSubcategories ? (openBlock(), createBlock("i", {
|
|
2785
2616
|
key: 0,
|
|
2786
|
-
class: ["i-chevron-down
|
|
2617
|
+
class: ["i-chevron-down text-base-400 group-hover:text-primary-subtle ml-1 transition-transform", open ? "rotate-180" : null]
|
|
2787
2618
|
}, null, 2)) : createCommentVNode("", true)
|
|
2788
2619
|
])
|
|
2789
2620
|
];
|
|
@@ -2798,15 +2629,15 @@ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2798
2629
|
});
|
|
2799
2630
|
_push(`<!--]--></ul></nav>`);
|
|
2800
2631
|
}
|
|
2801
|
-
const _sfc_setup$
|
|
2802
|
-
_sfc_main$
|
|
2632
|
+
const _sfc_setup$j = _sfc_main$j.setup;
|
|
2633
|
+
_sfc_main$j.setup = (props, ctx) => {
|
|
2803
2634
|
const ssrContext = useSSRContext();
|
|
2804
2635
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
|
|
2805
|
-
return _sfc_setup$
|
|
2636
|
+
return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
|
|
2806
2637
|
};
|
|
2807
|
-
const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2638
|
+
const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
|
|
2808
2639
|
|
|
2809
|
-
const _sfc_main$
|
|
2640
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2810
2641
|
__name: "AccountMenu",
|
|
2811
2642
|
setup(__props, { expose: __expose }) {
|
|
2812
2643
|
__expose();
|
|
@@ -2833,12 +2664,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2833
2664
|
return __returned__;
|
|
2834
2665
|
}
|
|
2835
2666
|
});
|
|
2836
|
-
function _sfc_ssrRender$
|
|
2667
|
+
function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
2837
2668
|
const _component_Fade = resolveComponent("Fade");
|
|
2838
2669
|
const _component_ALink = resolveComponent("ALink");
|
|
2839
2670
|
_push(ssrRenderComponent($setup["Menu"], mergeProps({
|
|
2840
2671
|
as: "div",
|
|
2841
|
-
class: "relative text-center text-sm
|
|
2672
|
+
class: "text-base-800 relative text-center text-sm"
|
|
2842
2673
|
}, _attrs), {
|
|
2843
2674
|
default: withCtx(({ open }, _push2, _parent2, _scopeId) => {
|
|
2844
2675
|
if (_push2) {
|
|
@@ -2847,16 +2678,39 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2847
2678
|
} else {
|
|
2848
2679
|
_push2(`<!---->`);
|
|
2849
2680
|
}
|
|
2850
|
-
_push2(ssrRenderComponent($setup["
|
|
2851
|
-
|
|
2852
|
-
|
|
2681
|
+
_push2(ssrRenderComponent($setup["AccountLink"], {
|
|
2682
|
+
role: "button",
|
|
2683
|
+
onClick: () => {
|
|
2684
|
+
}
|
|
2853
2685
|
}, {
|
|
2854
2686
|
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2855
2687
|
if (_push3) {
|
|
2856
|
-
|
|
2688
|
+
_push3(ssrRenderComponent($setup["MenuButton"], {
|
|
2689
|
+
class: "outline-none",
|
|
2690
|
+
"aria-label": "Minha conta"
|
|
2691
|
+
}, {
|
|
2692
|
+
default: withCtx((_2, _push4, _parent4, _scopeId3) => {
|
|
2693
|
+
if (_push4) {
|
|
2694
|
+
ssrRenderSlot(_ctx.$slots, "button", { open }, null, _push4, _parent4, _scopeId3);
|
|
2695
|
+
} else {
|
|
2696
|
+
return [
|
|
2697
|
+
renderSlot$1(_ctx.$slots, "button", { open })
|
|
2698
|
+
];
|
|
2699
|
+
}
|
|
2700
|
+
}),
|
|
2701
|
+
_: 2
|
|
2702
|
+
}, _parent3, _scopeId2));
|
|
2857
2703
|
} else {
|
|
2858
2704
|
return [
|
|
2859
|
-
|
|
2705
|
+
createVNode($setup["MenuButton"], {
|
|
2706
|
+
class: "outline-none",
|
|
2707
|
+
"aria-label": "Minha conta"
|
|
2708
|
+
}, {
|
|
2709
|
+
default: withCtx(() => [
|
|
2710
|
+
renderSlot$1(_ctx.$slots, "button", { open })
|
|
2711
|
+
]),
|
|
2712
|
+
_: 2
|
|
2713
|
+
}, 1024)
|
|
2860
2714
|
];
|
|
2861
2715
|
}
|
|
2862
2716
|
}),
|
|
@@ -2865,13 +2719,13 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2865
2719
|
_push2(ssrRenderComponent(_component_Fade, null, {
|
|
2866
2720
|
default: withCtx((_, _push3, _parent3, _scopeId2) => {
|
|
2867
2721
|
if (_push3) {
|
|
2868
|
-
_push3(ssrRenderComponent($setup["MenuItems"], { class: "absolute -right-8 mt-2 w-56 rounded shadow ring-1 ring-black/5
|
|
2722
|
+
_push3(ssrRenderComponent($setup["MenuItems"], { class: "divide-base-100 absolute -right-8 mt-2 w-56 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
2869
2723
|
default: withCtx((_2, _push4, _parent4, _scopeId3) => {
|
|
2870
2724
|
if (_push4) {
|
|
2871
|
-
_push4(`<div class="
|
|
2725
|
+
_push4(`<div class="text-base-600 p-3"${_scopeId3}>${ssrInterpolate(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`)} `);
|
|
2872
2726
|
_push4(ssrRenderComponent($setup["AccountLink"], {
|
|
2873
2727
|
role: "button",
|
|
2874
|
-
class: "ui-btn-sm ui-btn-primary
|
|
2728
|
+
class: "ui-btn-sm ui-btn-primary my-1 block"
|
|
2875
2729
|
}, {
|
|
2876
2730
|
default: withCtx((_3, _push5, _parent5, _scopeId4) => {
|
|
2877
2731
|
if (_push5) {
|
|
@@ -2975,7 +2829,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
2975
2829
|
_: 2
|
|
2976
2830
|
}, _parent4, _scopeId3));
|
|
2977
2831
|
_push4(`<!--[-->`);
|
|
2978
|
-
ssrRenderList(_ctx.$settings.
|
|
2832
|
+
ssrRenderList(_ctx.$settings.serviceLinks, ({ title, href }, i) => {
|
|
2979
2833
|
_push4(ssrRenderComponent($setup["MenuItem"], {
|
|
2980
2834
|
as: "li",
|
|
2981
2835
|
key: `s-${i}`
|
|
@@ -3018,24 +2872,24 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3018
2872
|
_push4(ssrRenderComponent($setup["MenuItem"], { as: "li" }, {
|
|
3019
2873
|
default: withCtx((_3, _push5, _parent5, _scopeId4) => {
|
|
3020
2874
|
if (_push5) {
|
|
3021
|
-
_push5(`<div class="flex justify-center gap-2 p-2 text-base
|
|
2875
|
+
_push5(`<div class="text-base-500 flex justify-center gap-2 p-2 text-base"${_scopeId4}><!--[-->`);
|
|
3022
2876
|
ssrRenderList($setup.socialNetworks, (href, network) => {
|
|
3023
2877
|
_push5(`<span${_scopeId4}>`);
|
|
3024
2878
|
_push5(ssrRenderComponent($setup["SocialNetworkLink"], {
|
|
3025
2879
|
network,
|
|
3026
|
-
class: "
|
|
2880
|
+
class: "hover:text-primary p-1"
|
|
3027
2881
|
}, null, _parent5, _scopeId4));
|
|
3028
2882
|
_push5(`</span>`);
|
|
3029
2883
|
});
|
|
3030
2884
|
_push5(`<!--]--></div>`);
|
|
3031
2885
|
} else {
|
|
3032
2886
|
return [
|
|
3033
|
-
createVNode("div", { class: "flex justify-center gap-2 p-2 text-base
|
|
2887
|
+
createVNode("div", { class: "text-base-500 flex justify-center gap-2 p-2 text-base" }, [
|
|
3034
2888
|
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.socialNetworks, (href, network) => {
|
|
3035
2889
|
return openBlock(), createBlock("span", { key: network }, [
|
|
3036
2890
|
createVNode($setup["SocialNetworkLink"], {
|
|
3037
2891
|
network,
|
|
3038
|
-
class: "
|
|
2892
|
+
class: "hover:text-primary p-1"
|
|
3039
2893
|
}, null, 8, ["network"])
|
|
3040
2894
|
]);
|
|
3041
2895
|
}), 128))
|
|
@@ -3049,15 +2903,15 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3049
2903
|
_push4(ssrRenderComponent($setup["MenuItem"], { as: "li" }, {
|
|
3050
2904
|
default: withCtx((_3, _push5, _parent5, _scopeId4) => {
|
|
3051
2905
|
if (_push5) {
|
|
3052
|
-
_push5(`<button class="p-2 text-right
|
|
2906
|
+
_push5(`<button class="text-base-800 p-2 text-right"${_scopeId4}><span class="text-base-600"${_scopeId4}>${ssrInterpolate("Sair")}</span><i class="i-arrow-right-on-rectangle ml-1 text-lg"${_scopeId4}></i></button>`);
|
|
3053
2907
|
} else {
|
|
3054
2908
|
return [
|
|
3055
2909
|
createVNode("button", {
|
|
3056
2910
|
onClick: $setup.logout,
|
|
3057
|
-
class: "p-2 text-right
|
|
2911
|
+
class: "text-base-800 p-2 text-right"
|
|
3058
2912
|
}, [
|
|
3059
2913
|
createVNode("span", { class: "text-base-600" }, toDisplayString("Sair")),
|
|
3060
|
-
createVNode("i", { class: "i-arrow-right-on-rectangle text-lg
|
|
2914
|
+
createVNode("i", { class: "i-arrow-right-on-rectangle ml-1 text-lg" })
|
|
3061
2915
|
], 8, ["onClick"])
|
|
3062
2916
|
];
|
|
3063
2917
|
}
|
|
@@ -3070,11 +2924,11 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3070
2924
|
_push4(`</ul>`);
|
|
3071
2925
|
} else {
|
|
3072
2926
|
return [
|
|
3073
|
-
createVNode("div", { class: "
|
|
2927
|
+
createVNode("div", { class: "text-base-600 p-3" }, [
|
|
3074
2928
|
createTextVNode(toDisplayString(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`) + " ", 1),
|
|
3075
2929
|
createVNode($setup["AccountLink"], {
|
|
3076
2930
|
role: "button",
|
|
3077
|
-
class: "ui-btn-sm ui-btn-primary
|
|
2931
|
+
class: "ui-btn-sm ui-btn-primary my-1 block"
|
|
3078
2932
|
}, {
|
|
3079
2933
|
default: withCtx(() => [
|
|
3080
2934
|
createTextVNode(toDisplayString("Acessar minha conta"))
|
|
@@ -3122,7 +2976,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3122
2976
|
]),
|
|
3123
2977
|
_: 1
|
|
3124
2978
|
}),
|
|
3125
|
-
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.
|
|
2979
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.serviceLinks, ({ title, href }, i) => {
|
|
3126
2980
|
return openBlock(), createBlock($setup["MenuItem"], {
|
|
3127
2981
|
as: "li",
|
|
3128
2982
|
key: `s-${i}`
|
|
@@ -3143,12 +2997,12 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3143
2997
|
}), 128)),
|
|
3144
2998
|
createVNode($setup["MenuItem"], { as: "li" }, {
|
|
3145
2999
|
default: withCtx(() => [
|
|
3146
|
-
createVNode("div", { class: "flex justify-center gap-2 p-2 text-base
|
|
3000
|
+
createVNode("div", { class: "text-base-500 flex justify-center gap-2 p-2 text-base" }, [
|
|
3147
3001
|
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.socialNetworks, (href, network) => {
|
|
3148
3002
|
return openBlock(), createBlock("span", { key: network }, [
|
|
3149
3003
|
createVNode($setup["SocialNetworkLink"], {
|
|
3150
3004
|
network,
|
|
3151
|
-
class: "
|
|
3005
|
+
class: "hover:text-primary p-1"
|
|
3152
3006
|
}, null, 8, ["network"])
|
|
3153
3007
|
]);
|
|
3154
3008
|
}), 128))
|
|
@@ -3163,10 +3017,10 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3163
3017
|
default: withCtx(() => [
|
|
3164
3018
|
createVNode("button", {
|
|
3165
3019
|
onClick: $setup.logout,
|
|
3166
|
-
class: "p-2 text-right
|
|
3020
|
+
class: "text-base-800 p-2 text-right"
|
|
3167
3021
|
}, [
|
|
3168
3022
|
createVNode("span", { class: "text-base-600" }, toDisplayString("Sair")),
|
|
3169
|
-
createVNode("i", { class: "i-arrow-right-on-rectangle text-lg
|
|
3023
|
+
createVNode("i", { class: "i-arrow-right-on-rectangle ml-1 text-lg" })
|
|
3170
3024
|
], 8, ["onClick"])
|
|
3171
3025
|
]),
|
|
3172
3026
|
_: 1
|
|
@@ -3179,13 +3033,13 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3179
3033
|
}, _parent3, _scopeId2));
|
|
3180
3034
|
} else {
|
|
3181
3035
|
return [
|
|
3182
|
-
createVNode($setup["MenuItems"], { class: "absolute -right-8 mt-2 w-56 rounded shadow ring-1 ring-black/5
|
|
3036
|
+
createVNode($setup["MenuItems"], { class: "divide-base-100 absolute -right-8 mt-2 w-56 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
3183
3037
|
default: withCtx(() => [
|
|
3184
|
-
createVNode("div", { class: "
|
|
3038
|
+
createVNode("div", { class: "text-base-600 p-3" }, [
|
|
3185
3039
|
createTextVNode(toDisplayString(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`) + " ", 1),
|
|
3186
3040
|
createVNode($setup["AccountLink"], {
|
|
3187
3041
|
role: "button",
|
|
3188
|
-
class: "ui-btn-sm ui-btn-primary
|
|
3042
|
+
class: "ui-btn-sm ui-btn-primary my-1 block"
|
|
3189
3043
|
}, {
|
|
3190
3044
|
default: withCtx(() => [
|
|
3191
3045
|
createTextVNode(toDisplayString("Acessar minha conta"))
|
|
@@ -3233,7 +3087,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3233
3087
|
]),
|
|
3234
3088
|
_: 1
|
|
3235
3089
|
}),
|
|
3236
|
-
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.
|
|
3090
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.serviceLinks, ({ title, href }, i) => {
|
|
3237
3091
|
return openBlock(), createBlock($setup["MenuItem"], {
|
|
3238
3092
|
as: "li",
|
|
3239
3093
|
key: `s-${i}`
|
|
@@ -3254,12 +3108,12 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3254
3108
|
}), 128)),
|
|
3255
3109
|
createVNode($setup["MenuItem"], { as: "li" }, {
|
|
3256
3110
|
default: withCtx(() => [
|
|
3257
|
-
createVNode("div", { class: "flex justify-center gap-2 p-2 text-base
|
|
3111
|
+
createVNode("div", { class: "text-base-500 flex justify-center gap-2 p-2 text-base" }, [
|
|
3258
3112
|
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.socialNetworks, (href, network) => {
|
|
3259
3113
|
return openBlock(), createBlock("span", { key: network }, [
|
|
3260
3114
|
createVNode($setup["SocialNetworkLink"], {
|
|
3261
3115
|
network,
|
|
3262
|
-
class: "
|
|
3116
|
+
class: "hover:text-primary p-1"
|
|
3263
3117
|
}, null, 8, ["network"])
|
|
3264
3118
|
]);
|
|
3265
3119
|
}), 128))
|
|
@@ -3274,10 +3128,10 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3274
3128
|
default: withCtx(() => [
|
|
3275
3129
|
createVNode("button", {
|
|
3276
3130
|
onClick: $setup.logout,
|
|
3277
|
-
class: "p-2 text-right
|
|
3131
|
+
class: "text-base-800 p-2 text-right"
|
|
3278
3132
|
}, [
|
|
3279
3133
|
createVNode("span", { class: "text-base-600" }, toDisplayString("Sair")),
|
|
3280
|
-
createVNode("i", { class: "i-arrow-right-on-rectangle text-lg
|
|
3134
|
+
createVNode("i", { class: "i-arrow-right-on-rectangle ml-1 text-lg" })
|
|
3281
3135
|
], 8, ["onClick"])
|
|
3282
3136
|
]),
|
|
3283
3137
|
_: 1
|
|
@@ -3298,24 +3152,33 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3298
3152
|
createTextVNode(toDisplayString($setup.initializeFirebaseAuth()), 1)
|
|
3299
3153
|
])
|
|
3300
3154
|
])) : createCommentVNode("", true),
|
|
3301
|
-
createVNode($setup["
|
|
3302
|
-
|
|
3303
|
-
|
|
3155
|
+
createVNode($setup["AccountLink"], {
|
|
3156
|
+
role: "button",
|
|
3157
|
+
onClick: withModifiers(() => {
|
|
3158
|
+
}, ["prevent"])
|
|
3304
3159
|
}, {
|
|
3305
3160
|
default: withCtx(() => [
|
|
3306
|
-
|
|
3161
|
+
createVNode($setup["MenuButton"], {
|
|
3162
|
+
class: "outline-none",
|
|
3163
|
+
"aria-label": "Minha conta"
|
|
3164
|
+
}, {
|
|
3165
|
+
default: withCtx(() => [
|
|
3166
|
+
renderSlot$1(_ctx.$slots, "button", { open })
|
|
3167
|
+
]),
|
|
3168
|
+
_: 2
|
|
3169
|
+
}, 1024)
|
|
3307
3170
|
]),
|
|
3308
3171
|
_: 2
|
|
3309
|
-
},
|
|
3172
|
+
}, 1032, ["onClick"]),
|
|
3310
3173
|
createVNode(_component_Fade, null, {
|
|
3311
3174
|
default: withCtx(() => [
|
|
3312
|
-
createVNode($setup["MenuItems"], { class: "absolute -right-8 mt-2 w-56 rounded shadow ring-1 ring-black/5
|
|
3175
|
+
createVNode($setup["MenuItems"], { class: "divide-base-100 absolute -right-8 mt-2 w-56 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none" }, {
|
|
3313
3176
|
default: withCtx(() => [
|
|
3314
|
-
createVNode("div", { class: "
|
|
3177
|
+
createVNode("div", { class: "text-base-600 p-3" }, [
|
|
3315
3178
|
createTextVNode(toDisplayString(`${"Ol\xE1"} ${$setup.customerName || "Visitante"}`) + " ", 1),
|
|
3316
3179
|
createVNode($setup["AccountLink"], {
|
|
3317
3180
|
role: "button",
|
|
3318
|
-
class: "ui-btn-sm ui-btn-primary
|
|
3181
|
+
class: "ui-btn-sm ui-btn-primary my-1 block"
|
|
3319
3182
|
}, {
|
|
3320
3183
|
default: withCtx(() => [
|
|
3321
3184
|
createTextVNode(toDisplayString("Acessar minha conta"))
|
|
@@ -3363,7 +3226,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3363
3226
|
]),
|
|
3364
3227
|
_: 1
|
|
3365
3228
|
}),
|
|
3366
|
-
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.
|
|
3229
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.serviceLinks, ({ title, href }, i) => {
|
|
3367
3230
|
return openBlock(), createBlock($setup["MenuItem"], {
|
|
3368
3231
|
as: "li",
|
|
3369
3232
|
key: `s-${i}`
|
|
@@ -3384,12 +3247,12 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3384
3247
|
}), 128)),
|
|
3385
3248
|
createVNode($setup["MenuItem"], { as: "li" }, {
|
|
3386
3249
|
default: withCtx(() => [
|
|
3387
|
-
createVNode("div", { class: "flex justify-center gap-2 p-2 text-base
|
|
3250
|
+
createVNode("div", { class: "text-base-500 flex justify-center gap-2 p-2 text-base" }, [
|
|
3388
3251
|
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.socialNetworks, (href, network) => {
|
|
3389
3252
|
return openBlock(), createBlock("span", { key: network }, [
|
|
3390
3253
|
createVNode($setup["SocialNetworkLink"], {
|
|
3391
3254
|
network,
|
|
3392
|
-
class: "
|
|
3255
|
+
class: "hover:text-primary p-1"
|
|
3393
3256
|
}, null, 8, ["network"])
|
|
3394
3257
|
]);
|
|
3395
3258
|
}), 128))
|
|
@@ -3404,10 +3267,10 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3404
3267
|
default: withCtx(() => [
|
|
3405
3268
|
createVNode("button", {
|
|
3406
3269
|
onClick: $setup.logout,
|
|
3407
|
-
class: "p-2 text-right
|
|
3270
|
+
class: "text-base-800 p-2 text-right"
|
|
3408
3271
|
}, [
|
|
3409
3272
|
createVNode("span", { class: "text-base-600" }, toDisplayString("Sair")),
|
|
3410
|
-
createVNode("i", { class: "i-arrow-right-on-rectangle text-lg
|
|
3273
|
+
createVNode("i", { class: "i-arrow-right-on-rectangle ml-1 text-lg" })
|
|
3411
3274
|
], 8, ["onClick"])
|
|
3412
3275
|
]),
|
|
3413
3276
|
_: 1
|
|
@@ -3425,15 +3288,15 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3425
3288
|
_: 3
|
|
3426
3289
|
}, _parent));
|
|
3427
3290
|
}
|
|
3428
|
-
const _sfc_setup$
|
|
3429
|
-
_sfc_main$
|
|
3291
|
+
const _sfc_setup$i = _sfc_main$i.setup;
|
|
3292
|
+
_sfc_main$i.setup = (props, ctx) => {
|
|
3430
3293
|
const ssrContext = useSSRContext();
|
|
3431
3294
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
|
|
3432
|
-
return _sfc_setup$
|
|
3295
|
+
return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
|
|
3433
3296
|
};
|
|
3434
|
-
const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3297
|
+
const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
|
|
3435
3298
|
|
|
3436
|
-
const _sfc_main$
|
|
3299
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
3437
3300
|
__name: "ShopHeader",
|
|
3438
3301
|
props: {
|
|
3439
3302
|
categories: {},
|
|
@@ -3443,9 +3306,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3443
3306
|
},
|
|
3444
3307
|
setup(__props, { expose: __expose }) {
|
|
3445
3308
|
__expose();
|
|
3309
|
+
const SearchModal = defineAsyncComponent(() => import('../SearchModal_2afca4fe.mjs'));
|
|
3310
|
+
const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_03b51b57.mjs'));
|
|
3446
3311
|
const props = __props;
|
|
3447
|
-
const SearchModal = defineAsyncComponent(() => import('../SearchModal.146ce2f7.mjs'));
|
|
3448
|
-
const CartSidebar = defineAsyncComponent(() => import('../CartSidebar.4179ad81.mjs'));
|
|
3449
3312
|
const header = ref(null);
|
|
3450
3313
|
const {
|
|
3451
3314
|
isSticky,
|
|
@@ -3484,39 +3347,42 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3484
3347
|
return __returned__;
|
|
3485
3348
|
}
|
|
3486
3349
|
});
|
|
3487
|
-
function _sfc_ssrRender$
|
|
3350
|
+
function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3488
3351
|
const _component_Skeleton = resolveComponent("Skeleton");
|
|
3489
3352
|
_push(`<header${ssrRenderAttrs(mergeProps({
|
|
3490
3353
|
ref: "header",
|
|
3491
3354
|
class: ["relative top-0 z-50 transition-colors", [
|
|
3492
3355
|
$setup.isSticky && !$setup.isSidenavOpen ? "bg-white/80" : "bg-white",
|
|
3493
|
-
$setup.isSticky ? "backdrop-blur-md
|
|
3356
|
+
$setup.isSticky ? "py-2 shadow backdrop-blur-md md:py-3" : "py-3 sm:py-4 md:py-5"
|
|
3494
3357
|
]]
|
|
3495
|
-
}, _attrs))}><div class="w-screen
|
|
3358
|
+
}, _attrs))}><div class="mx-auto flex w-screen grid-flow-col grid-cols-3 items-center justify-between px-1 sm:pl-2 sm:pr-2.5 md:grid lg:w-[calc(100vw-1rem)] lg:auto-cols-max lg:grid-cols-none lg:px-1 xl:max-w-[82rem] 2xl:max-w-[85rem]"><div class="basis-1/4 lg:hidden"><button class="my-1 px-2"${ssrRenderAttr("aria-label", "Abrir/fechar menu")}><i class="${ssrRenderClass([[
|
|
3359
|
+
$setup.isSidenavOpen ? "i-close" : "i-bars-3-bottom-left",
|
|
3360
|
+
$setup.isMounted ? "text-base-500" : "text-base-400 animate-pulse"
|
|
3361
|
+
], "text-3xl transition-colors"])}"></i></button></div>`);
|
|
3496
3362
|
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
3497
3363
|
_push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ class: "hidden lg:block" }, { inlineMenuTrees: $setup.inlineMenuTrees }), null, _parent));
|
|
3498
|
-
_push(`<div class="basis-1/4
|
|
3364
|
+
_push(`<div class="text-base-800 flex basis-1/4 items-center justify-end gap-3 px-2 lg:gap-4"><a href="/s"${ssrRenderAttr("aria-label", "Buscar produtos")} role="button"><i class="i-magnifying-glass hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"></i></a>`);
|
|
3499
3365
|
_push(ssrRenderComponent($setup["AccountMenu"], { class: "hidden sm:block" }, {
|
|
3500
3366
|
button: withCtx(({ open }, _push2, _parent2, _scopeId) => {
|
|
3501
3367
|
if (_push2) {
|
|
3502
|
-
_push2(`<i class="${ssrRenderClass([open ? "text-black scale-110" : null, "i-user-circle
|
|
3368
|
+
_push2(`<i class="${ssrRenderClass([open ? "text-black scale-110" : null, "i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
|
|
3503
3369
|
} else {
|
|
3504
3370
|
return [
|
|
3505
3371
|
createVNode("i", {
|
|
3506
|
-
class: ["i-user-circle
|
|
3372
|
+
class: ["i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125", open ? "text-black scale-110" : null]
|
|
3507
3373
|
}, null, 2)
|
|
3508
3374
|
];
|
|
3509
3375
|
}
|
|
3510
3376
|
}),
|
|
3511
3377
|
_: 1
|
|
3512
3378
|
}, _parent));
|
|
3513
|
-
_push(`<
|
|
3379
|
+
_push(`<a${ssrRenderAttr("href", _ctx.$settings.cartUrl || "/app/")}${ssrRenderAttr("aria-label", "Abrir carrinho")} class="group relative" role="button"><i class="i-shopping-bag group-hover:text-primary h-7 w-7 group-hover:scale-110 group-active:scale-125"></i>`);
|
|
3514
3380
|
if ($setup.delayedTotalItems) {
|
|
3515
|
-
_push(`<span class="ui-badge-pill-sm absolute -
|
|
3381
|
+
_push(`<span class="ui-badge-pill-sm absolute -right-1.5 -top-1">${ssrInterpolate($setup.delayedTotalItems)}</span>`);
|
|
3516
3382
|
} else {
|
|
3517
3383
|
_push(`<!---->`);
|
|
3518
3384
|
}
|
|
3519
|
-
_push(`</
|
|
3385
|
+
_push(`</a></div></div>`);
|
|
3520
3386
|
_push(ssrRenderComponent($setup["Drawer"], {
|
|
3521
3387
|
modelValue: $setup.isSidenavOpen,
|
|
3522
3388
|
"onUpdate:modelValue": ($event) => $setup.isSidenavOpen = $event,
|
|
@@ -3599,7 +3465,7 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3599
3465
|
ssrRenderSuspense(_push3, {
|
|
3600
3466
|
fallback: () => {
|
|
3601
3467
|
_push3(ssrRenderComponent(_component_Skeleton, {
|
|
3602
|
-
class: "pt-16
|
|
3468
|
+
class: "px-6 pt-16",
|
|
3603
3469
|
"is-bold": ""
|
|
3604
3470
|
}, null, _parent2, _scopeId));
|
|
3605
3471
|
},
|
|
@@ -3619,7 +3485,7 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3619
3485
|
(openBlock(), createBlock(Suspense, null, {
|
|
3620
3486
|
fallback: withCtx(() => [
|
|
3621
3487
|
createVNode(_component_Skeleton, {
|
|
3622
|
-
class: "pt-16
|
|
3488
|
+
class: "px-6 pt-16",
|
|
3623
3489
|
"is-bold": ""
|
|
3624
3490
|
})
|
|
3625
3491
|
]),
|
|
@@ -3642,21 +3508,21 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3642
3508
|
}
|
|
3643
3509
|
_push(`</header>`);
|
|
3644
3510
|
}
|
|
3645
|
-
const _sfc_setup$
|
|
3646
|
-
_sfc_main$
|
|
3511
|
+
const _sfc_setup$h = _sfc_main$h.setup;
|
|
3512
|
+
_sfc_main$h.setup = (props, ctx) => {
|
|
3647
3513
|
const ssrContext = useSSRContext();
|
|
3648
3514
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
|
|
3649
|
-
return _sfc_setup$
|
|
3515
|
+
return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
|
|
3650
3516
|
};
|
|
3651
|
-
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3517
|
+
const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
|
|
3652
3518
|
|
|
3653
|
-
var __freeze$
|
|
3654
|
-
var __defProp$
|
|
3655
|
-
var __template$
|
|
3656
|
-
var _a$
|
|
3657
|
-
const $$Astro$
|
|
3519
|
+
var __freeze$2 = Object.freeze;
|
|
3520
|
+
var __defProp$2 = Object.defineProperty;
|
|
3521
|
+
var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
|
|
3522
|
+
var _a$2;
|
|
3523
|
+
const $$Astro$8 = createAstro("https://demo.ecomplus.app");
|
|
3658
3524
|
const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
3659
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
3525
|
+
const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
|
|
3660
3526
|
Astro2.self = $$PageHeader;
|
|
3661
3527
|
const { routeContext } = Astro2.locals;
|
|
3662
3528
|
const { settings, isHomepage } = routeContext;
|
|
@@ -3669,10 +3535,10 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3669
3535
|
field: "categories",
|
|
3670
3536
|
value: categories?.map(({ _id, ...c }) => c)
|
|
3671
3537
|
});
|
|
3672
|
-
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$
|
|
3538
|
+
return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2([" ", "", " <script>", "<\/script> ", ""])), 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` ${maybeRenderHead()}<a href="/"> ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate` ${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" })} ` })} </a> ` })}` })))}`;
|
|
3673
3539
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
|
|
3674
3540
|
|
|
3675
|
-
const _sfc_main$
|
|
3541
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
3676
3542
|
__name: "PaymentMethodFlag",
|
|
3677
3543
|
props: {
|
|
3678
3544
|
as: { default: "i" },
|
|
@@ -3708,22 +3574,141 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3708
3574
|
return __returned__;
|
|
3709
3575
|
}
|
|
3710
3576
|
});
|
|
3711
|
-
function _sfc_ssrRender$
|
|
3577
|
+
function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3712
3578
|
if (!$setup.iconClassName) {
|
|
3713
|
-
_push(`<b${ssrRenderAttrs(mergeProps({ class: "
|
|
3579
|
+
_push(`<b${ssrRenderAttrs(mergeProps({ class: "mb-1 text-[57%] leading-none tracking-tighter text-black" }, _attrs))}>${ssrInterpolate($setup.props.flag)}</b>`);
|
|
3714
3580
|
} else {
|
|
3715
3581
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
|
|
3716
3582
|
}
|
|
3717
3583
|
}
|
|
3718
|
-
const _sfc_setup$
|
|
3719
|
-
_sfc_main$
|
|
3584
|
+
const _sfc_setup$g = _sfc_main$g.setup;
|
|
3585
|
+
_sfc_main$g.setup = (props, ctx) => {
|
|
3720
3586
|
const ssrContext = useSSRContext();
|
|
3721
3587
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PaymentMethodFlag.vue");
|
|
3722
|
-
return _sfc_setup$
|
|
3588
|
+
return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
|
|
3723
3589
|
};
|
|
3724
|
-
const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3590
|
+
const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
|
|
3725
3591
|
|
|
3726
|
-
const _sfc_main$
|
|
3592
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
3593
|
+
__name: "FooterStamps",
|
|
3594
|
+
props: {
|
|
3595
|
+
stamps: {}
|
|
3596
|
+
},
|
|
3597
|
+
setup(__props, { expose: __expose }) {
|
|
3598
|
+
__expose();
|
|
3599
|
+
const __returned__ = { PaymentMethodFlag };
|
|
3600
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3601
|
+
return __returned__;
|
|
3602
|
+
}
|
|
3603
|
+
});
|
|
3604
|
+
function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3605
|
+
const _component_ALink = resolveComponent("ALink");
|
|
3606
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex flex-wrap items-start justify-between gap-5 lg:flex-nowrap"><ul class="mx-auto flex items-center gap-x-6 gap-y-3 overflow-x-auto md:mx-0 md:flex-wrap md:overflow-hidden lg:gap-x-8"><!--[-->`);
|
|
3607
|
+
ssrRenderList($props.stamps, (stamp, i) => {
|
|
3608
|
+
_push(`<li>`);
|
|
3609
|
+
_push(ssrRenderComponent(_component_ALink, {
|
|
3610
|
+
href: stamp.href?.replace("{domain}", _ctx.$settings.domain || "")
|
|
3611
|
+
}, {
|
|
3612
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3613
|
+
if (_push2) {
|
|
3614
|
+
ssrRenderSlot(_ctx.$slots, `picture-${i}`, {}, null, _push2, _parent2, _scopeId);
|
|
3615
|
+
if (!stamp.img) {
|
|
3616
|
+
_push2(`<span class="flex items-center"${_scopeId}>`);
|
|
3617
|
+
if (stamp.icon) {
|
|
3618
|
+
_push2(`<span class="[&>*]:from-success-200 [&>*]:to-success-700 mr-2 text-4xl [&>*]:bg-gradient-to-br"${_scopeId}>`);
|
|
3619
|
+
if (stamp.icon === "lock") {
|
|
3620
|
+
_push2(`<i class="i-lock-closed"${_scopeId}></i>`);
|
|
3621
|
+
} else if (stamp.icon === "check") {
|
|
3622
|
+
_push2(`<i class="i-check-badge"${_scopeId}></i>`);
|
|
3623
|
+
} else {
|
|
3624
|
+
_push2(`<i class="i-arrow-path-rounded-square"${_scopeId}></i>`);
|
|
3625
|
+
}
|
|
3626
|
+
_push2(`</span>`);
|
|
3627
|
+
} else {
|
|
3628
|
+
_push2(`<!---->`);
|
|
3629
|
+
}
|
|
3630
|
+
_push2(`<span class="text-base-600 max-w-[140px] text-sm font-medium"${_scopeId}>${ssrInterpolate(stamp.alt)} `);
|
|
3631
|
+
if (stamp.href && stamp.href.charAt(0) !== "/") {
|
|
3632
|
+
_push2(`<i class="bg-base-400 i-arrow-top-right-on-square ml-0.5"${_scopeId}></i>`);
|
|
3633
|
+
} else {
|
|
3634
|
+
_push2(`<!---->`);
|
|
3635
|
+
}
|
|
3636
|
+
_push2(`</span></span>`);
|
|
3637
|
+
} else {
|
|
3638
|
+
_push2(`<!---->`);
|
|
3639
|
+
}
|
|
3640
|
+
} else {
|
|
3641
|
+
return [
|
|
3642
|
+
renderSlot$1(_ctx.$slots, `picture-${i}`),
|
|
3643
|
+
!stamp.img ? (openBlock(), createBlock("span", {
|
|
3644
|
+
key: 0,
|
|
3645
|
+
class: "flex items-center"
|
|
3646
|
+
}, [
|
|
3647
|
+
stamp.icon ? (openBlock(), createBlock("span", {
|
|
3648
|
+
key: 0,
|
|
3649
|
+
class: "[&>*]:from-success-200 [&>*]:to-success-700 mr-2 text-4xl [&>*]:bg-gradient-to-br"
|
|
3650
|
+
}, [
|
|
3651
|
+
stamp.icon === "lock" ? (openBlock(), createBlock("i", {
|
|
3652
|
+
key: 0,
|
|
3653
|
+
class: "i-lock-closed"
|
|
3654
|
+
})) : stamp.icon === "check" ? (openBlock(), createBlock("i", {
|
|
3655
|
+
key: 1,
|
|
3656
|
+
class: "i-check-badge"
|
|
3657
|
+
})) : (openBlock(), createBlock("i", {
|
|
3658
|
+
key: 2,
|
|
3659
|
+
class: "i-arrow-path-rounded-square"
|
|
3660
|
+
}))
|
|
3661
|
+
])) : createCommentVNode("", true),
|
|
3662
|
+
createVNode("span", { class: "text-base-600 max-w-[140px] text-sm font-medium" }, [
|
|
3663
|
+
createTextVNode(toDisplayString(stamp.alt) + " ", 1),
|
|
3664
|
+
stamp.href && stamp.href.charAt(0) !== "/" ? (openBlock(), createBlock("i", {
|
|
3665
|
+
key: 0,
|
|
3666
|
+
class: "bg-base-400 i-arrow-top-right-on-square ml-0.5"
|
|
3667
|
+
})) : createCommentVNode("", true)
|
|
3668
|
+
])
|
|
3669
|
+
])) : createCommentVNode("", true)
|
|
3670
|
+
];
|
|
3671
|
+
}
|
|
3672
|
+
}),
|
|
3673
|
+
_: 2
|
|
3674
|
+
}, _parent));
|
|
3675
|
+
_push(`</li>`);
|
|
3676
|
+
});
|
|
3677
|
+
_push(`<!--]--></ul><div class="mx-auto flex flex-wrap items-center justify-end gap-4 overflow-x-auto text-2xl md:mx-0 md:flex-nowrap md:overflow-hidden"><!--[-->`);
|
|
3678
|
+
ssrRenderList(_ctx.$settings.paymentMethods, (paymentMethod) => {
|
|
3679
|
+
_push(ssrRenderComponent($setup["PaymentMethodFlag"], {
|
|
3680
|
+
key: paymentMethod,
|
|
3681
|
+
flag: paymentMethod
|
|
3682
|
+
}, null, _parent));
|
|
3683
|
+
});
|
|
3684
|
+
_push(`<!--]--></div></div><div class="mt-7 justify-between gap-4 text-center text-xs md:flex md:text-left"><div class="mb-3 md:mb-0"> @ ${ssrInterpolate(( new Date()).getFullYear())} ${ssrInterpolate(_ctx.$settings.corporateName)} ${ssrInterpolate(_ctx.$settings.address ? `/ ${_ctx.$settings.address}` : "")} / ${ssrInterpolate(_ctx.$settings.docNumber)}</div>`);
|
|
3685
|
+
_push(ssrRenderComponent(_component_ALink, {
|
|
3686
|
+
href: "https://www.ecomplus.io/",
|
|
3687
|
+
class: "italic text-[#37003c]"
|
|
3688
|
+
}, {
|
|
3689
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3690
|
+
if (_push2) {
|
|
3691
|
+
_push2(` powered by <b${_scopeId}>e-com.plus</b>`);
|
|
3692
|
+
} else {
|
|
3693
|
+
return [
|
|
3694
|
+
createTextVNode(" powered by "),
|
|
3695
|
+
createVNode("b", null, "e-com.plus")
|
|
3696
|
+
];
|
|
3697
|
+
}
|
|
3698
|
+
}),
|
|
3699
|
+
_: 1
|
|
3700
|
+
}, _parent));
|
|
3701
|
+
_push(`</div></div>`);
|
|
3702
|
+
}
|
|
3703
|
+
const _sfc_setup$f = _sfc_main$f.setup;
|
|
3704
|
+
_sfc_main$f.setup = (props, ctx) => {
|
|
3705
|
+
const ssrContext = useSSRContext();
|
|
3706
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FooterStamps.vue");
|
|
3707
|
+
return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
|
|
3708
|
+
};
|
|
3709
|
+
const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
|
|
3710
|
+
|
|
3711
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
3727
3712
|
__name: "ShopFooter",
|
|
3728
3713
|
props: {
|
|
3729
3714
|
stamps: {},
|
|
@@ -3736,35 +3721,35 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3736
3721
|
__expose();
|
|
3737
3722
|
const __returned__ = { get socialNetworks() {
|
|
3738
3723
|
return socialNetworks;
|
|
3739
|
-
}, SocialNetworkLink,
|
|
3724
|
+
}, SocialNetworkLink, FooterStamps };
|
|
3740
3725
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3741
3726
|
return __returned__;
|
|
3742
3727
|
}
|
|
3743
3728
|
});
|
|
3744
|
-
function _sfc_ssrRender$
|
|
3729
|
+
function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
3745
3730
|
const _component_ALink = resolveComponent("ALink");
|
|
3746
|
-
_push(`<footer${ssrRenderAttrs(mergeProps({ class: "
|
|
3731
|
+
_push(`<footer${ssrRenderAttrs(mergeProps({ class: "bg-base-50 border-base-100 w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
|
|
3747
3732
|
ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
|
|
3748
3733
|
if (_ctx.$settings.description) {
|
|
3749
3734
|
_push(`<div class="prose"><p>${ssrInterpolate(_ctx.$settings.description)}</p></div>`);
|
|
3750
3735
|
} else {
|
|
3751
3736
|
_push(`<!---->`);
|
|
3752
3737
|
}
|
|
3753
|
-
_push(`<div class="flex gap-2
|
|
3738
|
+
_push(`<div class="text-base-500 flex gap-2"><!--[-->`);
|
|
3754
3739
|
ssrRenderList($setup.socialNetworks, (href, network) => {
|
|
3755
3740
|
_push(`<span>`);
|
|
3756
3741
|
_push(ssrRenderComponent($setup["SocialNetworkLink"], {
|
|
3757
3742
|
network,
|
|
3758
|
-
class: "
|
|
3743
|
+
class: "hover:text-primary p-1"
|
|
3759
3744
|
}, createSlots({ _: 2 }, [
|
|
3760
3745
|
network === "whatsapp" ? {
|
|
3761
3746
|
name: "append",
|
|
3762
3747
|
fn: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3763
3748
|
if (_push2) {
|
|
3764
|
-
_push2(`<span class="ml-1 text-sm
|
|
3749
|
+
_push2(`<span class="text-base-600 ml-1 text-sm"${_scopeId}>${ssrInterpolate(_ctx.$settings.whatsapp)}</span>`);
|
|
3765
3750
|
} else {
|
|
3766
3751
|
return [
|
|
3767
|
-
createVNode("span", { class: "ml-1 text-sm
|
|
3752
|
+
createVNode("span", { class: "text-base-600 ml-1 text-sm" }, toDisplayString(_ctx.$settings.whatsapp), 1)
|
|
3768
3753
|
];
|
|
3769
3754
|
}
|
|
3770
3755
|
}),
|
|
@@ -3774,13 +3759,8 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3774
3759
|
_push(`</span>`);
|
|
3775
3760
|
});
|
|
3776
3761
|
_push(`<!--]--></div>`);
|
|
3777
|
-
if (_ctx.$settings.
|
|
3778
|
-
_push(`<div class="
|
|
3779
|
-
if (_ctx.$settings.address) {
|
|
3780
|
-
_push(`<address class="inline-block mr-4">${ssrInterpolate(_ctx.$settings.address)}</address>`);
|
|
3781
|
-
} else {
|
|
3782
|
-
_push(`<!---->`);
|
|
3783
|
-
}
|
|
3762
|
+
if (_ctx.$settings.phone) {
|
|
3763
|
+
_push(`<div class="text-base-700 mt-3">`);
|
|
3784
3764
|
if (_ctx.$settings.phone) {
|
|
3785
3765
|
_push(ssrRenderComponent(_component_ALink, {
|
|
3786
3766
|
href: `tel:${_ctx.$settings.phone.replace(/\D/g, "")}`,
|
|
@@ -3807,48 +3787,16 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3807
3787
|
}
|
|
3808
3788
|
_push(`</div>`);
|
|
3809
3789
|
if ($props.categories?.length) {
|
|
3810
|
-
_push(`<div class="basis-1/2 sm:basis-auto"><div class="text-lg font-medium
|
|
3790
|
+
_push(`<div class="basis-1/2 sm:basis-auto"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.categoriesColTitle || "Categorias")}</div><ul class="${ssrRenderClass([$props.categories.length > 4 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
|
|
3811
3791
|
ssrRenderList($props.categories, ({ name, slug }, i) => {
|
|
3812
|
-
_push(`<li>`);
|
|
3813
|
-
_push(ssrRenderComponent(_component_ALink, {
|
|
3814
|
-
href: `/${slug}`,
|
|
3815
|
-
class: "ui-link text-base-600"
|
|
3816
|
-
}, {
|
|
3817
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3818
|
-
if (_push2) {
|
|
3819
|
-
_push2(`${ssrInterpolate(name)}`);
|
|
3820
|
-
} else {
|
|
3821
|
-
return [
|
|
3822
|
-
createTextVNode(toDisplayString(name), 1)
|
|
3823
|
-
];
|
|
3824
|
-
}
|
|
3825
|
-
}),
|
|
3826
|
-
_: 2
|
|
3827
|
-
}, _parent));
|
|
3828
|
-
_push(`</li>`);
|
|
3792
|
+
_push(`<li><a${ssrRenderAttr("href", `/${slug}`)} class="ui-link text-base-600">${ssrInterpolate(name)}</a></li>`);
|
|
3829
3793
|
});
|
|
3830
|
-
_push(`<!--]--><li>`);
|
|
3831
|
-
_push(ssrRenderComponent(_component_ALink, {
|
|
3832
|
-
href: "/s",
|
|
3833
|
-
class: "ui-link text-base-900"
|
|
3834
|
-
}, {
|
|
3835
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3836
|
-
if (_push2) {
|
|
3837
|
-
_push2(`${ssrInterpolate("Todos os produtos")}`);
|
|
3838
|
-
} else {
|
|
3839
|
-
return [
|
|
3840
|
-
createTextVNode(toDisplayString("Todos os produtos"))
|
|
3841
|
-
];
|
|
3842
|
-
}
|
|
3843
|
-
}),
|
|
3844
|
-
_: 1
|
|
3845
|
-
}, _parent));
|
|
3846
|
-
_push(`</li></ul></div>`);
|
|
3794
|
+
_push(`<!--]--><li><a href="/s" class="ui-link text-base-900">${ssrInterpolate("Todos os produtos")}</a></li></ul></div>`);
|
|
3847
3795
|
} else {
|
|
3848
3796
|
_push(`<!---->`);
|
|
3849
3797
|
}
|
|
3850
3798
|
if ($props.pageLinks?.length) {
|
|
3851
|
-
_push(`<div class="basis-1/2 sm:basis-auto"><div class="text-lg font-medium
|
|
3799
|
+
_push(`<div class="basis-1/2 sm:basis-auto"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.pagesColTitle || "Institucional")}</div><ul class="${ssrRenderClass([$props.pageLinks.length > 5 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
|
|
3852
3800
|
ssrRenderList($props.pageLinks, ({ title, href }, i) => {
|
|
3853
3801
|
_push(`<li>`);
|
|
3854
3802
|
_push(ssrRenderComponent(_component_ALink, {
|
|
@@ -3872,114 +3820,21 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
3872
3820
|
} else {
|
|
3873
3821
|
_push(`<!---->`);
|
|
3874
3822
|
}
|
|
3875
|
-
_push(`</div></div
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
_push(ssrRenderComponent(_component_ALink, {
|
|
3879
|
-
href: stamp.href?.replace("{domain}", _ctx.$settings.domain || "")
|
|
3880
|
-
}, {
|
|
3881
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3882
|
-
if (_push2) {
|
|
3883
|
-
ssrRenderSlot(_ctx.$slots, `picture-${i}`, {}, null, _push2, _parent2, _scopeId);
|
|
3884
|
-
if (!stamp.img) {
|
|
3885
|
-
_push2(`<span class="flex items-center"${_scopeId}>`);
|
|
3886
|
-
if (stamp.icon) {
|
|
3887
|
-
_push2(`<span class="text-4xl mr-2 [&>*]:bg-gradient-to-br [&>*]:from-success-200 [&>*]:to-success-700"${_scopeId}>`);
|
|
3888
|
-
if (stamp.icon === "lock") {
|
|
3889
|
-
_push2(`<i class="i-lock-closed"${_scopeId}></i>`);
|
|
3890
|
-
} else if (stamp.icon === "check") {
|
|
3891
|
-
_push2(`<i class="i-check-badge"${_scopeId}></i>`);
|
|
3892
|
-
} else {
|
|
3893
|
-
_push2(`<i class="i-arrow-path-rounded-square"${_scopeId}></i>`);
|
|
3894
|
-
}
|
|
3895
|
-
_push2(`</span>`);
|
|
3896
|
-
} else {
|
|
3897
|
-
_push2(`<!---->`);
|
|
3898
|
-
}
|
|
3899
|
-
_push2(`<span class="text-sm font-medium text-base-600 max-w-[140px]"${_scopeId}>${ssrInterpolate(stamp.alt)} `);
|
|
3900
|
-
if (stamp.href && stamp.href.charAt(0) !== "/") {
|
|
3901
|
-
_push2(`<i class="bg-base-400 ml-0.5 i-arrow-top-right-on-square"${_scopeId}></i>`);
|
|
3902
|
-
} else {
|
|
3903
|
-
_push2(`<!---->`);
|
|
3904
|
-
}
|
|
3905
|
-
_push2(`</span></span>`);
|
|
3906
|
-
} else {
|
|
3907
|
-
_push2(`<!---->`);
|
|
3908
|
-
}
|
|
3909
|
-
} else {
|
|
3910
|
-
return [
|
|
3911
|
-
renderSlot$1(_ctx.$slots, `picture-${i}`),
|
|
3912
|
-
!stamp.img ? (openBlock(), createBlock("span", {
|
|
3913
|
-
key: 0,
|
|
3914
|
-
class: "flex items-center"
|
|
3915
|
-
}, [
|
|
3916
|
-
stamp.icon ? (openBlock(), createBlock("span", {
|
|
3917
|
-
key: 0,
|
|
3918
|
-
class: "text-4xl mr-2 [&>*]:bg-gradient-to-br [&>*]:from-success-200 [&>*]:to-success-700"
|
|
3919
|
-
}, [
|
|
3920
|
-
stamp.icon === "lock" ? (openBlock(), createBlock("i", {
|
|
3921
|
-
key: 0,
|
|
3922
|
-
class: "i-lock-closed"
|
|
3923
|
-
})) : stamp.icon === "check" ? (openBlock(), createBlock("i", {
|
|
3924
|
-
key: 1,
|
|
3925
|
-
class: "i-check-badge"
|
|
3926
|
-
})) : (openBlock(), createBlock("i", {
|
|
3927
|
-
key: 2,
|
|
3928
|
-
class: "i-arrow-path-rounded-square"
|
|
3929
|
-
}))
|
|
3930
|
-
])) : createCommentVNode("", true),
|
|
3931
|
-
createVNode("span", { class: "text-sm font-medium text-base-600 max-w-[140px]" }, [
|
|
3932
|
-
createTextVNode(toDisplayString(stamp.alt) + " ", 1),
|
|
3933
|
-
stamp.href && stamp.href.charAt(0) !== "/" ? (openBlock(), createBlock("i", {
|
|
3934
|
-
key: 0,
|
|
3935
|
-
class: "bg-base-400 ml-0.5 i-arrow-top-right-on-square"
|
|
3936
|
-
})) : createCommentVNode("", true)
|
|
3937
|
-
])
|
|
3938
|
-
])) : createCommentVNode("", true)
|
|
3939
|
-
];
|
|
3940
|
-
}
|
|
3941
|
-
}),
|
|
3942
|
-
_: 2
|
|
3943
|
-
}, _parent));
|
|
3944
|
-
_push(`</li>`);
|
|
3945
|
-
});
|
|
3946
|
-
_push(`<!--]--></ul><div class="flex flex-wrap md:flex-nowrap justify-end items-center gap-4 text-2xl mx-auto md:mx-0 overflow-x-auto md:overflow-hidden"><!--[-->`);
|
|
3947
|
-
ssrRenderList(_ctx.$settings.payment_methods, (paymentMethod) => {
|
|
3948
|
-
_push(ssrRenderComponent($setup["PaymentMethodFlag"], {
|
|
3949
|
-
key: paymentMethod,
|
|
3950
|
-
flag: paymentMethod
|
|
3951
|
-
}, null, _parent));
|
|
3952
|
-
});
|
|
3953
|
-
_push(`<!--]--></div></div><div class="mt-7 text-xs text-center md:text-left md:flex justify-between gap-4"><div class="mb-3 md:mb-0"> @ ${ssrInterpolate(( new Date()).getFullYear())} ${ssrInterpolate(_ctx.$settings.corporate_name)} ${ssrInterpolate(_ctx.$settings.address ? `/ ${_ctx.$settings.address}` : "")} / ${ssrInterpolate(_ctx.$settings.doc_number)}</div>`);
|
|
3954
|
-
_push(ssrRenderComponent(_component_ALink, {
|
|
3955
|
-
href: "https://www.ecomplus.io/",
|
|
3956
|
-
class: "italic text-[#37003c]"
|
|
3957
|
-
}, {
|
|
3958
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
3959
|
-
if (_push2) {
|
|
3960
|
-
_push2(` powered by <b${_scopeId}>E-Com Plus</b>`);
|
|
3961
|
-
} else {
|
|
3962
|
-
return [
|
|
3963
|
-
createTextVNode(" powered by "),
|
|
3964
|
-
createVNode("b", null, "E-Com Plus")
|
|
3965
|
-
];
|
|
3966
|
-
}
|
|
3967
|
-
}),
|
|
3968
|
-
_: 1
|
|
3969
|
-
}, _parent));
|
|
3970
|
-
_push(`</div></div></footer>`);
|
|
3823
|
+
_push(`</div></div>`);
|
|
3824
|
+
_push(ssrRenderComponent($setup["FooterStamps"], { stamps: $props.stamps }, null, _parent));
|
|
3825
|
+
_push(`</footer>`);
|
|
3971
3826
|
}
|
|
3972
|
-
const _sfc_setup$
|
|
3973
|
-
_sfc_main$
|
|
3827
|
+
const _sfc_setup$e = _sfc_main$e.setup;
|
|
3828
|
+
_sfc_main$e.setup = (props, ctx) => {
|
|
3974
3829
|
const ssrContext = useSSRContext();
|
|
3975
3830
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopFooter.vue");
|
|
3976
|
-
return _sfc_setup$
|
|
3831
|
+
return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
|
|
3977
3832
|
};
|
|
3978
|
-
const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3833
|
+
const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
|
|
3979
3834
|
|
|
3980
|
-
const $$Astro$
|
|
3835
|
+
const $$Astro$7 = createAstro("https://demo.ecomplus.app");
|
|
3981
3836
|
const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
3982
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
3837
|
+
const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
|
|
3983
3838
|
Astro2.self = $$PageFooter;
|
|
3984
3839
|
const { routeContext } = Astro2.locals;
|
|
3985
3840
|
const { settings, getContent, isHomepage } = routeContext;
|
|
@@ -3988,13 +3843,13 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3988
3843
|
const {
|
|
3989
3844
|
footer: {
|
|
3990
3845
|
stamps,
|
|
3991
|
-
|
|
3992
|
-
|
|
3846
|
+
categoriesList,
|
|
3847
|
+
pagesList
|
|
3993
3848
|
}
|
|
3994
3849
|
} = layoutContent;
|
|
3995
3850
|
let mainCategories;
|
|
3996
3851
|
let pageLinks;
|
|
3997
|
-
if (categoriesList?.
|
|
3852
|
+
if (categoriesList?.isActive) {
|
|
3998
3853
|
if (categoriesList.categories?.length) {
|
|
3999
3854
|
mainCategories = categoriesList.categories;
|
|
4000
3855
|
} else {
|
|
@@ -4004,7 +3859,7 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4004
3859
|
}
|
|
4005
3860
|
}
|
|
4006
3861
|
}
|
|
4007
|
-
if (pagesList?.
|
|
3862
|
+
if (pagesList?.isActive) {
|
|
4008
3863
|
if (pagesList.links?.length) {
|
|
4009
3864
|
pageLinks = pagesList.links;
|
|
4010
3865
|
} else {
|
|
@@ -4018,7 +3873,7 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
4018
3873
|
}
|
|
4019
3874
|
}
|
|
4020
3875
|
}
|
|
4021
|
-
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
|
|
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` ${maybeRenderHead()}<a href="/"> ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate` ${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "loading": "lazy", "class": "max-w-[150px]" })} ` })} </a> ` })}` })}`;
|
|
4022
3877
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageFooter.astro", void 0);
|
|
4023
3878
|
|
|
4024
3879
|
const useProductShelf = (props) => {
|
|
@@ -4093,25 +3948,15 @@ const now = Date.now();
|
|
|
4093
3948
|
const parseBanners = (banners) => {
|
|
4094
3949
|
const validBanners = [];
|
|
4095
3950
|
banners.forEach(({
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
mobile_img: mobileImg,
|
|
4100
|
-
button_link: buttonLink,
|
|
4101
|
-
button_text: buttonText,
|
|
4102
|
-
...rest
|
|
3951
|
+
startsAt,
|
|
3952
|
+
endsAt,
|
|
3953
|
+
...bannerProps
|
|
4103
3954
|
}) => {
|
|
4104
|
-
if (
|
|
3955
|
+
if (startsAt && new Date(startsAt).getTime() < now)
|
|
4105
3956
|
return;
|
|
4106
|
-
if (
|
|
3957
|
+
if (endsAt && new Date(endsAt).getTime() > now)
|
|
4107
3958
|
return;
|
|
4108
|
-
validBanners.push(
|
|
4109
|
-
...rest,
|
|
4110
|
-
img,
|
|
4111
|
-
mobileImg,
|
|
4112
|
-
buttonLink,
|
|
4113
|
-
buttonText
|
|
4114
|
-
});
|
|
3959
|
+
validBanners.push(bannerProps);
|
|
4115
3960
|
});
|
|
4116
3961
|
return validBanners;
|
|
4117
3962
|
};
|
|
@@ -4134,9 +3979,9 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4134
3979
|
await Promise.all(sectionsContent.map(async ({ type, ...sectionContent }, index) => {
|
|
4135
3980
|
if (type === "product-shelf") {
|
|
4136
3981
|
const {
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
3982
|
+
collectionIdAndInfo,
|
|
3983
|
+
isHeadless,
|
|
3984
|
+
isShuffle,
|
|
4140
3985
|
...rest
|
|
4141
3986
|
} = sectionContent;
|
|
4142
3987
|
let { sort, title } = sectionContent;
|
|
@@ -4183,16 +4028,7 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4183
4028
|
await fetching;
|
|
4184
4029
|
sections[index] = {
|
|
4185
4030
|
type,
|
|
4186
|
-
props: {
|
|
4187
|
-
...rest,
|
|
4188
|
-
collectionId,
|
|
4189
|
-
searchQuery,
|
|
4190
|
-
sort,
|
|
4191
|
-
title: isHeadless ? null : title,
|
|
4192
|
-
titleLink,
|
|
4193
|
-
isShuffle,
|
|
4194
|
-
products
|
|
4195
|
-
}
|
|
4031
|
+
props: { ...props, products }
|
|
4196
4032
|
};
|
|
4197
4033
|
return;
|
|
4198
4034
|
}
|
|
@@ -4213,7 +4049,7 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4213
4049
|
case "product-specifications":
|
|
4214
4050
|
sections[index] = {
|
|
4215
4051
|
type,
|
|
4216
|
-
props:
|
|
4052
|
+
props: sectionContent
|
|
4217
4053
|
};
|
|
4218
4054
|
return;
|
|
4219
4055
|
}
|
|
@@ -4231,9 +4067,9 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
|
|
|
4231
4067
|
};
|
|
4232
4068
|
};
|
|
4233
4069
|
|
|
4234
|
-
const $$Astro$
|
|
4070
|
+
const $$Astro$6 = createAstro("https://demo.ecomplus.app");
|
|
4235
4071
|
const $$BannerPictures = createComponent(async ($$result, $$props, $$slots) => {
|
|
4236
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
4072
|
+
const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
|
|
4237
4073
|
Astro2.self = $$BannerPictures;
|
|
4238
4074
|
const {
|
|
4239
4075
|
img,
|
|
@@ -4285,7 +4121,7 @@ const useBanner = (props) => {
|
|
|
4285
4121
|
};
|
|
4286
4122
|
};
|
|
4287
4123
|
|
|
4288
|
-
const _sfc_main$
|
|
4124
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
4289
4125
|
__name: "Banner",
|
|
4290
4126
|
props: {
|
|
4291
4127
|
img: {},
|
|
@@ -4312,7 +4148,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
4312
4148
|
return __returned__;
|
|
4313
4149
|
}
|
|
4314
4150
|
});
|
|
4315
|
-
function _sfc_ssrRender$
|
|
4151
|
+
function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
4316
4152
|
const _component_ALink = resolveComponent("ALink");
|
|
4317
4153
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
4318
4154
|
class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
|
|
@@ -4333,7 +4169,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4333
4169
|
_: 3
|
|
4334
4170
|
}, _parent));
|
|
4335
4171
|
if ($setup.hasHeader) {
|
|
4336
|
-
_push(`<div class="p-12
|
|
4172
|
+
_push(`<div class="mb-3 p-12 sm:mb-0 xl:ps-32">`);
|
|
4337
4173
|
if ($setup.parsedTitle) {
|
|
4338
4174
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.headingTag), { class: "ui-title mt-1" }, {
|
|
4339
4175
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
@@ -4351,14 +4187,14 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4351
4187
|
_push(`<!---->`);
|
|
4352
4188
|
}
|
|
4353
4189
|
if ($setup.parsedSubtitle) {
|
|
4354
|
-
_push(`<p class="text-lg
|
|
4190
|
+
_push(`<p class="mt-4 text-lg md:mt-6">${ssrInterpolate($setup.parsedSubtitle)}</p>`);
|
|
4355
4191
|
} else {
|
|
4356
4192
|
_push(`<!---->`);
|
|
4357
4193
|
}
|
|
4358
4194
|
if ($setup.parsedButtonText) {
|
|
4359
4195
|
_push(ssrRenderComponent(_component_ALink, {
|
|
4360
4196
|
href: $props.buttonLink,
|
|
4361
|
-
class: "ui-btn-lg ui-btn-contrast min-w-[150px]
|
|
4197
|
+
class: "ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"
|
|
4362
4198
|
}, {
|
|
4363
4199
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
4364
4200
|
if (_push2) {
|
|
@@ -4380,22 +4216,66 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4380
4216
|
}
|
|
4381
4217
|
_push(`</div>`);
|
|
4382
4218
|
}
|
|
4383
|
-
const _sfc_setup$
|
|
4384
|
-
_sfc_main$
|
|
4219
|
+
const _sfc_setup$d = _sfc_main$d.setup;
|
|
4220
|
+
_sfc_main$d.setup = (props, ctx) => {
|
|
4385
4221
|
const ssrContext = useSSRContext();
|
|
4386
4222
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
|
|
4387
|
-
return _sfc_setup$
|
|
4223
|
+
return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
|
|
4388
4224
|
};
|
|
4389
|
-
const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4225
|
+
const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
|
|
4390
4226
|
|
|
4391
|
-
const $$Astro$
|
|
4227
|
+
const $$Astro$5 = createAstro("https://demo.ecomplus.app");
|
|
4392
4228
|
const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
|
|
4393
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
4229
|
+
const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
|
|
4394
4230
|
Astro2.self = $$BannersGrid;
|
|
4395
4231
|
const { banners } = Astro2.props;
|
|
4396
|
-
return renderTemplate`${maybeRenderHead()}<section class="ui-section"
|
|
4232
|
+
return renderTemplate`${maybeRenderHead()}<section class="ui-section"> <ul class="flex flex-wrap lg:flex-nowrap gap-4"> ${banners.map((banner) => renderTemplate`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover"> ${renderComponent($$result, "Banner", Banner, { ...banner }, { "picture": ($$result2) => renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { ...banner, "slot": "picture" })}` })} </li>`)} </ul> </section>`;
|
|
4397
4233
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro", void 0);
|
|
4398
4234
|
|
|
4235
|
+
const emitGtagEvent = async (name, _params) => {
|
|
4236
|
+
return;
|
|
4237
|
+
};
|
|
4238
|
+
const getGtagItem = (product) => {
|
|
4239
|
+
const [name$1, ...variants] = name(product).split(" / ");
|
|
4240
|
+
const item = {
|
|
4241
|
+
item_name: name$1,
|
|
4242
|
+
item_id: product.sku,
|
|
4243
|
+
price: Math.round(price(product) * 100) / 100,
|
|
4244
|
+
// https://developers.google.com/analytics/devguides/collection/ga4/item-scoped-ecommerce#add_an_item-scoped_custom_parameter
|
|
4245
|
+
// @ts-ignore
|
|
4246
|
+
object_id: product._id
|
|
4247
|
+
};
|
|
4248
|
+
if (variants && variants.length) {
|
|
4249
|
+
item.item_variant = variants.join(" / ");
|
|
4250
|
+
} else if (product.variation_id) {
|
|
4251
|
+
item.item_name = name$1.replace(
|
|
4252
|
+
window.__customGTMVariantRegex || /\s[^\s]+$/,
|
|
4253
|
+
""
|
|
4254
|
+
);
|
|
4255
|
+
item.item_variant = name$1.replace(item.item_name, "").trim();
|
|
4256
|
+
}
|
|
4257
|
+
if (product.quantity === 0 || product.quantity && product.product_id) {
|
|
4258
|
+
item.quantity = product.quantity;
|
|
4259
|
+
}
|
|
4260
|
+
const { brands, categories } = product;
|
|
4261
|
+
if (brands?.length) {
|
|
4262
|
+
item.item_brand = brands[0].name;
|
|
4263
|
+
}
|
|
4264
|
+
if (categories?.length) {
|
|
4265
|
+
for (let i = 0; i < categories.length; i++) {
|
|
4266
|
+
const { name: categoryName } = categories[i];
|
|
4267
|
+
if (i === 0) {
|
|
4268
|
+
item.item_category = categoryName;
|
|
4269
|
+
} else {
|
|
4270
|
+
item[`item_category${i + 1}`] = categoryName;
|
|
4271
|
+
if (i === 4)
|
|
4272
|
+
break;
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
4276
|
+
return item;
|
|
4277
|
+
};
|
|
4278
|
+
|
|
4399
4279
|
const useProductCard = (props) => {
|
|
4400
4280
|
const isFetching = ref(false);
|
|
4401
4281
|
let fetching = null;
|
|
@@ -4459,6 +4339,14 @@ const useProductCard = (props) => {
|
|
|
4459
4339
|
return true;
|
|
4460
4340
|
return Boolean(product.variations?.length);
|
|
4461
4341
|
});
|
|
4342
|
+
emitGtagEvent("view_item", {
|
|
4343
|
+
value: isActive.value ? product.price : 0,
|
|
4344
|
+
items: [{
|
|
4345
|
+
...getGtagItem(product),
|
|
4346
|
+
item_list_name: props.listName,
|
|
4347
|
+
item_list_id: props.listId || props.listName && slugify(props.listName)
|
|
4348
|
+
}]
|
|
4349
|
+
});
|
|
4462
4350
|
return {
|
|
4463
4351
|
isFetching,
|
|
4464
4352
|
fetching,
|
|
@@ -4623,7 +4511,7 @@ const usePrices = (props) => {
|
|
|
4623
4511
|
};
|
|
4624
4512
|
};
|
|
4625
4513
|
|
|
4626
|
-
const _sfc_main$
|
|
4514
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
4627
4515
|
__name: "Prices",
|
|
4628
4516
|
props: {
|
|
4629
4517
|
isBig: { type: Boolean },
|
|
@@ -4658,10 +4546,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4658
4546
|
return __returned__;
|
|
4659
4547
|
}
|
|
4660
4548
|
});
|
|
4661
|
-
function _sfc_ssrRender$
|
|
4549
|
+
function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
4662
4550
|
const _component_Fade = resolveComponent("Fade");
|
|
4663
4551
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
4664
|
-
class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:[font-size:92%]
|
|
4552
|
+
class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]", $props.isBig ? "text-lg" : null]
|
|
4665
4553
|
}, _attrs))}>`);
|
|
4666
4554
|
if ($setup.comparePrice) {
|
|
4667
4555
|
_push(`<span class="text-base-500 mr-1 text-[87%]">`);
|
|
@@ -4680,7 +4568,7 @@ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4680
4568
|
} else {
|
|
4681
4569
|
_push(`<!---->`);
|
|
4682
4570
|
}
|
|
4683
|
-
_push(`<strong class="${ssrRenderClass([$props.isBig ? "text-
|
|
4571
|
+
_push(`<strong class="${ssrRenderClass([$props.isBig ? "text-4xl block" : "inline-block", "text-base-800"])}">`);
|
|
4684
4572
|
if ($setup.hasVariedPrices) {
|
|
4685
4573
|
_push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
|
|
4686
4574
|
} else {
|
|
@@ -4788,19 +4676,21 @@ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4788
4676
|
}, _parent));
|
|
4789
4677
|
_push(`</div>`);
|
|
4790
4678
|
}
|
|
4791
|
-
const _sfc_setup$
|
|
4792
|
-
_sfc_main$
|
|
4679
|
+
const _sfc_setup$c = _sfc_main$c.setup;
|
|
4680
|
+
_sfc_main$c.setup = (props, ctx) => {
|
|
4793
4681
|
const ssrContext = useSSRContext();
|
|
4794
4682
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
|
|
4795
|
-
return _sfc_setup$
|
|
4683
|
+
return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
|
|
4796
4684
|
};
|
|
4797
|
-
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4685
|
+
const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
|
|
4798
4686
|
|
|
4799
|
-
const _sfc_main$
|
|
4687
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
4800
4688
|
__name: "ProductCard",
|
|
4801
4689
|
props: {
|
|
4802
4690
|
product: {},
|
|
4803
4691
|
productId: {},
|
|
4692
|
+
listName: {},
|
|
4693
|
+
listId: {},
|
|
4804
4694
|
headingTag: { default: "h3" }
|
|
4805
4695
|
},
|
|
4806
4696
|
setup(__props, { expose: __expose }) {
|
|
@@ -4829,40 +4719,40 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4829
4719
|
return __returned__;
|
|
4830
4720
|
}
|
|
4831
4721
|
});
|
|
4832
|
-
function _sfc_ssrRender$
|
|
4722
|
+
function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
4833
4723
|
const _component_ALink = resolveComponent("ALink");
|
|
4834
4724
|
const _component_AImg = resolveComponent("AImg");
|
|
4835
4725
|
_push(`<article${ssrRenderAttrs(mergeProps({
|
|
4836
4726
|
ref: "card",
|
|
4837
4727
|
"data-sku": $setup.product.sku,
|
|
4838
|
-
class: "relative h-full max-w-[350px]
|
|
4728
|
+
class: "group relative mx-auto h-full max-w-[350px] py-3"
|
|
4839
4729
|
}, _attrs))}>`);
|
|
4840
4730
|
_push(ssrRenderComponent(_component_ALink, {
|
|
4841
4731
|
href: $setup.link,
|
|
4842
|
-
class: "flex flex-col
|
|
4732
|
+
class: "flex h-full flex-col overflow-hidden rounded ring-black/5 group-hover:shadow group-hover:ring-1"
|
|
4843
4733
|
}, {
|
|
4844
4734
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
4845
4735
|
if (_push2) {
|
|
4846
|
-
_push2(`<div class="aspect-square p-2 motion-safe:group-hover:scale-110
|
|
4736
|
+
_push2(`<div class="aspect-square p-2 transition-transform motion-safe:group-hover:scale-110"${_scopeId}><div class="relative h-full w-full overflow-hidden rounded bg-white group-hover:rounded-none"${_scopeId}>`);
|
|
4847
4737
|
if ($setup.images?.length) {
|
|
4848
4738
|
_push2(`<span class="text-xs text-opacity-70"${_scopeId}>`);
|
|
4849
4739
|
_push2(ssrRenderComponent(_component_AImg, {
|
|
4850
4740
|
picture: $setup.images[0],
|
|
4851
4741
|
alt: $setup.title,
|
|
4852
|
-
class: "absolute
|
|
4742
|
+
class: "absolute left-0 top-0 block h-full w-full object-cover"
|
|
4853
4743
|
}, null, _parent2, _scopeId));
|
|
4854
4744
|
if ($setup.images[1] && $setup.wasHoveredOnce) {
|
|
4855
4745
|
_push2(ssrRenderComponent(_component_AImg, {
|
|
4856
4746
|
picture: $setup.images[1],
|
|
4857
4747
|
alt: $setup.title,
|
|
4858
|
-
class: "absolute
|
|
4748
|
+
class: "absolute left-0 top-0 z-10 block h-full w-full object-cover text-transparent opacity-0 transition-opacity group-hover:opacity-100 motion-safe:duration-300"
|
|
4859
4749
|
}, null, _parent2, _scopeId));
|
|
4860
4750
|
} else {
|
|
4861
4751
|
_push2(`<!---->`);
|
|
4862
4752
|
}
|
|
4863
4753
|
_push2(`</span>`);
|
|
4864
4754
|
} else {
|
|
4865
|
-
_push2(`<div class="
|
|
4755
|
+
_push2(`<div class="from-base-50/20 to-base-100 h-full w-full bg-gradient-to-br"${_scopeId}></div>`);
|
|
4866
4756
|
}
|
|
4867
4757
|
_push2(`</div></div>`);
|
|
4868
4758
|
if ($setup.discountPercentage) {
|
|
@@ -4870,11 +4760,11 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4870
4760
|
} else {
|
|
4871
4761
|
_push2(`<!---->`);
|
|
4872
4762
|
}
|
|
4873
|
-
_push2(`<div class="relative flex flex-col
|
|
4763
|
+
_push2(`<div class="relative z-10 flex grow flex-col justify-between bg-white/40 p-4 group-hover:backdrop-blur-md"${_scopeId}>`);
|
|
4874
4764
|
ssrRenderVNode(_push2, createVNode(resolveDynamicComponent($props.headingTag), {
|
|
4875
|
-
class: ["ui-link
|
|
4765
|
+
class: ["ui-link line-clamp-2 no-underline", [
|
|
4876
4766
|
$setup.isActive ? "text-base-700" : "text-base-500",
|
|
4877
|
-
$setup.link ? "group-hover:
|
|
4767
|
+
$setup.link ? "group-hover:text-primary group-hover:underline" : null
|
|
4878
4768
|
]]
|
|
4879
4769
|
}, {
|
|
4880
4770
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
@@ -4898,15 +4788,15 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4898
4788
|
}
|
|
4899
4789
|
_push2(`</div>`);
|
|
4900
4790
|
if ($setup.isActive && !$setup.hasVariations) {
|
|
4901
|
-
_push2(`<button class="uno-3suct9 ui-btn-sm ui-btn-primary"${_scopeId}><span class="inline-block h-4 w-4
|
|
4791
|
+
_push2(`<button class="uno-3suct9 ui-btn-sm ui-btn-primary"${_scopeId}><span class="bg-on-primary text-primary mr-1 inline-block h-4 w-4 rounded-full text-center text-base leading-none opacity-80"${_scopeId}> + </span> ${ssrInterpolate("Adicionar ao carrinho")}</button>`);
|
|
4902
4792
|
} else {
|
|
4903
4793
|
_push2(`<!---->`);
|
|
4904
4794
|
}
|
|
4905
4795
|
_push2(`</div>`);
|
|
4906
4796
|
} else {
|
|
4907
4797
|
return [
|
|
4908
|
-
createVNode("div", { class: "aspect-square p-2 motion-safe:group-hover:scale-110
|
|
4909
|
-
createVNode("div", { class: "relative
|
|
4798
|
+
createVNode("div", { class: "aspect-square p-2 transition-transform motion-safe:group-hover:scale-110" }, [
|
|
4799
|
+
createVNode("div", { class: "relative h-full w-full overflow-hidden rounded bg-white group-hover:rounded-none" }, [
|
|
4910
4800
|
$setup.images?.length ? (openBlock(), createBlock("span", {
|
|
4911
4801
|
key: 0,
|
|
4912
4802
|
class: "text-xs text-opacity-70"
|
|
@@ -4914,17 +4804,17 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4914
4804
|
createVNode(_component_AImg, {
|
|
4915
4805
|
picture: $setup.images[0],
|
|
4916
4806
|
alt: $setup.title,
|
|
4917
|
-
class: "absolute
|
|
4807
|
+
class: "absolute left-0 top-0 block h-full w-full object-cover"
|
|
4918
4808
|
}, null, 8, ["picture", "alt"]),
|
|
4919
4809
|
$setup.images[1] && $setup.wasHoveredOnce ? (openBlock(), createBlock(_component_AImg, {
|
|
4920
4810
|
key: 0,
|
|
4921
4811
|
picture: $setup.images[1],
|
|
4922
4812
|
alt: $setup.title,
|
|
4923
|
-
class: "absolute
|
|
4813
|
+
class: "absolute left-0 top-0 z-10 block h-full w-full object-cover text-transparent opacity-0 transition-opacity group-hover:opacity-100 motion-safe:duration-300"
|
|
4924
4814
|
}, null, 8, ["picture", "alt"])) : createCommentVNode("", true)
|
|
4925
4815
|
])) : (openBlock(), createBlock("div", {
|
|
4926
4816
|
key: 1,
|
|
4927
|
-
class: "
|
|
4817
|
+
class: "from-base-50/20 to-base-100 h-full w-full bg-gradient-to-br"
|
|
4928
4818
|
}))
|
|
4929
4819
|
])
|
|
4930
4820
|
]),
|
|
@@ -4936,11 +4826,11 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4936
4826
|
createVNode("strong", null, toDisplayString($setup.discountPercentage), 1),
|
|
4937
4827
|
createTextVNode("% ")
|
|
4938
4828
|
])) : createCommentVNode("", true),
|
|
4939
|
-
createVNode("div", { class: "relative flex flex-col
|
|
4829
|
+
createVNode("div", { class: "relative z-10 flex grow flex-col justify-between bg-white/40 p-4 group-hover:backdrop-blur-md" }, [
|
|
4940
4830
|
(openBlock(), createBlock(resolveDynamicComponent($props.headingTag), {
|
|
4941
|
-
class: ["ui-link
|
|
4831
|
+
class: ["ui-link line-clamp-2 no-underline", [
|
|
4942
4832
|
$setup.isActive ? "text-base-700" : "text-base-500",
|
|
4943
|
-
$setup.link ? "group-hover:
|
|
4833
|
+
$setup.link ? "group-hover:text-primary group-hover:underline" : null
|
|
4944
4834
|
]]
|
|
4945
4835
|
}, {
|
|
4946
4836
|
default: withCtx(() => [
|
|
@@ -4961,7 +4851,7 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4961
4851
|
class: "uno-3suct9 ui-btn-sm ui-btn-primary",
|
|
4962
4852
|
onClick: withModifiers(($event) => $setup.addProductToCart($setup.product), ["prevent"])
|
|
4963
4853
|
}, [
|
|
4964
|
-
createVNode("span", { class: "inline-block h-4 w-4
|
|
4854
|
+
createVNode("span", { class: "bg-on-primary text-primary mr-1 inline-block h-4 w-4 rounded-full text-center text-base leading-none opacity-80" }, " + "),
|
|
4965
4855
|
createTextVNode(" " + toDisplayString("Adicionar ao carrinho"))
|
|
4966
4856
|
], 8, ["onClick"])) : createCommentVNode("", true)
|
|
4967
4857
|
])
|
|
@@ -4972,15 +4862,15 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
4972
4862
|
}, _parent));
|
|
4973
4863
|
_push(`</article>`);
|
|
4974
4864
|
}
|
|
4975
|
-
const _sfc_setup$
|
|
4976
|
-
_sfc_main$
|
|
4865
|
+
const _sfc_setup$b = _sfc_main$b.setup;
|
|
4866
|
+
_sfc_main$b.setup = (props, ctx) => {
|
|
4977
4867
|
const ssrContext = useSSRContext();
|
|
4978
4868
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductCard.vue");
|
|
4979
|
-
return _sfc_setup$
|
|
4869
|
+
return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
|
|
4980
4870
|
};
|
|
4981
|
-
const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4871
|
+
const ProductCard = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
|
|
4982
4872
|
|
|
4983
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4873
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
4984
4874
|
__name: "ProductShelf",
|
|
4985
4875
|
props: {
|
|
4986
4876
|
collectionId: {},
|
|
@@ -5006,16 +4896,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5006
4896
|
{
|
|
5007
4897
|
[__temp, __restore] = withAsyncContext(() => fetching), await __temp, __restore();
|
|
5008
4898
|
}
|
|
5009
|
-
const
|
|
4899
|
+
const listName = title.value || `Shelf ${useId()}`;
|
|
4900
|
+
const __returned__ = { props, title, titleLink, fetching, products, listName, ProductCard };
|
|
5010
4901
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5011
4902
|
return __returned__;
|
|
5012
4903
|
}
|
|
5013
4904
|
});
|
|
5014
|
-
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
4905
|
+
function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5015
4906
|
const _component_ALink = resolveComponent("ALink");
|
|
4907
|
+
const _component_Carousel = resolveComponent("Carousel");
|
|
4908
|
+
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
5016
4909
|
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
5017
4910
|
if ($setup.title) {
|
|
5018
|
-
_push(`<div class="max-w-prose
|
|
4911
|
+
_push(`<div class="mx-auto mb-2 max-w-prose text-center"><h2 class="ui-text-brand text-3xl">`);
|
|
5019
4912
|
_push(ssrRenderComponent(_component_ALink, {
|
|
5020
4913
|
href: $setup.titleLink,
|
|
5021
4914
|
class: $setup.titleLink ? "ui-link" : "text-base-700"
|
|
@@ -5035,24 +4928,24 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
5035
4928
|
} else {
|
|
5036
4929
|
_push(`<!---->`);
|
|
5037
4930
|
}
|
|
5038
|
-
_push(ssrRenderComponent(
|
|
4931
|
+
_push(ssrRenderComponent(_component_Carousel, { class: "group/shelf" }, {
|
|
5039
4932
|
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5040
4933
|
if (_push2) {
|
|
5041
|
-
_push2(`<div style="${ssrRenderStyle($setup.products.length > 2 ? null : { display: "none" })}" class="text-
|
|
5042
|
-
_push2(ssrRenderComponent(
|
|
5043
|
-
class: "!top-1/2
|
|
4934
|
+
_push2(`<div style="${ssrRenderStyle($setup.products.length > 2 ? null : { display: "none" })}" class="text-primary text-3xl leading-none transition-opacity group-hover/shelf:opacity-90 lg:text-2xl lg:opacity-0"${_scopeId}>`);
|
|
4935
|
+
_push2(ssrRenderComponent(_component_CarouselControl, {
|
|
4936
|
+
class: "lg:hover:bg-primary-300/60 !-left-4 !top-1/2 h-12 w-12 rounded-full bg-transparent ring-black/5 lg:bg-white/80 lg:shadow-sm lg:ring-1",
|
|
5044
4937
|
"is-prev": ""
|
|
5045
4938
|
}, null, _parent2, _scopeId));
|
|
5046
|
-
_push2(ssrRenderComponent(
|
|
4939
|
+
_push2(ssrRenderComponent(_component_CarouselControl, { class: "lg:hover:bg-primary-300/60 !-right-4 !top-1/2 h-12 w-12 rounded-full bg-transparent ring-black/5 lg:bg-white/80 lg:shadow-sm lg:ring-1" }, null, _parent2, _scopeId));
|
|
5047
4940
|
_push2(`</div>`);
|
|
5048
4941
|
} else {
|
|
5049
4942
|
return [
|
|
5050
|
-
withDirectives(createVNode("div", { class: "text-
|
|
5051
|
-
createVNode(
|
|
5052
|
-
class: "!top-1/2
|
|
4943
|
+
withDirectives(createVNode("div", { class: "text-primary text-3xl leading-none transition-opacity group-hover/shelf:opacity-90 lg:text-2xl lg:opacity-0" }, [
|
|
4944
|
+
createVNode(_component_CarouselControl, {
|
|
4945
|
+
class: "lg:hover:bg-primary-300/60 !-left-4 !top-1/2 h-12 w-12 rounded-full bg-transparent ring-black/5 lg:bg-white/80 lg:shadow-sm lg:ring-1",
|
|
5053
4946
|
"is-prev": ""
|
|
5054
4947
|
}),
|
|
5055
|
-
createVNode(
|
|
4948
|
+
createVNode(_component_CarouselControl, { class: "lg:hover:bg-primary-300/60 !-right-4 !top-1/2 h-12 w-12 rounded-full bg-transparent ring-black/5 lg:bg-white/80 lg:shadow-sm lg:ring-1" })
|
|
5056
4949
|
], 512), [
|
|
5057
4950
|
[vShow, $setup.products.length > 2]
|
|
5058
4951
|
])
|
|
@@ -5063,8 +4956,11 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
5063
4956
|
if (_push2) {
|
|
5064
4957
|
_push2(`<!--[-->`);
|
|
5065
4958
|
ssrRenderList($setup.products, (product) => {
|
|
5066
|
-
_push2(`<li class="basis-1/2 md:basis-1/3 lg:basis-1/4
|
|
5067
|
-
_push2(ssrRenderComponent($setup["ProductCard"], {
|
|
4959
|
+
_push2(`<li class="shrink-0 basis-1/2 md:basis-1/3 lg:basis-1/4"${_scopeId}>`);
|
|
4960
|
+
_push2(ssrRenderComponent($setup["ProductCard"], {
|
|
4961
|
+
product,
|
|
4962
|
+
"list-name": $setup.listName
|
|
4963
|
+
}, null, _parent2, _scopeId));
|
|
5068
4964
|
_push2(`</li>`);
|
|
5069
4965
|
});
|
|
5070
4966
|
_push2(`<!--]-->`);
|
|
@@ -5073,9 +4969,12 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
5073
4969
|
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.products, (product) => {
|
|
5074
4970
|
return openBlock(), createBlock("li", {
|
|
5075
4971
|
key: product._id,
|
|
5076
|
-
class: "basis-1/2 md:basis-1/3 lg:basis-1/4
|
|
4972
|
+
class: "shrink-0 basis-1/2 md:basis-1/3 lg:basis-1/4"
|
|
5077
4973
|
}, [
|
|
5078
|
-
createVNode($setup["ProductCard"], {
|
|
4974
|
+
createVNode($setup["ProductCard"], {
|
|
4975
|
+
product,
|
|
4976
|
+
"list-name": $setup.listName
|
|
4977
|
+
}, null, 8, ["product", "list-name"])
|
|
5079
4978
|
]);
|
|
5080
4979
|
}), 128))
|
|
5081
4980
|
];
|
|
@@ -5085,13 +4984,13 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
|
|
|
5085
4984
|
}, _parent));
|
|
5086
4985
|
_push(`</section>`);
|
|
5087
4986
|
}
|
|
5088
|
-
const _sfc_setup = _sfc_main.setup;
|
|
5089
|
-
_sfc_main.setup = (props, ctx) => {
|
|
4987
|
+
const _sfc_setup$a = _sfc_main$a.setup;
|
|
4988
|
+
_sfc_main$a.setup = (props, ctx) => {
|
|
5090
4989
|
const ssrContext = useSSRContext();
|
|
5091
4990
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductShelf.vue");
|
|
5092
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
4991
|
+
return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
|
|
5093
4992
|
};
|
|
5094
|
-
const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
4993
|
+
const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
|
|
5095
4994
|
|
|
5096
4995
|
const useBreadcrumbs = async (props = {}) => {
|
|
5097
4996
|
const { settings, apiContext, data } = globalThis.$storefront;
|
|
@@ -5153,82 +5052,1014 @@ const useBreadcrumbs = async (props = {}) => {
|
|
|
5153
5052
|
};
|
|
5154
5053
|
};
|
|
5155
5054
|
|
|
5156
|
-
var __freeze = Object.freeze;
|
|
5157
|
-
var __defProp = Object.defineProperty;
|
|
5158
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
5159
|
-
var _a;
|
|
5160
|
-
const $$Astro$
|
|
5055
|
+
var __freeze$1 = Object.freeze;
|
|
5056
|
+
var __defProp$1 = Object.defineProperty;
|
|
5057
|
+
var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
|
|
5058
|
+
var _a$1;
|
|
5059
|
+
const $$Astro$4 = createAstro("https://demo.ecomplus.app");
|
|
5161
5060
|
const $$Breadcrumbs = createComponent(async ($$result, $$props, $$slots) => {
|
|
5162
|
-
const Astro2 = $$result.createAstro($$Astro$
|
|
5061
|
+
const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
|
|
5163
5062
|
Astro2.self = $$Breadcrumbs;
|
|
5164
5063
|
const { breadcrumbs, inlineJSONLd } = await useBreadcrumbs(Astro2.props);
|
|
5165
|
-
return renderTemplate`${breadcrumbs.length > 0 && renderTemplate`${maybeRenderHead()}<section
|
|
5064
|
+
return renderTemplate`${breadcrumbs.length > 0 && renderTemplate`${maybeRenderHead()}<section${addAttribute(`ui-section-slim ${breadcrumbs.length > 1 ? "" : "hidden lg:block"}`, "class")}><nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm"><ol class="flex items-center gap-1 text-base-600"><li><a href="/" class="hover:text-primary"><span class="sr-only"> Home </span><i class="i-home"></i></a></li>${breadcrumbs.map(
|
|
5166
5065
|
({ name, link }, i) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${i + 1 < breadcrumbs.length ? renderTemplate`<li class="text-base-300"><i class="i-chevron-right"></i></li><li class="whitespace-nowrap"><a${addAttribute(link, "href")} class="hover:text-primary">${name}</a></li>` : renderTemplate`<li class="hidden lg:block text-base-300"><i class="i-chevron-right"></i></li><li class="hidden lg:block whitespace-nowrap overflow-hidden text-ellipsis"><span class="text-base-500">${name}</span></li>`}` })}`
|
|
5167
|
-
)}</ol></nav>${inlineJSONLd && renderTemplate(_a || (_a = __template(['<script type="application/ld+json">', "<\/script>"])), unescapeHTML(inlineJSONLd))}</section>`}`;
|
|
5066
|
+
)}</ol></nav>${inlineJSONLd && renderTemplate(_a$1 || (_a$1 = __template$1(['<script type="application/ld+json">', "<\/script>"])), unescapeHTML(inlineJSONLd))}</section>`}`;
|
|
5168
5067
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Breadcrumbs.astro", void 0);
|
|
5169
5068
|
|
|
5170
|
-
const
|
|
5069
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
5070
|
+
__name: "ContentClearfix",
|
|
5071
|
+
props: {
|
|
5072
|
+
html: {}
|
|
5073
|
+
},
|
|
5074
|
+
setup(__props, { expose: __expose }) {
|
|
5075
|
+
__expose();
|
|
5076
|
+
const { html } = __props;
|
|
5077
|
+
const parsedHTML = html.replace(/<(img|iframe) /g, '<$1 loading="lazy" ');
|
|
5078
|
+
const __returned__ = { parsedHTML };
|
|
5079
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5080
|
+
return __returned__;
|
|
5081
|
+
}
|
|
5082
|
+
});
|
|
5083
|
+
function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5084
|
+
_push(`<article${ssrRenderAttrs(mergeProps({ class: "prose !max-w-full overflow-x-auto" }, _attrs))}><div class="[&_iframe]:max-w-full [&_img]:max-w-full [&_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
|
|
5085
|
+
}
|
|
5086
|
+
const _sfc_setup$9 = _sfc_main$9.setup;
|
|
5087
|
+
_sfc_main$9.setup = (props, ctx) => {
|
|
5088
|
+
const ssrContext = useSSRContext();
|
|
5089
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
|
|
5090
|
+
return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
|
|
5091
|
+
};
|
|
5092
|
+
const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
|
|
5171
5093
|
|
|
5172
|
-
const
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5094
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
5095
|
+
__name: "Collapse",
|
|
5096
|
+
props: {
|
|
5097
|
+
title: {}
|
|
5098
|
+
},
|
|
5099
|
+
setup(__props, { expose: __expose }) {
|
|
5100
|
+
__expose();
|
|
5101
|
+
const __returned__ = {};
|
|
5102
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5103
|
+
return __returned__;
|
|
5104
|
+
}
|
|
5105
|
+
});
|
|
5106
|
+
function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5107
|
+
_push(`<details${ssrRenderAttrs(mergeProps({ class: "[&_i]:open:rotate-180" }, _attrs))}><summary role="button" class="text-base-700 hover:text-base-800 [&>i]:hover:text-primary my-4 list-none text-2xl font-medium lowercase md:my-5"><i class="i-chevron-down mr-1"></i><span>${ssrInterpolate($props.title)}</span></summary>`);
|
|
5108
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
5109
|
+
_push(`</details>`);
|
|
5110
|
+
}
|
|
5111
|
+
const _sfc_setup$8 = _sfc_main$8.setup;
|
|
5112
|
+
_sfc_main$8.setup = (props, ctx) => {
|
|
5113
|
+
const ssrContext = useSSRContext();
|
|
5114
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Collapse.vue");
|
|
5115
|
+
return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
|
|
5116
|
+
};
|
|
5117
|
+
const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
|
|
5180
5118
|
|
|
5181
|
-
const
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5119
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5120
|
+
__name: "DocDescription",
|
|
5121
|
+
props: {
|
|
5122
|
+
apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
|
|
5123
|
+
title: {}
|
|
5124
|
+
},
|
|
5125
|
+
setup(__props, { expose: __expose }) {
|
|
5126
|
+
__expose();
|
|
5127
|
+
const props = __props;
|
|
5128
|
+
const html = computed(() => props.apiDoc.body_html || props.apiDoc.body_text);
|
|
5129
|
+
const __returned__ = { props, html, ContentClearfix, Collapse };
|
|
5130
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5131
|
+
return __returned__;
|
|
5132
|
+
}
|
|
5133
|
+
});
|
|
5134
|
+
function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5135
|
+
if ($setup.html) {
|
|
5136
|
+
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
5137
|
+
_push(ssrRenderComponent($setup["Collapse"], {
|
|
5138
|
+
title: $props.title || "Descri\xE7\xE3o",
|
|
5139
|
+
open: ""
|
|
5140
|
+
}, {
|
|
5141
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5142
|
+
if (_push2) {
|
|
5143
|
+
_push2(ssrRenderComponent($setup["ContentClearfix"], { html: $setup.html }, null, _parent2, _scopeId));
|
|
5144
|
+
} else {
|
|
5145
|
+
return [
|
|
5146
|
+
createVNode($setup["ContentClearfix"], { html: $setup.html }, null, 8, ["html"])
|
|
5147
|
+
];
|
|
5148
|
+
}
|
|
5149
|
+
}),
|
|
5150
|
+
_: 1
|
|
5151
|
+
}, _parent));
|
|
5152
|
+
_push(`</section>`);
|
|
5153
|
+
} else {
|
|
5154
|
+
_push(`<!---->`);
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
5157
|
+
const _sfc_setup$7 = _sfc_main$7.setup;
|
|
5158
|
+
_sfc_main$7.setup = (props, ctx) => {
|
|
5159
|
+
const ssrContext = useSSRContext();
|
|
5160
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocDescription.vue");
|
|
5161
|
+
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
5162
|
+
};
|
|
5163
|
+
const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
|
|
5189
5164
|
|
|
5190
|
-
const
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5165
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5166
|
+
__name: "CheckoutLink",
|
|
5167
|
+
props: {
|
|
5168
|
+
to: { default: "cart" },
|
|
5169
|
+
cartUrl: { default: globalThis.$storefront?.settings.cartUrl || "/app/#/cart" },
|
|
5170
|
+
checkoutUrl: { default: globalThis.$storefront?.settings.checkoutUrl || "/app/#/checkout" },
|
|
5171
|
+
cartId: {},
|
|
5172
|
+
cartItem: {}
|
|
5173
|
+
},
|
|
5174
|
+
setup(__props, { expose: __expose }) {
|
|
5175
|
+
__expose();
|
|
5176
|
+
const props = __props;
|
|
5177
|
+
const href = computed(() => {
|
|
5178
|
+
let url = props.to === "cart" ? props.cartUrl : props.checkoutUrl;
|
|
5179
|
+
if (props.cartId) {
|
|
5180
|
+
url += `/${props.cartId}`;
|
|
5181
|
+
} else if (props.cartItem) {
|
|
5182
|
+
const params = {
|
|
5183
|
+
product_id: props.cartItem.product_id
|
|
5184
|
+
};
|
|
5185
|
+
const {
|
|
5186
|
+
variation_id: variationId,
|
|
5187
|
+
quantity,
|
|
5188
|
+
sku,
|
|
5189
|
+
customizations
|
|
5190
|
+
} = props.cartItem;
|
|
5191
|
+
if (variationId)
|
|
5192
|
+
params.variation_id = variationId;
|
|
5193
|
+
if (quantity)
|
|
5194
|
+
params.quantity = String(quantity);
|
|
5195
|
+
if (sku)
|
|
5196
|
+
params.sku = sku;
|
|
5197
|
+
if (customizations) {
|
|
5198
|
+
customizations.forEach(({ label, option, attachment }, i) => {
|
|
5199
|
+
const prefix = `customizations.${i}.`;
|
|
5200
|
+
if (label)
|
|
5201
|
+
params[prefix + "label"] = label;
|
|
5202
|
+
if (option) {
|
|
5203
|
+
if (option._id)
|
|
5204
|
+
params[prefix + "option._id"] = option._id;
|
|
5205
|
+
params[prefix + "option.text"] = option.text;
|
|
5206
|
+
}
|
|
5207
|
+
if (attachment)
|
|
5208
|
+
params[prefix + "attachment"] = attachment;
|
|
5209
|
+
});
|
|
5210
|
+
}
|
|
5211
|
+
url += "?" + new URLSearchParams(params).toString();
|
|
5212
|
+
}
|
|
5213
|
+
return url;
|
|
5214
|
+
});
|
|
5215
|
+
const __returned__ = { props, href };
|
|
5216
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5217
|
+
return __returned__;
|
|
5218
|
+
}
|
|
5219
|
+
});
|
|
5220
|
+
function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5221
|
+
_push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
|
|
5222
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
5223
|
+
_push(`</a>`);
|
|
5224
|
+
}
|
|
5225
|
+
const _sfc_setup$6 = _sfc_main$6.setup;
|
|
5226
|
+
_sfc_main$6.setup = (props, ctx) => {
|
|
5227
|
+
const ssrContext = useSSRContext();
|
|
5228
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
|
|
5229
|
+
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
5230
|
+
};
|
|
5231
|
+
const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
|
|
5232
|
+
|
|
5233
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
5234
|
+
__name: "QuantitySelectorControl",
|
|
5235
|
+
props: {
|
|
5236
|
+
isMinus: { type: Boolean }
|
|
5237
|
+
},
|
|
5238
|
+
setup(__props, { expose: __expose }) {
|
|
5239
|
+
__expose();
|
|
5240
|
+
const {
|
|
5241
|
+
value,
|
|
5242
|
+
isBoundMin,
|
|
5243
|
+
isBoundMax
|
|
5244
|
+
} = inject(quantitySelectorKey);
|
|
5245
|
+
const __returned__ = { value, isBoundMin, isBoundMax };
|
|
5246
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5247
|
+
return __returned__;
|
|
5248
|
+
}
|
|
5249
|
+
});
|
|
5250
|
+
function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5251
|
+
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
5252
|
+
type: "button",
|
|
5253
|
+
class: "leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 h-12 w-10 text-xl disabled:opacity-40",
|
|
5254
|
+
"data-quantity-selector-control": $props.isMinus ? "minus" : "plus",
|
|
5255
|
+
"aria-label": $props.isMinus ? "Menos" : "Mais",
|
|
5256
|
+
disabled: $props.isMinus ? $setup.isBoundMin : $setup.isBoundMax
|
|
5257
|
+
}, _attrs))}>`);
|
|
5258
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
5259
|
+
if ($props.isMinus) {
|
|
5260
|
+
_push(`<!--[-->\u2212<!--]-->`);
|
|
5261
|
+
} else {
|
|
5262
|
+
_push(`<!--[-->+<!--]-->`);
|
|
5263
|
+
}
|
|
5264
|
+
}, _push, _parent);
|
|
5265
|
+
_push(`</button>`);
|
|
5266
|
+
}
|
|
5267
|
+
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
5268
|
+
_sfc_main$5.setup = (props, ctx) => {
|
|
5269
|
+
const ssrContext = useSSRContext();
|
|
5270
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
|
|
5271
|
+
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
5272
|
+
};
|
|
5273
|
+
const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
|
|
5274
|
+
|
|
5275
|
+
const quantitySelectorKey = Symbol("quantitySelector");
|
|
5276
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
5277
|
+
__name: "QuantitySelector",
|
|
5278
|
+
props: {
|
|
5279
|
+
modelValue: { default: 1 },
|
|
5280
|
+
min: { default: 1 },
|
|
5281
|
+
max: {},
|
|
5282
|
+
step: {},
|
|
5283
|
+
disabled: { type: Boolean },
|
|
5284
|
+
readonly: { type: Boolean }
|
|
5285
|
+
},
|
|
5286
|
+
emits: ["update:modelValue"],
|
|
5287
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5288
|
+
__expose();
|
|
5289
|
+
const props = __props;
|
|
5290
|
+
const emit = __emit;
|
|
5291
|
+
const input = ref(null);
|
|
5292
|
+
const inputId = `NInput${useId()}`;
|
|
5293
|
+
const value = computed({
|
|
5294
|
+
get() {
|
|
5295
|
+
return props.modelValue;
|
|
5296
|
+
},
|
|
5297
|
+
set(_value) {
|
|
5298
|
+
if (_value < props.min) {
|
|
5299
|
+
_value = props.min;
|
|
5300
|
+
input.value.value = `${_value}`;
|
|
5301
|
+
}
|
|
5302
|
+
if (props.max && _value > props.max) {
|
|
5303
|
+
_value = props.max;
|
|
5304
|
+
input.value.value = `${_value}`;
|
|
5305
|
+
}
|
|
5306
|
+
emit("update:modelValue", _value);
|
|
5307
|
+
}
|
|
5308
|
+
});
|
|
5309
|
+
const isBoundMin = computed(() => {
|
|
5310
|
+
return props.min >= value.value;
|
|
5311
|
+
});
|
|
5312
|
+
const isBoundMax = computed(() => {
|
|
5313
|
+
return props.max <= value.value;
|
|
5314
|
+
});
|
|
5315
|
+
provide(quantitySelectorKey, {
|
|
5316
|
+
value,
|
|
5317
|
+
isBoundMin,
|
|
5318
|
+
isBoundMax
|
|
5319
|
+
});
|
|
5320
|
+
const __returned__ = { quantitySelectorKey, props, emit, input, inputId, value, isBoundMin, isBoundMax, QuantitySelectorControl };
|
|
5321
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5322
|
+
return __returned__;
|
|
5323
|
+
}
|
|
5324
|
+
});
|
|
5325
|
+
function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5326
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
|
|
5327
|
+
ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
|
|
5328
|
+
_push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
|
|
5329
|
+
}, _push, _parent);
|
|
5330
|
+
_push(`<div class="flex items-center"><input type="number"${ssrRenderAttr("id", $setup.inputId)}${ssrRenderAttr("value", $setup.value)}${ssrRenderAttr("min", $props.min)}${ssrRenderAttr("max", $props.max)}${ssrRenderAttr("step", $props.step)}${ssrIncludeBooleanAttr($props.disabled) ? " disabled" : ""}${ssrIncludeBooleanAttr($props.readonly) ? " readonly" : ""} class="h-12 w-14 border-transparent px-2 text-center text-lg [-moz-appearance:_textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none">`);
|
|
5331
|
+
ssrRenderSlot(_ctx.$slots, "controls", { value: $setup.value, isBoundMin: $setup.isBoundMin, isBoundMax: $setup.isBoundMax }, () => {
|
|
5332
|
+
_push(ssrRenderComponent($setup["QuantitySelectorControl"], {
|
|
5333
|
+
"is-minus": "",
|
|
5334
|
+
class: "order-first"
|
|
5335
|
+
}, {
|
|
5336
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5337
|
+
if (_push2) {
|
|
5338
|
+
ssrRenderSlot(_ctx.$slots, "minus", {}, null, _push2, _parent2, _scopeId);
|
|
5339
|
+
} else {
|
|
5340
|
+
return [
|
|
5341
|
+
renderSlot$1(_ctx.$slots, "minus")
|
|
5342
|
+
];
|
|
5343
|
+
}
|
|
5344
|
+
}),
|
|
5345
|
+
_: 3
|
|
5346
|
+
}, _parent));
|
|
5347
|
+
_push(ssrRenderComponent($setup["QuantitySelectorControl"], { class: "order-last" }, {
|
|
5348
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5349
|
+
if (_push2) {
|
|
5350
|
+
ssrRenderSlot(_ctx.$slots, "plus", {}, null, _push2, _parent2, _scopeId);
|
|
5351
|
+
} else {
|
|
5352
|
+
return [
|
|
5353
|
+
renderSlot$1(_ctx.$slots, "plus")
|
|
5354
|
+
];
|
|
5355
|
+
}
|
|
5356
|
+
}),
|
|
5357
|
+
_: 3
|
|
5358
|
+
}, _parent));
|
|
5359
|
+
}, _push, _parent);
|
|
5360
|
+
_push(`</div></div>`);
|
|
5361
|
+
}
|
|
5362
|
+
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
5363
|
+
_sfc_main$4.setup = (props, ctx) => {
|
|
5364
|
+
const ssrContext = useSSRContext();
|
|
5365
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
|
|
5366
|
+
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
5367
|
+
};
|
|
5368
|
+
const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
|
|
5369
|
+
|
|
5370
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
5371
|
+
__name: "ImagesGallery",
|
|
5372
|
+
props: {
|
|
5373
|
+
pictures: {}
|
|
5374
|
+
},
|
|
5375
|
+
setup(__props, { expose: __expose }) {
|
|
5376
|
+
__expose();
|
|
5377
|
+
const activeIndex = ref(0);
|
|
5378
|
+
const psId = ref("");
|
|
5379
|
+
let lightbox;
|
|
5380
|
+
const isLoadingLightbox = ref(false);
|
|
5381
|
+
const zoom = (index) => {
|
|
5382
|
+
psId.value = `ps-${useId()}`;
|
|
5383
|
+
if (!lightbox && !isLoadingLightbox.value) {
|
|
5384
|
+
isLoadingLightbox.value = true;
|
|
5385
|
+
const styleId = "photoswipe-style";
|
|
5386
|
+
Promise.all([
|
|
5387
|
+
// @ts-ignore
|
|
5388
|
+
import('photoswipe/lightbox'),
|
|
5389
|
+
import('photoswipe'),
|
|
5390
|
+
!document.getElementById(styleId) && import('../photoswipe_9528923e.mjs')
|
|
5391
|
+
]).then(([
|
|
5392
|
+
{ default: PhotoSwipeLightbox },
|
|
5393
|
+
{ default: pswpModule },
|
|
5394
|
+
cssImport
|
|
5395
|
+
]) => {
|
|
5396
|
+
if (cssImport) {
|
|
5397
|
+
const { default: css } = cssImport;
|
|
5398
|
+
const style = document.createElement("style");
|
|
5399
|
+
style.id = styleId;
|
|
5400
|
+
style.textContent = css;
|
|
5401
|
+
document.head.appendChild(style);
|
|
5402
|
+
}
|
|
5403
|
+
lightbox = new PhotoSwipeLightbox({
|
|
5404
|
+
gallery: `#${psId.value} > div`,
|
|
5405
|
+
children: "a",
|
|
5406
|
+
pswpModule,
|
|
5407
|
+
showAnimationDuration: 300,
|
|
5408
|
+
hideAnimationDuration: 300
|
|
5409
|
+
});
|
|
5410
|
+
lightbox.init();
|
|
5411
|
+
lightbox.loadAndOpen(index);
|
|
5412
|
+
isLoadingLightbox.value = false;
|
|
5413
|
+
});
|
|
5414
|
+
}
|
|
5415
|
+
};
|
|
5416
|
+
const __returned__ = { activeIndex, psId, get lightbox() {
|
|
5417
|
+
return lightbox;
|
|
5418
|
+
}, set lightbox(v) {
|
|
5419
|
+
lightbox = v;
|
|
5420
|
+
}, isLoadingLightbox, zoom, get getImgSizes() {
|
|
5421
|
+
return imgSizes;
|
|
5422
|
+
} };
|
|
5423
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5424
|
+
return __returned__;
|
|
5425
|
+
}
|
|
5426
|
+
});
|
|
5427
|
+
function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5428
|
+
const _component_Carousel = resolveComponent("Carousel");
|
|
5429
|
+
const _component_AImg = resolveComponent("AImg");
|
|
5430
|
+
const _component_CarouselControl = resolveComponent("CarouselControl");
|
|
5431
|
+
const _component_ALink = resolveComponent("ALink");
|
|
5432
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "-mx-4 flex w-screen gap-3 sm:mx-0 sm:w-full md:h-[525px] 2xl:gap-5" }, _attrs))}>`);
|
|
5433
|
+
if ($props.pictures.length > 1) {
|
|
5434
|
+
_push(ssrRenderComponent(_component_Carousel, {
|
|
5435
|
+
axis: "y",
|
|
5436
|
+
class: "group hidden w-[300px] shrink-0 md:block"
|
|
5437
|
+
}, {
|
|
5438
|
+
controls: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5439
|
+
if (_push2) {
|
|
5440
|
+
_push2(`<span${_scopeId}>`);
|
|
5441
|
+
if ($props.pictures.length > 6) {
|
|
5442
|
+
_push2(ssrRenderComponent(_component_CarouselControl, { class: "hover:bg-primary-300/60 text-primary !bottom-3 !left-1/2 -ml-5 h-10 w-10 rounded-full bg-white/60 text-xl opacity-0 shadow-sm ring-1 ring-black/5 group-hover:opacity-90" }, null, _parent2, _scopeId));
|
|
5443
|
+
} else {
|
|
5444
|
+
_push2(`<!---->`);
|
|
5445
|
+
}
|
|
5446
|
+
_push2(`<span class="absolute bottom-0 block h-2 w-full bg-gradient-to-b from-transparent to-white"${_scopeId}></span></span>`);
|
|
5447
|
+
} else {
|
|
5448
|
+
return [
|
|
5449
|
+
createVNode("span", null, [
|
|
5450
|
+
$props.pictures.length > 6 ? (openBlock(), createBlock(_component_CarouselControl, {
|
|
5451
|
+
key: 0,
|
|
5452
|
+
class: "hover:bg-primary-300/60 text-primary !bottom-3 !left-1/2 -ml-5 h-10 w-10 rounded-full bg-white/60 text-xl opacity-0 shadow-sm ring-1 ring-black/5 group-hover:opacity-90"
|
|
5453
|
+
})) : createCommentVNode("", true),
|
|
5454
|
+
createVNode("span", { class: "absolute bottom-0 block h-2 w-full bg-gradient-to-b from-transparent to-white" })
|
|
5455
|
+
])
|
|
5456
|
+
];
|
|
5457
|
+
}
|
|
5458
|
+
}),
|
|
5459
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5460
|
+
if (_push2) {
|
|
5461
|
+
_push2(`<!--[-->`);
|
|
5462
|
+
ssrRenderList(Math.ceil($props.pictures.length / 2), (i) => {
|
|
5463
|
+
_push2(`<li class="${ssrRenderClass([i === 1 && "pt-1", "grid h-1/3 w-full grid-cols-2 gap-3 px-1 pb-3"])}"${_scopeId}><!--[-->`);
|
|
5464
|
+
ssrRenderList([1, 2].map((ii) => (i - 1) * 2 + (ii - 1)), (index) => {
|
|
5465
|
+
_push2(`<!--[-->`);
|
|
5466
|
+
if (index < $props.pictures.length) {
|
|
5467
|
+
_push2(`<button class="bg-secondary-100 h-full rounded"${_scopeId}>`);
|
|
5468
|
+
_push2(ssrRenderComponent(_component_AImg, {
|
|
5469
|
+
picture: $props.pictures[index],
|
|
5470
|
+
class: ["ring-secondary/10 h-full w-full rounded border-2 object-cover opacity-90 transition-colors", index === $setup.activeIndex ? "border-secondary/50 ring-4 cursor-auto" : "border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"]
|
|
5471
|
+
}, null, _parent2, _scopeId));
|
|
5472
|
+
_push2(`</button>`);
|
|
5473
|
+
} else {
|
|
5474
|
+
_push2(`<!---->`);
|
|
5475
|
+
}
|
|
5476
|
+
_push2(`<!--]-->`);
|
|
5477
|
+
});
|
|
5478
|
+
_push2(`<!--]--></li>`);
|
|
5479
|
+
});
|
|
5480
|
+
_push2(`<!--]-->`);
|
|
5481
|
+
} else {
|
|
5482
|
+
return [
|
|
5483
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList(Math.ceil($props.pictures.length / 2), (i) => {
|
|
5484
|
+
return openBlock(), createBlock("li", {
|
|
5485
|
+
key: i,
|
|
5486
|
+
class: ["grid h-1/3 w-full grid-cols-2 gap-3 px-1 pb-3", i === 1 && "pt-1"]
|
|
5487
|
+
}, [
|
|
5488
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList([1, 2].map((ii) => (i - 1) * 2 + (ii - 1)), (index) => {
|
|
5489
|
+
return openBlock(), createBlock(Fragment$1, {
|
|
5490
|
+
key: `${i}-${index}`
|
|
5491
|
+
}, [
|
|
5492
|
+
index < $props.pictures.length ? (openBlock(), createBlock("button", {
|
|
5493
|
+
key: 0,
|
|
5494
|
+
class: "bg-secondary-100 h-full rounded",
|
|
5495
|
+
onClick: ($event) => $setup.activeIndex = index
|
|
5496
|
+
}, [
|
|
5497
|
+
createVNode(_component_AImg, {
|
|
5498
|
+
picture: $props.pictures[index],
|
|
5499
|
+
class: ["ring-secondary/10 h-full w-full rounded border-2 object-cover opacity-90 transition-colors", index === $setup.activeIndex ? "border-secondary/50 ring-4 cursor-auto" : "border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"]
|
|
5500
|
+
}, null, 8, ["picture", "class"])
|
|
5501
|
+
], 8, ["onClick"])) : createCommentVNode("", true)
|
|
5502
|
+
], 64);
|
|
5503
|
+
}), 128))
|
|
5504
|
+
], 2);
|
|
5505
|
+
}), 128))
|
|
5506
|
+
];
|
|
5507
|
+
}
|
|
5508
|
+
}),
|
|
5509
|
+
_: 1
|
|
5510
|
+
}, _parent));
|
|
5511
|
+
} else {
|
|
5512
|
+
_push(`<!---->`);
|
|
5513
|
+
}
|
|
5514
|
+
_push(`<div class="relative aspect-square h-full grow md:aspect-auto">`);
|
|
5515
|
+
_push(ssrRenderComponent(_component_Carousel, {
|
|
5516
|
+
as: "div",
|
|
5517
|
+
index: $setup.activeIndex,
|
|
5518
|
+
"onUpdate:index": ($event) => $setup.activeIndex = $event,
|
|
5519
|
+
class: ["text-base-600 [&_i]:i-arrow-right mx-auto h-full w-full max-w-[525px] [&>*]:h-full [&_i]:mx-2 [&_i]:text-2xl", $setup.isLoadingLightbox && "opacity-80"],
|
|
5520
|
+
id: $setup.psId
|
|
5521
|
+
}, {
|
|
5522
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5523
|
+
if (_push2) {
|
|
5524
|
+
_push2(`<!--[-->`);
|
|
5525
|
+
ssrRenderList($props.pictures, (picture, i) => {
|
|
5526
|
+
_push2(ssrRenderComponent(_component_ALink, {
|
|
5527
|
+
key: `big-${i}`,
|
|
5528
|
+
href: picture.zoom?.size && picture.zoom.url,
|
|
5529
|
+
"data-pswp-width": $setup.getImgSizes(picture.zoom || "").width,
|
|
5530
|
+
"data-pswp-height": $setup.getImgSizes(picture.zoom || "").height,
|
|
5531
|
+
target: "_blank",
|
|
5532
|
+
rel: "noreferrer",
|
|
5533
|
+
class: ["shrink-0 basis-full", picture.zoom?.size && "cursor-zoom-in"],
|
|
5534
|
+
onClick: () => picture.zoom?.size && $setup.zoom(i)
|
|
5535
|
+
}, {
|
|
5536
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
5537
|
+
if (_push3) {
|
|
5538
|
+
_push3(ssrRenderComponent(_component_AImg, {
|
|
5539
|
+
picture,
|
|
5540
|
+
"preferred-size": "big",
|
|
5541
|
+
class: "h-full w-full rounded object-cover",
|
|
5542
|
+
fetchpriority: i === 0 ? "high" : "low",
|
|
5543
|
+
loading: i === 0 ? "eager" : "lazy"
|
|
5544
|
+
}, null, _parent3, _scopeId2));
|
|
5545
|
+
} else {
|
|
5546
|
+
return [
|
|
5547
|
+
createVNode(_component_AImg, {
|
|
5548
|
+
picture,
|
|
5549
|
+
"preferred-size": "big",
|
|
5550
|
+
class: "h-full w-full rounded object-cover",
|
|
5551
|
+
fetchpriority: i === 0 ? "high" : "low",
|
|
5552
|
+
loading: i === 0 ? "eager" : "lazy"
|
|
5553
|
+
}, null, 8, ["picture", "fetchpriority", "loading"])
|
|
5554
|
+
];
|
|
5555
|
+
}
|
|
5556
|
+
}),
|
|
5557
|
+
_: 2
|
|
5558
|
+
}, _parent2, _scopeId));
|
|
5559
|
+
});
|
|
5560
|
+
_push2(`<!--]-->`);
|
|
5561
|
+
} else {
|
|
5562
|
+
return [
|
|
5563
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($props.pictures, (picture, i) => {
|
|
5564
|
+
return openBlock(), createBlock(_component_ALink, {
|
|
5565
|
+
key: `big-${i}`,
|
|
5566
|
+
href: picture.zoom?.size && picture.zoom.url,
|
|
5567
|
+
"data-pswp-width": $setup.getImgSizes(picture.zoom || "").width,
|
|
5568
|
+
"data-pswp-height": $setup.getImgSizes(picture.zoom || "").height,
|
|
5569
|
+
target: "_blank",
|
|
5570
|
+
rel: "noreferrer",
|
|
5571
|
+
class: ["shrink-0 basis-full", picture.zoom?.size && "cursor-zoom-in"],
|
|
5572
|
+
onClick: withModifiers(() => picture.zoom?.size && $setup.zoom(i), ["prevent"])
|
|
5573
|
+
}, {
|
|
5574
|
+
default: withCtx(() => [
|
|
5575
|
+
createVNode(_component_AImg, {
|
|
5576
|
+
picture,
|
|
5577
|
+
"preferred-size": "big",
|
|
5578
|
+
class: "h-full w-full rounded object-cover",
|
|
5579
|
+
fetchpriority: i === 0 ? "high" : "low",
|
|
5580
|
+
loading: i === 0 ? "eager" : "lazy"
|
|
5581
|
+
}, null, 8, ["picture", "fetchpriority", "loading"])
|
|
5582
|
+
]),
|
|
5583
|
+
_: 2
|
|
5584
|
+
}, 1032, ["href", "data-pswp-width", "data-pswp-height", "class", "onClick"]);
|
|
5585
|
+
}), 128))
|
|
5586
|
+
];
|
|
5587
|
+
}
|
|
5588
|
+
}),
|
|
5589
|
+
_: 1
|
|
5590
|
+
}, _parent));
|
|
5591
|
+
if ($setup.isLoadingLightbox) {
|
|
5592
|
+
_push(`<i class="i-arrow-path bg-base-200 absolute left-1/2 top-1/2 -ml-7 -mt-7 h-14 w-14 animate-spin"${ssrRenderAttr("aria-label", "Carregando")}></i>`);
|
|
5593
|
+
} else {
|
|
5594
|
+
_push(`<!---->`);
|
|
5595
|
+
}
|
|
5596
|
+
if ($props.pictures.length > 1) {
|
|
5597
|
+
_push(`<ul class="mt-2 flex justify-center gap-1.5 md:hidden"><!--[-->`);
|
|
5598
|
+
ssrRenderList($props.pictures.length, (i) => {
|
|
5599
|
+
_push(`<li><button class="${ssrRenderClass([$setup.activeIndex !== i - 1 && "opacity-40", "bg-base-700 block h-1.5 w-3 rounded-full"])}"${ssrRenderAttr("aria-label", `${"Imagem"} ${i}`)}></button></li>`);
|
|
5600
|
+
});
|
|
5601
|
+
_push(`<!--]--></ul>`);
|
|
5602
|
+
} else {
|
|
5603
|
+
_push(`<!---->`);
|
|
5604
|
+
}
|
|
5605
|
+
_push(`</div></div>`);
|
|
5606
|
+
}
|
|
5607
|
+
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
5608
|
+
_sfc_main$3.setup = (props, ctx) => {
|
|
5609
|
+
const ssrContext = useSSRContext();
|
|
5610
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ImagesGallery.vue");
|
|
5611
|
+
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
5612
|
+
};
|
|
5613
|
+
const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
|
|
5614
|
+
|
|
5615
|
+
const useSkuSelector = (props) => {
|
|
5616
|
+
let grids = shallowReactive(globalThis.$storefront.data.grids);
|
|
5617
|
+
if (!grids) {
|
|
5618
|
+
grids = shallowReactive([]);
|
|
5619
|
+
api.get("grids").then(({ data: { result } }) => {
|
|
5620
|
+
result.forEach((grid) => grids.push(grid));
|
|
5621
|
+
});
|
|
5622
|
+
}
|
|
5623
|
+
const variationsGrids$1 = reactive({});
|
|
5624
|
+
const activeVariationsGrids = reactive({});
|
|
5625
|
+
watch(toRef(props, "variations"), () => {
|
|
5626
|
+
Object.assign(activeVariationsGrids, variationsGrids(props, void 0, true));
|
|
5627
|
+
const allVariationsGrids = variationsGrids(props);
|
|
5628
|
+
Object.keys(allVariationsGrids).forEach((gridId) => {
|
|
5629
|
+
if (activeVariationsGrids[gridId]) {
|
|
5630
|
+
variationsGrids$1[gridId] = activeVariationsGrids[gridId];
|
|
5631
|
+
} else {
|
|
5632
|
+
delete variationsGrids$1[gridId];
|
|
5633
|
+
}
|
|
5634
|
+
});
|
|
5635
|
+
}, { immediate: true });
|
|
5636
|
+
const orderedGridIds = computed(() => Object.keys(variationsGrids$1));
|
|
5637
|
+
const selectedOptions = reactive({});
|
|
5638
|
+
const variationId = ref();
|
|
5639
|
+
const selectOption = ({ optionText, gridId, gridIndex }) => {
|
|
5640
|
+
selectedOptions[gridId] = optionText;
|
|
5641
|
+
const filteredGrids = {};
|
|
5642
|
+
for (let i = 0; i <= gridIndex; i++) {
|
|
5643
|
+
const _gridId = orderedGridIds[i];
|
|
5644
|
+
if (selectedOptions[_gridId]) {
|
|
5645
|
+
filteredGrids[_gridId] = selectedOptions[_gridId];
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
const nextFilteredGrids = variationsGrids(props, filteredGrids, true);
|
|
5649
|
+
for (let i = gridIndex + 1; i < orderedGridIds.value.length; i++) {
|
|
5650
|
+
const _gridId = orderedGridIds[i];
|
|
5651
|
+
const options = nextFilteredGrids[_gridId];
|
|
5652
|
+
activeVariationsGrids[_gridId] = options;
|
|
5653
|
+
if (selectedOptions[_gridId] && !options.includes(selectedOptions[_gridId])) {
|
|
5654
|
+
delete selectedOptions[_gridId];
|
|
5655
|
+
}
|
|
5656
|
+
}
|
|
5657
|
+
const variations = props.variations.slice(0);
|
|
5658
|
+
for (let i = 0; i < variations.length; i++) {
|
|
5659
|
+
const variation = variations[i];
|
|
5660
|
+
const { specifications } = variation;
|
|
5661
|
+
const gridIds = Object.keys(specifications);
|
|
5662
|
+
for (let ii = 0; ii < gridIds.length; ii++) {
|
|
5663
|
+
const _gridId = gridIds[ii];
|
|
5664
|
+
if (selectedOptions[_gridId] !== specTextValue(variation, _gridId)) {
|
|
5665
|
+
variations.splice(i, 1);
|
|
5666
|
+
i -= 1;
|
|
5667
|
+
break;
|
|
5668
|
+
}
|
|
5669
|
+
}
|
|
5670
|
+
}
|
|
5671
|
+
variationId.value = variations[0]?._id || null;
|
|
5672
|
+
};
|
|
5673
|
+
watch(toRef(props, "variationId"), (_variationId) => {
|
|
5674
|
+
if (!_variationId || _variationId === variationId.value) {
|
|
5675
|
+
return;
|
|
5676
|
+
}
|
|
5677
|
+
const selectedVariation = props.variations.find((variation) => {
|
|
5678
|
+
return variation._id === _variationId;
|
|
5679
|
+
});
|
|
5680
|
+
if (!selectedVariation) {
|
|
5681
|
+
variationId.value = null;
|
|
5682
|
+
return;
|
|
5683
|
+
}
|
|
5684
|
+
const { specifications } = selectedVariation;
|
|
5685
|
+
const specs = Object.keys(specifications);
|
|
5686
|
+
const nextSpec = (specIndex = 0) => {
|
|
5687
|
+
const gridId = specs[specIndex];
|
|
5688
|
+
if (specs[specIndex] && specifications[gridId] && specifications[gridId].length === 1) {
|
|
5689
|
+
const optionText = specifications[gridId][0].text;
|
|
5690
|
+
if (variationsGrids$1[gridId].find((option) => option === optionText)) {
|
|
5691
|
+
selectOption({
|
|
5692
|
+
optionText,
|
|
5693
|
+
gridId,
|
|
5694
|
+
gridIndex: orderedGridIds.value.indexOf(gridId)
|
|
5695
|
+
});
|
|
5696
|
+
nextSpec(specIndex + 1);
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
};
|
|
5700
|
+
nextSpec();
|
|
5701
|
+
}, { immediate: true });
|
|
5702
|
+
const getGridTitle = (gridId) => {
|
|
5703
|
+
return gridTitle(gridId, grids);
|
|
5704
|
+
};
|
|
5705
|
+
const getColorOptionBg = (optionText) => {
|
|
5706
|
+
const rgbs = optionText.split(",").map((colorName) => {
|
|
5707
|
+
return specValueByText(props.variations, colorName.trim(), "colors");
|
|
5708
|
+
});
|
|
5709
|
+
return rgbs.length > 1 ? `background:linear-gradient(to right bottom, ${rgbs[0]} 50%, ${rgbs[1]} 50%)` : `background:${rgbs[0]}`;
|
|
5710
|
+
};
|
|
5711
|
+
return {
|
|
5712
|
+
grids,
|
|
5713
|
+
variationsGrids: variationsGrids$1,
|
|
5714
|
+
activeVariationsGrids,
|
|
5715
|
+
selectOption,
|
|
5716
|
+
selectedOptions,
|
|
5717
|
+
variationId,
|
|
5718
|
+
getGridTitle,
|
|
5719
|
+
getColorOptionBg
|
|
5720
|
+
};
|
|
5721
|
+
};
|
|
5722
|
+
|
|
5723
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
5724
|
+
__name: "SkuSelector",
|
|
5725
|
+
props: {
|
|
5726
|
+
variations: {},
|
|
5727
|
+
variationId: {}
|
|
5728
|
+
},
|
|
5729
|
+
emits: ["update:variationId"],
|
|
5730
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5731
|
+
__expose();
|
|
5732
|
+
const props = __props;
|
|
5733
|
+
const emit = __emit;
|
|
5734
|
+
const {
|
|
5735
|
+
variationsGrids,
|
|
5736
|
+
activeVariationsGrids,
|
|
5737
|
+
selectOption,
|
|
5738
|
+
selectedOptions,
|
|
5739
|
+
variationId,
|
|
5740
|
+
getGridTitle,
|
|
5741
|
+
getColorOptionBg
|
|
5742
|
+
} = useSkuSelector(props);
|
|
5743
|
+
watch(variationId, (_id) => {
|
|
5744
|
+
emit("update:variationId", _id);
|
|
5745
|
+
});
|
|
5746
|
+
const __returned__ = { props, emit, variationsGrids, activeVariationsGrids, selectOption, selectedOptions, variationId, getGridTitle, getColorOptionBg };
|
|
5747
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5748
|
+
return __returned__;
|
|
5749
|
+
}
|
|
5750
|
+
});
|
|
5751
|
+
function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5752
|
+
_push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
|
|
5753
|
+
ssrRenderList($setup.variationsGrids, (options, gridId) => {
|
|
5754
|
+
_push(`<div><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
|
|
5755
|
+
if ($setup.selectedOptions[gridId]) {
|
|
5756
|
+
_push(`<strong class="text-base-800">${ssrInterpolate($setup.selectedOptions[gridId])}</strong>`);
|
|
5757
|
+
} else {
|
|
5758
|
+
_push(`<!---->`);
|
|
5759
|
+
}
|
|
5760
|
+
_push(`</span>`);
|
|
5761
|
+
if (options.length < 7) {
|
|
5762
|
+
_push(`<ul class="mt-2 flex gap-2"><!--[-->`);
|
|
5763
|
+
ssrRenderList(options, (optionText, i) => {
|
|
5764
|
+
_push(`<li><button class="${ssrRenderClass([[
|
|
5765
|
+
$setup.selectedOptions[gridId] === optionText ? "border-secondary ring-2" : null,
|
|
5766
|
+
gridId === "colors" ? "h-9 w-9 text-[0]" : "px-2 py-1",
|
|
5767
|
+
$setup.activeVariationsGrids[gridId].includes(optionText) ? "text-base-800 bg-base-100 border-base-400" : "text-base-500 bg-base-200 border-base-300"
|
|
5768
|
+
], "ring-secondary/60 rounded border"])}" style="${ssrRenderStyle(gridId === "colors" ? $setup.getColorOptionBg(optionText) : void 0)}">${ssrInterpolate(optionText)}</button></li>`);
|
|
5769
|
+
});
|
|
5770
|
+
_push(`<!--]--></ul>`);
|
|
5771
|
+
} else {
|
|
5772
|
+
_push(`<!---->`);
|
|
5773
|
+
}
|
|
5774
|
+
_push(`</div>`);
|
|
5775
|
+
});
|
|
5776
|
+
_push(`<!--]--></div>`);
|
|
5777
|
+
}
|
|
5778
|
+
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
5779
|
+
_sfc_main$2.setup = (props, ctx) => {
|
|
5780
|
+
const ssrContext = useSSRContext();
|
|
5781
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SkuSelector.vue");
|
|
5782
|
+
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
5783
|
+
};
|
|
5784
|
+
const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
|
|
5785
|
+
|
|
5786
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5787
|
+
__name: "ProductDetails",
|
|
5788
|
+
props: {
|
|
5789
|
+
product: { default: () => globalThis.$storefront.apiContext?.doc }
|
|
5790
|
+
},
|
|
5791
|
+
setup(__props, { expose: __expose }) {
|
|
5792
|
+
__expose();
|
|
5793
|
+
const props = __props;
|
|
5794
|
+
const {
|
|
5795
|
+
product,
|
|
5796
|
+
title,
|
|
5797
|
+
isActive
|
|
5798
|
+
} = useProductCard(props);
|
|
5799
|
+
const quantity = ref(product.min_quantity || 1);
|
|
5800
|
+
const params = useUrlSearchParams("history");
|
|
5801
|
+
const hasSkuSelectionAlert = ref(false);
|
|
5802
|
+
const variationId = ref(null);
|
|
5803
|
+
watch(variationId, (_variationId) => {
|
|
5804
|
+
if (_variationId) {
|
|
5805
|
+
params.var = _variationId;
|
|
5806
|
+
hasSkuSelectionAlert.value = false;
|
|
5807
|
+
}
|
|
5808
|
+
});
|
|
5809
|
+
onMounted(() => {
|
|
5810
|
+
watch(params, ({ var: variation }) => {
|
|
5811
|
+
if (typeof variation === "string" && variation) {
|
|
5812
|
+
variationId.value = variation;
|
|
5813
|
+
}
|
|
5814
|
+
}, { immediate: true });
|
|
5815
|
+
});
|
|
5816
|
+
const isSkuSelected = computed(() => {
|
|
5817
|
+
return Boolean(!product.variations?.length || variationId.value);
|
|
5818
|
+
});
|
|
5819
|
+
const checkVariation = (ev) => {
|
|
5820
|
+
if (!isSkuSelected.value) {
|
|
5821
|
+
if (ev)
|
|
5822
|
+
ev.preventDefault();
|
|
5823
|
+
hasSkuSelectionAlert.value = true;
|
|
5824
|
+
} else {
|
|
5825
|
+
hasSkuSelectionAlert.value = false;
|
|
5826
|
+
}
|
|
5827
|
+
return !hasSkuSelectionAlert.value;
|
|
5828
|
+
};
|
|
5829
|
+
const addToCart = () => {
|
|
5830
|
+
if (!checkVariation())
|
|
5831
|
+
return;
|
|
5832
|
+
addProductToCart(product, variationId.value ? variationId.value : void 0);
|
|
5833
|
+
};
|
|
5834
|
+
const __returned__ = { props, product, title, isActive, quantity, params, hasSkuSelectionAlert, variationId, isSkuSelected, checkVariation, addToCart, CheckoutLink, QuantitySelector, Prices, ImagesGallery, SkuSelector };
|
|
5835
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5836
|
+
return __returned__;
|
|
5837
|
+
}
|
|
5838
|
+
});
|
|
5839
|
+
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5840
|
+
const _component_Fade = resolveComponent("Fade");
|
|
5841
|
+
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
|
|
5842
|
+
if ($setup.product.pictures?.length) {
|
|
5843
|
+
_push(ssrRenderComponent($setup["ImagesGallery"], {
|
|
5844
|
+
pictures: $setup.product.pictures
|
|
5845
|
+
}, null, _parent));
|
|
5846
|
+
} else {
|
|
5847
|
+
_push(`<!---->`);
|
|
5848
|
+
}
|
|
5849
|
+
_push(`</div><div class="top-0 py-4 lg:sticky"><h1 class="ui-text-brand text-base-700 text-xl">${ssrInterpolate($setup.title)}</h1>`);
|
|
5850
|
+
if ($setup.isActive) {
|
|
5851
|
+
_push(`<div class="mt-5">`);
|
|
5852
|
+
_push(ssrRenderComponent($setup["Prices"], {
|
|
5853
|
+
product: $setup.product,
|
|
5854
|
+
"is-big": "",
|
|
5855
|
+
"is-literal": ""
|
|
5856
|
+
}, null, _parent));
|
|
5857
|
+
if ($setup.product.variations) {
|
|
5858
|
+
_push(ssrRenderComponent($setup["SkuSelector"], {
|
|
5859
|
+
variations: $setup.product.variations,
|
|
5860
|
+
"variation-id": $setup.variationId,
|
|
5861
|
+
"onUpdate:variationId": ($event) => $setup.variationId = $event,
|
|
5862
|
+
class: "my-4"
|
|
5863
|
+
}, null, _parent));
|
|
5864
|
+
} else {
|
|
5865
|
+
_push(`<!---->`);
|
|
5866
|
+
}
|
|
5867
|
+
_push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
|
|
5868
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5869
|
+
if (_push2) {
|
|
5870
|
+
if ($setup.hasSkuSelectionAlert) {
|
|
5871
|
+
_push2(`<div class="ui-alert inline-block"${_scopeId}>${ssrInterpolate("Por favor selecione uma op\xE7\xE3o em cada campo acima")} <i class="i-arrow-right ml-1 -rotate-90"${_scopeId}></i></div>`);
|
|
5872
|
+
} else {
|
|
5873
|
+
_push2(`<!---->`);
|
|
5874
|
+
}
|
|
5875
|
+
} else {
|
|
5876
|
+
return [
|
|
5877
|
+
$setup.hasSkuSelectionAlert ? (openBlock(), createBlock("div", {
|
|
5878
|
+
key: 0,
|
|
5879
|
+
class: "ui-alert inline-block"
|
|
5880
|
+
}, [
|
|
5881
|
+
createTextVNode(toDisplayString("Por favor selecione uma op\xE7\xE3o em cada campo acima") + " "),
|
|
5882
|
+
createVNode("i", { class: "i-arrow-right ml-1 -rotate-90" })
|
|
5883
|
+
])) : createCommentVNode("", true)
|
|
5884
|
+
];
|
|
5885
|
+
}
|
|
5886
|
+
}),
|
|
5887
|
+
_: 1
|
|
5888
|
+
}, _parent));
|
|
5889
|
+
_push(`<div class="mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 overflow-hidden md:flex-nowrap lg:mt-4 lg:flex-wrap">`);
|
|
5890
|
+
_push(ssrRenderComponent($setup["QuantitySelector"], {
|
|
5891
|
+
modelValue: $setup.quantity,
|
|
5892
|
+
"onUpdate:modelValue": ($event) => $setup.quantity = $event,
|
|
5893
|
+
min: $setup.product.min_quantity,
|
|
5894
|
+
max: $setup.product.quantity,
|
|
5895
|
+
class: "border-base-100 rounded md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"
|
|
5896
|
+
}, null, _parent));
|
|
5897
|
+
_push(ssrRenderComponent($setup["CheckoutLink"], {
|
|
5898
|
+
class: "ui-btn-lg ui-btn-primary grow text-center",
|
|
5899
|
+
to: "checkout",
|
|
5900
|
+
"cart-item": {
|
|
5901
|
+
product_id: $setup.product._id,
|
|
5902
|
+
quantity: $setup.quantity,
|
|
5903
|
+
variation_id: $setup.variationId || void 0
|
|
5904
|
+
},
|
|
5905
|
+
"data-tooltip": !$setup.isSkuSelected ? "Escolha os detalhes do produto para comprar" : null,
|
|
5906
|
+
onClick: $setup.checkVariation
|
|
5907
|
+
}, {
|
|
5908
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5909
|
+
if (_push2) {
|
|
5910
|
+
_push2(`<i class="i-chevron-double-right mr-1"${_scopeId}></i> ${ssrInterpolate("Comprar")}`);
|
|
5911
|
+
} else {
|
|
5912
|
+
return [
|
|
5913
|
+
createVNode("i", { class: "i-chevron-double-right mr-1" }),
|
|
5914
|
+
createTextVNode(" " + toDisplayString("Comprar"))
|
|
5915
|
+
];
|
|
5916
|
+
}
|
|
5917
|
+
}),
|
|
5918
|
+
_: 1
|
|
5919
|
+
}, _parent));
|
|
5920
|
+
_push(`<button class="ui-btn-lg ui-btn-contrast grow"${ssrRenderAttr("data-tooltip", !$setup.isSkuSelected ? "Escolha os detalhes do produto para comprar" : null)}>${ssrInterpolate("Adicionar ao carrinho")}</button></div></div>`);
|
|
5921
|
+
} else {
|
|
5922
|
+
_push(`<!---->`);
|
|
5923
|
+
}
|
|
5924
|
+
_push(`</div><div class="w-full lg:col-span-3">`);
|
|
5925
|
+
ssrRenderSlot(_ctx.$slots, "description", {}, null, _push, _parent);
|
|
5926
|
+
_push(`</div></section>`);
|
|
5927
|
+
}
|
|
5928
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
5929
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
5930
|
+
const ssrContext = useSSRContext();
|
|
5931
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductDetails.vue");
|
|
5932
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
5933
|
+
};
|
|
5934
|
+
const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
5935
|
+
|
|
5936
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5937
|
+
__name: "ProductSpecifications",
|
|
5938
|
+
props: {
|
|
5939
|
+
product: { default: () => globalThis.$storefront.apiContext?.doc },
|
|
5940
|
+
title: {}
|
|
5941
|
+
},
|
|
5942
|
+
setup(__props, { expose: __expose }) {
|
|
5943
|
+
__expose();
|
|
5944
|
+
const props = __props;
|
|
5945
|
+
const specifications = computed(() => props.product.specifications || {});
|
|
5946
|
+
const hasSpecs = computed(() => Object.keys(specifications.value).length);
|
|
5947
|
+
const { grids } = globalThis.$storefront.data;
|
|
5948
|
+
const __returned__ = { props, specifications, hasSpecs, grids, get getGridTitle() {
|
|
5949
|
+
return gridTitle;
|
|
5950
|
+
}, get getSpecTextValue() {
|
|
5951
|
+
return specTextValue;
|
|
5952
|
+
}, Collapse };
|
|
5953
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
5954
|
+
return __returned__;
|
|
5955
|
+
}
|
|
5956
|
+
});
|
|
5957
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
5958
|
+
if ($setup.hasSpecs) {
|
|
5959
|
+
_push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
|
|
5960
|
+
_push(ssrRenderComponent($setup["Collapse"], {
|
|
5961
|
+
title: $props.title || "Especifica\xE7\xF5es"
|
|
5962
|
+
}, {
|
|
5963
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
5964
|
+
if (_push2) {
|
|
5965
|
+
_push2(`<ul${_scopeId}><!--[-->`);
|
|
5966
|
+
ssrRenderList($setup.specifications, (grid, gridId) => {
|
|
5967
|
+
_push2(`<li class="border-base-200 grid grid-cols-2 border-dashed py-2 sm:grid-cols-3 [&:not(:last-child)]:border-b"${_scopeId}><span class="text-base-700"${_scopeId}>${ssrInterpolate($setup.getGridTitle(`${gridId}`, $setup.grids))}</span><strong class="font-semibold sm:col-span-2"${_scopeId}>${ssrInterpolate($setup.getSpecTextValue($props.product, `${gridId}`, $setup.grids))}</strong></li>`);
|
|
5968
|
+
});
|
|
5969
|
+
_push2(`<!--]--></ul>`);
|
|
5970
|
+
} else {
|
|
5971
|
+
return [
|
|
5972
|
+
createVNode("ul", null, [
|
|
5973
|
+
(openBlock(true), createBlock(Fragment$1, null, renderList($setup.specifications, (grid, gridId) => {
|
|
5974
|
+
return openBlock(), createBlock("li", {
|
|
5975
|
+
key: gridId,
|
|
5976
|
+
class: "border-base-200 grid grid-cols-2 border-dashed py-2 sm:grid-cols-3 [&:not(:last-child)]:border-b"
|
|
5977
|
+
}, [
|
|
5978
|
+
createVNode("span", { class: "text-base-700" }, toDisplayString($setup.getGridTitle(`${gridId}`, $setup.grids)), 1),
|
|
5979
|
+
createVNode("strong", { class: "font-semibold sm:col-span-2" }, toDisplayString($setup.getSpecTextValue($props.product, `${gridId}`, $setup.grids)), 1)
|
|
5980
|
+
]);
|
|
5981
|
+
}), 128))
|
|
5982
|
+
])
|
|
5983
|
+
];
|
|
5984
|
+
}
|
|
5985
|
+
}),
|
|
5986
|
+
_: 1
|
|
5987
|
+
}, _parent));
|
|
5988
|
+
_push(`</section>`);
|
|
5989
|
+
} else {
|
|
5990
|
+
_push(`<!---->`);
|
|
5991
|
+
}
|
|
5992
|
+
}
|
|
5993
|
+
const _sfc_setup = _sfc_main.setup;
|
|
5994
|
+
_sfc_main.setup = (props, ctx) => {
|
|
5995
|
+
const ssrContext = useSSRContext();
|
|
5996
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductSpecifications.vue");
|
|
5997
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
5998
|
+
};
|
|
5999
|
+
const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
6000
|
+
|
|
6001
|
+
const $$Astro$3 = createAstro("https://demo.ecomplus.app");
|
|
6002
|
+
const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
|
|
6003
|
+
const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
|
|
6004
|
+
Astro2.self = $$Sections;
|
|
6005
|
+
const { routeContext } = Astro2.locals;
|
|
6006
|
+
const { sections } = await usePageSections({
|
|
6007
|
+
routeContext,
|
|
6008
|
+
handleCustomSection: async (type, content) => {
|
|
6009
|
+
if (type === "c:foo")
|
|
6010
|
+
return { props: { ...content, foo: "bar" } };
|
|
6011
|
+
return { props: content };
|
|
6012
|
+
}
|
|
6013
|
+
});
|
|
6014
|
+
const { isHomepage } = routeContext;
|
|
6015
|
+
return renderTemplate`${maybeRenderHead()}<article class="my-9 md:my-12"> ${sections.map(async ({ type, props }) => {
|
|
6016
|
+
switch (type) {
|
|
6017
|
+
case "product-shelf":
|
|
6018
|
+
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" })}`;
|
|
6019
|
+
case "banners-grid":
|
|
6020
|
+
return renderTemplate`${renderComponent($$result, "BannersGrid", $$BannersGrid, { ...props })}`;
|
|
6021
|
+
case "breadcrumbs":
|
|
6022
|
+
return renderTemplate`${renderComponent($$result, "Breadcrumbs", $$Breadcrumbs, {})}`;
|
|
6023
|
+
case "doc-description":
|
|
6024
|
+
return renderTemplate`${renderComponent($$result, "DocDescription", DocDescription, {})}`;
|
|
6025
|
+
case "product-details":
|
|
6026
|
+
const { hasDescription, hasSpecifications, ...detailsProps } = props;
|
|
6027
|
+
return renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate` ${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, {})}`}` })}` })} ` })}`;
|
|
6028
|
+
case "c:foo":
|
|
6029
|
+
return renderTemplate`<div${addAttribute(props.foo, "data-foo")}></div>`;
|
|
6030
|
+
default:
|
|
6031
|
+
return renderTemplate`<div${addAttribute(type, "data-section")}></div>`;
|
|
6032
|
+
}
|
|
6033
|
+
})} </article>`;
|
|
6034
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Sections.astro", void 0);
|
|
6035
|
+
|
|
6036
|
+
var __freeze = Object.freeze;
|
|
6037
|
+
var __defProp = Object.defineProperty;
|
|
6038
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
6039
|
+
var _a;
|
|
6040
|
+
const $$Astro$2 = createAstro("https://demo.ecomplus.app");
|
|
6041
|
+
const $$SharedData = createComponent(async ($$result, $$props, $$slots) => {
|
|
6042
|
+
const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
|
|
6043
|
+
Astro2.self = $$SharedData;
|
|
6044
|
+
const { inlineClientJS } = await useSharedData(Astro2.props);
|
|
6045
|
+
return renderTemplate(_a || (_a = __template(["<script>", "<\/script>"])), unescapeHTML(inlineClientJS));
|
|
6046
|
+
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/SharedData.astro", void 0);
|
|
5221
6047
|
|
|
5222
|
-
const $$Astro$1 = createAstro("https://
|
|
6048
|
+
const $$Astro$1 = createAstro("https://demo.ecomplus.app");
|
|
5223
6049
|
const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
|
|
5224
6050
|
const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
|
|
5225
6051
|
Astro2.self = $$Wildcard;
|
|
5226
6052
|
const { fetchingApiContext } = Astro2.locals.routeContext;
|
|
5227
|
-
|
|
5228
|
-
|
|
6053
|
+
const [
|
|
6054
|
+
{ data: { result: grids } }
|
|
6055
|
+
] = await Promise.all([
|
|
6056
|
+
api.get("grids"),
|
|
6057
|
+
fetchingApiContext
|
|
6058
|
+
]);
|
|
6059
|
+
return renderTemplate`${maybeRenderHead()}<main> ${renderComponent($$result, "SharedData", $$SharedData, { "field": "grids", "value": grids })} ${renderComponent($$result, "Sections", $$Sections, {})} </main>`;
|
|
5229
6060
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro", void 0);
|
|
5230
6061
|
|
|
5231
|
-
const $$Astro = createAstro("https://
|
|
6062
|
+
const $$Astro = createAstro("https://demo.ecomplus.app");
|
|
5232
6063
|
async function getStaticPaths() {
|
|
5233
6064
|
return (await api.get("products?sort=-sales&limit=4&fields=slug")).data.result.map(({ slug }) => ({ params: { slug } }));
|
|
5234
6065
|
}
|
|
@@ -5248,7 +6079,7 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
5248
6079
|
}
|
|
5249
6080
|
loadError = err;
|
|
5250
6081
|
}
|
|
5251
|
-
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}
|
|
6082
|
+
return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}> ${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`${renderComponent($$result2, "PageHeader", $$PageHeader, {})}${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}${renderComponent($$result2, "PageFooter", $$PageFooter, {})}` })}`}${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}</html>`;
|
|
5252
6083
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", void 0);
|
|
5253
6084
|
|
|
5254
6085
|
const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
|
|
@@ -5262,4 +6093,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
5262
6093
|
url: $$url
|
|
5263
6094
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
5264
6095
|
|
|
5265
|
-
export { $$
|
|
6096
|
+
export { $$BaseHead as $, Banner as B, CheckoutLink as C, FooterStamps as F, Prices 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, freeShippingFromValue as g, ____slug_ as h, loadRouteContext as l, parseProduct as p, removeCartItem as r, shoppingCart as s, totalItems as t, usePageHero as u };
|