@perevorot/shop 2.0.151 → 2.0.152

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/dist/components/account/OrderItem.js +1 -1
  2. package/dist/components/account/OrderItem.js.map +1 -1
  3. package/dist/components/account/User.js +1 -1
  4. package/dist/components/account/User.js.map +1 -1
  5. package/dist/components/auth/Forget.js +1 -1
  6. package/dist/components/auth/Forget.js.map +1 -1
  7. package/dist/components/auth/Login.js +1 -1
  8. package/dist/components/auth/Login.js.map +1 -1
  9. package/dist/components/auth/Registration.js +1 -1
  10. package/dist/components/auth/Registration.js.map +1 -1
  11. package/dist/components/auth/Reset.js +1 -1
  12. package/dist/components/auth/Reset.js.map +1 -1
  13. package/dist/components/shop/Catalog.js +1 -1
  14. package/dist/components/shop/Catalog.js.map +1 -1
  15. package/dist/components/shop/PromoProducts.js +1 -1
  16. package/dist/components/shop/PromoProducts.js.map +1 -1
  17. package/dist/components/shop/Search.js +1 -1
  18. package/dist/components/shop/Search.js.map +1 -1
  19. package/dist/components/shop/cart/Cart.js +1 -1
  20. package/dist/components/shop/cart/Cart.js.map +1 -1
  21. package/dist/components/shop/cart/CartItem.js +1 -1
  22. package/dist/components/shop/cart/CartItem.js.map +1 -1
  23. package/dist/components/shop/filters/Price.js +1 -1
  24. package/dist/components/shop/filters/Price.js.map +1 -1
  25. package/dist/components/shop/order/Checkout.js +1 -1
  26. package/dist/components/shop/order/Checkout.js.map +1 -1
  27. package/dist/components/shop/order/CheckoutItem.js +1 -1
  28. package/dist/components/shop/order/CheckoutItem.js.map +1 -1
  29. package/dist/components/shop/order/OneClick.js +1 -1
  30. package/dist/components/shop/order/OneClick.js.map +1 -1
  31. package/dist/components/shop/reviews/Question.js +1 -1
  32. package/dist/components/shop/reviews/Question.js.map +1 -1
  33. package/dist/components/shop/reviews/Review.js +1 -1
  34. package/dist/components/shop/reviews/Review.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vue-toastification"),r=require("vuex"),n=e.defineComponent({props:{item:Object},setup:function(n){var i=r.useStore(),l=t.useToast(),o=n.item,a=e.ref(!1);return{item:o,isOpen:a,toggle:function(){a.value=!a.value},pluralize:function(e,t){return e+" "+t[e%100>4&&e%100<20?2:[2,0,1,1,1,2][Math.min(e%10,5)]]},addressName:function(e){return e?(e.shipping_postcode?e.shipping_postcode+", ":"")+(e.shipping_city?e.shipping_city:"")+(e.shipping_street?", "+e.shipping_street:"")+(e.shipping_house?" "+e.shipping_house:"")+(e.shipping_building?", "+__("shop.address.building")+" "+e.shipping_building:"")+(e.shipping_flat?", "+__("shop.address.apartment")+" "+e.shipping_flat:"")+(e.shipping_floor?", "+e.shipping_floor+__("shop.address.floor"):""):""},repeat:function(){$http.post($ziggy("account.forward.orders"),{action:"repeat",id:o.id}).then((function(e){l(__("shop.cart.repeated"),{type:"success"}),i.dispatch("cart/get",{finally:function(){}})})).catch((function(){l(__("shop.cart.repeated_error"),{type:"error"})}))}}}}),i={class:"history-order-title"},l=["innerHTML"],o={class:"history-order-body"},a={class:"history-order-table"},s={class:"product"},p={class:"product-photo"},c=["src"],d={key:1,src:"/images/blank.png"},m={class:"product-info"},u=["href"],y=["href"],h={class:"cell-title"},g=["innerHTML"],_={class:"cell-title"},N={class:"cell-title"},E=["innerHTML"],V={class:"history-order-summary"},v={key:0,class:"history-order-delivery-payment"},f={class:"delivery-group"},b=e.createElementVNode("br",null,null,-1),S=["innerHTML"],D=["innerHTML"],k=["innerHTML"],T=["innerHTML"],L={class:"payment-group"},M={class:"history-order-total"},H={class:"total-item products-amount"},B={class:"total-item summ-regular"},q=["innerHTML"];n.render=function(t,r,n,x,z,$){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["history-order",{"is-open":t.isOpen}])},[e.createElementVNode("div",{class:"history-order-head",onClick:r[0]||(r[0]=function(){return t.toggle&&t.toggle.apply(t,arguments)})},[e.createElementVNode("div",i,[e.createTextVNode(" №"+e.toDisplayString(t.item.id)+" "+e.toDisplayString(t.__("shop.cart.bydate"))+" "+e.toDisplayString(t.item.date)+" ",1),e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(t.pluralize(t.item.positions.length,t.__("shop.pluralize.products")))+" "+e.toDisplayString(t.__("shop.cart.bysum"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.total)},null,8,l)])]),e.createElementVNode("div",{class:"history-order-status",style:e.normalizeStyle("color:"+t.item.status.color)},e.toDisplayString(t.item.status.name),5)]),e.createElementVNode("div",o,[e.createElementVNode("table",a,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.product")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.price")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.quantity")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.sum")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.positions,(function(r,n){return e.openBlock(),e.createElementBlock("tr",{key:n},[e.createElementVNode("td",null,[e.createElementVNode("div",s,[e.createElementVNode("div",p,[r.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.image},null,8,c)):(e.openBlock(),e.createElementBlock("img",d))]),e.createElementVNode("div",m,[e.createElementVNode("a",{href:r.category.href,class:"product-category"},e.toDisplayString(r.category.name),9,u),e.createElementVNode("a",{href:r.href,class:"product-title"},e.toDisplayString(r.name),9,y)])])]),e.createElementVNode("td",null,[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.table.price")),1),e.createElementVNode("div",{innerHTML:t.$filters.price(r.price)},null,8,g)]),e.createElementVNode("td",null,[e.createElementVNode("div",_,e.toDisplayString(t.__("shop.cart.table.quantity")),1),e.createElementVNode("div",null,e.toDisplayString(r.quantity),1)]),e.createElementVNode("td",null,[e.createElementVNode("div",N,e.toDisplayString(t.__("shop.cart.table.sum")),1),e.createElementVNode("div",{innerHTML:t.$filters.price(r.quantity*r.price)},null,8,E)])])})),128))])]),e.createElementVNode("div",V,[t.item.delivery&&t.item.payment?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",f,[e.createElementVNode("div",null,e.toDisplayString(t.__("shop.cart.shipment_info")),1),e.createElementVNode("div",null,[e.createTextVNode(e.toDisplayString(t.item.delivery)+" ",1),b,e.createElementVNode("span",{innerHTML:t.item.property.pickup_name?t.item.property.pickup_name+"<br>":""},null,8,S),e.createElementVNode("span",{innerHTML:t.item.property.novaposhta_city?t.item.property.novaposhta_city+"<br>"+t.item.property.novaposhta_warehouse+"<br>":""},null,8,D),e.createElementVNode("span",{innerHTML:t.addressName(t.item.property)+"<br>"},null,8,k),e.createElementVNode("span",{innerHTML:t.item.property.shipping_time?t.item.property.shipping_time+"<br />":""},null,8,T)])]),e.createElementVNode("div",L,[e.createElementVNode("div",null,e.toDisplayString(t.__("shop.cart.payment_info")),1),e.createElementVNode("div",null,e.toDisplayString(t.item.payment),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",M,[e.createElementVNode("div",H,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.products"))+": ",1),e.createElementVNode("span",null,e.toDisplayString(t.item.positions.length),1)]),e.createElementVNode("div",B,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.table.sum"))+": ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.total)},null,8,q)]),e.createElementVNode("a",{onClick:r[1]||(r[1]=function(){return t.repeat&&t.repeat.apply(t,arguments)}),class:"repeat-checkout-btn"},e.toDisplayString(t.__("shop.cart.repeat")),1)])])])],2)},module.exports=n;
1
+ "use strict";var e=require("vue"),t=require("vue-toastification"),r=require("vuex"),n=e.defineComponent({props:{item:Object},setup:function(n){var i=r.useStore(),l=t.useToast(),o=n.item,a=e.ref(!1);return{item:o,isOpen:a,toggle:function(){a.value=!a.value},pluralize:function(e,t){return e+" "+t[e%100>4&&e%100<20?2:[2,0,1,1,1,2][Math.min(e%10,5)]]},addressName:function(e){return e?(e.shipping_postcode?e.shipping_postcode+", ":"")+(e.shipping_city?e.shipping_city:"")+(e.shipping_street?", "+e.shipping_street:"")+(e.shipping_house?" "+e.shipping_house:"")+(e.shipping_building?", "+__("shop.address.building")+" "+e.shipping_building:"")+(e.shipping_flat?", "+__("shop.address.apartment")+" "+e.shipping_flat:"")+(e.shipping_floor?", "+e.shipping_floor+__("shop.address.floor"):""):""},repeat:function(){$http.post($ziggy("account.forward.orders"),{action:"repeat",id:o.id}).then((function(e){l(__("shop.cart.repeated"),{type:"success"}),i.dispatch("cart/get",{finally:function(){}})})).catch((function(){l(__("shop.cart.repeated_error"),{type:"error"})}))}}}}),i={class:"history-order-title"},l=["innerHTML"],o={class:"history-order-body"},a={class:"history-order-table"},s={class:"product"},p={class:"product-photo"},c=["src"],d=["alt"],m={class:"product-info"},u=["href"],y=["href"],h={class:"cell-title"},g=["innerHTML"],_={class:"cell-title"},N={class:"cell-title"},E=["innerHTML"],V={class:"history-order-summary"},v={key:0,class:"history-order-delivery-payment"},f={class:"delivery-group"},b=e.createElementVNode("br",null,null,-1),S=["innerHTML"],D=["innerHTML"],k=["innerHTML"],T=["innerHTML"],L={class:"payment-group"},M={class:"history-order-total"},H={class:"total-item products-amount"},B={class:"total-item summ-regular"},q=["innerHTML"];n.render=function(t,r,n,x,z,$){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["history-order",{"is-open":t.isOpen}])},[e.createElementVNode("div",{class:"history-order-head",onClick:r[0]||(r[0]=function(){return t.toggle&&t.toggle.apply(t,arguments)})},[e.createElementVNode("div",i,[e.createTextVNode(" №"+e.toDisplayString(t.item.id)+" "+e.toDisplayString(t.__("shop.cart.bydate"))+" "+e.toDisplayString(t.item.date)+" ",1),e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(t.pluralize(t.item.positions.length,t.__("shop.pluralize.products")))+" "+e.toDisplayString(t.__("shop.cart.bysum"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.total)},null,8,l)])]),e.createElementVNode("div",{class:"history-order-status",style:e.normalizeStyle("color:"+t.item.status.color)},e.toDisplayString(t.item.status.name),5)]),e.createElementVNode("div",o,[e.createElementVNode("table",a,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.product")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.price")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.quantity")),1),e.createElementVNode("th",null,e.toDisplayString(t.__("shop.cart.table.sum")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.positions,(function(r,n){return e.openBlock(),e.createElementBlock("tr",{key:n},[e.createElementVNode("td",null,[e.createElementVNode("div",s,[e.createElementVNode("div",p,[r.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.image},null,8,c)):(e.openBlock(),e.createElementBlock("img",{key:1,src:"/images/blank.png",alt:r.name},null,8,d))]),e.createElementVNode("div",m,[e.createElementVNode("a",{href:r.category.href,class:"product-category"},e.toDisplayString(r.category.name),9,u),e.createElementVNode("a",{href:r.href,class:"product-title"},e.toDisplayString(r.name),9,y)])])]),e.createElementVNode("td",null,[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.table.price")),1),e.createElementVNode("div",{innerHTML:t.$filters.price(r.price)},null,8,g)]),e.createElementVNode("td",null,[e.createElementVNode("div",_,e.toDisplayString(t.__("shop.cart.table.quantity")),1),e.createElementVNode("div",null,e.toDisplayString(r.quantity),1)]),e.createElementVNode("td",null,[e.createElementVNode("div",N,e.toDisplayString(t.__("shop.cart.table.sum")),1),e.createElementVNode("div",{innerHTML:t.$filters.price(r.quantity*r.price)},null,8,E)])])})),128))])]),e.createElementVNode("div",V,[t.item.delivery&&t.item.payment?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",f,[e.createElementVNode("div",null,e.toDisplayString(t.__("shop.cart.shipment_info")),1),e.createElementVNode("div",null,[e.createTextVNode(e.toDisplayString(t.item.delivery)+" ",1),b,e.createElementVNode("span",{innerHTML:t.item.property.pickup_name?t.item.property.pickup_name+"<br>":""},null,8,S),e.createElementVNode("span",{innerHTML:t.item.property.novaposhta_city?t.item.property.novaposhta_city+"<br>"+t.item.property.novaposhta_warehouse+"<br>":""},null,8,D),e.createElementVNode("span",{innerHTML:t.addressName(t.item.property)+"<br>"},null,8,k),e.createElementVNode("span",{innerHTML:t.item.property.shipping_time?t.item.property.shipping_time+"<br />":""},null,8,T)])]),e.createElementVNode("div",L,[e.createElementVNode("div",null,e.toDisplayString(t.__("shop.cart.payment_info")),1),e.createElementVNode("div",null,e.toDisplayString(t.item.payment),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",M,[e.createElementVNode("div",H,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.products"))+": ",1),e.createElementVNode("span",null,e.toDisplayString(t.item.positions.length),1)]),e.createElementVNode("div",B,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.table.sum"))+": ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.total)},null,8,q)]),e.createElementVNode("a",{onClick:r[1]||(r[1]=function(){return t.repeat&&t.repeat.apply(t,arguments)}),class:"repeat-checkout-btn"},e.toDisplayString(t.__("shop.cart.repeat")),1)])])])],2)},module.exports=n;
2
2
  //# sourceMappingURL=OrderItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrderItem.js","sources":["../../../src/components/account/OrderItem.vue","../../../src/components/account/OrderItem.vue?vue&type=template&id=1a693ecc&lang.js"],"sourcesContent":["<template>\n <div class=\"history-order\" v-bind:class=\"{ 'is-open': isOpen }\">\n <div class=\"history-order-head\" @click=\"toggle\">\n <div class=\"history-order-title\">\n №{{ item.id }} {{ __('shop.cart.bydate') }} {{ item.date }} <span>{{ pluralize(item.positions.length, __('shop.pluralize.products')) }} {{ __('shop.cart.bysum') }} <span v-html=\"$filters.price(item.total)\"></span></span>\n </div>\n <div class=\"history-order-status\" v-bind:style=\"'color:' + item.status.color\">{{ item.status.name }}</div>\n </div>\n <div class=\"history-order-body\">\n <table class=\"history-order-table\">\n <thead>\n <tr>\n <th>{{ __('shop.cart.table.product') }}</th>\n <th>{{ __('shop.cart.table.price') }}</th>\n <th>{{ __('shop.cart.table.quantity') }}</th>\n <th>{{ __('shop.cart.table.sum') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(p, key) in item.positions\" v-bind:key=\"key\">\n <td>\n <div class=\"product\">\n <div class=\"product-photo\">\n <img :src=\"p.image\" v-if=\"p.image\" />\n <img src=\"/images/blank.png\" v-else />\n </div>\n <div class=\"product-info\">\n <a :href=\"p.category.href\" class=\"product-category\">{{ p.category.name }}</a>\n <a :href=\"p.href\" class=\"product-title\">{{ p.name }}</a>\n </div>\n </div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.price') }}</div>\n <div v-html=\"$filters.price(p.price)\"></div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.quantity') }}</div>\n <div>{{ p.quantity }}</div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.sum') }}</div>\n <div v-html=\"$filters.price(p.quantity * p.price)\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"history-order-summary\">\n <div class=\"history-order-delivery-payment\" v-if=\"item.delivery && item.payment\">\n <div class=\"delivery-group\">\n <div>{{ __('shop.cart.shipment_info') }}</div>\n <div>\n {{ item.delivery }} <br />\n <span v-html=\"item.property.pickup_name ? item.property.pickup_name + '<br>' : ''\"></span>\n <span v-html=\"item.property.novaposhta_city ? item.property.novaposhta_city + '<br>' + item.property.novaposhta_warehouse + '<br>' : ''\"></span>\n <span v-html=\"addressName(item.property) + '<br>'\"></span>\n <span v-html=\"item.property.shipping_time ? item.property.shipping_time + '<br />' : ''\"></span>\n </div>\n </div>\n <div class=\"payment-group\">\n <div>{{ __('shop.cart.payment_info') }}</div>\n <div>{{ item.payment }}</div>\n </div>\n </div>\n <div class=\"history-order-total\">\n <div class=\"total-item products-amount\">\n {{ __('shop.cart.products') }}: <span>{{ item.positions.length }}</span>\n </div>\n <div class=\"total-item summ-regular\">{{ __('shop.cart.table.sum') }}: <span v-html=\"$filters.price(item.total)\"></span></div>\n <a @click=\"repeat\" class=\"repeat-checkout-btn\">{{ __('shop.cart.repeat') }}</a>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from 'vue';\nimport { useToast } from \"vue-toastification\";\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const toast = useToast();\n const item = props.item;\n const isOpen = ref(false);\n\n const toggle = () => {\n isOpen.value = !isOpen.value;\n };\n\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n };\n\n const addressName = (item) => {\n if (!item) {\n return '';\n }\n\n return (item.shipping_postcode ? item.shipping_postcode + ', ' : '') + (item.shipping_city ? item.shipping_city : '') + (item.shipping_street ? ', ' + item.shipping_street : '') + (item.shipping_house ? ' ' + item.shipping_house : '') + (item.shipping_building ? ', ' + __('shop.address.building') + ' ' + item.shipping_building : '') + (item.shipping_flat ? ', ' + __('shop.address.apartment') + ' ' + item.shipping_flat : '') + (item.shipping_floor ? ', ' + item.shipping_floor + __('shop.address.floor') : '');\n };\n\n const repeat = () => {\n $http\n .post($ziggy('account.forward.orders'), {\n action: 'repeat',\n id: item.id\n })\n .then((response) => {\n toast(__('shop.cart.repeated'), {\n type: 'success'\n });\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n })\n .catch(() => {\n toast(__('shop.cart.repeated_error'), {\n type: 'error'\n });\n });\n };\n\n return {\n item,\n isOpen,\n toggle,\n pluralize,\n addressName,\n repeat\n };\n }\n});\n</script>\n","<template>\n <div class=\"history-order\" v-bind:class=\"{ 'is-open': isOpen }\">\n <div class=\"history-order-head\" @click=\"toggle\">\n <div class=\"history-order-title\">\n №{{ item.id }} {{ __('shop.cart.bydate') }} {{ item.date }} <span>{{ pluralize(item.positions.length, __('shop.pluralize.products')) }} {{ __('shop.cart.bysum') }} <span v-html=\"$filters.price(item.total)\"></span></span>\n </div>\n <div class=\"history-order-status\" v-bind:style=\"'color:' + item.status.color\">{{ item.status.name }}</div>\n </div>\n <div class=\"history-order-body\">\n <table class=\"history-order-table\">\n <thead>\n <tr>\n <th>{{ __('shop.cart.table.product') }}</th>\n <th>{{ __('shop.cart.table.price') }}</th>\n <th>{{ __('shop.cart.table.quantity') }}</th>\n <th>{{ __('shop.cart.table.sum') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(p, key) in item.positions\" v-bind:key=\"key\">\n <td>\n <div class=\"product\">\n <div class=\"product-photo\">\n <img :src=\"p.image\" v-if=\"p.image\" />\n <img src=\"/images/blank.png\" v-else />\n </div>\n <div class=\"product-info\">\n <a :href=\"p.category.href\" class=\"product-category\">{{ p.category.name }}</a>\n <a :href=\"p.href\" class=\"product-title\">{{ p.name }}</a>\n </div>\n </div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.price') }}</div>\n <div v-html=\"$filters.price(p.price)\"></div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.quantity') }}</div>\n <div>{{ p.quantity }}</div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.sum') }}</div>\n <div v-html=\"$filters.price(p.quantity * p.price)\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"history-order-summary\">\n <div class=\"history-order-delivery-payment\" v-if=\"item.delivery && item.payment\">\n <div class=\"delivery-group\">\n <div>{{ __('shop.cart.shipment_info') }}</div>\n <div>\n {{ item.delivery }} <br />\n <span v-html=\"item.property.pickup_name ? item.property.pickup_name + '<br>' : ''\"></span>\n <span v-html=\"item.property.novaposhta_city ? item.property.novaposhta_city + '<br>' + item.property.novaposhta_warehouse + '<br>' : ''\"></span>\n <span v-html=\"addressName(item.property) + '<br>'\"></span>\n <span v-html=\"item.property.shipping_time ? item.property.shipping_time + '<br />' : ''\"></span>\n </div>\n </div>\n <div class=\"payment-group\">\n <div>{{ __('shop.cart.payment_info') }}</div>\n <div>{{ item.payment }}</div>\n </div>\n </div>\n <div class=\"history-order-total\">\n <div class=\"total-item products-amount\">\n {{ __('shop.cart.products') }}: <span>{{ item.positions.length }}</span>\n </div>\n <div class=\"total-item summ-regular\">{{ __('shop.cart.table.sum') }}: <span v-html=\"$filters.price(item.total)\"></span></div>\n <a @click=\"repeat\" class=\"repeat-checkout-btn\">{{ __('shop.cart.repeat') }}</a>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from 'vue';\nimport { useToast } from \"vue-toastification\";\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const toast = useToast();\n const item = props.item;\n const isOpen = ref(false);\n\n const toggle = () => {\n isOpen.value = !isOpen.value;\n };\n\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n };\n\n const addressName = (item) => {\n if (!item) {\n return '';\n }\n\n return (item.shipping_postcode ? item.shipping_postcode + ', ' : '') + (item.shipping_city ? item.shipping_city : '') + (item.shipping_street ? ', ' + item.shipping_street : '') + (item.shipping_house ? ' ' + item.shipping_house : '') + (item.shipping_building ? ', ' + __('shop.address.building') + ' ' + item.shipping_building : '') + (item.shipping_flat ? ', ' + __('shop.address.apartment') + ' ' + item.shipping_flat : '') + (item.shipping_floor ? ', ' + item.shipping_floor + __('shop.address.floor') : '');\n };\n\n const repeat = () => {\n $http\n .post($ziggy('account.forward.orders'), {\n action: 'repeat',\n id: item.id\n })\n .then((response) => {\n toast(__('shop.cart.repeated'), {\n type: 'success'\n });\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n })\n .catch(() => {\n toast(__('shop.cart.repeated_error'), {\n type: 'error'\n });\n });\n };\n\n return {\n item,\n isOpen,\n toggle,\n pluralize,\n addressName,\n repeat\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","item","Object","setup","store","useStore","toast","useToast","isOpen","ref","toggle","value","pluralize","count","words","Math","min","addressName","shipping_postcode","shipping_city","shipping_street","shipping_house","shipping_building","__","shipping_flat","shipping_floor","repeat","$http","post","$ziggy","action","id","then","response","type","dispatch","src","_createElementVNode","_createElementBlock","_ctx","onClick","_hoisted_1","date","positions","length","innerHTML","price","total","style","status","color","name","_hoisted_3","_hoisted_4","p","key","_hoisted_5","_hoisted_6","image","_hoisted_8","_hoisted_9","href","category","_hoisted_12","_hoisted_14","quantity","_hoisted_15","_hoisted_17","delivery","payment","_hoisted_18","_hoisted_19","_hoisted_20","property","pickup_name","novaposhta_city","novaposhta_warehouse","shipping_time","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28"],"mappings":"sFAgFeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAQC,aACRC,EAAQC,aACRN,EAAOD,EAAMC,KACbO,EAASC,OAAI,SA0CZ,CACHR,KAAAA,EACAO,OAAAA,EACAE,OA3CW,WACXF,EAAOG,OAASH,EAAOG,OA2CvBC,UAxCc,SAACC,EAAOC,UAGfD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKC,IAAIH,EAAQ,GAAI,MAsChGI,YAnCgB,SAAChB,UACZA,GAIGA,EAAKiB,kBAAoBjB,EAAKiB,kBAAoB,KAAO,KAAOjB,EAAKkB,cAAgBlB,EAAKkB,cAAgB,KAAOlB,EAAKmB,gBAAkB,KAAOnB,EAAKmB,gBAAkB,KAAOnB,EAAKoB,eAAiB,IAA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BAAIwB,KAAMP,EAAEQ,SAASD,WAAY,sCAAsBP,EAAEQ,SAASX,WAClEd,0BAAIwB,KAAMP,EAAEO,WAAY,mCAAmBP,EAAEH,iBAIzDd,gCACIA,2BAAA0B,oBAA2BxB,kCAC3BF,4BAAKQ,UAAQN,WAASO,MAAMQ,EAAER,oBAElCT,gCACIA,2BAAA2B,oBAA2BzB,qCAC3BF,kDAAQiB,EAAEW,eAEd5B,gCACIA,2BAAA6B,oBAA2B3B,gCAC3BF,4BAAKQ,UAAQN,WAASO,MAAMQ,EAAEW,SAAWX,EAAER,mCAK3DT,2BAAA8B,GACsD5B,OAAK6B,UAAY7B,OAAK8B,uBAAxE/B,2BAAAgC,GACIjC,2BAAAkC,GACIlC,kDAAQE,oCACRF,qEACOE,OAAK6B,iBAAYI,EACpBnC,6BAAMQ,UAAQN,OAAKkC,SAASC,YAAcnC,OAAKkC,SAASC,iCACxDrC,6BAAMQ,UAAQN,OAAKkC,SAASE,gBAAkBpC,OAAKkC,SAASE,uBAA2BpC,OAAKkC,SAASG,0CACrGvC,6BAAMQ,UAAQN,cAAYA,OAAKkC,4BAC/BpC,6BAAMQ,UAAQN,OAAKkC,SAASI,cAAgBtC,OAAKkC,SAASI,yCAGlExC,2BAAAyC,GACIzC,kDAAQE,mCACRF,kDAAQE,OAAK8B,iDAGrBhC,2BAAA0C,GACI1C,2BAAA2C,uCACOzC,4BAA2B,QAAEF,mDAASE,OAAKI,UAAUC,aAE5DP,2BAAA4C,uCAAwC1C,6BAA4B,QAAEF,qBAAiD,QAA3CQ,UAAQN,WAASO,MAAMP,OAAKQ,oBACxGV,0BAAIG,sCAAOD,8CAAc,yCAAyBA"}
1
+ {"version":3,"file":"OrderItem.js","sources":["../../../src/components/account/OrderItem.vue","../../../src/components/account/OrderItem.vue?vue&type=template&id=34dcd282&lang.js"],"sourcesContent":["<template>\n <div class=\"history-order\" v-bind:class=\"{ 'is-open': isOpen }\">\n <div class=\"history-order-head\" @click=\"toggle\">\n <div class=\"history-order-title\">\n №{{ item.id }} {{ __('shop.cart.bydate') }} {{ item.date }} <span>{{ pluralize(item.positions.length, __('shop.pluralize.products')) }} {{ __('shop.cart.bysum') }} <span v-html=\"$filters.price(item.total)\"></span></span>\n </div>\n <div class=\"history-order-status\" v-bind:style=\"'color:' + item.status.color\">{{ item.status.name }}</div>\n </div>\n <div class=\"history-order-body\">\n <table class=\"history-order-table\">\n <thead>\n <tr>\n <th>{{ __('shop.cart.table.product') }}</th>\n <th>{{ __('shop.cart.table.price') }}</th>\n <th>{{ __('shop.cart.table.quantity') }}</th>\n <th>{{ __('shop.cart.table.sum') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(p, key) in item.positions\" v-bind:key=\"key\">\n <td>\n <div class=\"product\">\n <div class=\"product-photo\">\n <img :src=\"p.image\" v-if=\"p.image\" />\n <img src=\"/images/blank.png\" :alt=\"p.name\" v-else />\n </div>\n <div class=\"product-info\">\n <a :href=\"p.category.href\" class=\"product-category\">{{ p.category.name }}</a>\n <a :href=\"p.href\" class=\"product-title\">{{ p.name }}</a>\n </div>\n </div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.price') }}</div>\n <div v-html=\"$filters.price(p.price)\"></div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.quantity') }}</div>\n <div>{{ p.quantity }}</div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.sum') }}</div>\n <div v-html=\"$filters.price(p.quantity * p.price)\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"history-order-summary\">\n <div class=\"history-order-delivery-payment\" v-if=\"item.delivery && item.payment\">\n <div class=\"delivery-group\">\n <div>{{ __('shop.cart.shipment_info') }}</div>\n <div>\n {{ item.delivery }} <br />\n <span v-html=\"item.property.pickup_name ? item.property.pickup_name + '<br>' : ''\"></span>\n <span v-html=\"item.property.novaposhta_city ? item.property.novaposhta_city + '<br>' + item.property.novaposhta_warehouse + '<br>' : ''\"></span>\n <span v-html=\"addressName(item.property) + '<br>'\"></span>\n <span v-html=\"item.property.shipping_time ? item.property.shipping_time + '<br />' : ''\"></span>\n </div>\n </div>\n <div class=\"payment-group\">\n <div>{{ __('shop.cart.payment_info') }}</div>\n <div>{{ item.payment }}</div>\n </div>\n </div>\n <div class=\"history-order-total\">\n <div class=\"total-item products-amount\">\n {{ __('shop.cart.products') }}: <span>{{ item.positions.length }}</span>\n </div>\n <div class=\"total-item summ-regular\">{{ __('shop.cart.table.sum') }}: <span v-html=\"$filters.price(item.total)\"></span></div>\n <a @click=\"repeat\" class=\"repeat-checkout-btn\">{{ __('shop.cart.repeat') }}</a>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from 'vue';\nimport { useToast } from \"vue-toastification\";\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const toast = useToast();\n const item = props.item;\n const isOpen = ref(false);\n\n const toggle = () => {\n isOpen.value = !isOpen.value;\n };\n\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n };\n\n const addressName = (item) => {\n if (!item) {\n return '';\n }\n\n return (item.shipping_postcode ? item.shipping_postcode + ', ' : '') + (item.shipping_city ? item.shipping_city : '') + (item.shipping_street ? ', ' + item.shipping_street : '') + (item.shipping_house ? ' ' + item.shipping_house : '') + (item.shipping_building ? ', ' + __('shop.address.building') + ' ' + item.shipping_building : '') + (item.shipping_flat ? ', ' + __('shop.address.apartment') + ' ' + item.shipping_flat : '') + (item.shipping_floor ? ', ' + item.shipping_floor + __('shop.address.floor') : '');\n };\n\n const repeat = () => {\n $http\n .post($ziggy('account.forward.orders'), {\n action: 'repeat',\n id: item.id\n })\n .then((response) => {\n toast(__('shop.cart.repeated'), {\n type: 'success'\n });\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n })\n .catch(() => {\n toast(__('shop.cart.repeated_error'), {\n type: 'error'\n });\n });\n };\n\n return {\n item,\n isOpen,\n toggle,\n pluralize,\n addressName,\n repeat\n };\n }\n});\n</script>\n","<template>\n <div class=\"history-order\" v-bind:class=\"{ 'is-open': isOpen }\">\n <div class=\"history-order-head\" @click=\"toggle\">\n <div class=\"history-order-title\">\n №{{ item.id }} {{ __('shop.cart.bydate') }} {{ item.date }} <span>{{ pluralize(item.positions.length, __('shop.pluralize.products')) }} {{ __('shop.cart.bysum') }} <span v-html=\"$filters.price(item.total)\"></span></span>\n </div>\n <div class=\"history-order-status\" v-bind:style=\"'color:' + item.status.color\">{{ item.status.name }}</div>\n </div>\n <div class=\"history-order-body\">\n <table class=\"history-order-table\">\n <thead>\n <tr>\n <th>{{ __('shop.cart.table.product') }}</th>\n <th>{{ __('shop.cart.table.price') }}</th>\n <th>{{ __('shop.cart.table.quantity') }}</th>\n <th>{{ __('shop.cart.table.sum') }}</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(p, key) in item.positions\" v-bind:key=\"key\">\n <td>\n <div class=\"product\">\n <div class=\"product-photo\">\n <img :src=\"p.image\" v-if=\"p.image\" />\n <img src=\"/images/blank.png\" :alt=\"p.name\" v-else />\n </div>\n <div class=\"product-info\">\n <a :href=\"p.category.href\" class=\"product-category\">{{ p.category.name }}</a>\n <a :href=\"p.href\" class=\"product-title\">{{ p.name }}</a>\n </div>\n </div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.price') }}</div>\n <div v-html=\"$filters.price(p.price)\"></div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.quantity') }}</div>\n <div>{{ p.quantity }}</div>\n </td>\n <td>\n <div class=\"cell-title\">{{ __('shop.cart.table.sum') }}</div>\n <div v-html=\"$filters.price(p.quantity * p.price)\"></div>\n </td>\n </tr>\n </tbody>\n </table>\n <div class=\"history-order-summary\">\n <div class=\"history-order-delivery-payment\" v-if=\"item.delivery && item.payment\">\n <div class=\"delivery-group\">\n <div>{{ __('shop.cart.shipment_info') }}</div>\n <div>\n {{ item.delivery }} <br />\n <span v-html=\"item.property.pickup_name ? item.property.pickup_name + '<br>' : ''\"></span>\n <span v-html=\"item.property.novaposhta_city ? item.property.novaposhta_city + '<br>' + item.property.novaposhta_warehouse + '<br>' : ''\"></span>\n <span v-html=\"addressName(item.property) + '<br>'\"></span>\n <span v-html=\"item.property.shipping_time ? item.property.shipping_time + '<br />' : ''\"></span>\n </div>\n </div>\n <div class=\"payment-group\">\n <div>{{ __('shop.cart.payment_info') }}</div>\n <div>{{ item.payment }}</div>\n </div>\n </div>\n <div class=\"history-order-total\">\n <div class=\"total-item products-amount\">\n {{ __('shop.cart.products') }}: <span>{{ item.positions.length }}</span>\n </div>\n <div class=\"total-item summ-regular\">{{ __('shop.cart.table.sum') }}: <span v-html=\"$filters.price(item.total)\"></span></div>\n <a @click=\"repeat\" class=\"repeat-checkout-btn\">{{ __('shop.cart.repeat') }}</a>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from 'vue';\nimport { useToast } from \"vue-toastification\";\nimport { useStore } from 'vuex';\n\nexport default defineComponent({\n props: {\n item: Object\n },\n setup(props) {\n const store = useStore();\n const toast = useToast();\n const item = props.item;\n const isOpen = ref(false);\n\n const toggle = () => {\n isOpen.value = !isOpen.value;\n };\n\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n };\n\n const addressName = (item) => {\n if (!item) {\n return '';\n }\n\n return (item.shipping_postcode ? item.shipping_postcode + ', ' : '') + (item.shipping_city ? item.shipping_city : '') + (item.shipping_street ? ', ' + item.shipping_street : '') + (item.shipping_house ? ' ' + item.shipping_house : '') + (item.shipping_building ? ', ' + __('shop.address.building') + ' ' + item.shipping_building : '') + (item.shipping_flat ? ', ' + __('shop.address.apartment') + ' ' + item.shipping_flat : '') + (item.shipping_floor ? ', ' + item.shipping_floor + __('shop.address.floor') : '');\n };\n\n const repeat = () => {\n $http\n .post($ziggy('account.forward.orders'), {\n action: 'repeat',\n id: item.id\n })\n .then((response) => {\n toast(__('shop.cart.repeated'), {\n type: 'success'\n });\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n })\n .catch(() => {\n toast(__('shop.cart.repeated_error'), {\n type: 'error'\n });\n });\n };\n\n return {\n item,\n isOpen,\n toggle,\n pluralize,\n addressName,\n repeat\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","item","Object","setup","store","useStore","toast","useToast","isOpen","ref","toggle","value","pluralize","count","words","Math","min","addressName","shipping_postcode","shipping_city","shipping_street","shipping_house","shipping_building","__","shipping_flat","shipping_floor","repeat","$http","post","$ziggy","action","id","then","response","type","dispatch","_createElementVNode","_createElementBlock","_ctx","onClick","_hoisted_1","date","positions","length","innerHTML","price","total","style","status","color","name","_hoisted_3","_hoisted_4","p","key","_hoisted_5","_hoisted_6","image","src","alt","_hoisted_9","href","category","_hoisted_12","_hoisted_14","quantity","_hoisted_15","_hoisted_17","delivery","payment","_hoisted_18","_hoisted_19","_hoisted_20","property","pickup_name","novaposhta_city","novaposhta_warehouse","shipping_time","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28"],"mappings":"sFAgFeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAQC,aACRC,EAAQC,aACRN,EAAOD,EAAMC,KACbO,EAASC,OAAI,SA0CZ,CACHR,KAAAA,EACAO,OAAAA,EACAE,OA3CW,WACXF,EAAOG,OAASH,EAAOG,OA2CvBC,UAxCc,SAACC,EAAOC,UAGfD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKC,IAAIH,EAAQ,GAAI,MAsChGI,YAnCgB,SAAChB,UACZA,GAIGA,EAA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"use strict";var e=require("vue"),r=require("vuex"),t=require("formvuelate"),a=require("vue-toastification"),o=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/api"),i=require("@perevorot/shop/dist/helpers");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(o);function s(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,o,n=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(n.push(a.value),!r||n.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return n}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}var m={name:"user",components:{SchemaForm:t.SchemaFormFactory([u.default({})])},props:{mode:{type:String,default:"registration"}},setup:function(o){var l=r.useStore(),u=e.ref(!1),c=e.ref(!0),m=e.ref({}),d=e.ref({}),f=e.ref({}),v=e.ref({}),p=a.useToast(),h=e.ref(0);t.useSchemaForm(v);return n.auth.registerForm().then((function(e){var r=i.formParse(e.data);"confirm"==o.mode&&(r.schema.email.hidden=!0,r.schema.password.hidden=!0),d.value=r.schema,v.value=Object.assign({},r.model,e.data.model),f.value=r.validation})).finally((function(){c.value=!1})),{loading:u,loadingForm:c,errors:m,schema:d,validation:f,onSubmit:function(){u.value=!0,l.dispatch("auth/update",{credentials:v.value,finally:function(){u.value=!1},callback:function(){p(__("auth."+o.mode+".form.saved"),{type:"success"}),l.commit("auth/modal",null),l.dispatch("auth/me")},catch:function(e){if(e.response&&e.response.data&&e.response.data.errors)for(var r=0,t=Object.entries(e.response.data.errors);r<t.length;r++){var a=s(t[r],2),o=a[0],n=a[1];n[0]&&(m.value[o]=n[0])}else console.error(e);h.value++}})},model:v,key:h}}},d={class:"field"},f={class:"columns is-vcentered"},v={class:"column"};m.render=function(r,t,a,o,n,i){var l=e.resolveComponent("SchemaForm");return o.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.model.user_type?"is-user-type-"+o.model.user_type.replaceAll("_","-"):null)},[(e.openBlock(),e.createBlock(l,{schemaRowClasses:"field",schema:o.schema,"validation-schema":o.validation,"initial-errors":o.errors,key:o.key,onSubmit:o.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",d,[e.createElementVNode("div",f,[e.createElementVNode("div",v,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":o.loading}]),type:"submit"},e.toDisplayString(r.__("auth."+a.mode+".form.save")),3)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],2))},module.exports=m;
1
+ "use strict";var e=require("vue"),r=require("vuex"),t=require("formvuelate"),a=require("vue-toastification"),n=require("@formvuelate/plugin-vee-validate"),o=require("@perevorot/shop/dist/api"),i=require("@perevorot/shop/dist/helpers");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(n);function s(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,n,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(o.push(a.value),!r||o.length!==r);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw n}}return o}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}var m={name:"user",components:{SchemaForm:t.SchemaFormFactory([u.default({})])},props:{mode:{type:String,default:"registration"}},setup:function(n){var l=r.useStore(),u=e.ref(!1),c=e.ref(!0),m=e.ref({}),d=e.ref({}),f=e.ref({}),v=e.ref({}),h=a.useToast(),p=e.ref(0);t.useSchemaForm(v);return o.auth.registerForm().then((function(e){var r=i.formParse(e.data);"confirm"==n.mode&&(r.schema.email.hidden=!0,r.schema.password.hidden=!0),d.value=r.schema,v.value=Object.assign({},r.model,e.data.model),f.value=r.validation})).finally((function(){c.value=!1})),{loading:u,loadingForm:c,errors:m,schema:d,validation:f,onSubmit:function(){u.value=!0,l.dispatch("auth/update",{credentials:v.value,finally:function(){u.value=!1},callback:function(){h(__("auth."+n.mode+".form.saved"),{type:"success"}),l.commit("auth/modal",null),l.dispatch("auth/me")},catch:function(e){if(e.response&&e.response.data&&e.response.data.errors)for(var r=0,t=Object.entries(e.response.data.errors);r<t.length;r++){var a=s(t[r],2),n=a[0],o=a[1];o[0]&&(m.value[n]=o[0])}else console.error(e);p.value++}})},model:v,key:p}}},d={class:"field"},f={class:"columns is-vcentered"},v={class:"column"};m.render=function(r,t,a,n,o,i){var l=e.resolveComponent("SchemaForm");return n.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.model.user_type?"is-user-type-"+n.model.user_type.replaceAll("_","-"):null)},[e.createVNode(l,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",d,[e.createElementVNode("div",f,[e.createElementVNode("div",v,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(r.__("auth."+a.mode+".form.save")),3)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],2))},module.exports=m;
2
2
  //# sourceMappingURL=User.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"User.js","sources":["../../../src/components/account/User.vue","../../../src/components/account/User.vue?vue&type=template&id=4578454c&lang.js"],"sourcesContent":["<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>","<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","mode","type","String","setup","store","useStore","loading","ref","loadingForm","errors","schema","validation","model","toast","useToast","key","useSchemaForm","api","registerForm","then","response","form","formParse","data","email","hidden","password","value","onSubmit","dispatch","credentials","callback","__","commit","error","Object","entries","field","messages","console","$setup","_createElementBlock","user_type","replaceAll","_createBlock","schemaRowClasses","afterForm","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_ctx","$props"],"mappings":"8wCA2BA,MAEe,CACXA,KAAM,OACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,KAAM,CAC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A,SAASzB,IAAKyB,MAAMZ,SAAQY,aACpHM,qBACP,kBAAAC,2BAAAC,GACID,2BAAAE,GACIF,2BAAAG,GACIH,uDAAc,+BAA6DP,aAA5CvC,KAAK,4BAC7BkD,aAAaC"}
1
+ {"version":3,"file":"User.js","sources":["../../../src/components/account/User.vue","../../../src/components/account/User.vue?vue&type=template&id=4578454c&lang.js"],"sourcesContent":["<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>","<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","mode","type","String","setup","store","useStore","loading","ref","loadingForm","errors","schema","validation","model","toast","useToast","key","useSchemaForm","api","registerForm","then","response","form","formParse","data","email","hidden","password","value","onSubmit","dispatch","credentials","callback","__","commit","error","Object","entries","field","messages","console","$setup","_createElementBlock","user_type","replaceAll","_createVNode","schemaRowClasses","afterForm","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_ctx","$props"],"mappings":"8wCA2BA,MAEe,CACXA,KAAM,OACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,iBAGjBC,eAAMJ,OACIK,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAcD,OAAI,GAClBE,EAASF,MAAI,IACbG,EAASH,MAAI,IACbI,EAAaJ,MAAI,IACjBK,EAAQL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,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),a=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),o=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var s=l(n),u=l(r),c=i(o);e.markRaw(u.default);var d={name:"forget",components:{SchemaForm:a.SchemaFormFactory([s.default({})])},props:{email:{type:String,default:""},emailOrPhone:{type:String,default:""},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},setup:function(n){var r=e.ref(!1),o=t.useStore(),l=e.ref(0),i=e.ref(""),s=e.ref(""),d=e.ref(!1),m=e.ref({}),v=e.ref({}),f=e.ref(!1),p=e.ref(""),g=e.ref(""),h=e.ref(""),y=e.ref("");e.getCurrentInstance();var N={email:{component:u.default,label:__("auth.login.form.email"),placeholder:n.showPlaceholders?__("auth.login.form.email"):""},emailOrPhone:{component:u.default,label:__("auth.login.form.emailOrPhone"),placeholder:n.showPlaceholders?__("auth.login.form.emailOrPhone"):""}},_={email:c.string().email(__("auth.validation.email")).required(__("auth.validation.required")),emailOrPhone:c.string().required(__("auth.validation.required")).test("test-name",__("auth.validation.emailOrPhone"),(function(e){var t=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e),a=/^(?:\+38)?(?:\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/.test(e);return!(!t&&!a)}))};m.value[n.forgetType]=N[n.forgetType],v.value[n.forgetType]=n[n.forgetType];var b={};b[n.forgetType]=_[n.forgetType];var E=c.object().shape(b);a.useSchemaForm(v);var V=e.inject("presetedResetToken"),k=e.inject("presetedResetEmail");return{loading:r,key:l,schema:m,validation:E,remembered:function(){o.commit("auth/modal","login")},onSubmit:function(){r.value=!0,i.value="",s.value="",o.dispatch("auth/reset",{credentials:v.value,callback:function(e,t,a){t?s.value=e:(i.value=e,f.value="phone"==(null==a?void 0:a.credentials))},finally:function(){v.value={},r.value=!1,d.value=!0,l.value++}})},again:function(){d.value=!1},sent:d,message:i,error:s,close:function(){o.commit("auth/modal",null)},sms:f,code1:p,code2:g,code3:h,code4:y,codeKeyUp:function(e){var t=e.target.nextElementSibling,a=e.target.previousElementSibling,n=t&&"INPUT"===t.tagName,r=a&&"INPUT"===a.tagName;e.keyCode>=48&&e.keyCode<=57&&(s.value="",n&&t.focus()),8===e.keyCode&&(s.value="",""===e.target.value&&r&&a.focus())},codePaste:function(e){e.preventDefault();var t=e.clipboardData.getData("Text");4==t.length&&(isNaN(t[0])||isNaN(t[1])||isNaN(t[2])||isNaN(t[3])||(p.value=t[0],g.value=t[1],h.value=t[2],y.value=t[3],s.value=""))},more:function(){f.value=!1,p.value="",g.value="",h.value="",y.value="",i.value="",d.value=!1},smsReset:function(){""===p.value||""===g.value||""===h.value||""===y.value?s.value=__("auth.validation.required"):(r.value=!0,s.value="",o.dispatch("auth/resetSms",{credentials:{code:String(p.value)+String(g.value)+String(h.value)+String(y.value)},callback:function(e,t){t?s.value=e.message:(p.value="",g.value="",h.value="",y.value="",V.value=e.token,k.value=e.email,o.commit("auth/modal","reset"))},finally:function(){r.value=!1,l.value++}}))}}}},m={class:"form auth-forget"},v={class:"title"},f={class:"field"},p={class:"columns is-vcentered"},g={class:"column"},h={class:"mt-2"},y={class:"forget-thanks-mesage"},N=["innerHTML"],_={class:"mt-2 close-button"},b={class:"forget-thanks-mesage schema-col"},E=["innerHTML"],V={class:"sms-code"},k={class:"control"},S=["innerHTML"],T={class:"actions-wrapper"},P={class:"forget-error-mesage"},w=["innerHTML"],D={class:"mt-2"};d.render=function(t,a,n,r,o,l){var i=e.resolveComponent("SchemaForm"),s=e.resolveDirective("maska");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.forget.title")),1),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:r.schema,"validation-schema":r.validation,key:r.key,onSubmit:r.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",f,[e.createElementVNode("div",p,[e.createElementVNode("div",g,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":r.loading}]),type:"submit"},e.toDisplayString(t.__("auth.forget.form.submit")),3)])])])]})),_:1},8,["schema","validation-schema","onSubmit"])),e.createElementVNode("div",h,[e.createElementVNode("a",{onClick:a[0]||(a[0]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,!r.sent]]),e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,N),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:a[1]||(a[1]=function(){return r.close&&r.close.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.close")),1)])],512),[[e.vShow,r.sent&&r.message&&!r.sms]]),e.withDirectives(e.createElementVNode("div",b,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,E),e.createElementVNode("div",V,[e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code1}]),"onUpdate:modelValue":a[2]||(a[2]=function(e){return r.code1=e}),onKeyup:a[3]||(a[3]=function(e){return r.codeKeyUp(e)}),onPaste:a[4]||(a[4]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code1],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code2}]),"onUpdate:modelValue":a[5]||(a[5]=function(e){return r.code2=e}),onKeyup:a[6]||(a[6]=function(e){return r.codeKeyUp(e)}),onPaste:a[7]||(a[7]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code2],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code3}]),"onUpdate:modelValue":a[8]||(a[8]=function(e){return r.code3=e}),onKeyup:a[9]||(a[9]=function(e){return r.codeKeyUp(e)}),onPaste:a[10]||(a[10]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code3],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code4}]),"onUpdate:modelValue":a[11]||(a[11]=function(e){return r.code4=e}),onKeyup:a[12]||(a[12]=function(e){return r.codeKeyUp(e)}),onPaste:a[13]||(a[13]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code4],[s,"#"]])]),r.error?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:r.error},null,8,S)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",T,[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-loading":r.loading}]),onClick:a[14]||(a[14]=function(){return r.smsReset&&r.smsReset.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_reset_password")),3),e.createElementVNode("button",{class:"button",onClick:a[15]||(a[15]=function(){return r.more&&r.more.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_more")),1),e.createElementVNode("button",{class:"button",onClick:a[16]||(a[16]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,r.sent&&r.message&&r.sms]]),e.withDirectives(e.createElementVNode("div",P,[e.createElementVNode("div",{class:"message",innerHTML:r.error},null,8,w),e.createElementVNode("div",D,[e.createElementVNode("a",{onClick:a[17]||(a[17]=function(){return r.again&&r.again.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.send")),1)])],512),[[e.vShow,r.sent&&r.error&&!r.sms]])])},module.exports=d;
1
+ "use strict";var e=require("vue"),t=require("vuex"),a=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),o=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var s=l(n),u=l(r),c=i(o);e.markRaw(u.default);var d={name:"forget",components:{SchemaForm:a.SchemaFormFactory([s.default({})])},props:{email:{type:String,default:""},emailOrPhone:{type:String,default:""},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},setup:function(n){var r=e.ref(!1),o=t.useStore(),l=e.ref(0),i=e.ref(""),s=e.ref(""),d=e.ref(!1),m=e.ref({}),v=e.ref({}),f=e.ref(!1),p=e.ref(""),g=e.ref(""),h=e.ref(""),y=e.ref("");e.getCurrentInstance();var N={email:{component:u.default,label:__("auth.login.form.email"),placeholder:n.showPlaceholders?__("auth.login.form.email"):""},emailOrPhone:{component:u.default,label:__("auth.login.form.emailOrPhone"),placeholder:n.showPlaceholders?__("auth.login.form.emailOrPhone"):""}},_={email:c.string().email(__("auth.validation.email")).required(__("auth.validation.required")),emailOrPhone:c.string().required(__("auth.validation.required")).test("test-name",__("auth.validation.emailOrPhone"),(function(e){var t=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e),a=/^(?:\+38)?(?:\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/.test(e);return!(!t&&!a)}))};m.value[n.forgetType]=N[n.forgetType],v.value[n.forgetType]=n[n.forgetType];var b={};b[n.forgetType]=_[n.forgetType];var E=c.object().shape(b);a.useSchemaForm(v);var V=e.inject("presetedResetToken"),S=e.inject("presetedResetEmail");return{loading:r,key:l,schema:m,validation:E,remembered:function(){o.commit("auth/modal","login")},onSubmit:function(){r.value=!0,i.value="",s.value="",o.dispatch("auth/reset",{credentials:v.value,callback:function(e,t,a){t?s.value=e:(i.value=e,f.value="phone"==(null==a?void 0:a.credentials))},finally:function(){v.value={},r.value=!1,d.value=!0,l.value++}})},again:function(){d.value=!1},sent:d,message:i,error:s,close:function(){o.commit("auth/modal",null)},sms:f,code1:p,code2:g,code3:h,code4:y,codeKeyUp:function(e){var t=e.target.nextElementSibling,a=e.target.previousElementSibling,n=t&&"INPUT"===t.tagName,r=a&&"INPUT"===a.tagName;e.keyCode>=48&&e.keyCode<=57&&(s.value="",n&&t.focus()),8===e.keyCode&&(s.value="",""===e.target.value&&r&&a.focus())},codePaste:function(e){e.preventDefault();var t=e.clipboardData.getData("Text");4==t.length&&(isNaN(t[0])||isNaN(t[1])||isNaN(t[2])||isNaN(t[3])||(p.value=t[0],g.value=t[1],h.value=t[2],y.value=t[3],s.value=""))},more:function(){f.value=!1,p.value="",g.value="",h.value="",y.value="",i.value="",d.value=!1},smsReset:function(){""===p.value||""===g.value||""===h.value||""===y.value?s.value=__("auth.validation.required"):(r.value=!0,s.value="",o.dispatch("auth/resetSms",{credentials:{code:String(p.value)+String(g.value)+String(h.value)+String(y.value)},callback:function(e,t){t?s.value=e.message:(p.value="",g.value="",h.value="",y.value="",V.value=e.token,S.value=e.email,o.commit("auth/modal","reset"))},finally:function(){r.value=!1,l.value++}}))}}}},m={class:"form auth-forget"},v={class:"title"},f={class:"field"},p={class:"columns is-vcentered"},g={class:"column"},h={class:"mt-2"},y={class:"forget-thanks-mesage"},N=["innerHTML"],_={class:"mt-2 close-button"},b={class:"forget-thanks-mesage schema-col"},E=["innerHTML"],V={class:"sms-code"},S={class:"control"},k=["innerHTML"],T={class:"actions-wrapper"},P={class:"forget-error-mesage"},w=["innerHTML"],D={class:"mt-2"};d.render=function(t,a,n,r,o,l){var i=e.resolveComponent("SchemaForm"),s=e.resolveDirective("maska");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.forget.title")),1),e.withDirectives(e.createElementVNode("div",null,[e.createVNode(i,{schemaRowClasses:"field",schema:r.schema,"validation-schema":r.validation,key:r.key,onSubmit:r.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",f,[e.createElementVNode("div",p,[e.createElementVNode("div",g,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":r.loading}]),type:"submit"},e.toDisplayString(t.__("auth.forget.form.submit")),3)])])])]})),_:1},8,["schema","validation-schema","onSubmit"]),e.createElementVNode("div",h,[e.createElementVNode("a",{onClick:a[0]||(a[0]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,!r.sent]]),e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,N),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:a[1]||(a[1]=function(){return r.close&&r.close.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.close")),1)])],512),[[e.vShow,r.sent&&r.message&&!r.sms]]),e.withDirectives(e.createElementVNode("div",b,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,E),e.createElementVNode("div",V,[e.createElementVNode("div",S,[e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code1}]),"onUpdate:modelValue":a[2]||(a[2]=function(e){return r.code1=e}),onKeyup:a[3]||(a[3]=function(e){return r.codeKeyUp(e)}),onPaste:a[4]||(a[4]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code1],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code2}]),"onUpdate:modelValue":a[5]||(a[5]=function(e){return r.code2=e}),onKeyup:a[6]||(a[6]=function(e){return r.codeKeyUp(e)}),onPaste:a[7]||(a[7]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code2],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code3}]),"onUpdate:modelValue":a[8]||(a[8]=function(e){return r.code3=e}),onKeyup:a[9]||(a[9]=function(e){return r.codeKeyUp(e)}),onPaste:a[10]||(a[10]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code3],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code4}]),"onUpdate:modelValue":a[11]||(a[11]=function(e){return r.code4=e}),onKeyup:a[12]||(a[12]=function(e){return r.codeKeyUp(e)}),onPaste:a[13]||(a[13]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code4],[s,"#"]])]),r.error?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:r.error},null,8,k)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",T,[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-loading":r.loading}]),onClick:a[14]||(a[14]=function(){return r.smsReset&&r.smsReset.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_reset_password")),3),e.createElementVNode("button",{class:"button",onClick:a[15]||(a[15]=function(){return r.more&&r.more.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_more")),1),e.createElementVNode("button",{class:"button",onClick:a[16]||(a[16]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,r.sent&&r.message&&r.sms]]),e.withDirectives(e.createElementVNode("div",P,[e.createElementVNode("div",{class:"message",innerHTML:r.error},null,8,w),e.createElementVNode("div",D,[e.createElementVNode("a",{onClick:a[17]||(a[17]=function(){return r.again&&r.again.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.send")),1)])],512),[[e.vShow,r.sent&&r.error&&!r.sms]])])},module.exports=d;
2
2
  //# sourceMappingURL=Forget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Forget.js","sources":["../../../src/components/auth/Forget.vue","../../../src/components/auth/Forget.vue?vue&type=template&id=01249924&lang.js"],"sourcesContent":["<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>","<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>"],"names":["markRaw","FormText","name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","email","type","String","emailOrPhone","forgetType","showPlaceholders","Boolean","setup","loading","ref","store","useStore","key","message","error","sent","schema","model","sms","code1","code2","code3","code4","getCurrentInstance","s","component","label","__","placeholder","yupValidations","yup","string","required","test","value","isValidEmail","isValidPhone","currentYupValidation","validation","object","shape","useSchemaForm","presetedResetToken","inject","presetedResetEmail","remembered","commit","onSubmit","dispatch","credentials","callback","m","isError","response","again","close","codeKeyUp","e","nextElement","target","nextElementSibling","prevElement","previousElementSibling","isNextElementIsInput","tagName","isPrevElementIsInput","keyCode","focus","codePaste","preventDefault","clipboardData","getData","length","isNaN","more","smsReset","code","token","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_7","innerHTML","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_13","onKeyup","$event","onPaste","_hoisted_15","_hoisted_16","_hoisted_18"],"mappings":"6jBA4DAA,UAAQC,WAER,MAEe,CACXC,KAAM,SACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,MAAO,CACHC,KAAMC,eACG,IAEbC,aAAc,CACVF,KAAMC,eACG,IAEbE,WAAY,CACRH,KAAMC,eACG,SAEbG,iBAAkB,CACdJ,KAAMK,iBACG,IAGjBC,eAAMR,OACIS,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,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hB,2BAAAiB,oBACIjB,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,uCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,uCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,kEAAlDA,YAAmEa,yCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,SAEfA,uBAA/CP,sCAAS,iBAAiBe,UAAQR,sDAEtCL,2BAAAqB,GACIrB,uDAAc,uBAAuCK,aAAYM,wCAAON,+DAAaH,2CACrFF,qCAAc,SAAUW,wCAAON,uDAASH,iCACxCF,qCAAc,SAAUW,wCAAON,mEAAeH,qDAdzCG,QAAQA,WAAWA,0BAiBhCL,2BAAAsB,GACItB,kCAAW,UAAUa,UAAQR,mBAC7BL,2BAAAuB,GACIvB,0BAAIW,wCAAON,yDAAUH,+CAHhBG,QAAQA,UAAUA"}
1
+ {"version":3,"file":"Forget.js","sources":["../../../src/components/auth/Forget.vue","../../../src/components/auth/Forget.vue?vue&type=template&id=01249924&lang.js"],"sourcesContent":["<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>","<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>"],"names":["markRaw","FormText","name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","email","type","String","emailOrPhone","forgetType","showPlaceholders","Boolean","setup","loading","ref","store","useStore","key","message","error","sent","schema","model","sms","code1","code2","code3","code4","getCurrentInstance","s","component","label","__","placeholder","yupValidations","yup","string","required","test","value","isValidEmail","isValidPhone","currentYupValidation","validation","object","shape","useSchemaForm","presetedResetToken","inject","presetedResetEmail","remembered","commit","onSubmit","dispatch","credentials","callback","m","isError","response","again","close","codeKeyUp","e","nextElement","target","nextElementSibling","prevElement","previousElementSibling","isNextElementIsInput","tagName","isPrevElementIsInput","keyCode","focus","codePaste","preventDefault","clipboardData","getData","length","isNaN","more","smsReset","code","token","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_ctx","_createVNode","schemaRowClasses","$setup","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_7","innerHTML","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_13","onKeyup","$event","onPaste","_hoisted_15","_hoisted_16","_hoisted_18"],"mappings":"6jBA4DAA,UAAQC,WAER,MAEe,CACXC,KAAM,SACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,MAAO,CACHC,KAAMC,eACG,IAEbC,aAAc,CACVF,KAAMC,eACG,IAEbE,WAAY,CACRH,KAAMC,eACG,SAEbG,iBAAkB,CACdJ,KAAMK,iBACG,IAGjBC,eAAMR,OACIS,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAAUJ,MAAI,IACdK,EAAQL,MAAI,IACZM,EAAON,OAAI,GACXO,EAASP,MAAI,IACbQ,EAAQR,MAAI,IACZS,EAAMT,OAAI,GACVU,EAAQV,MAAI,IACZW,EAAQX,MAAI,IACZY,EAAQZ,MAAI,IACZa,EAAQb,MAAI,IACDc,2BAEXC,EAAI,CACNxB,MAAO,CACHyB,UAAWhC,UACXiC,MAAOC,GAAG,yBACVC,YAAa7B,EAAMM,iBAAmBsB,GAAG,yBAA2B,IAExExB,aAAc,CACVsB,UAAWhC,UACXiC,MAAOC,GAAG,gCACVC,YAAa7B,EAAMM,iBAAmBsB,GAAG,gCAAkC,KAI7EE,EAAiB,CACnB7B,MAAO8B,EAAIC,SAAS/B,MAAM2B,GAAG,0BAA0BK,SAASL,GAAG,6BACnExB,aAAc2B,EACTC,SACAC,SAASL,GAAG,6BACZM,KAAK,YAAaN,GAAG,iCAAiC,SAAUO,OAIzDC,EAHe,kEAGWF,KAAKC,GAC/BE,EAHe,uTAGWH,KAAKC,YAE9BC,IAAiBC,OAQlCpB,EAAOkB,MAAMnC,EAAMK,YAAcoB,EAAEzB,EAAMK,YACzCa,EAAMiB,MAAMnC,EAAMK,YAAcL,EAAMA,EAAMK,gBAExCiC,EAAuB,GAC3BA,EAAqBtC,EAAMK,Y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}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),o=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),n=require("@perevorot/shop/dist/forms/FormPassword"),l=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var s=i(r),u=i(a),d=i(n),m=c(l);function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,a,n=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}e.markRaw(u.default);var h=o.SchemaFormFactory([s.default({})]),v={props:f({loginCallback:{type:Function,default:function(){}},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},"showPlaceholders",{type:Boolean,default:!1}),name:"login",components:{SchemaForm:h},setup:function(r){var a,n=e.ref(!1),l=t.useStore(),i=e.ref(0),c=e.ref({}),s=e.computed((function(){return l.getters["auth/modal"]})),p=e.ref({email:{component:u.default,label:__("auth.login.form.email"),store:"login",model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""},password:{component:d.default,label:__("auth.login.form.password"),placeholder:r.showPlaceholders?__("auth.login.form.password"):""}}),h=m.object().shape({email:m.string().email(__("auth.validation.email")).required(__("auth.validation.required")),password:m.string().required(__("auth.validation.required"))}),v=e.ref({email:"",password:""});o.useSchemaForm(v);return f(a={loading:n,modal:s,schema:p,validation:h,reset:function(){l.commit("auth/modal","forget")},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})}},"schema",p),f(a,"onSubmit",(function(){n.value=!0,l.dispatch("auth/login",{credentials:v.value,callback:function(e){if(r.loginCallback&&r.loginCallback(),window.authUserLoginCallback&&window.authUserLoginCallback(),e.data&&e.data.user&&!e.data.user.is_login_tracked){var t={event:"login",user_id:e.data.user.id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}},finally:function(){n.value=!1},catch:function(e){if(e.response.data&&e.response.data.errors){for(var t=0,o=Object.entries(e.response.data.errors);t<o.length;t++){var r=g(o[t],2),a=r[0],n=r[1];n[0]&&(c.value[a]=n[0])}v.value.password="",i.value++}}})})),f(a,"errors",c),f(a,"key",i),f(a,"model",v),f(a,"register",(function(){l.commit("auth/modal","registration")})),a}},b={class:"auth-login"},y={class:"title"},w={class:"href-forget-password"},k={class:"field"},_={class:"socials"},E={class:"description has-text-centered"},S={class:"buttons"},N=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],V=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],C={class:"href-register"};v.render=function(t,o,r,a,n,l){var i=e.resolveComponent("SchemaForm"),c=e.resolveComponent("forget");return e.openBlock(),e.createElementBlock("div",b,[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",y,e.toDisplayString(t.__("auth.login.title")),1),(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",w,[e.createElementVNode("a",{onClick:o[0]||(o[0]=function(){return a.reset&&a.reset.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.forget_password")),1)]),e.createElementVNode("div",k,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.login.form.submit")),3)]),e.createElementVNode("div",_,[e.createElementVNode("div",E,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",S,[e.createElementVNode("a",{class:"button",onClick:o[1]||(o[1]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},N),e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return a.google&&a.google.apply(a,arguments)})},V)])]),e.createElementVNode("div",C,[e.createElementVNode("a",{onClick:o[3]||(o[3]=function(){return a.register&&a.register.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.signup")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,"login"==a.modal]]),"forget"==a.modal?(e.openBlock(),e.createBlock(c,{key:0,email:a.model.email,"forget-type":r.forgetType,"show-placeholders":r.showPlaceholders},null,8,["email","forget-type","show-placeholders"])):e.createCommentVNode("v-if",!0)])},module.exports=v;
1
+ "use strict";var e=require("vue"),t=require("vuex"),o=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),n=require("@perevorot/shop/dist/forms/FormPassword"),l=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var s=i(r),u=i(a),d=i(n),m=c(l);function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,a,n=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}e.markRaw(u.default);var h=o.SchemaFormFactory([s.default({})]),v={props:f({loginCallback:{type:Function,default:function(){}},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},"showPlaceholders",{type:Boolean,default:!1}),name:"login",components:{SchemaForm:h},setup:function(r){var a,n=e.ref(!1),l=t.useStore(),i=e.ref(0),c=e.ref({}),s=e.computed((function(){return l.getters["auth/modal"]})),p=e.ref({email:{component:u.default,label:__("auth.login.form.email"),store:"login",model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""},password:{component:d.default,label:__("auth.login.form.password"),placeholder:r.showPlaceholders?__("auth.login.form.password"):""}}),h=m.object().shape({email:m.string().email(__("auth.validation.email")).required(__("auth.validation.required")),password:m.string().required(__("auth.validation.required"))}),v=e.ref({email:"",password:""});o.useSchemaForm(v);return f(a={loading:n,modal:s,schema:p,validation:h,reset:function(){l.commit("auth/modal","forget")},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})}},"schema",p),f(a,"onSubmit",(function(){n.value=!0,l.dispatch("auth/login",{credentials:v.value,callback:function(e){if(r.loginCallback&&r.loginCallback(),window.authUserLoginCallback&&window.authUserLoginCallback(),e.data&&e.data.user&&!e.data.user.is_login_tracked){var t={event:"login",user_id:e.data.user.id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}},finally:function(){n.value=!1},catch:function(e){if(e.response.data&&e.response.data.errors){for(var t=0,o=Object.entries(e.response.data.errors);t<o.length;t++){var r=g(o[t],2),a=r[0],n=r[1];n[0]&&(c.value[a]=n[0])}v.value.password="",i.value++}}})})),f(a,"errors",c),f(a,"key",i),f(a,"model",v),f(a,"register",(function(){l.commit("auth/modal","registration")})),a}},b={class:"auth-login"},y={class:"title"},w={class:"href-forget-password"},_={class:"field"},k={class:"socials"},E={class:"description has-text-centered"},N={class:"buttons"},S=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],V=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],C={class:"href-register"};v.render=function(t,o,r,a,n,l){var i=e.resolveComponent("SchemaForm"),c=e.resolveComponent("forget");return e.openBlock(),e.createElementBlock("div",b,[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",y,e.toDisplayString(t.__("auth.login.title")),1),e.createVNode(i,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",w,[e.createElementVNode("a",{onClick:o[0]||(o[0]=function(){return a.reset&&a.reset.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.forget_password")),1)]),e.createElementVNode("div",_,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.login.form.submit")),3)]),e.createElementVNode("div",k,[e.createElementVNode("div",E,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",N,[e.createElementVNode("a",{class:"button",onClick:o[1]||(o[1]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},S),e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return a.google&&a.google.apply(a,arguments)})},V)])]),e.createElementVNode("div",C,[e.createElementVNode("a",{onClick:o[3]||(o[3]=function(){return a.register&&a.register.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.signup")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],512),[[e.vShow,"login"==a.modal]]),"forget"==a.modal?(e.openBlock(),e.createBlock(c,{key:0,email:a.model.email,"forget-type":r.forgetType,"show-placeholders":r.showPlaceholders},null,8,["email","forget-type","show-placeholders"])):e.createCommentVNode("v-if",!0)])},module.exports=v;
2
2
  //# sourceMappingURL=Login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=11762c76&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\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 finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\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 finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","type","Function","forgetType","String","showPlaceholders","Boolean","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","placeholder","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","response","authUserLoginCallback","data","user","is_login_tracked","event","user_id","id","method","$env","debug","ecommerce","console","log","dataLayer","push","error","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_14","$props"],"mappings":"isDAgDAA,UAAQC,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzC,CACXC,SACIC,cAAe,CACXC,KAAMC,iBACG,cAEbC,WAAY,CACRF,KAAMG,eACG,SAEbC,iBAAkB,CACdJ,KAAMK,iBACG,uBAEK,CACdL,KAAMK,iBACG,IAGjBC,KAAM,QACNC,WAAY,CACRZ,WAAAA,GAEJa,eAAMV,SACIW,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAASJ,MAAI,IACbK,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBAErCC,EAASR,MAAI,CACfS,MAAO,CACHC,UAAW1B,UACX2B,MAAOC,GAAG,yBACVX,MAAO,QACPY,MAAO,QACPC,YAAa1B,EAAMM,iBAAmBkB,GAAG,yBAA2B,IAExEG,SAAU,CACNL,UAAWM,UACXL,MAAOC,GAAG,4BACVE,YAAa1B,EAAMM,iBAAmBkB,GAAG,4BAA8B,MAIzEK,EAAaC,EAAIC,SAASC,MAAM,CAClCX,MAAOS,EAAIG,SAASZ,MAAMG,GAAG,0BAA0BU,SAASV,GAAG,6BACnEG,SAAUG,EAAIG,SAASC,SAASV,GAAG,+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yCAAgB,2BAEpBA,iCAAM,uBAIP,2IA5B3BC,2BAAAC,oBACIF,iCACIA,2BAAAG,oBAAsBC,4CACtBC,iBAAYC,iBAAiB,QAASxD,OAAQyD,6BAA4BA,8BAA6BA,SAAS9D,IAAK8D,MAAMC,SAAQD,aACpHE,qBACP,kBAAAT,2BAAAU,GACIV,0BAAIW,sCAAOJ,yDAAUH,yCAEzBJ,2BAAAY,GACIZ,uDAAc,+BAA6DO,aAA5C3E,KAAK,4BAAqDwE,qCAE7FJ,2BAAAa,GACIb,2BAAAc,oBAA8CV,+BAC9CJ,2BAAAe,GACIf,gCAAS,SAAUW,sCAAOJ,gDAM1BP,gCAAS,SAAUW,sCAAOJ,gDAQlCP,2BAAAgB,GACIhB,0BAAIW,sCAAOJ,+DAAaH,iIA5B3BG,qBAkCCA,uBAAdF,uBAAkCtD,MAAOwD,QAAMxD,oBAAqBkE,iCAAgCA"}
1
+ {"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=11762c76&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\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 finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\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 finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","type","Function","forgetType","String","showPlaceholders","Boolean","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","placeholder","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","response","authUserLoginCallback","data","user","is_login_tracked","event","user_id","id","method","$env","debug","ecommerce","console","log","dataLayer","push","error","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createVNode","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_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