@perevorot/shop 2.0.9 → 2.0.13

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"),i=require("swiper");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(i),d=e.defineComponent({props:{id:Number,type:{type:String,default:"promo-products"}},setup:function(t){var d=!1,n=e.ref(!1),r=e.ref(null),a=e.ref(null),o=function(e){e.forEach((function(e){e.isIntersecting&&(d||(d=!0,l()))}))},l=function(){$http.post($ziggy("api.piece",{slug:t.type}),{id:t.id}).then((function(d){var o="piece-promo-products-"+t.id;window.app.component(o,{template:d.data?d.data:"<i></i>"}),a.value=o,n.value=!0,e.nextTick((function(){var e=r.value.querySelectorAll(".is-faded-tabs");e.length&&e.forEach((function(e){new s.default(e.querySelector(".swiper"),{slidesPerView:"auto",freeMode:{enabled:!0},modules:[i.Navigation,i.Mousewheel,i.FreeMode]})}));var t=r.value.querySelectorAll(".is-faded-tabs .swiper-slide"),d=r.value.querySelectorAll("[products-slider]");t.forEach((function(e,i){e.addEventListener("click",(function(){t.forEach((function(e){e.classList.remove("is-active")})),d.forEach((function(e){e.classList.add("is-hidden")})),d[i].classList.remove("is-hidden"),e.classList.add("is-active")}))})),d.length&&d.forEach((function(e){new s.default(e,window.viewedSwiperOptions)})),window.lazyImages&&window.lazyImages.update()}))}))};return window.addEventListener("DOMContentLoaded",(function(){new IntersectionObserver(o,{threshold:.1}).observe(r.value)})),{container:r,component:a,loaded:n}}}),n={ref:"container"},r={key:0,class:"product-promo-block container is-fluid is-skeleton"},a=e.createStaticVNode('<div class="gradient"></div><div class="title slider-title"> </div><div class="is-faded-tabs"><div class="is-flex"><div class="swiper-slide"> </div><div class="swiper-slide"> </div></div></div>',3),o={class:"swiper"},l={class:"swiper-wrapper products is-slider"},c=[e.createStaticVNode('<div class="border"><div class="wrapper"><picture class="is-lazy-loaded"><img class="lazy entered loaded" src="/images/blank.png"></picture><div class="availability"> </div><div class="title"> </div><div class="prices"><div class="price"></div></div></div></div>',1)];d.render=function(i,t,s,d,u,p){return e.openBlock(),e.createElementBlock("div",n,[i.loaded?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),{key:1})):(e.openBlock(),e.createElementBlock("section",r,[a,e.createElementVNode("div",o,[e.createElementVNode("div",l,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(function(i){return e.createElementVNode("div",{class:"product",key:i},c)})),64))])])]))],512)},module.exports=d;
1
+ "use strict";var e=require("vue"),i=require("swiper");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(i),r=e.defineComponent({props:{id:Number,type:{type:String,default:"promo-products"}},setup:function(t){var r=!1,d=e.ref(!1),n=e.ref(null),o=e.ref(null),a=function(e){e.forEach((function(e){e.isIntersecting&&(r||(r=!0,l()))}))},l=function(){$http.post($ziggy("api.piece",{slug:t.type}),{id:t.id}).then((function(r){var a="piece-promo-products-"+t.id;window.app.component(a,{template:r.data?r.data:"<i></i>"}),o.value=a,d.value=!0,e.nextTick((function(){var e=n.value.querySelectorAll(".is-faded-tabs");e.length&&e.forEach((function(e){new s.default(e.querySelector(".swiper"),{slidesPerView:"auto",freeMode:{enabled:!0},mousewheel:{forceToAxis:!0},modules:[i.Navigation,i.Mousewheel,i.FreeMode]})}));var t=n.value.querySelectorAll(".is-faded-tabs .swiper-slide"),r=n.value.querySelectorAll("[products-slider]");t.forEach((function(e,i){e.addEventListener("click",(function(){t.forEach((function(e){e.classList.remove("is-active")})),r.forEach((function(e){e.classList.add("is-hidden")})),r[i].classList.remove("is-hidden"),e.classList.add("is-active")}))})),r.length&&r.forEach((function(e){new s.default(e,window.viewedSwiperOptions)})),window.lazyImages&&window.lazyImages.update()}))}))};return window.addEventListener("DOMContentLoaded",(function(){new IntersectionObserver(a,{threshold:.1}).observe(n.value)})),{container:n,component:o,loaded:d}}}),d={ref:"container"},n={key:0,class:"product-promo-block container is-fluid is-skeleton"},o=e.createStaticVNode('<div class="gradient"></div><div class="title slider-title"> </div><div class="is-faded-tabs"><div class="is-flex"><div class="swiper-slide"> </div><div class="swiper-slide"> </div></div></div>',3),a={class:"swiper"},l={class:"swiper-wrapper products is-slider"},c=[e.createStaticVNode('<div class="border"><div class="wrapper"><picture class="is-lazy-loaded"><img class="lazy entered loaded" src="/images/blank.png"></picture><div class="availability"> </div><div class="title"> </div><div class="prices"><div class="price"></div></div></div></div>',1)];r.render=function(i,t,s,r,u,p){return e.openBlock(),e.createElementBlock("div",d,[i.loaded?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),{key:1})):(e.openBlock(),e.createElementBlock("section",n,[o,e.createElementVNode("div",a,[e.createElementVNode("div",l,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(function(i){return e.createElementVNode("div",{class:"product",key:i},c)})),64))])])]))],512)},module.exports=r;
2
2
  //# sourceMappingURL=PromoProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromoProducts.js","sources":["../../../src/components/shop/PromoProducts.vue","../../../src/components/shop/PromoProducts.vue?vue&type=template&id=014d4b4c&lang.js"],"sourcesContent":["<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\">&nbsp;</div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\">&nbsp;</div>\n <div class=\"swiper-slide\">&nbsp;</div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\">&nbsp;</div>\n <div class=\"title\">&nbsp;</div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number,\n type: {\n type: String,\n default: 'promo-products'\n }\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: props.type }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n","<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\">&nbsp;</div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\">&nbsp;</div>\n <div class=\"swiper-slide\">&nbsp;</div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\">&nbsp;</div>\n <div class=\"title\">&nbsp;</div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number,\n type: {\n type: String,\n default: 'promo-products'\n }\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: props.type }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","id","Number","type","String","setup","inited","loaded","ref","container","component","callback","entries","forEach","entry","isIntersecting","load","$http","post","$ziggy","slug","then","response","componentName","window","app","template","data","value","nextTick","fadedTabs","querySelectorAll","length","tab","Swiper","querySelector","slidesPerView","freeMode","enabled","modules","Navigation","Mousewheel","FreeMode","tabs","sliders","index","addEventListener","classList","remove","slider","add","viewedSwiperOptions","lazyImages","update","IntersectionObserver","threshold","observe","_createElementBlock","_hoisted_1","_ctx","_createBlock","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_6","_hoisted_7","key"],"mappings":"2IAqCeA,kBAAgB,CAC3BC,MAAO,CACHC,GAAIC,OACJC,KAAM,CACFA,KAAMC,eACG,mBAGjBC,eAAML,OACEM,GAAS,EAEPC,EAASC,OAAI,GACbC,EAAYD,MAAI,MAChBE,EAAYF,MAAI,MAEhBG,EAAW,SAACC,GACdA,EAAQC,SAAQ,SAACC,GACTA,EAAMC,iBACDT,IACDA,GAAS,EAETU,UAMVA,EAAO,WACTC,MACKC,KAAKC,OAAO,YAAa,CAAEC,KAAMpB,EAAMG,OAAS,CAC7CF,GAAID,EAAMC,KAEboB,MAAK,SAACC,OACGC,EAAgB,wBAA0BvB,EAAMC,GAEtDuB,OAAOC,IAAIf,UAAUa,EAAe,CAChCG,SAAUJ,EAASK,KAAOL,EAASK,KAAO,YAG9CjB,EAAUkB,MAAQL,EAClBhB,EAAOqB,OAAQ,EAEfC,YAAS,eACCC,EAAYrB,EAAUmB,MAAMG,iBAAiB,kBAE/CD,EAAUE,QACVF,EAAUjB,SAAQ,SAACoB,OACXC,UAAOD,EAAIE,cAAc,WAAY,CACrCC,cAAe,OACfC,SAAU,CACNC,SAAS,GAEbC,QAAS,CAACC,aAAYC,aAAYC,qBAKxCC,EAAOlC,EAAUmB,MAAMG,iBAAiB,gCACxCa,EAAUnC,EAAUmB,MAAMG,iBAAiB,qBAEjDY,EAAK9B,SAAQ,SAACoB,EAAKY,GACfZ,EAAIa,iBAAiB,SAAS,WAC1BH,EAAK9B,SAAQ,SAACoB,GACVA,EAAIc,UAAUC,OAAO,gBAGzBJ,EAAQ/B,SAAQ,SAACoC,GACbA,EAAOF,UAAUG,IAAI,gBAGzBN,EAAQC,GAAOE,UAAUC,OAAO,aAChCf,EAAIc,UAAUG,IAAI,mBAItBN,EAAQZ,QACRY,EAAQ/B,SAAQ,SAACoC,OACTf,UAAOe,EAAQzB,OAAO2B,wBAI9B3B,OAAO4B,YACP5B,OAAO4B,WAAWC,uBAMtC7B,OAAOsB,iBAAiB,oBAAoB,eACpCQ,qBAAqB3C,EAAU,CAC/B4C,UAAW,KACZC,QAAQ/C,EAAUmB,UAGlB,CACHnB,UAAAA,EACAC,UAAAA,EACAH,OAAAA,SCrIHC,IAAI,4BACU,4RASA,mBACI,6XAXvBiD,2BAAAC,GAC+EC,wBA4B3EC,wCAAgBD,sCA5BhBF,+BAAAI,GACIC,EAQAC,2BAAAC,GACID,2BAAAE,kBACIR,kDAAqC,YAATZ,UAA5BkB,kCAAW,UAA8BG,IAAKrB"}
1
+ {"version":3,"file":"PromoProducts.js","sources":["../../../src/components/shop/PromoProducts.vue","../../../src/components/shop/PromoProducts.vue?vue&type=template&id=5b048c5f&lang.js"],"sourcesContent":["<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\">&nbsp;</div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\">&nbsp;</div>\n <div class=\"swiper-slide\">&nbsp;</div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\">&nbsp;</div>\n <div class=\"title\">&nbsp;</div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number,\n type: {\n type: String,\n default: 'promo-products'\n }\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: props.type }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n mousewheel: {\n forceToAxis: true,\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n","<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\">&nbsp;</div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\">&nbsp;</div>\n <div class=\"swiper-slide\">&nbsp;</div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\">&nbsp;</div>\n <div class=\"title\">&nbsp;</div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number,\n type: {\n type: String,\n default: 'promo-products'\n }\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: props.type }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n mousewheel: {\n forceToAxis: true,\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","id","Number","type","String","setup","inited","loaded","ref","container","component","callback","entries","forEach","entry","isIntersecting","load","$http","post","$ziggy","slug","then","response","componentName","window","app","template","data","value","nextTick","fadedTabs","querySelectorAll","length","tab","Swiper","querySelector","slidesPerView","freeMode","enabled","mousewheel","forceToAxis","modules","Navigation","Mousewheel","FreeMode","tabs","sliders","index","addEventListener","classList","remove","slider","add","viewedSwiperOptions","lazyImages","update","IntersectionObserver","threshold","observe","_createElementBlock","_hoisted_1","_ctx","_createBlock","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_6","_hoisted_7","key"],"mappings":"2IAqCeA,kBAAgB,CAC3BC,MAAO,CACHC,GAAIC,OACJC,KAAM,CACFA,KAAMC,eACG,mBAGjBC,eAAML,OACEM,GAAS,EAEPC,EAASC,OAAI,GACbC,EAAYD,MAAI,MAChBE,EAAYF,MAAI,MAEhBG,EAAW,SAACC,GACdA,EAAQC,SAAQ,SAACC,GACTA,EAAMC,iBACDT,IACDA,GAAS,EAETU,UAMVA,EAAO,WACTC,MACKC,KAAKC,OAAO,YAAa,CAAEC,KAAMpB,EAAMG,OAAS,CAC7CF,GAAID,EAAMC,KAEboB,MAAK,SAACC,OACGC,EAAgB,wBAA0BvB,EAAMC,GAEtDuB,OAAOC,IAAIf,UAAUa,EAAe,CAChCG,SAAUJ,EAASK,KAAOL,EAASK,KAAO,YAG9CjB,EAAUkB,MAAQL,EAClBhB,EAAOqB,OAAQ,EAEfC,YAAS,eACCC,EAAYrB,EAAUmB,MAAMG,iBAAiB,kBAE/CD,EAAUE,QACVF,EAAUjB,SAAQ,SAACoB,OACXC,UAAOD,EAAIE,cAAc,WAAY,CACrCC,cAAe,OACfC,SAAU,CACNC,SAAS,GAEbC,WAAY,CACRC,aAAa,GAEjBC,QAAS,CAACC,aAAYC,aAAYC,qBAKxCC,EAAOpC,EAAUmB,MAAMG,iBAAiB,gCACxCe,EAAUrC,EAAUmB,MAAMG,iBAAiB,qBAEjDc,EAAKhC,SAAQ,SAACoB,EAAKc,GACfd,EAAIe,iBAAiB,SAAS,WAC1BH,EAAKhC,SAAQ,SAACoB,GACVA,EAAIgB,UAAUC,OAAO,gBAGzBJ,EAAQjC,SAAQ,SAACsC,GACbA,EAAOF,UAAUG,IAAI,gBAGzBN,EAAQC,GAAOE,UAAUC,OAAO,aAChCjB,EAAIgB,UAAUG,IAAI,mBAItBN,EAAQd,QACRc,EAAQjC,SAAQ,SAACsC,OACTjB,UAAOiB,EAAQ3B,OAAO6B,wBAI9B7B,OAAO8B,YACP9B,OAAO8B,WAAWC,uBAMtC/B,OAAOwB,iBAAiB,oBAAoB,eACpCQ,qBAAqB7C,EAAU,CAC/B8C,UAAW,KACZC,QAAQjD,EAAUmB,UAGlB,CACHnB,UAAAA,EACAC,UAAAA,EACAH,OAAAA,SCxIHC,IAAI,4BACU,4RASA,mBACI,6XAXvBmD,2BAAAC,GAC+EC,wBA4B3EC,wCAAgBD,sCA5BhBF,+BAAAI,GACIC,EAQAC,2BAAAC,GACID,2BAAAE,kBACIR,kDAAqC,YAATZ,UAA5BkB,kCAAW,UAA8BG,IAAKrB"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),n=require("vuex"),l=require("formvuelate"),o=require("@formvuelate/plugin-vee-validate"),i=require("@perevorot/shop/dist/forms/FormText"),a=require("yup"),r=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=c(o),u=c(i),d=s(a),p=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var n=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==n.value.indexOf(e.id)})):[]}))}}}),v={key:0,class:"column is-12"},f=[e.createElementVNode("div",{class:"bundle-title"},"Вместе дешевле",-1)],k={class:"column name"},h={class:"column is-narrow"},g=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],y={class:"column"},b={class:"columns is-gapless mb-0"},B={class:"column"},C={key:0,class:"code"},w={class:"title"},T=["href"],x={class:"column is-2 has-text-centered is-relative"},_={class:"quantity"},S={key:0,class:"quantity-price"},M=["innerHTML"],L=e.createTextVNode(" / шт"),D={class:"column is-2 has-text-right"},H=["innerHTML"],q=["innerHTML"],O=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},P={class:"option-title"},j={class:"column is-2 has-text-right"},J=e.createTextVNode("+"),U=["innerHTML"],I={key:0,class:"bundle columns"},A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],W={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],ne={key:1,class:"bundle columns"},le={class:"column is-narrow"},oe=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ie=["href"],ae=["src"],re={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},me={key:0,class:"code"},ue={class:"title"},de=["href"];p.render=function(t,n,l,o,i,a){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",v,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",k,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",h,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,g)]),e.createElementVNode("div",y,[e.createElementVNode("div",b,[e.createElementVNode("div",B,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",C,"Код продукта: "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",w,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,T)])]),e.createElementVNode("div",x,[e.createElementVNode("div",_,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),L])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,H)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:"Выгода "+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,O)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,"Дополнительные услуги, "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(n,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",P,e.toDisplayString(n.name),1)]),e.createElementVNode("div",j,[J,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",A,[G,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,Q)):(e.openBlock(),e.createElementBlock("svg",W,X))],2)],8,K)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,"Код продукта: "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",le,[oe,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,ae)):(e.openBlock(),e.createElementBlock("svg",re,ce))],2)],8,ie)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,"Код продукта: "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,de)])])])):e.createCommentVNode("v-if",!0)])],2)},e.markRaw(u.default);var pe=l.SchemaFormFactory([m.default({})]);window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ve=e.defineComponent({components:{CheckoutItem:p,SchemaForm:pe},name:"order-checkout",setup:function(){var o=r.useToast(),i=n.useStore(),a=e.ref(!1),c=e.computed((function(){return i.getters["cart/quantity"]})),s=e.computed((function(){return i.getters["cart/items"]})),m=e.computed((function(){return i.getters["cart/total"]})),p=e.computed((function(){return i.getters["auth/is"]})),v=e.computed((function(){return i.getters["checkout/user"]})),f=e.ref(!0),k=e.ref(null),h=e.ref(!1),g=e.ref(null),E=e.ref({}),V=e.ref([]),N=e.ref([]),y=e.ref("new"),b=e.ref(null),B=e.computed((function(){return i.getters["checkout/shippingData"]})),C=e.ref(!1),w=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),T=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(C.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(T,(function(e){e.length>1e3&&(T.value=T.value.substring(0,1e3))}));var x=function(t){return e.computed({get:function(){return v.value[t]},set:function(e){var n=JSON.parse(JSON.stringify(v.value));n[t]=e,i.commit("checkout/user",n)}})},_=e.ref({last_name:x("last_name"),name:x("name"),email:x("email"),phone:x("phone")});i.dispatch("auth/me",{finally:function(){}});var S=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),M=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),L=e.computed((function(){return S.value?V.value.find((function(e){return e.id==S.value})):{}})),D=e.computed((function(){return M.value?N.value.find((function(e){return e.id==M.value})):{}})),H=e.computed((function(){return z(V.value,S.value)})),q=e.computed((function(){return z(N.value,M.value)})),O=e.computed((function(){return R(V.value)})),$=e.computed((function(){return R(N.value)})),F=e.computed((function(){var e=[];return s.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),z=function(e,t){var n=0;if(t){var l=e.find((function(e){return e.id==t}));l&&(n="sum"==l.type?l.amount:Math.round(m.value*l.amount/100))}return n},R=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var n=!0,l=e.restrictions;l.price_min&&l.price_max?(n=m.value>=l.price_min&&m.value<=l.price_max,e.restrictedForce=!n):l.price_min?(n=m.value>=l.price_min,e.restrictedForce=!n):l.price_max&&(n=m.value<=l.price_max,e.restrictedForce=!n),n&&S.value&&l.shipping_type&&l.shipping_type.length&&(n=-1!==l.shipping_type.indexOf(S.value)),n&&M.value&&l.payment_method&&l.payment_method.length&&(n=-1!==l.payment_method.indexOf(M.value)),n&&l.categories&&l.categories.length&&(n=!F.value.filter((function(e){return!l.categories.includes(e)})).length,e.restrictedForce=!n),e.restricted=!n}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},P=e.computed((function(){var e=0;return s.value.forEach((function(t){var n=0;t.attributes.priceOld&&(n=t.attributes.priceOld-t.attributes.price),e+=n*t.quantity})),e}));$http.post(window.location.href).then((function(e){V.value=e.data.shipping,N.value=e.data.payment})),e.watch(y,(function(e){"login"==e&&i.commit("auth/modal","login")}));var j=e.ref({last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name"},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name"},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone",placeholder:"(050) 123-45-67"},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}});l.useSchemaForm(_);var J=d.object().shape({last_name:d.string().trim().required(__("auth.validation.required")),name:d.string().trim().required(__("auth.validation.required")),phone:d.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:d.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required"))});window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)}));var U=function(){i.commit("checkout/reset")};return{auth:p,userType:y,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){y.value="new"},quantity:c,items:s,loading:a,pluralize:t.pluralize,discount:P,total:m,shipping:S,shippingPrice:H,payment:M,fee:q,userValidation:J,userSchema:j,userSubmitButton:b,checkout:function(){J.isValid(_.value).then((function(e){if(e)if(S.value)if(B.value[L.value.code]&&B.value[L.value.code].isValid)if(M.value){var t=JSON.parse(JSON.stringify(B.value[L.value.code]));delete t.isValid;var n={checkout:!0,user:{last_name:_.value.last_name,name:_.value.name,phone:_.value.phone,email:_.value.email},shipping:{id:S.value,data:t},payment:{id:M.value},comment:T.value,dontcall:w.value};a.value=!0,$http.post(window.location.href,n).then((function(e){e.data.redirect&&(E.value={url:e.data.redirect.url,data:e.data.redirect.data}),h.value=!0,g.value=e.data.order,U()})).catch((function(e){o("Ошибка сохранения заказа",{type:"error"}),console.error(e)})).finally((function(){a.value=!1}))}else o("Выберите вид оплаты",{type:"error"});else o("Заполните все поля для доставки: «"+L.value.name+"»",{type:"error"});else o("Выберите способ доставки",{type:"error"});else y.value="new",b.value.click(),o("Заполните данные получателя заказа",{type:"error"})}))},ifCheckoutReady:f,validate:function(){J.isValid(_.value).then((function(e){f.value=e&&M.value&&S.value&&(!L.value.component||L.value.component&&B.value[L.value.code]&&B.value[L.value.code].isValid)}))},shippingTypesRestricted:O,paymentMethodsRestricted:$,toggleShippingRadio:function(e){S.value===e&&(S.value=null)},togglePaymentRadio:function(e){M.value===e&&(M.value=null)},shippingSelected:L,paymentSelected:D,shippingComponentData:B,shippingStoreData:function(e,t,n){var l=JSON.parse(JSON.stringify(B.value));t.isValid=n,l[e]=t,i.commit("checkout/shippingData",l)},resertStore:U,user:_,dontcall:w,comment:T,isCommentToggled:C,commentMaxLength:1e3,userCheckout:v,thanks:h,order:g,redirect:E,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"}}}}),fe={class:"cart checkout"},ke=["action"],he=["name","value"],ge={key:1,class:"items-wrapper"},Ee=e.createElementVNode("div",{class:"checkout-title"},"Оформление заказа",-1),Ve={class:"columns"},Ne={class:"column"},ye={class:"checkout-block items"},be={class:"title-row"},Be={class:"items-title"},Ce=e.createTextVNode("Ваш заказ "),we=["textContent"],Te=e.createTextVNode(),xe=["innerHTML"],_e=["onClick"],Se=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),e.createElementVNode("span",null,"Редактировать заказ",-1)],Me={class:"checkout-block"},Le={class:"wrapper"},De=e.createElementVNode("div",{class:"items-title"},"Контактные даные получателя заказа",-1),He={key:0,class:"user-tabs"},qe=e.createTextVNode(" Я новый клиент"),Oe=e.createTextVNode(" Я постоянный клиент"),$e={class:"columns"},Fe={class:"column user-form"},ze={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Re={class:"column user-login user-form"},Pe={class:"column"},je={key:0,class:"social-auth"},Je={class:"socials"},Ue=e.createElementVNode("div",{class:"description"},"Или авторизируйтесь через социальные сети:",-1),Ie={class:"buttons"},Ae=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ge=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ke={class:"wrapper"},Qe={class:"rows"},We={class:"item"},Xe={class:"row"},Ye=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Доставка")],-1),Ze={class:"row"},et={class:"info"},tt=["value","onClick"],nt=["src"],lt={key:1,class:"icon"},ot=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],it={key:0,class:"description"},at={class:"value"},rt={key:0,class:"green"},ct=["innerHTML"],st={class:"wrapper"},mt={class:"rows"},ut={class:"item"},dt={class:"row"},pt=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Оплата")],-1),vt={class:"row no-icon"},ft={class:"info"},kt=["value","onClick"],ht={key:0,class:"description"},gt={key:0,class:"value"},Et=["innerHTML"],Vt={class:"column is-4"},Nt={class:"checkout-block summary"},yt=e.createElementVNode("div",{class:"items-title"},"Итого",-1),bt={class:"rows"},Bt={class:"row"},Ct={class:"info"},wt=["textContent"],Tt=e.createTextVNode(" на сумму"),xt={class:"value"},_t=["innerHTML"],St={key:0,class:"row"},Mt=e.createElementVNode("div",{class:"info"},"Скидка",-1),Lt={class:"value"},Dt=["innerHTML"],Ht={key:1,class:"row"},qt=e.createElementVNode("div",{class:"info"},"Сервисный сбор",-1),Ot={class:"value"},$t=["innerHTML"],Ft={key:2,class:"row"},zt=e.createElementVNode("div",{class:"info"},"Стоимость доставки",-1),Rt={class:"value"},Pt=["innerHTML"],jt={key:1,class:"green"},Jt={class:"row"},Ut=e.createElementVNode("div",{class:"info"},"К оплате",-1),It={class:"value orange"},At=["innerHTML"],Gt={class:"checkbox-wrapper"},Kt=e.createTextVNode(" Мне можно не перезванивать для оформления заказа"),Qt=[e.createElementVNode("span",null,"Добавить комментарий к заказу",-1),e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1)],Wt={class:"user-form"},Xt={key:0,class:"chars-count"},Yt={key:2,class:"checkout-block thanks"},Zt={class:"title"},en=e.createTextVNode(" Заказ "),tn=e.createTextVNode(" успешно создан! "),nn={class:"columns"},ln={key:0,class:"column is-6"},on=e.createElementVNode("div",{class:"subtitle"},"Перейдите к оплате для завершения покупки",-1),an={key:1,class:"column is-6"},rn={class:"column is-6"},cn={key:0,class:"info-wrapper"},sn=e.createElementVNode("div",{class:"title"},"Доставка",-1),mn={class:"columns"},un=["innerHTML"],dn=["innerHTML"],pn={key:1,class:"info-wrapper"},vn=e.createElementVNode("div",{class:"title"},"Оплата",-1),fn={class:"columns"},kn=["innerHTML"],hn=["innerHTML"],gn={key:3,class:"checkout-block empty"},En=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),Vn={class:"message"},Nn=e.createTextVNode("Посмотрите предложения на "),yn=["href"],bn=e.createTextVNode(","),Bn=e.createElementVNode("br",null,null,-1),Cn=e.createTextVNode("воспользуйтесь каталогом или поиском"),wn=["href"];ve.render=function(t,n,l,o,i,a){var r=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),m=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",fe,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,n,l){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:n,value:t,key:l},null,8,he)})),128))],8,ke)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",ge,[Ee,e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,[e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.createElementVNode("div",Be,[Ce,e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,we),Te,e.createElementVNode("span",{innerHTML:"на сумму "+t.$filters.price(t.total)},null,8,xe)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(r,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(t){return[e.createElementVNode("button",{class:"button",onClick:t.open},Se,8,_e)]})),_:1})]),e.createElementVNode("button",{onClick:n[0]||(n[0]=function(){return t.resertStore&&t.resertStore.apply(t,arguments)}),style:{position:"fixed",bottom:"1px",right:"1px","z-index":"1000"}},"reset"),e.createElementVNode("div",Me,[e.createElementVNode("div",Le,[De,t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[1]||(n[1]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),qe]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[2]||(n[2]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),Oe])])),e.createElementVNode("div",$e,[e.withDirectives(e.createElementVNode("div",Fe,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",ze,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),e.withDirectives(e.createElementVNode("div",Re,[e.createVNode(m,{"login-callback":t.loginCallback},null,8,["login-callback"])],512),[[e.vShow,"login"==t.userType]]),e.createElementVNode("div",Pe,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Je,[Ue,e.createElementVNode("div",Ie,[e.createElementVNode("a",{class:"button",onClick:n[3]||(n[3]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ae),e.createElementVNode("a",{class:"button",onClick:n[4]||(n[4]=function(){return t.google&&t.google.apply(t,arguments)})},Ge)])])]))])])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[Ye,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":l.restricted}]),key:l.id},[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[6]||(n[6]=function(e){return t.shipping=e}),value:l.id,onClick:function(e){return t.toggleShippingRadio(l.id)}},null,8,tt),[[e.vModelRadio,t.shipping]]),l.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:l.icon},null,8,nt)):(e.openBlock(),e.createElementBlock("svg",lt,ot)),e.createElementVNode("span",null,e.toDisplayString(l.name),1)]),l.description?(e.openBlock(),e.createElementBlock("div",it,e.toDisplayString(l.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",at,[!l.amount&&l.price_label?(e.openBlock(),e.createElementBlock("span",rt,e.toDisplayString(l.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==l.type?l.amount+"%":t.$filters.price(l.amount)},null,8,ct))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:l},null,8,["commit","data","item"])),[[e.vShow,l.component&&l.id==t.shipping]])],2)})),128))])]),e.createElementVNode("div",st,[e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[pt,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":l.restricted}]),key:l.id},[e.createElementVNode("div",vt,[e.createElementVNode("div",ft,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[8]||(n[8]=function(e){return t.payment=e}),value:l.id,onClick:function(e){return t.togglePaymentRadio(l.id)}},null,8,kt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(l.name),1)]),l.description?(e.openBlock(),e.createElementBlock("div",ht,e.toDisplayString(l.description),1)):e.createCommentVNode("v-if",!0)]),l.amount?(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("span",{innerHTML:"percent"==l.type?l.amount+"%":t.$filters.price(l.amount)},null,8,Et)])):e.createCommentVNode("v-if",!0)])],2)})),128))])])])]),e.createElementVNode("div",Vt,[e.createElementVNode("div",Nt,[yt,e.createElementVNode("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("div",Ct,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,wt),Tt]),e.createElementVNode("div",xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,_t)])]),t.discount?(e.openBlock(),e.createElementBlock("div",St,[Mt,e.createElementVNode("div",Lt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Dt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Ht,[qt,e.createElementVNode("div",Ot,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,$t)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",Ft,[zt,e.createElementVNode("div",Rt,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,Pt)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",jt,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Jt,[Ut,e.createElementVNode("div",It,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total+t.fee+t.shippingPrice)},null,8,At)])])]),e.createElementVNode("div",Gt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":n[9]||(n[9]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),Kt])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:n[10]||(n[10]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:n[11]||(n[11]=function(){return t.validate&&t.validate.apply(t,arguments)})},"Подтвердить заказ",34),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:n[12]||(n[12]=function(e){return t.isCommentToggled=!t.isCommentToggled})},Qt),e.createElementVNode("div",Wt,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":n[13]||(n[13]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Xt,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("div",Zt,[en,e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),tn]),e.createElementVNode("div",nn,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",ln,[on,e.createElementVNode("button",{class:"button is-payment",onClick:n[14]||(n[14]=function(e){return t.redirectForm.submit()})},"Перейти к оплате")])):(e.openBlock(),e.createElementBlock("div",an,[e.createElementVNode("button",{class:"button is-orange",onClick:n[15]||(n[15]=function(){return t.home&&t.home.apply(t,arguments)})},"Продолжить покупки")])),e.createElementVNode("div",rn,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",cn,[sn,e.createElementVNode("div",mn,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,un)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,dn)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",pn,[vn,e.createElementVNode("div",fn,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,kn)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,hn)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])])])):(e.openBlock(),e.createElementBlock("div",gn,[En,e.createElementVNode("div",Vn,[Nn,e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},"главной странице",8,yn),bn,Bn,Cn]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},"Продолжить покупки",8,wn)]))])},module.exports=ve;
1
+ "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),n=require("vuex"),l=require("formvuelate"),o=require("@formvuelate/plugin-vee-validate"),i=require("@perevorot/shop/dist/forms/FormText"),a=require("yup"),r=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=c(o),u=c(i),d=s(a),p=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var n=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==n.value.indexOf(e.id)})):[]}))}}}),v={key:0,class:"column is-12"},f=[e.createElementVNode("div",{class:"bundle-title"},"Вместе дешевле",-1)],k={class:"column name"},h={class:"column is-narrow"},g=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],y={class:"column"},b={class:"columns is-gapless mb-0"},B={class:"column"},C={key:0,class:"code"},w={class:"title"},T=["href"],x={class:"column is-2 has-text-centered is-relative"},_={class:"quantity"},S={key:0,class:"quantity-price"},M=["innerHTML"],L=e.createTextVNode(" / шт"),D={class:"column is-2 has-text-right"},H=["innerHTML"],q=["innerHTML"],O=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},P={class:"option-title"},j={class:"column is-2 has-text-right"},J=e.createTextVNode("+"),U=["innerHTML"],I={key:0,class:"bundle columns"},A={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],W={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],ne={key:1,class:"bundle columns"},le={class:"column is-narrow"},oe=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ie=["href"],ae=["src"],re={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},me={key:0,class:"code"},ue={class:"title"},de=["href"];p.render=function(t,n,l,o,i,a){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",v,f)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",k,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",h,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,g)]),e.createElementVNode("div",y,[e.createElementVNode("div",b,[e.createElementVNode("div",B,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",C,"Код продукта: "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",w,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,T)])]),e.createElementVNode("div",x,[e.createElementVNode("div",_,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),L])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,H)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:"Выгода "+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,q)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,O)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,"Дополнительные услуги, "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(n,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",P,e.toDisplayString(n.name),1)]),e.createElementVNode("div",j,[J,e.createElementVNode("span",{innerHTML:t.$filters.price(n.price)},null,8,U)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",A,[G,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,Q)):(e.openBlock(),e.createElementBlock("svg",W,X))],2)],8,K)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,"Код продукта: "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",le,[oe,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,ae)):(e.openBlock(),e.createElementBlock("svg",re,ce))],2)],8,ie)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,"Код продукта: "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,de)])])])):e.createCommentVNode("v-if",!0)])],2)},e.markRaw(u.default);var pe=l.SchemaFormFactory([m.default({})]);window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ve=e.defineComponent({components:{CheckoutItem:p,SchemaForm:pe},name:"order-checkout",setup:function(){var o=r.useToast(),i=n.useStore(),a=e.ref(!1),c=e.computed((function(){return i.getters["cart/quantity"]})),s=e.computed((function(){return i.getters["cart/items"]})),m=e.computed((function(){return i.getters["cart/total"]})),p=e.computed((function(){return i.getters["auth/is"]})),v=e.computed((function(){return i.getters["checkout/user"]})),f=e.ref(!0),k=e.ref(null),h=e.ref(!1),g=e.ref(null),E=e.ref({}),V=e.ref([]),N=e.ref([]),y=e.ref("new"),b=e.ref(null),B=e.computed((function(){return i.getters["checkout/shippingData"]})),C=e.ref(!1),w=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),T=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(C.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(T,(function(e){e.length>1e3&&(T.value=T.value.substring(0,1e3))}));var x=function(t){return e.computed({get:function(){return v.value[t]},set:function(e){var n=JSON.parse(JSON.stringify(v.value));n[t]=e,i.commit("checkout/user",n)}})},_=e.ref({last_name:x("last_name"),name:x("name"),email:x("email"),phone:x("phone")});i.dispatch("auth/me",{finally:function(){}});var S=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),M=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),L=e.computed((function(){return S.value?V.value.find((function(e){return e.id==S.value})):{}})),D=e.computed((function(){return M.value?N.value.find((function(e){return e.id==M.value})):{}})),H=e.computed((function(){return z(V.value,S.value)})),q=e.computed((function(){return z(N.value,M.value)})),O=e.computed((function(){return R(V.value)})),$=e.computed((function(){return R(N.value)})),F=e.computed((function(){var e=[];return s.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),z=function(e,t){var n=0;if(t){var l=e.find((function(e){return e.id==t}));l&&(n="sum"==l.type?l.amount:Math.round(m.value*l.amount/100))}return n},R=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var n=!0,l=e.restrictions;l.price_min&&l.price_max?(n=m.value>=l.price_min&&m.value<=l.price_max,e.restrictedForce=!n):l.price_min?(n=m.value>=l.price_min,e.restrictedForce=!n):l.price_max&&(n=m.value<=l.price_max,e.restrictedForce=!n),n&&S.value&&l.shipping_type&&l.shipping_type.length&&(n=-1!==l.shipping_type.indexOf(S.value)),n&&M.value&&l.payment_method&&l.payment_method.length&&(n=-1!==l.payment_method.indexOf(M.value)),n&&l.categories&&l.categories.length&&(n=!F.value.filter((function(e){return!l.categories.includes(e)})).length,e.restrictedForce=!n),e.restricted=!n}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},P=e.computed((function(){var e=0;return s.value.forEach((function(t){var n=0;t.attributes.priceOld&&(n=t.attributes.priceOld-t.attributes.price),e+=n*t.quantity})),e}));$http.post(window.location.href).then((function(e){V.value=e.data.shipping,N.value=e.data.payment})),e.watch(y,(function(e){"login"==e&&i.commit("auth/modal","login")}));var j=e.ref({last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name"},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name"},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},email:{component:u.default,label:__("auth.login.form.email"),model:"email"}});l.useSchemaForm(_);var J=d.object().shape({last_name:d.string().trim().required(__("auth.validation.required")),name:d.string().trim().required(__("auth.validation.required")),phone:d.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:d.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required"))});window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)}));var U=function(){i.commit("checkout/reset")};return{auth:p,userType:y,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){y.value="new"},quantity:c,items:s,loading:a,pluralize:t.pluralize,discount:P,total:m,shipping:S,shippingPrice:H,payment:M,fee:q,userValidation:J,userSchema:j,userSubmitButton:b,checkout:function(){J.isValid(_.value).then((function(e){if(e)if(S.value)if(B.value[L.value.code]&&B.value[L.value.code].isValid)if(M.value){var t=JSON.parse(JSON.stringify(B.value[L.value.code]));delete t.isValid;var n={checkout:!0,user:{last_name:_.value.last_name,name:_.value.name,phone:_.value.phone,email:_.value.email},shipping:{id:S.value,data:t},payment:{id:M.value},comment:T.value,dontcall:w.value};a.value=!0,$http.post(window.location.href,n).then((function(e){e.data.redirect&&(E.value={url:e.data.redirect.url,data:e.data.redirect.data}),h.value=!0,g.value=e.data.order,U()})).catch((function(e){o("Ошибка сохранения заказа",{type:"error"}),console.error(e)})).finally((function(){a.value=!1}))}else o("Выберите вид оплаты",{type:"error"});else o("Заполните все поля для доставки: «"+L.value.name+"»",{type:"error"});else o("Выберите способ доставки",{type:"error"});else y.value="new",b.value.click(),o("Заполните данные получателя заказа",{type:"error"})}))},ifCheckoutReady:f,validate:function(){J.isValid(_.value).then((function(e){f.value=e&&M.value&&S.value&&(!L.value.component||L.value.component&&B.value[L.value.code]&&B.value[L.value.code].isValid)}))},shippingTypesRestricted:O,paymentMethodsRestricted:$,toggleShippingRadio:function(e){S.value===e&&(S.value=null)},togglePaymentRadio:function(e){M.value===e&&(M.value=null)},shippingSelected:L,paymentSelected:D,shippingComponentData:B,shippingStoreData:function(e,t,n){var l=JSON.parse(JSON.stringify(B.value));t.isValid=n,l[e]=t,i.commit("checkout/shippingData",l)},resertStore:U,user:_,dontcall:w,comment:T,isCommentToggled:C,commentMaxLength:1e3,userCheckout:v,thanks:h,order:g,redirect:E,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"}}}}),fe={class:"cart checkout"},ke=["action"],he=["name","value"],ge={key:1,class:"items-wrapper"},Ee=e.createElementVNode("div",{class:"checkout-title"},"Оформление заказа",-1),Ve={class:"columns"},Ne={class:"column"},ye={class:"checkout-block items"},be={class:"title-row"},Be={class:"items-title"},Ce=e.createTextVNode(" Ваш заказ "),we=["textContent"],Te=["innerHTML"],xe=["onClick"],_e=[e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),e.createElementVNode("span",null,"Редактировать заказ",-1)],Se={class:"checkout-block"},Me={class:"wrapper"},Le=e.createElementVNode("div",{class:"items-title"},"Контактные даные получателя заказа",-1),De={key:0,class:"user-tabs"},He=e.createTextVNode(" Я новый клиент "),qe=e.createTextVNode(" Я постоянный клиент "),Oe={class:"columns"},$e={class:"column user-form"},Fe={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={class:"column user-login user-form"},Re={class:"column"},Pe={key:0,class:"social-auth"},je={class:"socials"},Je=e.createElementVNode("div",{class:"description"},"Или авторизируйтесь через социальные сети:",-1),Ue={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ae=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ge={class:"wrapper"},Ke={class:"rows"},Qe={class:"item"},We={class:"row"},Xe=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Доставка")],-1),Ye={class:"row"},Ze={class:"info"},et=["value","onClick"],tt=["src"],nt={key:1,class:"icon"},lt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],ot={key:0,class:"description"},it={class:"value"},at={key:0,class:"green"},rt=["innerHTML"],ct={class:"wrapper"},st={class:"rows"},mt={class:"item"},ut={class:"row"},dt=e.createElementVNode("div",{class:"info"},[e.createElementVNode("div",{class:"items-title mb-1"},"Оплата")],-1),pt={class:"row no-icon"},vt={class:"info"},ft=["value","onClick"],kt={key:0,class:"description"},ht={key:0,class:"value"},gt=["innerHTML"],Et={class:"column is-4"},Vt={class:"checkout-block summary"},Nt=e.createElementVNode("div",{class:"items-title"},"Итого",-1),yt={class:"rows"},bt={class:"row"},Bt={class:"info"},Ct=["textContent"],wt=e.createTextVNode(" на сумму "),Tt={class:"value"},xt=["innerHTML"],_t={key:0,class:"row"},St=e.createElementVNode("div",{class:"info"},"Скидка",-1),Mt={class:"value"},Lt=["innerHTML"],Dt={key:1,class:"row"},Ht=e.createElementVNode("div",{class:"info"},"Сервисный сбор",-1),qt={class:"value"},Ot=["innerHTML"],$t={key:2,class:"row"},Ft=e.createElementVNode("div",{class:"info"},"Стоимость доставки",-1),zt={class:"value"},Rt=["innerHTML"],Pt={key:1,class:"green"},jt={class:"row"},Jt=e.createElementVNode("div",{class:"info"},"К оплате",-1),Ut={class:"value orange"},It=["innerHTML"],At={class:"checkbox-wrapper"},Gt=e.createTextVNode(" Мне можно не перезванивать для оформления заказа "),Kt=[e.createElementVNode("span",null,"Добавить комментарий к заказу",-1),e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1)],Qt={class:"user-form"},Wt={key:0,class:"chars-count"},Xt={key:2,class:"checkout-block thanks"},Yt={class:"title"},Zt=e.createTextVNode(" Заказ "),en=e.createTextVNode(" успешно создан! "),tn={class:"columns"},nn={key:0,class:"column is-6"},ln=e.createElementVNode("div",{class:"subtitle"},"Перейдите к оплате для завершения покупки",-1),on={key:1,class:"column is-6"},an={class:"column is-6"},rn={key:0,class:"info-wrapper"},cn=e.createElementVNode("div",{class:"title"},"Доставка",-1),sn={class:"columns"},mn=["innerHTML"],un=["innerHTML"],dn={key:1,class:"info-wrapper"},pn=e.createElementVNode("div",{class:"title"},"Оплата",-1),vn={class:"columns"},fn=["innerHTML"],kn=["innerHTML"],hn={key:3,class:"checkout-block empty"},gn=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),En={class:"message"},Vn=e.createTextVNode(" Посмотрите предложения на "),Nn=["href"],yn=e.createTextVNode(", "),bn=e.createElementVNode("br",null,null,-1),Bn=e.createTextVNode("воспользуйтесь каталогом или поиском "),Cn=["href"];ve.render=function(t,n,l,o,i,a){var r=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),m=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",fe,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,class:"is-hidden",method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,n,l){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:n,value:t,key:l},null,8,he)})),128))],8,ke)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",ge,[Ee,e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,[e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.createElementVNode("div",Be,[Ce,e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,we),e.createElementVNode("span",{innerHTML:"на сумму "+t.$filters.price(t.total)},null,8,Te)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(r,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(t){return[e.createElementVNode("button",{class:"button",onClick:t.open},_e,8,xe)]})),_:1})]),e.createElementVNode("button",{onClick:n[0]||(n[0]=function(){return t.resertStore&&t.resertStore.apply(t,arguments)}),style:{position:"fixed",bottom:"1px",right:"1px","z-index":"1000"}},"reset"),e.createElementVNode("div",Se,[e.createElementVNode("div",Me,[Le,t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[1]||(n[1]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),He]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[2]||(n[2]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),qe])])),e.createElementVNode("div",Oe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Fe,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),e.withDirectives(e.createElementVNode("div",ze,[e.createVNode(m,{"login-callback":t.loginCallback},null,8,["login-callback"])],512),[[e.vShow,"login"==t.userType]]),e.createElementVNode("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",je,[Je,e.createElementVNode("div",Ue,[e.createElementVNode("a",{class:"button",onClick:n[3]||(n[3]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:n[4]||(n[4]=function(){return t.google&&t.google.apply(t,arguments)})},Ae)])])]))])])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",We,[Xe,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":l.restricted}]),key:l.id},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[6]||(n[6]=function(e){return t.shipping=e}),value:l.id,onClick:function(e){return t.toggleShippingRadio(l.id)}},null,8,et),[[e.vModelRadio,t.shipping]]),l.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:l.icon},null,8,tt)):(e.openBlock(),e.createElementBlock("svg",nt,lt)),e.createElementVNode("span",null,e.toDisplayString(l.name),1)]),l.description?(e.openBlock(),e.createElementBlock("div",ot,e.toDisplayString(l.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",it,[!l.amount&&l.price_label?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(l.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==l.type?l.amount+"%":t.$filters.price(l.amount)},null,8,rt))])]),e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),{commit:t.shippingStoreData,data:t.shippingComponentData,item:l},null,8,["commit","data","item"])),[[e.vShow,l.component&&l.id==t.shipping]])],2)})),128))])]),e.createElementVNode("div",ct,[e.createElementVNode("div",st,[e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[dt,e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":l.restricted}]),key:l.id},[e.createElementVNode("div",pt,[e.createElementVNode("div",vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":n[8]||(n[8]=function(e){return t.payment=e}),value:l.id,onClick:function(e){return t.togglePaymentRadio(l.id)}},null,8,ft),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(l.name),1)]),l.description?(e.openBlock(),e.createElementBlock("div",kt,e.toDisplayString(l.description),1)):e.createCommentVNode("v-if",!0)]),l.amount?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("span",{innerHTML:"percent"==l.type?l.amount+"%":t.$filters.price(l.amount)},null,8,gt)])):e.createCommentVNode("v-if",!0)])],2)})),128))])])])]),e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[Nt,e.createElementVNode("div",yt,[e.createElementVNode("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Ct),wt]),e.createElementVNode("div",Tt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,xt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",_t,[St,e.createElementVNode("div",Mt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Lt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Dt,[Ht,e.createElementVNode("div",qt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,Ot)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",$t,[Ft,e.createElementVNode("div",zt,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,Rt)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",Pt,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",jt,[Jt,e.createElementVNode("div",Ut,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total+t.fee+t.shippingPrice)},null,8,It)])])]),e.createElementVNode("div",At,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":n[9]||(n[9]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),Gt])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:n[10]||(n[10]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:n[11]||(n[11]=function(){return t.validate&&t.validate.apply(t,arguments)})},"Подтвердить заказ",34),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:n[12]||(n[12]=function(e){return t.isCommentToggled=!t.isCommentToggled})},Kt),e.createElementVNode("div",Qt,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":n[13]||(n[13]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Wt,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,[Zt,e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),en]),e.createElementVNode("div",tn,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",nn,[ln,e.createElementVNode("button",{class:"button is-payment",onClick:n[14]||(n[14]=function(e){return t.redirectForm.submit()})},"Перейти к оплате")])):(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("button",{class:"button is-orange",onClick:n[15]||(n[15]=function(){return t.home&&t.home.apply(t,arguments)})},"Продолжить покупки")])),e.createElementVNode("div",an,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",rn,[cn,e.createElementVNode("div",sn,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,mn)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,un)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",dn,[pn,e.createElementVNode("div",vn,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,fn)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,kn)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])])])):(e.openBlock(),e.createElementBlock("div",hn,[gn,e.createElementVNode("div",En,[Vn,e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},"главной странице",8,Nn),yn,bn,Bn]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},"Продолжить покупки",8,Cn)]))])},module.exports=ve;
2
2
  //# sourceMappingURL=Checkout.js.map