@perevorot/shop 2.0.69 → 2.0.71
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.
- package/dist/components/auth/User.js +1 -1
- package/dist/components/auth/User.js.map +1 -1
- package/dist/components/shop/compare/Compare.js +1 -1
- package/dist/components/shop/compare/Compare.js.map +1 -1
- package/dist/components/shop/order/Checkout.js +1 -1
- package/dist/components/shop/order/Checkout.js.map +1 -1
- package/dist/components/shop/order/shipping/CheckoutShippingUkrposhtaWarehouse.js +2 -0
- package/dist/components/shop/order/shipping/CheckoutShippingUkrposhtaWarehouse.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue");function t(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var o=e.defineComponent({props:{data:Object,item:Object,commit:Function},setup:function(o){var n,u,a=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].city:null},set:function(e){var t={city:e};o.commit(o.item.code,t,i(t))}}),r=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].warehouse:null},set:function(e){var t={city:a.value,warehouse:e};o.commit(o.item.code,t,i(t))}}),i=function(e){return!(!e.city||!e.warehouse)},l=e.ref(!1),c=e.ref(!1),s=e.ref(""),d=e.ref(""),p=e.ref([]),y=e.ref([]),h=e.ref([]),v=e.ref(null),f=e.ref(null),m=e.ref(!1),w=e.ref(!1),k=e.ref(!1),g=e.ref(!1);e.onMounted((function(){o.item.data&&o.item.data.length&&(y.value=o.item.data)}));var C=function(){l.value=!1,c.value=!1,k.value=!1,g.value=!1};window.addEventListener("keyup",(function(e){(l.value||c.value)&&"Escape"===e.key&&C()})),window.addEventListener("click",(function(e){e.target.closest(".ukrposhta-wrapper")||C()})),e.watch(s,(function(e){clearTimeout(u),a.value=null,e&&(m.value=!0,u=setTimeout((function(){$http.post($ziggy("api.delivery-ukr-poshta"),{q:e,action:"cities"}).then((function(e){p.value=e.data.cities})).finally((function(){m.value=!1}))}),400))})),e.watch(d,(function(e){clearTimeout(u),e?(w.value=!0,u=setTimeout((function(){$http.post($ziggy("api.delivery-ukr-poshta"),{q:e,city:a.value.id,action:"warehouses"}).then((function(e){h.value=e.data.warehouses})).finally((function(){w.value=!1}))}),400)):(r.value=null,h.value=[])}));return t(n={isCityOpened:l,isWarehouseOpened:c,openCity:function(){l.value=!0},openWarehouse:function(){c.value=!0},cities:p,citiesPopular:y,warehouses:h,chooseCity:function(e,t){e.stopPropagation(),a.value=t,h.value=[],d.value="",k.value=!1,$http.post($ziggy("api.delivery-ukr-poshta"),{city:t.id,action:"warehouses"}).then((function(e){h.value=e.data.warehouses})).finally((function(){w.value=!1})),C()},chooseWarehouse:function(e,t){e.stopPropagation(),r.value=t,g.value=!1,r.value=t,C()},queryCity:s,queryWarehouse:d,city:a,warehouse:r,loadingCity:m,loadingWarehouse:w,focusWarehouse:function(){l.value=!1,k.value=!1,g.value||(g.value=!0,e.nextTick((function(){f.value.value=" ",f.value.focus()})))},focusCity:function(){c.value=!1,g.value=!1,k.value||(k.value=!0,e.nextTick((function(){v.value.value=" ",v.value.focus()})))}},"city",a),t(n,"warehouse",r),t(n,"cityQueryInput",v),t(n,"warehouseQueryInput",f),t(n,"cityQueryInputInQueryMode",k),t(n,"warehouseQueryInputInQueryMode",g),n}}),n={class:"component ukrposhta-wrapper"},u={class:"user-form"},a=["placeholder"],r=["value"],i=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),l={class:"dropdown-menu"},c={class:"dropdown-content"},s=["onClick"],d={key:0,class:"dropdown-item"},p={class:"user-form"},y=["placeholder"],h=["value"],v=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),f={class:"dropdown-menu"},m={class:"dropdown-content"},w=["onClick"],k={key:0,class:"dropdown-item"};o.render=function(t,o,g,C,E,V){return e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isCityOpened,"is-top":t.cityQueryInputInQueryMode}]),onMouseleave:o[4]||(o[4]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[3]||(o[3]=function(){return t.openCity&&t.openCity.apply(t,arguments)})},[e.createElementVNode("div",u,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingCity}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.queryCity=e}),onFocus:o[1]||(o[1]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:t.__("shop.order.city_placeholder"),autocomplete:"chrome-off",ref:"cityQueryInput"},null,40,a),[[e.vModelText,t.queryCity],[e.vShow,t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.city?t.city.name:"",onFocus:o[2]||(o[2]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:" "},null,40,r),[[e.vShow,!t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.city")),513),[[e.vShow,!t.cityQueryInputInQueryMode]]),i],2)])]),e.createElementVNode("div",l,[e.createElementVNode("div",c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.queryCity?t.cities:t.citiesPopular,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseCity(e,o)}},e.toDisplayString(o.name),9,s)})),128)),!t.queryCity||t.cities.length||t.loadingCity?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",d,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34),t.city?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dropdown",{"is-active":t.isWarehouseOpened,"is-top":t.warehouseQueryInputInQueryMode}]),onMouseleave:o[9]||(o[9]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[8]||(o[8]=function(){return t.openWarehouse&&t.openWarehouse.apply(t,arguments)})},[e.createElementVNode("div",p,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingWarehouse}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.queryWarehouse=e}),onFocus:o[6]||(o[6]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:t.__("shop.order.warehouse_placeholder"),autocomplete:"chrome-off",ref:"warehouseQueryInput"},null,40,y),[[e.vModelText,t.queryWarehouse],[e.vShow,t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.warehouse?t.warehouse.name:"",onFocus:o[7]||(o[7]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:" "},null,40,h),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.warehouse")),513),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),v],2)])]),e.createElementVNode("div",f,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.warehouses,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseWarehouse(e,o)}},e.toDisplayString(o.name),9,w)})),128)),!t.queryWarehouse||t.warehouses.length||t.loadingWarehouse?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34)):e.createCommentVNode("v-if",!0)])},module.exports=o;
|
|
2
|
+
//# sourceMappingURL=CheckoutShippingUkrposhtaWarehouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckoutShippingUkrposhtaWarehouse.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingUkrposhtaWarehouse.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingUkrposhtaWarehouse.vue?vue&type=template&id=23041795&lang.js"],"sourcesContent":["<template>\n <div class=\"component ukrposhta-wrapper\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : null;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : null;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.ukrposhta-wrapper')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode\n };\n }\n});\n</script>\n","<template>\n <div class=\"component ukrposhta-wrapper\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : null;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : null;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.ukrposhta-wrapper')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-ukr-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","typeTimeout","city","computed","get","code","set","isValid","warehouse","value","isCityOpened","ref","isWarehouseOpened","queryCity","queryWarehouse","cities","citiesPopular","warehouses","cityQueryInput","warehouseQueryInput","loadingCity","loadingWarehouse","cityQueryInputInQueryMode","warehouseQueryInputInQueryMode","onMounted","length","close","window","addEventListener","e","key","target","closest","watch","q","clearTimeout","setTimeout","$http","post","$ziggy","action","then","response","id","openCity","openWarehouse","chooseCity","stopPropagation","chooseWarehouse","focusWarehouse","nextTick","focus","focusCity","_createElementVNode","_createElementBlock","_hoisted_1","_ctx","onMouseleave","onClick","_hoisted_2","type","onFocus","placeholder","autocomplete","name","_hoisted_5","_hoisted_6","_hoisted_7","$event","_hoisted_9","_hoisted_10","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_17"],"mappings":"0JA+CA,MAAeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,SA8CEO,EA7CEC,EAAOC,WAAS,CAClBC,sBACWV,EAAMC,KAAKD,EAAMG,KAAKQ,MAAQX,EAAMC,KAAKD,EAAMG,KAAKQ,MAAMH,KAAO,MAE5EI,aAAIJ,OACMP,EAAO,CACTO,KAAMA,GAGVR,EAAMI,OAAOJ,EAAMG,KAAKQ,KAAMV,EAAMY,EAAQZ,OAI9Ca,EAAYL,WAAS,CACvBC,sBACWV,EAAMC,KAAKD,EAAMG,KAAKQ,MAAQX,EAAMC,KAAKD,EAAMG,KAAKQ,MAAMG,UAAY,MAEjFF,aAAIE,OACMb,EAAO,CACTO,KAAMA,EAAKO,MACXD,UAAWA,GAGfd,EAAMI,OAAOJ,EAAMG,KAAKQ,KAAMV,EAAMY,EAAQZ,OAI9CY,EAAU,SAACZ,YACHA,EAAKO,OAAQP,EAAKa,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