@perevorot/shop 2.0.111 → 2.0.112

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 +1 @@
1
- {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=224cb7df&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 q = props.item.quantity;\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.category;\n const brand = props.item.attributes.brand;\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 const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: [\n {\n item_name: name,\n item_id: code,\n price: price,\n quantity: q,\n item_brand: brand,\n item_category: category,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\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 q = props.item.quantity;\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.category;\n const brand = props.item.attributes.brand;\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 const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: [\n {\n item_name: name,\n item_id: code,\n price: price,\n quantity: q,\n item_brand: brand,\n item_category: category,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\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","q","quantity","price","code","category","brand","difference","dispatch","product","id","watch","values","increase","decrease","remove","object","ecommerce","currencyCode","items","item_name","item_id","item_brand","item_category","event","$env","debug","console","log","window","dataLayer","push","gotoProduct","href","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","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","type","min","_hoisted_28","innerHTML","_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,OAGrBC,EAAIjB,EAAMC,KAAKiB,SACfnB,EAAOC,EAAMC,KAAKF,KAClBoB,EAAQnB,EAAMC,KAAKS,WAAWS,MAC9BC,EAAOpB,EAAMC,K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,WAAWmG,MAAMvC,kCACjCd,2CAMZH,2BAAA6D,IAC4B5D,QAAK5C,WAAWmG,MAAMzF,oBAA9CoC,2BAAA2D,qBAAuDtD,8CAA2BP,QAAK5C,WAAWmG,MAAMzF,0CACxGiC,2BAAA+D,IACI/D,0BAAIY,yCAAOC,eAAYZ,QAAK5C,WAAWmG,MAAM5D,2BAAUK,QAAK5C,WAAWmG,MAAM9G"}
1
+ {"version":3,"file":"CartItem.js","sources":["../../../../src/components/shop/cart/CartItem.vue","../../../../src/components/shop/cart/CartItem.vue?vue&type=template&id=224cb7df&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 q = props.item.quantity;\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.category;\n const brand = props.item.attributes.brand;\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 const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: [\n {\n item_name: name,\n item_id: code,\n price: price,\n quantity: q,\n item_brand: brand,\n item_category: category,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\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 q = props.item.quantity;\n const name = props.item.name;\n const price = props.item.attributes.price;\n const code = props.item.attributes.code;\n const category = props.item.attributes.category;\n const brand = props.item.attributes.brand;\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 const object = {\n ecommerce: {\n currencyCode: 'UAH',\n items: [\n {\n item_name: name,\n item_id: code,\n price: price,\n quantity: q,\n item_brand: brand,\n item_category: category,\n }\n ]\n },\n event: 'remove_from_cart'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\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","q","quantity","price","code","category","brand","difference","dispatch","product","id","watch","values","increase","decrease","remove","object","ecommerce","currencyCode","items","item_name","item_id","item_brand","item_category","event","$env","debug","console","log","window","dataLayer","push","gotoProduct","href","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","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","type","min","_hoisted_28","innerHTML","_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_44","_hoisted_45","_hoisted_46","_hoisted_47","second","_hoisted_52","_hoisted_53","_hoisted_54","third","_hoisted_55","_hoisted_56","_hoisted_57","_hoisted_58","_hoisted_63","_hoisted_64","_hoisted_65"],"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,EAAe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C,WAAWmG,MAAM5D,UACzCI,uDAAc,+BAA+CC,QAAK5C,WAAWmG,MAAMvC,WACjChB,QAAK5C,WAAWmG,MAAMvC,qBAApEd,kCAAMe,IAAKjB,QAAK5C,WAAWmG,MAAMvC,kCACjCd,2CAMZH,2BAAA6D,IAC4B5D,QAAK5C,WAAWmG,MAAMzF,oBAA9CoC,2BAAA2D,qBAAuDtD,8CAA2BP,QAAK5C,WAAWmG,MAAMzF,0CACxGiC,2BAAA+D,IACI/D,0BAAIY,yCAAOC,eAAYZ,QAAK5C,WAAWmG,MAAM5D,2BAAUK,QAAK5C,WAAWmG,MAAM9G"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("@vueform/slider")),l=e.defineComponent({name:"price",components:{Slider:r.default},props:{min:Number,max:Number,step:Number,from:Number,to:Number,bar:Array,reset:String,hrefTemplate:String},setup:function(t){var r=e.ref([t.from,t.to]),l=e.ref(!0),n=e.computed((function(){return t.hrefTemplate.replace("#-#",Math.floor(r.value[0])+"-"+Math.ceil(r.value[1]))}));return{value:r,opacity:function(e){return 1},height:function(e){return e>0?"calc(10% + "+e+"%)":"0px"},change:function(){l.value=!1},href:n,disabled:l}}}),n={class:"shop-filters-price"},o={class:"mb-2"},a={class:"title is-6 mb-0 is-clickable","shop-filter-title":""},i=["href"],c={"shop-filter-content":""},s={class:"columns is-gapless is-vcentered"},u={class:"column"},m=["innerHTML"],d=e.createTextVNode(" — "),p=["innerHTML"],f={class:"column is-narrow"},h=["href"],v={class:"columns is-gapless is-align-items-flex-end mb-0",style:{height:"30px"}},N=["title"];l.render=function(t,r,l,V,b,g){var E=e.resolveComponent("slider");return e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,[e.createElementVNode("div",a,e.toDisplayString(t.__("shop.filter.price")),1),t.reset?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.reset,class:"is-size-7"},e.toDisplayString(t.__("shop.clearFilter")),9,i)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[e.createElementVNode("div",u,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[0])},null,8,m),d,e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[1])},null,8,p)]),e.createElementVNode("div",f,[e.createElementVNode("a",{href:t.href,class:"button is-small"},"OK",8,h)])]),e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bar,(function(r,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"column",style:e.normalizeStyle("width:5%;background-color:#DDD;height: "+t.height(r[0])+";opacity:"+t.opacity(l)),title:r[1]},null,12,N)})),128))]),e.createVNode(E,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=function(e){return t.value=e}),min:t.min,max:t.max,step:t.step,tooltips:!1,onUpdate:t.change},null,8,["modelValue","min","max","step","onUpdate"])])])},module.exports=l;
1
+ "use strict";var e=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("@vueform/slider")),l=e.defineComponent({name:"price",components:{Slider:r.default},props:{min:Number,max:Number,step:Number,from:Number,to:Number,bar:Array,reset:String,hrefTemplate:String},setup:function(t){var r=e.ref([t.from,t.to]),l=e.ref(!0),n=e.computed((function(){return t.hrefTemplate.replace("#-#",Math.floor(r.value[0])+"-"+Math.ceil(r.value[1]))}));return{value:r,opacity:function(e){return 1},height:function(e){return e>0?"calc(10% + "+e+"%)":"0px"},change:function(){l.value=!1},href:n,disabled:l}}}),n={class:"shop-filters-price"},o={class:"mb-2"},a={class:"title is-6 mb-0 is-clickable","shop-filter-title":""},i=["href"],c={"shop-filter-content":""},s={class:"columns is-gapless is-vcentered"},u={class:"column"},m=["innerHTML"],d=["innerHTML"],p={class:"column is-narrow"},f=["href"],h={class:"columns is-gapless is-align-items-flex-end mb-0",style:{height:"30px"}},v=["title"];l.render=function(t,r,l,N,V,b){var g=e.resolveComponent("slider");return e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",o,[e.createElementVNode("div",a,e.toDisplayString(t.__("shop.filter.price")),1),t.reset?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.reset,class:"is-size-7"},e.toDisplayString(t.__("shop.clearFilter")),9,i)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[e.createElementVNode("div",u,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[0])},null,8,m),e.createTextVNode(" — "),e.createElementVNode("span",{innerHTML:t.$filters.price(t.value[1])},null,8,d)]),e.createElementVNode("div",p,[e.createElementVNode("a",{href:t.href,class:"button is-small"},"OK",8,f)])]),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bar,(function(r,l){return e.openBlock(),e.createElementBlock("div",{key:l,class:"column",style:e.normalizeStyle("width:5%;background-color:#DDD;height: "+t.height(r[0])+";opacity:"+t.opacity(l)),title:r[1]},null,12,v)})),128))]),e.createVNode(g,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=function(e){return t.value=e}),min:t.min,max:t.max,step:t.step,tooltips:!1,onUpdate:t.change},null,8,["modelValue","min","max","step","onUpdate"])])])},module.exports=l;
2
2
  //# sourceMappingURL=Price.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Price.js","sources":["../../../../src/components/shop/filters/Price.vue","../../../../src/components/shop/filters/Price.vue?vue&type=template&id=4ec0b279&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>"],"names":["defineComponent","name","components","Slider","props","min","Number","max","step","from","to","bar","Array","reset","String","hrefTemplate","setup","value","ref","disabled","href","computed","replace","Math","floor","ceil","opacity","key","height","change","style","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_ctx","_hoisted_5","_hoisted_6","_hoisted_7","innerHTML","price","_hoisted_11","_hoisted_13","item","title","_createVNode","tooltips","onUpdate"],"mappings":"gJAsD6BA,kBAAgB,CACzCC,KAAM,QACNC,WAAY,CACRC,OAAAA,WAEJC,MAAO,CACHC,IAAKC,OACLC,IAAKD,OACLE,KAAMF,OACNG,KAAMH,OACNI,GAAIJ,OACJK,IAAKC,MACLC,MAAOC,OACPC,aAAcD,QAElBE,eAAMZ,OACIa,EAAQC,MAAI,CAACd,EAAMK,KAAML,EAAMM,KAC/BS,EAAWD,OAAI,GAEfE,EAAOC,YAAS,kBACXjB,EAAMW,aAAaO,QACtB,MACAC,KAAKC,MAAMP,EAAMA,MAAM,IAAM,IAAMM,KAAKE,KAAKR,EAAMA,MAAM,cAwB1D,CACHA,MAAAA,EACAS,QAtBY,SAACC,UACC,GAsBdC,OAXW,SAACX,UACLA,EAAQ,EAAI,cAAgBA,EAAQ,KAAO,OAWlDY,OARW,WACXV,EAASF,OAAQ,GAQjBG,KAAAA,EACAD,SAAAA,eCzGG,+BACI,iBACI,mDAA+B,wCAOzC,aACU,4CACI,8EAKA,wCAKL,kDACNW,MAAA,oHAtBZC,2BAAAC,GACIC,2BAAAC,GACID,2BAAAE,oBACOC,8BAEkCA,uBAAzCL,gCAAIX,KAAMgB,cAAa,+BACnBA,kEAGRH,2BAAAI,GACIJ,2BAAAK,GACIL,2BAAAM,GACIN,6BAAMO,UAAQJ,WAASK,MAAML,yBAAqBH,6BAC9CO,UAAQJ,WAASK,MAAML,yBAG/BH,2BAAAS,GACIT,0BAAIb,KAAMgB,aAAY,mBAAkB,cAGhDH,2BAAAU,oBAIIZ,kDAC0BK,gBAAdQ,EAAMjB,wBADlBI,4BAEKJ,IAAKA,QACA,SACLG,0GAMAe,MAAOD,4BAGhBE,4BACaV,6DAAAA,YACR/B,IAAK+B,MACL7B,IAAK6B,MACL5B,KAAM4B,OACNW,UAAU,EACVC,SAAQZ"}
1
+ {"version":3,"file":"Price.js","sources":["../../../../src/components/shop/filters/Price.vue","../../../../src/components/shop/filters/Price.vue?vue&type=template&id=4ec0b279&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>","<template>\n <div class=\"shop-filters-price\">\n <div class=\"mb-2\">\n <div class=\"title is-6 mb-0 is-clickable\" shop-filter-title>\n {{ __(\"shop.filter.price\") }}\n </div>\n <a :href=\"reset\" class=\"is-size-7\" v-if=\"reset\">{{\n __(\"shop.clearFilter\")\n }}</a>\n </div>\n <div shop-filter-content>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column\">\n <span v-html=\"$filters.price(value[0])\"></span> — <span\n v-html=\"$filters.price(value[1])\"\n ></span>\n </div>\n <div class=\"column is-narrow\">\n <a :href=\"href\" class=\"button is-small\">OK</a>\n </div>\n </div>\n <div\n class=\"columns is-gapless is-align-items-flex-end mb-0\"\n style=\"height: 30px\"\n >\n <div\n v-for=\"(item, key) in bar\"\n :key=\"key\"\n class=\"column\"\n :style=\"\n 'width:5%;background-color:#DDD;height: ' +\n height(item[0]) +\n ';opacity:' +\n opacity(key)\n \"\n :title=\"item[1]\"\n ></div>\n </div>\n <slider\n v-model=\"value\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :tooltips=\"false\"\n @update=\"change\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport Slider from \"@vueform/slider\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"price\",\n components: {\n Slider,\n },\n props: {\n min: Number,\n max: Number,\n step: Number,\n from: Number,\n to: Number,\n bar: Array,\n reset: String,\n hrefTemplate: String,\n },\n setup(props) {\n const value = ref([props.from, props.to]);\n const disabled = ref(true);\n\n const href = computed(() => {\n return props.hrefTemplate.replace(\n \"#-#\",\n Math.floor(value.value[0]) + \"-\" + Math.ceil(value.value[1])\n );\n });\n\n const opacity = (key) => {\n let opacity = 1;\n\n // if (value.value[0] > (key + 2) * props.step) {\n // opacity = 0.5;\n // } else if (value.value[1] < (key + 2) * props.step) {\n // opacity = 0.5;\n // }\n\n return opacity;\n };\n\n const height = (value) => {\n return value > 0 ? \"calc(10% + \" + value + \"%)\" : \"0px\";\n };\n\n const change = () => {\n disabled.value = false;\n };\n\n return {\n value,\n opacity,\n height,\n change,\n href,\n disabled,\n };\n },\n});\n</script>"],"names":["defineComponent","name","components","Slider","props","min","Number","max","step","from","to","bar","Array","reset","String","hrefTemplate","setup","value","ref","disabled","href","computed","replace","Math","floor","ceil","opacity","key","height","change","style","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_ctx","_hoisted_5","_hoisted_6","_hoisted_7","innerHTML","price","_hoisted_10","_hoisted_12","item","title","_createVNode","tooltips","onUpdate"],"mappings":"gJAsD6BA,kBAAgB,CACzCC,KAAM,QACNC,WAAY,CACRC,OAAAA,WAEJC,MAAO,CACHC,IAAKC,OACLC,IAAKD,OACLE,KAAMF,OACNG,KAAMH,OACNI,GAAIJ,OACJK,IAAKC,MACLC,MAAOC,OACPC,aAAcD,QAElBE,eAAMZ,OACIa,EAAQC,MAAI,CAACd,EAAMK,KAAML,EAAMM,KAC/BS,EAAWD,OAAI,GAEfE,EAAOC,YAAS,kBACXjB,EAAMW,aAAaO,QACtB,MACAC,KAAKC,MAAMP,EAAMA,MAAM,IAAM,IAAMM,KAAKE,KAAKR,EAAMA,MAAM,cAwB1D,CACHA,MAAAA,EACAS,QAtBY,SAACC,UACC,GAsBdC,OAXW,SAACX,UACLA,EAAQ,EAAI,cAAgBA,EAAQ,KAAO,OAWlDY,OARW,WACXV,EAASF,OAAQ,GAQjBG,KAAAA,EACAD,SAAAA,eCzGG,+BACI,iBACI,mDAA+B,wCAOzC,aACU,4CACI,mDAKA,wCAKL,kDACNW,MAAA,oHAtBZC,2BAAAC,GACIC,2BAAAC,GACID,2BAAAE,oBACOC,8BAEkCA,uBAAzCL,gCAAIX,KAAMgB,cAAa,+BACnBA,kEAGRH,2BAAAI,GACIJ,2BAAAK,GACIL,2BAAAM,GACIN,6BAAMO,UAAQJ,WAASK,MAAML,gDAAqBH,6BAC9CO,UAAQJ,WAASK,MAAML,yBAG/BH,2BAAAS,GACIT,0BAAIb,KAAMgB,aAAY,mBAAkB,cAGhDH,2BAAAU,oBAIIZ,kDAC0BK,gBAAdQ,EAAMjB,wBADlBI,4BAEKJ,IAAKA,QACA,SACLG,0GAMAe,MAAOD,4BAGhBE,4BACaV,6DAAAA,YACR/B,IAAK+B,MACL7B,IAAK6B,MACL5B,KAAM4B,OACNW,UAAU,EACVC,SAAQZ"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),l=require("@perevorot/shop/dist/forms/FormText"),a=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var m=s(r),u=s(l),p=s(a),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=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!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},g={class:"bundle-title"},k={class:"column name"},y={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},S={key:0,class:"code"},w={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},M={key:0,class:"quantity-price"},L=["innerHTML"],H={class:"column is-2 has-text-right"},q=["innerHTML"],O=["innerHTML"],P=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},j={class:"option-title"},A={class:"column is-2 has-text-right"},U=e.createTextVNode("+"),J=["innerHTML"],I={key:0,class:"bundle columns"},W={class:"column is-narrow"},G=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),K=["href"],Q=["src"],X={key:1},Y=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Z={class:"column"},ee={key:0,class:"code"},te={class:"title"},oe=["href"],ne={key:1,class:"bundle columns"},re={class:"column is-narrow"},le=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],ie=["src"],ce={key:1},se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],de={class:"column"},me={key:0,class:"code"},ue={class:"title"},pe=["href"];function ve(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function he(){}function fe(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,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",f,[e.createElementVNode("div",g,e.toDisplayString(t.__("shop.cart.bundle")),1)])):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",y,[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,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(t.__("shop.cart.code"))+" "+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,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,L),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",H,[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,q)):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.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,P)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",j,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[U,e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,J)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",W,[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",X,Y))],2)],8,K)]),e.createElementVNode("div",Z,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",te,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,oe)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",re,[le,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,ie)):(e.openBlock(),e.createElementBlock("svg",ce,se))],2)],8,ae)]),e.createElementVNode("div",de,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",me,e.toDisplayString(t.__("shop.cart.code"))+" "+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,pe)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(u.default),e.markRaw(p.default);var ge=n.SchemaFormFactory([m.default({})]),ke={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ye=e.defineComponent({components:{CheckoutItem:h,SchemaForm:ge},props:{isLogin:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var l=e.useSlots(),a=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),m=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),g=e.computed((function(){return i.getters["checkout/user"]})),k=e.ref(!0),y=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),S=e.ref("new"),w=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),M=e.ref(""),L=e.ref(null),H=e.ref(!1),q=e.getCurrentInstance(),O=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),P=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),$=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch($,(function(e){e.length>1e3&&($.value=$.value.substring(0,1e3))}));var F=function(t,o){return e.computed({get:function(){return g.value[t]?g.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(g.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",F);var z=e.ref({last_name:F("last_name"),middle_name:F("middle_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),company_name:F("company_name"),user_type:F("user_type","individual")});e.provide("user",z),i.dispatch("auth/me",{finally:function(){}});var R=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),j=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return j.value?C.value.find((function(e){return e.id==j.value})):{}})),J=e.computed((function(){return Q(B.value,R.value)})),I=e.computed((function(){return Q(C.value,j.value)})),W=e.computed((function(){return X(B.value)})),G=e.computed((function(){return X(C.value)})),K=e.computed((function(){var e=[];return m.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),Q=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},X=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&R.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(R.value)),o&&j.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(j.value)),o&&n.categories&&n.categories.length&&(o=!K.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===z.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Y=e.computed((function(){var e=0;return m.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(S,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Z={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:u.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},registration_number:{component:u.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:u.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:u.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}},ee=Object.keys(Z).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Z[t]),e}),{});ee=r.userFields.reduce((function(e,t){return e[t]=ee[t],e}),{});var te=e.ref(ee);n.useSchemaForm(z);var oe={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required()}))},ne=Object.keys(oe).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=oe[t]),e}),{}),re=v.object().shape(ne);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var le=fe((function(){return function(e){var t=e();if(t&&t.then)return t.then(he)}((function(){if("function"==typeof ae.value)return ve(ae.value(),(function(e){w.value&&w.value.click(),re.isValid(z.value).then((function(t){k.value=t&&j.value&&O.value&&R.value&&(!A.value.component||A.value.component&&D.value[A.value.code]&&D.value[A.value.code].isValid)&&e}))}))}))})),ae=e.ref(null);e.provide("shippingComponentValid",ae);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ce=fe((function(){var t="function"==typeof ae.value?ae.value():null;return re.isValid(z.value).then((function(o){if(o)if(R.value)if(!A.value.component||D.value[A.value.code]&&D.value[A.value.code].isValid)if(t)if(j.value)if(O.value){var n,r=D.value[A.value.code]?JSON.parse(JSON.stringify(D.value[A.value.code])):{};delete r.isValid;var l=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var i={checkout:!0,user:{last_name:z.value.last_name,middle_name:z.value.middle_name,name:z.value.name,phone:z.value.phone,email:z.value.email,user_type:z.value.user_type,registration_number:z.value.registration_number,company_name:z.value.company_name},shipping:{id:R.value,data:r,user:l},payment:{id:j.value},comment:$.value,dontcall:P.value,promoCode:M.value,clientId:n};s.value=!0,$http.post(window.location.href,i).then((function(t){if(t.data&&t.data.error&&t.data.message)a(t.data.message,{type:"error"});else{var o=[];m.value.forEach((function(e){o.push({item_name:e.name,item_id:e.attributes.code,price:e.price,item_category:e.attributes.category?e.attributes.category:"",item_brand:e.attributes.brand?e.attributes.brand:"",quantity:e.quantity})}));var n={ecommerce:{transaction_id:t.data.order.id,value:parseFloat(h.value),tax:"0",shipping:"0",items:o},event:"purchase"};M.value&&(n.ecommerce.coupon=M.value),$env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n)),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){y.value.submit()}),400)}))),_.value=!0,E.value=t.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),se()}})).catch((function(e){a(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else a(__("shop.order.validate_consent"),{type:"error"});else a(__("shop.order.validate_payment"),{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping"),{type:"error"});else S.value="new",w.value.click(),a(__("shop.order.validate_user"),{type:"error"})})),ve()})),se=function(){i.commit("checkout/reset")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(m.value.forEach((function(t){e.push({item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),item_brand:t.attributes.brand,item_category:t.attributes.category,quantity:t.quantity})})),e.length){var t={ecommerce:{currencyCode:"UAH",items:e},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:S,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){S.value="new"},quantity:d,items:m,loading:s,pluralize:t.pluralize,discount:Y,total:h,shipping:R,shippingPrice:J,payment:j,fee:I,userValidation:re,userSchema:te,userSubmitButton:w,checkout:ce,ifCheckoutReady:k,validate:le,shippingTypesRestricted:W,paymentMethodsRestricted:G,toggleShippingRadio:function(e){R.value===e&&(R.value=null)},togglePaymentRadio:function(e){j.value===e&&(j.value=null)},shippingSelected:A,paymentSelected:U,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:se,user:z,dontcall:P,comment:$,isCommentToggled:T,commentMaxLength:1e3,userCheckout:g,thanks:_,order:E,redirect:b,redirectForm:y,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){M.value&&(H.value=!0,$http.post(window.location.href,{promoCodeApply:M.value,email:z.value.email,total:h.value}).then((function(e){L.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ke,props:{message:__("shop.order.promo.error_"+e.error,{number:q.appContext.config.globalProperties.$filters.price(e.number)})}};a(t,{type:"error"}),"not_found"==e.error&&(M.value="")})),L.value=null)})).finally((function(){H.value=!1})))},promoCode:M,isPromoLoading:H,promoCodeApplied:L,resetPromoCode:function(){M.value="",L.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+I.value+J.value;return L.value&&"percent"==L.value.type?Math.round(e-e*L.value.amount/100):L.value&&"discount"==L.value.type?Math.max(0,e-L.value.amount):e},consent:V,shippingComponent:N,slots:l}}}),_e={class:"cart checkout"},Ee=["action"],Ve=["name","value"],Ne={key:1,class:"items-wrapper"},be={class:"checkout-title"},Be={class:"columns"},Ce={class:"column checkout-blocks-wrapper"},Se={class:"checkout-block is-cart"},we={class:"wrapper"},De={class:"title-row"},Te={class:"items-title"},xe=["textContent"],Me=e.createTextVNode(" "),Le=["innerHTML"],He=["onClick"],qe=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Oe={class:"checkout-block is-user auth-user"},Pe={class:"wrapper"},$e={class:"items-title"},Fe={key:0,class:"user-tabs"},ze={class:"columns"},Re={class:"column user-form"},je={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Ae={key:0,class:"column user-login user-form"},Ue={key:1,class:"column"},Je={key:0,class:"social-auth"},Ie={class:"socials"},We={class:"description"},Ge={class:"buttons"},Ke=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Qe=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Xe={class:"checkout-block is-shipping"},Ye={class:"wrapper shipping-type-block"},Ze={class:"rows"},et={class:"item"},tt={class:"row"},ot={class:"info"},nt={class:"items-title mb-1"},rt={key:0,class:"value"},lt={class:"next-dates"},at={class:"row"},it={class:"info"},ct=["value","onClick"],st=["src"],dt={key:1,class:"icon"},mt=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],ut={key:0,class:"description"},pt={class:"value"},vt={key:0,class:"green"},ht=["innerHTML"],ft={key:0},gt={key:0,class:"checkout-block is-payment"},kt={class:"wrapper payment-method-block"},yt={class:"rows"},_t={class:"item"},Et={class:"row"},Vt={class:"info"},Nt={class:"items-title mb-1"},bt={class:"info"},Bt=["value","onClick"],Ct={key:0,class:"description"},St={key:0,class:"value"},wt=["innerHTML"],Dt={class:"column is-4"},Tt={class:"checkout-block summary"},xt={key:0,class:"inner payment-method-block"},Mt={class:"rows"},Lt={class:"item"},Ht={class:"row"},qt={class:"info"},Ot={class:"items-title mb-1"},Pt={class:"info"},$t=["value","onClick"],Ft={key:0,class:"description"},zt={key:0,class:"value"},Rt=["innerHTML"],jt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),At={class:"inner"},Ut={class:"items-title"},Jt={class:"rows"},It={class:"row products"},Wt={class:"info"},Gt=["textContent"],Kt={class:"value"},Qt=["innerHTML"],Xt={key:0,class:"row discount"},Yt={class:"info"},Zt={class:"value"},eo=["innerHTML"],to={key:1,class:"row fee"},oo={class:"info"},no={class:"value"},ro=["innerHTML"],lo={key:2,class:"row shipping"},ao={class:"info"},io={class:"value"},co=["innerHTML"],so={key:1,class:"green"},mo={key:3,class:"row promo"},uo={class:"info"},po=e.createElementVNode("br",null,null,-1),vo={class:"green"},ho={class:"value"},fo=["innerHTML"],go={class:"row price"},ko={class:"info"},yo={class:"value orange"},_o=["innerHTML"],Eo={class:"checkbox-wrapper nocall"},Vo={key:0,class:"consent"},No={class:"checkbox-wrapper"},bo=["innerHTML"],Bo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Co={class:"user-form is-promo-code"},So={class:"control"},wo=["disabled"],Do={class:"label",for:"promo-code-applied"},To=["disabled"],xo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Mo={class:"user-form"},Lo={key:0,class:"chars-count"},Ho={key:2,class:"checkout-block thanks"},qo={class:"title"},Oo={class:"columns"},Po={key:0,class:"column is-6"},$o={class:"subtitle"},Fo={key:1,class:"column is-6"},zo={class:"column is-6"},Ro={key:0,class:"info-wrapper"},jo={class:"title"},Ao={class:"columns"},Uo=["innerHTML"],Jo=["innerHTML"],Io={key:1,class:"info-wrapper"},Wo={class:"title"},Go={class:"columns"},Ko=["innerHTML"],Qo=["innerHTML"],Xo={key:2,class:"info-wrapper"},Yo={class:"title"},Zo={class:"columns"},en={class:"column is-6"},tn=["innerHTML"],on={key:3,class:"checkout-block empty"},nn={class:"title"},rn={class:"message"},ln=["href"],an=e.createTextVNode(", "),cn=e.createElementVNode("br",null,null,-1),sn=["href"];ye.render=function(t,o,n,r,l,a){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",_e,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ve)})),128))],8,Ee)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",be,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Se,[e.createCommentVNode("items"),e.createElementVNode("div",we,[e.createElementVNode("div",De,[e.createElementVNode("div",Te,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,xe),Me,e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,Le)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[qe,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,He)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("div",$e,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ze,[e.withDirectives(e.createElementVNode("div",Re,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",je,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Ue,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",Ie,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Ge,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ke),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Qe)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",lt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",at,[e.createElementVNode("div",it,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,ct),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,st)):(e.openBlock(),e.createElementBlock("svg",dt,mt)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",pt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,ht))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ft,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,[e.createElementVNode("div",Vt,[e.createElementVNode("div",Nt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",bt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Bt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ct,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,wt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,[e.createElementVNode("div",qt,[e.createElementVNode("div",Ot,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Pt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,$t),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ft,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Rt)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),jt,e.createElementVNode("div",At,[e.createElementVNode("div",Ut,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",Jt,[e.createElementVNode("div",It,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Gt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Kt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Qt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Yt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Zt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,eo)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",no,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,ro)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("div",ao,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",io,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,co)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",so,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",mo,[e.createElementVNode("div",uo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),po,e.createElementVNode("span",vo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",ho,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,fo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",go,[e.createElementVNode("div",ko,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",yo,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,_o)])])]),e.createElementVNode("div",Eo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[11]||(o[11]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:o[12]||(o[12]=function(){return t.validate&&t.validate.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),35),e.renderSlot(t.$slots,"submit"),t.isConsent?(e.openBlock(),e.createElementBlock("div",Vo,[e.createElementVNode("div",No,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,bo)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[14]||(o[14]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Bo]),e.createElementVNode("div",Co,[e.createElementVNode("div",So,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,wo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Do,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[17]||(o[17]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[16]||(o[16]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,To))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[18]||(o[18]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),xo]),e.createElementVNode("div",Mo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[19]||(o[19]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Lo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Ho,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",qo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.__("shop.order.success")),1)]),e.createElementVNode("div",Oo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",$o,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[20]||(o[20]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("button",{class:"button is-orange",onClick:o[21]||(o[21]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",zo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ao,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Uo)):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,Jo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Io,[e.createElementVNode("div",Wo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Go,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Ko)):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,Qo)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",Yo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Zo,[e.createElementVNode("div",en,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,tn)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("div",nn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",rn,[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,ln),an,cn,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,sn)]))])},module.exports=ye;
1
+ "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),l=require("@perevorot/shop/dist/forms/FormText"),a=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var m=s(r),u=s(l),p=s(a),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=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!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},g={class:"bundle-title"},k={class:"column name"},y={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},S={key:0,class:"code"},w={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},M={key:0,class:"quantity-price"},L=["innerHTML"],H={class:"column is-2 has-text-right"},q=["innerHTML"],O=["innerHTML"],P=["innerHTML"],$={key:0,class:"options is-toggled"},F={class:"toggler"},z={class:"wrapper"},R={class:"column"},j={class:"option-title"},A={class:"column is-2 has-text-right"},U=["innerHTML"],J={key:0,class:"bundle columns"},I={class:"column is-narrow"},W=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),G=["href"],K=["src"],Q={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],oe={key:1,class:"bundle columns"},ne={class:"column is-narrow"},re=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),le=["href"],ae=["src"],ie={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},de={key:0,class:"code"},me={class:"title"},ue=["href"];function pe(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ve(){}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,l,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",f,[e.createElementVNode("div",g,e.toDisplayString(t.__("shop.cart.bundle")),1)])):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",y,[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,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(t.__("shop.cart.code"))+" "+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,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,L),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",H,[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,q)):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.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,P)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",R,[e.createElementVNode("div",j,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[e.createTextVNode("+"),e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,U)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("div",I,[W,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,K)):(e.openBlock(),e.createElementBlock("svg",Q,X))],2)],8,G)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(t.__("shop.cart.code"))+" "+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",oe,[e.createElementVNode("div",ne,[re,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",ie,ce))],2)],8,le)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",me,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,ue)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(u.default),e.markRaw(p.default);var fe=n.SchemaFormFactory([m.default({})]),ge={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ke=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},props:{isLogin:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var l=e.useSlots(),a=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),m=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),g=e.computed((function(){return i.getters["checkout/user"]})),k=e.ref(!0),y=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),S=e.ref("new"),w=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),M=e.ref(""),L=e.ref(null),H=e.ref(!1),q=e.getCurrentInstance(),O=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),P=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),$=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch($,(function(e){e.length>1e3&&($.value=$.value.substring(0,1e3))}));var F=function(t,o){return e.computed({get:function(){return g.value[t]?g.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(g.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",F);var z=e.ref({last_name:F("last_name"),middle_name:F("middle_name"),name:F("name"),email:F("email"),phone:F("phone"),registration_number:F("registration_number"),company_name:F("company_name"),user_type:F("user_type","individual")});e.provide("user",z),i.dispatch("auth/me",{finally:function(){}});var R=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),j=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),A=e.computed((function(){return R.value?B.value.find((function(e){return e.id==R.value})):{}})),U=e.computed((function(){return j.value?C.value.find((function(e){return e.id==j.value})):{}})),J=e.computed((function(){return Q(B.value,R.value)})),I=e.computed((function(){return Q(C.value,j.value)})),W=e.computed((function(){return X(B.value)})),G=e.computed((function(){return X(C.value)})),K=e.computed((function(){var e=[];return m.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),Q=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},X=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&R.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(R.value)),o&&j.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(j.value)),o&&n.categories&&n.categories.length&&(o=!K.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===z.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},Y=e.computed((function(){var e=0;return m.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(S,(function(e){"login"==e&&i.commit("auth/modal","login")}));var Z={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:u.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:u.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:u.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:u.default,label:__("auth.registration.form.phone"),model:"phone",mask:"(###) ###-##-##",type:"phone"},registration_number:{component:u.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:u.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:u.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}},ee=Object.keys(Z).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=Z[t]),e}),{});ee=r.userFields.reduce((function(e,t){return e[t]=ee[t],e}),{});var te=e.ref(ee);n.useSchemaForm(z);var oe={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required()}))},ne=Object.keys(oe).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=oe[t]),e}),{}),re=v.object().shape(ne);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var le=he((function(){return function(e){var t=e();if(t&&t.then)return t.then(ve)}((function(){if("function"==typeof ae.value)return pe(ae.value(),(function(e){w.value&&w.value.click(),re.isValid(z.value).then((function(t){k.value=t&&j.value&&O.value&&R.value&&(!A.value.component||A.value.component&&D.value[A.value.code]&&D.value[A.value.code].isValid)&&e}))}))}))})),ae=e.ref(null);e.provide("shippingComponentValid",ae);var ie=e.ref({});e.provide("shippingComponentUserData",ie);var ce=he((function(){var t="function"==typeof ae.value?ae.value():null;return re.isValid(z.value).then((function(o){if(o)if(R.value)if(!A.value.component||D.value[A.value.code]&&D.value[A.value.code].isValid)if(t)if(j.value)if(O.value){var n,r=D.value[A.value.code]?JSON.parse(JSON.stringify(D.value[A.value.code])):{};delete r.isValid;var l=JSON.parse(JSON.stringify(ie.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var i={checkout:!0,user:{last_name:z.value.last_name,middle_name:z.value.middle_name,name:z.value.name,phone:z.value.phone,email:z.value.email,user_type:z.value.user_type,registration_number:z.value.registration_number,company_name:z.value.company_name},shipping:{id:R.value,data:r,user:l},payment:{id:j.value},comment:$.value,dontcall:P.value,promoCode:M.value,clientId:n};s.value=!0,$http.post(window.location.href,i).then((function(t){if(t.data&&t.data.error&&t.data.message)a(t.data.message,{type:"error"});else{var o=[];m.value.forEach((function(e){o.push({item_name:e.name,item_id:e.attributes.code,price:e.price,item_category:e.attributes.category?e.attributes.category:"",item_brand:e.attributes.brand?e.attributes.brand:"",quantity:e.quantity})}));var n={ecommerce:{transaction_id:t.data.order.id,value:parseFloat(h.value),tax:"0",shipping:"0",items:o},event:"purchase"};M.value&&(n.ecommerce.coupon=M.value),$env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n)),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){y.value.submit()}),400)}))),_.value=!0,E.value=t.data.order,document.querySelector("html").classList.add("is-checkout-thanks"),se()}})).catch((function(e){a(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else a(__("shop.order.validate_consent"),{type:"error"});else a(__("shop.order.validate_payment"),{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping1")+": «"+A.value.name+"»",{type:"error"});else a(__("shop.order.validate_shipping"),{type:"error"});else S.value="new",w.value.click(),a(__("shop.order.validate_user"),{type:"error"})})),pe()})),se=function(){i.commit("checkout/reset")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(m.value.forEach((function(t){e.push({item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),item_brand:t.attributes.brand,item_category:t.attributes.category,quantity:t.quantity})})),e.length){var t={ecommerce:{currencyCode:"UAH",items:e},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:S,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){S.value="new"},quantity:d,items:m,loading:s,pluralize:t.pluralize,discount:Y,total:h,shipping:R,shippingPrice:J,payment:j,fee:I,userValidation:re,userSchema:te,userSubmitButton:w,checkout:ce,ifCheckoutReady:k,validate:le,shippingTypesRestricted:W,paymentMethodsRestricted:G,toggleShippingRadio:function(e){R.value===e&&(R.value=null)},togglePaymentRadio:function(e){j.value===e&&(j.value=null)},shippingSelected:A,paymentSelected:U,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:se,user:z,dontcall:P,comment:$,isCommentToggled:T,commentMaxLength:1e3,userCheckout:g,thanks:_,order:E,redirect:b,redirectForm:y,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){M.value&&(H.value=!0,$http.post(window.location.href,{promoCodeApply:M.value,email:z.value.email,total:h.value}).then((function(e){L.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ge,props:{message:__("shop.order.promo.error_"+e.error,{number:q.appContext.config.globalProperties.$filters.price(e.number)})}};a(t,{type:"error"}),"not_found"==e.error&&(M.value="")})),L.value=null)})).finally((function(){H.value=!1})))},promoCode:M,isPromoLoading:H,promoCodeApplied:L,resetPromoCode:function(){M.value="",L.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+I.value+J.value;return L.value&&"percent"==L.value.type?Math.round(e-e*L.value.amount/100):L.value&&"discount"==L.value.type?Math.max(0,e-L.value.amount):e},consent:V,shippingComponent:N,slots:l}}}),ye={class:"cart checkout"},_e=["action"],Ee=["name","value"],Ve={key:1,class:"items-wrapper"},Ne={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},Se={class:"wrapper"},we={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=["innerHTML"],Me=["onClick"],Le=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),He={class:"checkout-block is-user auth-user"},qe={class:"wrapper"},Oe={class:"items-title"},Pe={key:0,class:"user-tabs"},$e={class:"columns"},Fe={class:"column user-form"},ze={type:"submit",ref:"userSubmitButton",class:"is-hidden"},Re={key:0,class:"column user-login user-form"},je={key:1,class:"column"},Ae={key:0,class:"social-auth"},Ue={class:"socials"},Je={class:"description"},Ie={class:"buttons"},We=[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:"checkout-block is-shipping"},Qe={class:"wrapper shipping-type-block"},Xe={class:"rows"},Ye={class:"item"},Ze={class:"row"},et={class:"info"},tt={class:"items-title mb-1"},ot={key:0,class:"value"},nt={class:"next-dates"},rt={class:"row"},lt={class:"info"},at=["value","onClick"],it=["src"],ct={key:1,class:"icon"},st=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],dt={key:0,class:"description"},mt={class:"value"},ut={key:0,class:"green"},pt=["innerHTML"],vt={key:0},ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},gt={class:"rows"},kt={class:"item"},yt={class:"row"},_t={class:"info"},Et={class:"items-title mb-1"},Vt={class:"info"},Nt=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],St={class:"column is-4"},wt={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Mt={class:"row"},Lt={class:"info"},Ht={class:"items-title mb-1"},qt={class:"info"},Ot=["value","onClick"],Pt={key:0,class:"description"},$t={key:0,class:"value"},Ft=["innerHTML"],zt=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),Rt={class:"inner"},jt={class:"items-title"},At={class:"rows"},Ut={class:"row products"},Jt={class:"info"},It=["textContent"],Wt={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},lo={class:"value"},ao=["innerHTML"],io={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},mo=e.createElementVNode("br",null,null,-1),uo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},go={class:"value orange"},ko=["innerHTML"],yo={class:"checkbox-wrapper nocall"},_o={key:0,class:"consent"},Eo={class:"checkbox-wrapper"},Vo=["innerHTML"],No=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),bo={class:"user-form is-promo-code"},Bo={class:"control"},Co=["disabled"],So={class:"label",for:"promo-code-applied"},wo=["disabled"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form"},xo={key:0,class:"chars-count"},Mo={key:2,class:"checkout-block thanks"},Lo={class:"title"},Ho={class:"columns"},qo={key:0,class:"column is-6"},Oo={class:"subtitle"},Po={key:1,class:"column is-6"},$o={class:"column is-6"},Fo={key:0,class:"info-wrapper"},zo={class:"title"},Ro={class:"columns"},jo=["innerHTML"],Ao=["innerHTML"],Uo={key:1,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Wo=["innerHTML"],Go=["innerHTML"],Ko={key:2,class:"info-wrapper"},Qo={class:"title"},Xo={class:"columns"},Yo={class:"column is-6"},Zo=["innerHTML"],en={key:3,class:"checkout-block empty"},tn={class:"title"},on={class:"message"},nn=["href"],rn=e.createElementVNode("br",null,null,-1),ln=["href"];ke.render=function(t,o,n,r,l,a){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ye,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ee)})),128))],8,_e)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ne,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",Se,[e.createElementVNode("div",we,[e.createElementVNode("div",De,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Te),e.createTextVNode(" "),e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,xe)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[Le,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Me)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",He,[e.createElementVNode("div",qe,[e.createElementVNode("div",Oe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",$e,[e.withDirectives(e.createElementVNode("div",Fe,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",ze,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",je,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",Ue,[e.createElementVNode("div",Je,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Ie,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},We),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ge)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",nt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,at),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",ct,st)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",mt,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,pt))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",vt,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Nt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",St,[e.createElementVNode("div",wt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ht,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",qt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Ot),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Pt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ft)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),zt,e.createElementVNode("div",Rt,[e.createElementVNode("div",jt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",Ut,[e.createElementVNode("div",Jt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,It),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",Wt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",lo,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,ao)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",io,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),mo,e.createElementVNode("span",uo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",go,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,ko)])])]),e.createElementVNode("div",yo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[11]||(o[11]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),onMouseenter:o[12]||(o[12]=function(){return t.validate&&t.validate.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),35),e.renderSlot(t.$slots,"submit"),t.isConsent?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("div",Eo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,Vo)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[14]||(o[14]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),No]),e.createElementVNode("div",bo,[e.createElementVNode("div",Bo,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,Co),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",So,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[17]||(o[17]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[16]||(o[16]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,wo))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[18]||(o[18]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),Do]),e.createElementVNode("div",To,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[19]||(o[19]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",xo,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",Mo,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",Lo,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.__("shop.order.success")),1)]),e.createElementVNode("div",Ho,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",qo,[e.createElementVNode("div",Oo,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[20]||(o[20]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("button",{class:"button is-orange",onClick:o[21]||(o[21]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",$o,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("div",zo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Ro,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,jo)):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,Ao)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Io,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Wo)):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,Go)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",Ko,[e.createElementVNode("div",Qo,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",Xo,[e.createElementVNode("div",Yo,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,Zo)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",tn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",on,[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,nn),e.createTextVNode(", "),rn,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,ln)]))])},module.exports=ke;
2
2
  //# sourceMappingURL=Checkout.js.map