cloudcommerce 0.35.1 → 0.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/renovate.json +10 -0
- package/CHANGELOG.md +16 -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/ssr/src/env.d.ts +2 -1
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +2 -2
- package/packages/api/package.json +1 -1
- 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/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/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/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/astro.config.mjs +4 -4
- package/packages/storefront/client.d.ts +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.54eaab04.js +1 -0
- package/packages/storefront/dist/client/_astro/{hoisted.799e5593.js → hoisted.c90fc6ab.js} +1 -1
- package/packages/storefront/dist/server/entry.mjs +2 -2
- package/packages/storefront/dist/server/{manifest_6bc0c00d.mjs → manifest_221d806b.mjs} +1 -1
- package/packages/storefront/package.json +3 -4
- package/packages/storefront/src/lib/components/Drawer.vue +1 -0
- package/packages/storefront/src/vue-globals.d.ts +1 -0
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.085a62c9.js +0 -1
package/.github/renovate.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"excludePackageNames": [
|
|
23
23
|
"astro",
|
|
24
|
+
"vue",
|
|
24
25
|
"typescript"
|
|
25
26
|
],
|
|
26
27
|
"excludePackagePrefixes": [
|
|
@@ -54,6 +55,15 @@
|
|
|
54
55
|
"matchPackagePrefixes": [
|
|
55
56
|
"@astrojs/"
|
|
56
57
|
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"groupName": "Vue",
|
|
61
|
+
"matchPackageNames": [
|
|
62
|
+
"vue"
|
|
63
|
+
],
|
|
64
|
+
"matchPackagePrefixes": [
|
|
65
|
+
"@vue/"
|
|
66
|
+
]
|
|
57
67
|
}
|
|
58
68
|
]
|
|
59
69
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.36.1](https://github.com/ecomplus/cloud-commerce/compare/v0.36.0...v0.36.1) (2023-12-03)
|
|
6
|
+
|
|
7
|
+
## [0.36.0](https://github.com/ecomplus/cloud-commerce/compare/v0.35.1...v0.36.0) (2023-12-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **storefront:** Store SSR `env.d.ts` should add `/// <reference types="@cloudcommerce/storefront/.auto-imports" />` to keep using Vue methods without manual imports on .vue/.astro/.mdx files
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **storefront:** Ensure Vue imports (no auto-import expected) on lib components ([c03ad92](https://github.com/ecomplus/cloud-commerce/commit/c03ad921e43f15faa119134e96507ca80be1cc17))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* **storefront:** Removing `.auto-import.d.ts` from `client.d.ts`, prevents internal errors ([34c1a4f](https://github.com/ecomplus/cloud-commerce/commit/34c1a4f921db777ac0a8e65fc501bebf78f73c32))
|
|
20
|
+
|
|
5
21
|
### [0.35.1](https://github.com/ecomplus/cloud-commerce/compare/v0.35.0...v0.35.1) (2023-12-02)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/passport": "^0.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.36.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.36.0",
|
|
20
|
+
"@cloudcommerce/passport": "^0.36.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.
|
|
20
|
+
"@cloudcommerce/api": "^0.36.0",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.36.0",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.36.0",
|
|
23
23
|
"@headlessui/vue": "^1.7.16"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cloudcommerce/i18n": "^0.
|
|
27
|
-
"@cloudcommerce/storefront": "^0.
|
|
28
|
-
"@cloudcommerce/types": "^0.
|
|
26
|
+
"@cloudcommerce/i18n": "^0.36.0",
|
|
27
|
+
"@cloudcommerce/storefront": "^0.36.0",
|
|
28
|
+
"@cloudcommerce/types": "^0.36.0",
|
|
29
29
|
"@fontsource/croissant-one": "^5.0.17",
|
|
30
30
|
"@iconify-json/mingcute": "^1.1.11",
|
|
31
31
|
"photoswipe": "^5.4.2"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="astro/client" />
|
|
2
2
|
/// <reference types="vite-plugin-pwa/client" />
|
|
3
3
|
/// <reference types="vue/ref-macros" />
|
|
4
4
|
/// <reference types="@cloudcommerce/storefront/client" />
|
|
5
5
|
/// <reference types="@cloudcommerce/storefront/server" />
|
|
6
|
+
/// <reference types="@cloudcommerce/storefront/.auto-imports" />
|
|
6
7
|
|
|
7
8
|
/* eslint-disable import/newline-after-import */
|
|
8
9
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/modules": "^0.
|
|
18
|
+
"@cloudcommerce/events": "^0.36.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.36.0",
|
|
20
|
+
"@cloudcommerce/modules": "^0.36.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.
|
|
26
|
+
"@cloudcommerce/cli": "^0.36.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.36.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.1",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite": "^4.5.0",
|
|
31
31
|
"vitest": "^0.34.6",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "0.
|
|
33
|
+
"@cloudcommerce/eslint": "0.36.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.1",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"firebase-admin": "^11.11.1",
|
|
38
38
|
"firebase-functions": "^4.5.0",
|
|
39
39
|
"mitt": "^3.0.1",
|
|
40
|
-
"vue": "
|
|
40
|
+
"vue": "3.3.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@cloudcommerce/types": "workspace:*",
|
|
@@ -182,10 +182,10 @@ const genAstroConfig = ({
|
|
|
182
182
|
}),
|
|
183
183
|
AutoImport({
|
|
184
184
|
include: [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
/^(?!@@).*\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
|
186
|
+
/^(?!@@).*\.vue$/, /^(?!@@).*\.vue\?vue/, // .vue
|
|
187
|
+
/^(?!@@).*\.mdx?$/, // .md, .mdx
|
|
188
|
+
/^(?!@@).*\.astro$/,
|
|
189
189
|
],
|
|
190
190
|
imports: ['vue'],
|
|
191
191
|
dts: isLibDev ? '.auto-imports.d.ts' : false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as C,w as V,a as I,e as Y,b as $,t as v}from"./use-analytics.cc95e346.js";import{a as H}from"./afetch.f4507208.js";import{u as R}from"./index.8ac1db99.js";import"./customer-session.5ab9ab1a.js";import"./sf-utils.b04e1813.js";import"./ecom-utils.5cbfb95e.js";import"./shopping-cart.d9f601dd.js";import"./price.04ceb6c4.js";import"./name.01410784.js";import"./i18n.29216eeb.js";const p={waiting:Promise.resolve(),params:{content_ids:[],content_name:""}},A=(t,e="BRL",n=!1)=>{const a={currency:e,content_category:t.item_category,content_name:t.item_name,value:t.price,content_type:"product"};return n?(a.contents=[{id:t.item_id,quantity:t.quantity}],Number(t.quantity)<0&&(a.value=0)):a.content_ids=[t.item_id],a},W=async({event:t})=>{if(t.name==="page_view")return p.waiting=new Promise(a=>{setTimeout(a,110)}),p.params.content_name=t.params.page_title,[{name:"PageView"}];const{items:e,currency:n}=t.params;if(t.name==="view_item"&&e){const a=e[0];if(a)return a.item_list_id==="product-page"?[{name:"ViewContent",params:A(a,n)}]:(e.forEach(({item_id:i})=>{p.params.content_ids.push(i)}),p.params.content_ids.length>e.length?[{name:null}]:(await p.waiting,[{name:"ViewContent",params:{...p.params,content_type:"product"}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const a=t.name==="add_to_cart";return e.map(i=>({name:"AddToCart",params:A({...i,quantity:a?i.quantity||1:-(i.quantity||1)},n,!0)}))}return[{name:null}]},h={waiting:Promise.resolve(),params:{description:"",contents:[]}},w=(t,e=!1)=>{const n={content_id:t.item_id,content_name:t.item_name,price:t.price,content_category:t.item_category,brand:t.item_brand};return e&&(n.quantity=t.quantity),n},D=async({event:t})=>{if(t.name==="page_view")return h.waiting=new Promise(a=>{setTimeout(a,110)}),h.params.description=t.params.page_title,[{name:"PageView"}];const{items:e,currency:n}=t.params;if(t.name==="view_item"&&e){const a=e[0];if(a)return a.item_list_id==="product-page"?[{name:"ViewContent",params:{contents:[w(a)],content_type:"product",currency:n,value:a.price}}]:(e.forEach(i=>{h.params.contents.push(w(i))}),h.params.contents.length>e.length?[{name:null}]:(await h.waiting,[{name:"ViewContent",params:{...h.params,content_type:"product",currency:n}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const a=t.name==="add_to_cart";return e.map(i=>{const l=i.quantity||1,{price:d}=i;return{name:"AddToCart",params:{contents:[w({...i,quantity:a?l:-l},!0)],content_type:"product",currency:n,value:a&&typeof d=="number"?l*d:0}}})}return[{name:null}]};let b=[];const F=R(()=>{H("/_analytics",{method:"post",body:{...I(),events:b}}),b=[]},200),_=t=>{b.push(t),F()};{C(),V(async n=>{const{name:a,params:i}=n.event;_({type:"gtag",name:a,params:i});const{gtag:l,dataLayer:d,fbq:s,ttq:c}=window;typeof l=="function"&&l("event",a,i),d&&typeof d.push=="function"&&d.push(["event",a,i]),(await W(n)).forEach(o=>{o.name&&(_({type:"fbq",...o}),typeof s=="function"&&s("track",o.name,o.params))}),(await D(n)).forEach(o=>{o.name&&(_({type:"ttk",...o}),typeof c?.page=="function"&&(o.name==="PageView"?c.page():c.track(o.name,o.params)))})});let t="";const e=()=>{const n=window.location.toString();n!==t&&(Y("page_view",{...$(),page_location:n,client_id:v.g_client_id||v.client_id}),t=n)};e(),window.addEventListener("storefront:apiContext",()=>{try{window.dataLayer.push(function(){this.reset(),e()})}catch{e()}})}const y=t=>history.replaceState(t,""),k=!!document.startViewTransition,g=()=>!!document.querySelector('[name="astro-view-transitions-enabled"]'),q=t=>document.dispatchEvent(new Event(t)),P=()=>q("astro:load"),f="data-astro-transition-persist";let m=history.state?.index||0;!history.state&&g()&&y({index:m,scrollY:0});const G=(t,e)=>{let n=!1,a=!1;return(...i)=>{if(n){a=!0;return}t(...i),n=!0,setTimeout(()=>{a&&(a=!1,t(...i)),n=!1},e)}};async function M(t){const e=await fetch(t),n=await e.text();return{ok:e.ok,html:n}}function x(){const t=document.querySelector('[name="astro-view-transitions-fallback"]');return t?t.getAttribute("content"):"animate"}function L(){for(const t of document.scripts)t.dataset.astroExec=""}function K(){let t=Promise.resolve();for(const e of Array.from(document.scripts)){if(e.dataset.astroExec==="")continue;const n=document.createElement("script");n.innerHTML=e.innerHTML;for(const a of e.attributes){if(a.name==="src"){const i=new Promise(l=>{n.onload=l});t=t.then(()=>i)}n.setAttribute(a.name,a.value)}n.dataset.astroExec="",e.replaceWith(n)}return t}const B=new DOMParser;async function T(t,e,n){const a=B.parseFromString(t,"text/html"),i=s=>{const c=s.getAttribute(f),u=c&&a.head.querySelector(`[${f}="${c}"]`);if(u)return u;if(s.matches("link[rel=stylesheet]")){const r=s.getAttribute("href");return a.head.querySelector(`link[rel=stylesheet][href="${r}"]`)}if(s.tagName==="SCRIPT"){let r=s;for(const o of a.scripts)if(r.textContent&&r.textContent===o.textContent||r.type===o.type&&r.src&&r.src===o.src)return o}return null},l=()=>{a.querySelectorAll("head noscript").forEach(r=>r.remove());const s=document.documentElement,c=[...s.attributes].filter(({name:r})=>(s.removeAttribute(r),r.startsWith("data-astro-")));[...a.documentElement.attributes,...c].forEach(({name:r,value:o})=>s.setAttribute(r,o));for(const r of Array.from(document.head.children)){const o=i(r);o?o.remove():r.remove()}document.head.append(...a.head.children);const u=document.body;document.body.replaceWith(a.body);for(const r of u.querySelectorAll(`[${f}]`)){const o=r.getAttribute(f),E=document.querySelector(`[${f}="${o}"]`);E&&E.replaceWith(r)}if(scrollTo({left:0,top:0,behavior:"instant"}),e?.scrollY===0&&location.hash){const r=decodeURIComponent(location.hash.slice(1)),o=document.getElementById(r);o&&(e.scrollY=o.offsetTop,y(e),o.scrollIntoView())}else e&&e.scrollY!==0&&scrollTo(0,e.scrollY);q("astro:beforeload")},d=[];for(const s of a.querySelectorAll("head link[rel=stylesheet]"))if(!document.querySelector(`[${f}="${s.getAttribute(f)}"], link[rel=stylesheet]`)){const c=document.createElement("link");c.setAttribute("rel","preload"),c.setAttribute("as","style"),c.setAttribute("href",s.getAttribute("href")),d.push(new Promise(u=>{["load","error"].forEach(r=>c.addEventListener(r,u)),document.head.append(c)}))}if(d.length&&await Promise.all(d),n==="animate"){let s=!1;addEventListener("animationstart",()=>s=!0,{once:!0}),document.documentElement.dataset.astroTransitionFallback="old",await new Promise(c=>{const u=()=>{removeEventListener("animationend",u),clearTimeout(r),l(),c(!0),document.documentElement.dataset.astroTransitionFallback="new"};addEventListener("animationend",u,{once:!0});let r=setTimeout(()=>!s&&u())})}else l()}async function S(t,e,n){let a;const{html:i,ok:l}=await M(e);if(!l){location.href=e;return}document.documentElement.dataset.astroTransition=t,k?a=document.startViewTransition(()=>T(i,n)).finished:a=T(i,n,x());try{await a}finally{await K(),L(),P()}}function N(t){if(document.querySelector(`link[rel=prefetch][href="${t}"]`))return;if(navigator.connection){let n=navigator.connection;if(n.saveData||/(2|3)g/.test(n.effectiveType||""))return}let e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.append(e)}(k||x()!=="none")&&!location.pathname.startsWith("/app/")&&(L(),document.addEventListener("click",t=>{let e=t.target;if(e instanceof Element&&e.tagName!=="A"&&(e=e.closest("a")),!e||!(e instanceof HTMLAnchorElement)||e.dataset.astroReload!==void 0||e.hasAttribute("download")||!e.href||e.pathname.startsWith("/app/")||e.target&&e.target!=="_self"||e.origin!==location.origin||t.button!==0||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||t.defaultPrevented||!g())return;if(location.pathname===e.pathname&&location.search===e.search){if(e.hash)return;if(t.preventDefault(),y({...history.state,scrollY}),scrollTo({left:0,top:0,behavior:"instant"}),location.hash){const a={index:++m,scrollY:0};history.pushState(a,"",e.href)}return}t.preventDefault(),S("forward",e.href,{index:++m,scrollY:0});const n={index:m,scrollY};y({index:m-1,scrollY}),history.pushState(n,"",e.href)}),addEventListener("popstate",t=>{if(!g()&&t.state){location.reload();return}if(t.state===null)return;const e=history.state,n=e?.index??m+1,a=n>m?"forward":"back";S(a,location.href,e),m=n}),["mouseenter","touchstart","focus"].forEach(t=>{document.addEventListener(t,e=>{if(e.target instanceof HTMLAnchorElement){let n=e.target;n.origin===location.origin&&n.pathname!==location.pathname&&!n.pathname.startsWith("/app/")&&n.dataset.astroReload===void 0&&!n.hasAttribute("download")&&n.role!=="button"&&g()&&N(n.pathname)}},{passive:!0,capture:!0})}),addEventListener("load",P),addEventListener("scroll",G(()=>{history.state&&y({...history.state,scrollY})},300),{passive:!0}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,s as E,c as p,b as N}from"./customer-session.5ab9ab1a.js";import{s as w}from"./shopping-cart.d9f601dd.js";import{g as v,e as I}from"./use-analytics.cc95e346.js";import{u as O}from"./afetch.f4507208.js";import{w as T}from"./ecom-utils.5cbfb95e.js";import"./hoisted.
|
|
1
|
+
import{a as b,s as E,c as p,b as N}from"./customer-session.5ab9ab1a.js";import{s as w}from"./shopping-cart.d9f601dd.js";import{g as v,e as I}from"./use-analytics.cc95e346.js";import{u as O}from"./afetch.f4507208.js";import{w as T}from"./ecom-utils.5cbfb95e.js";import"./hoisted.54eaab04.js";import"./sf-utils.b04e1813.js";import"./index.8ac1db99.js";import"./price.04ceb6c4.js";import"./name.01410784.js";import"./i18n.29216eeb.js";const R=o=>{let a="";if(typeof o=="object"&&o!==null){let i=Array.isArray(o.phones)?o.phones[0]:o;i&&i.number&&(i.country_code&&(a=`+${i.country_code} `),a+=i.number)}return a},k=R,M=()=>{const o=window.storefrontApp?.router;if(o){const a=()=>sessionStorage.getItem("st_discount_coupon")||void 0,i=s=>Math.round(s*100)/100,h=[],r=(s,t)=>{h.includes(s)||(h.push(s),t||(t={value:i(w.subtotal||0),items:w.items.map(v)}),s!=="view_cart"&&(t.coupon=a(),h.includes("begin_checkout")||r("begin_checkout")),I(s,t))};let g=!1;const m=(s,t)=>{if(!g){if(localStorage.getItem("gtag.orderIdSent")!==s){let _;if(t)try{_=JSON.parse(t)}catch{}const{amount:l}=_||window.storefrontApp,S={transaction_id:s,value:i(l?.total||w.subtotal||0),items:w.items.map(v),coupon:_?_.extra_discount?.discount_coupon:a()};l&&(l.freight!==void 0&&(S.shipping=i(l.freight)),l.tax!==void 0&&(S.tax=i(l.tax)));let A=1;const{dataLayer:y,__sendGTMExtraPurchaseData:P}=window;if(y&&P){const n={};let e;if(p){n.customerDisplayName=N.value;let c=p.value.name;if(!c?.given_name)try{const f=sessionStorage.getItem("ecomCustomerAccount");if(f){const C=JSON.parse(f);typeof C=="object"&&C&&(c=C.name)}}catch{}c&&(n.customerGivenName=c.given_name,n.customerFamilyName=c.family_name),n.customerEmail=p.value.main_email,n.customerPhone=k(p.value),e=p.value.addresses?.[0]}try{const c=sessionStorage.getItem("ecomCustomerAddress");if(c){const f=JSON.parse(c);typeof e=="object"&&e?Object.assign(e,f):e=f}}catch{}e&&e.zip&&(n.shippingAddrZip=e.zip,n.shippingAddrStreet=e.street,n.shippingAddrNumber=e.number,e.street&&e.number&&(n.shippingAddrStreet+=`, ${e.number}`),n.shippingAddrCity=e.city,n.shippingAddrProvinceCode=e.province_code),y.push({event:"purchaseExtraData",...n}),A=100}setTimeout(()=>I("purchase",S),A),localStorage.setItem("gtag.orderIdSent",s)}g=!0}};let u;const d=({name:s,params:t})=>{switch(s){case"cart":r("view_cart");break;case"checkout":t.step?Number(t.step)===1?r("add_shipping_info"):Number(t.step)===2&&r("add_payment_info"):r("begin_checkout");break;case"confirmation":clearTimeout(u),t.json?m(t.id,decodeURIComponent(t.json)):u=setTimeout(()=>{m(t.id)},1500);break}};o.currentRoute&&d(o.currentRoute),o.afterEach(d)}};{Object.keys(O).length&&sessionStorage.setItem("ecomUtm",JSON.stringify(O));let o=window.location.search;!o&&window.location.hash&&(o="?"+window.location.hash.split("?")[1]);const a=new URLSearchParams(o);a.get("product_id")&&a.get("quantity")==="1"&&(localStorage.setItem("ecomShoppingCart__tmp",JSON.stringify({items:[{product_id:a.get("product_id"),variation_id:a.get("variation_id")||void 0,quantity:1}]})),window.ECOM_CART_STORAGE_KEY="ecomShoppingCart__tmp");const{hostname:i}=window.location,{domain:h}=globalThis.$storefront.settings,r=`https://ecomplus.io/v2/:${window.ECOM_STORE_ID}/`;window.ECOMCLIENT_API_STORE=r,window.ECOMCLIENT_API_STORE_CACHE=r,window.ECOMCLIENT_API_PASSPORT=r,window.ECOMCLIENT_API_SEARCH=`${r}/search/_els/`,window.ECOMCLIENT_API_MODULES=["localhost","127.0.0.1"].includes(i)?`https://${h}/_api/modules/`:"/_api/modules/";const g=()=>{const{ecomPassport:u}=window;T(b,async()=>{b.value?u.setSession({auth:{...E.auth,id:E.auth?.customer_id,level:3},customer:p.value}):u.checkLogin()&&u.logout()},{immediate:!0}),T(p,d=>{(d.display_name||d.main_email)&&u.setCustomer(d)},{immediate:!0}),setTimeout(M,400)},m=document.createElement("script");m.src="https://cdn.jsdelivr.net/npm/@ecomplus/storefront-app@2.0.0-beta.190/dist/lib/js/app.js",m.onload=g,document.body.appendChild(m)}
|
|
@@ -3,7 +3,7 @@ import http from 'node:http';
|
|
|
3
3
|
import { TLSSocket } from 'node:tls';
|
|
4
4
|
import { appendForwardSlash as appendForwardSlash$1, joinPaths, slash, prependForwardSlash, removeTrailingForwardSlash, collapseDuplicateSlashes } from '@astrojs/internal-helpers/path';
|
|
5
5
|
import 'cookie';
|
|
6
|
-
import { l as levels, d as dateTimeFormat, A as AstroCookies, c as computePreferredLocale, a as computePreferredLocaleList, b as computeCurrentLocale, r as routeIsRedirect, e as redirectRouteStatus, f as redirectRouteGenerate, g as routeIsFallback, h as attachCookiesToResponse, i as createAPIContext, j as callEndpoint, k as callMiddleware, L as Logger, m as AstroIntegrationLogger, R as RouteCache, n as getSetCookiesFromResponse, o as createRenderContext, manifest } from './
|
|
6
|
+
import { l as levels, d as dateTimeFormat, A as AstroCookies, c as computePreferredLocale, a as computePreferredLocaleList, b as computeCurrentLocale, r as routeIsRedirect, e as redirectRouteStatus, f as redirectRouteGenerate, g as routeIsFallback, h as attachCookiesToResponse, i as createAPIContext, j as callEndpoint, k as callMiddleware, L as Logger, m as AstroIntegrationLogger, R as RouteCache, n as getSetCookiesFromResponse, o as createRenderContext, manifest } from './manifest_221d806b.mjs';
|
|
7
7
|
import { yellow, dim, bold, cyan, red, reset } from 'kleur/colors';
|
|
8
8
|
import { A as AstroError, R as ReservedSlotName, k as renderSlotToString, o as renderJSX, p as chunkToString, C as ClientAddressNotAvailable, S as StaticClientAddressNotAvailable, q as ResponseSentError, t as CantRenderPage, v as renderPage$1 } from './chunks/astro_d98f7186.mjs';
|
|
9
9
|
import 'clsx';
|
|
@@ -1365,7 +1365,7 @@ const _page1 = () => import('./chunks/index_5e3ed8a0.mjs');
|
|
|
1365
1365
|
const _page2 = () => import('./chunks/~fallback_41122b9b.mjs');
|
|
1366
1366
|
const _page3 = () => import('./chunks/index_10e14f85.mjs');
|
|
1367
1367
|
const _page4 = () => import('./chunks/account_519edb70.mjs');
|
|
1368
|
-
const _page5 = () => import('./chunks/_.._5a781fb3.mjs');const pageMap = new Map([["../../node_modules/.pnpm/astro@3.6.
|
|
1368
|
+
const _page5 = () => import('./chunks/_.._5a781fb3.mjs');const pageMap = new Map([["../../node_modules/.pnpm/astro@3.6.0/node_modules/astro/dist/assets/endpoint/node.js", _page0],["src/pages/index.astro", _page1],["src/pages/~fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5]]);
|
|
1369
1369
|
const _manifest = Object.assign(manifest, {
|
|
1370
1370
|
pageMap,
|
|
1371
1371
|
renderers,
|
|
@@ -1064,6 +1064,6 @@ function deserializeManifest(serializedManifest) {
|
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
|
-
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@3.6.
|
|
1067
|
+
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@3.6.0/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.54eaab04.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.e7cac999.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.54eaab04.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.e7cac999.css"}],"routeData":{"route":"/~fallback","type":"page","pattern":"^\\/~fallback\\/?$","segments":[[{"content":"~fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/~fallback.astro","pathname":"/~fallback","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.c90fc6ab.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.e7cac999.css"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.54eaab04.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.e7cac999.css"}],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.54eaab04.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.e7cac999.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"site":"https://demo.ecomplus.app","base":"/","trailingSlash":"ignore","compressHTML":false,"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/[...slug]@_@astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astrojs-ssr-virtual-entry",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/account@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/~fallback.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/~fallback@_@astro",{"propagation":"in-tree","containsHead":false}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,s)=>{let n=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),n();break}});for(let e of s.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"],["context","(()=>{var n=(d,i)=>{let t=async()=>{await(await d())()},e=()=>{if(i.value===\"idle\"){if(typeof window.requestIdleCallback==\"function\"){setTimeout(()=>window.requestIdleCallback(t),9);return}setTimeout(t,200);return}t()},o=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===o&&window._emitedContextId===o){console.log(\"[ctx] first load\"),e(),document.addEventListener(\"astro:beforeload\",()=>{delete window._firstLoadContextId},{once:!0});return}window.addEventListener(\"storefront:apiContext\",e,{once:!0})};(self.Astro||(self.Astro={})).context=n;window.dispatchEvent(new Event(\"astro:context\"));})();\n"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account_e5d410a7.mjs","/../../node_modules/.pnpm/astro@3.6.0/node_modules/astro/dist/assets/endpoint/node.js":"chunks/pages/node_bd378ac0.mjs","/src/pages/~fallback.astro":"chunks/pages/~fallback_73578d2f.mjs","\u0000@astrojs-manifest":"manifest_221d806b.mjs","\u0000@astro-page:../../node_modules/.pnpm/astro@3.6.0/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_1119b0d1.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index_5e3ed8a0.mjs","\u0000@astro-page:src/pages/~fallback@_@astro":"chunks/~fallback_41122b9b.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index_10e14f85.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account_519edb70.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_.._5a781fb3.mjs","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/SearchModal.vue":"_astro/SearchModal.b6aa5ef7.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/CartSidebar.vue":"_astro/CartSidebar.430b55df.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.css?used&inline":"_astro/photoswipe.01431ec7.js","~/components/ProductShelf.vue":"_astro/ProductShelf.bf82838b.js","~/components/PitchBar.vue":"_astro/PitchBar.06e0f831.js","@astrojs/vue/client.js":"_astro/client.41b42098.js","/astro/hoisted.js?q=0":"_astro/hoisted.c90fc6ab.js","~/components/AccountPage.vue":"_astro/AccountPage.700be123.js","~/components/HeroSlider.vue":"_astro/HeroSlider.bd684ed8.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe-lightbox.esm.js":"_astro/photoswipe-lightbox.esm.c157838f.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.992a296f.js","~/components/ShopHeader.vue":"_astro/ShopHeader.2d6e361a.js","/astro/hoisted.js?q=1":"_astro/hoisted.54eaab04.js","~/components/ProductDetails.vue":"_astro/ProductDetails.06da998d.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.esm.js":"_astro/photoswipe.esm.92c2d901.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_slug_.e7cac999.css","/robots.txt","/_astro/AccountPage.700be123.js","/_astro/CartSidebar.430b55df.js","/_astro/HeroSlider.bd684ed8.js","/_astro/PitchBar.06e0f831.js","/_astro/Prices.0e829c31.js","/_astro/ProductDetails.06da998d.js","/_astro/ProductShelf.3f4f38b5.js","/_astro/ProductShelf.bf82838b.js","/_astro/QuantitySelector.ebf60845.js","/_astro/SearchModal.b6aa5ef7.js","/_astro/ShopHeader.2d6e361a.js","/_astro/_plugin-vue_export-helper.f75743ee.js","/_astro/afetch.f4507208.js","/_astro/client.41b42098.js","/_astro/customer-session.5ab9ab1a.js","/_astro/ecom-utils.5cbfb95e.js","/_astro/firebase-app.992a296f.js","/_astro/format-money.9cf6b04d.js","/_astro/hoisted.54eaab04.js","/_astro/hoisted.c90fc6ab.js","/_astro/i18n.29216eeb.js","/_astro/img-sizes.41e0efe4.js","/_astro/img.4f23a3dd.js","/_astro/index-61e5ac61.bdc8d0cd.js","/_astro/index.570b84fe.js","/_astro/index.8ac1db99.js","/_astro/modules-info.55780599.js","/_astro/name.01410784.js","/_astro/photoswipe-lightbox.esm.c157838f.js","/_astro/photoswipe.01431ec7.js","/_astro/photoswipe.esm.92c2d901.js","/_astro/price.04ceb6c4.js","/_astro/sf-utils.b04e1813.js","/_astro/shopping-cart.d9f601dd.js","/_astro/use-analytics.cc95e346.js","/_astro/use-product-card.437911bb.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]});
|
|
1068
1068
|
|
|
1069
1069
|
export { AstroCookies as A, Logger as L, RouteCache as R, computePreferredLocaleList as a, computeCurrentLocale as b, computePreferredLocale as c, dateTimeFormat as d, redirectRouteStatus as e, redirectRouteGenerate as f, routeIsFallback as g, attachCookiesToResponse as h, createAPIContext as i, callEndpoint as j, callMiddleware as k, levels as l, AstroIntegrationLogger as m, manifest, getSetCookiesFromResponse as n, createRenderContext as o, routeIsRedirect as r };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.1",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -57,11 +57,10 @@
|
|
|
57
57
|
"unplugin-auto-import": "^0.16.7",
|
|
58
58
|
"vite": "^4.5.0",
|
|
59
59
|
"vite-plugin-pwa": "^0.17.2",
|
|
60
|
-
"vue": "
|
|
60
|
+
"vue": "3.3.8"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@cloudcommerce/eslint": "workspace:*",
|
|
64
|
-
"@cloudcommerce/types": "workspace:*"
|
|
65
|
-
"@vue/runtime-core": "^3.3.9"
|
|
64
|
+
"@cloudcommerce/types": "workspace:*"
|
|
66
65
|
}
|
|
67
66
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as C,w as V,a as I,e as Y,b as $,t as v}from"./use-analytics.cc95e346.js";import{a as H}from"./afetch.f4507208.js";import{u as R}from"./index.8ac1db99.js";import"./customer-session.5ab9ab1a.js";import"./sf-utils.b04e1813.js";import"./ecom-utils.5cbfb95e.js";import"./shopping-cart.d9f601dd.js";import"./price.04ceb6c4.js";import"./name.01410784.js";import"./i18n.29216eeb.js";const y=t=>history.replaceState(t,""),k=!!document.startViewTransition,g=()=>!!document.querySelector('[name="astro-view-transitions-enabled"]'),q=t=>document.dispatchEvent(new Event(t)),P=()=>q("astro:load"),f="data-astro-transition-persist";let m=history.state?.index||0;!history.state&&g()&&y({index:m,scrollY:0});const W=(t,e)=>{let n=!1,a=!1;return(...i)=>{if(n){a=!0;return}t(...i),n=!0,setTimeout(()=>{a&&(a=!1,t(...i)),n=!1},e)}};async function D(t){const e=await fetch(t),n=await e.text();return{ok:e.ok,html:n}}function x(){const t=document.querySelector('[name="astro-view-transitions-fallback"]');return t?t.getAttribute("content"):"animate"}function L(){for(const t of document.scripts)t.dataset.astroExec=""}function F(){let t=Promise.resolve();for(const e of Array.from(document.scripts)){if(e.dataset.astroExec==="")continue;const n=document.createElement("script");n.innerHTML=e.innerHTML;for(const a of e.attributes){if(a.name==="src"){const i=new Promise(l=>{n.onload=l});t=t.then(()=>i)}n.setAttribute(a.name,a.value)}n.dataset.astroExec="",e.replaceWith(n)}return t}const G=new DOMParser;async function A(t,e,n){const a=G.parseFromString(t,"text/html"),i=s=>{const c=s.getAttribute(f),u=c&&a.head.querySelector(`[${f}="${c}"]`);if(u)return u;if(s.matches("link[rel=stylesheet]")){const r=s.getAttribute("href");return a.head.querySelector(`link[rel=stylesheet][href="${r}"]`)}if(s.tagName==="SCRIPT"){let r=s;for(const o of a.scripts)if(r.textContent&&r.textContent===o.textContent||r.type===o.type&&r.src&&r.src===o.src)return o}return null},l=()=>{a.querySelectorAll("head noscript").forEach(r=>r.remove());const s=document.documentElement,c=[...s.attributes].filter(({name:r})=>(s.removeAttribute(r),r.startsWith("data-astro-")));[...a.documentElement.attributes,...c].forEach(({name:r,value:o})=>s.setAttribute(r,o));for(const r of Array.from(document.head.children)){const o=i(r);o?o.remove():r.remove()}document.head.append(...a.head.children);const u=document.body;document.body.replaceWith(a.body);for(const r of u.querySelectorAll(`[${f}]`)){const o=r.getAttribute(f),E=document.querySelector(`[${f}="${o}"]`);E&&E.replaceWith(r)}if(scrollTo({left:0,top:0,behavior:"instant"}),e?.scrollY===0&&location.hash){const r=decodeURIComponent(location.hash.slice(1)),o=document.getElementById(r);o&&(e.scrollY=o.offsetTop,y(e),o.scrollIntoView())}else e&&e.scrollY!==0&&scrollTo(0,e.scrollY);q("astro:beforeload")},d=[];for(const s of a.querySelectorAll("head link[rel=stylesheet]"))if(!document.querySelector(`[${f}="${s.getAttribute(f)}"], link[rel=stylesheet]`)){const c=document.createElement("link");c.setAttribute("rel","preload"),c.setAttribute("as","style"),c.setAttribute("href",s.getAttribute("href")),d.push(new Promise(u=>{["load","error"].forEach(r=>c.addEventListener(r,u)),document.head.append(c)}))}if(d.length&&await Promise.all(d),n==="animate"){let s=!1;addEventListener("animationstart",()=>s=!0,{once:!0}),document.documentElement.dataset.astroTransitionFallback="old",await new Promise(c=>{const u=()=>{removeEventListener("animationend",u),clearTimeout(r),l(),c(!0),document.documentElement.dataset.astroTransitionFallback="new"};addEventListener("animationend",u,{once:!0});let r=setTimeout(()=>!s&&u())})}else l()}async function T(t,e,n){let a;const{html:i,ok:l}=await D(e);if(!l){location.href=e;return}document.documentElement.dataset.astroTransition=t,k?a=document.startViewTransition(()=>A(i,n)).finished:a=A(i,n,x());try{await a}finally{await F(),L(),P()}}function M(t){if(document.querySelector(`link[rel=prefetch][href="${t}"]`))return;if(navigator.connection){let n=navigator.connection;if(n.saveData||/(2|3)g/.test(n.effectiveType||""))return}let e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.append(e)}(k||x()!=="none")&&!location.pathname.startsWith("/app/")&&(L(),document.addEventListener("click",t=>{let e=t.target;if(e instanceof Element&&e.tagName!=="A"&&(e=e.closest("a")),!e||!(e instanceof HTMLAnchorElement)||e.dataset.astroReload!==void 0||e.hasAttribute("download")||!e.href||e.pathname.startsWith("/app/")||e.target&&e.target!=="_self"||e.origin!==location.origin||t.button!==0||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||t.defaultPrevented||!g())return;if(location.pathname===e.pathname&&location.search===e.search){if(e.hash)return;if(t.preventDefault(),y({...history.state,scrollY}),scrollTo({left:0,top:0,behavior:"instant"}),location.hash){const a={index:++m,scrollY:0};history.pushState(a,"",e.href)}return}t.preventDefault(),T("forward",e.href,{index:++m,scrollY:0});const n={index:m,scrollY};y({index:m-1,scrollY}),history.pushState(n,"",e.href)}),addEventListener("popstate",t=>{if(!g()&&t.state){location.reload();return}if(t.state===null)return;const e=history.state,n=e?.index??m+1,a=n>m?"forward":"back";T(a,location.href,e),m=n}),["mouseenter","touchstart","focus"].forEach(t=>{document.addEventListener(t,e=>{if(e.target instanceof HTMLAnchorElement){let n=e.target;n.origin===location.origin&&n.pathname!==location.pathname&&!n.pathname.startsWith("/app/")&&n.dataset.astroReload===void 0&&!n.hasAttribute("download")&&n.role!=="button"&&g()&&M(n.pathname)}},{passive:!0,capture:!0})}),addEventListener("load",P),addEventListener("scroll",W(()=>{history.state&&y({...history.state,scrollY})},300),{passive:!0}));const p={waiting:Promise.resolve(),params:{content_ids:[],content_name:""}},S=(t,e="BRL",n=!1)=>{const a={currency:e,content_category:t.item_category,content_name:t.item_name,value:t.price,content_type:"product"};return n?(a.contents=[{id:t.item_id,quantity:t.quantity}],Number(t.quantity)<0&&(a.value=0)):a.content_ids=[t.item_id],a},K=async({event:t})=>{if(t.name==="page_view")return p.waiting=new Promise(a=>{setTimeout(a,110)}),p.params.content_name=t.params.page_title,[{name:"PageView"}];const{items:e,currency:n}=t.params;if(t.name==="view_item"&&e){const a=e[0];if(a)return a.item_list_id==="product-page"?[{name:"ViewContent",params:S(a,n)}]:(e.forEach(({item_id:i})=>{p.params.content_ids.push(i)}),p.params.content_ids.length>e.length?[{name:null}]:(await p.waiting,[{name:"ViewContent",params:{...p.params,content_type:"product"}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const a=t.name==="add_to_cart";return e.map(i=>({name:"AddToCart",params:S({...i,quantity:a?i.quantity||1:-(i.quantity||1)},n,!0)}))}return[{name:null}]},h={waiting:Promise.resolve(),params:{description:"",contents:[]}},w=(t,e=!1)=>{const n={content_id:t.item_id,content_name:t.item_name,price:t.price,content_category:t.item_category,brand:t.item_brand};return e&&(n.quantity=t.quantity),n},B=async({event:t})=>{if(t.name==="page_view")return h.waiting=new Promise(a=>{setTimeout(a,110)}),h.params.description=t.params.page_title,[{name:"PageView"}];const{items:e,currency:n}=t.params;if(t.name==="view_item"&&e){const a=e[0];if(a)return a.item_list_id==="product-page"?[{name:"ViewContent",params:{contents:[w(a)],content_type:"product",currency:n,value:a.price}}]:(e.forEach(i=>{h.params.contents.push(w(i))}),h.params.contents.length>e.length?[{name:null}]:(await h.waiting,[{name:"ViewContent",params:{...h.params,content_type:"product",currency:n}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const a=t.name==="add_to_cart";return e.map(i=>{const l=i.quantity||1,{price:d}=i;return{name:"AddToCart",params:{contents:[w({...i,quantity:a?l:-l},!0)],content_type:"product",currency:n,value:a&&typeof d=="number"?l*d:0}}})}return[{name:null}]};let b=[];const N=R(()=>{H("/_analytics",{method:"post",body:{...I(),events:b}}),b=[]},200),_=t=>{b.push(t),N()};{C(),V(async n=>{const{name:a,params:i}=n.event;_({type:"gtag",name:a,params:i});const{gtag:l,dataLayer:d,fbq:s,ttq:c}=window;typeof l=="function"&&l("event",a,i),d&&typeof d.push=="function"&&d.push(["event",a,i]),(await K(n)).forEach(o=>{o.name&&(_({type:"fbq",...o}),typeof s=="function"&&s("track",o.name,o.params))}),(await B(n)).forEach(o=>{o.name&&(_({type:"ttk",...o}),typeof c?.page=="function"&&(o.name==="PageView"?c.page():c.track(o.name,o.params)))})});let t="";const e=()=>{const n=window.location.toString();n!==t&&(Y("page_view",{...$(),page_location:n,client_id:v.g_client_id||v.client_id}),t=n)};e(),window.addEventListener("storefront:apiContext",()=>{try{window.dataLayer.push(function(){this.reset(),e()})}catch{e()}})}
|