1import{ab as _,a1 as k,p as S,w as g,o as I,j as m,h as A,r as $,a as v,z as y,B as f,C as L,I as T,K as U,F as j,E as B}from"./index-DgV8FTMp.js";import{u as D}from"./shop-DBEp14ee.js";import{g as P}from"./helpers-DjuFaQPq.js";import"./shop.api-DTmkk8kK.js";import"./article.api-DSDsj4Uz.js";import"./fetch-videos-utils-5U41R48M.js";import"./ecal.api-Cd3SFJ7z.js";const b=_({name:"Cart",components:{SdpStreamlineIcon:k},setup(){const t=D(),o=$(""),h=m(()=>(o==null?void 0:o.value)??""),u=m(()=>t.productSkus),d=(e,s)=>{setTimeout(async()=>{var a,n;const r=s-1;if(window.Cart&&typeof window.Cart=="object"&&((n=(a=window.Cart)==null?void 0:a.order())!=null&&n.token)){console.log("[shop] Cart was loaded"),t.cartIsLoaded=!0;const i=window.Cart.order().token,C=t.pendingSKU;await t.fetchPrices({skus:C,userToken:i}),t.pendingSKU=[]}else r>0&&setTimeout(()=>d(e,r),e)},e)},l=()=>{var s,r;if(u.value.length<=0)return;const e=(r=(s=window==null?void 0:window.Cart)==null?void 0:s.order())==null?void 0:r.token;t.fetchPrices({skus:u.value,userToken:e})},p=async()=>{if(o.value==="")try{o.value=await P()}catch(e){console.warn(e)}},c=A({script:[]});S(c);const w=async()=>{c.script=[{src:`${o.value}/js/cart-widget-full.min.js`,key:"wm-cart-widget"}]};return g(o,()=>{w()}),g(()=>t.cartIsLoaded,async e=>{if(!e){console.log(`[shop] cartIsLoaded has status ${e}`);return}const s=(()=>{var n,i;const a=(i=(n=window.Cart)==null?void 0:n.order())==null?void 0:i.loggedInCustomerAccount;return!(!a||a==="guest")})();console.log(`[shop] userIsAuthenticatedInCart is ${s}`);const r=v();if(s||!r.isUserLoggedIn){console.log(`[shop] user already logged in to the cart or not logged in at all (${s}, ${r.isUserLoggedIn})`),l();return}t.hasFreshUserAuthToken||(console.log("[shop] Fetching user auth token"),await t.fetchUserAuthToken()),console.log(`[shop] userAuth: ${t.userAuth}`),t.userAuth!==!1&&(console.log("[shop] Will log user in to cart"),window.Cart.loginAccount(t.userAuth.token)),l()}),I(()=>{d(250,50),p()}),{getDataDomain:h}}}),x=["data-domain"];function F(t,o,h,u,d,l){const p=f("sdp-streamline-icon"),c=f("router-link");return L(),T(c,{to:"/shop/cart",class:"cart-container","aria-label":t.$t("shop.shopping_cart")},{default:U(()=>[j(p,{icon:"cart",size:18,class:"text-white"}),B("div",{id:"cart-widget-top-cart","data-domain":t.getDataDomain},null,8,x)]),_:1},8,["aria-label"])}const R=y(b,[["render",F],["__scopeId","data-v-78d18190"]]);export{R as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.