1import D from"./CqU6AV4Z.js";import T from"./BUEUxFE0.js";import{ag as H,T as N,B as A,U as L,m as M,n as U,p as u,o as l,w as n,h as a,g as t,Y,d as r,L as _,M as j,c as f,f as C,e as z,v as E,t as h,j as F,r as y,S as G}from"./K1b_ijTh.js";import R from"./7mFOq8Ud.js";import{_ as q}from"./pjb_M3L6.js";import J from"./rfHyGcty.js";import{u as K}from"./B1Fi2rw8.js";import{y as Q}from"./D6Z08Q7a.js";import"./CQoHp_LM.js";import"./CZ-9ZaBF.js";import"./BrLwkkZd.js";import"./FXYoTY6c.js";import"./BQguEG_I.js";import"./Zxf_Ata2.js";import"./C3TXZl8F.js";import"./Dce4Gtd0.js";import"./XUID70n1.js";const W={class:"fixed inset-0 overflow-hidden"},X={class:"absolute inset-0 overflow-hidden"},Z={class:"cart-flyout-content"},tt={class:"cart-flyout-content-inner"},et={key:0,class:"cart-flyout--added-to-cart"},at={class:"h-full w-full overflow-x-hidden overflow-y-auto pe-2 flex flex-col gap-6"},ot={key:1,class:"text-center text-lg"},St={__name:"Cart",setup(st){const c=y(!0),i=y(null),{isSidebarOpen:g,showAddedToCart:v,toggleSidebar:d,closeSidebar:b}=H(),p=K(),{fetchCart:S}=p,{cartProducts:e}=N(p),w=F(()=>e.value?.discount_codes?.length?e.value.discount:null),x=(o,s)=>{s.value=o?.length<=0},m=o=>{const s=o?.lines??[];x(s,c),i.value=o?.currency??null},k=()=>{t(c),t(i),t(e)};return A(e,()=>{m(e.value??null)},{deep:!0}),L(k),M(async()=>{await U(),await S(),m(e.value??null)}),(o,s)=>{const I=D,B=T,O=E,V=R,P=q,$=J;return l(),u(t(Q),{id:"cartFlyout"},{default:n(()=>[a(I,{products:t(e),onChangeCartIsOpen:t(d)},null,8,["products","onChangeCartIsOpen"]),a(t(G),{as:"template",show:t(g)},{default:n(()=>[a(t(Y),{as:"div",class:"relative z-50",onClose:t(b)},{default:n(()=>[a(t(_),{as:"template",enter:"ease-in-out duration-500","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in-out duration-500","leave-from":"opacity-100","leave-to":"opacity-0"},{default:n(()=>[...s[0]||(s[0]=[r("div",{class:"fixed inset-0 bg-neutral-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),r("div",W,[r("div",X,[r("div",Z,[a(t(_),{as:"template",enter:"transform transition ease-in-out duration-500 sm:duration-700","enter-from":"translate-y-full lg:translate-y-0 lg:translate-x-full","enter-to":"translate-y-0 lg:translate-y-0 lg:translate-x-0",leave:"transform transition ease-in-out duration-500 sm:duration-700","leave-from":"translate-y-0 lg:translate-y-0 lg:translate-x-0","leave-to":"translate-y-full lg:translate-y-0 lg:translate-x-full"},{default:n(()=>[a(t(j),{class:"pointer-events-auto w-screen max-w-xl"},{default:n(()=>[r("div",tt,[a(B,{onChangeCartIsOpen:t(d)},null,8,["onChangeCartIsOpen"]),t(v)?(l(),f("span",et,[a(O,{name:"tabler:check",class:"w-4 h-4"}),z(" "+h(o.$t("cart.Product_added_to_cart")),1)])):C("",!0),r("div",at,[t(e)?.lines?.length?(l(),u(V,{key:0,products:t(e).lines,appliedCodes:t(e)?.discount_codes??[],class:"h-fit"},null,8,["products","appliedCodes"])):(l(),f("p",ot,h(o.$t("cart.Add_some_product")),1)),t(e)?.lines?.length?(l(),u(P,{key:2,productsValue:t(e)?.products_cost,discountPrice:t(w),vatValue:t(e)?.vat_amount,shipmentCost:t(e)?.cheapest_delivery_cost,totalPrice:t(e)?.total_cost,discountCodes:t(e)?.discount_codes},null,8,["productsValue","discountPrice","vatValue","shipmentCost","totalPrice","discountCodes"])):C("",!0)]),a($,{onChangeCartIsOpen:t(d),isButtonDisabled:t(c),subtotalCosts:t(e)?.products_cost,currency:t(i)},null,8,["onChangeCartIsOpen","isButtonDisabled","subtotalCosts","currency"])])]),_:1})]),_:1})])])])]),_:1},8,["onClose"])]),_:1},8,["show"])]),_:1})}}};export{St 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.