cloudcommerce 0.33.5 → 0.35.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 +50 -0
- package/action.yml +11 -3
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +7 -7
- package/packages/api/lib/api.js +1 -1
- package/packages/api/lib/api.js.map +1 -1
- package/packages/api/package.json +1 -1
- package/packages/api/src/api.ts +1 -1
- package/packages/apps/affilate-program/lib/events-to-affilate-program.js.map +1 -1
- package/packages/apps/affilate-program/package.json +2 -2
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/lib/custom-payment-create-transaction.js.map +1 -1
- package/packages/apps/custom-payment/lib/custom-payment-list-payments.js.map +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/lib/datafrete-webhook.js.map +1 -1
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/lib/events-to-app-emails.js.map +1 -1
- package/packages/apps/emails/lib/functios-lib/abandoned-carts.js.map +1 -1
- package/packages/apps/emails/lib/functios-lib/handle-orders.js.map +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/fb-conversions/lib/fb-conversions-events.js.map +1 -1
- package/packages/apps/fb-conversions/lib/functions-lib/create-fb-objects.js.map +1 -1
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/lib/functions-lib/database.js.map +1 -1
- package/packages/apps/frenet/lib/functions-lib/events-to-frenet.js.map +1 -1
- package/packages/apps/frenet/lib/functions-lib/remove-delivered.js.map +1 -1
- package/packages/apps/frenet/lib/functions-lib/tracking-codes.js.map +1 -1
- package/packages/apps/frenet/lib/functions-lib/update-fulfillments.js.map +1 -1
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/lib/functions-lib/all-parses.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/ecom/events-to-galaxpay.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/auth/create-access.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/auth/create-axios.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/auth/gerate-token.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/handle-plans.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/update-subscription.js.map +1 -1
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/webhook.d.ts +1 -0
- package/packages/apps/galaxpay/lib/functions-lib/galaxpay/webhook.js.map +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-create-transaction.js +2 -2
- package/packages/apps/galaxpay/lib/galaxpay-create-transaction.js.map +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-events.js.map +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-list-payments.js +1 -1
- package/packages/apps/galaxpay/lib/galaxpay-list-payments.js.map +1 -1
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/google-analytics/lib/google-analytics-events.js +4 -4
- package/packages/apps/google-analytics/lib/google-analytics-events.js.map +1 -1
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/google-analytics/src/google-analytics-events.ts +4 -4
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js.map +1 -1
- package/packages/apps/loyalty-points/lib/functions-lib/get-program-id.js.map +1 -1
- package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-points-events.js.map +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/database.js.map +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/events-to-melhor-envio.js.map +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/new-label.js.map +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/order-is-valid.js.map +1 -1
- package/packages/apps/melhor-envio/lib/functions-lib/tracking-codes.js.map +1 -1
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/lib/mp-create-transaction.js.map +1 -1
- package/packages/apps/mercadopago/lib/mp-list-payments.js.map +1 -1
- package/packages/apps/mercadopago/lib/mp-webhook.js.map +1 -1
- package/packages/apps/mercadopago/package.json +2 -2
- package/packages/apps/pagarme/lib/functions-lib/add-installments.js.map +1 -1
- package/packages/apps/pagarme/lib/functions-lib/parse-status-to-ecom.js.map +1 -1
- package/packages/apps/pagarme/lib/pagarme-create-transaction.js.map +1 -1
- package/packages/apps/pagarme/lib/pagarme-list-payments.js.map +1 -1
- package/packages/apps/pagarme/lib/pagarme-webhook.js.map +1 -1
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme-v5/lib/pagarme-v5-events.js.map +1 -1
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/lib/functions-lib/handle-webhook.d.ts +1 -0
- package/packages/apps/paghiper/lib/functions-lib/handle-webhook.js.map +1 -1
- package/packages/apps/paghiper/lib/paghiper-create-transaction.js.map +1 -1
- package/packages/apps/paghiper/lib/paghiper-list-payments.js.map +1 -1
- package/packages/apps/paghiper/lib/paghiper-webhook.js.map +1 -1
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/lib/functions-lib/get-certificate.js.map +1 -1
- package/packages/apps/pix/lib/functions-lib/pix-auth/construtor.js.map +1 -1
- package/packages/apps/pix/lib/functions-lib/pix-auth/create-axios.js.map +1 -1
- package/packages/apps/pix/lib/functions-lib/pix-auth/oauth.js.map +1 -1
- package/packages/apps/pix/lib/pix-create-transaction.js.map +1 -1
- package/packages/apps/pix/lib/pix-list-payments.js.map +1 -1
- package/packages/apps/pix/lib/pix-webhook.js.map +1 -1
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/lib/event-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js.map +1 -1
- package/packages/apps/tiny-erp/lib/tiny-webhook.js.map +1 -1
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/lib/events-to-webhooks-app.js.map +1 -1
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/config/lib/config.js.map +1 -1
- package/packages/config/lib/env.js.map +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/lib/index.js.map +1 -1
- package/packages/emails/lib/parse-template-to-html.js.map +1 -1
- package/packages/emails/lib/providers/sendgrid/index.js.map +1 -1
- package/packages/emails/lib/providers/sendgrid/parse-to-data.js.map +1 -1
- package/packages/emails/lib/providers/smtp/index.js.map +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +1 -1
- package/packages/events/package.json +2 -2
- package/packages/feeds/lib/firebase/serve-feeds.js.map +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
- package/packages/firebase/lib/helpers/pubsub.js.map +1 -1
- package/packages/firebase/lib/helpers/update-app-data.js.map +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/fix-items.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/new-order.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/utils.js.map +1 -1
- package/packages/modules/lib/firebase/handle-module.js.map +1 -1
- package/packages/modules/lib/firebase/serve-modules-api.js.map +1 -1
- package/packages/modules/lib/firebase.js.map +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/passport/lib/firebase/authenticate-customer.js.map +1 -1
- package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
- package/packages/passport/lib/firebase.js.map +1 -1
- package/packages/passport/package.json +2 -2
- package/packages/ssr/lib/analytics/send-to-ga4.js +44 -0
- package/packages/ssr/lib/analytics/send-to-ga4.js.map +1 -0
- package/packages/ssr/lib/analytics/send-to-meta.js +44 -0
- package/packages/ssr/lib/analytics/send-to-meta.js.map +1 -0
- package/packages/ssr/lib/analytics/send-to-tiktok.js +44 -0
- package/packages/ssr/lib/analytics/send-to-tiktok.js.map +1 -0
- package/packages/ssr/lib/analytics-events.js +52 -24
- package/packages/ssr/lib/analytics-events.js.map +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +16 -3
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +6 -6
- package/packages/ssr/src/analytics/send-to-ga4.ts +56 -0
- package/packages/ssr/src/analytics/send-to-meta.ts +50 -0
- package/packages/ssr/src/analytics/send-to-tiktok.ts +49 -0
- package/packages/ssr/src/analytics-events.ts +57 -27
- package/packages/ssr/src/firebase/serve-storefront.ts +17 -3
- package/packages/storefront/.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.77d861e9.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.005ec337.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.b35ac2f9.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.7965ce11.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.862d15eb.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.120b6513.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.4a2f57cf.js +1 -0
- package/packages/storefront/dist/client/_astro/QuantitySelector.d7dd044c.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.0bf88bcc.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.57302617.js +4 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.d927d271.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.f458f318.css +1 -0
- package/packages/storefront/dist/client/_astro/afetch.f4507208.js +1 -0
- package/packages/storefront/dist/client/_astro/client.409c434f.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.68901b4c.js +1 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.f65876ca.js +1 -0
- package/packages/storefront/dist/client/_astro/firebase-app.992a296f.js +16 -0
- package/packages/storefront/dist/client/_astro/format-money.db179bca.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.719d11e3.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.f4c55052.js +1 -0
- package/packages/storefront/dist/client/_astro/i18n.614beec4.js +1 -0
- package/packages/storefront/dist/client/_astro/img-sizes.41e0efe4.js +1 -0
- package/packages/storefront/dist/client/_astro/img.27573b8b.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.aac4c53d.js +1 -0
- package/packages/storefront/dist/client/_astro/index.d93220be.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.4373e917.js +1 -0
- package/packages/storefront/dist/client/_astro/name.2999355b.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/sf-utils.b04e1813.js +1 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.608866aa.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.205d2b8f.js +1 -0
- package/packages/storefront/dist/client/_astro/use-product-card.cc44716b.js +1 -0
- package/packages/storefront/dist/client/robots.txt +1 -1
- package/packages/storefront/dist/server/chunks/CartSidebar_6cb69be3.mjs +203 -0
- package/packages/storefront/dist/server/chunks/SearchModal_930845a4.mjs +18 -0
- package/packages/storefront/dist/server/chunks/_.._07cccbbe.mjs +6 -0
- package/packages/storefront/dist/server/chunks/account_e71f4214.mjs +6 -0
- package/packages/storefront/dist/server/chunks/astro/assets-service_a9d9ab5f.mjs +544 -0
- package/packages/storefront/dist/server/chunks/{astro.708269c6.mjs → astro_d98f7186.mjs} +214 -1878
- package/packages/storefront/dist/server/chunks/index_414d53c7.mjs +6 -0
- package/packages/storefront/dist/server/chunks/index_a7b0afbf.mjs +6 -0
- package/packages/storefront/dist/server/chunks/node_7efff4d0.mjs +6 -0
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0808946e.mjs → __e7ddf925.mjs} +2019 -1017
- package/packages/storefront/dist/server/chunks/pages/account_f14e6f5a.mjs +28 -0
- package/packages/storefront/dist/server/chunks/pages/index_b300d887.mjs +316 -0
- package/packages/storefront/dist/server/chunks/pages/node_2b0cb889.mjs +93 -0
- package/packages/storefront/dist/server/chunks/pages/~fallback_2bbdf875.mjs +40 -0
- package/packages/storefront/dist/server/chunks/photoswipe_9528923e.mjs +3 -0
- package/packages/storefront/dist/server/chunks/~fallback_43c17ff0.mjs +6 -0
- package/packages/storefront/dist/server/entry.mjs +1012 -2526
- package/packages/storefront/dist/server/manifest_4dba1382.mjs +1069 -0
- package/packages/storefront/dist/server/renderers.mjs +335 -51
- package/packages/storefront/package.json +11 -13
- 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/assets/forms.css +35 -30
- package/packages/storefront/src/lib/components/Carousel.vue +3 -1
- package/packages/storefront/src/lib/components/CarouselControl.vue +1 -1
- package/packages/storefront/src/lib/components/Drawer.vue +45 -7
- package/packages/storefront/src/lib/components/Picture.astro +47 -4
- package/packages/storefront/src/lib/components/globals/Fade.vue +1 -1
- package/packages/storefront/src/lib/composables/use-product-shelf.ts +1 -1
- package/packages/storefront/src/lib/scripts/vbeta-app.ts +25 -15
- package/packages/storefront/src/lib/state/search-engine.ts +101 -0
- package/packages/storefront/src/lib/state/shopping-cart.ts +52 -65
- package/packages/storefront/src/lib/state/use-analytics.ts +2 -1
- package/packages/storefront/src/lib/state/use-storage.ts +5 -2
- package/packages/test-base/lib/endpoints.js.map +1 -1
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/ssr/lib/analytics-providers/google-analytics.js +0 -48
- package/packages/ssr/lib/analytics-providers/google-analytics.js.map +0 -1
- package/packages/ssr/lib/analytics-providers/meta-conversions-api.js +0 -44
- package/packages/ssr/lib/analytics-providers/meta-conversions-api.js.map +0 -1
- package/packages/ssr/src/analytics-providers/google-analytics.ts +0 -67
- package/packages/ssr/src/analytics-providers/meta-conversions-api.ts +0 -57
- package/packages/storefront/dist/client/_astro/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/headphone_1Ekzdh.avif +0 -0
- package/packages/storefront/dist/client/_astro/headphone_Z1GbHcH.webp +0 -0
- 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/passion_1LvKlp.webp +0 -0
- package/packages/storefront/dist/client/_astro/passion_2PSWs.avif +0 -0
- package/packages/storefront/dist/client/_astro/preload-helper.cf010ec4.js +0 -1
- package/packages/storefront/dist/client/_astro/rect8589_1A8K2Q.webp +0 -0
- 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_LhopI.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1NFjiR.avif +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/rect8589_ZorpIx.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1CcLjM.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_299fN7.avif +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/rect859_rsWaw.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_sLbkT.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect89_1yf5jS.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect89_GQBli.webp +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/client/~fallback.html +0 -67
- package/packages/storefront/dist/client/~index.html +0 -113
- 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/images.dist.csv +0 -30
- package/packages/storefront/dist/server/images.src.csv +0 -11
- package/packages/storefront/dist/server/manifest.webmanifest +0 -1
- package/packages/storefront/dist/server/registerSW.js +0 -1
- package/packages/storefront/dist/server/static-builds.csv +0 -51
|
@@ -33,8 +33,8 @@ const watchAppRoutes = () => {
|
|
|
33
33
|
emittedCheckoutSteps.push(evName);
|
|
34
34
|
if (!params) {
|
|
35
35
|
params = {
|
|
36
|
-
value: fixMoneyValue(shoppingCart.
|
|
37
|
-
items: shoppingCart.
|
|
36
|
+
value: fixMoneyValue(shoppingCart.subtotal || 0),
|
|
37
|
+
items: shoppingCart.items.map(getGtagItem),
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
if (evName !== 'view_cart') {
|
|
@@ -63,8 +63,8 @@ const watchAppRoutes = () => {
|
|
|
63
63
|
};
|
|
64
64
|
const params: Gtag.EventParams = {
|
|
65
65
|
transaction_id: orderId,
|
|
66
|
-
value: fixMoneyValue(amount?.total || shoppingCart.
|
|
67
|
-
items: shoppingCart.
|
|
66
|
+
value: fixMoneyValue(amount?.total || shoppingCart.subtotal || 0),
|
|
67
|
+
items: shoppingCart.items.map(getGtagItem),
|
|
68
68
|
coupon: order
|
|
69
69
|
? order.extra_discount?.discount_coupon
|
|
70
70
|
: getCouponApplied(),
|
|
@@ -182,19 +182,29 @@ if (!import.meta.env.SSR) {
|
|
|
182
182
|
if (Object.keys(utm).length) {
|
|
183
183
|
sessionStorage.setItem('ecomUtm', JSON.stringify(utm));
|
|
184
184
|
}
|
|
185
|
+
let querystring = window.location.search;
|
|
186
|
+
if (!querystring && window.location.hash) {
|
|
187
|
+
querystring = '?' + window.location.hash.split('?')[1];
|
|
188
|
+
}
|
|
189
|
+
const searchParams = new URLSearchParams(querystring);
|
|
190
|
+
if (searchParams.get('product_id') && searchParams.get('quantity') === '1') {
|
|
191
|
+
localStorage.setItem('ecomShoppingCart__tmp', JSON.stringify({
|
|
192
|
+
items: [{
|
|
193
|
+
product_id: searchParams.get('product_id'),
|
|
194
|
+
variation_id: searchParams.get('variation_id') || undefined,
|
|
195
|
+
quantity: 1,
|
|
196
|
+
}],
|
|
197
|
+
}));
|
|
198
|
+
(window as any).ECOM_CART_STORAGE_KEY = 'ecomShoppingCart__tmp';
|
|
199
|
+
}
|
|
185
200
|
const { hostname } = window.location;
|
|
186
201
|
const { domain } = globalThis.$storefront.settings;
|
|
187
202
|
const apiBaseUri = `https://ecomplus.io/v2/:${window.ECOM_STORE_ID}/`;
|
|
188
|
-
|
|
189
|
-
window.
|
|
190
|
-
|
|
191
|
-
window.
|
|
192
|
-
|
|
193
|
-
window.ECOMCLIENT_API_PASSPORT = apiBaseUri;
|
|
194
|
-
// @ts-ignore
|
|
195
|
-
window.ECOMCLIENT_API_SEARCH = `${apiBaseUri}/search/_els/`;
|
|
196
|
-
// @ts-ignore
|
|
197
|
-
window.ECOMCLIENT_API_MODULES = hostname !== 'localhost' && hostname !== '127.0.0.1'
|
|
203
|
+
(window as any).ECOMCLIENT_API_STORE = apiBaseUri;
|
|
204
|
+
(window as any).ECOMCLIENT_API_STORE_CACHE = apiBaseUri;
|
|
205
|
+
(window as any).ECOMCLIENT_API_PASSPORT = apiBaseUri;
|
|
206
|
+
(window as any).ECOMCLIENT_API_SEARCH = `${apiBaseUri}/search/_els/`;
|
|
207
|
+
(window as any).ECOMCLIENT_API_MODULES = ['localhost', '127.0.0.1'].includes(hostname)
|
|
198
208
|
? `https://${domain}/_api/modules/`
|
|
199
209
|
: '/_api/modules/';
|
|
200
210
|
|
|
@@ -227,7 +237,7 @@ if (!import.meta.env.SSR) {
|
|
|
227
237
|
};
|
|
228
238
|
|
|
229
239
|
const appScript = document.createElement('script');
|
|
230
|
-
appScript.src = 'https://cdn.jsdelivr.net/npm/@ecomplus/storefront-app@2.0.0-beta.
|
|
240
|
+
appScript.src = 'https://cdn.jsdelivr.net/npm/@ecomplus/storefront-app@2.0.0-beta.190/dist/lib/js/app.js';
|
|
231
241
|
appScript.onload = onLoad;
|
|
232
242
|
document.body.appendChild(appScript);
|
|
233
243
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { SearchItem } from '@cloudcommerce/types';
|
|
2
|
+
import { ref, watch, shallowReactive } from 'vue';
|
|
3
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
4
|
+
import api from '@cloudcommerce/api';
|
|
5
|
+
import useStorage from '@@sf/state/use-storage';
|
|
6
|
+
|
|
7
|
+
const storageKey = 'ecomSeachHistory';
|
|
8
|
+
|
|
9
|
+
export const searchHistory = useStorage<string[]>(storageKey, []);
|
|
10
|
+
|
|
11
|
+
export const search = async ({
|
|
12
|
+
term,
|
|
13
|
+
params,
|
|
14
|
+
fields,
|
|
15
|
+
url = 'search/v1',
|
|
16
|
+
}: {
|
|
17
|
+
term: string,
|
|
18
|
+
params?: Record<string, any>,
|
|
19
|
+
fields?: readonly string[],
|
|
20
|
+
url?: 'search/v1' | `search/v1?${string}`,
|
|
21
|
+
}) => {
|
|
22
|
+
term = term.trim();
|
|
23
|
+
if (term.length < 2) {
|
|
24
|
+
return { data: { result: [], meta: null } };
|
|
25
|
+
}
|
|
26
|
+
const response = await api.get(url, {
|
|
27
|
+
fields,
|
|
28
|
+
params: {
|
|
29
|
+
...params,
|
|
30
|
+
term,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
if (response.data.result.length && !searchHistory.includes(term)) {
|
|
34
|
+
const termIndex = searchHistory.findIndex((_term) => term.startsWith(_term));
|
|
35
|
+
if (termIndex > -1) {
|
|
36
|
+
searchHistory[termIndex] = term;
|
|
37
|
+
} else {
|
|
38
|
+
searchHistory.unshift(term);
|
|
39
|
+
}
|
|
40
|
+
while (searchHistory.length > 20) {
|
|
41
|
+
searchHistory.pop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return response;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export class SearchEngine {
|
|
48
|
+
url: 'search/v1' | `search/v1?${string}`;
|
|
49
|
+
fields?: readonly string[];
|
|
50
|
+
term = ref('');
|
|
51
|
+
params = shallowReactive<Record<string, any>>({});
|
|
52
|
+
pageSize = ref(24);
|
|
53
|
+
pageNumber = ref(1);
|
|
54
|
+
products = shallowReactive<SearchItem[]>([]);
|
|
55
|
+
#search: ReturnType<typeof useDebounceFn<typeof search>>;
|
|
56
|
+
constructor({
|
|
57
|
+
fields,
|
|
58
|
+
url = 'search/v1',
|
|
59
|
+
debounce = 150,
|
|
60
|
+
}: {
|
|
61
|
+
fields?: readonly string[],
|
|
62
|
+
url?: 'search/v1' | `search/v1?${string}`,
|
|
63
|
+
debounce?: number,
|
|
64
|
+
} = {}) {
|
|
65
|
+
this.fields = fields;
|
|
66
|
+
this.url = url;
|
|
67
|
+
this.products = shallowReactive([]);
|
|
68
|
+
this.#search = useDebounceFn(search, debounce);
|
|
69
|
+
watch([this.term, this.params], () => {
|
|
70
|
+
this.pageNumber.value = 1;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async fetch(term?: string) {
|
|
75
|
+
if (term && term !== this.term.value) {
|
|
76
|
+
this.term.value = term;
|
|
77
|
+
this.pageNumber.value = 1;
|
|
78
|
+
}
|
|
79
|
+
const limit = this.pageSize.value;
|
|
80
|
+
const offset = limit * (this.pageNumber.value - 1);
|
|
81
|
+
const response = await this.#search({
|
|
82
|
+
term: this.term.value,
|
|
83
|
+
params: {
|
|
84
|
+
limit,
|
|
85
|
+
offset,
|
|
86
|
+
...this.params,
|
|
87
|
+
},
|
|
88
|
+
url: this.url,
|
|
89
|
+
fields: this.fields,
|
|
90
|
+
});
|
|
91
|
+
if (response) {
|
|
92
|
+
const { data } = response;
|
|
93
|
+
if (data.meta) {
|
|
94
|
+
this.products.splice(0);
|
|
95
|
+
}
|
|
96
|
+
data.result.forEach((item) => this.products.push(item));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default SearchEngine;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Products, CartSet, SearchItem } from '@cloudcommerce/api/types';
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import {
|
|
2
|
+
import { computed, watch } from 'vue';
|
|
3
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
4
4
|
import mitt from 'mitt';
|
|
5
5
|
import useStorage from '@@sf/state/use-storage';
|
|
6
6
|
import addItem from '@@sf/state/shopping-cart/add-cart-item';
|
|
@@ -11,79 +11,31 @@ const storageKey = 'ecomShoppingCart';
|
|
|
11
11
|
const emptyCart = {
|
|
12
12
|
items: [],
|
|
13
13
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const cartItems = computed(() => {
|
|
17
|
-
return cart.items.map((item) => {
|
|
18
|
-
let finalPrice = item.kit_product?.price && item.kit_product.pack_quantity
|
|
19
|
-
? item.kit_product.price / item.kit_product.pack_quantity
|
|
20
|
-
: item.price;
|
|
21
|
-
if (Array.isArray(item.customizations)) {
|
|
22
|
-
item.customizations.forEach((customization) => {
|
|
23
|
-
if (customization.add_to_price) {
|
|
24
|
-
const { type, addition } = customization.add_to_price;
|
|
25
|
-
finalPrice += type === 'fixed'
|
|
26
|
-
? addition
|
|
27
|
-
: item.price * (addition / 100);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
item.final_price = finalPrice;
|
|
32
|
-
const min = item.min_quantity || 1;
|
|
33
|
-
const max = item.max_quantity;
|
|
34
|
-
if (
|
|
35
|
-
typeof item.quantity !== 'number'
|
|
36
|
-
|| Number.isNaN(item.quantity)
|
|
37
|
-
|| item.quantity < min
|
|
38
|
-
) {
|
|
39
|
-
item.quantity = min;
|
|
40
|
-
} else if (max && item.quantity > max) {
|
|
41
|
-
item.quantity = max;
|
|
42
|
-
}
|
|
43
|
-
return item;
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
const subtotal = computed(() => {
|
|
47
|
-
return cartItems.value.reduce((acc, item) => {
|
|
48
|
-
return acc + (item.quantity * (item.final_price || item.price));
|
|
49
|
-
}, 0);
|
|
50
|
-
});
|
|
14
|
+
const shoppingCart = useStorage<CartSet>(storageKey, emptyCart);
|
|
51
15
|
const totalItems = computed(() => {
|
|
52
|
-
return
|
|
16
|
+
return shoppingCart.items.reduce((acc, item) => {
|
|
53
17
|
return acc + item.quantity;
|
|
54
18
|
}, 0);
|
|
55
19
|
});
|
|
56
|
-
const shoppingCart = computed({
|
|
57
|
-
get() {
|
|
58
|
-
return {
|
|
59
|
-
...cart,
|
|
60
|
-
subtotal: subtotal.value,
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
set(newCart) {
|
|
64
|
-
Object.assign(cart, newCart, {
|
|
65
|
-
subtotal: subtotal.value,
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
20
|
|
|
70
21
|
const addCartItem = (newItem: CartItem) => {
|
|
71
|
-
|
|
72
|
-
const upsertedItem = addItem(cartObj, newItem);
|
|
73
|
-
if (upsertedItem) {
|
|
74
|
-
// Force reactivity
|
|
75
|
-
shoppingCart.value.items = cartObj.items;
|
|
76
|
-
}
|
|
22
|
+
addItem(shoppingCart, newItem);
|
|
77
23
|
};
|
|
78
24
|
const removeCartItem = (itemId: string) => {
|
|
79
|
-
for (let i = 0; i < shoppingCart.
|
|
80
|
-
const item = shoppingCart.
|
|
25
|
+
for (let i = 0; i < shoppingCart.items.length; i++) {
|
|
26
|
+
const item = shoppingCart.items[i];
|
|
81
27
|
if (item._id === itemId) {
|
|
82
|
-
shoppingCart.
|
|
28
|
+
shoppingCart.items.splice(i, 1);
|
|
83
29
|
break;
|
|
84
30
|
}
|
|
85
31
|
}
|
|
86
32
|
};
|
|
33
|
+
const resetCartItems = (items?: CartItem[]) => {
|
|
34
|
+
while (shoppingCart.items.length) {
|
|
35
|
+
shoppingCart.items.pop();
|
|
36
|
+
}
|
|
37
|
+
items?.forEach(addCartItem);
|
|
38
|
+
};
|
|
87
39
|
const addProductToCart = (
|
|
88
40
|
product: (Partial<Products> | Partial<SearchItem>) & { _id: Products['_id'] },
|
|
89
41
|
variationId?: Products['_id'],
|
|
@@ -97,6 +49,7 @@ export {
|
|
|
97
49
|
shoppingCart,
|
|
98
50
|
addCartItem,
|
|
99
51
|
removeCartItem,
|
|
52
|
+
resetCartItems,
|
|
100
53
|
parseProduct,
|
|
101
54
|
addProductToCart,
|
|
102
55
|
};
|
|
@@ -106,9 +59,9 @@ type CartEvent = {
|
|
|
106
59
|
removeCartItem: CartItem,
|
|
107
60
|
};
|
|
108
61
|
const cartEmitter = mitt<CartEvent>();
|
|
109
|
-
const cloneItems = () => shoppingCart.
|
|
62
|
+
const cloneItems = () => shoppingCart.items.map((item) => ({ ...item }));
|
|
110
63
|
let oldItems = cloneItems();
|
|
111
|
-
|
|
64
|
+
const emitCartEvents = useDebounceFn((items: CartItem[]) => {
|
|
112
65
|
['addCartItem' as const, 'removeCartItem' as const].forEach((evName) => {
|
|
113
66
|
const isAdd = evName === 'addCartItem';
|
|
114
67
|
const baseItems = isAdd ? items : oldItems;
|
|
@@ -126,7 +79,41 @@ watchDebounced(shoppingCart, ({ items }) => {
|
|
|
126
79
|
});
|
|
127
80
|
});
|
|
128
81
|
oldItems = cloneItems();
|
|
129
|
-
},
|
|
82
|
+
}, 200);
|
|
83
|
+
|
|
84
|
+
watch(shoppingCart.items, (items) => {
|
|
85
|
+
items.forEach((item) => {
|
|
86
|
+
let finalPrice = item.kit_product?.price && item.kit_product.pack_quantity
|
|
87
|
+
? item.kit_product.price / item.kit_product.pack_quantity
|
|
88
|
+
: item.price;
|
|
89
|
+
if (Array.isArray(item.customizations)) {
|
|
90
|
+
item.customizations.forEach((customization) => {
|
|
91
|
+
if (customization.add_to_price) {
|
|
92
|
+
const { type, addition } = customization.add_to_price;
|
|
93
|
+
finalPrice += type === 'fixed'
|
|
94
|
+
? addition
|
|
95
|
+
: item.price * (addition / 100);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
item.final_price = finalPrice;
|
|
100
|
+
const min = item.min_quantity || 1;
|
|
101
|
+
const max = item.max_quantity;
|
|
102
|
+
if (
|
|
103
|
+
typeof item.quantity !== 'number'
|
|
104
|
+
|| Number.isNaN(item.quantity)
|
|
105
|
+
|| item.quantity < min
|
|
106
|
+
) {
|
|
107
|
+
item.quantity = min;
|
|
108
|
+
} else if (max && item.quantity > max) {
|
|
109
|
+
item.quantity = max;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
shoppingCart.subtotal = items.reduce((acc, item) => {
|
|
113
|
+
return acc + (item.quantity * (item.final_price || item.price));
|
|
114
|
+
}, 0);
|
|
115
|
+
emitCartEvents(items);
|
|
116
|
+
});
|
|
130
117
|
|
|
131
118
|
export const cartEvents = {
|
|
132
119
|
on: cartEmitter.on,
|
|
@@ -11,6 +11,7 @@ export const trackingIds: {
|
|
|
11
11
|
g_session_id?: string,
|
|
12
12
|
fbclid?: string,
|
|
13
13
|
fbp?: string,
|
|
14
|
+
ttclid?: string,
|
|
14
15
|
client_id?: string,
|
|
15
16
|
session_id?: string,
|
|
16
17
|
} = {};
|
|
@@ -242,7 +243,7 @@ export const useAnalytics = () => {
|
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
const url = new URL(window.location.toString());
|
|
245
|
-
['gclid', 'fbclid'].forEach((key) => {
|
|
246
|
+
['gclid', 'fbclid', 'ttclid'].forEach((key) => {
|
|
246
247
|
const id = trackingIds[key] || url.searchParams.get(key);
|
|
247
248
|
if (id) {
|
|
248
249
|
trackingIds[key] = id;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { reactive
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
import { watchDebounced } from '@vueuse/core';
|
|
2
3
|
|
|
3
4
|
const useStorage = <T extends {}>(
|
|
4
5
|
key: string,
|
|
@@ -19,8 +20,10 @@ const useStorage = <T extends {}>(
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
const state = reactive<T>(persistedValue || initialValue);
|
|
22
|
-
|
|
23
|
+
watchDebounced(state, () => {
|
|
23
24
|
storage.setItem(key, JSON.stringify(state));
|
|
25
|
+
}, {
|
|
26
|
+
debounce: 50,
|
|
24
27
|
});
|
|
25
28
|
return state;
|
|
26
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,EACJ,aAAa,EACb,mBAAmB,GACpB,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhB,MAAM,MAAM,GAAG,aAAa,IAAI,UAAU,CAAC;AAC3C,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAExD,IAAI,SAAS,GAAG,mBAAmB,CAAC;AACpC,IAAI,CAAC,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,EACJ,aAAa,EACb,mBAAmB,GACpB,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhB,MAAM,MAAM,GAAG,aAAa,IAAI,UAAU,CAAC;AAC3C,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAExD,IAAI,SAAS,GAAG,mBAAmB,CAAC;AACpC,IAAI,CAAC,SAAS,EAAE,CAAC;IACf,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAC3B,EAAE,CAAC,YAAY,CACb,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAClC,EAAE,QAAQ,EAAE,OAAO,EAAE,CACtB,CACF,CAAC;QACF,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC1C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,SAAS,GAAG,YAAY,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,MAAM,OAAO,GAAG,yBAAyB,SAAS,IAAI,MAAM,EAAE,CAAC;AAC/D,MAAM,UAAU,GAAG,GAAG,OAAO,UAAU,CAAC;AACxC,MAAM,WAAW,GAAG,GAAG,OAAO,WAAW,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,GACZ,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
const ga4Axios = axios.create({
|
|
4
|
-
baseURL: 'https://www.google-analytics.com',
|
|
5
|
-
headers: {
|
|
6
|
-
'Content-Type': 'application/json',
|
|
7
|
-
},
|
|
8
|
-
});
|
|
9
|
-
const url = `/mp/collect?api_secret=${process.env.GA_API_TOKEN}`
|
|
10
|
-
+ `&measurement_id=${process.env.GA_MEASUREMENT_ID}`;
|
|
11
|
-
const sendEvent = (analyticsEvents, clientId, sessionId, utm) => {
|
|
12
|
-
if (process.env.GA_API_TOKEN && process.env.GA_MEASUREMENT_ID) {
|
|
13
|
-
const requests = [];
|
|
14
|
-
let events = [];
|
|
15
|
-
analyticsEvents.forEach((event, index) => {
|
|
16
|
-
if (event.params) {
|
|
17
|
-
Object.assign(event.params, { session_id: sessionId });
|
|
18
|
-
}
|
|
19
|
-
const body = event;
|
|
20
|
-
if (body.name === 'page_view') {
|
|
21
|
-
body.name = 'campaign_details';
|
|
22
|
-
body.params = {
|
|
23
|
-
source: utm?.source,
|
|
24
|
-
medium: utm?.medium,
|
|
25
|
-
campaign: utm?.campaign,
|
|
26
|
-
term: utm?.term,
|
|
27
|
-
content: utm?.content,
|
|
28
|
-
session_id: sessionId,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
events.push(body);
|
|
32
|
-
if (events.length === 25 || index === analyticsEvents.length - 1) {
|
|
33
|
-
events.push(body);
|
|
34
|
-
requests.push(ga4Axios.post(url, {
|
|
35
|
-
client_id: clientId,
|
|
36
|
-
events,
|
|
37
|
-
}));
|
|
38
|
-
events = [];
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return requests;
|
|
42
|
-
}
|
|
43
|
-
// throw new Error('Google Analytics credentials not found');
|
|
44
|
-
return null;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default sendEvent;
|
|
48
|
-
// # sourceMappingURL=google-analytics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google-analytics.js","sourceRoot":"","sources":["../../src/analytics-providers/google-analytics.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,GAAG,GAAG,0BAA0B,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;MAC5D,mBAAmB,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;AAEvD,MAAM,SAAS,GAAG,CAChB,eAAiC,EACjC,QAAgB,EAChB,SAAiB,EACjB,GAMC,EACD,EAAE;IACF,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;QAC7D,MAAM,QAAQ,GAAuC,EAAE,CAAC;QACxD,IAAI,MAAM,GAAqB,EAAE,CAAC;QAElC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACvC,IAAI,KAAK,CAAC,MAAM,EAAE;gBAChB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;aACxD;YAED,MAAM,IAAI,GAAG,KAAK,CAAC;YACnB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;gBAC7B,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;gBAC/B,IAAI,CAAC,MAAM,GAAG;oBACZ,MAAM,EAAE,GAAG,EAAE,MAAM;oBACnB,MAAM,EAAE,GAAG,EAAE,MAAM;oBACnB,QAAQ,EAAE,GAAG,EAAE,QAAQ;oBACvB,IAAI,EAAE,GAAG,EAAE,IAAI;oBACf,OAAO,EAAE,GAAG,EAAE,OAAO;oBACrB,UAAU,EAAE,SAAS;iBACtB,CAAC;aACH;YAED,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,IAAI,KAAK,KAAK,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;gBAChE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,QAAQ,CAAC,IAAI,CACX,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE;oBACjB,SAAS,EAAE,QAAQ;oBACnB,MAAM;iBACP,CAAC,CACH,CAAC;gBACF,MAAM,GAAG,EAAE,CAAC;aACb;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;KACjB;IACD,6DAA6D;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
const version = 'v18.0';
|
|
4
|
-
const metaAxios = axios.create({
|
|
5
|
-
baseURL: `https://graph.facebook.com/${version}`,
|
|
6
|
-
headers: {
|
|
7
|
-
'Content-Type': 'application/json',
|
|
8
|
-
},
|
|
9
|
-
});
|
|
10
|
-
const url = `/${process.env.FB_PIXEL_ID}/events?access_token=${process.env.FB_GRAPH_TOKEN}`;
|
|
11
|
-
const sendEvent = (metaEvents, pageLocation, userData) => {
|
|
12
|
-
if (process.env.FB_PIXEL_ID && process.env.FB_GRAPH_TOKEN) {
|
|
13
|
-
const requests = [];
|
|
14
|
-
let data = [];
|
|
15
|
-
metaEvents.forEach((event, index) => {
|
|
16
|
-
const body = event;
|
|
17
|
-
if (body.name === 'PageView') {
|
|
18
|
-
body.name = 'Lead';
|
|
19
|
-
body.params = {
|
|
20
|
-
content_name: event.params?.page_title,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
data.push({
|
|
24
|
-
event_name: body.name,
|
|
25
|
-
event_time: Date.now(),
|
|
26
|
-
event_source_url: pageLocation,
|
|
27
|
-
action_source: 'website',
|
|
28
|
-
user_data: userData,
|
|
29
|
-
custom_data: body.params,
|
|
30
|
-
});
|
|
31
|
-
if (data.length === 1000 || index === metaEvents.length - 1) {
|
|
32
|
-
requests.push(metaAxios.post(url, { data }));
|
|
33
|
-
data = [];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return requests;
|
|
37
|
-
}
|
|
38
|
-
// throw new Error('Meta credentials not found');
|
|
39
|
-
return null;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// https://developers.facebook.com/docs/meta-pixel/reference#standard-events
|
|
43
|
-
export default sendEvent;
|
|
44
|
-
// # sourceMappingURL=meta-conversions-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta-conversions-api.js","sourceRoot":"","sources":["../../src/analytics-providers/meta-conversions-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,8BAA8B,OAAO,EAAE;IAChD,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,wBAAwB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;AAE5F,MAAM,SAAS,GAAG,CAChB,UAA4B,EAC5B,YAAoB,EACpB,QAA6C,EAE7C,EAAE;IACF,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;QACzD,MAAM,QAAQ,GAAuC,EAAE,CAAC;QACxD,IAAI,IAAI,GAA2B,EAAE,CAAC;QAEtC,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAClC,MAAM,IAAI,GAAG,KAAK,CAAC;YACnB,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;gBAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;gBACnB,IAAI,CAAC,MAAM,GAAG;oBACZ,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU;iBACvC,CAAC;aACH;YAED,IAAI,CAAC,IAAI,CAAC;gBACR,UAAU,EAAE,IAAI,CAAC,IAAI;gBACrB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gBACtB,gBAAgB,EAAE,YAAY;gBAC9B,aAAa,EAAE,SAAS;gBACxB,SAAS,EAAE,QAAQ;gBACnB,WAAW,EAAE,IAAI,CAAC,MAAM;aACzB,CAAC,CAAC;YAEH,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3D,QAAQ,CAAC,IAAI,CACX,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAC9B,CAAC;gBACF,IAAI,GAAG,EAAE,CAAC;aACX;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;KACjB;IACD,iDAAiD;IACjD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,4EAA4E;AAC5E,eAAe,SAAS,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { AnalyticsEvent } from '../analytics-events';
|
|
2
|
-
import axios, { AxiosResponse } from 'axios';
|
|
3
|
-
|
|
4
|
-
const ga4Axios = axios.create({
|
|
5
|
-
baseURL: 'https://www.google-analytics.com',
|
|
6
|
-
headers: {
|
|
7
|
-
'Content-Type': 'application/json',
|
|
8
|
-
},
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const url = `/mp/collect?api_secret=${process.env.GA_API_TOKEN}`
|
|
12
|
-
+ `&measurement_id=${process.env.GA_MEASUREMENT_ID}`;
|
|
13
|
-
|
|
14
|
-
const sendEvent = (
|
|
15
|
-
analyticsEvents: AnalyticsEvent[],
|
|
16
|
-
clientId: string,
|
|
17
|
-
sessionId: string,
|
|
18
|
-
utm?: {
|
|
19
|
-
source?: string,
|
|
20
|
-
medium?: string,
|
|
21
|
-
campaign?: string,
|
|
22
|
-
term?: string,
|
|
23
|
-
content?: string
|
|
24
|
-
},
|
|
25
|
-
) => {
|
|
26
|
-
if (process.env.GA_API_TOKEN && process.env.GA_MEASUREMENT_ID) {
|
|
27
|
-
const requests: Promise<AxiosResponse<any, any>>[] = [];
|
|
28
|
-
let events: AnalyticsEvent[] = [];
|
|
29
|
-
|
|
30
|
-
analyticsEvents.forEach((event, index) => {
|
|
31
|
-
if (event.params) {
|
|
32
|
-
Object.assign(event.params, { session_id: sessionId });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const body = event;
|
|
36
|
-
if (body.name === 'page_view') {
|
|
37
|
-
body.name = 'campaign_details';
|
|
38
|
-
body.params = {
|
|
39
|
-
source: utm?.source,
|
|
40
|
-
medium: utm?.medium,
|
|
41
|
-
campaign: utm?.campaign,
|
|
42
|
-
term: utm?.term,
|
|
43
|
-
content: utm?.content,
|
|
44
|
-
session_id: sessionId,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
events.push(body);
|
|
49
|
-
if (events.length === 25 || index === analyticsEvents.length - 1) {
|
|
50
|
-
events.push(body);
|
|
51
|
-
requests.push(
|
|
52
|
-
ga4Axios.post(url, {
|
|
53
|
-
client_id: clientId,
|
|
54
|
-
events,
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
events = [];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return requests;
|
|
62
|
-
}
|
|
63
|
-
// throw new Error('Google Analytics credentials not found');
|
|
64
|
-
return null;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default sendEvent;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { AnalyticsEvent } from '../analytics-events';
|
|
2
|
-
import axios, { AxiosResponse } from 'axios';
|
|
3
|
-
|
|
4
|
-
const version = 'v18.0';
|
|
5
|
-
const metaAxios = axios.create({
|
|
6
|
-
baseURL: `https://graph.facebook.com/${version}`,
|
|
7
|
-
headers: {
|
|
8
|
-
'Content-Type': 'application/json',
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const url = `/${process.env.FB_PIXEL_ID}/events?access_token=${process.env.FB_GRAPH_TOKEN}`;
|
|
13
|
-
|
|
14
|
-
const sendEvent = (
|
|
15
|
-
metaEvents: AnalyticsEvent[],
|
|
16
|
-
pageLocation: string,
|
|
17
|
-
userData: { [x: string]: string | undefined },
|
|
18
|
-
|
|
19
|
-
) => {
|
|
20
|
-
if (process.env.FB_PIXEL_ID && process.env.FB_GRAPH_TOKEN) {
|
|
21
|
-
const requests: Promise<AxiosResponse<any, any>>[] = [];
|
|
22
|
-
let data: { [x: string]: any }[] = [];
|
|
23
|
-
|
|
24
|
-
metaEvents.forEach((event, index) => {
|
|
25
|
-
const body = event;
|
|
26
|
-
if (body.name === 'PageView') {
|
|
27
|
-
body.name = 'Lead';
|
|
28
|
-
body.params = {
|
|
29
|
-
content_name: event.params?.page_title,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
data.push({
|
|
34
|
-
event_name: body.name,
|
|
35
|
-
event_time: Date.now(),
|
|
36
|
-
event_source_url: pageLocation,
|
|
37
|
-
action_source: 'website',
|
|
38
|
-
user_data: userData,
|
|
39
|
-
custom_data: body.params,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
if (data.length === 1000 || index === metaEvents.length - 1) {
|
|
43
|
-
requests.push(
|
|
44
|
-
metaAxios.post(url, { data }),
|
|
45
|
-
);
|
|
46
|
-
data = [];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
return requests;
|
|
51
|
-
}
|
|
52
|
-
// throw new Error('Meta credentials not found');
|
|
53
|
-
return null;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// https://developers.facebook.com/docs/meta-pixel/reference#standard-events
|
|
57
|
-
export default sendEvent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as U,d as G,b as J}from"./index.fadf28bd.js";import{_ as q,d as K,B as X,o as B,a as Q,q as v,b as Y,n as $,i as c,j as h,t as D,c as F,k as Z,E as ee,Q as te,C as ae,l as oe,w as P,u as le,e as M,H as se,I as re}from"./_plugin-vue_export-helper.ee681fa8.js";const ne=K({__name:"CarouselControl",props:{isPrev:{type:Boolean,default:!1}},setup(r,{expose:u}){u();const{changeSlide:l}=X(L),t={changeSlide:l};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),ue=["aria-label","data-carousel-control"];function ie(r,u,l,t,n,o){return B(),Q("button",{type:"button","aria-label":l.isPrev?"Anterior":"Próximo",onClick:u[0]||(u[0]=m=>t.changeSlide(l.isPrev?-1:1)),class:$(["group absolute top-0 z-1",l.isPrev?"left-0":"right-0"]),"data-carousel-control":l.isPrev?"previous":"next"},[v(r.$slots,"default",{},()=>[Y("i",{class:$(["m-0",l.isPrev?"i-chevron-left group-active:-translate-x-1":"i-chevron-right group-active:translate-x-1"])},null,2)])],10,ue)}const ce=q(ne,[["render",ie]]),L=Symbol("carousel"),de=K({__name:"Carousel",props:{as:{default:"ul"},modelValue:{default:1},autoplay:{}},emits:["update:modelValue"],setup(r,{expose:u,emit:l}){u();const t=r,n=c(0);h(D(t,"modelValue"),e=>{n.value=e-1},{immediate:!0}),h(n,(e,a)=>{e!==a&&l("update:modelValue",e+1)});const o=c(null),{x:m,isScrolling:T,arrivedState:_}=U(o),W=F(()=>_.left),I=F(()=>_.right),s=c([]),g=c(0),p=c(0),k=c(0),V=()=>{o.value&&(g.value=o.value.scrollWidth,p.value=o.value.offsetWidth)},z=()=>{if(!o.value)return;let e=[...o.value.children];e.length===1&&e[0].tagName.endsWith("SLOT")&&(e=[...e[0].children]),s.value=e.map(a=>({offsetLeft:a.offsetLeft,width:a.offsetWidth}))},E=e=>{let a=n.value+e;if(a>=s.value.length)return 0;a<0&&(a=s.value.length+a);const{offsetLeft:y,width:d}=s.value[a]||{};return d?y:0},x=()=>{const e=s.value.findIndex(a=>Math.abs(a.offsetLeft-m.value)<=5);e>-1&&(n.value=e||0)},O=()=>{const e=g.value-p.value;k.value=s.value.findIndex(({offsetLeft:a})=>a>=e-5)};let i;const f=()=>{t.autoplay&&(clearTimeout(i),i=setTimeout(()=>{C(1)},t.autoplay))},C=(e,a=!0)=>{if(s.value.length<2)return;if(a&&(e===1||e===-1)){let d=0,A=0;for(let S=n.value;S<s.value.length;S++){const{width:H}=s.value[S]||{};if(H&&(d+=1,A+=H,A>=p.value))break}d&&(e=e>0?d:-d)}const y=E(e);o.value?.scrollTo({left:y,behavior:"smooth"}),f()};h(T,e=>{e?clearTimeout(i):(x(),f())});const R=c(null),N=G(R);h(N,e=>{e?clearTimeout(i):f()});const b=()=>{o.value&&(V(),z(),x(),O())},w=J(()=>{o.value&&(o.value.scrollLeft=0,b())},400);Z(()=>{b(),ee(()=>{o.value&&[...o.value.children].forEach(e=>{e.setAttribute("tabindex","0")})}),f(),window.addEventListener("resize",w)}),te(()=>{window.removeEventListener("resize",w),clearTimeout(i)}),ae(L,{autoplay:D(t,"autoplay"),changeSlide:C,isBoundLeft:W,isBoundRight:I});const j={carouselKey:L,props:t,emit:l,currentIndex:n,wrapper:o,currentPos:m,isScrolling:T,arrivedState:_,isBoundLeft:W,isBoundRight:I,slidesWidth:s,wrapperScrollWidth:g,wrapperVisibleWidth:p,indexCount:k,calcWrapperWidth:V,calcSlidesWidth:z,calcNextOffsetLeft:E,calcCurrentIndex:x,calcIndexCount:O,get autoplayTimer(){return i},set autoplayTimer(e){i=e},restartAutoplay:f,changeSlide:C,carousel:R,isHovered:N,calcOnInit:b,onResize:w,CarouselControl:ce};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}}),fe={ref:"carousel",class:"relative","data-carousel":""};function ve(r,u,l,t,n,o){return B(),Q("div",fe,[(B(),oe(le(l.as),{ref:"wrapper",class:"flex overflow-x-scroll overflow-y-hidden list-none m-0 p-0 snap-x snap-mandatory scroll-smooth [&>*]:snap-start [&>*]:outline-none",style:{"scrollbar-width":"none","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"none"},"data-carousel-wrapper":""},{default:P(()=>[v(r.$slots,"default")]),_:3},512)),v(r.$slots,"controls",se(re({changeSlide:t.changeSlide,isBoundLeft:t.isBoundLeft,isBoundRight:t.isBoundRight,currentPage:t.currentIndex+1,pageCount:t.indexCount+1})),()=>[M(t.CarouselControl,{"is-prev":""},{default:P(()=>[v(r.$slots,"previous")]),_:3}),M(t.CarouselControl,null,{default:P(()=>[v(r.$slots,"next")]),_:3})])],512)}const me=q(de,[["render",ve]]);export{me as C,ce as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as g,c as m,_ as x,o as i,a as c,q as b,B as P,F as v,y as h,p as C,i as F,C as j,b as a,x as d,H as w,I as M,f as q,$ as Q,e as _,w as y,r as B,l as z,h as k,g as L}from"./_plugin-vue_export-helper.ee681fa8.js";import{f as N}from"./modules-info.df822732.js";import{p as U,r as A,s as O,t as $}from"./api.a2eda23e.js";import{g as T,P as V}from"./Prices.78eb0a61.js";import{g as E}from"./img.ec6ba316.js";import{e as D}from"./index.fadf28bd.js";import"./session-utm.744b0db3.js";import"./format-money.923559cc.js";const R=g({__name:"CheckoutLink",props:{to:{default:"cart"},cartUrl:{default:globalThis.$storefront.settings.cart_url||"/app/#/cart"},checkoutUrl:{default:globalThis.$storefront.settings.checkout_url||"/app/#/checkout"}},setup(r,{expose:s}){s();const t=r,e=m(()=>t.to==="cart"?t.cartUrl:t.checkoutUrl),n={props:t,href:e};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),H=["href"];function K(r,s,t,e,n,l){return i(),c("a",{href:e.href},[b(r.$slots,"default")],8,H)}const G=x(R,[["render",K]]),J=r=>{const s=m(()=>!r.item&&r.product?U(r.product):null),t=m(()=>r.item||s.value),e=m(()=>T(t.value)),n=m(()=>{const{slug:u}=t.value;return typeof u=="string"?`/${u}`:null}),l=m(()=>{if(t.value.picture)return E(t.value.picture,void 0,r.pictureSize||"small")}),o=m(()=>t.value.final_price||t.value.price);return{cartItem:t,title:e,link:n,image:l,finalPrice:o}},W=g({__name:"QuantitySelectorControl",props:{isMinus:{type:Boolean}},setup(r,{expose:s}){s();const{value:t,isBoundMin:e,isBoundMax:n}=P(S),l={value:t,isBoundMin:e,isBoundMax:n};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}}),X=["data-quantity-selector-control","aria-label","disabled"];function Y(r,s,t,e,n,l){return i(),c("button",{type:"button",class:"w-10 h-12 text-xl leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40","data-quantity-selector-control":t.isMinus?"minus":"plus","aria-label":t.isMinus?"Menos":"Mais",disabled:t.isMinus?e.isBoundMin:e.isBoundMax,onClick:s[0]||(s[0]=C(o=>e.value+=t.isMinus?-1:1,["prevent"]))},[b(r.$slots,"default",{},()=>[t.isMinus?(i(),c(v,{key:0},[h("−")],64)):(i(),c(v,{key:1},[h("+")],64))])],8,X)}const Z=x(W,[["render",Y]]),S=Symbol("quantitySelector"),ee=g({__name:"QuantitySelector",props:{modelValue:{default:1},min:{default:1},max:{},step:{},disabled:{type:Boolean},readonly:{type:Boolean}},emits:["update:modelValue"],setup(r,{expose:s,emit:t}){s();const e=r,n=F(null),l=`NInput${D()}`,o=m({get(){return e.modelValue},set(f){f<e.min&&(f=e.min,n.value.value=`${f}`),e.max&&f>e.max&&(f=e.max,n.value.value=`${f}`),t("update:modelValue",f)}}),u=m(()=>e.min>=o.value),p=m(()=>e.max<=o.value);j(S,{value:o,isBoundMin:u,isBoundMax:p});const I={quantitySelectorKey:S,props:e,emit:t,input:n,inputId:l,value:o,isBoundMin:u,isBoundMax:p,QuantitySelectorControl:Z};return Object.defineProperty(I,"__isScriptSetup",{enumerable:!1,value:!0}),I}}),te={"data-quantity-selector":""},re={class:"flex items-center"},se=["min","max","step","disabled","readonly"];function ae(r,s,t,e,n,l){return i(),c("div",te,[b(r.$slots,"label",w(M({inputId:e.inputId,value:e.value})),()=>[a("label",{for:e.inputId,class:"sr-only"},d("Quantidade"))]),a("div",re,[q(a("input",{ref:"input",type:"number",id:e.inputId,"onUpdate:modelValue":s[0]||(s[0]=o=>e.value=o),min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:"h-12 w-14 px-2 text-lg border-transparent text-center [-moz-appearance:_textfield] [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none"},null,8,se),[[Q,e.value]]),b(r.$slots,"controls",w(M({value:e.value,isBoundMin:e.isBoundMin,isBoundMax:e.isBoundMax})),()=>[_(e.QuantitySelectorControl,{"is-minus":"",class:"order-first"},{default:y(()=>[b(r.$slots,"minus")]),_:3}),_(e.QuantitySelectorControl,{class:"order-last"},{default:y(()=>[b(r.$slots,"plus")]),_:3})])])])}const ne=x(ee,[["render",ae]]),oe=g({__name:"CartItem",props:{item:{},product:{},pictureSize:{}},setup(r,{expose:s}){s();const t=r,{cartItem:e,title:n,link:l,image:o,finalPrice:u}=J(t),p={props:t,cartItem:e,title:n,link:l,image:o,finalPrice:u,get removeCartItem(){return A},QuantitySelector:ne,Prices:V};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),ie={class:"relative bg-white shadow-sm"},le={class:"py-2 flex-auto text-sm text-base-700 group-hover:text-base-900 group-hover:underline"},ce=a("span",{class:"w-5 h-5 text-sm leading-none flex flex-col justify-center rounded-full border-3 text-danger-800 border-danger-700/30"},[a("i",{class:"i-close my-0 mx-auto"})],-1),ue=[ce],de={class:"flex justify-between items-center border-t-2 border-base-100"},me={class:"border-r-2 border-base-100"};function pe(r,s,t,e,n,l){const o=B("AImg"),u=B("ALink");return i(),c("article",ie,[_(u,{href:e.link,class:"flex items-center gap-5 p-4 group"},{default:y(()=>[e.image?(i(),z(o,{key:0,picture:e.image,alt:e.title,class:"w-20 h-20 object-cover"},null,8,["picture","alt"])):k("",!0),a("p",le,d(e.title),1)]),_:1},8,["href"]),e.cartItem._id?(i(),c("button",{key:0,onClick:s[0]||(s[0]=C(p=>e.removeCartItem(e.cartItem._id),["stop"])),class:"absolute top-0 right-0 p-2 opacity-70 hover:opacity-100","aria-label":"Remover"},ue)):k("",!0),a("div",de,[a("div",me,[_(e.QuantitySelector,{modelValue:e.cartItem.quantity,"onUpdate:modelValue":s[1]||(s[1]=p=>e.cartItem.quantity=p),min:e.cartItem.min_quantity,max:e.cartItem.max_quantity},null,8,["modelValue","min","max"])]),_(e.Prices,{"base-price":e.cartItem.base_price,price:e.finalPrice,"has-cashback":!1,"has-price-options":!1,class:"px-4 py-2.5 text-[95%] text-right"},null,8,["base-price","price"])])])}const _e=x(oe,[["render",pe]]),fe=g({__name:"CartSidebar",emits:["close"],setup(r,{expose:s,emit:t}){s();const e={emit:t,get freeShippingFromValue(){return N},get shoppingCart(){return O},get totalItems(){return $},CheckoutLink:G,Prices:V,CartItem:_e};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),be={class:"flex flex-col h-screen bg-white"},he={class:"px-6 py-4 flex justify-end items-center gap-3 shadow ring-1 ring-black/5 z-10"},ge=a("span",{class:"text-right text-base text-base-600 font-medium"},d("Meu carrinho de compras"),-1),xe={class:"min-w-[3rem] text-right"},ye={class:"ui-badge-pill-lg"},ve={class:"grow overflow-y-auto bg-base-50"},ke={key:0,class:"text-sm text-center"},Se={key:0,class:"p-3 secondary-subtle"},Ce=a("strong",{class:"lowercase"},d("Frete grátis"),-1),Ie={key:1,class:"p-3 bg-success-50 text-success-800"},we=a("i",{class:"text-success-900 i-check mr-1"},null,-1),Me={class:"px-4 pt-4 pb-2"},Be={class:"px-5 pt-4 pb-3 ring-2 ring-black/5 z-10"},Ve={class:"grid grid-cols-5 gap-3 items-center text-right"},Pe=a("div",{class:"col-span-2"},d("Subtotal"),-1),Fe=a("i",{class:"i-check mr-2"},null,-1),je=a("i",{class:"i-arrow-left mr-1"},null,-1);function qe(r,s,t,e,n,l){return i(),c("aside",be,[a("header",he,[ge,a("span",xe,[a("span",ye,d(e.totalItems),1)])]),a("article",ve,[e.freeShippingFromValue?(i(),c("div",ke,[e.freeShippingFromValue>e.shoppingCart.subtotal?(i(),c("div",Se,[h(d("Adicione $1 para ganhar".replace("$1",r.$money(e.freeShippingFromValue-e.shoppingCart.subtotal)))+" ",1),Ce])):(i(),c("div",Ie,[we,h(" "+d("Frete grátis a partir de")+" "+d(r.$money(e.freeShippingFromValue)),1)]))])):k("",!0),a("ul",Me,[(i(!0),c(v,null,L(e.shoppingCart.items,(o,u)=>(i(),c("li",{key:u},[_(e.CartItem,{item:o,class:"mb-3"},null,8,["item"])]))),128))])]),a("footer",Be,[a("div",Ve,[Pe,_(e.Prices,{price:e.shoppingCart.subtotal,class:"col-span-3 text-lg"},null,8,["price"])]),_(e.CheckoutLink,{class:"ui-btn-lg ui-btn-primary w-full text-right my-2.5"},{default:y(()=>[Fe,h(" "+d("Finalizar compra"))]),_:1}),a("a",{href:"#",onClick:s[0]||(s[0]=C(o=>e.emit("close"),["prevent"])),class:"ui-link text-base-500 hover:text-base-700 text-sm"},[je,h(" "+d("Continuar comprando"))])])])}const Te=x(fe,[["render",qe]]);export{Te as default};
|