(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-21d65af0"],{"034d":function(e,t,a){"use strict";function i(e,t,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=!1;function n(){r||(r=!0,e.$nextTick((function(){r=!1,a()})))}var s=!0,o=!1,l=void 0;try{for(var c,d=t[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var u=c.value;e.$watch(u,n,{immediate:i})}}catch(p){o=!0,l=p}finally{try{!s&&d.return&&d.return()}finally{if(o)throw l}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},"03f8":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"row col-12 no-wrap q-py-xs"},[a("div",{staticClass:"col-2 row justify-center items-start"},[a("q-btn",{staticStyle:{border:"0.5px"},attrs:{ripple:!1,"no-caps":"",outline:"","fab-mini":"",dense:"","no-wrap":"",color:"primary",label:e.info.quantity+" x"}})],1),a("div",{staticClass:"col-8 row"},[a("div",{staticClass:"col-12"},[a("div",{staticClass:"text-primary title"},[e._v(" "+e._s(e.info.hema_name_en)+" ")]),a("div",[e._v(" "+e._s(e.info.hema_brand_en)+" ")]),e.disabled?e.info.remark?a("div",[e._v("Note: "+e._s(e.info.remark))]):e._e():a("q-input",{staticClass:"full-width q-mt-sm",attrs:{outlined:"",dense:"",placeholder:"Note",autogrow:""},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}})],1)]),a("div",{staticClass:"col-2 text-right"},[a("div",{staticClass:"price text-primary"},[e._v(" "+e._s(e.$priceFormat(e.info.rowTotal))+" ")])])])},r=[],n=a("27f9"),s=a("013f");const o={QInput:n["a"]};var l={name:"ProductItem",props:["info","disabled"],components:{...o},data(){return{remark:""}},methods:{getProductWithRemark(){return{productName:this.info.hema_brand_en+" "+this.info.hema_name_en+" "+this.info.hema_sizedesc,quantity:this.info.quantity,cprcode:this.info.cprcode,iprcode:this.info.iprcode,originalPrice:this.info.originalPrice,price:this.info.price,settlementPrice:this.info.settlementPrice,discount:this.info.discount,rowTotal:this.info.rowTotal,remark:this.remark,isPreOrder:!!this.info.preorder}},$priceFormat(e){return Object(s["a"])(e)}}},c=l,d=(a("a371"),a("2877")),u=Object(d["a"])(c,i,r,!1,null,"72797a58",null);t["default"]=u.exports},"0707":function(e,t,a){},"0a78":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,i)&&(a[i]=e[i]);return a}var l={bounds:{type:Object},defaultPlace:{type:String,default:""},componentRestrictions:{type:Object,default:null},types:{type:Array,default:function(){return[]}},placeholder:{required:!1,type:String},className:{required:!1,type:String},label:{required:!1,type:String,default:null},selectFirstOnEnter:{require:!1,type:Boolean,default:!1}};t.default={mounted:function(){var e=this,t=this.$refs.input;t.value=this.defaultPlace,this.$watch("defaultPlace",(function(){t.value=e.defaultPlace})),this.$gmapApiPromiseLazy().then((function(){var t=(0,i.getPropsValues)(e,l);if(e.selectFirstOnEnter&&(0,n.default)(e.$refs.input),"function"!==typeof google.maps.places.Autocomplete)throw new Error("google.maps.places.Autocomplete is undefined. Did you add 'places' to libraries when loading Google Maps?");e.autoCompleter=new google.maps.places.Autocomplete(e.$refs.input,t);l.placeholder,l.place,l.defaultPlace,l.className,l.label,l.selectFirstOnEnter;var a=o(l,["placeholder","place","defaultPlace","className","label","selectFirstOnEnter"]);(0,i.bindProps)(e,e.autoCompleter,a),e.autoCompleter.addListener("place_changed",(function(){e.$emit("place_changed",e.autoCompleter.getPlace())}))}))},created:function(){console.warn("The PlaceInput class is deprecated! Please consider using the Autocomplete input instead")},props:l}},"0e21":function(e,t,a){"use strict";a("e5d9")},"108f":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.addEventListener?e.addEventListener:e.attachEvent;function a(a,i){if("keydown"===a){var r=i;i=function(t){var a=document.getElementsByClassName("pac-item-selected").length>0;if(13===t.which&&!a){var i=document.createEvent("Event");i.keyCode=40,i.which=40,r.apply(e,[i])}r.apply(e,[t])}}t.apply(e,[a,i])}e.addEventListener=a,e.attachEvent=a}},"1a25":function(e,t,a){"use strict";a("28362")},2789:function(e,t,a){"use strict";a("fe81")},28362:function(e,t,a){},"2adb":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropsValues=o,t.bindProps=l;var i=a("034d"),r=n(i);function n(e){return e&&e.__esModule?e:{default:e}}function s(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){return Object.keys(t).reduce((function(t,a){return void 0!==e[a]&&(t[a]=e[a]),t}),{})}function l(e,t,a){var i=function(i){var n=a[i],o=n.twoWay,l=n.type,c=n.trackProperties,d=n.noBind;if(d)return"continue";var u="set"+s(i),p="get"+s(i),f=i.toLowerCase()+"_changed",m=e[i];if("undefined"===typeof t[u])throw new Error(u+" is not a method of (the Maps object corresponding to) "+e.$options._componentTag);l===Object&&c?(0,r.default)(e,c.map((function(e){return i+"."+e})),(function(){t[u](e[i])}),void 0!==e[i]):e.$watch(i,(function(){var a=e[i];t[u](a)}),{immediate:"undefined"!==typeof m,deep:l===Object}),o&&(e.$gmapOptions.autobindAllEvents||e.$listeners[f])&&t.addListener(f,(function(){e.$emit(f,t[p]())}))};for(var n in a)i(n)}},"38cd":function(e,t,a){"use strict";a("511c")},"43b0":function(e,t,a){},"470a":function(e,t,a){"use strict";a("43b0")},5054:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("b7d9"),r=n(i);function n(e){return e&&e.__esModule?e:{default:e}}var s={options:{type:Object,required:!1,default:function(){return{}}},position:{type:Object,twoWay:!0},zIndex:{type:Number,twoWay:!0}},o=["domready","closeclick","content_changed"];t.default=(0,r.default)({mappedProps:s,events:o,name:"infoWindow",ctr:function(){return google.maps.InfoWindow},props:{opened:{type:Boolean,default:!0}},inject:{$markerPromise:{default:null}},mounted:function(){var e=this.$refs.flyaway;e.parentNode.removeChild(e)},beforeCreate:function(e){var t=this;if(e.content=this.$refs.flyaway,this.$markerPromise)return delete e.position,this.$markerPromise.then((function(e){return t.$markerObject=e,e}))},methods:{_openInfoWindow:function(){this.opened?null!==this.$markerObject?this.$infoWindowObject.open(this.$map,this.$markerObject):this.$infoWindowObject.open(this.$map):this.$infoWindowObject.close()}},afterCreate:function(){var e=this;this._openInfoWindow(),this.$watch("opened",(function(){e._openInfoWindow()}))}})},"511c":function(e,t,a){},"51a8":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t{if(this.api=window["google"],"undefined"===typeof this.resolve)throw new Error("Should not happen");this.resolve(this.api)},window["gm_authFailure"]=()=>{if("undefined"===typeof this.reject)throw new Error("Should not happen");this.reject(new Error("google-maps: authentication error"))},this.loader=new Promise((e,t)=>{this.resolve=e,this.reject=t;const a=document.createElement("script");a.src=this.createUrl(),a.async=!0,a.onerror=e=>t(e),document.head.appendChild(a)}))}createUrl(){const e=["callback="+n.CALLBACK_NAME];this.apiKey&&e.push("key="+this.apiKey);for(let t in this.options)if(this.options.hasOwnProperty(t)){let a=this.options[t];"version"===t&&(t="v"),"libraries"===t&&(a=a.join(",")),e.push(`${t}=${a}`)}return"https://maps.googleapis.com/maps/api/js?"+e.join("&")}}n.CALLBACK_NAME="_dk_google_maps_loader_cb";const s="https://r90q8mnhpk.execute-api.ap-southeast-1.amazonaws.com/production";var o=a("d8af"),l=a("bc3a"),c=a.n(l),d=a("5a0c"),u=a.n(d);const p=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.business",stylers:[{visibility:"off"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}];var f=p;let m=a("5ccb"),h="M17.402,0H5.643C2.526,0,0,3.467,0,6.584v34.804c0,3.116,2.526,5.644,5.643,5.644h11.759c3.116,0,5.644-2.527,5.644-5.644 V6.584C23.044,3.467,20.518,0,17.402,0z M22.057,14.188v11.665l-2.729,0.351v-4.806L22.057,14.188z M20.625,10.773 c-1.016,3.9-2.219,8.51-2.219,8.51H4.638l-2.222-8.51C2.417,10.773,11.3,7.755,20.625,10.773z M3.748,21.713v4.492l-2.73-0.349 V14.502L3.748,21.713z M1.018,37.938V27.579l2.73,0.343v8.196L1.018,37.938z M2.575,40.882l2.218-3.336h13.771l2.219,3.336H2.575z M19.328,35.805v-7.872l2.729-0.355v10.048L19.328,35.805z",v={path:h,scale:.7,strokeColor:"white",strokeWeight:.1,fillOpacity:1,fillColor:"#2c2a74",offset:"5%",rotation:0,anchor:""};const y=new n("AIzaSyBFn2U3mrs1oMRhEJgQO8gZCpZnjbrRhhI");let g,b;var _={name:"MapTracking",data(){return{map:"",origin:{lat:13.7451179,lng:100.5638973},destination:{lat:13.7305691,lng:100.5406135},markerOrigin:null,markerDesination:null,markerRider:null,orderDetail:null,infowindow:null}},async mounted(){const e=this;g=await y.load();const{id:t}=this.$router.currentRoute.params,a=await this.getOrderDetail(t),[i,r]=Object(o["b"])(a.origin).latlng;this.origin={lat:i,lng:r},this.destination=a.destination,this.initMap(),setInterval(()=>{e.getOrderDetail(t)},5e3)},methods:{customInfoWindow(e){return`
\n \n

OrderId #${e.id}

\n
\n

\n origin:\n ${e.origin}\n

\n

\n destination:\n ${e.destination}\n

\n

\n time:\n ${e.time}\n

\n

\n distance:\n ${e.distance}\n

\n
\n
\n

\n GPS Latest update:\n ${u()(e.Positions.items[0].createdAt).format("HH:mm:ss DD/MM/YYYY")}\n

\n
\n
`},async getOrderDetail(e){try{const{data:t}=await c.a.get(s+"/getOrderDetail",{params:{id:e}}),a=t.data.Positions.items[0];if(this.markerRider){this.orderDetail=t.data;let e=this.markerRider.getIcon();e.rotation=a.heading,this.markerRider.setIcon(e),this.markerRider.setPosition(a),this.infowindow.setContent(this.customInfoWindow(this.orderDetail))}else this.orderDetail=t.data,this.markerRider={lat:a.lat,lng:a.lng};return t.data}catch(t){return null}},initMap(){b=new g.maps.DirectionsRenderer,this.map=new g.maps.Map(document.getElementById("map"),{disableDefaultUI:!0,center:this.getCenter(this.origin,this.destination),styles:f}),b.setMap(this.map),this.createRouter(this.origin,this.destination),this.infowindow=new g.maps.InfoWindow({content:this.customInfoWindow(this.orderDetail),disableAutoPan:!0}),v.anchor=new g.maps.Point(10,25),v.fillColor="#30a566",v.rotation=0,this.markerRider=this.createMarker(this.markerRider,v),this.infowindow.open(this.map,this.markerRider)},getCenter(e,t){var a=new g.maps.LatLngBounds;return a.extend(new g.maps.LatLng(e)),a.extend(new g.maps.LatLng(t)),a.getCenter()},createMarker(e,t){let a=this.map;if(t){const i=new g.maps.Marker({position:e,icon:t,map:a});return i}{const t=new g.maps.Marker({position:e,map:a});return t}},createRouter(e,t){const a=this;let i={origin:e,destination:t,travelMode:g.maps.TravelMode.DRIVING,avoidHighways:!0,avoidTolls:!0},r=new g.maps.DirectionsService;r.route(i,(function(i,r){if(r==g.maps.DirectionsStatus.OK){b.setDirections(i),b.setOptions({polylineOptions:{strokeColor:"#2c2a74",strokeOpacity:.8,strokeWeight:6},suppressMarkers:!0});let e=i.routes[0].overview_path;a.markerOrigin=a.createMarker(e[0],m),a.markerDesination=a.createMarker(e[e.length-1],null)}else alert("Directions Request from "+e.toUrlValue(6)+" to "+t.toUrlValue(6)+" failed: "+r)}))}}},w=_,C=(a("fa96"),a("2877")),P=Object(C["a"])(w,i,r,!1,null,"6ee51eee",null);t["default"]=P.exports},"7a03":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a){var i=function(a){(e.$gmapOptions.autobindAllEvents||e.$listeners[a])&&t.addListener(a,(function(t){e.$emit(a,t)}))},r=!0,n=!1,s=void 0;try{for(var o,l=a[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var c=o.value;i(c)}}catch(d){n=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(n)throw s}}}},"7ad3":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"q-my-xs bg-grey-2 q-pa-xs"},[a("div",{staticClass:"flex justify-between"},[a("span",{staticClass:"title"},[e._v("#"+e._s(e.order.orderId)+" ")]),a("span",{staticClass:"payment"},[e._v(e._s(e.status))])]),a("div",{staticClass:"row justify-between"},[a("div",[e._v(e._s(e.timestamp))]),a("div",[e._v("฿ "+e._s(e.$priceFormat(e.grandTotal)))])]),a("div",{staticClass:"row justify-between"},[a("div",[e._v(e._s(e.itemCount)+" "+e._s(e.itemCount>1?"items":"item"))]),a("div",[e._v(e._s(e.shippingType))])]),a("div",{staticClass:"row justify-between"},[a("q-btn",{attrs:{disable:!1,dense:"","no-caps":"",flat:"",color:"primary","no-wrap":"",label:"Reorder"},on:{click:e.reorderHandler}}),a("q-btn",{attrs:{dense:"","no-caps":"",flat:"",color:"primary",to:"/order/"+e.order.orderId,"no-wrap":"",label:"View detail"}})],1),a("q-dialog",{attrs:{persistent:""},model:{value:e.dialogDelivery.show,callback:function(t){e.$set(e.dialogDelivery,"show",t)},expression:"dialogDelivery.show"}},[a("DialogAlert",{attrs:{message:e.dialogDelivery.message,"left-btn":e.dialogDelivery.leftButtonText,"right-btn":e.dialogDelivery.rightButtonText},on:{leftClick:e.dialogDelivery.leftButtonCallback,rightClick:e.dialogDelivery.rightButtonCallback}})],1)],1)},r=[],n=a("5a0c"),s=a.n(n),o=a("013f"),l=a("24e8");const c={QDialog:l["a"]};var d={name:"OrderCard",props:["order"],components:{...c,DialogAlert:()=>a.e("chunk-5af30cec").then(a.bind(null,"bb5b"))},data(){return{dialogDelivery:{show:!1,message:void 0,leftButtonText:null,leftButtonCallback:()=>{},rightButtonText:null,rightButtonCallback:()=>{}}}},computed:{itemCount(){let e=0;if(this.order.productList)switch(this.order.type){case"new":e=this.order.productList.reduce((e,t)=>e+t.quantity,0);break;case"old":e=this.order.productList.reduce((e,t)=>e+t.quantity,0);break;default:break}return e},shippingType(){if(this.order.shipping)return this.order.shipping.shippingType},timestamp(){return this.order.payment&&this.order.payment.timestamp&&s.a.unix(this.order.payment.timestamp).isValid()?s.a.unix(this.order.payment.timestamp).format("D MMM YYYY"):this.order&&s.a.unix(this.order.orderDate).isValid()?s.a.unix(this.order.orderDate).format("D MMM YYYY"):""},grandTotal(){return this.order&&this.order.payment&&this.order.payment.grandTotal>=0?this.order.payment.grandTotal:this.order&&this.order.grandTotal?this.order.grandTotal:""},status(){return this.order.payment?this.order.payment.isPaid?"Paid":"Cancelled":this.order.isPaid?"Paid":"Cancelled"}},methods:{$priceFormat(e){return Object(o["a"])(e)},reorderHandler(){this.dialogDelivery.show=!0,this.dialogDelivery.message="Do you want to buy again?",this.dialogDelivery.rightButtonText="Yes",this.dialogDelivery.leftButtonText="Cancel",this.dialogDelivery.rightButtonCallback=async()=>{const{productList:e}=this.order;this.$store.dispatch("cart/Reorder",e),this.dialogDelivery.show=!1,this.$router.push("/cart")},this.dialogDelivery.leftButtonCallback=async()=>{this.dialogDelivery.show=!1}},async addToCart(e){const{error:t,noNotify:a}=await this.$store.dispatch("cart/AddToCart",e)}}},u=d,p=(a("470a"),a("2877")),f=Object(p["a"])(u,i,r,!1,null,"0a7659d4",null);t["default"]=f.exports},"7bdd":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("input",e._g(e._b({ref:"input"},"input",e.$attrs,!1),e.$listeners))},r=[],n=function(e){return e.default||e}(a("51a8")),s=n,o=a("2877"),l=Object(o["a"])(s,i,r,!1,null,null,null);t["default"]=l.exports},"82e1":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("b7d9"),r=n(i);function n(e){return e&&e.__esModule?e:{default:e}}var s={animation:{twoWay:!0,type:Number},attribution:{type:Object},clickable:{type:Boolean,twoWay:!0,default:!0},cursor:{type:String,twoWay:!0},draggable:{type:Boolean,twoWay:!0,default:!1},icon:{twoWay:!0},label:{},opacity:{type:Number,default:1},options:{type:Object},place:{type:Object},position:{type:Object,twoWay:!0},shape:{type:Object,twoWay:!0},title:{type:String,twoWay:!0},zIndex:{type:Number,twoWay:!0},visible:{twoWay:!0,default:!0}},o=["click","rightclick","dblclick","drag","dragstart","dragend","mouseup","mousedown","mouseover","mouseout"];t.default=(0,r.default)({mappedProps:s,events:o,name:"marker",ctr:function(){return google.maps.Marker},inject:{$clusterPromise:{default:null}},render:function(e){return this.$slots.default&&0!==this.$slots.default.length?1===this.$slots.default.length?this.$slots.default[0]:e("div",this.$slots.default):""},destroyed:function(){this.$markerObject&&(this.$clusterObject?this.$clusterObject.removeMarker(this.$markerObject,!0):this.$markerObject.setMap(null))},beforeCreate:function(e){return this.$clusterPromise&&(e.map=null),this.$clusterPromise},afterCreate:function(e){var t=this;this.$clusterPromise&&this.$clusterPromise.then((function(a){a.addMarker(e),t.$clusterObject=a}))}})},"9cb5":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vue-map-container"},[a("div",{ref:"vue-map",staticClass:"vue-map"}),a("div",{staticClass:"vue-map-hidden"},[e._t("default")],2),e._t("visible")],2)},r=[],n=function(e){return e.default||e}(a("d092")),s=n,o=(a("2789"),a("2877")),l=Object(o["a"])(s,i,r,!1,null,null,null);t["default"]=l.exports},"9d25":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("router-link",{directives:[{name:"intersection",rawName:"v-intersection.once",value:e.onIntersection,expression:"onIntersection",modifiers:{once:!0}}],staticClass:"col-12 col-md-6 flex",style:"padding: 4px;text-decoration:none",attrs:{to:"/product/"+e.info.cprcode}},[i("div",{staticClass:"card-product column full-width"},[i("div",{staticClass:"img",staticStyle:{padding:"5px 5px 0px 5px"}},[e.visible?i("q-img",{attrs:{basic:"","placeholder-src":a("cbd0"),height:"40vh",contain:"",src:e.imageSrc},on:{error:function(t){return e.retryImageSrc(e.info.cprcode,e.info.pr_use_original_img)}}}):e._e()],1),i("div",{staticClass:"column col-grow",style:e.showCurve&&!e.loading?"padding:8px;border-top-right-radius:30px;box-shadow:0 -2.8px 2.2px "+e.color+",0 -9.7px 10.3px "+e.color+", 0 -15.5px 16px "+e.color+";":"padding:8px;"},[i("div",{staticClass:"brand"},[e._v(e._s(e.info.hema_name_en))]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6 name-item text-dark-grey"},[e._v(" "+e._s(e.info.hema_brand_en)+" ")]),i("div",{staticClass:"col-6 name-item text-dark-grey text-right"},[e._v(" "+e._s(e.info.hema_sizedesc)+" ")])]),i("div",{staticStyle:{flex:"1"}}),"PREORDER_FIXED"===e.preorder.type?i("div",{staticClass:"row"},[i("q-badge",{staticStyle:{"font-size":"22px",height:"32px"},attrs:{outline:"",color:"lime-10"}},[e._v("Delivery on "+e._s(e.displayDeliveryDate))])],1):e._e(),"PREORDER_RELATIVE"===e.preorder.type?i("div",{staticClass:"row"},[i("q-badge",{staticStyle:{"font-size":"22px",height:"32px"},attrs:{outline:"",color:"lime-10"}},[e._v(e._s(e.preorder.relativeDay)+" day advance order")])],1):e._e(),i("div",{staticClass:"row"},[e.isShopAtStore?i("div",{staticClass:"col-12 items-end row"},[e.info.lastPrice?i("span",{staticClass:"special-price",staticStyle:{color:"#979797","text-decoration":"line-through","font-size":"12px"}},[e._v(" ฿ "+e._s(e.$priceFormat(e.info.lastPrice))+" ")]):e._e(),e.info.lastPrice?i("span",{staticClass:"discount-price"},[e._v("-"+e._s(e.calculateDiscount)+"%")]):e._e(),i("div",{staticClass:"col-grow row"},[e.info.price?i("div",{staticClass:"col-12 special-price",staticStyle:{padding:"10px 0 5px 0"},style:"font-size:px;white-space: nowrap;color: #575757;"},[e._v(" ฿"+e._s(e.$priceFormat(e.info.price))+" "),e.info.unit?i("span",{staticClass:"unit-price"},[e._v("/"+e._s(e.info.unit))]):e._e()]):e._e()]),i("div",{staticClass:"text-right"},[i("q-btn",{attrs:{rounded:"",color:"dark",size:"10px","aria-label":"add to cart"}},[i("div",{staticClass:"row items-center no-wrap"},[i("q-icon",{attrs:{left:"",name:"shopping_cart"}}),i("div",{staticClass:"text-center"},[e._v("Store"),i("br"),e._v("Only")])],1)])],1)]):e.info.pre_type||e.info.stock>0?i("div",{staticClass:"col-12 items-end row"},[i("div",{staticClass:"col-7 row"},[i("div",{staticClass:"col-12"},[e.info.lastPrice?i("span",{staticStyle:{"font-size":"20px",color:"#575757","text-decoration":"line-through"}},[e._v("฿"+e._s(e.info.lastPrice?e.$priceFormat(e.info.lastPrice):""))]):e._e(),e.info.lastPrice?i("span",{staticClass:"discount-price"},[e._v("-"+e._s(e.calculateDiscount)+"%")]):e._e()]),e.info.price?i("div",{staticClass:"col-12 special-price",staticStyle:{padding:"10px 0 5px 0"},style:"font-size:26px;white-space: nowrap;"},[e._v(" ฿"+e._s(e.$priceFormat(e.info.price))+" "),e.info.unit?i("span",{staticClass:"unit-price"},[e._v("/"+e._s(e.info.unit))]):e._e()]):e._e()]),i("div",{staticClass:"col-grow text-right"},[e.atToCard<=0?i("div",[i("q-btn",{attrs:{round:"",color:"primary",size:"20px",icon:"shopping_cart","aria-label":"add to cart"},on:{click:function(t){return t.preventDefault(),e.onAtToCard(e.info)}}})],1):i("div",{staticStyle:{display:"flex","justify-content":"flex-end"}},[i("div",{staticStyle:{"padding-right":"5px"}},[i("q-btn",{attrs:{round:"",dense:"",color:"primary",size:"20px","aria-label":"remove from cart"},on:{click:function(t){return t.preventDefault(),e.subtract(e.info)}}},[i("i",{staticClass:"fas fa-minus"})])],1),i("p",{staticClass:"special-price",staticStyle:{padding:"0 5px",margin:"0px","align-items":"center",display:"flex"}},[e._v(" "+e._s(e.atToCard)+" ")]),i("q-btn",{attrs:{round:"",dense:"",color:"primary",size:"20px",icon:"add","aria-label":"add to cart"},on:{click:function(t){return t.preventDefault(),e.onAtToCard(e.info)}}})],1)])]):e.info.stock<=0||void 0===e.info.stock?i("div",{staticClass:"col-12 items-end row"},[e.info.lastPrice?i("span",{staticClass:"special-price",staticStyle:{color:"#979797","text-decoration":"line-through","font-size":"12px"}},[e._v(" ฿ "+e._s(e.$priceFormat(e.info.lastPrice))+" ")]):e._e(),e.info.lastPrice?i("span",{staticClass:"discount-price"},[e._v("-"+e._s(e.calculateDiscount)+"%")]):e._e(),i("div",{staticClass:"col-grow row"},[e.info.price?i("div",{staticClass:"col-12 special-price",staticStyle:{padding:"10px 0 5px 0"},style:"font-size:px;white-space: nowrap;color: #575757;"},[e._v(" ฿"+e._s(e.$priceFormat(e.info.price))+" "),e.info.unit?i("span",{staticClass:"unit-price"},[e._v("/"+e._s(e.info.unit))]):e._e()]):e._e()]),i("div",{staticClass:"text-right"},[i("q-btn",{attrs:{rounded:"",color:"dark",size:"10px","aria-label":"add to cart"}},[i("div",{staticClass:"row items-center no-wrap"},[i("q-icon",{attrs:{left:"",name:"shopping_cart"}}),i("div",{staticClass:"text-center"},[e._v("out of"),i("br"),e._v("stock")])],1)])],1)]):e._e()]),e.badge.left?i("q-img",{staticClass:"overlay",attrs:{basic:"",src:""+e.badge.left}}):e._e(),e.badge.right?i("q-img",{staticClass:"overlay-right",attrs:{basic:"",src:""+e.badge.right}}):e._e()],1)])])},r=[],n=a("013f"),s=a("07f7"),o=a("0454"),l=a("256a"),c=a("2544"),d=a("d62e"),u=a("58a8");const p=["rgba(245, 245, 255,1)","rgba(237, 255, 232,1)","rgba(255, 250, 232,1)"];var f={name:"ProductCartVLarge",props:["info"],mixins:[s["a"],o["a"],l["a"],c["a"],d["a"]],components:{QBadge:u["a"]},data(){return{visible:!1,loading:!1,showCurve:!1,color:p[0],atToCard:0}},computed:{badge(){return this.info.badge||{}}},watch:{"info.cprcode":{handler:function(e){this.initializeImageSrc(e,this.info.pr_use_original_img)}}},mounted(){this.showCurve=!0,this.color=p[Math.round(Math.random()*p.length)],this.initializeImageSrc(this.info.cprcode,this.info.pr_use_original_img)},methods:{$priceFormat(e){return Object(n["a"])(e)},onIntersection(e){this.visible=e.isIntersecting},async subtract(e){try{const{message:t}=await this.$store.dispatch("cart/Decrement",e);"SUCCESS"===t&&(this.atToCard-=1)}catch(t){}},onAtToCard(e){this.AddToCart(e,e=>{e||(this.atToCard+=1,this.$gtag&&this.$gtag.event("add_to_cart",{currency:"THB",items:[{id:this.info.cprcode,name:this.info.hema_name_en}],value:this.atToCard}))})}}},m=f,h=(a("f241"),a("2877")),v=Object(h["a"])(m,i,r,!1,null,"75eb9176",null);t["default"]=v.exports},a371:function(e,t,a){"use strict";a("0707")},a45a:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"q-pb-sm col-12"},[a("div",{staticClass:"group"},[a("div",{staticClass:"q-pa-xs bg-info row justify-between"},[a("div",{staticClass:"title text-primary"},[e._v(" "+e._s(e.mode)+" ")]),a("div",{staticClass:"title text-primary"},[e._v(" "+e._s(e.pickingStatus)+" ")]),a("CurrentStatus",{attrs:{isPaid:e.isPaid,statusList:e.group}})],1),e._l(e.productList,(function(e,t){return a("ProductItem",{key:t,ref:"ProductItem",refInFor:!0,staticClass:"q-pa-xs",attrs:{info:e,disabled:!0}})}))],2)])},r=[],n=a("5a0c"),s=a.n(n),o={name:"OrderDetailGroup",props:["group","index","shippingType","isPaid"],components:{ProductItem:()=>a.e("chunk-21d65af0").then(a.bind(null,"03f8")),CurrentStatus:()=>a.e("chunk-21d65af0").then(a.bind(null,"e807"))},computed:{mode(){if(this.group.preOrder){const e=s()(this.group.dateTime).format("D MMM YYYY");return`Pre-order: ${this.shippingType.toLowerCase()} on ${e}`}if(this.group.mode){const e=s()(this.group.dateTime).format("D MMM YYYY");return`${this.group.mode.toLowerCase()}: ${this.shippingType.toLowerCase()} on ${e}`}return""},productList(){return this.group.productList.map(e=>{let t,a;return e.rowTotal&&(t=e.settlementPrice!==e.rowTotal?e.settlementPrice:void 0,a=e.rowTotal),e.originalPrice&&(t=e.settlementPrice!==e.originalPrice?e.settlementPrice:void 0,a=e.originalPrice),{...e,rowTotal:a,settlementPrice:t,hema_name_en:e.hema_name_en?e.hema_name_en:e.productName}})},pickingStatus(){return this.group.pickingStatus}}},l=o,c=(a("e790"),a("2877")),d=Object(c["a"])(l,i,r,!1,null,"0f46f937",null);t["default"]=d.exports},a8b4:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={inject:{$mapPromise:{default:"abcdef"}},provide:function(){var e=this;return this.$mapPromise.then((function(t){e.$map=t})),{}}}},b60a:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{ref:"formRef",staticStyle:{display:"none"},attrs:{method:"post",action:"https://t.2c2p.com/RedirectV3/payment"}},[a("input",{attrs:{type:"hidden",name:"version"},domProps:{value:e.version}}),a("input",{attrs:{type:"hidden",name:"merchant_id"},domProps:{value:e.merchant_id}}),a("input",{attrs:{type:"hidden",name:"currency"},domProps:{value:e.currency}}),a("input",{attrs:{type:"hidden",name:"user_defined_1"},domProps:{value:e.user_defined_1}}),a("input",{attrs:{type:"hidden",name:"user_defined_2"},domProps:{value:e.user_defined_2}}),a("input",{attrs:{type:"hidden",name:"request_3ds"},domProps:{value:e.request_3ds}}),a("input",{attrs:{type:"hidden",name:"enable_store_card"},domProps:{value:e.enable_store_card}}),e.stored_card_unique_id?a("input",{attrs:{type:"hidden",name:"stored_card_unique_id"},domProps:{value:e.stored_card_unique_id}}):e._e(),a("input",{attrs:{type:"hidden",name:"hash_value"},domProps:{value:e.hash_value}}),e._v(" PRODUCT INFO : "),a("input",{attrs:{type:"hidden",name:"payment_description"},domProps:{value:e.payment_description}}),a("br"),e._v(" ORDER NO : "),a("input",{attrs:{type:"hidden",name:"order_id"},domProps:{value:e.order_id}}),a("br"),e._v(" AMOUNT: "),a("input",{attrs:{type:"hidden",name:"amount"},domProps:{value:e.amount}}),a("br")])])},r=[],n={name:"CreditCardFormV2",data(){return{amount:null,currency:null,hash_value:null,merchant_id:null,order_id:null,payment_description:null,request_3ds:null,enable_store_card:null,stored_card_unique_id:null,result_url_2:null,user_defined_1:null,user_defined_2:null,version:null}},methods:{setInfo(e){this.amount=e.amount,this.currency=e.currency,this.hash_value=e.hash_value,this.merchant_id=e.merchant_id,this.order_id=e.order_id,this.payment_description=e.payment_description,this.request_3ds=e.request_3ds,this.enable_store_card=e.enable_store_card,this.stored_card_unique_id=e.stored_card_unique_id,this.result_url_2=e.result_url_2,this.user_defined_1=e.user_defined_1,this.user_defined_2=e.user_defined_2,this.version=e.version},submit(){this.$nextTick(()=>{this.$refs.formRef.submit()})}}},s=n,o=a("2877"),l=Object(o["a"])(s,i,r,!1,null,null,null);t["default"]=l.exports},b7b1:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=!1;t.loadGmapApi=function(e,t){if("undefined"!==typeof document){if(r)throw new Error("You already started the loading of google maps");r=!0;var a=document.createElement("SCRIPT");if("object"!==("undefined"===typeof e?"undefined":i(e)))throw new Error("options should be an object");Array.prototype.isPrototypeOf(e.libraries)&&(e.libraries=e.libraries.join(",")),e["callback"]="vueGoogleMapsInit";var n="https://maps.googleapis.com/";"boolean"===typeof t&&!0===t&&(n="https://maps.google.cn/");var s=n+"maps/api/js?"+Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&");a.setAttribute("src",s),a.setAttribute("async",""),a.setAttribute("defer",""),document.head.appendChild(a)}}},b7d9:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var a=[],i=!0,r=!1,n=void 0;try{for(var s,o=e[Symbol.iterator]();!(i=(s=o.next()).done);i=!0)if(a.push(s.value),t&&a.length===t)break}catch(l){r=!0,n=l}finally{try{!i&&o["return"]&&o["return"]()}finally{if(r)throw n}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,i)&&(a[i]=e[i]);return a}function m(e,t){if(!e)throw new Error(t)}function h(e){return Object.entries(e).map((function(e){var t=i(e,2),a=t[0],r=t[1],n={};return"type"in r&&(n.type=r.type),"default"in r&&(n.default=r.default),"required"in r&&(n.required=r.required),[a,n]})).reduce((function(e,t){var a=i(t,2),r=a[0],n=a[1];return e[r]=n,e}),{})}},b8fa:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"row justify-center items-center"},[e.$q.screen.lt.sm?a("TitleBar",{attrs:{"center-slot":"Contact"}}):e._e(),e.$q.screen.gt.xs?a("TileBar",{staticClass:"col-12 col-sm-10 col-md-9",attrs:{optionButton:"Back"},on:{"on-button":function(t){return e.$router.go(-1)}}}):e._e(),e._m(0),a("div",{staticClass:"col-12 q-mt-lg",attrs:{id:"wrapper"}},[a("GmapMap",{ref:"mapRef",staticStyle:{height:"520px",width:"100%"},attrs:{center:e.center,zoom:15,options:e.mapOptions}},[a("GmapMarker",{ref:"marker",attrs:{position:e.marker,clickable:!0,animation:e.animation,draggable:!1}})],1),a("div",{staticClass:"branch"},[a("div",{staticStyle:{margin:"20px"}},[a("q-select",{attrs:{"bg-color":"white",borderless:"",options:e.branchs},scopedSlots:e._u([{key:"selected",fn:function(){return[a("div",{staticClass:"list-shop-store"},[a("div",{staticClass:"list-shop-store-name"},[e._v(" "+e._s(e.branchSelected.name)+" ")]),a("div",{staticClass:"list-shop-store-address"},[e._v(" "+e._s(e.branchSelected.address)+", "+e._s(e.branchSelected.subDistrict)+", "+e._s(e.branchSelected.district)+", "+e._s(e.branchSelected.province)+" "+e._s(e.branchSelected.postcode)+" "),a("br"),e._v(" "+e._s(e.branchSelected.phoneNumber)+" ")])])]},proxy:!0},{key:"option",fn:function(t){return[a("q-item",e._g(e._b({},"q-item",t.itemProps,!1),t.itemEvents),[a("q-item-section",[a("div",{staticClass:"list-shop-store-name"},[e._v(" "+e._s(t.opt.name)+" ")]),a("div",{staticClass:"list-shop-store-address"},[e._v(" "+e._s(t.opt.address)+", "+e._s(t.opt.subDistrict)+", "+e._s(t.opt.district)+", "+e._s(t.opt.province)+" "+e._s(t.opt.postcode)+" "),a("br"),e._v(" "+e._s(t.opt.phoneNumber)+" ")])])],1)]}}]),model:{value:e.branchSelected,callback:function(t){e.branchSelected=t},expression:"branchSelected"}})],1)]),a("div",{staticClass:"btn-route"},[a("q-btn",{staticClass:"btn-color",attrs:{"no-caps":""},on:{click:e.onOpenGoogleMap}},[a("i",{staticClass:"fa fa-location-arrow",staticStyle:{"margin-right":"10px"},attrs:{"aria-hidden":"true"}}),a("div",{staticClass:"btn-label"},[e._v("Get Direction")])])],1)],1)],1)},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"col-10 row"},[a("div",{staticClass:"col-12 text-title text-center",staticStyle:{padding:"20px 0"}},[e._v(" Contact ")]),a("div",{staticClass:"col-12 justify-center items-center text-center"},[a("div",{staticStyle:{margin:"0 0 10px"}},[a("h2",{staticClass:"header-title"},[e._v(" Villa Market Customer Care Team ")]),a("p",[e._v(" Call: "),a("a",{attrs:{href:"tel:+6627791000"}},[e._v("02-779-1000")]),e._v(" (9am - 10pm) ")]),a("p",[e._v(" Email: "),a("a",{attrs:{href:"mailto:online@villamarket.com"}},[e._v("online@villamarket.com")])]),a("p",[e._v("Line: @villa.supermarket")]),a("p",{staticStyle:{"justify-content":"center",display:"flex","flex-direction":"column"}},[e._v(" Facebook:"),a("br"),a("a",{staticStyle:{color:"#1979c3",overflow:"hidden"},attrs:{href:"https://www.facebook.com/villamarketofficial"}},[e._v("https://www.facebook.com/villamarketofficial")])])]),a("div",{staticStyle:{margin:"0 0 10px"}},[a("h2",{staticClass:"header-title"},[e._v(" Villa Market JP. Head Office (Corporate Inquiries) ")]),a("p",[e._v(" 595 Sukhumvit Rd., North Khlong Ton, Vadhana Bangkok , 10110 ")]),a("p",[e._v(" Call: "),a("a",{attrs:{href:"tel:+6620551000"}},[e._v("02-055-1000")]),e._v(" (Mon - Fri 8.30am - 6pm) ")]),a("p",[e._v(" Ext. 003 - Purchasing Department / Ext. 004 - Human Resources Department ")])]),a("div",{staticStyle:{margin:"0 0 10px"}},[a("h2",{staticClass:"header-title"},[e._v(" Become A Supplier to Villa Market ")]),a("p",[e._v(" If you're a producer or supplier and would like to see your products available for "),a("br"),e._v("sale in Villa Market, then please send an email to "),a("a",{staticStyle:{color:"#1979c3"},attrs:{href:"mailto:commercial@villamarket.com"}},[e._v("commercial@villamarket.com")]),a("br"),e._v("If you're a producer or supplier and would like to see your products available for "),a("br"),e._v("review your offer and contact you directly. ")])])])])}],n=(a("ddb0"),a("d8af")),s=a("2b0e"),o=a("755e"),l=a("58a7");s["default"].use(o,{load:{key:l["a"],libraries:"places"}});var c={components:{TitleBar:()=>a.e("signin~31ecd969").then(a.bind(null,"1e1d")),TileBar:()=>a.e("chunk-5af30cec").then(a.bind(null,"7112"))},data(){return{center:{lat:13.73457,lng:100.5798123},marker:{lat:13.73457,lng:100.5798123},mapOptions:{disableDefaultUI:!0},branchSelected:n["a"][0],branchs:n["a"],animation:1}},watch:{branchSelected(){this.marker=null;const[e,t]=this.branchSelected.latlng;this.$refs.mapRef.$mapPromise.then(a=>{a.panTo({lat:e,lng:t})}),this.marker={lat:e,lng:t}}},methods:{onOpenGoogleMap(){""!=this.branchSelected.location_url&&window.open(this.branchSelected.location_url,"_blank")}}},d=c,u=(a("f760"),a("2877")),p=Object(u["a"])(d,i,r,!1,null,"44b0b91c",null);t["default"]=p.exports},bc7a:function(e,t,a){"use strict";a.r(t);var i=a("fea1"),r=a("0c5e");for(var n in r)["default"].indexOf(n)<0&&function(e){a.d(t,e,(function(){return r[e]}))}(n);var s=a("2877"),o=Object(s["a"])(r["default"],i["a"],i["b"],!1,null,null,null);t["default"]=o.exports},c7ee:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"q-pb-sm col-12"},[a("div",{staticClass:"group"},[a("div",{staticClass:"q-pa-xs bg-info"},[a("div",{staticClass:"title text-primary"},[e._v(" "+e._s(e.showDateTime||e.isNationwide?e.group.title2:"Express")+" "),a("span",{staticStyle:{"text-transform":"none"}},[e._v(e._s("Pre-order"===e.group.title2?": start delivery on "+e.dateOptions[0].label:""))])])]),e._l(e.group.items,(function(e,t){return a("ProductItem",{key:t,ref:"ProductItem",refInFor:!0,staticClass:"q-pa-xs",attrs:{info:e}})})),a("div",{staticClass:"col-12 row justify-end items-center q-pa-sm bg-info"},[e.showDateTime?a("div",{staticClass:"col-12 q-px-sm title"},[e._v(" "+e._s("DELIVERY"===e.shippingType?"Delivery date":"Pick-up date")+" ")]):e._e(),e.showDateTime?a("div",{staticClass:"col-2 q-px-sm title text-right"},[e._v(" Date ")]):e._e(),e.showDateTime?a("q-select",{staticClass:"col-4",attrs:{outlined:"",options:e.dateOptions,dense:"","options-dense":""},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}}):e._e(),e.showDateTime?a("div",{staticClass:"col-2 q-pa-sm title text-right"},[e._v(" Time ")]):e._e(),e.showDateTime?a("q-select",{staticClass:"col-4",attrs:{outlined:"",options:e.timeOptions,dense:"","options-dense":""},model:{value:e.selectedTime,callback:function(t){e.selectedTime=t},expression:"selectedTime"}}):e._e()],1)],2)])},r=[],n=a("ddd8"),s=a("0016"),o=a("5a0c"),l=a.n(o);const c={QSelect:n["a"],QIcon:s["a"]};var d={name:"ScheduleGroup",props:["group","isExpress","isNationwide","index","shippingType"],components:{...c,ProductItem:()=>a.e("chunk-21d65af0").then(a.bind(null,"03f8"))},data(){return{selectedDate:null,selectedTime:null,nextDayHour:16,startHour:9,endHour:19}},computed:{currentTime(){return this.$store.getters["cartData/currentTime"]},deliveryFee(){return this.group&&this.group.deliveryFee?this.group.deliveryFee:"Free"},dateOptions(){const e=l.a.unix(this.group.start);let t=[],a=0;for(e.hour()>=this.nextDayHour&&(a=1);a<7;a++)t.push({label:e.add(a,"day").format("D MMM"),value:e.add(a,"day")});return t},timeOptions(){let e=l.a.unix(this.group.start);this.selectedDate&&(e=this.selectedDate.value);let t=e.set("second",0).set("minute",0).set("hour",0),a=[];for(let n=this.startHour;ne.value>i.add(2,"hour"));return r},showDateTime(){return!this.isNationwide&&(!!this.group.preOrder||!this.isExpress)}},watch:{selectedDate:{immediate:!1,handler:function(e){this.selectedTime=null}}},mounted(){},methods:{defaultSelect(){this.selectedDate=this.dateOptions[0],this.selectedTime=this.timeOptions[0]},validate(){if(this.showDateTime){if(null===this.selectedDate||void 0===this.selectedDate)return!1;if(null===this.selectedTime||void 0===this.selectedTime)return!1}return!0},getSchedule(){let e="REGULAR",t=this.selectedTime?this.selectedTime.value.toISOString():l.a.unix(this.currentTime).toISOString();if(this.isExpress&&!this.group.preOrder){e="EXPRESS",t=l.a.unix(this.currentTime).add(1,"hour").add(5,"minute").toISOString();const a=l.a.unix(this.currentTime);a.hour()<=7?t=l.a.unix(this.currentTime).set("hour",9).set("minute",0).set("second",0):a.hour()>=19&&(t=l.a.unix(this.currentTime).add(1,"day").set("hour",9).set("minute",0).set("second",0))}return this.isNationwide&&(e="NATIONWIDE",t=l.a.unix(this.currentTime).add(2,"day").set("minute",0).set("second",0)),{scheduleId:this.index,preOrder:this.group.preOrder,mode:e,dateTime:t,deliveryFee:this.group.deliveryFee,pickingStatus:"pending"}},getProductWithRemarkList(){return this.$refs["ProductItem"].map(e=>({scheduleId:this.index,...e.getProductWithRemark()}))}}},u=d,p=(a("1a25"),a("2877")),f=Object(p["a"])(u,i,r,!1,null,"f2e79c2e",null);t["default"]=f.exports},ce18:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:["resizeBus"],data:function(){return{_actualResizeBus:null}},created:function(){"undefined"===typeof this.resizeBus?this.$data._actualResizeBus=this.$gmapDefaultResizeBus:this.$data._actualResizeBus=this.resizeBus},methods:{_resizeCallback:function(){this.resize()},_delayedResizeCallback:function(){var e=this;this.$nextTick((function(){return e._resizeCallback()}))}},watch:{resizeBus:function(e){this.$data._actualResizeBus=e},"$data._actualResizeBus":function(e,t){t&&t.$off("resize",this._delayedResizeCallback),e&&e.$on("resize",this._delayedResizeCallback)}},destroyed:function(){this.$data._actualResizeBus&&this.$data._actualResizeBus.$off("resize",this._delayedResizeCallback)}}},ce42:function(e,t,a){},cf19:function(e,t,a){},d092:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t0||"Please type your place name"}]},model:{value:e.address.name,callback:function(t){e.$set(e.address,"name",t)},expression:"address.name"}}),a("q-input",{ref:"name",staticClass:"col-12",attrs:{dense:"",filled:"",label:"Receiver's first name","lazy-rules":"",rules:[function(e){return e&&e.length>0||"Please type your first name"}]},model:{value:e.address.firstname,callback:function(t){e.$set(e.address,"firstname",t)},expression:"address.firstname"}}),a("q-input",{ref:"name",staticClass:"col-12",attrs:{dense:"",filled:"",label:"Receiver's last name","lazy-rules":"",rules:[function(e){return e&&e.length>0||"Please type your last name"}]},model:{value:e.address.lastname,callback:function(t){e.$set(e.address,"lastname",t)},expression:"address.lastname"}}),a("q-input",{staticClass:"col-12",staticStyle:{display:"none"},attrs:{dense:"",type:"email",filled:"",label:"Email"},model:{value:e.address.email,callback:function(t){e.$set(e.address,"email",t)},expression:"address.email"}}),a("VuePhoneNumberInput",{ref:"PhoneNumberInput",staticClass:"q-mx-sm",staticStyle:{"margin-bottom":"20px"},attrs:{"default-country-code":"TH","preferred-countries":["TH","US","GB"],error:e.phoneDummyError},on:{update:e.onUpdatePhone},model:{value:e.phoneDummy,callback:function(t){e.phoneDummy=t},expression:"phoneDummy"}}),a("q-input",{staticClass:"col-12",attrs:{dense:"",filled:"",autocomplete:"new-password",label:"Address details (Please Include Building Name, Tower, Floor, Room no, etc.)",rules:[function(e){return e&&e.length>0||"Please enter address details"}]},model:{value:e.address.address,callback:function(t){e.$set(e.address,"address",t)},expression:"address.address"}}),a("q-input",{staticClass:"col-12",attrs:{dense:"",filled:"",autocomplete:"new-password",label:"Subdistrict",rules:[function(e){return e&&e.length>0||"Please enter subdistrict"}]},model:{value:e.address.subDistrict,callback:function(t){e.$set(e.address,"subDistrict",t)},expression:"address.subDistrict"}}),a("q-input",{staticClass:"col-12",attrs:{dense:"",filled:"",autocomplete:"new-password",label:"District",rules:[function(e){return e&&e.length>0||"Please enter district"}]},model:{value:e.address.district,callback:function(t){e.$set(e.address,"district",t)},expression:"address.district"}}),a("q-input",{ref:"Province",staticClass:"col-12",attrs:{dense:"",filled:"",autocomplete:"new-password",label:"Province",rules:[function(e){return e&&e.length>0||"Please enter province"}]},model:{value:e.address.province,callback:function(t){e.$set(e.address,"province",t)},expression:"address.province"}}),a("q-input",{ref:"PostalCode",staticClass:"col-12",attrs:{dense:"",filled:"",autocomplete:"new-password",label:"Postal Code",rules:[function(e){return e&&e.length>0||"Please enter postal code"}],"stack-label":"",placeholder:"e.g. 10600"},model:{value:e.address.postcode,callback:function(t){e.$set(e.address,"postcode",t)},expression:"address.postcode"}})],1)],1),a("div",{staticClass:"text-right q-mt-sm"},[a("q-btn",{attrs:{loading:e.saveLoading,"no-caps":"",color:"white","text-color":"primary"},on:{click:e.onSave}},[e._v("Save Address")])],1)])],1),a("q-dialog",{attrs:{persistent:""},model:{value:e.dialogError.show,callback:function(t){e.$set(e.dialogError,"show",t)},expression:"dialogError.show"}},[a("DialogAlert",{attrs:{message:e.dialogError.message,"right-btn":"Close"},on:{rightClick:e.dialogError.rightClickCallback}})],1)],1)},r=[],n=(a("ddb0"),a("7bec")),s=a.n(n),o=(a("4413"),a("8a12")),l=a("24e8"),c=a("0d59"),d=a("27f9"),u=a("0378"),p=a("429b"),f=a("7460"),m=a("2f62"),h=a("2ba5"),v=a("2b0e"),y=a("755e"),g=a("58a7"),b=a("b012");const _={QDialog:l["a"],QSpinner:c["a"],QInput:d["a"],QForm:u["a"],QTabs:p["a"],QTab:f["a"]};v["default"].use(y,{load:{key:g["a"],libraries:"places"}});var w={name:"AddShippingAddressFromMap",components:{..._,VuePhoneNumberInput:s.a,FullScreenDialog:()=>a.e("chunk-vendors~6e8b5f81").then(a.bind(null,"0aa5")),TitleBar:()=>a.e("signin~31ecd969").then(a.bind(null,"1e1d")),TileBar:()=>a.e("chunk-5af30cec").then(a.bind(null,"7112")),DialogAlert:()=>a.e("chunk-5af30cec").then(a.bind(null,"bb5b"))},mixins:[h["a"]],data(){return{loaded:!1,predictList:[],allowConfirm:!1,draging:!1,loadingGeocode:!1,dialog:!1,keyword:null,tab:null,address:{name:null,firstname:null,lastname:null,address:null,subDistrict:null,district:null,province:null,postcode:null,email:null,phone:null},reportedMapCenter:{lat:13.736717,lng:100.523186},phoneDummy:void 0,phoneDummyError:!1,mapCenter:null,formatedAddress:null,saveLoading:!1,dialogError:{show:!1,message:"",rightClickCallback:()=>{}}}},computed:{...Object(m["b"])("user",["shippingAddressList"])},created(){this.sync(),this.$gmapApiPromiseLazy().then(()=>{this.loaded=!0,this.updateGeocode2(this.reportedMapCenter),this.onGetCurrentLocation()}),this.loadUser().then(()=>{this.autoFill()})},methods:{onGetCurrentLocation(){window.navigator.geolocation.getCurrentPosition(e=>{if(e&&e.coords&&(null!=e.coords.longitude||void 0!=e.coords.longitude)&&(null!=e.coords.latitude||void 0!=e.coords.latitude)){const t=new google.maps.LatLng(e.coords.latitude,e.coords.longitude);this.updateCenterWithSync(t)}},e=>{if(e)switch(e.code){case 1:this.dialogError={show:!0,message:"Permission denied, please check your browser settings.",rightClickCallback:()=>{this.dialogError.show=!1}};break;default:this.dialogError={show:!0,message:"We cannot detect your location.",rightClickCallback:()=>{this.dialogError.show=!1}};break}})},autoFill(){const e=this.$store.getters["user/user"];e.firstName?this.address.firstname=e.firstName:e.name&&(this.address.firstname=e.name.split(" ")[0]),e.lastName?this.address.lastname=e.lastName:e.name&&(this.address.lastname=e.name.split(" ")[1]||"-"),e.email&&(this.address.email=e.email),e.phone_number&&(this.address.phone=e.phone_number,this.phoneDummy=e.phone_number)},async onQuery(e){if(null===e)return;if(void 0===e)return;if(""===e)return;const t=new google.maps.places.AutocompleteService;t.getQueryPredictions({input:e,location:new google.maps.LatLng(13.736717,100.523186),radius:55e4},(e,t)=>{this.predictList=e})},async onChooseAddress(e){const t=new google.maps.places.PlacesService(this.$refs.dummymap),a={placeId:e.place_id,fields:["address_components","geometry","formatted_address"]};t.getDetails(a,(e,t)=>{this.address={...this.address,...Object(o["b"])(e.address_components)},this.address.location={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()},this.reportedMapCenter={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()},this.sync(),this.formatedAddress=e.formatted_address,this.allowConfirm=!0})},async onConfirm(){this.autoFill(),this.dialog=!0},async onSave(){const e=this.$refs["PhoneNumberInput"].isValid;if(!e)return void(this.phoneDummyError=!0);const t=await this.$refs.myForm.validate();if(t){const e=[...this.shippingAddressList,this.address];try{this.saveLoading=!0,await this.$store.dispatch("user/AddAddress",e)}catch(a){}finally{this.saveLoading=!1}this.dialog=!1,this.$router.go(-1)}},async updateCenter(e){this.reportedMapCenter={lat:e.lat(),lng:e.lng()},this.loadingGeocode=!0,this.updateGeocode(e)},async updateCenterWithSync(e){this.reportedMapCenter={lat:e.lat(),lng:e.lng()},this.sync(),this.loadingGeocode=!0,this.updateGeocode(e)},updateGeocode:Object(b["debounce"])((async function(e){this.loadingGeocode=!0;const t=await this.$store.dispatch("map/getGeocode",{lat:e.lat(),long:e.lng()});this.address={...this.address,...t.address,firstname:this.address.firstname,lastname:this.address.lastname,email:this.address.email,phone:this.address.phone},this.formatedAddress=t.formatted_address,this.loadingGeocode=!1,this.allowConfirm=!0}),300),updateGeocode2:Object(b["debounce"])((async function(e){const t=await this.$store.dispatch("map/getGeocode",{lat:e.lat,long:e.lng});this.address={...this.address,...t.address,firstname:this.address.firstname,lastname:this.address.lastname,email:this.address.email,phone:this.address.phone},this.formatedAddress=t.formatted_address}),300),onUpdatePhone(e){this.address.phone=e.formattedNumber,e.isValid&&(this.phoneDummyError=!1)},sync(){this.mapCenter=this.reportedMapCenter}}},C=w,P=(a("38cd"),a("2877")),k=Object(P["a"])(C,i,r,!1,null,"5d86002a",null);t["default"]=k.exports},e5d9:function(e,t,a){},e790:function(e,t,a){"use strict";a("cf19")},e807:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"col-12"},[a("div",{staticClass:" text-center current-status"},["Cancelled"!==e.isPaid?a("div",{staticClass:"row stepProgressBar justify-center"},e._l(e.localStatus,(function(t,i){return a("div",{key:i,staticClass:"row items-center",staticStyle:{display:"contents"}},[a("div",{class:"column items-center"},[a("div",{staticClass:"circle-icon",style:"border: 3px solid "+(t.active?"#2c2a74":"#e0e0e0")},[a("q-icon",{class:"text-"+(t.active?"primary":"grey-4"),attrs:{name:t.icon,size:(e.isMobile?20:25)+"px"}})],1),a("p",{class:"text-"+(t.active?"primary":"grey-4")+" text-status"},[e._v(" "+e._s(t.status)+" ")]),"delivering"!==t.value||e.localStatus[i+1].active?e._e():a("div",[a("q-btn",{attrs:{dense:"",flat:"","no-caps":"",color:"primary",label:"Track your order"},on:{click:e.onTrackingOrder}})],1)]),"complete"!==t.value?a("div",{staticClass:"line-status",style:"background-color: "+(t.active?"#2c2a74":"#e0e0e0")}):e._e()])})),0):a("div",{staticClass:"column items-center"},[a("div",{staticClass:"circle-icon",staticStyle:{border:"3px solid red"}},[a("q-icon",{staticClass:"text-red",attrs:{name:"close",size:(e.isMobile?20:25)+"px"}})],1),a("p",{staticClass:"text-red text-status"},[e._v("Payment Cancelled")])])])])},r=[],n={props:["statusList","isPaid"],data(){return{localStatus:[{status:"PENDING",value:"pending",active:!1,icon:"book_open_page_variant"},{status:"PICKED",value:"picked",active:!1,icon:"inbox_multiple"},{status:"DELIVERING",value:"delivering",active:!1,icon:"train_car"},{status:"COMPLETE",value:"complete",active:!1,icon:"check_circle"}]}},computed:{isMobile(){return this.$q.screen.width<600}},mounted(){if("Cancelled"!==this.isPaid)for(let e=0;e<=this.localStatus.length-1;e++)if(this.localStatus[e].active=!0,this.localStatus[e].value===this.statusList.pickingStatus)break},methods:{onTrackingOrder(){const{id:e}=this.$router.currentRoute.params;this.$router.push("/tracking/"+e)}}},s=n,o=(a("0e21"),a("2877")),l=Object(o["a"])(s,i,r,!1,null,"170a5cc0",null);t["default"]=l.exports},f241:function(e,t,a){"use strict";a("f9f5")},f4a0:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=!1,a=void 0;return function(){return t||(t=!0,a=e()),a}}},f656:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var a=[],i=!0,r=!1,n=void 0;try{for(var s,o=e[Symbol.iterator]();!(i=(s=o.next()).done);i=!0)if(a.push(s.value),t&&a.length===t)break}catch(l){r=!0,n=l}finally{try{!i&&o["return"]&&o["return"]()}finally{if(r)throw n}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a("b7d9"),n=s(r);function s(e){return e&&e.__esModule?e:{default:e}}var o={draggable:{type:Boolean},editable:{type:Boolean},options:{type:Object},path:{type:Array,twoWay:!0,noBind:!0},paths:{type:Array,twoWay:!0,noBind:!0}},l=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];t.default=(0,n.default)({props:{deepWatch:{type:Boolean,default:!1}},events:l,mappedProps:o,name:"polygon",ctr:function(){return google.maps.Polygon},beforeCreate:function(e){e.path||delete e.path,e.paths||delete e.paths},afterCreate:function(e){var t=this,a=function(){};this.$watch("paths",(function(r){if(r){a(),e.setPaths(r);for(var n=function(){t.$emit("paths_changed",e.getPaths())},s=[],o=e.getPaths(),l=0;l