@perevorot/shop 2.0.72 → 2.0.73

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.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(l),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),c=e.ref(!1),a=e.computed((function(){return o.getters["cart/items"]})),s=e.computed((function(){return o.getters["cart/modal"]})),i=e.computed((function(){return o.getters["cart/total"]})),d=e.computed((function(){return o.getters["cart/quantity"]})),u=function(){o.commit("cart/modal",!1)};o.dispatch("cart/get",{finally:function(){}}),window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&u()}));var m,p,v=e.ref(null),E=e.ref(null),k=e.ref(null),f=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new r.default(v.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[l.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:E.value,prevEl:k.value}}))),e})),N=e.ref(null),V=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return N.value&&(p&&p.destroy(),e.length&&(p=new r.default(N.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:V.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)}));var y=e.ref(!1);return{loading:c,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",!s.value)},close:u,clear:function(){c.value=!0,o.dispatch("cart/clear",{finally:function(){c.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",!1)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",!1)})),window.location.href=e},cross:f,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:N,bundlesSliderPrev:g,bundlesSliderNext:V,checkout:function(){try{y.value=!0;var e=[];a.value.forEach((function(t){e.push({name:t.name,id:t.attributes.code,price:t.attributes.price,brand:t.attributes.brand,category:t.attributes.category,quantity:t.quantity})}));var t={ecommerce:{checkout:{products:[e]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Checkout","gtm-ee-event-non-interaction":"False",eventCallback:function(){window.location.href=$ziggy("shop.checkout")},eventTimeout:2e3};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout"),setTimeout((function(){window.location.href=$ziggy("shop.checkout")}),2e3)}catch(e){console.error(e),window.location.href=$ziggy("shop.checkout")}},isLoading:y}}}),a={class:"cart"},s={class:"dropdown is-right is-hoverable"},i={class:"dropdown-trigger"},d=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),u=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),m={class:"dropdown-menu",role:"menu"},p={key:0,class:"dropdown-content"},v={class:"dropdown-item"},E={class:"columns"},k={class:"column"},f=["innerHTML"],N=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),V={class:"dropdown-item has-text-centered"},g={class:"dropdown-item has-text-centered"},h={key:1,class:"dropdown-content"},y={class:"dropdown-item"},w={class:"modal-content"},B=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],b={class:"box"},C={class:"cart-title"},_=["textContent"],x={key:0,class:"items-wrapper"},S={class:"items"},L={class:"columns is-gapless is-vcentered main-actions"},T={class:"column"},M={class:"column has-text-right"},D={class:"totals"},$={class:"title"},H=["innerHTML"],q={class:"column is-narrow"},z={key:0,class:"cross"},P={class:"title"},F={class:"swiper",ref:"crossSlider"},O={class:"swiper-wrapper"},A={class:"columns is-gapless"},G={class:"column is-narrow"},j=["onClick"],R=["src"],I={key:1},J=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],K={class:"column"},Q=["data-code"],U={class:"name"},W=["onClick"],X={class:"columns is-gapless is-vcentered"},Y={class:"column is-narrow"},Z={class:"prices"},ee=["innerHTML"],te=["innerHTML"],ne={class:"column"},le=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),oe={class:"swiper-nav prev",ref:"crossSliderPrev"},re=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ce={class:"swiper-nav next",ref:"crossSliderNext"},ae=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],se={key:1,class:"bundles"},ie={class:"title"},de={class:"swiper",ref:"bundlesSlider"},ue={class:"swiper-wrapper"},me={class:"column is-narrow"},pe=["onClick"],ve=["src"],Ee={key:1},ke=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],fe={class:"column"},Ne={class:"product"},Ve={class:"name"},ge=["onClick"],he={class:"columns is-gapless is-vcentered"},ye={class:"prices"},we=["innerHTML"],Be=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),be={class:"column is-narrow"},Ce=["onClick"],_e=["src"],xe={key:1},Se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Le={class:"column"},Te={class:"product"},Me={class:"name"},De=["onClick"],$e={class:"columns is-gapless is-vcentered"},He={class:"prices"},qe=["innerHTML"],ze={key:0,class:"column is-narrow"},Pe=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Fe={key:1,class:"column is-narrow"},Oe=["onClick"],Ae=["src"],Ge={key:1},je=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Re={key:2,class:"column"},Ie={class:"product"},Je={class:"name"},Ke=["onClick"],Qe={class:"columns is-gapless is-vcentered"},Ue={class:"prices"},We=["innerHTML"],Xe={class:"columns is-vcentered"},Ye={class:"column"},Ze=["innerHTML"],et=["innerHTML"],tt={class:"column"},nt={class:"is-flex is-align-items-center"},lt=["innerHTML"],ot={class:"swiper-nav prev",ref:"bundlesSliderPrev"},rt=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ct={class:"swiper-nav next",ref:"bundlesSliderNext"},at=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],st={key:1,class:"empty"},it={class:"title"},dt={class:"message"},ut=["href"],mt=e.createTextVNode(", "),pt=e.createElementVNode("br",null,null,-1),vt={class:"viewed-wrapper"};c.render=function(t,n,l,o,r,c){var Et=e.resolveComponent("cart-item"),kt=e.resolveComponent("cart-add"),ft=e.resolveComponent("bundle-add"),Nt=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",s,[e.createElementVNode("div",i,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[d,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),u])]}))]),e.createElementVNode("div",m,[t.items.length?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,f)])]),N,e.createElementVNode("div",V,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",g,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:n[2]||(n[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",h,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",y,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[3]||(n[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",w,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},B),e.createElementVNode("div",b,[e.createElementVNode("div",C,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,_)):e.createCommentVNode("v-if",!0)]),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(n){return e.openBlock(),e.createBlock(Et,{key:n.id,item:n},e.createSlots({_:2},[e.renderList(t.$slots,(function(n,l){return{name:l,fn:e.withCtx((function(n){return[e.renderSlot(t.$slots,l,e.normalizeProps(e.guardReactiveProps(n||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",L,[e.createElementVNode("div",T,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createElementVNode("div",$,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,H)])])]),e.createElementVNode("div",q,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",P,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",F,[e.createElementVNode("div",O,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",A,[e.createElementVNode("div",G,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,R)):(e.openBlock(),e.createElementBlock("svg",I,J))],2)],8,j)]),e.createElementVNode("div",K,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",U,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,W)]),e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,ee)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,te)])]),e.createElementVNode("div",ne,[e.createVNode(kt,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[le]})),_:2},1032,["id"])])])],8,Q)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",oe,re,512)),(e.openBlock(),e.createElementBlock("svg",ce,ae,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",ie,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",de,[e.createElementVNode("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":n.third}])},[e.createElementVNode("div",me,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,ve)):(e.openBlock(),e.createElementBlock("svg",Ee,ke))],2)],8,pe)]),e.createElementVNode("div",fe,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ve,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,ge)]),e.createElementVNode("div",he,[e.createElementVNode("div",ye,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,we)])])])]),Be,e.createElementVNode("div",be,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.second.image}])},[n.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.second.image},null,8,_e)):(e.openBlock(),e.createElementBlock("svg",xe,Se))],2)],8,Ce)]),e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("div",Me,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,De)]),e.createElementVNode("div",$e,[e.createElementVNode("div",He,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,qe)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",ze,Pe)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.third.image}])},[n.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.third.image},null,8,Ae)):(e.openBlock(),e.createElementBlock("svg",Ge,je))],2)],8,Oe)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("div",Je,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Ke)]),e.createElementVNode("div",Qe,[e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,We)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,Ze),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+n.bundle.amount},null,8,et)]),e.createElementVNode("div",tt,[e.createElementVNode("div",nt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,lt),e.createVNode(ft,{id:n.id,second:n.second.id,third:n.third?n.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",ot,rt,512)),(e.openBlock(),e.createElementBlock("svg",ct,at,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",it,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",dt,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,ut),mt,pt,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:n[7]||(n[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",vt,[e.createVNode(Nt,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)])},module.exports=c;
1
+ "use strict";var e=require("vue"),t=require("vuex"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(l),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),c=e.ref(!1),a=e.computed((function(){return o.getters["cart/items"]})),s=e.computed((function(){return o.getters["cart/modal"]})),i=e.computed((function(){return o.getters["cart/total"]})),d=e.computed((function(){return o.getters["cart/quantity"]})),u=function(){o.commit("cart/modal",!1)};o.dispatch("cart/get",{finally:function(){}}),document.body.addEventListener("click",(function(e){s.value&&!e.target.closest(".cart")&&u()})),window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&u()}));var m,p,v=e.ref(null),E=e.ref(null),k=e.ref(null),f=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new r.default(v.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[l.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:E.value,prevEl:k.value}}))),e})),N=e.ref(null),V=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return N.value&&(p&&p.destroy(),e.length&&(p=new r.default(N.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:V.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)}));var y=e.ref(!1);return{loading:c,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",!s.value)},close:u,clear:function(){c.value=!0,o.dispatch("cart/clear",{finally:function(){c.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",!1)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",!1)})),window.location.href=e},cross:f,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:N,bundlesSliderPrev:g,bundlesSliderNext:V,checkout:function(){try{y.value=!0;var e=[];a.value.forEach((function(t){e.push({name:t.name,id:t.attributes.code,price:t.attributes.price,brand:t.attributes.brand,category:t.attributes.category,quantity:t.quantity})}));var t={ecommerce:{checkout:{products:[e]}},event:"gtm-ee-event","gtm-ee-event-category":"Ecommerce","gtm-ee-event-action":"Checkout","gtm-ee-event-non-interaction":"False",eventCallback:function(){window.location.href=$ziggy("shop.checkout")},eventTimeout:2e3};window.dataLayer?(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)):window.location.href=$ziggy("shop.checkout"),setTimeout((function(){window.location.href=$ziggy("shop.checkout")}),2e3)}catch(e){console.error(e),window.location.href=$ziggy("shop.checkout")}},isLoading:y}}}),a={class:"dropdown is-right is-hoverable"},s={class:"dropdown-trigger"},i=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),d=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),u={class:"dropdown-menu",role:"menu"},m={key:0,class:"dropdown-content"},p={class:"dropdown-item"},v={class:"columns"},E={class:"column"},k=["innerHTML"],f=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),N={class:"dropdown-item has-text-centered"},V={class:"dropdown-item has-text-centered"},g={key:1,class:"dropdown-content"},h={class:"dropdown-item"},y={class:"modal-content"},w=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],B={class:"box"},b={class:"cart-title"},C=["textContent"],_={key:0,class:"items-wrapper"},x={class:"items"},S={class:"columns is-gapless is-vcentered main-actions"},L={class:"column"},T={class:"column has-text-right"},M={class:"totals"},D={class:"title"},$=["innerHTML"],H={class:"column is-narrow"},q={key:0,class:"cross"},z={class:"title"},P={class:"swiper",ref:"crossSlider"},F={class:"swiper-wrapper"},O={class:"columns is-gapless"},A={class:"column is-narrow"},G=["onClick"],j=["src"],R={key:1},I=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],J={class:"column"},K=["data-code"],Q={class:"name"},U=["onClick"],W={class:"columns is-gapless is-vcentered"},X={class:"column is-narrow"},Y={class:"prices"},Z=["innerHTML"],ee=["innerHTML"],te={class:"column"},ne=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),le={class:"swiper-nav prev",ref:"crossSliderPrev"},oe=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],re={class:"swiper-nav next",ref:"crossSliderNext"},ce=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ae={key:1,class:"bundles"},se={class:"title"},ie={class:"swiper",ref:"bundlesSlider"},de={class:"swiper-wrapper"},ue={class:"column is-narrow"},me=["onClick"],pe=["src"],ve={key:1},Ee=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],ke={class:"column"},fe={class:"product"},Ne={class:"name"},Ve=["onClick"],ge={class:"columns is-gapless is-vcentered"},he={class:"prices"},ye=["innerHTML"],we=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Be={class:"column is-narrow"},be=["onClick"],Ce=["src"],_e={key:1},xe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Se={class:"column"},Le={class:"product"},Te={class:"name"},Me=["onClick"],De={class:"columns is-gapless is-vcentered"},$e={class:"prices"},He=["innerHTML"],qe={key:0,class:"column is-narrow"},ze=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Pe={key:1,class:"column is-narrow"},Fe=["onClick"],Oe=["src"],Ae={key:1},Ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],je={key:2,class:"column"},Re={class:"product"},Ie={class:"name"},Je=["onClick"],Ke={class:"columns is-gapless is-vcentered"},Qe={class:"prices"},Ue=["innerHTML"],We={class:"columns is-vcentered"},Xe={class:"column"},Ye=["innerHTML"],Ze=["innerHTML"],et={class:"column"},tt={class:"is-flex is-align-items-center"},nt=["innerHTML"],lt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},ot=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],rt={class:"swiper-nav next",ref:"bundlesSliderNext"},ct=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],at={key:1,class:"empty"},st={class:"title"},it={class:"message"},dt=["href"],ut=e.createTextVNode(", "),mt=e.createElementVNode("br",null,null,-1),pt={class:"viewed-wrapper"};c.render=function(t,n,l,o,r,c){var vt=e.resolveComponent("cart-item"),Et=e.resolveComponent("cart-add"),kt=e.resolveComponent("bundle-add"),ft=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cart",{"is-open":t.modal}])},[e.createElementVNode("div",a,[e.createElementVNode("div",s,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[i,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),d])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,k)])]),f,e.createElementVNode("div",N,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",V,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:n[2]||(n[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",g,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[3]||(n[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},w),e.createElementVNode("div",B,[e.createElementVNode("div",b,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,C)):e.createCommentVNode("v-if",!0)]),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(n){return e.openBlock(),e.createBlock(vt,{key:n.id,item:n},e.createSlots({_:2},[e.renderList(t.$slots,(function(n,l){return{name:l,fn:e.withCtx((function(n){return[e.renderSlot(t.$slots,l,e.normalizeProps(e.guardReactiveProps(n||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",S,[e.createElementVNode("div",L,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,$)])])]),e.createElementVNode("div",H,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",z,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",P,[e.createElementVNode("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",O,[e.createElementVNode("div",A,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,j)):(e.openBlock(),e.createElementBlock("svg",R,I))],2)],8,G)]),e.createElementVNode("div",J,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",Q,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,U)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,Z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,ee)])]),e.createElementVNode("div",te,[e.createVNode(Et,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ne]})),_:2},1032,["id"])])])],8,K)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",le,oe,512)),(e.openBlock(),e.createElementBlock("svg",re,ce,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":n.third}])},[e.createElementVNode("div",ue,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,pe)):(e.openBlock(),e.createElementBlock("svg",ve,Ee))],2)],8,me)]),e.createElementVNode("div",ke,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ne,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,Ve)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,ye)])])])]),we,e.createElementVNode("div",Be,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.second.image}])},[n.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.second.image},null,8,Ce)):(e.openBlock(),e.createElementBlock("svg",_e,xe))],2)],8,be)]),e.createElementVNode("div",Se,[e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,Me)]),e.createElementVNode("div",De,[e.createElementVNode("div",$e,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,He)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",qe,ze)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.third.image}])},[n.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.third.image},null,8,Oe)):(e.openBlock(),e.createElementBlock("svg",Ae,Ge))],2)],8,Fe)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ue)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,Ye),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+n.bundle.amount},null,8,Ze)]),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,nt),e.createVNode(kt,{id:n.id,second:n.second.id,third:n.third?n.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",lt,ot,512)),(e.openBlock(),e.createElementBlock("svg",rt,ct,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",st,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",it,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dt),ut,mt,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:n[7]||(n[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",pt,[e.createVNode(ft,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)],2)},module.exports=c;
2
2
  //# sourceMappingURL=Cart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=e5371912&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","setup","store","useStore","loading","ref","items","computed","getters","modal","total","quantity","close","commit","dispatch","window","addEventListener","e","value","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","products","forEach","item","push","id","attributes","code","price","brand","category","object","ecommerce","event","eventCallback","$ziggy","eventTimeout","dataLayer","setTimeout","error","console","_createElementVNode","role","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_renderSlot","_ctx","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","innerHTML","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_20","_hoisted_21","_toDisplayString","_hoisted_23","_hoisted_24","_createBlock","_","slotProps","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","image","src","_hoisted_43","_hoisted_45","_hoisted_47","_hoisted_48","_hoisted_49","priceOld","_hoisted_52","_createVNode","_hoisted_53","_hoisted_54","_hoisted_57","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","third","_hoisted_64","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_74","_hoisted_75","_hoisted_77","_hoisted_78","second","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_88","_hoisted_89","_hoisted_91","_hoisted_94","_hoisted_100","_hoisted_101","_hoisted_102","_hoisted_104","_hoisted_105","_hoisted_107","_hoisted_108","bundle","amount","_hoisted_111","_hoisted_112","_hoisted_114","_hoisted_117","_hoisted_120","_hoisted_121","_hoisted_122","locale","url","_hoisted_125","_hoisted_126","slider"],"mappings":"uMAmQ6BA,kBAAgB,CACzCC,KAAM,OACNC,MAAO,CACHC,QAAS,CACLC,KAAMC,iBACG,IAGjBC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GAEdC,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBACrCC,EAAQF,YAAS,kBAAML,EAAMM,QAAQ,iBACrCE,EAAQH,YAAS,kBAAML,EAAMM,QAAQ,iBACrCG,EAAWJ,YAAS,kBAAML,EAAMM,QAAQ,oBAMxCI,EAAQ,WACVV,EAAMW,OAAO,cAAc,IAa/BX,EAAMY,SAAS,WAAY,SACd,eAGbC,OAAOC,iBAAiB,SAAS,SAACC,GAC1BR,EAAMS,OAAmB,WAAVD,EAAEE,KACjBP,WAgBJQ,EAwCAC,EAvCEC,EAAcjB,MAAI,MAClBkB,EAAkBlB,MAAI,MACtBmB,EAAkBnB,MAAI,MAEtBoB,EAAQlB,YAAS,eACbkB,EAAQvB,EAAMM,QAAQ,qBAExBc,EAAYJ,QACRE,GACAA,EAAYM,UAGZD,EAAME,SACNP,EAAc,IAAIQ,UAAON,EAAYJ,MAAO,CACxCW,cAAe,EACfC,eAAgB,EAChBC,YAAa,KACJ,CACDF,cAAe,EACfC,eAAgB,IAGxBE,aAAc,EACdC,gBAAgB,EAChBC,QAAS,CAACC,cACVC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQhB,EAAgBL,MACxBsB,OAAQhB,E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ACIhF,2BAAAiF,IACIjF,kCAAW,QAAQgB,UAAQT,WAASpB,MAAML,EAAK8E,MAAMzE,gEAMzEa,2BAAAkF,IACIlF,2BAAAmF,IACInF,mCAAY,YAAYgB,UAAQT,WAASpB,MAAML,EAAKsG,OAAOlC,sBAC3DlD,mCAAY,gBAAgBgB,UAAQT,gCAAgCzB,EAAKsG,OAAOC,qBAEpFrF,2BAAAsF,IACItF,2BAAAuF,IACIvF,mCAAY,QAAQgB,UAAQT,WAASpB,MAAML,EAAKsG,OAAOjG,mBACvDiE,kBAAapE,GAAIF,EAAKE,GAAKqF,OAAQvF,EAAKuF,OAAOrF,GAAW4E,MAAO9E,EAAK8E,MAAQ9E,EAAK8E,MAAM5E,iFAOjHkB,2BAAAsF,2BAGAtF,2BAAAuF,iEAKRvF,2BAAAwF,IACI1F,2BAAA2F,qBAAsBpF,4BACtBP,2BAAA4F,wCACOrF,kCACHP,qBAAoF,KAAhFvB,KAAM8B,OAAKsF,OAAOC,IAAMvF,OAAKsF,OAAOC,2BAAcvF,oCAAgCwF,uCAASxF,kCAEnGP,qCAAc,kBAAmBQ,sCAAOD,yDAAUA,+BAClDP,2BAAAgG,IACI5C,kBAAS6C,QAAQ"}
1
+ {"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=222e3752&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', !modal.value);\n };\n\n const close = () => {\n store.commit('cart/modal', false);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', false);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', false);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n try {\n isLoading.value = true;\n\n let products = [];\n\n items.value.forEach((item) => {\n products.push({\n name: item.name,\n id: item.attributes.code,\n price: item.attributes.price,\n brand: item.attributes.brand,\n category: item.attributes.category,\n quantity: item.quantity\n });\n });\n\n const object = {\n ecommerce: {\n checkout: {\n products: [products]\n }\n },\n event: 'gtm-ee-event',\n 'gtm-ee-event-category': 'Ecommerce',\n 'gtm-ee-event-action': 'Checkout',\n 'gtm-ee-event-non-interaction': 'False',\n eventCallback: function () {\n window.location.href = $ziggy('shop.checkout');\n },\n eventTimeout: 2000\n };\n\n if (window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n } else {\n window.location.href = $ziggy('shop.checkout');\n }\n\n setTimeout(() => {\n window.location.href = $ziggy('shop.checkout');\n }, 2000);\n } catch (error) {\n console.error(error);\n\n window.location.href = $ziggy('shop.checkout');\n }\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","setup","store","useStore","loading","ref","items","computed","getters","modal","total","quantity","close","commit","dispatch","document","body","addEventListener","event","value","target","closest","window","e","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","products","forEach","item","push","id","attributes","code","price","brand","category","object","ecommerce","eventCallback","$ziggy","eventTimeout","dataLayer","setTimeout","error","console","_createElementVNode","role","_createElementBlock","_ctx","_hoisted_1","_hoisted_2","_renderSlot","onClick","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","innerHTML","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_19","_hoisted_20","_toDisplayString","_hoisted_22","_hoisted_23","_createBlock","_","slotProps","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","image","src","_hoisted_42","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","priceOld","_hoisted_51","_createVNode","_hoisted_52","_hoisted_53","_hoisted_56","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","third","_hoisted_63","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","second","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_93","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","bundle","amount","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_116","_hoisted_119","_hoisted_120","_hoisted_121","locale","url","_hoisted_124","_hoisted_125","slider"],"mappings":"uMAmQ6BA,kBAAgB,CACzCC,KAAM,OACNC,MAAO,CACHC,QAAS,CACLC,KAAMC,iBACG,IAGjBC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GAEdC,EAAQC,YAAS,kBAAML,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AAK4E,MAAQ5E,EAAK4E,MAAM1E,iFAOjHiB,2BAAAqF,2BAGArF,2BAAAsF,iEAKRtF,2BAAAuF,IACIzF,2BAAA0F,qBAAsBvF,4BACtBH,2BAAA2F,wCACOxF,kCACHH,qBAAoF,KAAhFtB,KAAMyB,OAAKyF,OAAOC,IAAM1F,OAAKyF,OAAOC,2BAAc1F,oCAAgC2F,uCAAS3F,kCAEnGH,qCAAc,kBAAmBO,sCAAOJ,yDAAUA,+BAClDH,2BAAA+F,IACI5C,kBAAS6C,QAAQ"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),i={name:"CartItem",props:{item:Object},setup:function(i){var n=t.useStore(),o=e.ref(!1),l=e.ref(),r=e.ref(i.item.attributes.options&&i.item.attributes.options.length?i.item.attributes.options:[]),a=e.ref(!1),c=e.computed((function(){return n.getters["auth/is"]}));i.item.attributes.options&&i.item.attributes.options.length&&(a.value=!0);var s=function(e){o.value=!0,n.dispatch("cart/add",{product:{id:i.item.id,quantity:e},finally:function(){o.value=!1}})};i.item.options&&i.item.options.length&&e.watch(r,(function(e){o.value=!0,n.dispatch("cart/options",{product:{id:i.item.id,options:Object.values(e)},finally:function(){o.value=!1}})}));return{loading:o,increase:function(){s(1)},decrease:function(){s(-1)},remove:function(){o.value=!0,n.dispatch("cart/remove",{id:i.item.id,finally:function(){o.value=!1}})},options:r,optionsToggled:a,input:l,gotoProduct:function(e){window.addEventListener("beforeunload",(function(){n.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){n.commit("cart/modal",null)})),window.location.href=e},auth:c}}},n={key:0,class:"column is-12"},o={class:"bundle-title"},l={class:"column name"},r={class:"column is-narrow"},a={class:"cart-actions"},c=["disabled"],s=[e.createElementVNode("svg",{class:"icon"},[e.createElementVNode("use",{"xlink:href":"#cart-remove"})],-1)],m={class:"column is-narrow"},d=["src"],u={key:1},p=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],v={class:"column"},b={class:"columns is-gapless mb-0"},k={class:"column"},E={key:0,class:"code"},g={class:"title"},f={key:0},V={key:0,class:"column is-narrow has-text-right is-relative"},N={class:"quantity"},h=["disabled"],y=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-minus"})],-1)],B=["disabled"],C=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-plus"})],-1)],w={key:0,class:"quantity-price"},x=["innerHTML"],S={class:"column is-2 has-text-right"},D=["innerHTML"],T=["innerHTML"],q=["innerHTML"],_=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),L={class:"wrapper"},M={class:"column is-narrow"},H=["value","id"],P={class:"column"},z=["for"],$={key:0,class:"option-description"},O={class:"column is-2 has-text-right"},j=e.createTextVNode("+"),U=["innerHTML"],F={key:0,class:"bundle columns"},I=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("div",{class:"cart-bundle-spacer"})],-1),A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),J=["src"],K={key:1},Q=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],R={class:"column"},W={key:0,class:"code"},X={class:"title"},Y={key:1,class:"bundle columns"},Z=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("div",{class:"cart-bundle-spacer"})],-1),ee={class:"column is-narrow"},te=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ie=["src"],ne={key:1},oe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],le={class:"column"},re={key:0,class:"code"},ae={class:"title"};i.render=function(t,i,ce,se,me,de){var ue=e.resolveComponent("wishlist-add");return ce.item.deleted?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["columns is-multiline shop-cart-item",{inactive:!1===ce.item.attributes.active,"is-bundle":ce.item.attributes.bundle}])},[ce.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",l,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":ce.item.attributes.bundle}])},[e.createElementVNode("div",r,[e.createElementVNode("div",a,[e.createElementVNode("button",{class:"remove",onClick:i[0]||(i[0]=function(){return se.remove&&se.remove.apply(se,arguments)}),disabled:se.loading},s,8,c),se.auth&&!ce.item.attributes.bundle?(e.openBlock(),e.createBlock(ue,{key:0,id:ce.item.id},null,8,["id"])):e.createCommentVNode("v-if",!0)])]),e.createElementVNode("div",m,[e.createElementVNode("a",{onClick:i[1]||(i[1]=function(e){return se.gotoProduct(ce.item.attributes.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.image}])},[ce.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.image},null,8,d)):(e.openBlock(),e.createElementBlock("svg",u,p))],2)])]),e.createElementVNode("div",v,[e.createElementVNode("div",b,[e.createElementVNode("div",k,[e.renderSlot(t.$slots,"item-name",{item:ce.item,gotoProduct:se.gotoProduct},(function(){return[ce.item.attributes.code?(e.openBlock(),e.createElementBlock("div",E,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",g,[!1===ce.item.attributes.active?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(ce.item.name),1)):(e.openBlock(),e.createElementBlock("a",{key:1,onClick:i[2]||(i[2]=function(e){return se.gotoProduct(ce.item.attributes.href)})},e.toDisplayString(ce.item.name),1))])]}))]),(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",N,[e.createElementVNode("button",{class:"button decrease",onClick:i[3]||(i[3]=function(){return se.decrease&&se.decrease.apply(se,arguments)}),disabled:se.loading||1==ce.item.quantity},y,8,h),e.withDirectives(e.createElementVNode("input",{class:"input is-small",type:"number",min:"1","onUpdate:modelValue":i[4]||(i[4]=function(e){return ce.item.quantity=e}),disabled:""},null,512),[[e.vModelText,ce.item.quantity]]),e.createElementVNode("button",{class:"button increase",onClick:i[5]||(i[5]=function(){return se.increase&&se.increase.apply(se,arguments)}),disabled:se.loading},C,8,B)]),ce.item.quantity>1?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("span",{innerHTML:t.$filters.price(ce.item.attributes.price)},null,8,x),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)])),e.createElementVNode("div",S,[e.renderSlot(t.$slots,"item-price",{item:ce.item,filters:t.$filters},(function(){return[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":ce.item.attributes.bundle}])},[ce.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(ce.item.attributes.priceOld*ce.item.quantity)},null,8,D)):e.createCommentVNode("v-if",!0),ce.item.attributes.bundle&&ce.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(ce.item.attributes.amount.percent?ce.item.attributes.amount.percent+"%":t.$filters.price(ce.item.attributes.amount.sum*ce.item.quantity))},null,8,T)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(ce.item.attributes.price*ce.item.quantity)},null,8,q)],2)]}))])]),ce.item.options&&ce.item.options.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["options",{"is-toggled":se.optionsToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:i[6]||(i[6]=function(e){return se.optionsToggled=!se.optionsToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(ce.item.options.length),1),_]),e.withDirectives(e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.item.options,(function(n,o){return e.openBlock(),e.createElementBlock("div",{key:o,class:e.normalizeClass(["columns",{"is-checked":-1!==se.options.indexOf(n.id)}])},[e.createElementVNode("div",M,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":i[7]||(i[7]=function(e){return se.options=e}),value:n.id,id:"option-"+ce.item.id+"-"+n.id},null,8,H),[[e.vModelCheckbox,se.options]])]),e.createElementVNode("div",P,[e.createElementVNode("label",{class:"option-title is-clickable",for:"option-"+ce.item.id+"-"+n.id},e.toDisplayString(n.name),9,z),n.description?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",O,[j,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])],2)})),128))],512),[[e.vShow,se.optionsToggled]])],2)):e.createCommentVNode("v-if",!0)])],2),ce.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("div",A,[G,e.createElementVNode("a",{onClick:i[8]||(i[8]=function(e){return se.gotoProduct(ce.item.attributes.second.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.second.image}])},[ce.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.second.image},null,8,J)):(e.openBlock(),e.createElementBlock("svg",K,Q))],2)])]),e.createElementVNode("div",R,[ce.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",X,[e.createElementVNode("a",{onClick:i[9]||(i[9]=function(e){return se.gotoProduct(ce.item.attributes.second.href)})},e.toDisplayString(ce.item.attributes.second.name),1)])])])):e.createCommentVNode("v-if",!0),ce.item.attributes.bundle&&ce.item.attributes.third?(e.openBlock(),e.createElementBlock("div",Y,[Z,e.createElementVNode("div",ee,[te,e.createElementVNode("a",{onClick:i[10]||(i[10]=function(e){return se.gotoProduct(ce.item.attributes.third.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.third.image}])},[ce.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.third.image},null,8,ie)):(e.openBlock(),e.createElementBlock("svg",ne,oe))],2)])]),e.createElementVNode("div",le,[ce.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",re,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ae,[e.createElementVNode("a",{onClick:i[11]||(i[11]=function(e){return se.gotoProduct(ce.item.attributes.third.href)})},e.toDisplayString(ce.item.attributes.third.name),1)])])])):e.createCommentVNode("v-if",!0)])],2))},module.exports=i;
1
+ "use strict";var e=require("vue"),t=require("vuex"),i={name:"CartItem",props:{item:Object},setup:function(i){var n=t.useStore(),o=e.ref(!1),l=e.ref(),a=e.ref(i.item.attributes.options&&i.item.attributes.options.length?i.item.attributes.options:[]),r=e.ref(!1),c=e.computed((function(){return n.getters["auth/is"]}));i.item.attributes.options&&i.item.attributes.options.length&&(r.value=!0);var s=function(e){o.value=!0,n.dispatch("cart/add",{product:{id:i.item.id,quantity:e},finally:function(){o.value=!1}})};i.item.options&&i.item.options.length&&e.watch(a,(function(e){o.value=!0,n.dispatch("cart/options",{product:{id:i.item.id,options:Object.values(e)},finally:function(){o.value=!1}})}));return{loading:o,increase:function(){s(1)},decrease:function(){s(-1)},remove:function(){o.value=!0,n.dispatch("cart/remove",{id:i.item.id,finally:function(){o.value=!1}})},options:a,optionsToggled:r,input:l,gotoProduct:function(e){window.addEventListener("beforeunload",(function(){n.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){n.commit("cart/modal",null)})),window.location.href=e},auth:c}}},n={key:0,class:"column is-12"},o={class:"bundle-title"},l={class:"column name"},a={class:"column is-narrow cart-actions-parent"},r={class:"cart-actions"},c=["disabled"],s=[e.createElementVNode("svg",{class:"icon"},[e.createElementVNode("use",{"xlink:href":"#cart-remove"})],-1)],m={class:"column is-narrow image-parent"},d=["src"],u={key:1},p=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],v={class:"column"},b={class:"columns is-gapless mb-0"},k={class:"column"},g={key:0,class:"code"},E={class:"title"},f={key:0},V={key:0,class:"column is-narrow has-text-right is-relative quantity-parent"},N={class:"quantity"},h=["disabled"],y=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-minus"})],-1)],B=["disabled"],C=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-plus"})],-1)],w={key:0,class:"quantity-price"},x=["innerHTML"],S={class:"column is-2 has-text-right"},D=["innerHTML"],T=["innerHTML"],q=["innerHTML"],_=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),L={class:"wrapper"},M={class:"column is-narrow"},H=["value","id"],P={class:"column"},z=["for"],$={key:0,class:"option-description"},O={class:"column is-2 has-text-right"},j=e.createTextVNode("+"),U=["innerHTML"],F={key:0,class:"bundle columns"},I=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("div",{class:"cart-bundle-spacer"})],-1),A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),J=["src"],K={key:1},Q=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],R={class:"column"},W={key:0,class:"code"},X={class:"title"},Y={key:1,class:"bundle columns"},Z=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("div",{class:"cart-bundle-spacer"})],-1),ee={class:"column is-narrow"},te=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ie=["src"],ne={key:1},oe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],le={class:"column"},ae={key:0,class:"code"},re={class:"title"};i.render=function(t,i,ce,se,me,de){var ue=e.resolveComponent("wishlist-add");return ce.item.deleted?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["columns is-multiline shop-cart-item",{inactive:!1===ce.item.attributes.active,"is-bundle":ce.item.attributes.bundle}])},[ce.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",l,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":ce.item.attributes.bundle}])},[e.createElementVNode("div",a,[e.createElementVNode("div",r,[e.createElementVNode("button",{class:"remove",onClick:i[0]||(i[0]=function(){return se.remove&&se.remove.apply(se,arguments)}),disabled:se.loading},s,8,c),se.auth&&!ce.item.attributes.bundle?(e.openBlock(),e.createBlock(ue,{key:0,id:ce.item.id},null,8,["id"])):e.createCommentVNode("v-if",!0)])]),e.createElementVNode("div",m,[e.createElementVNode("a",{onClick:i[1]||(i[1]=function(e){return se.gotoProduct(ce.item.attributes.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.image}])},[ce.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.image},null,8,d)):(e.openBlock(),e.createElementBlock("svg",u,p))],2)])]),e.createElementVNode("div",v,[e.createElementVNode("div",b,[e.createElementVNode("div",k,[e.renderSlot(t.$slots,"item-name",{item:ce.item,gotoProduct:se.gotoProduct},(function(){return[ce.item.attributes.code?(e.openBlock(),e.createElementBlock("div",g,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[!1===ce.item.attributes.active?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(ce.item.name),1)):(e.openBlock(),e.createElementBlock("a",{key:1,onClick:i[2]||(i[2]=function(e){return se.gotoProduct(ce.item.attributes.href)})},e.toDisplayString(ce.item.name),1))])]}))]),(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",N,[e.createElementVNode("button",{class:"button decrease",onClick:i[3]||(i[3]=function(){return se.decrease&&se.decrease.apply(se,arguments)}),disabled:se.loading||1==ce.item.quantity},y,8,h),e.withDirectives(e.createElementVNode("input",{class:"input is-small",type:"number",min:"1","onUpdate:modelValue":i[4]||(i[4]=function(e){return ce.item.quantity=e}),disabled:""},null,512),[[e.vModelText,ce.item.quantity]]),e.createElementVNode("button",{class:"button increase",onClick:i[5]||(i[5]=function(){return se.increase&&se.increase.apply(se,arguments)}),disabled:se.loading},C,8,B)]),ce.item.quantity>1?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("span",{innerHTML:t.$filters.price(ce.item.attributes.price)},null,8,x),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)])),e.createElementVNode("div",S,[e.renderSlot(t.$slots,"item-price",{item:ce.item,filters:t.$filters},(function(){return[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":ce.item.attributes.bundle}])},[ce.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(ce.item.attributes.priceOld*ce.item.quantity)},null,8,D)):e.createCommentVNode("v-if",!0),ce.item.attributes.bundle&&ce.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(ce.item.attributes.amount.percent?ce.item.attributes.amount.percent+"%":t.$filters.price(ce.item.attributes.amount.sum*ce.item.quantity))},null,8,T)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(ce.item.attributes.price*ce.item.quantity)},null,8,q)],2)]}))])]),ce.item.options&&ce.item.options.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["options",{"is-toggled":se.optionsToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:i[6]||(i[6]=function(e){return se.optionsToggled=!se.optionsToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(ce.item.options.length),1),_]),e.withDirectives(e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.item.options,(function(n,o){return e.openBlock(),e.createElementBlock("div",{key:o,class:e.normalizeClass(["columns",{"is-checked":-1!==se.options.indexOf(n.id)}])},[e.createElementVNode("div",M,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":i[7]||(i[7]=function(e){return se.options=e}),value:n.id,id:"option-"+ce.item.id+"-"+n.id},null,8,H),[[e.vModelCheckbox,se.options]])]),e.createElementVNode("div",P,[e.createElementVNode("label",{class:"option-title is-clickable",for:"option-"+ce.item.id+"-"+n.id},e.toDisplayString(n.name),9,z),n.description?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",O,[j,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])],2)})),128))],512),[[e.vShow,se.optionsToggled]])],2)):e.createCommentVNode("v-if",!0)])],2),ce.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("div",A,[G,e.createElementVNode("a",{onClick:i[8]||(i[8]=function(e){return se.gotoProduct(ce.item.attributes.second.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.second.image}])},[ce.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.second.image},null,8,J)):(e.openBlock(),e.createElementBlock("svg",K,Q))],2)])]),e.createElementVNode("div",R,[ce.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",X,[e.createElementVNode("a",{onClick:i[9]||(i[9]=function(e){return se.gotoProduct(ce.item.attributes.second.href)})},e.toDisplayString(ce.item.attributes.second.name),1)])])])):e.createCommentVNode("v-if",!0),ce.item.attributes.bundle&&ce.item.attributes.third?(e.openBlock(),e.createElementBlock("div",Y,[Z,e.createElementVNode("div",ee,[te,e.createElementVNode("a",{onClick:i[10]||(i[10]=function(e){return se.gotoProduct(ce.item.attributes.third.href)})},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!ce.item.attributes.third.image}])},[ce.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:ce.item.attributes.third.image},null,8,ie)):(e.openBlock(),e.createElementBlock("svg",ne,oe))],2)])]),e.createElementVNode("div",le,[ce.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",ae,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(ce.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",re,[e.createElementVNode("a",{onClick:i[11]||(i[11]=function(e){return se.gotoProduct(ce.item.attributes.third.href)})},e.toDisplayString(ce.item.attributes.third.name),1)])])])):e.createCommentVNode("v-if",!0)])],2))},module.exports=i;
2
2
  //# sourceMappingURL=CartItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=a41dc228&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.id\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"gotoProduct(item.attributes.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\">\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.second.href)\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch('cart/remove', {\n id: props.item.id,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch('cart/add', {\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch('cart/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.id\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"gotoProduct(item.attributes.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\">\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.second.href)\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch('cart/remove', {\n id: props.item.id,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch('cart/add', {\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch('cart/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>"],"names":["name","props","item","Object","setup","store","useStore","loading","ref","input","options","attributes","length","optionsToggled","auth","computed","getters","value","quantity","difference","dispatch","product","id","watch","values","increase","decrease","remove","gotoProduct","href","window","addEventListener","commit","location","_createElementVNode","$props","deleted","_createElementBlock","active","bundle","_hoisted_1","_hoisted_2","_ctx","_hoisted_3","_hoisted_4","_hoisted_5","onClick","$setup","disabled","_createBlock","_hoisted_9","image","src","_hoisted_14","_hoisted_15","_hoisted_16","_renderSlot","code","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","type","min","_hoisted_28","innerHTML","price","_hoisted_31","filters","priceOld","amount","percent","sum","_hoisted_35","_hoisted_36","option","index","key","indexOf","_hoisted_37","_hoisted_39","description","_hoisted_41","_hoisted_42","_hoisted_45","_hoisted_46","_hoisted_47","_hoisted_48","second","_hoisted_53","_hoisted_54","_hoisted_55","third","_hoisted_56","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_64","_hoisted_65","_hoisted_66"],"mappings":"sDAgJe,CACXA,KAAM,WACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAQD,QACRE,EAAUF,MAAIP,EAAMC,KAAKS,WAAWD,SAAWT,EAAMC,KAAKS,WAAWD,QAAQE,OAASX,EAAMC,KAAKS,WAAWD,QAAU,IACtHG,EAAiBL,OAAI,GACrBM,EAAOC,YAAS,kBAAMV,EAAMW,QAAQ,cAEtCf,EAAMC,KAAKS,WAAWD,SAAWT,EAAMC,KAAKS,WAAWD,QAAQE,SAC/DC,EAAeI,OAAQ,OAsBrBC,EAAW,SAACC,GACdZ,EAAQU,OAAQ,EAEhBZ,EAAMe,SAAS,WAAY,CACvBC,QAAS,CACLC,GAAIrB,EAAMC,KAAKoB,GACfJ,SAAUC,WAEL,WACLZ,EAAQU,OAAQ,MAKxBhB,EAAMC,KAAKQ,SAAWT,EAAMC,KAAKQ,QAAQE,QACzCW,QAAMb,GAAS,SAACA,GACZH,EAAQU,OAAQ,EAEhBZ,EAAMe,SAA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KxB,WAAW6E,OAAOrC,iCAClCd,yCAMZH,2BAAAuD,GAC4BtD,QAAKxB,WAAW6E,OAAO/B,oBAA/CpB,2BAAAqD,oBAAwDhD,8CAA2BP,QAAKxB,WAAW6E,OAAO/B,0CAC1GvB,2BAAAyD,GACIzD,0BAAIY,uCAAOC,eAAYZ,QAAKxB,WAAW6E,OAAO3D,2BAAUM,QAAKxB,WAAW6E,OAAOxF,gDAIzDmC,QAAKxB,WAAW4B,QAAUJ,QAAKxB,WAAWiF,qBAA5EvD,2BAAAwD,GACIC,EAGA5D,2BAAA6D,IACIC,GAGA9D,0BAAIY,yCAAOC,eAAYZ,QAAKxB,WAAWiF,MAAM/D,UACzCK,uDAAc,+BAA+CC,QAAKxB,WAAWiF,MAAMzC,WACjChB,QAAKxB,WAAWiF,MAAMzC,qBAApEd,kCAAMe,IAAKjB,QAAKxB,WAAWiF,MAAMzC,kCACjCd,2CAMZH,2BAAA+D,IAC4B9D,QAAKxB,WAAWiF,MAAMnC,oBAA9CpB,2BAAA6D,qBAAuDxD,8CAA2BP,QAAKxB,WAAWiF,MAAMnC,0CACxGvB,2BAAAiE,IACIjE,0BAAIY,yCAAOC,eAAYZ,QAAKxB,WAAWiF,MAAM/D,2BAAUM,QAAKxB,WAAWiF,MAAM5F"}
1
+ {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=61e32b2d&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.id\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(item.attributes.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\">\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.second.href)\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch('cart/remove', {\n id: props.item.id,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch('cart/add', {\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch('cart/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-if=\"!item.deleted\" v-bind:class=\"{ inactive: item.attributes.active === false, 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow cart-actions-parent\">\n <div class=\"cart-actions\">\n <button class=\"remove\" @click=\"remove\" :disabled=\"loading\">\n <svg class=\"icon\">\n <use xlink:href=\"#cart-remove\" />\n </svg>\n </button>\n <wishlist-add :id=\"item.id\" v-if=\"auth && !item.attributes.bundle\"></wishlist-add>\n </div>\n </div>\n <div class=\"column is-narrow image-parent\">\n <a @click=\"gotoProduct(item.attributes.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <slot name=\"item-name\" :item=\"item\" :gotoProduct=\"gotoProduct\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <span v-if=\"item.attributes.active === false\">\n {{ item.name }}\n </span>\n <a @click=\"gotoProduct(item.attributes.href)\" v-else>{{ item.name }}</a>\n </div>\n </slot>\n </div>\n <div class=\"column is-narrow has-text-right is-relative quantity-parent\" v-if=\"true || $env.shop.isChangeQuantity\">\n <div class=\"quantity\">\n <button class=\"button decrease\" @click=\"decrease\" :disabled=\"loading || item.quantity == 1\">\n <svg>\n <use xlink:href=\"#cart-minus\" />\n </svg>\n </button>\n <input class=\"input is-small\" type=\"number\" min=\"1\" v-model=\"item.quantity\" disabled />\n <button class=\"button increase\" @click=\"increase\" :disabled=\"loading\">\n <svg>\n <use xlink:href=\"#cart-plus\" />\n </svg>\n </button>\n </div>\n <div class=\"quantity-price\" v-if=\"item.quantity > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-narrow has-text-right\" v-else>{{ item.quantity }}✕</div>\n <div class=\"column is-2 has-text-right\">\n <slot name=\"item-price\" :item=\"item\" :filters=\"$filters\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </slot>\n </div>\n </div>\n <div class=\"options\" v-if=\"item.options && item.options.length\" v-bind:class=\"{ 'is-toggled': optionsToggled }\">\n <div class=\"toggler\" @click=\"optionsToggled = !optionsToggled\">\n <span>{{ __('shop.cart.additional') }} {{ item.options.length }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"wrapper\" v-show=\"optionsToggled\">\n <div v-for=\"(option, index) in item.options\" v-bind:key=\"index\" class=\"columns\" v-bind:class=\"{ 'is-checked': options.indexOf(option.id) !== -1 }\">\n <div class=\"column is-narrow\">\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"options\" :value=\"option.id\" :id=\"'option-' + item.id + '-' + option.id\" />\n </div>\n <div class=\"column\">\n <label class=\"option-title is-clickable\" :for=\"'option-' + item.id + '-' + option.id\">{{ option.name }}</label>\n <div class=\"option-description\" v-if=\"option.description\">{{ option.description }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.second.href)\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <div class=\"cart-bundle-spacer\"></div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n <a @click=\"gotoProduct(item.attributes.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a @click=\"gotoProduct(item.attributes.third.href)\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'CartItem',\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const input = ref();\n const options = ref(props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []);\n const optionsToggled = ref(false);\n const auth = computed(() => store.getters['auth/is']);\n\n if (props.item.attributes.options && props.item.attributes.options.length) {\n optionsToggled.value = true;\n }\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch('cart/remove', {\n id: props.item.id,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n const increase = () => {\n quantity(+1);\n };\n\n const decrease = () => {\n quantity(-1);\n };\n\n const quantity = (difference) => {\n loading.value = true;\n\n store.dispatch('cart/add', {\n product: {\n id: props.item.id,\n quantity: difference\n },\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n if (props.item.options && props.item.options.length) {\n watch(options, (options) => {\n loading.value = true;\n\n store.dispatch('cart/options', {\n product: {\n id: props.item.id,\n options: Object.values(options)\n },\n finally: () => {\n loading.value = false;\n }\n });\n });\n }\n\n const gotoProduct = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n return {\n loading,\n increase,\n decrease,\n remove,\n options,\n optionsToggled,\n input,\n gotoProduct,\n auth\n };\n }\n};\n</script>"],"names":["name","props","item","Object","setup","store","useStore","loading","ref","input","options","attributes","length","optionsToggled","auth","computed","getters","value","quantity","difference","dispatch","product","id","watch","values","increase","decrease","remove","gotoProduct","href","window","addEventListener","commit","location","_createElementVNode","$props","deleted","_createElementBlock","active","bundle","_hoisted_1","_hoisted_2","_ctx","_hoisted_3","_hoisted_4","_hoisted_5","onClick","$setup","disabled","_createBlock","_hoisted_9","image","src","_hoisted_14","_hoisted_15","_hoisted_16","_renderSlot","code","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","type","min","_hoisted_28","innerHTML","price","_hoisted_31","filters","priceOld","amount","percent","sum","_hoisted_35","_hoisted_36","option","index","key","indexOf","_hoisted_37","_hoisted_39","description","_hoisted_41","_hoisted_42","_hoisted_45","_hoisted_46","_hoisted_47","_hoisted_48","second","_hoisted_53","_hoisted_54","_hoisted_55","third","_hoisted_56","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_64","_hoisted_65","_hoisted_66"],"mappings":"sDAgJe,CACXA,KAAM,WACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAQD,QACRE,EAAUF,MAAIP,EAAMC,KAAKS,WAAWD,SAAWT,EAAMC,KAAKS,WAAWD,QAAQE,OAASX,EAAMC,KAAKS,WAAWD,QAAU,IACtHG,EAAiBL,OAAI,GACrBM,EAAOC,YAAS,kBAAMV,EAAMW,QAAQ,cAEtCf,EAAMC,KAAKS,WAAWD,SAAWT,EAAMC,KAAKS,WAAWD,QAAQE,SAC/DC,EAAeI,OAAQ,OAsBrBC,EAAW,SAACC,GACdZ,EAAQU,OAAQ,EAEhBZ,EAAMe,SAAS,WAAY,CACvBC,QAAS,CACLC,GAAIrB,EAAMC,KAAKoB,GACfJ,SAAUC,WAEL,WACLZ,EAAQU,OAAQ,MAKxBhB,EAAMC,KAAKQ,SAAWT,EAAMC,KAAKQ,QAAQE,QACzCW,QAAMb,GAAS,SAACA,GACZH,EAAQU,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