1(function(p){"use strict";var A=[];var n={};var $={};var Y;var K;const c=8e4;const m={form:"application/x-www-form-urlencoded; charset=UTF-8",json:"application/json"};var L;if(typeof map_style!=="undefined"&&map_style!==null){map_style=map_style?JSON.parse(map_style):""}const z=site_url+"/apilocations";const q="store";window.StoreMapName="Mapstore";var u=function(e){console.debug(e)};var V=function(e){alert(JSON.stringify(e))};var U=function(e,t){localStorage.setItem(e,t)};var B=function(e){return localStorage.getItem(e)};var J=function(e){localStorage.removeItem(e)};function i(e,t,a){let s=JSON.parse(localStorage.getItem(e));if(!s){s={}}s[t]=a;localStorage.setItem(e,JSON.stringify(s))}window.getFromLocalStorageStore=function(e,t){const a=JSON.parse(localStorage.getItem(e));return a?a[t]:undefined};function G(e,t){let a=JSON.parse(localStorage.getItem(e));if(!a){return}delete a[t];localStorage.setItem(e,JSON.stringify(a))}window.getLocation=function(){const e=getFromLocalStorageStore(q,"selectedCityId");const t=getFromLocalStorageStore(q,"selectedAreaId");const a=getFromLocalStorageStore(q,"selectedStateId");const s=getFromLocalStorageStore(q,"selectedPostalId");return{city_id:e,area_id:t,state_id:a,postal_id:s}};jQuery.fn.exists=function(){return this.length>0};window.empty=function(e){if(typeof e==="undefined"||e==null||e==""||e=="null"||e=="undefined"){return true}return false};jQuery(document).ready(function(){if(p(".sidebar-panel").exists()){p(".sidebar-panel").slideAndSwipe()}if(p(".headroom").exists()){var e=document.querySelector(".headroom");u(e);var t=new Headroom(e);t.init()}p(document).ready(function(){p(".dropdown").on("show.bs.dropdown",function(){p(this).find(".dropdown-menu").first().stop(true,true).slideDown(150)});p(".dropdown").on("hide.bs.dropdown",function(){p(this).find(".dropdown-menu").first().stop(true,true).slideUp(150)})});if(p(".star-rating").exists()){le()}p(document).on("change","#min_range_slider",function(){p(".min-selected-range").html(p(this).val())});p(".collapse").on("show.bs.collapse",function(){p(this).parent().find("a").removeClass("closed").addClass("opened")}).on("hidden.bs.collapse",function(){p(this).parent().find("a").removeClass("opened").addClass("closed")});if(p(".sticky-sidebar").exists()){Y=new StickySidebar(".sticky-sidebar",{topSpacing:20})}if(p(".sticky-cart").exists()){K=new StickySidebar(".sticky-cart",{topSpacing:20})}p(".category-nav").sticky({topSpacing:0});p(".gallery_magnific").magnificPopup({delegate:"a",type:"image",gallery:{enabled:true},removalDelay:300,mainClass:"mfp-fade"});p(document).on("click",".toogle-radio",function(){var e=p(this).find("input");if(e.prop("checked")==false){e.prop("checked",true)}else{e.prop("checked",false)}});p(document).on("click",".desired_delivery",function(){X(p(this).find("input").val(),{now:"hide",schedule:"show"},".schedule-section")});p(document).on("click",".a-account",function(){p(".login-wrap,.signup-wrap,.account-section").hide();p("."+p(this).data("id")).show()});p(document).on("click",".close-modal",function(){ee(p(this).data("id"))});if(p(".auto_typehead").exists()){var r={};p(".auto_typehead").each(function(e,t){var a=p(this);var s=a.data("api");var i=a.data("display");var o=Q(a.data("settings"));p.each(o,function(e,t){if(t=="true"){r[e]=true}else if(t=="false"){r[e]=false}else{r[e]=t}});r["input"]=a;r["source"]={user:{display:i.split(","),ajax:{method:"POST",url:ajaxurl+"/"+s,path:"details.data",data:{q:"{{query}}",YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")},beforeSend:function(e,t){u("before send");if(s=="getlocation_autocomplete"){if(p(".change-address-modal").exists()){p(".change-address-modal").find(".modal-content").addClass("opened")}}},callback:{done:function(e){return e},fail:function(e,t,a){},always:function(e,t,a){u("always")},then:function(e,t){}}}}};r["template"]=function(e,t){return a.data("template")};r["emptyTemplate"]=a.data("emptytemplate");r["callback"]={onClickAfter:function(e,t,a,s){var i=e.data("api");switch(i){case"getlocation_autocomplete":var o=H();var r="id="+a.id+"&addressLine1="+a.addressLine1+"&addressLine2="+a.addressLine2;if(a.provider=="google.maps"){if(typeof a.place_type!=="undefined"&&a.place_type!==null){r+="&place_type="+a.place_type}}else if(a.provider=="mapbox"){if(typeof a.latitude!=="undefined"&&a.latitude!==null){r+="&latitude="+a.latitude;r+="&longitude="+a.longitude;r+="&place_type="+a.place_type}}r+="&services="+o;
1v("getLocationDetails",r,"typeahead_loader",1);break;case"getSearchSuggestion":window.location.href=a.url;break}},onCancel:function(e,t,a){if(s=="getlocation_autocomplete"){if(p(".change-address-modal").exists()){p(".change-address-modal").find(".modal-content").removeClass("opened")}}}};r["selector"]={list:"typeahead__list list-unstyled"};p.typeahead(r)})}p(document).on("click",".get_current_location",function(){Z("get_place_details")});if(p(".load-ajax").exists()){p(".load-ajax").each(function(e,t){var a=p(t).data("action");var s=p(t).data("params");var i=p(t).data("loader_type");var o=p(t).data("single_call");var r=p(t).data("silent");var d=p(t).data("method");var l=p(t).data("content_type");var n=Q(s);if(l=="json"){if(a=="getFeed"){var c=n.services;s={local_id:n.local_id,target:n.target,YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),filters:{services:c.split(",")}}}s=JSON.stringify(s)}v(a,s,i,o,r,d,l)})}p(document).on("click",".show-more",function(e){var t=p(this).data("action");var a=p(this).data("params");var s=p(this).data("loader_type");var i=p(this).data("single_call");var o=Q(a);var r=o.filters;r=r.replace(/\\/g,"");r=JSON.parse(r);a={local_id:o.local_id,page:o.page,target:o.target,YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),filters:r};a=JSON.stringify(a);v(t,a,s,i,null,"PUT","json")});p(document).on("click",".restaurants-filter",function(e){var t=p("#local_id").val();var a=p("#target").val();var s="";var i=p(".sort:checked").val();var o=p(".price_range:checked").val();var r=p("#min_range_slider").val();var d=p(".ratings_selected").val();var l=[];var n=[];p(".services:checked").each(function(){l.push(p(this).val())});p(".cuisine:checked").each(function(){n.push(p(this).val())});if(typeof i!=="undefined"&&i!==null){}else i="";s={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),local_id:t,target:a,filters:{services:l,cuisine:n,price_range:o,max_fee:parseInt(r),ratings:parseInt(d),sort:i}};s=JSON.stringify(s);v("getFeed",s,"restaurants_filter",1,1,"PUT","json")});p(function(){te()});p("#changeAddress").on("shown.bs.modal",function(e){p(".auto_typehead").val("");p(".auto_typehead").focus()});p("#changeAddress").on("hidden.bs.modal",function(e){p(".change-address-modal").find(".modal-content").removeClass("opened")});p(document).on("click",".get-item-details",function(e){var t=p(this).data("item_uuid");var a=p(this).closest("section").data("cat_id");v("getMenuItem","&merchant_id="+merchant_id+"&item_uuid="+t+"&cat_id="+a)});p(document).on("click",".choose-size",function(){var e=p(this).find("input:checked").val();if(typeof e!=="undefined"&&e!==null){_e(e)}});p(document).on("click",".addon-items",function(e){})});var W=function(e){var t="";var a=parseInt(list_limit);u("$itemlimit=>"+a);for(let e=0;e<a;e++){t+='<div class="col-lg-3 col-md-3 mb-4 mb-lg-3">';t+='<div class="position-relative skeleton-height">';t+='<div class="skeleton-placeholder"></div>';t+="</div>";t+="</div>"}e.html(t)};var Z=function(a){var e={enableHighAccuracy:true,timeout:5e3,maximumAge:0};if(navigator.geolocation){de("typeahead_loader",1);navigator.geolocation.getCurrentPosition(function(e){var t=H();v("reverseGeocoding","lat="+e.coords.latitude+"&lng="+e.coords.longitude+"&services="+t+"&next_steps="+a,"typeahead_loader",1)},function(e){de("typeahead_loader",false);f(e.message)},e)}else{f(_("Error: Your browser doesn't support geolocation."));de("typeahead_loader",false)}};var H=function(){var e="";if(p("#services").exists()){p("#services option:selected").each(function(){e+=p(this).val()+","})}return e};function Q(e){if(typeof e!="string"||e.length==0)return{};var t=e.split("&");var a=t.length;var s,i={},o,r;for(var d=0;d<a;d++){s=t[d].split("=");o=decodeURIComponent(s[0]);if(o.length==0)continue;r=decodeURIComponent(s[1]);if(typeof i[o]=="undefined")i[o]=r;else if(i[o]instanceof Array)i[o].push(r);else i[o]=[i[o],r]}return i}var X=function(a,e,s){p.each(e,function(e,t){u(e+"=>"+t+"=>"+a);if(a==e){if(t=="show"){p(s).show()}else{p(s).hide()}}})};var ee=function(e){p("#"+e).modal("hide")};var te=function(){L=p(".lazy").Lazy({chainable:false,beforeLoad:function(e){},afterLoad:function(e){e.parent().parent().addClass("image-loaded")},onError:function(e){},onFinishedAll:function(){}})};var h=function(){setTimeout(()=>{te()},500)};var _=function(e){return e};const ae=new Notyf({duration:1e3*4});var f=function(e,t){switch(t){case"error":ae.error(e);break;default:ae.success(e);break}};const se=new Notyf({duration:1e4*6,dismissible:true,icon:""});var ie=function(e){se.success(e)};var g=function(){var e=Date.now()+(Math.random()*1e5).toFixed();return e};window.addValidationRequest=function(){var e="";var t=p("meta[name=YII_CSRF_TOKEN]").attr("content");e+="&YII_CSRF_TOKEN="+t;return e};var v=function(e,t,a,s,i,o,r){var d=g();if(!empty(s)){d=s}if(empty(i)){i=null}var l="";if(empty(o)){o="POST"}if(empty(r)){l="application/x-www-form-urlencoded; charset=UTF-8";t+=addValidationRequest()}else{l="application/json"}n[d]=p.ajax({url:ajaxurl+"/"+e,method:o,data:t,dataType:"json",contentType:l,timeout:c,crossDomain:true,beforeSend:function(e){if(i==null){}else{de(a,true)}if(n[d]!=null){n[d].abort();clearTimeout($[d])}else{$[d]=setTimeout(function(){n[d].abort()},c)}}});n[d].done(function(e){var t="";if(typeof e.details!=="undefined"&&e.details!==null){if(typeof e.details.next_action!=="undefined"&&e.details.next_action!==null){t=e.details.next_action}}if(e.code==1){switch(t){case"redirect":window.location.href=e.details.redirect_url;break;case"get_place_details":var a=e.details.data;p(".auto_typehead").val(a.address.address1);var s="id="+a.place_id+"&addressLine1="+a.address.address1+"&addressLine2="+a.address.address2;if(e.details.provider=="google.maps"){if(typeof a.place_type!=="undefined"&&a.place_type!==null){s+="&place_type="+a.place_type}}else if(e.details.provider=="mapbox"){if(typeof a.latitude!=="undefined"&&a.latitude!==null){s+="&latitude="+a.latitude;s+="&longitude="+a.longitude;s+="&place_type="+a.place_type}}s+="&services="+e.details.services;
1v("getLocationDetails",s,"typeahead_loader",1);break;case"sidebar_filter":p(".sidenav-filter").html(e.details.data);p(".min-selected-range").html(p("#min_range_slider").val());le();p("#moreCuisine").on("shown.bs.collapse",function(){p(".more-cuisine u").html(_("View less"))});p("#moreCuisine").on("hidden.bs.collapse",function(){p(".more-cuisine u").html(_("Show more +"))});break;case"fill_feed":oe({action:e.details.action,title:e.details.total_message,data:e.details.data,target:e.details.target,append:e.details.append,show_next_page:e.details.show_next_page,next_page_data:e.details.next_page_data});break;case"merchant_menu":MerchantMenu({data:e.details.data});break;case"show_item_details":p("#itemModal").modal("show");ue(e.details.data);break;case"fill_price_format":p(e.details.data.target).html(e.details.data.pretty_price);break}}else{switch(t){case"location_details_no_results":f(e.msg);p(".typeahead__container").removeClass("loading");break;case"clear_restaurant_results":var i=e.details.target;var o="";o+='<div class="list-items mt-4 row hover01 list-loader load-ajax"></div>';o+=e.details.data;p(i).html(o);break;default:f(e.msg);break}}});n[d].always(function(){de(a,false);n[d]=null;clearTimeout($[d])});n[d].fail(function(e,t){clearTimeout($[d])})};var oe=function(e){var t="";var a="";var s;var i;var o="";var r=parseInt(e.append);var d=e.target;var l=e.show_next_page;t+='<h4 class="total_message title">';t+="<span>"+e.title+"</span>";t+='<div class="skeleton-placeholder"></div>';t+="</h4>";t+='<div class="list-items mt-4 row hover01 list-loader load-ajax">';p.each(e.data,function(e,t){a+='<div class="col-lg-3 col-md-3 mb-4 mb-lg-3">';a+='<a href="'+t.url+'">';a+='<div class="position-relative">';a+='<div class="skeleton-placeholder"></div>';a+='<figure><img class="rounded lazy" data-src="'+t.url_logo+'"/></figure>';a+='<h6 class="mt-2">'+t.restaurant_name+"</h6>";a+='<div class="row">';a+='<div class="col d-flex justify-content-start align-items-center"> ';a+='<p class="m-0"><i class="zmdi zmdi-time"></i> '+t.delivery_estimation+"</p>";a+="</div>";a+='<div class="col d-flex justify-content-end align-items-center">';if(t.delivery_fee_raw>0){a+='<p class="m-0"><i class="zmdi zmdi-car"></i> '+t.delivery_fee+"</p>"}a+="</div>";a+="</div>";a+='<div class="position-top">';if(typeof t.cuisine!=="undefined"&&t.cuisine!==null){if(t.cuisine.length>0){s=t.cuisine[0].bgcolor;i=t.cuisine[0].fncolor;a+='<span class="badge" style="background:'+s+";font-color:"+i+';">'+t.cuisine[0].cuisine_name+"</span>"}}a+='<span class="badge rounded-pill float-right" style="background:'+s+";font-color:"+i+';" >'+t.ratings+"</span>";a+="</div>";a+="</div>";a+="</a>";a+="</div>"});if(r<=0){t+=a}t+="</div>";if(l==true){u("SHOW NEXT");p.each(e.next_page_data,function(e,t){if(e=="filters"){o+="&filters="+re(JSON.stringify(t))}else o+=e+"="+t+"&"});u("ATTRIBUTES");u(o);t+='<div class="text-center show_more_section mt-5">';t+='<a href="javascript:;" class="btn btn-black show-more" ';t+="data-action="+e.action+" data-params="+o;t+="\n";t+="data-loader_type="+"show_more"+' data-single_call="1"';t+='data-silent=""';t+=">"+_("Show more")+"</a>";t+='<div class="m-auto circle-loader medium" data-loader="circle-side"></div>';t+="</div>"}else{p(".show_more_section").hide()}if(r>0){p(".list-items").append(a)}else{p(d).html(t)}h()};var re=function(e){return(e+"").replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0")};var de=function(e,t){switch(e){case"getLocationDetails":case"typeahead_loader":if(t){p(".typeahead__container").addClass("loading")}else{setTimeout(function(){p(".typeahead__container").removeClass("loading")},1e3)}break;case"show_more":if(t){p(".show_more_section").addClass("loading")}else{p(".show_more_section").removeClass("loading")}break;case"results_loader":if(t){W(p(".list-loader"))}else{}break;case"restaurants_filter":if(t){W(p(".list-loader"));p(".restaurants-filter").addClass("loading");p(".total_message").addClass("loading");p(".show_more_section").hide()}else{p(".restaurants-filter").removeClass("loading");p(".total_message").removeClass("loading")}break;case"add_to_cart":if(t){p(".add_to_cart").addClass("loading")}else{p(".add_to_cart").removeClass("loading")}break;default:break}};var le=function(){var _={};p(".star-rating").each(function(e,t){var a=p(this);var s=p(this).data("totalstars");var i=p(this).data("initialrating");var o=p(this).data("strokecolor");var r=p(this).data("ratedcolor");var d=parseInt(p(this).data("strokewidth"));var l=parseInt(p(this).data("starsize"));var n=p(this).data("readonly");var c=p(this).data("minrating");var m=p(this).data("disableafterrate");var u=p(this).data("usefullstars");var h=p(this).data("hovercolor");_["totalStars"]=!empty(s)?s:"";_["initialRating"]=!empty(i)?i:"";_["minRating"]=!empty(c)?c:"";_["strokeColor"]=!empty(o)?o:"";_["ratedColor"]=!empty(r)?r:"";_["hoverColor"]=!empty(h)?h:"";_["strokeWidth"]=!empty(d)?d:"";_["starSize"]=!empty(l)?l:"";_["readOnly"]=!empty(n)?n:"";_["disableAfterRate"]=m;_["useFullStars"]=!empty(u)?u:"";_["callback"]=function(e,t){t.parent().find(".ratings_selected").val(e);qa.$refs.ReviewRef.rating_value=e};p(this).starRating(_)})};var ne=function(){setTimeout(function(){Y.updateSticky()}
1,1)};var ce=function(){setTimeout(function(){if(typeof K!=="undefined"&&K!==null){K.updateSticky()}},1)};var me=function(e){p(".menu-left").removeClass("loading");p("#merchant-menu").removeClass("loading");var t=e.data.category;var a=e.data.items;Vue.createApp({data(){return e.data}}).mount("#menu-category");var s=[];var i=[];if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){i.push(a[t])});s.push({cat_id:t.cat_id,category_name:t.category_name,category_uiid:t.category_uiid,items:i});i=[]})}var s={category:s};Vue.createApp({data(){return s}}).mount("#merchant-menu");ne()};var r;var d;var l;var ue=function(e){r=e.items;d=e.addons;l=e.addon_items;var t={items:r};if(typeof E!=="undefined"&&E!==null){E.$data.items=r;p("#item-details .lazy").attr("src",r.url_image)}else{E=Vue.createApp({data(){return t},created(){}}).mount("#item-details")}};var he=function(e){var t=p("#itemModal .modal-body");r=e.items;d=e.addons;l=e.addon_items;var i="";i+='<div class="item_s" data-item_token="'+r.item_token+'" >';i+='<div class="list-items">';i+='<div class="position-relative">';i+='<div class="skeleton-placeholder"></div>';i+='<img class="rounded lazy" data-src="'+r.url_image+'"/>';
1i+="</div>";i+="</div>";i+="</div>";i+='<h4 class="m-0 mt-2 mb-2">'+r.item_name+"</h4>";if(!empty(r.item_description)){i+="<p>"+r.item_description+"</p>"}var a=0;if(typeof r.price!=="undefined"&&r.price!==null){a=Object.keys(r.price).length}if(a>0){i+='<div class="mb-4 btn-group btn-group-toggle input-group-small choose-size flex-wrap" data-toggle="buttons">';var o=1;p.each(r.price,function(e,t){var a=o==1?"active":"";var s=o==1?"checked='checked'":"";i+='<label class="btn '+a+' ">';i+='<input value="'+t.item_size_id+'" name="size_uuid" id="size_uuid" class="size_uuid" type="radio" '+s+"> ";if(t.discount<=0){i+=t.size_name+" "+t.pretty_price}else{i+=t.size_name+" <del>"+t.pretty_price+"</del> "+t.pretty_price_after_discount}i+="</label>";o++});i+="</div>"}i+='<div class="addon-list"></div>';t.html(i);i="";var s=p('input[name="size_uuid"]:checked').val();_e(s)};var _e=function(e){var i="";var t=p("#itemModal .addon-list");if(typeof r.item_addons!=="undefined"&&r.item_addons!==null){if(typeof r.item_addons[e]!=="undefined"&&r.item_addons[e]!==null){p.each(r.item_addons[e],function(e,a){if(typeof d[a]!=="undefined"&&d[a]!==null){var s={multi_option:d[a].multi_option,multi_option_value:d[a].multi_option_value,require_addon:d[a].require_addon,pre_selected:d[a].pre_selected,sub_items:d[a].sub_items};i+='<DIV class="addon-rows">';i+='<div class="d-flex align-items-center heads">';i+='<div class="flexcol flex-grow-1">';i+='<h5 class="m-0">'+d[a].subcategory_name+"</h5>";i+='<p class="text-grey m-0 mb-1">'+fe(s)+"</p>";i+="</div>";i+='<div class="flexcol">';i+='<h6 class="m-0">'+ge(d[a].require_addon)+"</h6>";i+="</div>";i+="</div>";var t=d[a].sub_items;if(t.length>0){i+='<ul class="list-unstyled list-selection list-addon no-hover m-0 p-0"';i+='data-subcat_id="'+a+'" ';i+='data-multi_option="'+s.multi_option+'" data-multi_option_value="'+s.multi_option_value+'" ';i+='data-require_addon="'+s.require_addon+'" data-pre_selected="'+s.pre_selected+'" ';i+=">";p.each(t,function(e,t){if(typeof l[t]!=="undefined"&&l[t]!==null){i+=pe(l[t],a,s)}});i+="</ul>"}i+="</DIV>"}})}}t.html(i);ItemSummary()};var pe=function(e,t,a){u("AddonItemsRows");u(a);var s=!empty(a.multi_option)?a.multi_option:"";var i=!empty(a.multi_option_value)?a.multi_option_value:"";u("multi_option=>"+s);u("multi_option_value=>"+i);var o="";o+='<li class="d-flex align-items-center" >';switch(s){case"custom":o+='<div class="custom-control custom-checkbox flex-grow-1">';o+='<input type="checkbox" id="sub_item_id'+e.sub_item_id+'" name="sub_item_id_'+t+'" value="'+e.sub_item_id+'" class="addon-items custom-control-input">';o+='<label class="custom-control-label font14 bold" for="sub_item_id'+e.sub_item_id+'">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+="</label>";o+="</div>";o+='<p class="m-0">+'+e.pretty_price+"</p>";break;case"multiple":o+='<div class="position-relative quantity-wrapper ">';o+='<div class="quantity-parent">';o+='<div class="quantity d-flex justify-content-between m-auto">';o+='<div><a href="javascript:;" class="rounded-pill qty-btn multiple_qty" data-id="less"><i class="zmdi zmdi-minus"></i></a></div>';o+='<div class="qty" data-id="'+e.sub_item_id+'">0</div>';o+='<div><a href="javascript:;" class="rounded-pill qty-btn multiple_qty" data-id="plus"><i class="zmdi zmdi-plus"></i></a></div>';o+="</div>";o+="</div> ";o+='<a href="javascript:;" class="btn quantity-add-cart multiple_qty">';o+='<i class="zmdi zmdi-plus"></i>';o+="</a>";o+="</div>";o+='<div class="flexcol ml-3">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+='<p class="m-0 text-grey">+'+e.pretty_price+"</p>";o+="</div>";break;default:o+='<div class="custom-control custom-radio flex-grow-1">';o+='<input type="radio" id="sub_item_id'+e.sub_item_id+'" name="sub_item_id_'+t+'" value="'+e.sub_item_id+'" class="addon-items custom-control-input">';o+='<label class="custom-control-label font14 bold" for="sub_item_id'+e.sub_item_id+'">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+="</label>";o+="</div>";o+='<p class="m-0">+'+e.pretty_price+"</p>";break}o+="</li>";return o};var fe=function(e){var t="";var a=!empty(e.multi_option)?e.multi_option:"";var s=!empty(e.sub_items)?e.sub_items:"";var i=!empty(e.multi_option_value)?e.multi_option_value:"";switch(a){case"one":t=_("Select 1");break;case"multiple":t=_("Choose up to ")+i;break;case"two_flavor":t=_("Select flavor "+i);break;
1case"custom":t=_("Choose up to ")+i;break;default:break}return t};var ge=function(e){if(e>0){return _("Required")}else return _("Optional")};var y=0;var b=0;var ve=0;var t=0;var ye="";var w=0;var be=0;var x;var S;var we=0;var xe=[];var o=[];var Se=0;var Te=0;var ke=function(){u("ItemSummary");w=0;y=0;ve=0;b=0;t=E.size_id;be=0;r=C;l=j;if(!empty(r.price[t])){if(r.price[t].discount>0){be=!empty(r.price[t])?parseFloat(r.price[t].price_after_discount):0}else be=!empty(r.price[t])?parseFloat(r.price[t].price):0}w+=be;var i=[];var o=[];p(".list-addon").each(function(e,t){x=p(t).attr("data-multi_option");Se=p(t).attr("data-require_addon");we=p(t).attr("data-subcat_id");Te=p(t).attr("data-multi_option_value");if(x=="custom"||x=="one"){S=p(t).find(".addon-items:checked")}else if(x=="multiple"){S=p(t).find(".qty")}if(Se==1){o.push(we)}if(Te>0){var a=p(t).find("input:checked");var s=a.length;if(s>=Te){p(t).find("input:checkbox:not(:checked)").attr("disabled",true)}else{p(t).find("input:disabled").attr("disabled",false)}}if(typeof S!=="undefined"&&S!==null){S.each(function(e,t){if(x=="multiple"){y=p(t).data("id");b=parseInt(p(t).html());ve=!empty(l[y])?parseFloat(l[y].price):0;w+=b*ve;if(b>0){i.push(we)}}else{y=p(t).val();ve=!empty(l[y])?parseFloat(l[y].price):0;w+=ve;i.push(we)}})}});u("REQUIRED");u(o);u(i);u("END REQUIRED");var a=true;if(o.length>0){p.each(o,function(e,t){if(i.includes(t)===false){a=false;return false}})}u("$required_meet=>"+a);if(a==false){p(".add_to_cart").attr("disabled",true)}else p(".add_to_cart").attr("disabled",false);v("priceFormat","price="+w+"&target=.item-summary","")};var Ie=function(){t=p('input[name="size_uuid"]:checked').val();ye=p(".item_s").attr("data-item_token");y=0;b=0;ve=0;xe=[];o="";var s="";p(".list-addon").each(function(e,t){x=p(t).attr("data-multi_option");we=p(t).attr("data-subcat_id");if(x=="custom"||x=="one"){S=p(t).find(".addon-items:checked")}else if(x=="multiple"){S=p(t).find(".qty")}var a=0;if(typeof S!=="undefined"&&S!==null){S.each(function(e,t){if(x=="multiple"){y=p(t).attr("data-id");b=parseInt(p(t).html());ve=!empty(j[y])?parseFloat(j[y].price):0}else{y=p(t).val();ve=!empty(j[y])?parseFloat(j[y].price):0;b=1}if(b>0){s+='{"sub_item_id":'+y+', "sub_item_qty":'+b+"},"}})}if(!empty(s)){s=s.slice(0,-1);o+='"'+we+'":['+s+"],";s="";xe.push({subcat_id:we,multi_option:x,multi_option_value:p(t).attr("data-multi_option_value")})}});o=o.slice(0,-1);o="{"+o+"}";o=JSON.parse(o);u(o);var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),item_token:ye,item_size_id:t,addons_category:xe,addons_items:o};e=JSON.stringify(e);v("addCartItems",e,"add_to_cart",1,1,"PUT","json")};window.setCookie=function(e,t,a){const s=new Date;s.setTime(s.getTime()+a*24*60*60*1e3);let i="expires="+s.toUTCString();document.cookie=e+"="+t+";"+i+";path=/"};window.getCookie=function(e,t,a){let s=e+"=";let i=document.cookie.split(";");for(let t=0;t<i.length;t++){let e=i[t];while(e.charAt(0)==" "){e=e.substring(1)}if(e.indexOf(s)==0){return e.substring(s.length,e.length)}}return""};const Ce={props:["message","donnot_close"],data(){return{new_message:""}},methods:{show(){p("#loadingBox").modal("show")},close(){p("#loadingBox").modal("hide")},setMessage(e){this.new_message=e}},template:` 2 <div class="modal" id="loadingBox" tabindex="-1" role="dialog" aria-labelledby="loadingBox" aria-hidden="true" 3 data-backdrop="static" data-keyboard="false" 4 > 5 <div class="modal-dialog modal-dialog-centered modal-loadingbox" role="document"> 6 <div class="modal-content"> 7 <div class="modal-body"> 8 <div class="loading mt-2"> 9 <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 10 </div> 11 <p class="text-center mt-2"> 12 <div v-if="!new_message">{{message}}</div> 13 <div v-if="new_message">{{new_message}}</div> 14 <div>{{donnot_close}}</div> 15 </p> 16 </div> 17 </div> <!--content--> 18 </div> <!--dialog--> 19 </div> <!--modal--> 20 `};const Oe={props:["title","label","next_url","auto_generate_uuid","enabled_auto_detect_address"],components:{"loading-box":Ce},data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],autosaved_addres:true}},created(){if(this.enabled_auto_detect_address){this.detectLocation()}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{detectLocation(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(s=>
20{if(s.data.code==1){let e={id:s.data.details.data.place_id,country:s.data.details.data.address.country,country_code:s.data.details.data.address.country_code};let t=JSON.parse(some_words);let a=t.we_detected;a=a.replace("{address}",s.data.details.data.address.formatted_address);ElementPlus.ElMessageBox.confirm(a,t.address_detected,{confirmButtonText:t.yes,cancelButtonText:t.no,type:"info"}).then(()=>{this.getLocationDetails(e)})["catch"](()=>{})}})["catch"](e=>{}).then(e=>{})},showList(){this.show_list=true},clearData(){this.data=[];this.q=""},getLocationDetails(e){this.show_list=false;var t;var a=3;t="id="+e.id;t+="&country="+e.country;t+="&country_code="+e.country_code;t+="&description="+e.description;t+="&autosaved_addres="+this.autosaved_addres;t+="&auto_generate_uuid="+this.auto_generate_uuid;t+="&cart_uuid="+getCookie("cart_uuid");t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/getLocationDetails",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.awaitingSearch=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.q=e.details.data.address.formatted_address;if(this.auto_generate_uuid==true||this.auto_generate_uuid=="true"){setCookie("cart_uuid",e.details.cart_uuid,30)}window.location.href=this.next_url}else{this.error[0]=e.msg}});n[a].always(e=>{this.awaitingSearch=false})}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:` 21 <loading-box ref="loading_box" message="Getting address" donnot_close="do not close this window" ></loading-box> 22 <div class="position-relative search-geocomplete"> 23 <div v-if="!awaitingSearch" class="img-20 m-auto pin_placeholder icon"></div> 24 <div v-if="awaitingSearch" class="icon" data-loader="circle"></div> 25 26 <input @click="showList" v-model="q" class="form-control form-control-text" 27 :placeholder="label.enter_address" > 28 29 <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div> 30 <div v-if="!hasData" class="search_placeholder pos-right img-20"></div> 31 </div> 32 33 <div class="search-geocomplete-results" v-if="show_list"> 34 <ul class="list-unstyled m-0 border"> 35 <li v-for="items in data"> 36 <a href="javascript:;" @click="getLocationDetails(items)" > 37 <h6 class="m-0">{{items.addressLine1}}</h6> 38 <p class="m-0 text-grey">{{items.addressLine2}}</p> 39 </a> 40 </li> 41 </ul> 42 </div> 43 `};const je={props:["label","addresses","location_data","saveplace"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],autosaved_addres:true,is_fullwidth:false,visible:false}},mounted(){if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile){this.is_fullwidth=true}}},computed:{hasAddress(){if(!empty(this.addresses)){if(Object.keys(this.addresses).length>0){return true}}return false},hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},showModal(){this.visible=true},closeModal(){this.visible=false;this.$emit("afterClose")},close(){this.visible=false},getLocationDetails(e){const t=e?.provider??null;console.debug("provider",t);console.debug("getLocationDetails",e);this.show_list=false;var a;var s=3;if(t=="mapbox"){a="id="+`${e.longitude},${e.latitude}`}else{a="id="+e.id}a+="&country="+e.country;a+="&country_code="+e.country_code;a+="&autosaved_addres="+this.autosaved_addres;a+="&saveplace="+this.saveplace;a+="&description="+e.description;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/getLocationDetails",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.awaitingSearch=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.q="";this.closeModal();this.$emit("setLocation",e.details.data)}else{this.error[0]=e.msg}});n[s].always(e=>{this.awaitingSearch=false})},setPlaceID(e){var t;var a=4;t="place_id="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/setPlaceID",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$emit("setPlaceid")}else{this.error[0]=e.msg}});n[a].always(e=>{})},editAddress(e){this.$emit("setEdit",e)},deleteAddress(e){var t;var a=5;t="address_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/deleteAddress",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$emit("loadData");this.$emit("afterDelete",e)}
43else{this.error[0]=e.msg}});n[a].always(e=>{})},locateLocation(){this.awaitingSearch=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{this.awaitingSearch=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.awaitingSearch=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(t=>{if(t.data.code==1){let e=[];e.id=t.data.details.data.place_id;e.country=t.data.details.data.address.country;e.country_code=t.data.details.data.address.country_code;this.getLocationDetails(e)}else{ElementPlus.ElNotification({title:"",message:t.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false})},searchLocation(e,t){let a=[];axios({method:"POST",url:ajaxurl+"/getlocationAutocomplete",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){a=e.data.details.data}else{a=[]}t(a)})["catch"](e=>{}).then(e=>{})}},template:` 44 <el-dialog v-model="visible" :close-on-click-modal="false" :show-close="true" :title="label.title" > 45 46 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 47 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 48 </div> 49 50 <div class="position-relative search-geocomplete" v-loading="awaitingSearch" > 51 <el-autocomplete 52 v-model="q" 53 :placeholder="label.enter_address" 54 size="large" 55 class="w-100" 56 :trigger-on-focus="false" 57 value-key="description" 58 :fit-input-width="is_fullwidth" 59 clearable 60 :fetch-suggestions="searchLocation" 61 @select="getLocationDetails" 62 > 63 <template #suffix> 64 <button @click="locateLocation" type="button" class="btn btn-link"> 65 <i class="zmdi zmdi-my-location font20" style="color:#000;"></i> 66 </button> 67 </template> 68 </el-autocomplete> 69 </div> 70 71 <template v-if="hasAddress"> 72 <div class="p-2"></div> 73 <el-scrollbar max-height="200px" class="w-100"> 74 <ul class="m-0 list-unstyled w-100 list-with-icon-button" > 75 <li v-for="valadd in addresses" class="row align-items-center no-gutters" > 76 77 <div class="col-1" @click="setPlaceID(valadd.place_id)" ><i class="zmdi zmdi-pin icon-25"></i></div> 78 <div class="col-9" @click="setPlaceID(valadd.place_id)" > 79 <h5 class="m-0">{{valadd.address.complete_delivery_address}}</h5> 80 </div> 81 82 <div class="col-2 "> 83 <div class="float-right"> 84 <a href="javascript:;" @click="editAddress(valadd)" class="rounded-pill rounded-button-icon d-inline-block mr-2"> 85 <i class="zmdi zmdi-edit"></i> 86 </a> 87 88 <a href="javascript:;" v-if="location_data.address_uuid != valadd.address_uuid " @click="deleteAddress(valadd.address_uuid)" 89 class="rounded-pill rounded-button-icon d-inline-block"> 90 <i class="zmdi zmdi-close"></i> 91 </a> 92 93 </div> 94 </div> 95 </li> 96 </ul> 97 </el-scrollbar> 98 </template> 99 100 </el-dialog> 101 `};const Ee={props:["label","set_place_id","cmaps_config"],data(){return{data:[],is_loading:false,error:[],cmaps:undefined,cmaps_full:false,location_name:"",delivery_options:"",address_label:"",delivery_instructions:"",delivery_options_data:[],address_label_data:[],address1:"",formatted_address:"",new_coordinates:[],inline_edit:false,address2:"",postal_code:"",company:"",custom_field_enabled:false,custom_field1:"",custom_field2:"",custom_field1_data:[],formattedAddress:null}},mounted(){autosize(document.getElementById("delivery_instructions"));this.getAddressAttributes()},computed:{DataValid(){if(Object.keys(this.data).length>0){return true}return false},DataValidNew(){if(Object.keys(this.new_coordinates).length>0){return true}return false}},methods:{show(e){this.cmaps_full=false;this.getAdddress(e);p(this.$refs.modal_address).modal("show")},clearForms(){this.data=[];this.location_name="";this.delivery_options="";this.address_label="";this.delivery_instructions="";this.address1="";this.formatted_address="";this.address2="";this.postal_code="";this.company=""},showWithData(e){console.debug("showWithData",e);this.clearForms();p(this.$refs.modal_address).modal("show");this.data=e;this.address1=e?.parsed_address.street_number??e.address.address1;this.formatted_address=e?.parsed_address.street_name??e.address.formatted_address;this.formattedAddress=e?.parsed_address?.formatted_address??"";console.debug("this.formattedAddress",this.formattedAddress);this.loadMap()},close(){p(this.$refs.modal_address).modal("hide")},closeModal(){p(this.$refs.modal_address).modal("hide");this.$emit("afterClose")},getAddressAttributes(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddressAttributes",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.delivery_options_data=e.details.delivery_option;this.address_label_data=e.details.address_label;this.delivery_options=e.details.default_atts.delivery_options;this.address_label=e.details.default_atts.address_label;this.custom_field_enabled=e.details.custom_field_enabled;this.custom_field1_data=e.details.custom_field1_data;this.custom_field1=Object.keys(this.custom_field1_data)[0]}else{this.delivery_options_data=[];this.address_label_data=[];this.delivery_options="";this.address_label="";this.custom_field1_data=[];this.custom_field_enabled=false}});n[t].always(e=>{this.is_loading=false})},getAdddress(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/getAdddress",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.location_name=e.details.data.attributes.location_name;this.delivery_options=e.details.data.attributes.delivery_options;this.address_label=e.details.data.attributes.address_label;this.delivery_instructions=e.details.data.attributes.delivery_instructions;this.address1=e.details.data.address.address1;this.formatted_address=e.details.data.address.formatted_address;this.formattedAddress=e?.details?.data?.address?.formattedAddress??this.formatted_address;this.address2=e.details.data.address.address2;this.postal_code=e.details.data.address.postal_code;this.company=e.details.data.address.company;this.custom_field1=e.details.data.attributes.custom_field1;this.custom_field2=e.details.data.attributes.custom_field2;this.loadMap()}else{this.clearForms()}});n[a].always(e=>{this.is_loading=false})},loadMap(){this.renderMap()},renderMap(){switch(this.cmaps_config.provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{u("render map here");this.cmaps=new google.maps.Map(this.$refs.cmaps,{center:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true,styles:map_style})}this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break;
101case"yandex":this.initYandexAddress();break}},async initYandexAddress(){console.debug("initYandexAddress");await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:t,YMapMarker:a,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};if(T){T.destroy();T=null}if(!T){T=new e(this.$refs.cmaps,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);P=new r({coordinates:n.center});T.addChild(P)}},addMarker(t){switch(this.cmaps_config.provider){case"google.maps":P=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}P=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){switch(this.cmaps_config.provider){case"google.maps":P.setMap(null);break;case"mapbox":u("remove marker");P.remove();break}},adjustPin(){console.debug("adjustPin");this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:this.cmaps_config.provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_config.provider=="google.maps"){P.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_config.provider=="mapbox"){P.on("dragend",e=>{const t=P.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}else if(this.cmaps_config.provider=="yandex"){const t={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};P.update({coordinates:t.center,draggable:true,onDragEnd:e=>{this.new_coordinates={lat:e[1],lng:e[0]}}})}},mapBoxResize(){if(this.cmaps_config.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},cancelPin(){this.error=[];this.cmaps_full=false;if(this.cmaps_config.provider=="yandex"){const e={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};P.update({coordinates:e.center,draggable:false})}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:this.cmaps_config.provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}},setNewCoordinates(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),lat:this.data.latitude,lng:this.data.longitude,new_lat:this.new_coordinates.lat,new_lng:this.new_coordinates.lng};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutValidateCoordinates",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data.latitude=this.new_coordinates.lat;this.data.longitude=this.new_coordinates.lng;this.cmaps_full=false;if(this.cmaps_config.provider=="yandex"){}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps})}}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:this.data.address_uuid,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,latitude:this.data.latitude,longitude:this.data.longitude,address1:this.address1,formatted_address:this.formatted_address,formattedAddress:this.formattedAddress,set_place_id:this.set_place_id,address2:this.address2,postal_code:this.postal_code,company:this.company,data:this.data,address_format_use:this.cmaps_config.address_format_use,custom_field1:this.custom_field1,custom_field2:this.custom_field2};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/SaveAddress",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.close();this.$emit("afterSave",true)}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},ConfirmDelete(t){D.confirm().then(e=>{if(e){this.deleteAddress(t)}})},deleteAddress(e){var t;var a=5;t="address_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/deleteAddress",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.close();this.$emit("afterDelete",true)}else{this.error[0]=e.msg}});n[a].always(e=>{})}},template:` 102 <div class="modal" ref="modal_address" id="ModalAddress" tabindex="-1" role="dialog" 103 aria-labelledby="ModalAddress" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 104 <div class="modal-dialog modal-lg" role="document"> 105 <div class="modal-content"> 106 107 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 108 <h5 class="modal-title">{{label.title}}</h5>
109 <a href="javascript:;" @click="closeModal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 110 </div> 111 112 <div class="modal-body" > 113 114 <template v-if="cmaps_config.provider=='mapbox'"> 115 <div :class="{ 'map-large': cmaps_full, 'map-small': !cmaps_full }" > 116 <div ref="cmaps" id="cmaps" style="height:100%; width:100%;"></div> 117 </div> 118 </template> 119 <template v-else> 120 <div ref="cmaps" id="cmaps" :class="{ 'map-large': cmaps_full, 'map-small': !cmaps_full }"></div> 121 </template> 122 123 <template v-if="!cmaps_full"> 124 125 <div class="row mt-3" > 126 <div class="col"> 127 <h5 class="m-0"> 128 {{formattedAddress}} 129 </h5> 130 </div> 131 <div class="col text-right"> 132 <button class="btn small btn-black" @click="adjustPin" :disabled="!DataValid" >{{label.adjust_pin}}</button> 133 </div> 134 </div> 135 <!--row--> 136 137 <div class="forms mt-3 mb-2"> 138 139 140 141 <template v-if="cmaps_config.address_format_use==2"> 142 143 <div class="row"> 144 <div class="col"> 145 <div class="form-label-group"> 146 <input v-model="formatted_address" class="form-control form-control-text" placeholder="" id="formatted_address" type="text"> 147 <label for="formatted_address"> 148 {{label.street_name}} ({{label.mandatory}}) 149 </label> 150 </div> 151 </div> 152 <div class="col"> 153 <div class="form-label-group"> 154 <input v-model="address1" class="form-control form-control-text" placeholder="" id="address1" type="text"> 155 <label for="address1"> 156 {{label.street_number}} ({{label.mandatory}}) 157 </label> 158 </div> 159 </div> 160 </div> 161 162 <div class="row"> 163 <div class="col"> 164 <div class="form-label-group"> 165 <input v-model="location_name" class="form-control form-control-text" placeholder="" id="location_name" type="text"> 166 <label for="location_name"> 167 {{label.entrance}} 168 </label> 169 </div> 170 </div> 171 <div class="col"> 172 <div class="form-label-group"> 173 <input v-model="address2" class="form-control form-control-text" placeholder="" id="address2" type="text"> 174 <label for="address2"> 175 {{label.floor}} 176 </label> 177 </div> 178 </div> 179 </div> 180 181 182 <div class="row"> 183 <div class="col"> 184 185 <div class="form-label-group"> 186 <input v-model="postal_code" class="form-control form-control-text" placeholder="" id="postal_code" type="text"> 187 <label for="postal_code"> 188 {{label.door}} ({{label.mandatory}}) 189 </label> 190 </div> 191 192 </div> 193 <div class="col"> 194 195 <div class="form-label-group"> 196 <input v-model="company" class="form-control form-control-text" placeholder="" id="company" type="text"> 197 <label for="company"> 198 {{label.company}} 199 </label> 200 </div> 201 202 </div> 203 </div> 204 205 206 </template> 207 <template v-else> 208 209 <div class="form-label-group"> 210 <input v-model="formatted_address" class="form-control form-control-text" placeholder="" id="formatted_address" type="text"> 211 <label for="formatted_address"> 212 {{label.street_name}} 213 </label> 214 </div> 215 216 <div class="form-label-group"> 217 <input v-model="address1" class="form-control form-control-text" placeholder="" id="address1" type="text"> 218 <label for="address1"> 219 {{label.street_number}} 220 </label> 221 </div> 222 223 <div class="form-label-group"> 224 <input class="form-control form-control-text" v-model="location_name" 225 id="location_name" type="text" > 226 <label for="location_name">{{label.location_name}}</label> 227 </div> 228 229 </template> 230 231 <h5 class="m-0 mt-2 mb-2">{{label.delivery_options}}</h5> 232 <select class="form-control custom-select" v-model="delivery_options"> 233 <option v-for="(items, key) in delivery_options_data" :value="key" >{{items}}</option> 234 </select> 235 236 237 <h5 class="m-0 mt-2 mb-2">{{label.delivery_instructions}}</h5> 238 <div class="form-label-group"> 239 <textarea id="delivery_instructions" 240 style="max-height:150px;" v-model="delivery_instructions" class="form-control form-control-text font13" 241 :placeholder="label.notes"> 242 </textarea> 243 </div> 244 245 <template v-if="custom_field_enabled"> 246 <div class="d-flex align-items-center"> 247 <div class="mr-2"><h5 class="m-0 mt-2 mb-2">{{label.custom_field1}}</h5></div> 248 <div> 249 <el-tooltip placement="top" :content="label.custom_field1_info"> 250 <el-button link type="plain"> 251 <i class="zmdi zmdi-info font20"></i> 252 </el-button> 253 </el-tooltip> 254 </div>
255 </div> 256 257 <select class="form-control custom-select" v-model="custom_field1"> 258 <option v-for="(items, key) in custom_field1_data" :value="key" >{{items}}</option> 259 </select> 260 261 <div class="d-flex align-items-center"> 262 <div class="m-0 mt-2 mb-2"><h5 class="m-0 mt-2 mb-2">{{label.custom_field2}}</h5></div> 263 <div> 264 <el-tooltip placement="top" :content="label.custom_field2_info"> 265 <el-button link type="plain"> 266 <i class="zmdi zmdi-info font20"></i> 267 </el-button> 268 </el-tooltip> 269 </div> 270 </div> 271 272 <div class="form-label-group"> 273 <textarea id="delivery_instructions" 274 style="max-height:150px;" v-model="custom_field2" class="form-control form-control-text font13" > 275 </textarea> 276 </div> 277 </template> 278 279 <div class="mb-1 mt-1"></div> 280 281 <p>{{label.address_label}}</p> 282 <div class="btn-group btn-group-toggle input-group-small mb-4" > 283 <label class="btn" v-for="(items, key) in address_label_data" :class="{ active: address_label==key }" > 284 <input v-model="address_label" type="radio" :value="key" > 285 {{ items }} 286 </label> 287 </div> 288 <!--btn-group--> 289 290 </div> <!--forms--> 291 292 </template> 293 294 <div id="error_message" v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 295 <p v-for="err in error" class="m-0">{{err}}</p> 296 </div> 297 298 299 </div> <!--modal-body--> 300 301 302 <div class="modal-footer justify-content-start"> 303 304 <template v-if="!cmaps_full"> 305 <div class="border flex-fill"> 306 <button class="btn btn-black w-100" @click="closeModal" > 307 {{label.cancel}} 308 </button> 309 </div> 310 <div class="border flex-fill"> 311 <button class="btn btn-green w-100" @click="save" :class="{ loading: is_loading }" :disabled="!DataValid" > 312 <span class="label">{{label.save}}</span> 313 <div class="m-auto circle-loader" data-loader="circle-side"></div> 314 </button> 315 </div> 316 </template> 317 318 <template v-else-if="cmaps_full"> 319 <div class="border flex-fill"> 320 <button class="btn btn-black w-100" @click="cancelPin" > 321 {{label.cancel}} 322 </button> 323 </div> 324 <div class="border flex-fill"> 325 <button class="btn btn-green w-100" @click="setNewCoordinates" 326 :class="{ loading: is_loading }" :disabled="!DataValidNew" > 327 <span class="label">{{label.save}}</span> 328 <div class="m-auto circle-loader" data-loader="circle-side"></div> 329 </button> 330 </div> 331 </template> 332 333 </div> <!--content--> 334 </div> <!--dialog--> 335 </div> <!--modal--> 336 `};const Pe={beforeMount:(t,a)=>{t.clickOutsideEvent=e=>{if(!(t==e.target||t.contains(e.target))){a.value()}};document.addEventListener("click",t.clickOutsideEvent)},unmounted:e=>{document.removeEventListener("click",e.clickOutsideEvent)}};const Fe={props:["title","label"],data(){return{transaction_list:[],transaction:"",loading:false,charge_type:"",estimation:[]}},mounted(){this.getMerchantServices()},methods:{getMerchantServices(){var e;var t=g();e="merchant_id="+merchant_id;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/servicesList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){this.loading=false;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_list=e.details.data;this.transaction=e.details.transaction;this.charge_type=e.details.charge_type;this.estimation=e.details.estimation}else{this.transaction_list=[];this.transaction="";this.charge_type="";this.estimation=[]}});n[t].always(e=>{this.loading=false})},doUpdateService(e){this.transaction=e;this.updateService()},updateService(){axios({method:"POST",url:ajaxurl+"/updateService",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+this.transaction+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){setCookie("cart_transaction_type",this.transaction,30);
336setCookie("cart_uuid",e.data.details.cart_uuid,30)}if(typeof M!=="undefined"&&M!==null){M.addressNeeded()}})["catch"](e=>{}).then(e=>{this.$emit("afterUpdate",this.transaction)})}},template:` 337 <div class="btn-group-rounded btn-group btn-group-toggle" > 338 <label class="btn d-flex" 339 v-for="trans in transaction_list" :class="{ active: transaction==trans.service_code }" > 340 <input type="radio" :value="trans.service_code" v-model="transaction" @click="doUpdateService(trans.service_code)" > 341 <div class="align-self-center"> 342 <div class="bold">{{ trans.service_name }}</div> 343 344 <template v-if="estimation[trans.service_code]"> 345 <template v-for="(item,index) in estimation[trans.service_code] "> 346 347 <template v-if="trans.service_code=='delivery'"> 348 <template v-if="item.charge_type==charge_type"> 349 <p class="m-0">{{item.estimation}} {{label.min}}</p> 350 </template> 351 </template> 352 <template v-else> 353 <template v-if="item.charge_type=='fixed'"> 354 <p class="m-0">{{item.estimation}} {{label.min}}</p> 355 </template> 356 </template> 357 358 </template> 359 </template> 360 361 </div> 362 </label> 363 </div> 364 `};const Ne={props:["sitekey","size","theme","is_enabled","captcha_lang"],data(){return{recaptcha:null}},mounted(){if(this.is_enabled==1||this.is_enabled=="true"||this.is_enabled==true){this.initCapcha()}},methods:{initCapcha(){if(window.grecaptcha==null){new Promise(e=>{window.recaptchaReady=function(){e()};const t=window.document;const a="recaptcha-script";const s=t.createElement("script");s.id=a;s.setAttribute("src","https://www.google.com/recaptcha/api.js?onload=recaptchaReady&render=explicit&hl="+this.captcha_lang);t.head.appendChild(s)}).then(()=>{this.renderRecaptcha()})}else{this.renderRecaptcha()}},renderRecaptcha(){this.recaptcha=grecaptcha.render(this.$refs.recaptcha_target,{sitekey:this.sitekey,theme:this.theme,size:this.size,tabindex:this.tabindex,callback:e=>this.$emit("verify",e),"expired-callback":()=>this.$emit("expire"),"error-callback":()=>this.$emit("fail")})},reset(){grecaptcha.reset(this.recaptcha)}},template:` 365 <div class="mb-2 mt-2" ref="recaptcha_target"></div> 366 `};const e={props:["label","mobile_number","mobile_prefix","default_country","only_countries"],emits:["update:mobile_number","update:mobile_prefix"],data(){return{data:[],country_flag:""}},updated(){},mounted(){this.getLocationCountries()},methods:{getLocationCountries(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),default_country:this.default_country,only_countries:this.only_countries};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getLocationCountries",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.country_flag=e.details.default_data.flag;this.$emit("update:mobile_prefix",e.details.default_data.phonecode)}else{this.data=[];this.country_flag="";this.mobile_prefix=""}});n[t].always(e=>{})},setValue(e){this.country_flag=e.flag;this.$emit("update:mobile_prefix",e.phonecode);this.$refs.ref_mobile_number.focus()}},template:` 367 <div class="inputs-with-dropdown d-flex align-items-center mb-3" > 368 <div class="dropdown"> 369 <button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 370 <img v-if="country_flag" :src="country_flag"> 371 </button> 372 <div class="dropdown-menu" > 373 <a v-for="item in data" @click="setValue(item)" 374 href="javascript:;" class="dropdown-item d-flex align-items-center"> 375 <div class="mr-2"> 376 <img :src="item.flag"> 377 </div> 378 <div>{{item.country_name}}</div> 379 </a> 380 </div> 381 </div> <!--dropdown--> 382 383 <div class="mr-0 ml-1" v-if="mobile_prefix">+{{mobile_prefix}}</div> 384 <input type="text" v-maska="'###################'" ref="ref_mobile_number" 385 :value="mobile_number" @input="$emit('update:mobile_number', $event.target.value)" > 386 387 </div> <!--inputs--> 388 `};const Re={props:["label","size"],methods:{confirm(){bootbox.confirm({size:this.size,title:this.label.confirm,message:this.label.are_you_sure,centerVertical:true,animate:false,buttons:{cancel:{label:this.label.cancel,className:"btn btn-black small pl-4 pr-4"},confirm:{label:this.label.yes,className:"btn btn-green small pl-4 pr-4"}},callback:e=>{this.$emit("callback",e)}})},alert(e,t){bootbox.alert({size:!empty(t.size)?t.size:"",closeButton:false,message:e,animate:false,centerVertical:true,buttons:{ok:{label:this.label.ok,className:"btn btn-green small pl-4 pr-4"}}})}}};var De,Me,Ae;const $e={components:{"star-rating":VueStarRating["default"]},props:["label","accepted_files","max_file"],data(){return{upload_images:[],required_message:[],rating_value:"",review_content:"",as_anonymous:false,order_uuid:"",is_loading:false,error:[],is_reset:false}},mounted(){De=new Tagify(document.querySelector(".tags_like"));Me=new Tagify(document.querySelector(".tags_not_like"));autosize(document.getElementById("review_content"));this.initDropZone(this.label,this)},methods:{show(){p("#reviewModal").modal("show")},close(){p(this.$refs.review_modal).modal("hide");Dropzone.forElement("#dropzone_multiple").removeAllFiles(true)},reset(){Dropzone.forElement("#dropzone_multiple").files=[];p(".dz-preview").remove();p(".dropzone").removeClass("dz-started");this.upload_images=[];this.rating_value="";this.review_content="";this.as_anonymous=false;this.order_uuid="";this.error=[];De.removeAllTags();Me.removeAllTags()},initDropZone(t,i){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};Dropzone.autoDiscover=false;Ae=p("#dropzone_multiple").dropzone({dictDefaultMessage:t.dictDefaultMessage,dictFallbackMessage:t.dictFallbackMessage,dictFallbackText:t.dictFallbackText,dictFileTooBig:t.dictFileTooBig,dictInvalidFileType:t.dictInvalidFileType,dictResponseError:t.dictResponseError,dictCancelUpload:t.dictCancelUpload,dictCancelUploadConfirmation:t.dictCancelUploadConfirmation,dictRemoveFile:t.dictRemoveFile,dictMaxFilesExceeded:t.dictMaxFilesExceeded,paramName:"file",url:ajaxurl+"/uploadReview",params:e,addRemoveLinks:true,maxFiles:parseInt(this.max_file),acceptedFiles:this.accepted_files,autoProcessQueue:true,init:function(){var s=this;s.on("maxfilesexceeded",function(e){f(t.max_file_exceeded,"error");s.removeFile(e)});s.on("removedfile",function(e){u("removedfile");i.removeUpload(e.upload_uuid)});s.on("success",(e,t)=>{u(t);var a=t;if(a.code==1){e.upload_uuid=a.details.id;i.upload_images.push(a.details)}else{var a=JSON.parse(t);f(a.msg,"error");s.removeFile(e)}});s.on("addedfile",function(){u("addedfile")})}})},removeUpload(i){return new Promise((t,e)=>{var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:i};var s=g();n[s]=p.ajax({url:ajaxurl+"/removeReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(a),c
388ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[s]!=null){n[s].abort();this.is_loading=false}}});n[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});n[s].always(e=>{this.is_loading=false})})},remove(a){if(this.upload_images){this.upload_images.forEach((e,t)=>{if(e.id==a){u("index remove=>"+t);this.upload_images.splice(t,1)}})}},getTag(e){var a=[];if(e){e.forEach((e,t)=>{a.push(e.value)})}return a},addReview(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid,review_content:this.review_content,rating_value:this.rating_value,as_anonymous:this.as_anonymous,tags_like:this.getTag(De.value),tags_not_like:this.getTag(Me.value),upload_images:this.upload_images};var t=1;n[t]=p.ajax({url:ajaxurl+"/addReview",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort();this.is_loading=false}}});n[t].done(e=>{u(e);if(e.code==1){f(e.msg);this.reset();p(this.$refs.review_modal).modal("hide");this.$emit("afterAddreview")}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},deleteAllImages(){if(this.upload_images.length<=0){return false}var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),upload_images:this.upload_images};var t=g();n[t]=p.ajax({url:ajaxurl+"/removeAllReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.upload_images=[];Dropzone.forElement("#dropzone_multiple").removeAllFiles(true)}})}},template:` 389 <div class="modal" ref="review_modal" id="reviewModal" tabindex="-1" role="dialog" aria-labelledby="reviewModal" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 390 <div class="modal-dialog modal-dialog-centered" role="document"> 391 <div class="modal-content"> 392 393 394 <div class="modal-body" > 395 396 <a href="javascript:;" @click="close" 397 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 398 399 <h4 class="bold m-0 mb-3 mt-3">{{label.write_review}}</h4> 400 401 <star-rating 402 v-model:rating="rating_value" 403 :star-size="30" 404 :show-rating="false" 405 @update:rating="rating_value = $event" 406 > 407 </star-rating> 408 409 <h5 class="m-0 mt-3 mb-2">{{label.what_did_you_like}}</h5> 410 <input type="text" name="tags_like" class="tags_like" id="tags_like" :placeholder="label.search_tag"> 411 412 <h5 class="m-0 mt-2 mb-2">{{label.what_did_you_not_like}}</h5> 413 <input type="text" name="tags_not_like" class="tags_not_like" id="tags_not_like" :placeholder="label.search_tag"> 414 415 <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5> 416 <div class="mb-3"> 417 <div class="dropzone dropzone_container" id="dropzone_multiple" data-action="gallery_create"> 418 <div class="dz-default dz-message"> 419 <i class="fas fa-cloud-upload-alt"></i> 420 <p>{{label.drop_files_here}}</p> 421 </div> 422 </div> 423 </div> 424 425 <!-- <div v-if="upload_images.length>0" class="row gallery m-0"> 426 <div v-for="images in upload_images" class="col-lg-4 col-md-4 col-sm-12 mb-0 mb-lg-0 p-1"> 427 <div class="position-relative"> 428 <img :src="images.url_image"> 429 <a href="javascript:;" 430 @click="removeUpload(images.id)" data-dz-remove 431 class="remove btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-plus"></i></a> 432 </div> 433 </div> 434 </div>--> 435 436 <h5 class="m-0 mt-2 mb-2">{{label.write_your_review}}</h5> 437 <div class="form-label-group"> 438 <textarea id="review_content" class="form-control form-control-text font13" 439 :placeholder="label.review_helps" 440 v-model="review_content" 441 style="max-height:150px;" 442 > 443 </textarea> 444 </div> 445 446 <div class="custom-control custom-checkbox flex-grow-1"> 447 <input type="checkbox" class="custom-control-input" 448 name="as_anonymous" value="1" 449 id="as_anonymous" 450 v-model="as_anonymous" 451 > 452 <label class="custom-control-label font14 bold" for="as_anonymous" > 453 {{label.post_review_anonymous}} 454 </label> 455 </div> 456 457 458 <div id="error_message" v-cloak v-if="error.length>0" class="alert alert-warning mb-2 mt-2" role="alert"> 459 <p v-cloak v-for="message in error" class="m-0">{{message}}</p> 460 </div> 461 462 </div> <!--modal body--> 463 464 <div class="modal-footer justify-content-start"> 465 <button class="btn btn-black w-100" @click="addReview" :class="{ loading: is_loading }" >
466 <span class="label">{{label.add_review}}</span> 467 <div class="m-auto circle-loader" data-loader="circle-side"></div> 468 </button> 469 </div> <!--footer--> 470 471 </div> <!--content--> 472 </div> <!--dialog--> 473 </div> <!--modal--> 474 `};const Ye={props:["ajax_url","amount","price_format"],data(){return{data:0,config:JSON.parse(money_config)}},mounted(){this.data=window["v-money3"].format(this.amount,this.config)},watch:{price_format(e,t){this.config=e}},updated(){this.data=window["v-money3"].format(this.amount,this.config)},methods:{formatNumber(e){return window["v-money3"].format(e,this.config)}},template:` 475 {{data}} 476 `};var Ke=function(e){return window["v-money3"].format(e,JSON.parse(money_config))};let T;let k=16.6;const Le={props:["keys","provider","zoom","center","markers","size"],template:` 477 <iframe v-if="mapFallback" class="map border address-map-fallback" :class="size" :src="fallbackUrl" title="Address map" loading="eager" referrerpolicy="no-referrer-when-downgrade"></iframe> 478 <div v-else ref="cmaps" class="map border" :class="size"></div> 479 480 <div class="position-absolute map-buttons-wrap" v-if="size=='map-lg-large'" > 481 <div class="btn-group-vertical" v-loading="loading" v-if="provider!='yandex'" > 482 <div class="mb-2"> 483 <button @click="locateLocation" type="button" class="btn btn-white rounded-circle"> 484 <i class="zmdi zmdi-gps-dot font25"></i> 485 </button> 486 </div> 487 <button @click="setPlusZoom()" type="button" class="btn btn-white"> 488 <i class="zmdi zmdi-plus font25"></i> 489 </button> 490 <div class="divider py-1 bg-dark"></div> 491 <button @click="setLessZoom()" type="button" class="btn btn-white"> 492 <i class="zmdi zmdi-minus font25"></i> 493 </button> 494 </div> 495 </div> 496 `,data(){return{cmapsMarker:[],latLng:[],cmaps:undefined,bounds:undefined,loading:false,mapFallback:false,mapRetries:0}},mounted(){this.renderMap()},watch:{markers(e,t){this.mapFallback=false;this.mapRetries=0;this.renderMap()}},computed:{fallbackUrl(){let e=this.markers&&this.markers[0]?this.markers[0]:this.center||{};let t=parseFloat(e.lat)||33.749;let a=parseFloat(e.lng)||-84.388;return"https://www.google.com/maps?q="+encodeURIComponent(t+","+a)+"&z=16&output=embed"}},methods:{locateLocation(){this.$emit("dragMarker",true);this.loading=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.$emit("dragMarker",false);this.loading=false;this.$emit("afterSelectmap",e.coords.latitude,e.coords.longitude);u(e)},e=>{this.$emit("dragMarker",false);this.loading=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.$emit("dragMarker",false);this.loading=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},renderMap(){try{if(this.provider==="google.maps"){if(!this.$refs.cmaps||this.$refs.cmaps.clientWidth<1||typeof window.google==="undefined"||!window.google.maps||typeof window.google.maps.Map!=="function"){if(this.mapRetries++<20){setTimeout(()=>this.renderMap(),250)}else{this.mapFallback=true}return}}switch(this.provider){case"google.maps":this.bounds=new window.google.maps.LatLngBounds;if(typeof this.cmaps!=="undefined"&&this.cmaps!==null&&Object.keys(this.cmapsMarker).length>0){this.moveAllMarker()}else{this.cmaps=new window.google.maps.Map(this.$refs.cmaps,{center:{lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)},zoom:parseInt(this.zoom),disableDefaultUI:true,styles:map_style});Object.entries(this.markers).forEach(([e,t])=>{this.addMarker({position:{lat:parseFloat(t.lat),lng:parseFloat(t.lng)},map:this.cmaps,draggable:t.draggable==1?true:false,label:t.label},t.id,t.draggable)})}break;case"mapbox":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null&&Object.keys(this.cmapsMarker).length>0){this.moveAllMarker()}else{mapboxgl.accessToken=this.keys;this.bounds=new mapboxgl.LngLatBounds;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.center.lng),parseFloat(this.center.lat)],zoom:14});this.cmaps.on("error",e=>{u(e.error.message)});
496Object.entries(this.markers).forEach(([e,t])=>{this.addMarker({position:{lat:parseFloat(t.lat),lng:parseFloat(t.lng)},map:this.cmaps,draggable:t.draggable==1?true:false},t.id,t.draggable)});if(Object.keys(this.markers).length>1){this.FitBounds()}else{if(this.markers[0]){this.setCenter(this.markers[0].lat,this.markers[0].lng)}}}break;case"yandex":this.initYandex();break}if(this.provider==="google.maps"){setTimeout(()=>{if(this.$refs.cmaps&&this.$refs.cmaps.children.length===0){this.cmaps=undefined;if(this.mapRetries++<3){this.renderMap()}else{this.mapFallback=true}}},900)}}catch(e){console.error(e);this.cmaps=undefined;if(this.mapRetries++<3){setTimeout(()=>this.renderMap(),350)}else{this.mapFallback=true}}},async initYandex(){console.debug("initYandex");await ymaps3.ready;const{YMap:t,YMapDefaultSchemeLayer:a,YMapMarker:e,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.center.lng),parseFloat(this.center.lat)],zoom:k};if(typeof this.$refs.cmaps!=="undefined"&&this.$refs.cmaps!==null){}else{return}console.debug("yandex_map",T);console.debug("this.markers",this.markers);if(!T){console.debug("ADD Yandex map");T=new t(this.$refs.cmaps,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new a({}),new s({})]);let e=true;if(Object.keys(this.markers).length>0){e=this.markers[0].draggable}console.debug("is_dragable",e);if(e){T.addChild(new i({onUpdate:e=>{if(e.mapInAction){this.cmapsMarker[0].update({coordinates:e.location.center});this.$emit("dragMarker",true)}else{this.$emit("dragMarker",false)}},onActionEnd:e=>{console.log("onActionEnd",e.type);if(e.type=="drag"){this.cmapsMarker[0].update({coordinates:e.location.center});this.$emit("afterSelectmap",e.location.center[1],e.location.center[0])}else if(e.type=="scrollZoom"){k=e.location.zoom}}}))}if(this.size=="map-lg-large"){T.addChild(new o({position:"right"}).addChild(new d({})));T.addChild(new o({position:"top right"}).addChild(new l({onGeolocatePosition:e=>{console.log("onGeolocatePosition",e);this.$emit("afterSelectmap",e[1],e[0])}})))}Object.entries(this.markers).forEach(([e,t])=>{let a=t.id;this.cmapsMarker[a]=new r({coordinates:[parseFloat(t.lng),parseFloat(t.lat)],draggable:t.draggable,onDragEnd:e=>{console.log("onDragEnd",e);this.$emit("afterSelectmap",e[1],e[0])}});T.addChild(this.cmapsMarker[a])});if(Object.keys(this.markers).length>1){}else{if(this.markers[0]){const c={center:[this.markers[0].lng,this.markers[0].lat],zoom:k};T.update({location:c})}}}else{console.debug("move all marker");Object.entries(this.markers).forEach(([e,t])=>{let a=t.id;if(this.cmapsMarker[a]){this.cmapsMarker[a].update({coordinates:[t.lng,t.lat]})}});if(Object.keys(this.markers).length>1){}else{if(this.markers[0]){const c={center:[this.markers[0].lng,this.markers[0].lat],zoom:k};T.update({location:c})}}}},async addMarker(e,a,t){try{switch(this.provider){case"google.maps":this.cmapsMarker[a]=new window.google.maps.Marker(e);this.cmaps.panTo(new window.google.maps.LatLng(e.position.lat,e.position.lng));this.bounds.extend(this.cmapsMarker[a].position);if(t===true){google.maps.event.addListener(this.cmaps,"drag",e=>{this.$emit("dragMarker",true);let t=new google.maps.LatLng(this.cmaps.getCenter().lat(),this.cmaps.getCenter().lng());this.cmapsMarker[a].setPosition(t)});google.maps.event.addListener(this.cmaps,"dragend",e=>{let t=new google.maps.LatLng(this.cmaps.getCenter().lat(),this.cmaps.getCenter().lng());this.$emit("dragMarker",false);this.$emit("afterSelectmap",t.lat(),t.lng())});window.google.maps.event.addListener(this.cmapsMarker[a],"drag",e=>{this.$emit("dragMarker",true)});window.google.maps.event.addListener(this.cmapsMarker[a],"dragend",e=>{const t=e.latLng;this.latLng={lat:t.lat(),lng:t.lng()};this.$emit("dragMarker",false);this.$emit("afterSelectmap",t.lat(),t.lng())})}break;case"mapbox":this.cmapsMarker[a]=new mapboxgl.Marker(e).setLngLat([e.position.lng,e.position.lat]).addTo(this.cmaps);this.bounds.extend(new mapboxgl.LngLat(e.position.lng,e.position.lat));if(t===true){this.cmapsMarker[a].on("dragend",e=>{const t=this.cmapsMarker[a].getLngLat();u(t.lat+"=>"+t.lng);this.$emit("afterSelectmap",t.lat,t.lng)});this.cmaps.on("drag",()=>{this.cmapsMarker[a].setLngLat([this.cmaps.getCenter().lng.toFixed(4),this.cmaps.getCenter().lat.toFixed(4)])});this.cmaps.on("dragend",()=>{this.cmapsMarker[a].setLngLat([this.cmaps.getCenter().lng.toFixed(4),this.cmaps.getCenter().lat.toFixed(4)]);this.$emit("afterSelectmap",this.cmaps.getCenter().lat.toFixed(4),this.cmaps.getCenter().lng.toFixed(4))})}this.mapBoxResize();break}}catch(s){console.error(s)}},mapBoxResize(){if(this.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},moveAllMarker(){console.log("moveAllMarker");console.log(this.markers);if(this.provider=="google.maps"){if(Object.keys(this.markers).length>
4960){Object.entries(this.markers).forEach(([e,t])=>{let a=new google.maps.LatLng(parseFloat(t.lat),parseFloat(t.lng));if(!empty(this.cmapsMarker[t.id])){this.cmapsMarker[t.id].setPosition(a)}});if(Object.keys(this.markers).length>1){this.FitBounds()}else{this.cmaps.panTo(new window.google.maps.LatLng(this.markers[0].lat,this.markers[0].lng))}}}else{if(Object.keys(this.markers).length>0){Object.entries(this.markers).forEach(([e,t])=>{if(!empty(this.cmapsMarker[t.id])){this.cmapsMarker[t.id].setLngLat([t.lng,t.lat]).addTo(this.cmaps)}});if(Object.keys(this.markers).length>1){this.FitBounds()}else{this.cmaps.flyTo({center:[this.markers[0].lng,this.markers[0].lat],essential:true,zoom:14})}}}},centerMap(){this.FitBounds()},FitBounds(){try{switch(this.provider){case"google.maps":if(!empty(this.bounds)){this.cmaps.fitBounds(this.bounds)}break;case"mapbox":if(!empty(this.bounds)){this.cmaps.fitBounds(this.bounds,{duration:0,padding:50})}break}}catch(e){}},setCenter(e,t){try{switch(this.provider){case"google.maps":this.cmaps.setCenter(new window.google.maps.LatLng(e,t));break;case"mapbox":this.cmaps.flyTo({center:[t,e],essential:true});break}}catch(a){console.error(a)}},setPlusZoom(){if(this.provider=="yandex"){}else{this.cmaps.setZoom(this.cmaps.getZoom()+2)}},setLessZoom(){if(this.provider=="yandex"){}else{this.cmaps.setZoom(this.cmaps.getZoom()-2)}}}};const ze={props:["label","modelValue","formatted_address","enabled_locate"],emits:["update:modelValue"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],hasSelected:false,loading:false,addressData:[],auto_locate:false,is_fullwidth:false,selectedData:[]}},created(){this.q=this.formatted_address;if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile){this.is_fullwidth=true}}},watch:{formatted_address(e,t){this.q=e}},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},setData(e){this.clearData();this.q=e.description;this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)},locateLocation(){this.loading=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{this.loading=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.loading=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(e=>{if(e.data.code==1){this.q=e.data.details.data.address.formatted_address;this.addressData=e.data.details.data;this.$emit("afterGetcurrentlocation",this.addressData)}else{this.addressData=[];ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false;this.auto_locate=false})},setAddressData(e){this.addressData=e},setLoading(e){this.loading=e},onSubmit(){if(Object.keys(this.addressData).length>0){console.log("selectedData",this.selectedData);if(this.selectedData.from_addressbook){this.$emit("afterPointaddress",this.selectedData)}else{this.$emit("afterGetcurrentlocation",this.addressData)}}else{this.auto_locate=true;this.locateLocation()}},searchLocation(e,t){let a=[];let s=1;if(typeof isGuest!=="undefined"&&isGuest!==null){s=isGuest}let i=empty(e)?"getRecentAddress":"getlocationAutocomplete";i=s==1?"getlocationAutocomplete":i;if(s==1&&empty(e)){t(a);return}axios({method:"POST",url:ajaxurl+"/"+i,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){a=e.data.details.data}else{a=[]}t(a)})["catch"](e=>{}).then(e=>{})},handleSelect(e){this.selectedData=e;this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)}},template:` 497 <div class="d-flex flex-sm-row flex-column align-items-center justify-content-between"> 498 <div class="position-relative search-geocomplete" v-loading="loading" :class="{width_87 : enabled_locate , 'w-100' : !enabled_locate}" > 499 <div class="p-0"> 500 <el-autocomplete 501 v-model="q" 502 :placeholder="label.enter_address" 503 size="large" 504 class="w-100" 505 :trigger-on-focus="true" 506 value-key="description" 507 :fit-input-width="is_fullwidth" 508 clearable 509 :fetch-suggestions="searchLocation" 510 @select="handleSelect" 511 > 512 <template #suffix> 513 <button v-if="enabled_locate" @click="locateLocation" type="button" class="btn btn-link"> 514 <i class="zmdi zmdi-my-location font20" style="color:#000;"></i> 515 </button> 516 </template> 517 </el-autocomplete> 518 </div> 519 </div> 520 <div v-if="enabled_locate" class="flex-enabled-locate"> 521 <button @click="onSubmit" type="button" class="btn btn-green pl-3 pr-3" :disabled="loading"> 522 <i class="zmdi zmdi-arrow-right font25"></i> 523 </button> 524 </div> 525 </div> 526 `};const qe={props:["data","keys","provider","zoom","center","label"],components:{"components-maps":Le,"component-auto-complete":ze},data(){return{markers:[],address_data:[],loading:false,drag:false,visible:false}},computed:{hasFormatAddress(){if(Object.keys(this.address_data).length>0){return true}return false},getFormatAddress(){return this.address_data},isMobileView(){if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile==1){return true}}return false}},watch:{data(e,t){console.debug("new data",e);this.address_data=e},address_data(e,t){u("watch address_data");u(e);this.dataMarkers(e.latitude,e.longitude)}},methods:{getFormatAddress(){return"test"},setInitialMarker(){console.debug("setInitialMarker",this.data);if(T){T.destroy();T=null}this.dataMarkers(this.data.latitude,this.data.longitude)},dataMarkers(e,t){this.markers=[{id:0,lat:parseFloat(e),lng:parseFloat(t),draggable:true}]}
526,setLoading(e){this.loading=e},show(e){if(e){this.address_data=this.data;p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}},afterChoose(e){this.getLocationDetails(e)},getLocationDetails(e){console.log("provider",this.provider);console.debug("getLocationDetails",e);let t=e.id;if(this.provider=="mapbox"){t=`${e?.longitude},${e?.latitude}`}axios({method:"POST",url:ajaxurl+"/getLocationDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&id="+t+"&saveplace=0"+"&description="+e.description,timeout:c}).then(e=>{if(e.data.code==1){this.dataMarkers(e.data.details.data.latitude,e.data.details.data.longitude);this.address_data=e.data.details.data}else{}})["catch"](e=>{}).then(e=>{})},afterSelectmap(t,a){this.loading=true;axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+t+"&lng="+a,timeout:c}).then(e=>{if(e.data.code==1){if(Object.keys(e.data.details.data).length>0){this.address_data=e.data.details.data;this.address_data.latitude=t;this.address_data.longitude=a}}else{}})["catch"](e=>{}).then(e=>{this.loading=false})},dragMarker(e){this.drag=e},setNewAdress(){i(StoreMapName,"selectedAddress",this.address_data);this.$emit("afterChangeaddress",this.address_data)},afterClosemodal(){this.$emit("afterClosemodal",this.provider)}},template:` 527 <el-dialog v-model="visible" :close-on-click-modal="false" :show-close="true" :title="label.exact_location" width="55%" @closed="afterClosemodal" > 528 529 <div class="position-relative" > 530 531 <component-auto-complete 532 ref="auto_complete" 533 :label="{ 534 enter_address : label.enter_address 535 }" 536 :formatted_address="hasFormatAddress?getFormatAddress.address.formatted_address:''" 537 @after-choose="afterChoose" 538 > 539 </component-auto-complete> 540 541 <div class="pt-2"></div> 542 543 <components-maps 544 ref="cmaps" 545 :keys="keys" 546 :provider="provider" 547 :zoom="zoom" 548 size="map-lg-large" 549 :center="center" 550 :markers="markers" 551 @after-selectmap="afterSelectmap" 552 @drag-marker="dragMarker" 553 > 554 </components-maps> 555 556 <div v-if="!drag" class="w-100 position-absolute" style="bottom:20px;"> 557 <div class="w-50 m-auto"> 558 <button type="button" @click="setNewAdress" class="btn btn-green w-100" :class="{ loading: loading }" > 559 <span class="label"> 560 {{label.submit}} 561 </span> 562 <div class="m-auto circle-loader" data-loader="circle-side"></div> 563 </button> 564 </div> 565 </div> 566 567 </div> 568 569 </el-dialog> 570 `};const Ve={props:["label"],data(){return{loading:false,data:[],address_data:""}},created(){this.getSavedAddress()},computed:{getData(){return this.data},totalCount(){return Object.keys(this.data).length-1},hasSelectAddress(){if(Object.keys(this.address_data).length>0){return false}return true}},methods:{show(e){if(e){p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}},getSavedAddress(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAddresses",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},setAddress(e){i(StoreMapName,"selectedAddress",e);this.show(false);this.$emit("afterSelectaddress",e)}},template:` 571 <div class="modal" ref="modal" id="modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 572 <div class="modal-dialog modal-dialog-centered" role="document"> 573 <div class="modal-content"> 574 <div class="modal-header border-bottom-0" > 575 <h5 class="modal-title" id="exampleModalLongTitle">{{label.save_address}}</h5> 576 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 577 <span aria-hidden="true">×</span> 578 </button> 579 </div> 580 <div class="modal-body"> 581 582 <el-radio-group v-model="address_data" class="ml-4"> 583 <template v-for="(items,index) in getData" :keys="items" > 584 <el-radio :label="items" size="large"> 585 <div class="text-dark font-weight-bold">{{items.attributes.address_label}}</div> 586 <div class="text-truncatex max-width-addressx"> 587 {{items.address.formattedAddress}} 588 </div> 589 </el-radio> 590 </template> 591 </el-radio-group> 592 593 </div> 594 595 <div class="modal-footer"> 596 <button type="button" class="btn btn-light" data-dismiss="modal"> 597 {{label.cancel}} 598 </button> 599 <button @click="setAddress(address_data)" type="button" class="btn btn-green pl-3 pr-3" 600 :disabled="hasSelectAddress" 601 > 602 {{label.save}} 603 </button> 604 </div> 605 606 </div> 607 </div> 608 </div> 609 `};let I=[];const Ue={template:"#xtemplate_address_form",props:["location_data"],data(){return{error:[],cmaps_config:[],address1:"",formatted_address:"",location_name:"",delivery_options:"",delivery_options_data:[],delivery_instructions:"",address_label:"",address_label_data:[],cmaps_full:false,new_coordinates:[],is_loading:false,address2:"",postal_code:"",company:"",custom_field1:"",custom_field2:"",custom_field1_data:[],custom_field_enabled:false}},created(){this.getAddressAttributes()},watch:{location_data(e,t){if(empty(e)){return}if(typeof e.parsed_address!=="undefined"&&e.parsed_address!==null){if(!empty(e.parsed_address.street_name)){this.formatted_address=e.parsed_address.street_name;this.address1=e.parsed_address.street_number}else{this.formatted_address=e.address.formatted_address;this.address1=e.address.address1}}else{this.formatted_address=e.address.formatted_address;this.address1=e.address.address1}if(!empty(e.attributes)){this.location_name=e.attributes.location_name;this.delivery_options=e.attributes.delivery_options;this.delivery_instructions=e.attributes.delivery_instructions;this.address_label=e.attributes.address_label}else{this.location_name="";this.delivery_instructions="";this.delivery_options="Leave it at my door";this.address_label="Home"}this.show()}},computed:{hasLocationData(){if(typeof this.location_data!=="undefined"&&this.location_data!==null){var e=Object.keys(this.location_data).length;if(e>0){return true}}return false}
609,hasNewCoordinates(){var e=Object.keys(this.new_coordinates).length;if(e>0){return true}return false}},methods:{show(){this.cmaps_full=false;p(this.$refs.address_modal).modal("show");setTimeout(()=>{this.renderMap()},100)},hide(){this.error=[];p(this.$refs.address_modal).modal("hide")},close(){this.hide()},setLoading(e){this.is_loading=e},closeModal(){u("closeModal");this.hide();this.$emit("afterClosemodal")},getAddressAttributes(){axios({method:"POST",url:ajaxurl+"/getAddressAttributes",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.cmaps_config=e.data.details.maps_config;this.delivery_options_data=e.data.details.delivery_option;this.address_label_data=e.data.details.address_label;this.delivery_options=e.data.details.default_atts.delivery_options;this.address_label=e.data.details.default_atts.address_label;this.custom_field_enabled=e.data.details.custom_field_enabled;this.custom_field1_data=e.data.details.custom_field1_data;this.custom_field1=Object.keys(this.custom_field1_data)[0]}else{this.cmaps_config=[];this.delivery_options_data=[];this.address_label_data=[];this.custom_field1_data=[];this.custom_field_enabled=false}})["catch"](e=>{}).then(e=>{})},renderMap(){this.cmaps_provider=this.cmaps_config.provider;switch(this.cmaps_provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{this.cmaps=new google.maps.Map(this.$refs.ref_map,{center:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true,styles:map_style})}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.ref_map,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break;case"yandex":this.initYandexDeliveryDetails();break}},async initYandexDeliveryDetails(){await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:t,YMapMarker:a,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};if(!T){T=new e(this.$refs.ref_map,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);I=new r({coordinates:n.center});T.addChild(I)}else{console.debug("here here")}},addMarker(t){switch(this.cmaps_provider){case"google.maps":I=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}I=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){switch(this.cmaps_provider){case"google.maps":I.setMap(null);break;case"mapbox":I.remove();break}},adjustPin(){this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}console.log("adjustPin",this.cmaps_provider);this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_provider=="google.maps"){I.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_provider=="mapbox"){I.on("dragend",e=>{const t=I.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}else if(this.cmaps_provider=="yandex"){const t={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};I.update({coordinates:t.center,draggable:true,onDragEnd:e=>{console.log("onDragEnd",e);
609this.new_coordinates={lat:e[1],lng:e[0]}}})}},cancelPin(){this.error=[];this.cmaps_full=false;if(this.cmaps_provider=="yandex"){const e={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};I.update({coordinates:e.center,draggable:false})}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}},mapBoxResize(){if(this.cmaps_provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},setNewCoordinates(){let e="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content");e+="&cart_uuid="+getCookie("cart_uuid");e+="&lat="+this.location_data.latitude;e+="&lng="+this.location_data.longitude;e+="&new_lat="+this.new_coordinates.lat;e+="&new_lng="+this.new_coordinates.lng;axios({method:"POST",url:ajaxurl+"/checkoutValidateCoordinates",data:e,timeout:c}).then(e=>{if(e.data.code==1){this.location_data.latitude=this.new_coordinates.lat;this.location_data.longitude=this.new_coordinates.lng;this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}else{ElementPlus.ElNotification({title:"",message:e.data.msg[0],position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{})},save(){this.$emit("onSavelocation",this.location_data,{address1:this.address1,formatted_address:this.formatted_address,location_name:this.location_name,delivery_options:this.delivery_options,address_label:this.address_label,delivery_instructions:this.delivery_instructions,address2:this.address2,postal_code:this.postal_code,company:this.company,address_format_use:this.cmaps_config.address_format_use,custom_field1:this.custom_field1,custom_field2:this.custom_field2})}}};const Be=Vue.createApp({components:{"components-loading-box":Ce}}).mount("#vue-loading-box");const Je=Vue.createApp({components:{"component-home-search":Oe}}).mount("#vue-home-search");const Ge=Vue.createApp({components:{"component-home-search":Oe}}).mount("#vue-home-search-mobile");const We={props:["title","featured_name","settings","responsive"],data(){return{is_loading:false,owl:undefined,data:[],services:[],estimation:[],location_details:[]}},mounted(){this.GetFeaturedLocation()},computed:{hasData(){if(this.data.length>0){return true}return false},classObject(){return{"w-100":this.settings.theme==="rounded","w-75":this.settings.theme==="rounded-circle"}}},methods:{GetFeaturedLocation(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),featured_name:this.featured_name};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/GetFeaturedLocation",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.location_details=e.details.location_details;this.data=e.details.data;this.services=e.details.services;this.estimation=e.details.estimation;setTimeout(()=>{this.RenderCarousel()},1)}else{this.location_details="";this.data="";this.services="";this.estimation=""}});n[t].always(e=>{this.is_loading=false})},RenderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.owl_carousel).owlCarousel({items:parseInt(this.settings.items),lazyLoad:this.settings.lazyLoad=="1"?true:false,loop:this.settings.loop=="1"?true:false,margin:parseInt(this.settings.margin),nav:this.settings.nav=="1"?true:false,dots:this.settings.dots=="1"?true:false,stagePadding:parseInt(this.settings.stagePadding),responsive:this.responsive,rtl:e})},SlideNext(){this.owl.trigger("next.owl.carousel")},SlidePrev(){this.owl.trigger("prev.owl.carousel",[300])}},template:` 610 611 <DIV class="mt-5 mb-5"> 612 613 <div class="row no-gutters mb-4 " v-if="hasData" > 614 <div class="col d-flex justify-content-start align-items-center "> 615 <h5 class="m-0 section-title"> 616 {{title}} <span>{{location_details.location_name}}</span> 617 </h5> 618 </div> 619 <div class="col d-flex justify-content-end align-items-center "> 620 <a @click="SlidePrev" href="javascript:;" class="owl-carousel-nav prev mr-4"> </a> 621 <a @click="SlideNext" href="javascript:;" class="owl-carousel-nav next"> </a> 622 </div> <!--col--> 623 </div> <!--row--> 624
625 <div ref="owl_carousel" class="owl-carousel restaurant-carousel" :class="settings.theme" v-if="hasData" > 626 627 <div v-for="item in data" class="row equal align-items-center position-relative" 628 :class="classObject" 629 > 630 631 <template v-for="(cuisine,index) in item.cuisine_name" > 632 <template v-if="index <= 0"> 633 634 <span class="badge mr-1 top-left" v-if="settings.theme==='rounded'" 635 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 636 >{{cuisine.cuisine_name}}</span> 637 638 <div class="rounded-pill badge top-right" v-if="item.ratings.rating>0" 639 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 640 > 641 {{item.ratings.rating}} 642 </div> 643 644 </template> 645 </template> 646 647 648 <div class="w-100 list-items p-0 " > 649 <a :href="item.merchant_url" ><img :class="settings.theme" :src="item.url_logo" /></a> 650 </div> 651 652 <!--ROUNDED TEMPLATE--> 653 <template v-if="settings.theme==='rounded'"> 654 <div class="d-flex justify-content-between mt-2 w-100 pl-1 pr-1 "> 655 <div class="flex-col "> 656 <a :href="item.merchant_url" ><h6>{{item.restaurant_name}}</h6></a> 657 </div> 658 </div> <!--flex--> 659 660 <div class="d-flex justify-content-between w-100 pl-1 pr-1"> 661 <div class="flex-col"> 662 <p class="m-0"> 663 <i class="zmdi zmdi-time mr-1"></i> 664 665 <template v-if="estimation[item.merchant_id]"> 666 <template v-if="services[item.merchant_id]"> 667 <template v-for="(service_name,index_service) in services[item.merchant_id]" > 668 <template v-if="index_service<=0"> 669 670 <template v-if="estimation[item.merchant_id][service_name]"> 671 <template v-if="estimation[item.merchant_id][service_name][item.charge_type] "> 672 {{ estimation[item.merchant_id][service_name][item.charge_type].estimation }} <?php echo t("min")?> 673 </template> 674 </template> 675 676 </template> 677 </template> 678 </template> 679 </template> 680 681 </p> 682 </div> 683 <div class="flex-col"><p class="m-0" v-if="item.free_delivery==='1'" >{{ settings.free_delivery}}</p></div>
684 </div> <!--flex--> 685 </template> 686 <!--END ROUNDED TEMPLATE--> 687 688 <!-- ROUNDED CIRCLE TEMPLATE--> 689 <template v-else > 690 <div class="mt-3 text-center w-100"> 691 <a :href="item.merchant_url" ><h6 class="mb-1">{{item.restaurant_name}}</h6></a> 692 693 <template v-for="(cuisine,index) in item.cuisine_name" > 694 <template v-if="index <= 0"> 695 696 <span class="badge" 697 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 698 >{{cuisine.cuisine_name}}</span> 699 700 701 </template> 702 </template> 703 704 </div> 705 </template> 706 <!-- END ROUNDED CIRCLE TEMPLATE--> 707 708 </div> <!-- row--> 709 710 </div><!-- owl-carousel--> 711 712 </DIV> 713 `};const Ze={props:["data"],data(){return{owl:undefined}},mounted(){},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.cuisine_carousel).owlCarousel({loop:true,dots:false,nav:false,autoWidth:true,rtl:e})}},template:` 714 <div ref="cuisine_carousel" class="owl-carousel owl-theme cuisine_carousel"> 715 <div v-for="(item, index) in data" class="mr-2"> 716 <a :href="item.url" class="d-block bg-light rounded-pill" 717 :class="{active : index==0 }" 718 > 719 {{item.cuisine_name}} 720 </a> 721 </div> 722 </div> 723 `};const He={props:["responsive","label"],data(){return{owl:undefined}},mounted(){this.renderCarousel()},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.carousel_three_steps).owlCarousel({rtl:e,loop:true,dots:true,nav:false,responsive:{0:{items:1,loop:false},320:{items:1,loop:false},480:{items:1,loop:false},600:{items:1,loop:false},700:{items:2,loop:false},1e3:{items:2,loop:false}}})}},template:"#three-steps-ordering"};const Qe={template:"#xtemplate_cuisine_list",props:["title"],data(){return{swiperCuisine:null,data:[],loading:false}},mounted(){this.getCuisine()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getCuisine(){this.loading=true;let e="language="+language;axios.get(ajaxurl+"/CuisineList2?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetcuisine",true)}else{this.data=[];this.$emit("afterGetcuisine",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperCuisine=new Swiper(this.$refs.swiperCuisineList,{lazy:true,slidesPerView:7.5,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:3,spaceBetween:0},320:{slidesPerView:3,spaceBetween:0},480:{slidesPerView:3.5,spaceBetween:0},640:{slidesPerView:4.5,spaceBetween:5},768:{slidesPerView:7,spaceBetween:10},1024:{slidesPerView:7.5,spaceBetween:15}}})},setUrl(e){window.location.href=e}}};const Xe={template:"#xtemplate_swiper_list",props:["title","query","filters_transactions","city_id","area_id","state_id","postal_id"],data(){return{swiperList:null,loading:true,data:[],available_vouchers:null,available_promos:null}},mounted(){this.getData()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getData(){this.loading=true;const e="query="+this.query;axios.get(ajaxurl+"/GetFeaturedLocation?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.available_vouchers=e.data.details.available_vouchers;this.available_promos=e.data.details.available_promos;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetfeatured",true)}else{this.data=[];this.$emit("afterGetfeatured",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperList=new Swiper(this.$refs.refSwiperList,{lazy:true,slidesPerView:3.5,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:1,spaceBetween:0}
723,320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:3,spaceBetween:10},1024:{slidesPerView:3.5,spaceBetween:15}}})},setUrl(e){window.location.href=e}}};const et={template:"#xtemplate_join",props:["title"],data(){return{swiperList:null,loading:true,data:[]}},mounted(){this.getData()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getData(){this.loading=true;let e="language="+language;axios.get(ajaxurl+"/getJoin?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;setTimeout(()=>{this.initSwiper()},1)}else{this.data=[]}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperList=new Swiper(this.$refs.refSwiperList,{lazy:true,slidesPerView:3,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:1,spaceBetween:0},320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:3,spaceBetween:10},1024:{slidesPerView:3,spaceBetween:15}}})}}};let tt=null;let at=null;if(typeof componentsFeaturedItemList!=="undefined"&&componentsFeaturedItemList!==null){tt=componentsFeaturedItemList}if(typeof componentsItemDialog!=="undefined"&&componentsItemDialog!==null){at=componentsItemDialog}let st=null;if(typeof componentsFeaturedList!=="undefined"&&componentsFeaturedList!==null){st=componentsFeaturedList}const it=Vue.createApp({components:{"components-swiper-list":Xe,"component-three-steps":He,"components-cuisine-list":Qe,"components-join":et,"components-featured-list":tt,"components-item-dialog":at,"components-featured-merchant":st},data(){return{data_cuisine:[],cuisine_url:""}},methods:{viewItem(e){const t=e?.is_eligible;if(!t){return}this.$refs.ref_item_dialog.viewItem({cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},afterAddtocart(){if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof ot!=="undefined"&&ot!==null){ot.$refs.ref_featured_list.getFeaturedItems()}}}});it.use(ElementPlus);it.component("infinite-loading",V3InfiniteLoading["default"]);const ot=it.mount("#vue-home-widgets");const rt={props:["active","merchant_id","is_guest","please_login"],data(){return{data:[],loading:false}},methods:{SaveStore(){if(this.is_guest){ElementPlus.ElNotification({title:"",message:this.please_login,position:"bottom-right",type:"warning"});return}var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id};var t=500;e=JSON.stringify(e);this.loading=true;n[t]=p.ajax({url:ajaxurl+"/SaveStore",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.$emit("afterSave",true)}else{D.alert(e.msg,{})}});n[t].always(e=>{this.loading=false})}},template:` 724 <div class="d-none d-lg-block" > 725 <a @click="SaveStore()" href="javascript:;" class="btn bg-light btn-circle rounded-pill"> 726 <i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i> 727 </a> 728 </div> 729 <div class="d-block d-lg-none"> 730 <a @click="SaveStore()" href="javascript:;" class="btn bg-light btn-circle rounded-pill"> 731 <i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i> 732 </a> 733 </div> 734 `};var dt=function(){var e=[];var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a=Object.keys(t).length;if(a>0){e={whento_deliver:t.whento_deliver};if(t.whento_deliver=="schedule"){e={whento_deliver:t.whento_deliver,delivery_date:t.delivery_date,delivery_time:t.delivery_time.start_time,delivery_time_raw:t.delivery_time}}return e}return false};const lt={components:{"star-rating":VueStarRating["default"]},props:["data_attributes","data_cuisine","label"],data(){return{sortby:"",cuisine:[],price_range:0,max_delivery_fee:0,rating:0}},computed:{hasFilter(){if(!empty(this.sortby)){return true}if(this.price_range>0){return true}if(this.max_delivery_fee>0){return true}if(this.cuisine.length>0){return true}if(this.rating>0){return true}return false}},methods:{show(e){p(this.$refs.filterFeed).modal("show")},close(){p(this.$refs.filterFeed).modal("hide")},clearFilter(){this.sortby="";this.price_range=0;this.max_delivery_fee=0;this.cuisine=[];this.rating=0},applyFilter(){this.close();this.$emit("afterFilter",{sortby:this.sortby,cuisine:this.cuisine,price_range:this.price_range,max_delivery_fee:this.max_delivery_fee,rating:this.rating})}},template:` 735 <div class="modal" ref="filterFeed" tabindex="-1" role="dialog" 736 aria-labelledby="filterFeed" aria-hidden="true" > 737 <div class="modal-dialog modal-full modal-dialog-scrollable" role="document"> 738 <div class="modal-content"> 739 <div class="modal-body" > 740 741 <a href="javascript:;" @click="close" 742 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 743 744 <h5 class="mt-3">{{label.filters}}</h5> 745 746 <div v-for="(sort_by, key) in data_attributes.sort_by" class="row m-0 ml-2 mb-2"> 747 <div class="custom-control custom-radio"> 748 <input v-model="sortby" :value="key" type="radio" :id="key+1" class="custom-control-input"> 749 <label class="custom-control-label" :for="key+1">{{sort_by}}</label>
750 </div> 751 </div><!--row--> 752 753 <h5 class="mt-3">{{label.price_range}}</h5> 754 755 <div class="btn-group btn-group-toggle input-group-small mt-2 mb-2 w-100" > 756 <label v-for="(price, key) in data_attributes.price_range" class="btn" :class="{ active: price_range==key }" > 757 <input type="radio" :value="key" v-model="price_range"> 758 <!-- {{price}} --> 759 <span v-html="price"></span> 760 </label> 761 </div> 762 763 <h5 class="mt-3">{{label.cuisine}}</h5> 764 765 <div class="row m-0"> 766 <template v-for="(item_cuisine, index) in data_cuisine" > 767 <div class="col-6 mb-1" > 768 <div class="custom-control custom-checkbox"> 769 <input type="checkbox" class="custom-control-input cuisine" :id="'cuisine'+item_cuisine.cuisine_id+1" 770 :value="item_cuisine.cuisine_id" 771 v-model="cuisine" 772 > 773 <label class="custom-control-label" :for="'cuisine'+item_cuisine.cuisine_id+1"> 774 {{item_cuisine.cuisine_name}} 775 </label> 776 </div> 777 </div> <!--col--> 778 </template> 779 </div><!-- row--> 780 781 <h5 class="mt-3">{{label.max_delivery_fee}}</h5> 782 783 <div class="form-group"> 784 <label for="formControlRange">{{label.delivery_fee}} <b><span class="min-selected-range"></span></b></label> 785 <input v-model="max_delivery_fee" 786 id="min_range_slider" value="10" type="range" class="custom-range" id="formControlRange" min="1" max="20" > 787 </div> 788 789 <h5 class="mt-3">{{label.ratings}}</h5> 790 <p class="bold">{{label.over}} {{rating}}</p> 791 <star-rating 792 v-model:rating="rating" 793 :star-size="30" 794 :show-rating="false" 795 @update:rating="rating = $event" 796 > 797 </star-rating> 798 799 </div> <!--content--> 800 801 <div class="modal-footer border-top-0"> 802 <template v-if="hasFilter"> 803 <button @click="clearFilter" class="btn btn-light rounded-0 w-50" > 804 {{label.clear_all}} 805 </button> 806 <button @click="applyFilter" class="btn btn-black rounded-0 w-50" > 807 {{label.done}} 808 </button> 809 </template> 810 <template v-else> 811 <button @click="applyFilter" class="btn btn-black rounded-0 w-100" > 812 {{label.done}} 813 </button> 814 </template> 815 </div> 816 <!--- modal footer --> 817 818 </div> <!--dialog--> 819 </div> <!--modal--> 820 `};const nt={props:["ajax_url","tabs_suggestion","label"],data(){return{active_tab:"restaurant",data:[],q:"",awaitingSearch:false,is_loading:false}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){this.clearData();return false}this.show_list=true;this.is_loading=true;setTimeout(()=>{axios({method:"POST",url:ajaxurl+"/getSearchSuggestionV1",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+this.q+"&category="+this.active_tab,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false;this.is_loading=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{show(e){this.clearData();p(this.$refs.suggestion).modal("show");setTimeout(()=>{this.$refs.q.focus()},500)},close(){p(this.$refs.suggestion).modal("hide")},showList(){this.show_list=true},clearData(){this.data=[];this.q="";this.show_list=false},setTab(e){this.clearData();this.show_list=false;this.active_tab=e}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:` 821 <div class="modal" ref="suggestion" tabindex="-1" role="dialog" 822 aria-labelledby="suggestion" aria-hidden="true" > 823 <div class="modal-dialog modal-full modal-dialog-scrollable" role="document"> 824 <div class="modal-content"> 825 <div class="modal-body p-0" > 826 827 <div class="container-fluid mt-3 mb-2"> 828 <a href="javascript:;" @click="close" 829 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 830 831 <div class="position-relative inputs-box-wrap mt-3 "> 832 <input @click="showList" ref="q" v-model="q" class="inputs-box-grey rounded w-100" :placeholder="label.search"> 833 <div class="search_placeholder pos-right img-15"></div> 834 <button @click="clearData" v-if="show_list" class="btn btn-sm icon-remove">{{label.clear}}</button> 835 </div> 836 837 </div> 838 <!-- container --> 839 840 <ul class="suggestion-tab row no-gutters list-unstyled list-inline"> 841 <li v-for="(item, index) in tabs_suggestion" 842 class="col list-inline-item mr-0" 843 :class="{active : active_tab==index }" 844 @click="setTab(index)" 845 > 846 {{item}} 847 </li> 848 </ul> 849 850 <div class="container-fluid "> 851 852 <el-skeleton :count="9" animated :loading="is_loading" > 853 <template #template> 854 <div class="row mb-2"> 855 <div class="col-2">
856 <el-skeleton style="--el-skeleton-circle-size: 40px"> 857 <template #template> 858 <el-skeleton-item variant="circle" /> 859 </template> 860 </el-skeleton> 861 </div> <!-- col --> 862 863 <div class="col"> 864 <el-skeleton animated> 865 <template #template> 866 <div style="padding: 0px"> 867 <el-skeleton-item variant="p" style="width: 50%" /> 868 <div 869 style=" 870 display: flex; 871 align-items: center; 872 justify-items: space-between; 873 " 874 > 875 <el-skeleton-item variant="text" style="margin-right: 16px" /> 876 <el-skeleton-item variant="text" style="width: 30%" /> 877 </div> 878 </div> 879 </template> 880 </el-skeleton> 881 </div> <!-- col --> 882 </div> 883 <!-- row --> 884 </template> 885 886 <template #default> 887 <template v-if="hasData"> 888 <ul class="list-unstyled m-0"> 889 <li v-for="items in data"> 890 <a :href="items.url"> 891 <div class="row align-items-center no-gutters"> 892 <div class="col-1 mr-3"> 893 <img class="img-40 rounded-pill" :src="items.url_logo"> 894 </div> 895 <div class="col text-truncate border-bottom p-2"> 896 <h6 class="m-0 text-truncate">{{items.title}}</h6> 897 <p class="m-0 text-truncate text-grey "> 898 <span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span> 899 </p> 900 </div> 901 </div> 902 </a> 903 </li> 904 </ul> 905 </template> 906 <template v-else> 907 <template v-if="q"> 908 <el-empty :description="label.no_results"></el-empty> 909 </template> 910 </template> 911 912 </template> 913 914 </el-skeleton> 915 916 917 </div> 918 <!-- container --> 919 920 921 922 923 </div> <!--content--> 924 </div> <!--dialog--> 925 </div> <!--modal--> 926 `};const ct={template:"#xtemplate_banner",data(){return{loading:false,swiperBanner:null,data:null}},mounted(){this.getBanner()},computed:{hasBanner(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getBanner(){const e=getFromLocalStorageStore(StoreMapName,"selectedAddress");if(typeof e==="undefined"||e===null||e===""){return}let t="latitude="+e.latitude+"&longitude="+e.longitude;this.loading=true;axios.get(ajaxurl+"/getBanner?"+t).then(e=>{if(e.data.code==1){this.data=e.data.details.data;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetbanner",true)}else{this.data=null;this.$emit("afterGetbanner",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperBanner=new Swiper(this.$refs.refSwiper,{lazy:true,slidesPerView:3,spaceBetween:15,autoHeight:true,autoplay:{delay:2500,disableOnInteraction:false},pagination:{el:".swiper-pagination",clickable:true,dynamicBullets:true},breakpoints:{310:{slidesPerView:1,spaceBetween:0},320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:2,spaceBetween:10},1024:{slidesPerView:3,spaceBetween:15}}})},onBannerClick(e){window.location.href=e.url}}};const mt=Vue.createApp({components:{"component-save-store":rt,"star-rating":VueStarRating["default"],"component-filter-feed":lt,"component-mobile-search-suggestion":nt,"components-banner":ct},data(){return{is_loading:false,reload_loading:false,collapse:true,data_attributes:[],data_cuisine:[],cuisine:[],sortby:"",price_range:0,max_delivery_fee:0,page:0,show_next_page:false,datas:[],services:[],estimation:[],total_message:"",rating:0,transaction_type:"",whento_deliver:"",delivery_date:"",delivery_time:"",response_code:1,pause_reason_data:[],data_attributes_loading:false,enabled_review:true,has_banner:false,is_guest:true}},mounted(){this.getCuisineList();this.searchAttributes();this.pauseReasonList();if(typeof cuisine_filter!=="undefined"&&cuisine_filter!==null){let e=JSON.parse(cuisine_filter);this.cuisine=e}this.Search(false);if(typeof isGuest!=="undefined"&&isGuest!==null){this.is_guest=isGuest}},computed:{hasFilter(){if(!empty(this.sortby)){return true}if(this.price_range>0){return true}if(this.max_delivery_fee>0){this.AutoFeed();return true}if(this.cuisine.length>0){return true}if(this.rating>0){this.AutoFeed();return true}return false},hasMore(){if(this.show_next_page){return true}return false},hasData(){if(this.datas.length>0){return true}return false},hasFilter(){if(Object.keys(this.cuisine).length>0){return true}if(!empty(this.sortby)){return true}if(!empty(this.price_range)){return true}if(!empty(this.max_delivery_fee)){return true}if(!empty(this.rating)){return true}return false}},methods:{afterGetbanner(e){this.has_banner=e},clearFilter(){this.sortby="";this.price_range=0;this.max_delivery_fee=0;this.cuisine=[];this.rating=0;this.Search(false)},getCuisineList(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/CuisineList",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data_cuisine=e.details.data_cuisine}else{this.data_cuisine=[]}});n[t].always(e=>{})},searchAttributes(){let e=getCookie("currency_code");e=!empty(e)?e:"";var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),currency_code:e};var a=g();t=JSON.stringify(t);this.data_attributes_loading=true;n[a]=p.ajax({url:ajaxurl+"/searchAttributes",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data_attributes=e.details}else{this.data_attributes=[]}});n[a].always(e=>{this.data_attributes_loading=false})},ShowMore(){this.Search(this.show_next_page)},AutoFeed(){setTimeout(()=>{this.Search(false)},100)},Search(t){if(t){var a=11}else{var a=g();this.page=0}var e;if(e=dt()){if(empty(this.whento_deliver)){this.whento_deliver=e.whento_deliver;this.delivery_date=e.delivery_date;this.delivery_time=e.delivery_time}}let s=getCookie("currency_code");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),local_id:getCookie("kmrs_local_id"),cart_uuid:getCookie("cart_uuid"),page:this.page,currency_code:s,filters:{cuisine:this.cuisine,sortby:this.sortby,price_range:this.price_range,max_delivery_fee:this.max_delivery_fee,rating:this.rating,transaction_type:this.transaction_type,whento_deliver:this.whento_deliver,delivery_date:this.delivery_date,delivery_time:this.delivery_time}};i=JSON.stringify(i);n[a]=p.ajax({url:ajaxurl+"/getFeedV1",method:"PUT",dataType:"json",data:i,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{this.response_code=e.code;if(e.code==1){if(!t){this.datas=[];this.services=[];this.estimation=[]}this.datas=[...this.datas,...e.details.data];this.services=e.details.services;this.estimation=e.details.estimation;this.total_message=e.details.total_message;this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.transaction_type=e.details.transaction_type;this.enabled_review=e.details.enabled_review;this.updateImage()}else{this.datas=[];this.services=[];this.estimation=[];this.total_message="";this.show_next_page=false;this.page=0;this.transaction_type=""}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},pauseReasonList(){axios({method:"POST",url:ajaxurl+"/pauseReasonList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.pause_reason_data=e.data.details}else{this.pause_reason_data=[]}})["catch"](e=>{}).then(e=>{})},updateImage(){h()},afterSaveStore(e){e.saved_store=e.saved_store==1?false:true},showFilter(){this.$refs.filter_feed.show()},afterApplyFilter(e){this.sortby=e.sortby;this.cuisine=e.cuisine;this.price_range=e.price_range;this.max_delivery_fee=e.max_delivery_fee;this.rating=e.rating;this.AutoFeed()},showSearchSuggestion(){this.$refs.search_suggestion.show()}}});mt.use(ElementPlus);const a=mt.mount("#vue-feed");const ut={data(){return{data:[],transaction_type:"",is_loading:false}}
926,mounted(){this.getServices()},methods:{getServices(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid")};n[t]=p.ajax({url:ajaxurl+"/getServices",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.transaction_type=e.details.transaction_type;this.$emit("setTransaction",this.transaction_type,e.details.data)}else{this.data=[];this.transaction_type=""}});n[t].always(e=>{this.is_loading=false})},setTransactionType(e){var t=g();var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),transaction_type:e,cart_uuid:getCookie("cart_uuid")};n[t]=p.ajax({url:ajaxurl+"/setTransactionType",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);this.transaction_type=e.details.transaction_type;this.$emit("afterSettransaction",this.transaction_type)}else{this["this"].transaction_type=""}});n[t].always(e=>{})}},template:` 927 928 <template v-if="is_loading" > 929 <el-skeleton animated style="width:auto;" class="mr-2"> 930 <template #template> 931 <el-skeleton-item variant="button"></el-skeleton-item> 932 </template> 933 </el-skeleton> 934 </template> 935 936 <div v-else class="dropdown widget-dropdown mr-2" > 937 <button class="" type="button" id="dropdownMenuButton" 938 data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 939 <template v-if="data[transaction_type]"> 940 {{data[transaction_type].service_name}} 941 </template> 942 </button> 943 944 <div class="dropdown-menu" aria-labelledby="services"> 945 <a v-for="item in data" href="javascript:;" @click="setTransactionType(item.service_code)" > 946 {{item.service_name}} 947 </a> 948 </div> 949 950 </div> <!--dropdown--> 951 `};const ht={props:["layout","transaction_type","label","transaction_list"],data(){return{address1:"",whento_deliver:"",formatted_address:"",loading:false,delivery_option:[],delivery_datetime:"",visible:false}},mounted(){this.TransactionInfo()},methods:{TransactionInfo(){var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a=g();var s={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),choosen_delivery:t,merchant_id:e};n[a]=p.ajax({url:ajaxurl+"/TransactionInfo",method:"PUT",dataType:"json",data:JSON.stringify(s),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.address1=e.details.address1;this.whento_deliver=e.details.whento_deliver;this.formatted_address=e.details.formatted_address;this.delivery_option=e.details.delivery_option;this.delivery_datetime=e.details.delivery_datetime;this.visible=true;if(e.details.time_already_passed){setCookie("choosen_delivery",[],30)}}else{this.address1="";this.whento_deliver="";this.formatted_address="";this.delivery_option=[];this.delivery_datetime="";this.visible=false}});n[a].always(e=>{this.loading=false})},setTransactionInfo(){this.$emit("afterClick",{address1:this.address1,delivery_option:this.delivery_option,whento_deliver:this.whento_deliver,formatted_address:this.formatted_address,delivery_datetime:this.delivery_datetime})}},template:` 952 <template v-if="loading" > 953 <el-skeleton animated style="width:auto;"> 954 <template #template> 955 <el-skeleton-item variant="button"></el-skeleton-item> 956 </template> 957 </el-skeleton> 958 </template> 959 <div v-else class="position-relative"> 960 <template v-if="layout=='widget-dropdown-address'"> 961 <p class="m-0"> 962 963 <template v-if="whento_deliver=='schedule'"> 964 {{delivery_datetime}} 965 </template> 966 <template v-else>
967 <span class="text-capitalize"> 968 <template v-if="transaction_list[transaction_type]"> 969 {{transaction_list[transaction_type].service_name}} 970 </template> 971 <template v-else> 972 {{transaction_type}} 973 </template> 974 </span> {{label.now}} 975 </template> 976 977 </p> 978 <div class="dropdown"> 979 <button @click="setTransactionInfo()" class="btn-text dropdown-toggle" type="button" > 980 <span class="text-truncate">{{address1}}</span> 981 </button> 982 </template> 983 984 <template v-else> 985 986 <div class="widget-dropdown" v-if="visible" > 987 <button class="no-icons d-flex align-items-center" @click="setTransactionInfo()" > 988 <span class="d-inline text-truncate"> 989 <template v-if="address1"> 990 {{address1}} {{formatted_address}} 991 </template> 992 <template v-else> 993 {{label.select_address}} 994 </template> 995 </span> 996 <span class="d-inline"> • 997 998 <template v-if="whento_deliver=='schedule'"> 999 {{delivery_datetime}} 1000 </template> 1001 <template v-else> 1002 <template v-if="delivery_option[whento_deliver]"> 1003 {{ delivery_option[whento_deliver].short_name }} 1004 </template> 1005 </template> 1006 1007 </span> 1008 </button> 1009 </div> 1010 </template> 1011 </div> 1012 `};const _t={props:["label"],data(){return{data:[],screen_size:{width:0,height:0}}},mounted(){this.handleResize();window.addEventListener("resize",this.handleResize)},computed:{isMobileView(){if(this.screen_size.width<=991){return true}return false}},methods:{show(e){this.data=e;p(this.$refs.ModalDeliveryDetails).modal("show")},close(){let e=this.$refs.ModalDeliveryDetails;p(e).modal("hide");if(e){e.classList.remove("show");e.style.display="none";e.setAttribute("aria-hidden","true");e.removeAttribute("aria-modal")}setTimeout(()=>{if(!document.querySelector(".modal.show")){document.querySelectorAll(".modal-backdrop").forEach(e=>e.remove());document.body.classList.remove("modal-open");document.body.style.removeProperty("padding-right");document.body.style.removeProperty("overflow")}},0)},handleResize(){this.screen_size.width=window.innerWidth;this.screen_size.height=window.innerHeight}},template:` 1013 <div class="modal" ref="ModalDeliveryDetails" tabindex="-1" role="dialog" 1014 aria-labelledby="ModalDeliveryDetails" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 1015 <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> 1016 <div class="modal-content" :class="{ 'modal-mobile': isMobileView }" > 1017 1018 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1019 <h5 class="modal-title">{{label.title}}</h5> 1020 <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1021 </div> 1022 1023 <div class="modal-body" > 1024 1025 <a href="javascript:;" @click="$emit('showAddress')" 1026 class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2"> 1027 <div class="flexcol mr-2"><i class="zmdi zmdi-pin"></i></div> 1028 <div class="flexcol" > 1029 <template v-if="data.address1"> 1030 <span class="bold mr-1">{{data.address1}}</span> 1031 <p class="m-0 text-muted">{{data.formatted_address}}</p> 1032 </template> 1033 <template v-else> 1034 <span class="bold mr-1">{{label.select_address}}</span> 1035 </template> 1036 </div> 1037 </a> 1038 1039 <a v-if="data" href="javascript:;" @click="$emit('showTransOptions')" 1040 class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2"> 1041 <div class="flexcol mr-2"><i class="zmdi zmdi-time"></i></div> 1042 <div class="flexcol" > 1043 <template v-if="data.whento_deliver=='schedule'"> 1044 {{data.delivery_datetime}} 1045 </template> 1046 <template v-else> 1047 <template v-if="data.delivery_option"> 1048 {{ data.delivery_option[data.whento_deliver].short_name }} 1049 </template> 1050 </template> 1051 </div> 1052 </a> 1053 1054 </div> <!--modal-body--> 1055 1056 <div class="modal-footer justify-content-start"> 1057 1058 <button class="btn btn-black w-100" @click="close();" > 1059 {{label.done}} 1060 </button> 1061 1062 </div> <!--modal-footer--> 1063 1064 </div> <!--content--> 1065 </div> <!--dialog--> 1066 </div> <!--modal--> 1067 `};const pt={props:["label"],data(){return{data:[],loading:false,delivery_option:[],whento_deliver:"",opening_hours_date:[],opening_hours_time:[],delivery_date:"",delivery_time:"",error:[]}},mounted(){},computed:{hasError(){if(this.error.length>0){return true}return false}},methods:{show(e){p(this.$refs.modalselecttime).modal("show");this.getDeliveryTimes()},close(){p(this.$refs.modalselecttime).modal("hide");this.$emit("afterClose")},getDeliveryTimes(){var t=g();var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),merchant_id:e};n[t]=p.ajax({url:ajaxurl+"/getDeliveryTimes",method:"PUT",dataType:"json",data:JSON.stringify(a),c
1067ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.delivery_option=e.details.delivery_option;this.whento_deliver=e.details.whento_deliver;this.opening_hours_date=e.details.opening_hours.dates;this.opening_hours_time=e.details.opening_hours.time_ranges;var t=Object.keys(e.details.opening_hours.dates);this.delivery_date=t[0];var t=e.details.opening_hours.time_ranges[this.delivery_date][0];this.delivery_time=JSON.stringify(t);if(!empty(e.details.delivery_date)){this.delivery_date=e.details.delivery_date}if(!empty(e.details.delivery_time)){this.delivery_time=e.details.delivery_time}u("SELECTED=>");u(this.delivery_date);u(this.delivery_time);u(this.delivery_option)}else{this.delivery_option=[];this.whento_deliver="";this.error=e.msg}});n[t].always(e=>{this.loading=false})},save(){var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),delivery_date:this.delivery_date,whento_deliver:this.whento_deliver,delivery_time:!empty(this.delivery_time)?JSON.parse(this.delivery_time):""};n[t]=p.ajax({url:ajaxurl+"/saveTransactionInfo",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.$emit("afterSave",e.details);if(e.code==1){var t={whento_deliver:e.details.whento_deliver,delivery_date:e.details.delivery_date,delivery_time:e.details.delivery_time};setCookie("choosen_delivery",JSON.stringify(t),30)}});n[t].always(e=>{this.loading=false})},JsonValue(e){return JSON.stringify({start_time:e.start_time,end_time:e.end_time,pretty_time:e.pretty_time})}},template:` 1068 <div class="modal" ref="modalselecttime" id="ModalTRNOptions" tabindex="-1" role="dialog" 1069 aria-labelledby="ModalTRNOptions" aria-hidden="true" > 1070 <div class="modal-dialog" role="document"> 1071 <div class="modal-content"> 1072 <div class="modal-body" > 1073 1074 <a href="javascript:;" @click="close" 1075 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1076 1077 <h4 class="m-0 mb-3 mt-3">{{label.title}}</h4> 1078 1079 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1080 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1081 </div> 1082 1083 <div class="btn-group btn-group-toggle input-group-small mt-2 mb-3" > 1084 <label v-for="(item, index) in delivery_option" class="btn" :class="{ active: whento_deliver==item.value }" > 1085 <input type="radio" :value="item.value" name="whento_deliver" v-model="whento_deliver"> 1086 {{item.name}} 1087 </label> 1088 </div> 1089 1090 <template v-if="whento_deliver=='schedule'"> 1091 1092 <select class="form-control custom-select mb-3" v-model="delivery_date"> 1093 <option v-for="(item, index) in opening_hours_date" :value="item.value" > 1094 {{ item.name}} 1095 </option> 1096 </select> 1097 1098 <select id="delivery_time" class="form-control custom-select" 1099 v-model="delivery_time" v-if="opening_hours_date[delivery_date]" > 1100 <option v-for="(item, index) in opening_hours_time[delivery_date]" 1101 :value="JsonValue(item)" > 1102 {{item.pretty_time}} 1103 </option> 1104 </select> 1105 1106 </template> 1107 1108 </div> <!--modal-body--> 1109 1110 1111 <div class="modal-footer justify-content-start"> 1112 1113 <button @click="save" 1114 class="btn btn-green w-100" :class="{ loading: loading }" 1115 :disabled="hasError" 1116 > 1117 <span class="label">{{label.save}}</span> 1118 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1119 </button> 1120 1121 </div> <!--modal-footer--> 1122 1123 </div> <!--content--> 1124 </div> <!--dialog--> 1125 </div> <!--modal--> 1126 `};
1126const ft={props:["label"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[]}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){this.clearData();return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getSearchSuggestion",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""}},template:` 1127 1128 <div class="mr-2 position-relative inputs-box-wrap d-none d-md-block"> 1129 <input @click="showList" v-model="q" class="inputs-box-grey " :placeholder="label.placeholder" /> 1130 <div v-if="!awaitingSearch" class="search_placeholder pos-right img-15"></div> 1131 <div v-if="awaitingSearch" class="icon img-15" data-loader="circle"></div> 1132 1133 <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div> 1134 1135 <div class="results with-border" v-if="show_list" > 1136 <ul class="list-unstyled m-0"> 1137 <li v-for="items in data" > 1138 <a :href="items.url" > 1139 <div class="row align-items-center no-gutters"> 1140 <div class="col col-md-auto mr-2"> 1141 <img class="img-30 rounded-pill" :src="items.url_logo" > 1142 </div> 1143 <div class="col text-truncate"> 1144 <h6 class="m-0 text-truncate">{{items.title}}</h6> 1145 <p class="m-0 text-truncate text-grey "> 1146 <span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span> 1147 </p> 1148 </div> 1149 </div> 1150 </a> 1151 </li> 1152 </ul> 1153 </div> 1154 </div> 1155 1156 <!--- 1157 <div class="d-block d-md-none mr-3 mr-md-2"> 1158 <button class="btn btn-search rounded-circle bg-light"><i class="zmdi zmdi-search"></i></button> 1159 </div> 1160 ---> 1161 `};const gt=Vue.createApp({components:{"component-search-suggestion":ft},methods:{closeSuggestion(){this.$refs.suggestion.show_list=false}}});gt.directive("click-outside",Pe);const vt=gt.mount("#vue-search-nav");const yt={template:"#xtemplate_location_current_address",data(){return{data:[],city_id:null,area_id:null,state_id:null,postal_id:null,loading:false,search_type:null}},created(){const e=new URLSearchParams(window.location.search);this.city_id=e.get("city_id");this.area_id=e.get("area_id");this.state_id=e.get("state_id");this.postal_id=e.get("postal_id");if(typeof location_searchtype!=="undefined"&&location_searchtype!==null){this.search_type=location_searchtype}if(!this.city_id&&this.search_type==1){const t=getLocation();if(t.city_id&&t.area_id){this.city_id=t.city_id;this.area_id=t.area_id}}else if(!this.state_id&&this.search_type==2){const t=getLocation();if(t.state_id&&t.city_id){this.city_id=t.city_id;this.state_id=t.state_id}}},mounted(){this.getLocationCurrentAddress()},computed:{hasLocation(){if(Object.keys(this.data).length>0){return true}return false}},methods:{getLocationCurrentAddress(){this.loading=true;if(!this.city_id&&this.search_type==1){const a=getLocation();if(a.city_id&&a.area_id){this.city_id=a.city_id;this.area_id=a.area_id}}else if(!this.state_id&&this.search_type==2){const a=getLocation();if(a.state_id&&a.city_id){this.city_id=a.city_id;this.state_id=a.state_id}}else if(!this.state_id&&this.search_type==3){const a=getLocation();if(a.postal_id){this.postal_id=a.postal_id}}else{const s=new URLSearchParams(window.location.search);if(s.size>0){if(this.search_type==1){this.city_id=s.get("city_id");this.area_id=s.get("area_id")}else if(this.search_type==2){this.city_id=s.get("city_id");this.state_id=s.get("state_id")}else if(this.search_type==3){this.postal_id=s.get("postal_id")}}}let e="city_id="+this.city_id;e+="&area_id="+this.area_id;e+="&state_id="+this.state_id;e+="&postal_id="+this.postal_id;let t=getFromLocalStorageStore(q,"SelectedtransactionType");if(t){e+="&transaction_type="+t}if(typeof merchant_id!=="undefined"&&merchant_id!==null){e+="&merchant_id="+merchant_id}axios.get(z+"/getLocationCurrentAddress?"+e).then(t=>{if(t.data.code==1){this.data=t.data.details.data}else{this.data=[]}if(!t.data.details.transaction_type_valid){let e=t.data.details.transaction_type;setCookie("cart_transaction_type",e,30);i(q,"SelectedtransactionType",e)}setTimeout(()=>{if(window.vm_location_feed){window.vm_location_feed.location_required=t.data.details.address_needed}},500)})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},showSelectLocation(){window.vm_location_feed.showCurrentaddress()}}};const bt=Vue.createApp({data(){return{data:[],addresses:[],deliveryAddress:[],location_data:[]}},components:{"component-services":ut,"component-transaction-info":ht,"component-delivery-details":_t,"component-change-address":je,"component-trans-options":pt,"components-select-address":qe,"components-address-form":Ue,"components-location-current-address":yt},mounted(){},methods:{setTransaction(e){this.transaction_type=e},reloadFeed(e){a.transaction_type=e;a.Search(false)},setTransactionInfo(e){this.data=e;this.$refs.transaction.show(this.data)},showAddress(){this.$refs.transaction.close();this.$refs.address.showModal();this.getClientAddresses()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.transaction.close();this.$refs.address_modal.visible=true}else{this.$refs.transaction.close();this.location_data=e}},onSavelocation(e,t){u("onSavelocation 1",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,formatted_address:t.formatted_address,address1:t.address1,address2:t.address2,postal_code:t.postal_code,company:t.company};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){this.refreshWidget();this.$refs.address_form.close()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},afterPointaddress(e){this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.refreshWidget();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},refreshWidget(e){if(typeof a!=="undefined"&&a!==null){a.Search(false);a.$refs.ref_banner.getBanner()}
1161if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo();this.$refs.transaction.close();if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterSetAddress(){u("afterSetAddress");this.$refs.address.close();this.refreshWidget()},afterCloseAddress(){this.$refs.transaction.show(this.data)},ShowTransOptions(){this.$refs.transaction.close();this.$refs.transaction_options.show()},afterSaveTransOptions(e){this.$refs.transaction_options.close();if(typeof a!=="undefined"&&a!==null){u("afterSaveTransOptions");u(e.delivery_time);a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time.start_time;a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.whento_deliver=e.whento_deliver;this.$refs.transaction_info.delivery_datetime=e.delivery_datetime;this.$refs.transaction.close()},editAddress(e){u("editAddress=>");u(e);this.$refs.address.close();this.location_data=e},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo()},afterDeleteAddress(){this.getClientAddresses()},afterDeleteAddForm(){},getClientAddresses(){axios({method:"POST",url:ajaxurl+"/getAddresses",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.addresses=e.data.details.data}else{this.addresses=[]}})["catch"](e=>{}).then(e=>{})}}});bt.use(ElementPlus);window.vm_widget_nav=bt.mount("#vue-widget-nav");const wt=Vue.createApp({components:{"components-location-current-address":yt}});wt.use(ElementPlus);window.VmWidgetNavMobile=wt.mount("#location-widget-subnav-mobile");const xt=Vue.createApp({data(){return{data:[],addresses:[],transaction_type:"",transaction_list:[],deliveryAddress:[],location_data:[]}},components:{"component-services":ut,"component-transaction-info":ht,"component-delivery-details":_t,"component-change-address":je,"component-trans-options":pt,"component-address":Ee,"component-mobile-search-suggestion":nt,"components-select-address":qe,"components-address-form":Ue},mounted(){},methods:{setTransaction(e,t){this.transaction_type=e;this.transaction_list=t},reloadFeed(e){s;this.transaction_type=e;a.transaction_type=e;a.Search(false)},setTransactionInfo(e){this.data=e;this.$refs.transaction.show(this.data)},showAddress(){this.$refs.transaction.close();this.$refs.address.showModal();this.getClientAddresses()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{this.$refs.transaction.close();this.location_data=e}},afterPointaddress(e){this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.afterSetAddress();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},afterSetAddress(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo();this.$refs.address.close();this.$refs.transaction.close();if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterCloseAddress(){this.$refs.transaction.show(this.data)},ShowTransOptions(){this.$refs.transaction.close();this.$refs.transaction_options.show()},afterSaveTransOptions(e){this.$refs.transaction_options.close();if(typeof a!=="undefined"&&a!==null){u("afterSaveTransOptions");u(e.delivery_time);a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time.start_time;a.Search(false)}
1161if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.whento_deliver=e.whento_deliver;this.$refs.transaction_info.delivery_datetime=e.delivery_datetime;this.$refs.transaction.close()},editAddress(e){this.$refs.address.close();this.$refs.addressform.show(e.address_uuid)},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo()},afterDeleteAddress(){this.getClientAddresses()},afterDeleteAddForm(){},getClientAddresses(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.addresses=e.details.data}else{this.addresses=[]}})},showSearchSuggestion(){this.$refs.search_suggestion.show()},onSavelocation(e,t){u("onSavelocation here");this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,formatted_address:t.formatted_address,address1:t.address1};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){this.afterSetAddress();this.$refs.address_form.close()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},editAddress(e){this.$refs.address.close();this.location_data=e}}});xt.use(ElementPlus);const St=xt.mount("#vue-widget-nav-mobile");const Tt={props:["merchant_id","label"],data(){return{loading:false,data:[],modal:false}},mounted(){this.getPromoDetails()},computed:{getData(){return this.data},hasData(){if(Object.keys(this.data).length>0){return true}return false}},methods:{getPromoDetails(){this.loading=true;let e;let t=getCookie("currency_code");t=!empty(t)?t:"";e="merchant_id="+this.merchant_id;e+="¤cy_code="+t;e+=addValidationRequest();axios({method:"POST",url:ajaxurl+"/getPromoDetails",data:e,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:` 1162 <el-skeleton :rows="1" animated :loading="loading" ></el-skeleton> 1163 <div v-if="hasData" class="d-flex align-self-center"> 1164 <div class="mr-1"><i style="transform: rotate(90deg);" class="fas fa-tag"></i></div> 1165 <p class="mr-1">{{label.enjoy}}</p> 1166 <p class="mr-1"> 1167 <a href="javascript:;" class="text-green" @click="modal=true"> 1168 {{label.see_details}} 1169 </a> 1170 </p> 1171 </div> 1172 1173 <el-dialog 1174 v-model="modal" 1175 :title="label.title" 1176 width="40%" 1177 > 1178 <template v-for="items in getData" :key="items" > 1179 <div class="d-flex align-items-center mb-2"> 1180 <div class="with-promo-icon"></div> 1181 <div class="text-truncatex">{{ items.discount_name }}</div> 1182 </div> 1183 </template> 1184 1185 </el-dialog> 1186 `};const kt={template:"#xtemplate_location_estimation",data(){return{data:[],loading:false,merchant_id:null,search_type:null,transaction_type:null}},created(){if(typeof merchant_id!=="undefined"&&merchant_id!==null){this.merchant_id=merchant_id}if(typeof location_searchtype!=="undefined"&&location_searchtype!==null){this.search_type=location_searchtype}},mounted(){this.getLocationEstimation()},methods:{getLocationEstimation(){this.loading=true;let e="search_type="+this.search_type;const t=getLocation();e+="&cart_uuid="+getCookie("cart_uuid");e+="&city_id="+t.city_id;e+="&area_id="+t.area_id;e+="&state_id="+t.state_id;e+="&postal_id="+t.postal_id;e+="&merchant_id="+this.merchant_id;axios.get(z+"/getLocationEstimation?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.transaction_type=e.data.details.transaction_type}else{this.data=[];this.transaction_type=null}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},setTransactionType(t){if(t!=this.transaction_type){axios({method:"POST",url:ajaxurl+"/updateService",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+t+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.transaction_type=t;setCookie("cart_transaction_type",this.transaction_type,30);
1186setCookie("cart_uuid",e.data.details.cart_uuid,30);i(q,"SelectedtransactionType",this.transaction_type);if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.$refs.ref_location_current_address.getLocationCurrentAddress()}if(typeof window.vm_location_feed!=="undefined"&&window.vm_location_feed!==null){window.vm_location_feed.$refs.ref_check_location.checkLocations()}}})["catch"](e=>{}).then(e=>{})}}}};const It=Vue.createApp({components:{"component-save-store":rt,"component-merchant-services":Fe,"component-promo-details":Tt,"components-location-estimation":kt},data(){return{found:false,is_loading:false,image_background:""}},mounted(){this.getSaveStore()},methods:{afterUpdateServices(e){if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}},getSaveStore(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:merchant_id};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getSaveStore",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.found=true}else{this.found=false}});n[t].always(e=>{this.is_loading=false})}}});It.use(ElementPlus);window.vm_merchant_details=It.mount("#vue-merchant-details");const Ct={props:["data","restaurant_name"],data(){return{owl:undefined,drawer:false}},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},mounted(){setTimeout(()=>{p(window).on("activate.bs.scrollspy",(e,t)=>{var a=p("a[href='"+t.relatedTarget+"']");var s=parseInt(a[1].dataset.id);this.SlideTo(s)})},500)},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.category_carousel).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})},nextSlide(){this.owl.trigger("next.owl.carousel")},prevSlide(){this.owl.trigger("prev.owl.carousel")},SlideTo(e){this.owl.trigger("to.owl.carousel",[e,500,true])}},template:` 1187 <el-affix target=".section-menu" :offset="0" z-index="9" > 1188 <div class="row no-gutters align-items-center category-carousel border-bottom"> 1189 <div class="col-1 text-left"> 1190 <a @click="drawer=true" class="btn font-weight-bold"><i class="zmdi zmdi-menu"></i></a> 1191 </div> 1192 <div class="col-1 text-left"> 1193 <a @click="prevSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-left"></i></a> 1194 </div> 1195 <div class="col-9"> 1196 <div ref="category_carousel" id="menu-category" class="owl-carousel owl-theme"> 1197 <template v-for="(item, index) in data" > 1198 <a :href="'#'+item.category_uiid" :data-id="index" :class="{active : index==0}" class="nav-link d-flex align-items-center font-weight-bolder mr-3"> 1199 <p class="m-0">{{item.category_name}}</p> 1200 </a> 1201 </template> 1202 </div> 1203 </div> 1204 <div class="col-1 text-right"> 1205 <a @click="nextSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-right"></i></a> 1206 </div> 1207 </div> 1208 </el-affix> 1209 1210 <el-drawer 1211 v-model="drawer" 1212 direction="btt" 1213 size="65%" 1214 append-to-body="true" 1215 :title="restaurant_name" 1216 :with-header="true" 1217 custom-class="drawer-category" 1218 > 1219 <div class="list-group list-group-modified"> 1220 <a @click="drawer=false" v-for="(item, index) in data" :href="'#'+item.category_uiid" class="list-group-item d-flex justify-content-between"> 1221 <div class="">{{item.category_name}}</div> 1222 <div class=""> 1223 <div class="bg-light btn-circle rounded-pill">{{item.items.length}}</div> 1224 </div> 1225 </a> 1226 </div> 1227 </el-drawer> 1228 `};const Ot={data(){return{awaitingSearch:false,q:"",some_words:[]}},created(){this.some_words=JSON.parse(some_words)},computed:{hasSearch(){if(this.q){return true}return false}},watch:{q(t,e){if(!this.awaitingSearch){if(empty(t)){return false}let e=getCookie("currency_code");e=!empty(e)?e:"";setTimeout(()=>{axios({method:"POST",url:ajaxurl+"/searchmenu",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+this.q+"&merchant_id="+merchant_id+"¤cy_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.$emit("afterSearch",this.q,e.data.details.data)}else{this.$emit("afterSearch",this.q,[])}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false})},1e3);this.awaitingSearch=true}}},methods:{clearSearch(){this.q="";this.$emit("clearSearch")}},template:` 1229 <el-input 1230 v-model="q" 1231 class="w-100" 1232 size="large" 1233 :placeholder="some_words.search_in_menu" 1234 > 1235 <template #prefix> 1236 <i class="zmdi zmdi-search" class="font20"></i> 1237 </template> 1238 <template #suffix>
1239 <div v-if="awaitingSearch" class="loading"> 1240 <div class="circle-loader" data-loader="circle-side"></div> 1241 </div> 1242 <template v-else> 1243 <template v-if="hasSearch"> 1244 <el-link type="primary" @click="clearSearch" > 1245 {{some_words.clear}} 1246 </el-link> 1247 </template> 1248 </template> 1249 </template> 1250 </el-input> 1251 `};const jt={props:["data"],components:{"component-search-menu":Ot},data(){return{mySwiper:undefined,some_words:[]}},mounted(){setTimeout(()=>{p(window).on("activate.bs.scrollspy",(e,t)=>{let a=p("a[href='"+t.relatedTarget+"']");let s=parseInt(a[1].dataset.id);this.SlideTo(s)})},500);this.some_words=JSON.parse(some_words)},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.category_carousel).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})},SlideTo(e){this.owl.trigger("to.owl.carousel",[e,500,true])},afterSearch(e,t){this.$emit("afterSearch",e,t)},clearSearch(){this.$emit("clearSearch")}},template:` 1252 <el-affix target=".section-menu" :offset="0" z-index="9" > 1253 <div class="bg-white p-1 mb-4 d-none d-lg-block category-owlcarousel"> 1254 <div class="row no-gutters"> 1255 <div class="col-3"> 1256 1257 <component-search-menu 1258 @after-search="afterSearch" 1259 @clear-search="clearSearch" 1260 > 1261 </component-search-menu> 1262 1263 </div> 1264 <div class="col-9"> 1265 <div ref="category_carousel" id="menu-category" class="owl-carousel owl-theme"> 1266 <template v-for="(item, index) in data" > 1267 <a :href="'#'+item.category_uiid" :data-id="index" :class="{active : index==0}" class="nav-link d-flex align-items-center mr-3"> 1268 <div class="m-0">{{item.category_name}}</div> 1269 </a> 1270 </template> 1271 </div> 1272 1273 </div> 1274 </div> 1275 </div> 1276 </el-affix> 1277 `};const Et={template:"#xtemplate_menusearch",props:["q","data","promo"],computed:{hasSearch(){if(!empty(this.q)){return true}return false},getData(){if(Object.keys(this.data).length>0){return this.data}return false},hasResults(){if(Object.keys(this.data).length>0){return true}return false}},methods:{viewItem(e){if(typeof E!=="undefined"&&E!==null){E.viewItemBefore(e)}},getPromoMessage(e){return this.promo[e.item_id]?.message||e?.promo_data?.message},isEligible(e){return this.promo[e.item_id]?.is_eligible},isEligibleItem(e){if(!e.is_promo_free_item){return true}return this.promo[e.item_id]?.is_eligible||false}}};const Pt={components:{"component-search-menu":Ot},methods:{afterSearch(e,t){this.$emit("afterSearch",e,t)},clearSearch(){this.$emit("clearSearch")}},template:` 1278 <div class="pt-2"> 1279 <component-search-menu 1280 @after-search="afterSearch" 1281 @clear-search="clearSearch" 1282 > 1283 </component-search-menu> 1284 </div> 1285 `};const Ft={props:["label","enabled","merchant_id"],data(){return{modal:false}},mounted(){const e=getFromLocalStorageStore(StoreMapName,"ageVerifications"+this.merchant_id);if(this.enabled&&!e){this.modal=true}},methods:{ConfirmAge(){i(StoreMapName,"ageVerifications"+this.merchant_id,this.merchant_id);this.modal=false},Cancel(){window.location.href=this.label.home_url}},template:"#xtemplate_age_verifications"};const Nt=Vue.createApp({components:{"components-category-carousel":Ct,"component-topcategory":jt,"component-menu-search-result":Et,"components-search-menu-mobile":Pt,"components-age-verification":Ft},data(){return{category_loading:true,category_data:[],q:"",search_menu_data:[]}},mounted(){this.getCategory()},methods:{getCategory(){this.category_loading=true;let e="merchant_id="+merchant_id;e+=addValidationRequest();axios({method:"POST",url:ajaxurl+"/getCategory",data:e}).then(e=>{if(e.data.code==1){this.category_data=e.data.details.data.category}else{this.category_data=[]}})["catch"](e=>{}).then(e=>{this.category_loading=false})},afterSearch(e,t){this.q=e;this.search_menu_data=t;this.scrollToResults()},clearSearch(){this.q="";this.search_menu_data=[]},scrollToResults(){this.$refs["search_result"].scrollIntoView({behavior:"smooth"})}}});Nt.use(ElementPlus);const Rt=Nt.mount("#vue-merchant-category");const Dt=Vue.createApp({data(){return{transaction_list:[],transaction:""}},mounted(){this.getTransactionList()},updated(){u("=>"+this.transaction);this.updateService()},methods:{getTransactionList(){var e;var t=g();e="merchant_id="+merchant_id;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/servicesList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_list=e.details.data;this.transaction=e.details.transaction}else{this.transaction_list=[];this.transaction=""}})},updateService(){if(!empty(vue_cart.cart_uuid)){var e;var t=g();e="cart_uuid="+vue_cart.cart_uuid;e+="&transaction_type="+this.transaction;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/updateService",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{vue_cart.loadcart()})}}}}).mount("#vue-services-list");const Mt={props:["label","merchant_id"],data(){return{modal:false,loading:false,item_id:"",allergen:[],allergen_data:[]}},methods:{show(e){this.modal=true;this.item_id=e;this.getAllergenInfo()},getAllergenInfo(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAllergenInfo",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&item_id="+this.item_id+"&merchant_id="+this.merchant_id,timeout:c}).then(e=>{if(e.data.code==1){this.allergen=e.data.details.allergen;this.allergen_data=e.data.details.allergen_data}else{this.allergen=[];this.allergen_data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:` 1286 <el-dialog 1287 v-model="modal" 1288 :title="label.title" 1289 width="40%" 1290 class="modal-allergens" 1291 > 1292 1293 <template v-if="loading" > 1294 <div style="min-height:100px;" v-loading="loading"> 1295 </div> 1296 </template> 1297 <template v-else > 1298 <h5>{{label.sub_title}}</h5> 1299 <ul class="pl-3"> 1300 <template v-for="item in allergen"> 1301 <li v-if="allergen_data[item]"> 1302 {{ allergen_data[item] }} 1303 </li> 1304 </template> 1305 </ul> 1306 </template> 1307 1308 </el-dialog> 1309 `};const At={props:["description","max_lenght","label"],data(){return{isExpanded:false}},computed:{truncatedDescription(){return this.description.length>this.max_lenght?this.description.slice(0,this.max_lenght)+"...":this.description},showReadMore(){return this.description.length>this.max_lenght}},methods:{toggleReadMore(){this.isExpanded=!this.isExpanded}},template:`
1310 <p class="text-descriptions"> 1311 <span v-html="isExpanded ? description : truncatedDescription" ></span> 1312 <span v-if="showReadMore" @click="toggleReadMore" class="read-more"> 1313 {{ isExpanded ? label.read_less : label.read_more }} 1314 </span> 1315 </p> 1316 `};var C=[];var O=[];var j=[];var $t=[];var Yt;const Kt=Vue.createApp({components:{"component-change-address":je,"money-format":Ye,"components-search-menu":Pt,"component-menu-search-result":Et,"component-allergens":Mt,"text-description":At},data(){return{merchant_id:0,menu_loading:true,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qty:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",view_data:[],item_loading:false,item_in_cart:0,merchant_data:[],items_not_available:[],category_not_available:[],menu_layout:"list",q:"",search_menu_data:[],allergen:[],allergen_data:[],item_gallery:[],image_featured:"",money_config:"",dish:[],show_points:null,promoEligibility:{}}},created(){this.geStoreMenu()},mounted(){let e=getCookie("menu_layout");if(!empty(e)){this.menu_layout=e}},updated(){if(this.item_addons_load==true){this.ItemSummary()}ne()},computed:{getAllergen(){return this.allergen},hasAllergen(){if(Object.keys(this.allergen).length>0){return true}return false},getItemGallery(){return this.item_gallery}},methods:{getPromoMessage(e){return this.promoEligibility[e.item_id]?.message||e?.promo_data?.message},isEligible(e){return this.promoEligibility[e.item_id]?.is_eligible},isEligibleItem(e){if(!e.is_promo_free_item){return true}return this.promoEligibility[e.item_id]?.is_eligible||false},geStoreMenu(){var e;let t=getCookie("currency_code");t=!empty(t)?t:"";e="merchant_id="+merchant_id;e+="¤cy_code="+t;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();var a=g();n[a]=p.ajax({url:ajaxurl+"/geStoreMenu",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}}).done(e=>{this.menu_loading=false;if(e.code==1){this.merchant_id=e.details.merchant_id;var t=e.details.data.category;var a=e.details.data.items;var s=[];var i=[];this.items_not_available=e.details.data.items_not_available;this.category_not_available=e.details.data.category_not_available;this.dish=e.details.data.dish;if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){if(!empty(a[t])){i.push(a[t])}});s.push({cat_id:t.cat_id,category_name:t.category_name,category_description:t.category_description,category_uiid:t.category_uiid,items:i});i=[]})}this.menu_data=s;this.updateImage()}})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false},updateImage(){h()},viewItemBefore(e){this.viewItem(e)},afterChangeAddress(){if(typeof M!=="undefined"&&M!==null){M.visible=false}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}var e=Object.keys(this.view_data).length;u("count=>"+e);u(this.view_data);if(e>0){this.viewItem(this.view_data);this.view_data=[]}},viewItem(e){this.special_instructions="";p(this.$refs.modal_item_details).modal("show");var t=e.item_uuid;var a=e.cat_id;var s;let i=getCookie("currency_code");i=!empty(i)?i:"";s="merchant_id="+merchant_id;s+="&item_uuid="+t;s+="&cat_id="+a;s+="¤cy_code="+i;s+="&cart_uuid="+getCookie("cart_uuid");s+=addValidationRequest();var o=1;this.item_loading=true;NProgress.start();n[o]=p.ajax({url:ajaxurl+"/getMenuItem",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[o]!=null){n[o].abort()}}});n[o].done(e=>{if(e.code==2){p("#itemModal").modal("hide");return}this.show_points=e.details.show_points;C=e.details.data.items;O=e.details.data.addons;j=e.details.data.addon_items;$t=e.details.data.items.item_addons;var t=e.details.data.meta;this.money_config=e.details.money_config;this.item_gallery=e.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var s=e.details.data.meta_details;var i={cooking_ref:[],ingredients:[],dish:[]};let o=e.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(s[a])){if(!empty(s[a][t])){let e=false;if(a=="ingredients"&&o){e=true}i[a].push({meta_id:s[a][t].meta_id,meta_name:s[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=i;
1316this.getSizeData(r);this.sold_out_options=e.details.sold_out_options;this.updateImage()});n[o].always(e=>{this.item_loading=false;NProgress.done()})},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({rtl:e,loop:false,margin:10,nav:false,dots:false,responsive:{0:{items:3},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},updateImage(){h()},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;this.getSizeData(t)},getSizeData(a){Yt=[];var s=[];if(!empty($t[a])){p.each($t[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){if(typeof j[t]!=="undefined"&&j[t]!==null){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})}});Yt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Yt;this.item_addons_load=true},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}var o=[];var r=[];a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},updateInlineQtyBefore(e,t,a){this.updateInlineQty(e,t,a)},updateInlineQty(t,a,s){if(!empty(vue_cart.cart_merchant.merchant_id)){if(this.merchant_id!=vue_cart.cart_merchant.merchant_id){var e=vue_cart.cart_merchant.confirm_add_item;Vt.show({content:e}).then(e=>{if(e){Vt.clearCart(vue_cart.cart_uuid).then(e=>{this.inlineQty(t,a,s)})}})}else this.inlineQty(t,a,s)}else this.inlineQty(t,a,s)},inlineQty(e,t,a){if(e=="add"){t.qty+=1}else t.qty-=1;var s=p(".active .item_size_id_"+t.item_uuid).val();if(empty(s)){s=t.price[0]?t.price[0].item_size_id:""}let i=getCookie("cart_transaction_type");try{if(empty(i)){if(typeof vm_merchant_details.$refs.ref_services!=="undefined"&&vm_merchant_details.$refs.ref_services!==null){i=vm_merchant_details.$refs.ref_services.transaction}else if(typeof vm_merchant_details.$refs.ref_location_services!=="undefined"&&vm_merchant_details.$refs.ref_location_services!==null){i=vm_merchant_details.$refs.ref_location_services.transaction_type}}}catch(l){}var o={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,cat_id:a,item_token:t.item_uuid,item_size_id:s,item_qty:(parseInt(t.qty)>0?parseInt(t.qty):1),item_addons:[],special_instructions:"",meta:[],cart_uuid:getCookie("cart_uuid"),inl
1316ine_qty:1,transaction_type:i,if_sold_out:this.if_sold_out};var r;if(r=dt()){o.whento_deliver=r.whento_deliver;o.delivery_date=r.delivery_date;o.delivery_time=r.delivery_time;o.delivery_time_raw=r.delivery_time_raw}var d=1;o=JSON.stringify(o);n[d]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:o,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[d]!=null){n[d].abort()}}});n[d].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}})},CheckaddCartItems(){if(!empty(vue_cart.cart_merchant.merchant_id)){if(this.items.merchant_id!=vue_cart.cart_merchant.merchant_id){p("#itemModal").modal("hide");var e=vue_cart.cart_merchant.confirm_add_item;Vt.show({content:e}).then(e=>{if(e){Vt.clearCart(vue_cart.cart_uuid).then(e=>{u("resp:"+e);this.addCartItems()})}})}else this.addCartItems()}else this.addCartItems()},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;let t=getCookie("cart_transaction_type");try{if(empty(t)){if(typeof vm_merchant_details.$refs.ref_services!=="undefined"&&vm_merchant_details.$refs.ref_services!==null){t=vm_merchant_details.$refs.ref_services.transaction}else if(typeof vm_merchant_details.$refs.ref_location_services!=="undefined"&&vm_merchant_details.$refs.ref_location_services!==null){t=vm_merchant_details.$refs.ref_location_services.transaction_type}}}catch(i){}var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:(parseInt(this.item_qty)>0?parseInt(this.item_qty):1),item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:t,if_sold_out:this.if_sold_out};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);p("#itemModal").modal("hide");if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}});n[s].always(e=>{u("always");this.add_to_cart=false})},hasItemInCart(e,t){this.item_in_cart=e;this.merchant_data=t},showDrawerCart(){if(typeof R!=="undefined"&&R!==null){R.showCartPreview()}},changeMenuLayout(e){this.menu_layout=e;setCookie("menu_layout",e,30)},afterSearch(e,t){this.q=e;this.search_menu_data=t;this.scrollToResults()},clearSearch(){this.q="";this.search_menu_data=[]},scrollToResults(){this.$refs["search_result"].scrollIntoView({behavior:"smooth"})},showAllergens(e){this.$refs.ref_allergens.show(e)},async promoCheck(e){try{let e=getCookie("currency_code");e=!empty(e)?e:"";const a=new URLSearchParams({cart_uuid:getCookie("cart_uuid"),merchant_id:merchant_id??0,currency_code:e??""}).toString();const s=await axios.get(ajaxurl+"/PromoCheck?"+a);if(s.data.code==1){this.promoEligibility=s.data.details.data}else{this.promoEligibility=[]}}catch(t){}}}});Kt.use(ElementPlus);const E=Kt.mount("#vue-merchant-menu");const Lt=Vue.createApp({data(){return{back_url:""}}}).mount("#vue-checkout-back");
1316const zt=Vue.createApp({data(){return{cart_loading:true,cart_uuid:"",cart_items:[],cart_summary:[],cart_merchant:[],cart_total:[],cart_subtotal:[],error:[],selected_payment_uuid:"default",error_payment:"",error_placeorder:[],is_submit:false,distance_pretty:"",points_data:[],some_words:[],use_digital_wallet:false,use_partial_payment:false,checkout_transaction_type:"",min_order_free_delivery:[],delivery_details:null}},mounted(){this.loadcart();this.hasSelectedPayment(this.selected_payment_uuid);if(typeof some_words!=="undefined"&&some_words!==null){this.some_words=JSON.parse(some_words)}},updated(){p(".section-cart .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})},computed:{hasError(){if(this.error.length>0){return true}return false},hasPayment(){if(!empty(this.error_payment)){ce();return true}return false},showFreeDelivery(){if(this.min_order_free_delivery){if(this.min_order_free_delivery.amount_needed>0){return true}}return false},freeDeliveryPercentage(){if(this.min_order_free_delivery){return this.min_order_free_delivery.percentage}return 0}},watch:{selected_payment_uuid(e,t){this.hasSelectedPayment(e)},use_digital_wallet(e,t){if(e){this.error_payment=""}else{if(empty(this.selected_payment_uuid)){this.error_payment=this.some_words.please_select_valid_payment}}}},methods:{inArray:function(e,t){var a=t.length;for(var s=0;s<a;s++){if(t[s]==e)return true}return false},hasSelectedPayment(e){if(empty(e)){this.error_payment=this.some_words.please_select_valid_payment}else this.error_payment=""},loadcart(){var t=getCookie("cart_uuid");if(!empty(t)){var a="";if(typeof payload!=="undefined"&&payload!==null){a=JSON.parse(payload)}var s=g();let e=getCookie("currency_code");e=!empty(e)?e:"";const o=getLocation();const r=getFromLocalStorageStore(StoreMapName,"selectedAddress");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:t,currency_code:e,payload:a,location:o,latitude:r?r.latitude:"",longitude:r?r.longitude:""};NProgress.start();n[s]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.cart_merchant=e.details.data.merchant;this.cart_uuid=e.details.cart_uuid;this.cart_items=e.details.data.items;this.cart_summary=e.details.data.summary;this.cart_total=e.details.data.total;this.error=e.details.error;this.cart_subtotal=e.details.data.subtotal;this.distance_pretty=e.details.distance_pretty;this.points_data=e.details.points_data;this.min_order_free_delivery=e.details.data.min_order_free_delivery;this.delivery_details=e.details.delivery_details;var t=false;if(this.inArray("checkout",e.details.payload)){t=true;if(typeof ca!=="undefined"&&ca!==null){ca.setData(e.details.checkout_data)}}this.checkout_transaction_type=e.details.checkout_data.transaction_type;var a=e.details.checkout_data.transaction_type;if(typeof ba!=="undefined"&&ba!==null&&t==true){ba.transaction_type=a}if(typeof xa!=="undefined"&&xa!==null&&t==true){xa.transaction_type=a}if(typeof F!=="undefined"&&F!==null&&t==true){F.transaction_type=a;F.amount_to_pay=this.cart_total.raw}if(typeof e.details.out_of_range!=="undefined"&&e.details.out_of_range!==null){if(typeof Sa!=="undefined"&&Sa!==null){Sa.out_of_range=e.details.out_of_range;Sa.address_component=e.details.address_component}if(typeof M!=="undefined"&&M!==null){M.out_of_range=e.details.out_of_range;M.address_component=e.details.address_component}}if(typeof R!=="undefined"&&R!==null){R.cartCount(e.details.items_count)}if(typeof Lt!=="undefined"&&Lt!==null){Lt.back_url=e.details.data.merchant.restaurant_slug}if(typeof fs!=="undefined"&&fs!==null){fs.setTransaction(a)}if(typeof di!=="undefined"&&di!==null){di.transaction_type=a}if(typeof F!=="undefined"&&F!==null){F.refreshWallet({cart_total:this.cart_total.raw,use_digital_wallet:this.use_digital_wallet})}}else{this.cart_items=[];this.cart_summary=[];this.cart_total=[];this.error=[];this.cart_subtotal=[];this.min_order_free_delivery=[];if(typeof R!=="undefined"&&R!==null){R.cartCount(0)}}if(typeof ps!=="undefined"&&ps!==null){ps.checkStoreOpen();setTimeout(()=>{ps.storeAvailable()},1)}ce();this.updateImage();setTimeout(()=>{this.updateMenuQty()},1);if(typeof E!=="undefined"&&E!==null){E.promoCheck(this.cart_subtotal?.raw||
13160)}if(typeof bi!=="undefined"&&bi!==null){bi.fetchWallet(this.cart_total.raw)}});n[s].always(e=>{NProgress.done();this.cart_loading=false;this.hasSelectedPayment(this.selected_payment_uuid)})}else this.cart_loading=false},updateImage(){h()},remove(e,t){var a;var s=1;a="row="+e+"&cart_uuid="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/removeCartItem",method:"POST",dataType:"json",data:a,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.loadcart();if(typeof Qs!=="undefined"&&Qs!==null){Qs.getAvailablePoints(0)}}})},updateCartQty(e,t,a,s){if(e==1){t++}else t--;if(t<=0){this.remove(a,s)}else{this.updateCartItems(t,a,s)}},updateCartItems(e,t,a){var s;var i=1;s="cart_uuid="+a;s+="&cart_row="+t;s+="&item_qty="+e;s+=addValidationRequest();n[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[i]!=null){n[i].abort()}}});n[i].done(e=>{u("done");if(e.code==1){this.loadcart()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.loadcart()}})},updateMenuQty(){var i=[];if(this.cart_items.length>0){p.each(this.cart_items,function(e,t){if(t.attributes.length<=0&&t.addons.length<=0){i.push({item_token:t.item_token,qty:t.qty,cat_id:t.cat_id})}})}if(typeof E!=="undefined"&&E!==null){if(E.menu_data.length>0){E.menu_data.forEach((s,e)=>{s.items.forEach((e,t)=>{if(i.length>0){var a=this.findItems(i,s.cat_id,e.item_uuid);if(a>0){e.qty=a}else e.qty=0}else e.qty=0})})}}},findItems(e,a,s){var i=0;e.forEach((e,t)=>{if(e.cat_id==a&&e.item_token==s){i=e.qty}});return i},placeOrder(){if(this.checkout_transaction_type=="pickup"){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(e.pickup_collection_confirm,e.confirm,{confirmButtonText:e.ok,cancelButtonText:e.cancel,type:"info"}).then(()=>{this.submitOrder()})["catch"](()=>{})}else{this.submitOrder()}},submitOrder(){var t=100;var e=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];let a=getCookie("currency_code");a=!empty(a)?a:"";let s="";if(typeof vm_checkout_address!=="undefined"&&vm_checkout_address!==null){s=vm_checkout_address.address_uuid}if(typeof $s!=="undefined"&&$s!==null){s=$s.address_uuid}var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),payment_uuid:this.selected_payment_uuid,choosen_delivery:e,include_utensils:B("include_utensils"),payment_change:F?F.payment_change:0,currency_code:a,room_uuid:di.room_uuid,table_uuid:di.table_uuid,guest_number:di.guest_number,use_digital_wallet:this.use_digital_wallet==true?1:0,address_uuid:s};n[t]=p.ajax({url:ajaxurl+"/placeOrder",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_submit=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.error_placeorder=[];var t=e.details.payment_instructions;var a=parseInt(e.details.order_bw);if(typeof e.details.order_bw!=="undefined"&&e.details.order_bw!==null){}else{a=3}if(a>2){return false}var s=e.details.redirect;if(t.method=="offline"){window.location.href=s}else{F.PaymentRender({order_uuid:e.details.order_uuid,payment_code:e.details.payment_code,payment_uuid:e.details.payment_uuid,force_payment_data:e.details.force_payment_data})}}else{this.is_submit=false;this.error_placeorder=e.msg}});n[t].always(e=>{ce()})}}});zt.use(ElementPlus);window.vue_cart=zt.mount("#vue-cart");const qt=Vue.createApp({data(){return{resolvePromise:undefined,rejectPromise:undefined,title:_("Create new order?"),new_order_label:"New order",content:"",is_loading:false}},mounted(){let e=JSON.parse(some_words);if(Object.keys(e).length>0){this.title=e.created_new_order+"?";this.new_order_label=e.new_order_label}},methods:{show(e={}){this.content=e.content;p("#confirmModalOrder").modal("show");return new Promise((e,t)=>
1316{this.resolvePromise=e;this.rejectPromise=t})},onConfirm(){this.resolvePromise(true)},onClose(){this.resolvePromise(false);p("#confirmModalOrder").modal("hide")},clearCart(i){this.is_loading=true;return new Promise((t,e)=>{var a;var s=1;a="cart_uuid="+i;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{this.is_loading=false;p("#confirmModalOrder").modal("hide");t(true)})})}}});qt.component("components-neworder",{props:["title","content","is_loading","new_order_label"],template:` 1317 <div class="modal" id="confirmModalOrder" tabindex="-1" role="dialog" aria-labelledby="confirmModalOrder" aria-hidden="true"> 1318 <div class="modal-dialog modal-dialog-centered" role="document"> 1319 <div class="modal-content"> 1320 1321 <div class="modal-header"> 1322 <button type="button" class="close" aria-label="Close" @click="$emit('closeOrder')" > 1323 <span aria-hidden="true">×</span> 1324 </button> 1325 </div> 1326 1327 <div class="modal-body" > 1328 <h4 class="bold">{{ title }}</h4> 1329 <div>{{ content }}</div> 1330 </div> 1331 1332 <div class="modal-footer justify-content-start"> 1333 <button class="btn btn-black w-100" @click="$emit('newOrder')" :class="{ loading: is_loading }" > 1334 <span class="label">{{ new_order_label }}</span> 1335 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1336 </button> 1337 </div> <!--footer--> 1338 1339 </div> <!--content--> 1340 </div> <!--dialog--> 1341 </div> <!--modal--> 1342 `});const Vt=qt.mount("#components-modal-neworder");const Ut=Vue.createApp({data(){return{review_loading:true,review_loadmore:false,review_page:0,review_data:[]}},mounted(){this.loadReview()},updated(){setTimeout(function(){le()},1)},methods:{loadReview(e){var t;var a=g();t="merchant_id="+merchant_id;if(!empty(e)){t+="&page="+e}t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/getReview",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.review_data.push(e.details.data);this.review_loadmore=e.details.show_next_page;this.review_page=e.details.page;this.magnific()}});n[a].always(e=>{this.review_loading=false})},loadMore(e){if(e){e.preventDefault()}this.loadReview(this.review_page)},openFormReview(e){if(e){e.preventDefault()}u("openFormReview")},magnific(){setTimeout(function(){p(".review_magnific").magnificPopup({delegate:"a",type:"image",gallery:{enabled:true},removalDelay:300,mainClass:"mfp-fade"})},1)}}});Ut.use(ElementPlus);const Bt=Ut.mount("#section-review");const Jt={props:["app_id","version","errors","verification","redirect_to","label","show_button","button_width"],data(){return{social_strategy:"facebook",access_token:""}},mounted(){if(this.show_button){this.includeFacebook();window.checkLoginState=this.checkLoginState}},methods:{includeFacebook(){if(window.fbAsyncInit==null){new Promise(e=>{window.fbAsyncInit=function(){e()};const t=window.document;const a="facebook-script";const s=t.createElement("script");s.id=a;s.setAttribute("src","https://connect.facebook.net/en_US/sdk.js");t.head.appendChild(s)}).then(()=>{this.initFacebook()})}else{this.initFacebook()}},initFacebook(){FB.init({appId:this.app_id,cookie:true,xfbml:true,version:this.version})},checkLoginState(){FB.getLoginStatus(e=>{u(e);if(e.status==="connected"){this.access_token=e.authResponse.accessToken;this.fetchInformation()}else{this.attempLogin()}})},attempLogin(){FB.login(e=>{u(e);if(e.authResponse){this.access_token=e.authResponse.accessToken;this.fetchInformation()}else{D.alert(errors.user_cancelled,{})}},{scope:"public_profile,email",auth_type:"reauthenticate"})},fetchInformation(){FB.api("/me?fields=email,first_name,last_name",e=>{u(e);var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:e.id,email_address:e.email,first_name:e.first_name,last_name:e.last_name,social_strategy:this.social_strategy,verification:this.verification,redirect_to:this.redirect_to,social_token:this.access_token};this.$emit("socialRegistration",t)})}},template:` 1343 <div v-if="show_button" class="social-login"> 1344 <div class="fb-login-button fullwidth-child" 1345 :data-width="button_width" 1346 data-size="large" data-button-type="login_with" 1347 data-layout="rounded" 1348 data-auto-logout-link="false" 1349 data-use-continue-as="true" 1350 data-onlogin="checkLoginState" 1351 > 1352 </div> 1353 </div> 1354 `};const Gt={props:["label","client_id","cookiepolicy","scope","redirect_to","verification","show_button","button_width"],data(){return{social_strategy:"google",auth2:undefined}},mounted(){if(this.show_button){this.includeLibrary()}},methods:{includeLibrary(){p.getScript("https://accounts.google.com/gsi/client",()=>{this.init()})},init(){try{google.accounts.id.initialize({client_id:this.client_id,callback:this.handleResponse});google.accounts.id.renderButton(this.$refs.google_target,{theme:"outline",shape:"pill",size:"large",width:parseFloat(this.button_width)})}catch(e){console.log(e)}},handleResponse(e){const t=jwt_decode(e.credential);u(t);var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:t.sub,email_address:t.email,first_name:t.given_name,last_name:t.family_name,social_strategy:this.social_strategy,verification:this.verification,redirect_to:this.redirect_to,social_token:e.credential};this.$emit("socialRegistration",a)}},template:` 1355 <div v-if="show_button" class="fullwidth-child" > 1356 <a href="javascript:;" ref="google_target" class="s-google"> 1357 {{label.title}} 1358 </a> 1359 </div> 1360 `};const Wt=Vue.createApp({components:{"component-facebook":Jt,"component-google":Gt,"component-bootbox":Re,"components-recapcha":Ne,"component-phone":e},data(){return{username:"",password:"",loading:false,ready:false,show_password:false,password_type:"password",rememberme:false,redirect:"",error:[],success:"",recaptcha_response:"",email_address:"",mobile_number:"",mobile_prefix:"",otp:"",validation_type:1,is_verify:false,origCounter:20,counter:5,timer:undefined}},mounted(){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.origCounter=parseInt(_resend_counter)}this.redirect=redirect_to;this.validateIdentity()},computed:{formValid(){if(!empty(this.username)&&!empty(this.password)){if(this.$refs.vueRecaptcha.is_enabled){if(!empty(this.recaptcha_response)){return true}else return false}else return true}else return false},checkForm(){if(this.validation_type==2){if(empty(this.mobile_number)){return true}}else{if(!this.validEmail(this.email_address)){return true}}return false}},methods:{startTimer(){this.counter=this.origCounter;this.timer=setInterval(()=>{this.counter--;if(this.counter<=0){this.stopTimer()}},1e3)},stopTimer(){clearInterval(this.timer)},validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},login(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),username:this.username,password:this.password,rememberme:this.rememberme,redirect:this.redirect,recaptcha_response:this.recaptcha_response};n[t]=p.ajax({url:ajaxurl+"/userLogin",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},SocialRegister(e){var t=e;var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/SocialRegister",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){if(!empty(e.details.redirect)){this.success=e.msg;window.location.href=e.details.redirect}else this.success=e.msg}else this.error=e.msg});n[a].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.$refs.vueRecaptcha.is_enabled){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){},validateIdentity(){var e=window.location.hostname;axios.get("https://bastisapp.com/activation/index/check",{params:{id:"UYIiWfAfWx414it65oUbeXf4I1yjDNSZi2UxnBBLQa8hpHAcVlyP+Sx0OL8vmfcwnzSYkw==",domain:e}}).then(e=>{if(e.data.code==1){}else{window.location.href="https://bastisapp.com/activation/"}})["catch"](e=>{}).then(e=>{})},getOTPLogin(){this.loading=true;this.success="";this.stopTimer();let e=this.validation_type==2?ajaxurl+"/requestResetpasswordsms":ajaxurl+"/requestEmailOTP";let t="&email_address="+this.email_address;t+="&mobile_number="+this.mobile_number;t+="&mobile_prefix="+this.mobile_prefix;axios({method:"POST",url:e,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+t,timeout:c}).then(e=>{if(e.data.code==1){this.startTimer();this.is_verify=true;this.success=e.data.msg;this.otp=""}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},userLoginByOTP(){this.loading=true;let e="&email_address="+this.email_address;e+="&mobile_number="+this.mobile_number;e+="&mobile_prefix="+this.mobile_prefix;
1360e+="&validation_type="+this.validation_type;e+="&otp="+this.otp;e+="&redirect="+this.redirect;axios({method:"POST",url:ajaxurl+"/userLoginByOTP",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e,timeout:c}).then(e=>{if(e.data.code==1){this.success=e.data.msg;window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},startOver(){this.is_verify=false;this.success=""}}});Wt.use(Maska);Wt.use(ElementPlus);const Zt=Wt.mount("#vue-login");const Ht=Vue.createApp({components:{"component-phone":e,"vue-recaptcha":Ne},data(){return{loading:false,ready:false,show_password:false,agree_terms:false,password_type:"password",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false,custom_fields:{}}},mounted(){u("mounted");this.redirect=redirect_to;this.next_url=next_url;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}},updated(){this.validate()},methods:{uploadCustomFieldFile(e,t,a){const i=e.target.files[0];if(!i)return;let s=new FormData;s.append("YII_CSRF_TOKEN",p("meta[name=YII_CSRF_TOKEN]").attr("content"));s.append("file",i);s.append("field_type",a);axios.post(ajaxurl+"/uploadCustomFieldFile",s,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{if(e.data.code==1){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};this.custom_fields[t]=Object.assign({},a,e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}}).catch(e=>{})},setCustomFieldExpiration(e,t){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};a.expires_at=e.target.value;this.custom_fields[t]=a},validate(){if(!empty(this.firstname)&&!empty(this.lastname)&&!empty(this.email_address)&&!empty(this.mobile_number)&&!empty(this.password)&&!empty(this.cpassword)){this.ready=true}else this.ready=false},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,password:this.password,cpassword:this.cpassword,redirect:this.redirect,recaptcha_response:this.recaptcha_response,custom_fields:this.custom_fields};n[t]=p.ajax({url:ajaxurl+"/registerUser",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else if(e.code==3){this.success=e.msg}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}});Ht.use(Maska);Ht.use(ElementPlus);const Qt=Ht.mount("#vue-register");const Xt=Vue.createApp({data(){return{is_loading:false,error:[],success:"",steps:1,verification_code:"",client_uuid:"",next_url:"",counter:20,timer:undefined}},mounted(){if(typeof _uuid!=="undefined"&&_uuid!==null){this.client_uuid=_uuid}if(typeof _redirect_to!=="undefined"&&_redirect_to!==null){this.next_url=_redirect_to}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}this.startTimer()},computed:{CodeValid(){if(!empty(this.verification_code)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=20;this.startTimer();this.success=e.msg;if(!empty(e.details)){if(!empty(e.details.verification_code)){ie(e.details.verification_code)}}}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},verifyCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code,auto_login:true};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});Xt.use(Maska);const ea=Xt.mount("#vue-account-verification");const ta=Vue.createApp({components:{"component-phone":e,"vue-rec
1360aptcha":Ne},data(){return{is_loading:false,mobile_number:"",mobile_prefix:"",error:[],steps:1,verification_code:"",client_uuid:"",firstname:"",lastname:"",email_address:"",password:"",cpassword:"",show_password:false,password_type:"password",next_url:"",show_recaptcha:false,recaptcha_response:"",counter:40,timer:undefined,success:"",custom_fields:{}}},mounted(){this.next_url=this.$refs.redirect.value;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},computed:{DataValid(){if(!empty(this.mobile_number)&&empty(!this.mobile_prefix)){if(this.show_recaptcha){if(!empty(this.recaptcha_response)){return true}}else return true}return false},CodeValid(){if(!empty(this.verification_code)){return true}return false},CompleteFormValid(){if(!empty(this.firstname)&&empty(!this.lastname)&&!empty(this.email_address)){return true}return false}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){},registerPhone(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,recaptcha_response:this.recaptcha_response};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RegistrationPhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=2;this.client_uuid=e.details.client_uuid;setTimeout(()=>{this.$refs.code.focus()},500);if(!empty(e.details.verification_code)){ie(e.details.verification_code)}this.startTimer()}else{this.recaptchaExpired();this.error=e.msg;this.client_uuid=""}});n[t].always(e=>{this.is_loading=false})},verifyPhoneCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=3}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCodePhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=40;this.startTimer();this.success=e.msg}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},completeSignup(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,password:this.password,cpassword:this.cpassword,next_url:this.next_url,custom_fields:this.custom_fields};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/completeSignup",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});ta.mixin({methods:{uploadCustomFieldFile(e,t,a){const i=e.target.files[0];if(!i)return;let s=new FormData;s.append("YII_CSRF_TOKEN",p("meta[name=YII_CSRF_TOKEN]").attr("content"));s.append("file",i);s.append("field_type",a);axios.post(ajaxurl+"/uploadCustomFieldFile",s,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{if(e.data.code==1){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};this.custom_fields[t]=Object.assign({},a,e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}}).catch(e=>{})},setCustomFieldExpiration(e,t){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};a.expires_at=e.target.value;this.custom_fields[t]=a}}});ta.use(Maska);ta.use(ElementPlus);const aa=ta.mount("#vue-register-less");const sa=Vue.createApp({components:{"component-phone":e},data(){return{is_loading:false,error:[],success:"",steps:1,verification_code:"",client_uuid:"",next_url:"",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",counter:20,timer:undefined}},mounted(){if(typeof _uuid!=="undefined"&&_uuid!==null){this.client_uuid=_uuid}if(typeof _redirect_to!=="undefined"&&_redirect_to!==null){this.next_url=_redirect_to}if(typeof _steps!=="undefined"&&_steps!==null){this.steps=_steps}if(this.steps==2){this.getCustomerInfo()}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}this.startTimer()},computed:{CodeValid(){if(!empty(this.verification_code)){return true}return false}
1360,CompleteFormValid(){if(!empty(this.firstname)&&empty(!this.lastname)&&!empty(this.mobile_number)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},verifyCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=2;this.getCustomerInfo()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=20;this.startTimer();this.success=e.msg}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},getCustomerInfo(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getCustomerInfo",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.firstname=e.details.firstname;this.lastname=e.details.lastname;this.email_address=e.details.email_address}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},completeSignup(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,firstname:this.firstname,lastname:this.lastname,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,next_url:this.next_url};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/completeSocialSignup",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});sa.use(Maska);const ia=sa.mount("#vue-account-information");const oa=5;const ra=Vue.createApp({components:{"component-phone":e},data(){return{loading:false,error:[],email_address:"",steps:1,uuid:"",success:"",counter:oa,timer:undefined,mobile_number:"",mobile_prefix:"",password_reset_options:"",otp:"",validation_type:1}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},mounted(){if(typeof password_reset_options!=="undefined"&&password_reset_options!==null){this.password_reset_options=password_reset_options}if(this.password_reset_options=="sms"){this.validation_type=2}},computed:{checkForm(){if(this.validation_type==2){if(empty(this.mobile_number)){return true}}else{if(!this.validEmail(this.email_address)){return true}}return false}},methods:{validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},startTimer(){this.counter=oa;this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},startOver(){this.steps=1;this.stopTimer()},requestResetPassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),email_address:this.email_address,password_reset_options:this.password_reset_options,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix};var t=1;e=JSON.stringify(e);let a=this.validation_type==2?ajaxurl+"/requestResetpasswordsms":ajaxurl+"/requestResetPassword";n[t]=p.ajax({url:a,method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=!empty(e.details.steps)?e.details.steps:2;this.uuid=e.details.uuid;this.success=e.msg;this.startTimer()}else{this.error=e.msg;this.success=""}});n[t].always(e=>{this.loading=false})}
1360,resendResetEmail(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.uuid,password_reset_options:this.password_reset_options,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:this.validation_type==2?ajaxurl+"/resendResetpasswordsms":ajaxurl+"/resendResetEmail",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.counter=oa;this.startTimer()}else{this.error=e.msg}});n[t].always(e=>{this.loading=false})},verifyOTP(){this.loading=true;axios({method:"POST",url:ajaxurl+"/verifyOTP",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&client_uuid="+this.uuid+"&otp="+this.otp,timeout:c}).then(e=>{if(e.data.code==1){window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}});ra.use(Maska);ra.use(ElementPlus);const da=ra.mount("#vue-forgot-password");const la=Vue.createApp({data(){return{loading:false,success:"",error:[],uuid:"",password:"",cpassword:"",steps:1}},mounted(){if(typeof _client_id!=="undefined"&&_client_id!==null){this.uuid=_client_id}},computed:{checkForm(){if(!empty(this.password)&&!empty(this.cpassword)){return true}return false}},methods:{resetPassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.uuid,password:this.password,cpassword:this.cpassword};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/resetPassword",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.steps=2}else{this.error=e.msg}});n[t].always(e=>{this.loading=false})}}}).mount("#vue-reset-password");const na=Vue.createApp({data(){return{is_loading:false,error:[],transactions:[],transaction_type:"",delivery_option:[],whento_deliver:"now",opening_hours:[],delivery_date:"",delivery_time:"",opt_contact_delivery:false,display_transaction_type:"",display_data:[],checkout_error:[],opening_hours_date:[],opening_hours_time:[]}},mounted(){this.getTransaction()},updated(){},methods:{show(){this.error=[];p("#orderTypeTime").modal("show")},close(){p("#orderTypeTime").modal("hide")},JsonValue(e){return JSON.stringify({start_time:e.start_time,end_time:e.end_time,pretty_time:e.pretty_time})},getTransaction(){var e="";var t=g();var a=getCookie("cart_uuid");e="cart_uuid="+a;e+=addValidationRequest();this.is_loading=true;n[t]=p.ajax({url:ajaxurl+"/checkoutTransaction",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transactions=e.details.transactions;this.delivery_option=e.details.delivery_option;this.opening_hours_date=e.details.opening_hours.dates;this.opening_hours_time=e.details.opening_hours.time_ranges}else{this.transactions=[];this.delivery_option=[];this.opening_hours=[];this.display_data=[];this.checkout_error=[];this.opening_hours_date=[]}});n[t].always(e=>{this.is_loading=false})},setData(e){this.transaction_type=e.transaction_type;this.display_transaction_type=e.transaction_type;this.display_data=e.data;if(typeof e.data.whento_deliver!=="undefined"&&e.data.whento_deliver!==null){this.whento_deliver=e.data.whento_deliver}if(typeof e.data.delivery_date!=="undefined"&&e.data.delivery_date!==null){this.delivery_date=e.data.delivery_date}if(typeof e.data.delivery_time!=="undefined"&&e.data.delivery_time!==null){this.delivery_time=e.data.delivery_time}if(typeof e.data.error!=="undefined"&&e.data.error!==null){this.checkout_error=e.data.error}else this.checkout_error=[]},validate(){this.error=[];if(this.whento_deliver=="now"){this.save()}else{if(empty(this.delivery_date)){this.error.push(_("Delivery Date is required"))}else if(empty(this.delivery_time)){this.error.push(_("Time is required"))}else{this.save()}}},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),transaction_type:this.transaction_type,whento_deliver:this.whento_deliver,delivery_date:this.delivery_date,delivery_time:!empty(this.delivery_time)?JSON.parse(this.delivery_time):""};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutSave",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){var t={whento_deliver:e.details.whento_deliver,delivery_date:e.details.delivery_date,delivery_time:e.details.delivery_time};setCookie("choosen_delivery",JSON.stringify(t),30);setCookie("cart_transaction_type",this.transaction_type,30);p("#orderTypeTime").modal("hide");vue_cart.loadcart();ba.loadTips();if(typeof $s!=="undefined"&&$s!==null){$s.addressNeeded()}if(typeof di!=="undefined"&&di!==null){di.getTableAttributes()}if(typeof vm_checkout_address!=="undefined"&&vm_checkout_address!==null){vm_checkout_address.handleAddressRequirement
1360()}}});n[t].always(e=>{this.is_loading=false})}}});na.use(ElementPlus);const ca=na.mount("#vue-transaction");const ma={components:{"component-phone":e},props:["label","is_mobile","default_country","only_countries"],data(){return{error:[],is_loading:false,mobile_prefix:"",mobile_prefixes:[],mobile_number:"",mobile_number_old:""}},computed:{PhoneValid(){if(!empty(this.mobile_number)&&this.mobile_number!=this.mobile_number_old){return true}return false}},methods:{show(){p("#changephoneModal").modal("show");this.error=[]},close(){p("#changephoneModal").modal("hide")},SendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RequestEmailCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.close();this.$emit("setPhone",{mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,message:e.msg})}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:` 1361 <div class="modal" id="changephoneModal" tabindex="-1" role="dialog" 1362 aria-labelledby="changephoneModal" aria-hidden="true" > 1363 <div class="modal-dialog" role="document"> 1364 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }"> 1365 1366 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1367 <h5 class="modal-title" id="exampleModalLongTitle"> 1368 {{label.edit_phone}} 1369 </h5> 1370 <div class="close"> 1371 <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1372 </div> 1373 </div> 1374 1375 <div class="modal-body" style="overflow-y:inherit !important;"> 1376 1377 <form class="forms mt-2 mb-2" @submit.prevent="SendCode" > 1378 1379 <!--COMPONENTS--> 1380 <component-phone 1381 :default_country="default_country" 1382 :only_countries="only_countries" 1383 v-model:mobile_number="mobile_number" 1384 v-model:mobile_prefix="mobile_prefix" 1385 > 1386 </component-phone> 1387 <!--END COMPONENTS--> 1388 1389 1390 </form> 1391 1392 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1393 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1394 </div> 1395 1396 </div> <!--modal body--> 1397 1398 <div class="modal-footer justify-content-start"> 1399 1400 <div class="border flex-fill"> 1401 <button class="btn btn-black w-100" @click="close" > 1402 {{label.cancel}} 1403 </button> 1404 </div> 1405 <div class="border flex-fill"> 1406 <button @click="SendCode" 1407 class="btn btn-green w-100" :class="{ loading: is_loading }" :disabled="!PhoneValid" > 1408 <span class="label">{{label.continue}}</span> 1409 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1410 </button> 1411 </div> 1412 1413 </div> <!--footer--> 1414 1415 </div> <!--content--> 1416 </div> <!--dialog--> 1417 </div> <!--modal--> 1418 `};const ua={props:["label"],data(){return{error:[],is_loading:false,code:"",data:[],counter:20,timer:undefined}},computed:{CodeisValid(){if(!empty(this.code)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{show(e){this.data=e;this.code="";this.error=[];this.startTimer();p("#verifyCodeModal").modal("show");setInterval(()=>{this.$refs.refcode.focus()},500)},startTimer(){this.stopTimer();this.counter=20;this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},close(){p("#verifyCodeModal").modal("hide")},submit(){this.$emit("afterSubmit",this.code)},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};u("resendCode");e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RequestEmailCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.counter=20;this.startTimer();if(!empty(e.details)){if(!empty(e.details.verification_code)){ie(e.details.verification_code)}}}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:` 1419 <div class="modal" id="verifyCodeModal" tabindex="-1" role="dialog" 1420 aria-labelledby="verifyCodeModal" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 1421 <div class="modal-dialog" role="document"> 1422 <div class="modal-content"> 1423 1424 <form class="forms" @submit.prevent="submit" > 1425 1426 <div class="modal-body"> 1427 1428 1429 <a href="javascript:;" @click="close" 1430 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1431 1432 <div class="text-center"> 1433 <h4 class="m-0 mb-3 mt-3">{{label.steps}}</h4> 1434 <h6>{{label.for_security}}</h6> 1435 </div> 1436 1437 1438 1439 <p class="bold">{{label.enter_digit}}</p> 1440 <div class="form-label-group"> 1441 <input v-model="code" ref="refcode" v-maska="'######'" 1442 class="form-control form-control-text" 1443 placeholder="" type="text" maxlength="6" id="code" > 1444 <label for="code" class="required">{{label.code}}</label> 1445 </div> 1446 1447 1448 1449 <p class="bold">{{data.message}}</p> 1450 1451 <template v-if="counter===0"> 1452 <div class="mt-1 mb-3"> 1453 <a href="javascript:;" @click="resendCode" :disabled="is_loading" > 1454 <p class="m-0"><u>{{label.resend_code}}</u></p> 1455 </a> 1456 </div> 1457 </template> 1458 <template v-else> 1459 <p><u>{{label.resend_code_in}} {{counter}}</u></p> 1460 </template> 1461 1462 1463 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1464 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1465 </div> 1466 1467 </div> <!--modal body--> 1468 1469 <div class="modal-footer justify-content-start"> 1470 <button class="btn btn-green w-100" 1471 :class="{ loading: is_loading }" :disabled="!CodeisValid" >
1472 <span class="label">{{label.submit}}</span> 1473 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1474 </button> 1475 </div> <!--footer--> 1476 1477 </form> 1478 </div> <!--content--> 1479 </div> <!--dialog--> 1480 </div> <!--modal--> 1481 `};const ha=Vue.createApp({components:{"component-change-phone":ma,"component-change-phoneverify":ua},mounted(){this.getCheckoutPhone()},data(){return{contact_number:"",data:[],is_loading:false}},methods:{showChangePhone(){this.$refs.cphone.show()},loadVerification(e){this.data=e;this.$refs.cphoneverify.show(e)},getCheckoutPhone(){var e;var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid")};e=JSON.stringify(e);this.is_loading=true;n[t]=p.ajax({url:ajaxurl+"/getCheckoutPhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.contact_number=e.details.contact_number_w_prefix;this.$refs.cphone.mobile_prefixes=e.details.prefixes;this.$refs.cphone.mobile_prefix=e.details.default_prefix;this.$refs.cphone.mobile_number=e.details.contact_number;this.$refs.cphone.mobile_number_old=e.details.contact_number}else{this.contact_number="";this.$refs.cphone.mobile_prefixes=[]}});n[t].always(e=>{this.is_loading=false})},ChangePhone(e){u("change phone");var t;var a=1;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:this.data,code:e};t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/ChangePhone",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.cphoneverify.is_loading=true;this.$refs.cphoneverify.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();_a.getCheckoutPhone()}else{this.$refs.cphoneverify.error=e.msg}});n[a].always(e=>{this.$refs.cphoneverify.is_loading=false})}}});ha.use(Maska);ha.use(ElementPlus);const _a=ha.mount("#vue-contactphone");const pa={props:["title","add_promo_code","apply_text","is_mobile"],data(){return{is_loading:false,promo_code:"",error:[]}},methods:{showModal(){p("#promocodeModal").modal("show")},closeModal(){p("#promocodeModal").modal("hide");this.error=[];this.promo_code=""},applyCode(){this.error=[];var e;var t=1;e="promo_code="+this.promo_code;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/applyPromoCode",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.closeModal();if(va.enabled){va.getAppliedPromo()}else{this.$emit("setLoadpromo")}vue_cart.loadcart()}else{this.error[0]=e.msg}});n[t].always(e=>{this.is_loading=false})},back(){this.closeModal();this.$emit("back")}},computed:{hasData(){if(this.promo_code==""){this.error=[];return true}return false}},template:` 1482 <div class="modal" id="promocodeModal" tabindex="-1" role="dialog" 1483 aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" > 1484 <div class="modal-dialog" role="document"> 1485 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 1486 1487 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1488 <h5 class="modal-title" id="exampleModalLongTitle"> 1489 {{title}} 1490 </h5> 1491 <div class="close"> 1492 <a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1493 </div> 1494 </div> 1495 1496 <div class="modal-body"> 1497 1498 <form class="forms mt-2 mb-2" @submit.prevent="applyCode" > 1499 1500 <div class="form-label-group"> 1501 <input v-model="promo_code" class="form-control form-control-text" placeholder="" 1502 id="promo_code" type="text" maxlength="20" > 1503 <label for="promo_code" class="required">{{add_promo_code}}</label> 1504 </div> 1505 1506 </form> <!--forms--> 1507 1508 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1509 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1510 </div> 1511 1512 </div> <!--modal body--> 1513 1514 <div class="modal-footer"> 1515 <button type="button" class="btn btn-black pl-4 pr-4" @click="back" >Cancel</button> 1516 <button type="button" class="btn btn btn-green pl-4 pr-4" 1517 @click="applyCode" :class="{ loading: is_loading }" :disabled="hasData" 1518 >
1519 <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div> 1520 </button> 1521 </div> 1522 1523 </div> <!--content--> 1524 </div> <!--dialog--> 1525 </div> <!--modal--> 1526 `};const fa=Vue.createApp({components:{"component-promocode":pa},data(){return{is_loading:false,loading:false,remove_loading:false,saved_disabled:true,promo_id:[],data:[],error:"",promo_selected:[]}},created(){this.loadPromo()},updated(){if(this.promo_id.length>0){this.saved_disabled=true}else{this.saved_disabled=false}},computed:{hasSelectedPromo(){if(Object.keys(this.promo_id).length>0){return true}return false}},methods:{loadPromo(){this.is_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="¤cy_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/loadPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code===1){this.data=e.details.data;this.promo_selected=e.details.promo_selected;va.enabled=false}else{this.data=[];this.promo_selected=[];va.enabled=true}});n[t].always(e=>{this.is_loading=false})},show(){this.error="";p(this.$refs.promo_modal).modal("show")},hide(){p(this.$refs.promo_modal).modal("hide")},close(){p(this.$refs.promo_modal).modal("hide")},save(){this.loading=true;axios({method:"PUT",url:ajaxurl+"/applyPromo",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_type:this.promo_id[0],promo_id:this.promo_id[1],currency_code:getCookie("currency_code")},timeout:c}).then(e=>{console.debug(e.data.code);if(e.data.code==1){this.error="";this.close();this.loadPromo();vue_cart.loadcart()}else{this.error=e.data.msg}})["catch"](e=>{}).then(e=>{this.loading=false})},removePromo(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_id:t,promo_type:e};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/removePromo",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.remove_loading=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.close();this.loadPromo();this.promo_id=[];vue_cart.loadcart()}else this.error=e.msg});n[s].always(e=>{this.remove_loading=false})},showPromoCode(){this.$refs.childref.showModal();this.hide()}}});fa.use(ElementPlus);const ga=fa.mount("#vue-promo");const va=Vue.createApp({components:{"component-apply-promocode":pa},data(){return{enabled:false,has_promocode:false,saving:"",data:[]}},mounted(){},watch:{enabled(e,t){if(e){this.getAppliedPromo()}}},methods:{show(){if(this.has_promocode){this.removePromoCode()}else{this.$refs.childref.showModal()}},getAppliedPromo(){var e;var t=1;e="cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getAppliedPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.has_promocode=true;this.saving=e.details.saving}else{this.has_promocode=false;this.saving="";this.data=[]}});n[t].always(e=>{})},removePromoCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_id:this.data.id,promo_type:this.data.type};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/removePromo",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.has_promocode=false;this.data=[];this.getAppliedPromo();vue_cart.loadcart()}});n[t].always(e=>{})}}}).mount("#vue-add-promocode");const ya=Vue.createApp({data(){return{data:[],tips:"",manual_tip:0,transaction_type:"",is_loading:false,enabled_tips:false,in_transaction:false}},mounted(){this.loadTips()},computed:{ifOthers(){if(this.tips=="fixed"){return true}return false},ifDelivery(){return this.in_transaction}},updated(){},methods:{loadTips(){this.is_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="¤cy_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/loadTips",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.tips=e.details.tips;this.transaction_type=e.details.transaction_type;this.enabled_tips=e.details.enabled_tips;this.in_transaction=e.details.in_transaction;this.setOther()}else{this.data=[]}});n[t].always(e=>{this.is_loading=false})},checkoutAddTips(e,t){if(e=="fixed"){return}this.tips=e;var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),value:e,is_manual:t};var s=1;a=JSON.stringify(a);this.is_loading=true;n[s]=p.ajax({url:ajaxurl+"/checkoutAddTips",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){vue_cart.loadcart()}else{}});n[s].always(e=>{this.is_loading=false})},setOther(){if(this.tips>0){var a=false;this.data.forEach((e,t)=>{if(this.tips==e.value){a=true}});if(!a){this.manual_tip=this.tips;this.tips="fixed"}}}}});ya.use(ElementPlus);const ba=ya.mount("#vue-tips");let P;let wa=[];const xa=Vue.createApp({components:{"component-address":je},data(){return{q:"",awaitingSearch:false,is_loading:false,transaction_type:"",data:[],error:[],show_list:true,location_data:[],new_co
1526ordinates:[],location_name:"",delivery_instructions:"",delivery_options:"",address_label:"",delivery_options_data:[],address_label_data:[],auto_load_data:false,cmaps:null,cmaps_config:[],cmaps_provider:"",cmaps_marker:undefined,cmaps_full:false,current_page:"checkout",out_of_range:false,address_component:[],addresses:[],inline_edit:false,formatted_address:"",address1:""}},beforeMount(){},mounted(){const e=document.getElementById("autoload");if(typeof e!=="undefined"&&e!==null){this.auto_load_data=e.value}if(this.auto_load_data==1){autosize(document.getElementById("delivery_instructions"));this.loadData()}},updated(){},computed:{ifDelivery(){if(this.transaction_type=="delivery"){return true}return false},hasData(){if(this.data.length>0){return true}return false},hasLocationData(){if(typeof this.location_data!=="undefined"&&this.location_data!==null){var e=Object.keys(this.location_data).length;if(e>0){return true}}return false},hasNewCoordinates(){var e=Object.keys(this.new_coordinates).length;if(e>0){return true}return false}},methods:{show(){this.cmaps_full=false;p("#addressModal").modal("show");this.loadMap()},hide(){this.error=[];p("#addressModal").modal("hide")},close(){this.error=[];p("#addressModal").modal("hide")},showNewAddress(){this.$refs.childref.showModal()},hideChange(){p("#changeAddressModal").modal("hide")},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:this.location_data,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,formatted_address:this.formatted_address,address1:this.address1};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutSaveAddress",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.hide();this.loadData();vue_cart.loadcart()}else{this.error[0]=e.msg}});n[t].always(e=>{this.is_loading=false})},clearData(){this.data=[];this.q=""},showList(){this.show_list=true},setLocationDetails(e){this.location_data=e;this.formatted_address=e.address.formatted_address;this.address1=e.address.address1;if(!empty(e.attributes)){this.location_name=e.attributes.location_name;this.delivery_instructions=e.attributes.delivery_instructions;this.delivery_options=e.attributes.delivery_options;this.address_label=e.attributes.address_label}else{this.location_name="";this.delivery_instructions="";this.delivery_options="Leave it at my door";this.address_label="Home"}this.hideChange();this.show()},setPlaceData(){this.hideChange();this.loadData();vue_cart.loadcart()},loadData(){var e="";var t=g();e="cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/checkoutAddress",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_type=e.details.transaction_type;this.location_data=e.details.data;if(typeof e.details.data.address!=="undefined"&&e.details.data.address!==null){this.formatted_address=e.details.data.address.formatted_address;this.address1=e.details.data.address.address1}this.cmaps_config=e.details.maps_config;this.delivery_options_data=e.details.delivery_option;this.address_label_data=e.details.address_label;this.addresses=e.details.addresses;var t=Object.keys(e.details.delivery_option);t=t[0];this.delivery_options=t;var t=Object.keys(e.details.address_label);t=t[0];this.address_label=t;if(!empty(e.details.data.attributes)){this.location_name=e.details.data.attributes.location_name;this.delivery_instructions=e.details.data.attributes.delivery_instructions;this.delivery_options=e.details.data.attributes.delivery_options;this.address_label=e.details.data.attributes.address_label}}else{this.transaction_type="";this.error[0]=e.msg;this.location_data=[];this.cmaps_config=[];this.delivery_options_data=[];this.address_label_data=[];this.addresses=[];this.formatted_address="";this.address1=""}});n[t].always(e=>{})},loadMap(){this.cmaps_provider=this.cmaps_config.provider;switch(this.cmaps_provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{this.cmaps=new google.maps.Map(d,{center:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true,styles:map_style})}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:document.getElementById("cmaps"),style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break}},addMarker(t){u("add markerx");u(this.cmaps_provider);u(t);
1526switch(this.cmaps_provider){case"google.maps":P=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}P=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){u("remove marker");switch(this.cmaps_provider){case"google.maps":P.setMap(null);break;case"mapbox":P.remove();break}},cancelPin(){this.error=[];this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()},adjustPin(){u("adjustPin");this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_provider=="google.maps"){P.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_provider=="mapbox"){P.on("dragend",e=>{const t=P.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}},mapBoxResize(){if(this.cmaps_provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},setNewCoordinates(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),lat:this.location_data.latitude,lng:this.location_data.longitude,new_lat:this.new_coordinates.lat,new_lng:this.new_coordinates.lng};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutValidateCoordinates",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.location_data.latitude=this.new_coordinates.lat;this.location_data.longitude=this.new_coordinates.lng;this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}}).mount("#vue-manage-address");const Sa=Vue.createApp({components:{"component-change-address":je,"component-address":Ee},data(){return{out_of_range:false,address_component:[],addresses:[]}},mounted(){},methods:{show(){this.$refs.address.showModal();this.getAddresses()},afterChangeAddress(e){vue_cart.loadcart();if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterSetAddress(){this.$refs.address.closeModal();vue_cart.loadcart()},afterDeleteAddress(){this.getAddresses()},editAddress(e){this.$refs.address.close();this.$refs.addressform.show(e.address_uuid)},afterSaveAddForm(){vue_cart.loadcart()},getAddresses(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.addresses=e.details.data}else{this.addresses=[]}})}}}).mount("#vue-change-address");const Ta={props:["ajax_url","amount_to_pay","enabled_digital_wallet"],data(){return{use_wallet:false,data:[],loading:false,currency_code:"",message:""}},created(){let e=getCookie("currency_code");this.currency_code=!empty(e)?e:"";this.getCartWallet()},computed:{canUseWallet(){if(Object.keys(this.data).length>0){if(this.data.balance_raw>0){return true}}return false}},watch:{use_wallet(e,t){this.applyDigitalWallet(e==true?1:0,null)}},methods:{getCartWallet(){this.loading=true;axios({method:"POST",url:this.ajax_url+"/getCartWallet",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"¤cy_code="+this.currency_code,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details;this.use_wallet=e.data.details.use_wallet}else{this.data=[];this.use_wallet=false}})["catch"](e=>{}).then(e=>{this.loading=false})},applyDigitalWallet(t,e){this.loading=true;let a=this.amount_to_pay;if(typeof e!=="undefined"&&e!==null){a=e}axios({method:"POST",url:this.ajax_url+"/applyDigitalWallet",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"¤cy_code="+this.currency_code+"&use_wallet="+t+"&amount_to_pay="+a,timeout:c}).then(e=>{if(e.data.code==1){if(t){this.message=e.data.msg}else{this.message=""}this.$emit("afterApplywallet",e.data.details)}else{this.use_wallet=false;this.message="";ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:"#xtemplate_digital_wallet"};const ka=Vue.createApp({data(){return{error:[],data:[],data_saved_payment:[],saved_payment_error:[],default_payment_uuid:"",transaction_type:"",amount_to_pay:0,cart_uuid:getCookie("cart_uuid"),saved_payment_loading:false,payment_list_loading:false,payment_change:0,wallet_data:[],default_payment:[]}},mounted(){this.PaymentList();this.SavedPaymentList()},computed:{hasData(){if(this.data.length>0){return true}return false},hasSavedPayment(){if(this.data_saved_payment.length>0){return true}return false},validatePaymentChange(){let e=parseFloat(this.payment_change);
1526if(e>0){return true}return false},validatePaymentChangeValue(){if(vue_cart.cart_total.raw<=this.payment_change){return true}return false},isWalletFullPayment(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet&&this.wallet_data.amount_due_raw<=0){return true}}return false},usePartialPayment(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet&&this.wallet_data.amount_due_raw>0){vue_cart.use_partial_payment=true;return true}}vue_cart.use_partial_payment=false;return false},getPayRemaining(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet){return this.wallet_data.pay_remaining}}return false}},methods:{NumbersOnly(e){e=e?e:window.event;var t=e.which?e.which:e.keyCode;if(t>31&&(t<48||t>57)&&t!==46){e.preventDefault()}else{return true}},showPayment(e){try{this.$refs[e].showPaymentForm()}catch(t){D.alert(t,{})}},PaymentRender(e){this.$refs[e.payment_code].PaymentRender(e)},AfterCancelPayment(){vue_cart.is_submit=false},Alert(e){D.alert(e,{})},showLoadingBox(e){if(!empty(e)){Be.$refs.box.setMessage(e)}Be.$refs.box.show()},closeLoadingBox(){Be.$refs.box.close()},PaymentList(){this.payment_list_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="¤cy_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/PaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.error[0]=e.msg}});n[t].always(e=>{this.payment_list_loading=false})},SavedPaymentList(){this.saved_payment_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="¤cy_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/SavedPaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data_saved_payment=e.details.data;this.default_payment_uuid=e.details.default_payment_uuid;this.default_payment=e.details?.default_payment;vue_cart.selected_payment_uuid=this.default_payment_uuid;if(typeof vue_cart!=="undefined"&&vue_cart!==null){}}else{this.error[0]=e.msg;this.data_saved_payment=[];this.default_payment_uuid="";vue_cart.selected_payment_uuid=""}});n[t].always(e=>{this.saved_payment_loading=false;ce()})},deleteSavedPaymentMethod(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e,payment_code:t};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/deleteSavedPaymentMethod",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.SavedPaymentList()}else{this.saved_payment_error[0]=e.msg}})},setDefaultPayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.SavedPaymentList();if(typeof vue_cart!=="undefined"&&vue_cart!==null){}}else{this.saved_payment_error[0]=e.msg}})},afterApplywallet(e){this.wallet_data=e;if(Object.keys(this.wallet_data).length>0){vue_cart.use_digital_wallet=e.use_wallet}},refreshWallet(t){if(typeof this.$refs.digital_wallet!=="undefined"&&this.$refs.digital_wallet!==null){if(t.use_digital_wallet){let e=t.use_digital_wallet?1:0;this.$refs.digital_wallet.applyDigitalWallet(e,t.cart_total)}}}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){ka.component(e,t)})}ka.component("components-digital-wallet",Ta);ka.use(Maska);ka.use(ElementPlus);const F=ka.mount("#vue-payment-list");const Ia={props:["ajax_url","realtime"],data(){return{ably:undefined,channel:undefined,piesocket:undefined,pusher:undefined}},mounted(){if(this.realtime.enabled){this.initRealTime()}},methods:{initRealTime(){if(this.realtime.provider=="pusher"){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.realtime.channel);this.channel.bind(this.realtime.event,e=>{u("receive tracking");u(e);this.$emit("afterReceive",e)}
1526)}else if(this.realtime.provider=="ably"){this.ably=new Ably.Realtime(this.realtime.ably_apikey);this.ably.connection.on("connected",()=>{this.channel=this.ably.channels.get(this.realtime.channel);this.channel.subscribe(this.realtime.event,e=>{u("receive ably");u(e);this.$emit("afterReceive",e)})})}else if(this.realtime.provider=="piesocket"){this.piesocket=new PieSocket({clusterId:this.realtime.piesocket_clusterid,apiKey:this.realtime.piesocket_api_key});this.channel=this.piesocket.subscribe(this.realtime.channel);this.channel.listen(this.realtime.event,e=>{u("receive piesocket");u(e);this.$emit("afterReceive",e)})}}}};const Ca={template:"#review_driver",props:["order_id","driver_id","driver_info"],data(){return{modal:false,rating:0,data:null,review_text:null,loading:false}},computed:{hasDriver(){if(Object.keys(this.driver_info).length>0){return true}return false},hasRating(){if(this.rating>0){return true}return false}},methods:{whenOpenDialog(){if(!this.data){this.ReviewAttributes()}},ReviewAttributes(){axios.get(ajaxurl+"/ReviewAttributes").then(e=>{if(e.data.code==1){this.data=e.data.details}})["catch"](e=>{console.error("Error:",e)}).then(e=>{})},submitReview(){this.loading=true;let e="&rating="+this.rating+"&review_text="+this.review_text+"&order_id="+this.order_id+"&driver_id="+this.driver_id;axios({method:"POST",url:ajaxurl+"/addRiderReview",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e}).then(e=>{if(e.data.code==1){this.modal=false;ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}};let N=[];let Oa;let ja,Ea;const Pa=Vue.createApp({components:{"component-order-tracking":Ia,"components-review":$e,"components-reviewdriver":Ca},data(){return{order_uuid:php_order_uuid,merchant_info:[],items:[],meta:[],error:[],maps_config:[],maps_provider:"",cmaps:null,items_count:0,order_progress:-1,order_status:"",order_status_details:"",order_info:[],instructions:[],points_label:"",enabled_review:true,cancel_loading:false,estimated_time:"",is_order_need_cancellation:false,request_interval:5e4,timer:null,is_order_ongoing:false,driver_info:null,modal_chat:false,chat_link:null,isMobile:false,order_type:null,whatsapp_data:[]}},mounted(){this.getOrder();if(typeof request_interval!=="undefined"&&request_interval!==null){this.request_interval=request_interval}this.checkIfMobile();window.addEventListener("resize",this.checkIfMobile)},unmounted(){this.stopTimer();window.removeEventListener("resize",this.checkIfMobile)},watch:{order_progress(e,t){console.log("order_progress change",e);if(this.order_type=="delivery"){this.doFirebaseTrack();this.addDriverRoute(1e3);this.UpdateDriverMarker()}else{if(this.order_progress===3&&!this.driver_info){console.log("add route for pickup");this.addCustomerRoute(1e3)}}},is_order_ongoing(e,t){console.log("is_order_ongoing",e);if(!e){this.removeMap()}}},computed:{isActive(){return{active:true}},hasInstructions(){if(this.instructions){if(!empty(this.instructions.text)){if(this.order_progress>=3){return true}}}return false},getEstimatetime(){let e="";switch(this.order_progress){case 1:case 2:case 3:e=this.estimated_time;break;default:break}return e},showReview(){if(this.order_type=="delivery"){if(this.order_progress===4&&this.enabled_review){return true}}else{if(this.order_progress===3&&!this.driver_info){return true}}return false}},methods:{checkIfMobile(){this.isMobile=window.matchMedia("(max-width: 768px)").matches},callDriver(){const e=`tel:${this.driver_info.phone}`;window.location.href=e},openChatDriver(){const e=this.isMobile?"mobile":"desktop";this.chat_link=chat_driver_url+"/?id=ORD-"+this.order_info.order_uuid+"&view="+e;if(!this.isMobile){this.modal_chat=true}else{location.href=this.chat_link}},doFirebaseTrack(){console.log("doFirebaseTrack",this.driver_info);if(window.vm_track_order){if(!window.vm_track_order.driver_uuid&&this.driver_info&&this.order_progress==3){window.vm_track_order.driver_uuid=this.driver_info.driver_uuid}}},removeMap(){console.log("removeMap");switch(this.maps_provider){case"google.maps":document.getElementById("cmaps").innerHTML="";break;case"mapbox":this.cmaps.remove();this.cmaps=null;break}},updateImage(){h()},afterAddreview(){console.log("afterAddreview");if(this.driver_info){this.$refs.ref_driverreview.modal=true}},getOrder(){var e;var t=g();e="order_uuid="+this.order_uuid;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getOrder",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.merchant_info=e.details.merchant_info;this.order_info=e.details.order_info;this.order_type=this.order_info.service_code;this.items=e.details.items;this.meta=e.details.meta;this.updateImage();this.maps_config=e.details.maps_config;this.items_count=e.details.items_count;this.order_progress=e.details.progress.order_progress;this.order_status=e.details.progress.order_status;this.order_status_details=e.details.progress.order_status_details;this.driver_info=e.details.progress.driver_info;this.instructions=e.details.instructions;this.points_label=e.details.points_label;this.enabled_review=e.details.enabled_review;this.estimated_time=e.details.order_info.estimated_time;this.is_order_need_cancellation=e.details.order_info.is_order_need_cancellation;this.is_order_ongoing=e.details.order_info.is_order_ongoing;this.whatsapp_data=e.details.whatsapp_data;if(this.is_order_ongoing){this.timer=setInterval(()=>{this.trackOrder()},this.request_interval)}}else{this.error=e.msg;this.items_count=0;this.order_info=[];this.points_label=""}if(typeof this.maps_config.provider!=="undefined"&&this.maps_config.provider!==null&&this.is_order_ongoing){this.$nextTick(()=>
1526{if(document.getElementById("cmaps")){this.loadTrackMap()}})}});n[t].always(e=>{})},afterProgress(e){console.log("afterProgress",e);if(e.order_id!=this.order_info.order_id){return}this.driver_info=e.driver_info;this.is_order_ongoing=e.is_order_ongoing;if(e.order_progress==0){this.order_progress=e.order_progress;this.order_status=e.order_status;this.order_status_details=e.order_status_details}else if(e.order_progress==-1){}else{this.order_progress=e.order_progress;this.order_status=e.order_status;this.order_status_details=e.order_status_details;this.estimated_time=e.estimated_time;this.is_order_need_cancellation=e.is_order_need_cancellation}},writeReview(e){u("writeReview 123=>"+e);this.$refs.ReviewRef.order_uuid=e;this.$refs.ReviewRef.show()},loadTrackMap(){const d=document.getElementById("cmaps");if(!d){return}this.maps_provider=this.maps_config.provider;let e=this.order_info.address_label+" - "+this.order_info.complete_delivery_address+" "+this.order_info.location_name;switch(this.maps_provider){case"google.maps":Oa=new google.maps.LatLngBounds;this.cmaps=new google.maps.Map(document.getElementById("cmaps"),{center:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},zoom:this.maps_config.zoom,disableDefaultUI:true,styles:map_style});ja=new google.maps.DirectionsService;Ea=new google.maps.DirectionsRenderer({map:this.cmaps,suppressMarkers:true,polylineOptions:{strokeColor:"blue",strokeWeight:7,strokeOpacity:.8}});if(!empty(this.merchant_info.latitude)){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:{url:this.maps_config.icon_merchant,scaledSize:new google.maps.Size(45,45)},animation:google.maps.Animation.DROP,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}if(!empty(this.meta.latitude)){this.addMarker({position:{lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)},map:this.cmaps,icon:{url:this.maps_config.icon_destination,scaledSize:new google.maps.Size(45,45)},animation:google.maps.Animation.DROP,title:e},2)}this.FitBounds();break;case"mapbox":Oa=new mapboxgl.LngLatBounds;mapboxgl.accessToken=this.maps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.maps_config.default_lng),parseFloat(this.maps_config.default_lat)],zoom:14});this.cmaps.on("error",e=>{console.log("map error",e.error.message)});this.mapBoxResize();if(!empty(this.merchant_info.latitude&&this.order_progress<=2)){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:"marker_icon_merchant",animation:null,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}else if(this.order_progress>2&&!this.driver_info){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:"marker_icon_merchant",animation:null,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}if(!empty(this.meta.latitude)){this.addMarker({position:{lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)},map:this.cmaps,icon:"marker_icon_destination",animation:null,title:e},2)}if(this.driver_info&&this.order_progress>2){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:"marker_icon_rider",animation:null,title:this.driver_info.full_name},3)}this.FitBounds();break;case"yandex":this.initYandexTrackMap();break}},async initYandexTrackMap(){console.debug("initYandexTrackMap");await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:a,YMapMarker:s,YMapDefaultFeaturesLayer:i}=ymaps3;const o={center:[parseFloat(this.maps_config.default_lng),parseFloat(this.maps_config.default_lat)],zoom:k};if(T){T.destroy();T=null}if(!T){T=new e(this.$refs.cmaps,{location:o,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new a({}),new i({})]);let t=[];if(!empty(this.merchant_info.latitude)){let e=[parseFloat(this.merchant_info.longitude),parseFloat(this.merchant_info.latitude)];t.push(e);const d=document.createElement("img");d.className="icon-marker";d.src=this.maps_config.icon_merchant;T.addChild(new s({coordinates:e},d))}if(!empty(this.meta.latitude)){let e=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)];t.push(e);const d=document.createElement("img");d.className="icon-marker";d.src=this.maps_config.icon_destination;T.addChild(new s({coordinates:e},d))}const r={center:t[0],zoom:k};T.update({location:r})}},mapBoxResize(){if(this.maps_config.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},addMarker(e,t){switch(this.maps_provider){case"google.maps":N[t]=new google.maps.Marker(e);const a=new google.maps.InfoWindow({content:e.title});N[t].addListener("click",()=>{a.open(this.cmaps,N[t])});Oa.extend(N[t].position);break;case"mapbox":const s=document.createElement("div");s.className=e.icon;N[t]=new mapboxgl.Marker(s).setLngLat([e.position.lng,e.position.lat]).addTo(this.cmaps);const i=new mapboxgl.Popup({offset:25}).setText(e.title);N[t].setPopup(i);Oa.extend(new mapboxgl.LngLat(e.position.lng,e.position.lat));break}},async addDriverRoute(e){if(!this.is_order_ongoing){return}setTimeout(async()=>
1526{if(this.driver_info&&this.order_progress>2){console.log("addDriverRoute");if(N[1]){if(this.maps_provider=="mapbox"){N[1].remove()}else if(this.maps_provider=="google.maps"){console.log("remove marker mapbox");N[1].setMap(null);N[1]=null}}let e,t;if(this.maps_provider=="mapbox"){e=[parseFloat(this.driver_info.lontitude),parseFloat(this.driver_info.latitude)];t=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)]}else if(this.maps_provider=="google.maps"){e={lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)};t={lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)}}this.addRoute(e,t)}},e)},addCustomerRoute(e){let t,a;if(this.maps_provider=="mapbox"){t=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)];a=[parseFloat(this.merchant_info.longitude),parseFloat(this.merchant_info.latitude)]}else if(this.maps_provider=="google.maps"){t={lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)};a={lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)}}setTimeout(()=>{this.addRoute(t,a)},e)},async addRoute(e,t){console.log("start",e);console.log("end",t);if(this.maps_provider=="mapbox"){const a=await fetch(`https://api.mapbox.com/directions/v5/mapbox/driving/${e[0]},${e[1]};${t[0]},${t[1]}?geometries=geojson&access_token=${mapboxgl.accessToken}`,{method:"GET"});const s=await a.json();const i=s.routes[0];const o=i.geometry;if(this.cmaps.getSource("route")){this.cmaps.getSource("route").setData(o)}else{this.cmaps.addLayer({id:"route",type:"line",source:{type:"geojson",data:o},layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#76adeb","line-width":7}})}this.FitBounds()}else if(this.maps_provider=="google.maps"){Ea.setDirections({routes:[]});ja.route({origin:e,destination:t,travelMode:"DRIVING"},(e,t)=>{console.log("status",t);if(t==="OK"){console.log("response",e);Ea.setDirections(e)}else{console.error("Directions request failed due to "+t)}})}},FitBounds(){switch(this.maps_provider){case"google.maps":this.cmaps.fitBounds(Oa);break;case"mapbox":this.cmaps.fitBounds(Oa,{padding:30});break}},CancelOrder(){console.log("CancelOrder",this.order_uuid);let e=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(e.cancel_order_descriptions,e.cancel_order,{confirmButtonText:e.confirm,cancelButtonText:e.cancel,type:"info"}).then(()=>{this.applyCancelOrder()})["catch"](()=>{})},applyCancelOrder(){this.cancel_loading=true;axios({method:"POST",url:ajaxurl+"/CancelOrder",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&order_uuid="+this.order_uuid}).then(e=>{if(e.data.code==1){ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});this.getOrder()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.cancel_loading=false})},trackOrder(){console.log("trackOrder");axios.get(ajaxurl+"/trackOrder?"+"order_uuid="+this.order_uuid).then(e=>{if(e.data.code==1){this.afterProgress(e.data.details.data);if(!e.data.details.data.is_order_ongoing){this.stopTimer()}}else{this.stopTimer()}})["catch"](e=>{console.error("Error:",e)}).then(e=>{})},stopTimer(){console.log("stopTimer");clearInterval(this.timer)},setDriverLocation(e){if(this.driver_info&&this.order_progress>2){console.log("setDriverLocation",e);this.driver_info.latitude=e.lat;this.driver_info.lontitude=e.lng;this.UpdateDriverMarker();this.addDriverRoute(0)}}
1526,UpdateDriverMarker(){if(!this.cmaps){return}if(!this.is_order_ongoing){return}if(!this.driver_info){return}if(this.driver_info&&this.order_progress>2){console.log("UpdateDriverMarker");if(N[3]){if(this.maps_provider=="mapbox"){const e=[parseFloat(this.driver_info.lontitude),parseFloat(this.driver_info.latitude)];N[3].setLngLat(e)}else if(this.maps_provider=="google.maps"){console.log("move google marker");const e={lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)};N[3].setPosition(e)}}else{if(this.maps_provider=="mapbox"){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:"marker_icon_rider",animation:null,title:this.driver_info.full_name},3)}else if(this.maps_provider=="google.maps"){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:{url:this.maps_config.icon_rider,scaledSize:new google.maps.Size(35,35)},animation:null,title:this.driver_info.full_name},3)}}}}}});Pa.use(ElementPlus);window.app_orders_track=Pa.mount("#vue-orders-track");const Fa={props:["payload","label","cart_preview","drawer"],data(){return{cart_loading:true,cart_uuid:"",cart_items:[],cart_summary:[],cart_merchant:[],cart_total:[],error:[],go_checkout:[],subtotal:[],items_count:0,update_cart_loading:false}},computed:{hasError(){if(this.error.length>0){return true}return false}},methods:{getCartPreview(){if(!this.cart_preview){this.getCartCount();return}var t=g();let e=getCookie("currency_code");e=!empty(e)?e:"";const a=getLocation();const s=getFromLocalStorageStore(StoreMapName,"selectedAddress");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),currency_code:e,payload:this.payload,location:a,latitude:s?s.latitude:"",longitude:s?s.longitude:""};n[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.cart_loading=false;if(e.code==1){this.cart_merchant=e.details.data.merchant;this.cart_uuid=e.details.cart_uuid;this.cart_items=e.details.data.items;this.cart_summary=e.details.data.summary;this.cart_total=e.details.data.total;this.error=e.details.error;this.go_checkout=e.details.go_checkout;this.subtotal=e.details.data.subtotal;this.items_count=e.details.items_count}else{this.cart_items=[];this.cart_summary=[];this.cart_total=[];this.error=[];this.subtotal=0;this.items_count=0}this.updateImage();this.$emit("setCartcount",this.items_count);if(typeof E!=="undefined"&&E!==null){E.hasItemInCart(this.items_count,this.cart_merchant)}})},getCartCount(){var t=g();let e=getCookie("currency_code");e=!empty(e)?e:"";var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),currency_code:e,payload:["items_count"]};n[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.items_count=e.details.items_count}else this.items_count=0;this.$emit("setCartcount",this.items_count)})},updateCartQty(e,t,a,s){if(e==1){t++}else t--;if(t<=0){this.remove(a,s)}else{this.updateCartItems(t,a,s)}},updateCartItems(e,t,a){var s;var i=1;s="cart_uuid="+a;s+="&cart_row="+t;s+="&item_qty="+e;this.update_cart_loading=true;s+=addValidationRequest();n[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[i]!=null){n[i].abort()}}});n[i].done(e=>{if(e.code==1){this.getCartPreview()}if(typeof ot!=="undefined"&&ot!==null){ot.$refs.ref_featured_list.getFeaturedItems()}});n[i].always(e=>{this.update_cart_loading=false})},remove(e,t){var a;var s=1;a="row="+e+"&cart_uuid="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/removeCartItem",method:"POST",dataType:"json",data:a,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{u(e);
1526if(e.code==1){this.getCartPreview()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getCartPreview()}})},updateImage(){h()},beforeClose(e){this.$emit("afterDrawerclose",false);e()}},template:` 1527 1528 <el-drawer 1529 v-model="drawer" 1530 direction="rtl" 1531 size="320px" 1532 append-to-body="true" 1533 :with-header="true" 1534 :before-close="beforeClose" 1535 custom-class="drawer-preview-cart" 1536 > 1537 1538 <template v-if="cart_loading==false"> 1539 <template v-if="cart_items.length>0"> 1540 1541 <div class="mt-3 mb-0"> 1542 <p class="m-0 bold">{{label.your_cart}}</p> 1543 <a :href="cart_merchant.restaurant_slug" class="m-0 p-0"><h5 class="m-0 chevron d-inline position-relative">{{cart_merchant.restaurant_name}}</h5></a> 1544 <p class="m-0 text-muted">{{cart_merchant.merchant_address}}</p> 1545 </div> 1546 1547 <div class="d-flex justify-content-between align-items-center mb-1"> 1548 <div><h6 class="m-0">{{label.summary}}</h6></div> 1549 <div> 1550 <a href="javascript:;" @click="clear(cart_uuid)" class="javascript:;"> 1551 <p class="m-0"><u>{{label.clear}}</u></p> 1552 </a> 1553 </div> 1554 </div> 1555 </template> 1556 1557 <template v-else> 1558 <h5 class="mt-3 mb-0">{{label.cart}}</h5> 1559 <div class="cart-empty text-center" > 1560 <div class="mt-5"> 1561 <div class="no-results m-auto"></div> 1562 <h6 class="m-0 mt-3">{{label.no_order}}</h6> 1563 <p>{{label.lets_change_that}}</p> 1564 </div>
1565 </div> 1566 </template> 1567 1568 </template> 1569 1570 <!--section-cart--> 1571 <DIV class="section-cart"> 1572 1573 <div v-cloak class="items" v-for="(items, index) in cart_items" > 1574 1575 <div class="line-items row mb-1"> 1576 <div class="col-3"> 1577 <el-image 1578 style="width: 50px; height: 50px" 1579 :src="items.url_image" 1580 :fit="contain" 1581 lazy 1582 ></el-image> 1583 </div> <!--col--> 1584 1585 <div class="col-6 p-0 d-flex justify-content-start flex-column"> 1586 1587 <p class="mb-1"> 1588 {{ items.item_name }} 1589 <template v-if=" items.price.size_name!='' "> 1590 ({{items.price.size_name}}) 1591 </template> 1592 </p> 1593 1594 <template v-if="items.is_free"> 1595 <div class="mb-1"> 1596 <el-tag effect="plain" type="success" size="small" style="white-space: nowrap !important;" > 1597 {{ label.free }} 1598 </el-tag> 1599 </div> 1600 </template> 1601 <template v-else> 1602 <template v-if="items.price.discount>0"> 1603 <p class="m-0 font11"><del>{{items.price.pretty_price}}</del> {{items.price.pretty_price_after_discount}}</p> 1604 </template> 1605 <template v-else> 1606 <p class="m-0 font11">{{items.price.pretty_price}}</p> 1607 </template> 1608 </template> 1609 1610 <!--quantity--> 1611 <div class="quantity d-flex justify-content-between"> 1612 1613 <div> 1614 <a href="javascript:;" @click="updateCartQty(0,items.qty,items.cart_row,cart_uuid)" class="rounded-pill qty-btn" data-id="less"> 1615 <i class="zmdi zmdi-minus"></i> 1616 </a> 1617 </div> 1618 1619 <div class="qty">{{ items.qty }}</div> 1620 1621 <div> 1622 <a href="javascript:;" @click="updateCartQty(1,items.qty,items.cart_row,cart_uuid)" class="rounded-pill qty-btn" data-id="plus"> 1623 <i class="zmdi zmdi-plus"></i> 1624 </a> 1625 </div> 1626 1627 </div> 1628 <!--quantity--> 1629 1630 <p class="mb-0" v-if=" items.special_instructions!='' ">{{ items.special_instructions }}</p> 1631 1632 <template v-if=" items.attributes!='' "> 1633 <template v-for="(attributes, attributes_key) in items.attributes"> 1634 <p class="mb-0"> 1635 <template v-for="(attributes_data, attributes_index) in attributes"> 1636 {{attributes_data}}<template v-if=" attributes_index<(attributes.length-1) ">, </template> 1637 </template> 1638 </p> 1639 </template> 1640 </template> 1641 1642 1643 </div> <!--col--> 1644 1645 <div class="col-3 quantity d-flex justify-content-start flex-column text-right"> 1646 <a href="javascript:;" @click="remove(items.cart_row,cart_uuid)" class="rounded-pill ml-auto mb-1"><i class="zmdi zmdi-close"></i></a> 1647 <template v-if="items.price.discount<=0 "> 1648 <p class="mb-0">{{ items.price.pretty_total }}</p> 1649 </template> 1650 <template v-else> 1651 <p class="mb-0">{{ items.price.pretty_total_after_discount }}</p> 1652 </template> 1653 </div> <!--col--> 1654 1655 </div><!-- line-items--> 1656 1657 <!--addon-items--> 1658 <div class="addon-items row mb-1" v-for="(addons, index_addon) in items.addons" > 1659 <div class="col-3"><!--empty--></div> <!--col--> 1660 <div class="col-9 pl-0 d-flex justify-content-start flex-column"> 1661 <p class="m-0 bold">{{ addons.subcategory_name }}</p> 1662 1663 <template v-cloak v-for="addon_items in addons.addon_items"> 1664 <div class="d-flex justify-content-between mb-1"> 1665 <div class="flexrow"><p class="m-0">{{addon_items.qty}} x {{addon_items.pretty_price}} {{addon_items.sub_item_name}}</p></div> 1666 <div class="flexrow"><p class="m-0">{{addon_items.pretty_addons_total}}</p></div> 1667 </div> <!--flex--> 1668 </template> 1669 1670 </div> <!--col--> 1671 </div> 1672 <!-- addon-items--> 1673 1674 </div> <!--items--> 1675 1676 </DIV> 1677 1678 <template v-if="cart_items.length>0"> 1679 <div class="divider"></div> 1680 <a class="btn btn-green w-100 pointer position-relative" :disabled="hasError" 1681 :href="hasError?'javascript:;':go_checkout.link" 1682 :class="{ loading: update_cart_loading }" 1683 > 1684 <div class="d-flex justify-content-between"> 1685 <div>{{label.go_checkout}}</div> 1686 <div v-if="!update_cart_loading">{{subtotal.value}}</div> 1687 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1688 </div> 1689 </a> 1690 </template> 1691 1692 <div v-cloak class="alert alert-warning m-0 mt-2" v-if="error.length>0"> 1693 <p class="m-0" v-for="error_msg in error"> 1694 {{ error_msg }} 1695 </p> 1696 </div> 1697 1698 </el-drawer> 1699 `};const Na={props:["ajax_url","message"],data(){return{settings:[],beams:undefined}},mounted(){this.getWebpushSettings()},methods:{getWebpushSettings(){axios({method:"POST",url:this.ajax_url+"/getWebpushSettings",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.settings=e.data.details;
1699if(this.settings.enabled==1){this.webPushInit()}}else{this.settings=[]}})["catch"](e=>{}).then(e=>{})},webPushInit(){if(this.settings.provider=="pusher"&&this.settings.user_settings.enabled==1){this.beams=new PusherPushNotifications.Client({instanceId:this.settings.pusher_instance_id});this.beams.start().then(()=>{this.beams.setDeviceInterests(this.settings.user_settings.interest).then(()=>{console.log("Device interests have been set")}).then(()=>this.beams.getDeviceInterests()).then(e=>console.log("Current interests:",e))["catch"](e=>{var t={notification_type:"push",message:"Beams "+e,date:"",image_type:"icon",image:"zmdi zmdi-info-outline"};R.$refs.notification.addData(t)})})["catch"](e=>{var t={notification_type:"push",message:"Beams "+e,date:"",image_type:"icon",image:"zmdi zmdi-info-outline"};R.$refs.notification.addData(t)})}else if(this.settings.provider=="onesignal"){}}},template:` 1700 `};const Ra={components:{"components-webpush":Na},props:["ajax_url","label","realtime","view_url","avatar","image_background"],data(){return{data:[],count:0,new_message:false,player:undefined,ably:undefined,channel:undefined,piesocket:undefined,observer:undefined,pusher:undefined,sounds_order:null,sounds_chat:null}},mounted(){this.getAllNotification();if(this.realtime.enabled){this.initRealTime()}this.observer=lozad(".lozad",{loaded:function(e){e.classList.add("loaded")}});if(typeof sounds_order!=="undefined"&&sounds_order!==null){this.sounds_order=sounds_order}if(typeof sounds_chat!=="undefined"&&sounds_chat!==null){this.sounds_chat=sounds_chat}},updated(){this.observer.observe()},computed:{hasData(){if(this.data.length>0){return true}return false},ReceiveMessage(){if(this.new_message){return true}return false}},methods:{initRealTime(){u(this.realtime.event_tracking_order);if(this.realtime.provider=="pusher"){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.realtime.channel);this.channel.bind(this.realtime.event,e=>{u("receive pusher");u(e);if(e.notification_type=="silent"){}else if(e.notification_type=="order_update"){this.playAlert(this.sounds_order)}else if(e.notification_type=="chat-message"){this.playAlert(this.sounds_chat)}else{this.playAlert()}this.addData(e)})}else if(this.realtime.provider=="ably"){this.ably=new Ably.Realtime(this.realtime.ably_apikey);this.ably.connection.on("connected",()=>{this.channel=this.ably.channels.get(this.realtime.channel);this.channel.subscribe(this.realtime.event,e=>{u("receive ably");u(e.data);this.playAlert();this.addData(e.data)})})}else if(this.realtime.provider=="piesocket"){this.piesocket=new PieSocket({clusterId:this.realtime.piesocket_clusterid,apiKey:this.realtime.piesocket_api_key});
1700this.channel=this.piesocket.subscribe(this.realtime.channel);this.channel.listen(this.realtime.event,e=>{u("receive piesocket");u(e);this.playAlert();this.addData(e)})}},playAlert(e){let t=[site_url+"/assets/sound/notify.mp3",site_url+"/assets/sound/notify.ogg"];if(e){t=[e]}this.player=new Howl({src:t,html5:true});this.player.play()},getAllNotification(){axios({method:"POST",url:this.ajax_url+"/getNotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.count=e.data.details.count}else{this.data=[];this.count=0}})["catch"](e=>{}).then(e=>{})},addData(e){this.data.unshift(e);this.count++;this.new_message=true;setTimeout(()=>{this.new_message=false;this.player.stop()},1e3)},clearAll(){axios({method:"POST",url:this.ajax_url+"/clearNotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=[];this.count=0}else{f(e.data.msg,"error")}this.new_message=false})["catch"](e=>{}).then(e=>{})}},template:` 1701 1702 <components-webpush 1703 :ajax_url="ajax_url" 1704 :message='label' 1705 /> 1706 </components-webpush> 1707 1708 <div class="btn-group pull-right notification-dropdown"> 1709 <button type="button" class="btn p-0 btn-default" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 1710 <img class="img-30 rounded-pill lozad" :src="avatar" :data-background-image="image_background" /> 1711 <span v-if="count>0" :class="{'shake-constant shake-chunk' : ReceiveMessage }" class="badge rounded-circle badge-danger count">{{count}}</span> 1712 </button> 1713 <div class="dropdown-menu dropdown-menu-right"> 1714 <div class="dropdown-header d-flex justify-content-between"> 1715 <div class="flex-col"> 1716 <div class="d-flex align-items-center"> 1717 <h5 class="m-0 mr-2">{{label.title}}</h5> 1718 <span class="badge rounded-circle badge-green badge-25">{{count}}</span> 1719 </div> 1720 </div> 1721 <div class="flex-col" v-if="hasData"> 1722 <a @click="clearAll">{{label.clear}}</a> 1723 </div> 1724 </div> 1725 <!--header--> 1726 1727 <!--content--> 1728 <ul v-if="hasData" class="list-unstyled m-0"> 1729 <li v-for="(item,index) in data"> 1730 <a :href="item.url!='' ? item.url : 'javascript:;'" :class="{ active: index<=0 }" > 1731 <div class="d-flex"> 1732 <div v-if="item.image!=''" class="flex-col mr-3"> 1733 <template v-if="item.image_type=='icon'"> 1734 <div class="notify-icon rounded-circle bg-soft-primary"> 1735 <i :class="item.image"></i> 1736 </div> 1737 </template> 1738 <template v-else> 1739 <div class="notify-icon"> 1740 <img class="img-40 rounded-circle" :src="item.image" /> 1741 </div> 1742 </template> 1743 </div> 1744 <div class="flex-col"> 1745 <div class="text-heading" v-html="item.message"></div> 1746 <div class="dropdown-text-light">{{item.date}}</div> 1747 </div> 1748 </div> 1749 </a> 1750 </li> 1751 </ul> 1752 <!--content--> 1753 1754 <div v-if="!hasData" class="none-notification text-center"> 1755 <div class="image-notification m-auto"></div> 1756 <h5 class="m-0 mb-1 mt-2">{{label.no_notification}}</h5> 1757 <p class="m-0 font11 text-muted">{{label.no_notification_content}}</p> 1758 </div> 1759 1760 <div v-if="hasData" class="footer-dropdown text-center"> 1761 <a :href="view_url" targe="_blank" class="text-primary">{{label.view}}</a> 1762 </div> 1763 1764 </div> <!--dropdown-menu--> 1765 </div> 1766 <!--btn-group--> 1767 `};const Da={props:["ajax_url"],data(){return{data:[],is_loading:false}},mounted(){this.getLanguage()},methods:{getLanguage(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getLanguage",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setLang(e){window.location.href=e}},template:`
1768 <el-skeleton style="width: 150px" :loading="is_loading" animated> 1769 <template #template> 1770 <el-skeleton-item variant="image" style="width: 150px; height: 20px" /> 1771 </template> 1772 <template #default> 1773 1774 <el-dropdown trigger="click" v-if="data.enabled"> 1775 <span class="el-dropdown-link"> 1776 1777 <div class="d-flex align-items-center"> 1778 <div class="mr-2"> 1779 <el-image 1780 style="width: 30px; height: 25px" 1781 :src="data.default.flag" 1782 :fit="contain" 1783 lazy 1784 ></el-image> 1785 </div> 1786 <div class="mr-2">{{data.default.title}}</div> 1787 <div><i class="zmdi zmdi-chevron-down"></i></div> 1788 </div> 1789 </span> 1790 <template #dropdown> 1791 <el-dropdown-menu> 1792 <el-dropdown-item v-for="item in data.data" > 1793 1794 <el-dropdown-item @click="setLang(item.link)"> 1795 <div class="row no-gutters align-items-center"> 1796 <div class="col mr-3"> 1797 <el-image 1798 style="width: 30px; height: 25px" 1799 :src="item.flag" 1800 :fit="contain" 1801 ></el-image> 1802 </div> 1803 <div class="col">{{item.title}}</div> 1804 </div> 1805 </el-dropdown-item> 1806 1807 </el-dropdown-item> 1808 </el-dropdown-menu> 1809 </template> 1810 </el-dropdown> 1811 1812 </template> 1813 </el-skeleton> 1814 `};const Ma={props:["ajax_url","realtime"],data(){return{merchant_uuid:""}},created(){this.getMerchantByCart()},methods:{getMerchantByCart(){axios({method:"POST",url:this.ajax_url+"/getMerchantByCart",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.merchant_uuid=e.data.details.merchant_uuid;this.initRealTime()}else{this.merchant_uuid=""}})["catch"](e=>{}).then(e=>{})},initRealTime(){if(this.realtime.provider=="pusher"&&this.realtime.enabled==1){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.merchant_uuid);this.channel.bind(this.realtime.event,e=>{let t=JSON.parse(e.message);this.$emit("afterReceiveitemupdate",t)})}}}};const Aa={data(){return{data:[],loading:false,based_currency:""}},created(){this.getCurrencyList()},methods:{getCurrencyList(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getCurrencyList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"¤cy_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.based_currency=e.data.details.based_currency}else{this.data=[];this.based_currency=""}})["catch"](e=>{}).then(e=>{this.loading=false})},setCurrency(e){this.based_currency=e;this.$emit("afterSelectcurrency",e)}},template:` 1815 <div class="dropdown language-bar d-inline" v-if="!loading" > 1816 <a class="dropdown-toggle text-truncate" href="javascript:;" 1817 role="button" id="currencySelection" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 1818 {{based_currency}} 1819 </a> 1820 <div class="dropdown-menu" aria-labelledby="currencySelection"> 1821 <template v-for="(items,code) in data"> 1822 <a @click="setCurrency(code)" class="dropdown-item" :class="{active : based_currency==code}" > 1823 <div class="d-flex align-items-center"> 1824 <div class="text-truncate">{{items}}</div> 1825 </div> 1826 </a> 1827 </template> 1828 </div> 1829 </div> 1830 `};const $a=Vue.createApp({components:{"component-cart-preview":Fa,"components-notification":Ra,"components-language":Da,"component-notification-cart":Ma,"component-currency-selection":Aa},mounted(){this.getCartPreview()},data(){return{items_count:0,drawer:false,drawer_preview_cart:false}},methods:{getCartPreview(){this.$refs.childref.getCartPreview()},cartCount(e){this.items_count=e},showCartPreview(){this.drawer_preview_cart=true},afterDrawerclose(){this.drawer_preview_cart=false},afterReceiveitemupdate(e){axios({method:"POST",url:ajaxurl+"/validateCartItems",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&item_id="+e.item_id,timeout:c}).then(t=>{if(t.data.code==1){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.alert(t.data.msg,"",{confirmButtonText:e.ok,callback:e=>{if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}
1830if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof E!=="undefined"&&E!==null){E.geStoreMenu()}}})}})["catch"](e=>{}).then(e=>{})},afterSelectcurrency(e){setCookie("currency_code",e,30);if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof E!=="undefined"&&E!==null){E.geStoreMenu()}if(typeof oi!=="undefined"&&oi!==null){if(typeof oi.$refs.food_list_recommended!=="undefined"&&oi.$refs.food_list_recommended!==null){oi.$refs.food_list_recommended.getFoodList();oi.$refs.food_list.getFoodList()}}if(typeof ot!=="undefined"&&ot!==null){ot.$refs.ref_featured_list.getFeaturedItems()}if(typeof is!=="undefined"&&is!==null){is.getPlan()}}}});$a.use(ElementPlus);const R=$a.mount("#vue-cart-preview");const Ya={props:["title","button"],data(){return{data:[]}},methods:{show(){p("#ModalAlert").modal("show")},close(){p("#ModalAlert").modal("hide")},alert(e){this.data=e;u(this.data);this.show()}},template:` 1831 <div class="modal" id="ModalAlert" tabindex="-1" role="dialog" aria-labelledby="ModalAlert" aria-hidden="true"> 1832 <div class="modal-dialog modal-dialog-centered" role="document"> 1833 <div class="modal-content"> 1834 1835 <div class="modal-header"> 1836 <h5 class="modal-title" id="exampleModalLabel">{{ title }}</h5> 1837 <button type="button" class="close" aria-label="Close" @click="close" > 1838 <span aria-hidden="true">×</span> 1839 </button> 1840 </div> 1841 1842 <div class="modal-body" > 1843 <div v-for="item in data.text" > 1844 {{ item }} 1845 </div> 1846 </div> 1847 1848 <div class="modal-footer justify-content-center"> 1849 <button class="btn btn-black w-25" @click="close" > 1850 {{button}} 1851 </button> 1852 </div> <!--footer--> 1853 1854 </div> <!--content--> 1855 </div> <!--dialog--> 1856 </div> <!--modal--> 1857 `};const Ka=Vue.createApp({components:{"component-alert":Ya},methods:{alert(e){this.$refs.Alertref.alert({text:e})}}}).mount("#component_alert");const La={props:["label"],data(){return{data:[],loading:false,merchant_name:"",cancel_status:false,cancel_msg:"",order_uuid:"",error:[],is_loading:false,cancel_response:[]}},methods:{show(){p("#ModalCancelOrder").modal("show")},close(){p("#ModalCancelOrder").modal("hide");this.order_uuid=""},cancel(e){this.merchant_name=e.merchant_name;this.show();this.order_uuid=e.order_uuid;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/cancelOrderStatus",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.cancel_status=false;this.cancel_msg="";if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.cancel_status=e.details.cancel_status;this.cancel_msg=e.details.cancel_msg;this.cancel_response=e.details}else{this.cancel_status=false;this.cancel_response=[]}});n[a].always(e=>{this.loading=false})},applyCancelOrder(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/applyCancelOrder",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){f(e.msg,"success");this.close();qa.page=0;qa.data=[];qa.orderHistory()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:` 1858 <div class="modal" id="ModalCancelOrder" tabindex="-1" role="dialog" aria-labelledby="ModalCancelOrder" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 1859 <div class="modal-dialog modal-dialog-centered" role="document"> 1860 <div class="modal-content"> 1861 1862 <div class="modal-header"> 1863 <h5 class="modal-title" id="exampleModalLabel">{{merchant_name}}</h5> 1864 <button type="button" class="close" aria-label="Close" @click="close" :disabled="is_loading" >
1865 <span aria-hidden="true">×</span> 1866 </button> 1867 </div> 1868 1869 <DIV v-if="loading"> 1870 <div class="loading mt-5 mb-5"> 1871 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1872 </div> 1873 </DIV> 1874 1875 <DIV v-else> 1876 1877 <div class="modal-body" > 1878 1879 <h5 v-if="cancel_response.refund_status==='full_refund'">{{label.are_you_sure}}</h5> 1880 <h5 v-else>{{label.how}}</h5> 1881 1882 <div class="mt-3"> 1883 <p>{{cancel_msg}}</p> 1884 </div> 1885 1886 <div class="mt-3 mb-2" v-if="cancel_response.refund_msg"> 1887 <p>{{cancel_response.refund_msg}}</p> 1888 </div> 1889 1890 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1891 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1892 </div> 1893 1894 </div> <!--body--> 1895 1896 <div class="modal-footer justify-content-center"> 1897 <button class="btn btn-black w-100" @click="close" :disabled="is_loading" > 1898 {{label.dont}} 1899 </button> 1900 <button class="btn btn-green w-100" :disabled="!cancel_status" @click="applyCancelOrder()" 1901 :class="{ loading: is_loading }" > 1902 <span class="label">{{label.cancel}}</span> 1903 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1904 </button> 1905 </div> <!--footer--> 1906 1907 </DIV> <!--end if--> 1908 1909 </div> <!--content--> 1910 </div> <!--dialog--> 1911 </div> <!--modal--> 1912 `};const za=Vue.createApp({components:{"component-cancel-order":La,"components-review":$e,"components-reviewdriver":Ca},mounted(){this.orderHistory();this.orderSummary();const e=new URLSearchParams(window.location.search).get("order_uuid");if(e){this.orderDetails(e)}},data(){return{show_next_page:false,loading:false,load_more:false,page:0,data:[],merchants:[],items:[],size:[],status:[],services:[],show_details:false,order_loading:false,order_merchant:[],order_items:[],order_summary:[],order_info:[],order_status:[],order_services:[],order_label:[],status_allowed_cancelled:[],status_allowed_review:[],q:"",awaitingSearch:false,search_found:false,summary_data:[],total_qty:0,animated_total_qty:0,total_order_raw:0,animated_total_order:0,refund_transaction:[],order_table_data:[],order_info_data:null}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){return false}setTimeout(()=>{var e;var t=g();e="page=0";e+="&q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=[];this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.data.push(e.details.data.data);this.merchants=e.details.data.merchants;this.items=e.details.data.items;this.size=e.details.data.size;this.status=e.details.data.status;this.services=e.details.data.services;this.status_allowed_cancelled=e.details.data.status_allowed_cancelled;this.status_allowed_review=e.details.data.status_allowed_review;this.search_found=true}else{this.data=[];this.search_found=true}});n[t].always(e=>{this.awaitingSearch=false})},1e3);this.awaitingSearch=true}},total_qty(e){gsap.to(this.$data,{duration:.6,animated_total_qty:e})},total_order_raw(e){gsap.to(this.$data,{duration:.6,animated_total_order:e})}},computed:{hasData(){if(this.search_found){return true}return false},hasResults(){if(this.data.length>0){return true}return false},hasRefund(){if(this.refund_transaction.length>0){return true}return false},animatedNumber(){return this.animated_total_qty.toFixed(0)},animatedTotal(){return this.animated_total_order.toFixed(2)},hasBooking(){if(Object.keys(this.order_table_data).length>0){return true}return false}},methods:{clearData(){this.search_found=false;this.q="";this.page=0;this.data=[];this.orderHistory()},orderHistory(){if(!this.load_more){this.loading=true}var e;var t=g();e="page="+this.page;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.data.push(e.details.data.data);this.merchants=this.addObjectToArray(this.merchants,e.details.data.merchants);this.items=this.addObjectToArray(this.items,e.details.data.items);this.status=e.details.data.status;this.services=e.details.data.services;this.status_allowed_cancelled=e.details.data.status_allowed_cancelled;this.status_allowed_review=e.details.data.status_allowed_review}else{}});n[t].always(e=>{this.loading=false;this.load_more=false})},addObjectToArray(e,t){var a={};Object.entries(e).forEach(([e,t])=>{a[e]=t});Object.entries(t).forEach(([e,t])=>{a[e]=t});return a},loadMoreOrders(e){this.page=e;this.load_more=true;this.orderHistory()},orderDetails(e){this.show_details=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/orderDetails",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.order_loading=true;this.order_merchant=[];this.order_items=[];this.order_summary=[];this.order_info=[];this.order_status=[];this.order_services=[];this.order_label=[];
1912if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.order_merchant=e.details.data.merchant;this.order_items=e.details.data.items;this.order_summary=e.details.data.summary;this.order_info=e.details.data.order.order_info;this.order_label=e.details.data.label;this.refund_transaction=e.details.data.refund_transaction;this.order_status=e.details.data.order.status;this.order_services=e.details.data.order.services;this.order_table_data=e.details.data.order_table_data;if(!empty(this.order_services[this.order_info.service_code])){this.order_services=this.order_services[this.order_info.service_code]}if(!empty(this.order_status[this.order_info.status])){this.order_status=this.order_status[this.order_info.status]}}});n[a].always(e=>{this.order_loading=false;this.updateImage()})},closeOrderDetails(){this.show_details=false},updateImage(){h()},buyAgain(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:e,cart_uuid:getCookie("cart_uuid")};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/orderBuyAgain",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);if(t==1){this.show_details=false}R.getCartPreview();if(typeof R!=="undefined"&&R!==null){R.showCartPreview()}}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}})},callCancel(e,t){this.$refs.orderCancelRef.cancel({merchant_name:t,order_uuid:e})},writeReview(e,t){this.order_info_data=t;this.$refs.ReviewRef.order_uuid=e;this.$refs.ReviewRef.show()},afterAddreview(){if(this.order_info_data.driver_id>0){this.$refs.ref_driverreview.modal=true}},orderSummary(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/orderSummary",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.summary_data=e.details.summary;this.total_qty=e.details.summary.total_qty;this.total_order_raw=e.details.summary.total_order_raw>0?e.details.summary.total_order_raw:0})}}});za.use(ElementPlus);const qa=za.mount("#vue-my-order");const D=Vue.createApp({components:{"component-bootbox":Re},data(){return{resolvePromise:undefined,rejectPromise:undefined}},methods:{confirm(){return new Promise((e,t)=>{this.resolvePromise=e;this.rejectPromise=t;this.$refs.bootbox.confirm()})},Callback(e){this.resolvePromise(e)},alert(e,t){this.$refs.bootbox.alert(e,t)}}}).mount("#vue-bootbox");const Va=Vue.createApp({components:{"component-new-address":je,"component-address":Ee},mounted(){this.getAddresses(false)},data(){return{data:[],error:[],is_loading:false,reload_loading:false,total_address:0,total_address_animated:0}},watch:{total_address(e){gsap.to(this.$data,{duration:.5,total_address_animated:e})}},computed:{animatedTotal(){return this.total_address_animated.toFixed(0)}},methods:{getAddresses(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.total_address=this.data.length}else{this.data=[];this.total_address=0}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},showNewAddress(){this.$refs.refnewaddress.autosaved_addres=false;this.$refs.refnewaddress.showModal()},ShowAddress(e){this.$refs.address.show(e)},setLocationDetails(e){this.$refs.address.showWithData(e)},ConfirmDelete(e){this.$refs.address.ConfirmDelete(e)}}});Va.use(ElementPlus);const Ua=Va.mount("#vue-my-address");const Ba={props:["label","payment_type","show_payment"],data(){return{data:[],display:false}},mounted(){this.getPaymentMethod();this.display=this.show_payment},methods:{getPaymentMethod(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_type:this.payment_type};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/PaymentMethod",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}})},showPayment(e){this.$emit("setPayment",e)}},template:` 1913 <!--PAYMENT METHODS--> 1914 <transition name="slide-fade"> 1915 <div class="card mb-3" v-if="display" > 1916 <div class="card-body"> 1917 1918 <h5 class="mb-3">{{label.add_new_payment}}</h5> 1919 1920 <a v-for="payment in data" @click="showPayment(payment.payment_code)" 1921 href="javascript:;" class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 1922 <div class="flexcol mr-2 payment-logo-wrap"> 1923 <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i> 1924 <img v-else class="img-35" :src="payment.logo_image" /> 1925 </div> 1926 1927 <div class="flexcol" >
1928 <span class="mr-1">{{payment.payment_name}}</span> 1929 </div> 1930 </a> 1931 1932 </div> <!--card body--> 1933 </div> <!--card--> 1934 </transition> 1935 <!--END PAYMENT METHODS--> 1936 `};const Ja=Vue.createApp({data(){return{data:[],default_payment_uuid:"",error:[],is_loading:false,reload_loading:false,payment_method:false}},mounted(){this.getMyPayments(false)},watch:{payment_method(e,t){this.$refs.payment_method.display=e}},methods:{getMyPayments(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/MyPayments",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.default_payment_uuid=e.details.default_payment_uuid}else{this.data=[];this.default_payment_uuid=""}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},ConfirmDelete(t){D.confirm().then(e=>{if(e){this.deletePayment(t)}})},deletePayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/deletePayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getMyPayments(true)}else{D.alert(e.msg,{})}});n[a].always(e=>{})},editPayment(e){this.$refs[e.payment_code].Get(e.reference_id)},SavedPaymentList(){this.getMyPayments(true)},showPayment(e){try{this.$refs[e].showPaymentForm()}catch(t){D.alert(t,{})}},setDefaultPayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getMyPayments(true)}else{D.alert(e.msg,{})}})}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Ja.component(e,t)})}Ja.component("components-payment-method",Ba);Ja.use(Maska);Ja.use(ElementPlus);const Ga=Ja.mount("#vue-my-payments");const Wa=Vue.createApp({components:{"component-save-store":rt},data(){return{data:[],is_loading:false,reload_loading:false,services:[],estimation:[]}},mounted(){this.saveStoreList(false)},updated(){u("updated");p(".list-items .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})},methods:{saveStoreList(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/saveStoreList",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.services=e.details.services;this.estimation=e.details.estimation}else{this.data=[];this.services=[];this.estimation=[]}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},afterSaveStore(e){e.saved_store=e.saved_store==1?false:true}}});Wa.use(ElementPlus);const Za=Wa.mount("#vue-saved-store");const Ha={props:["label","modelValue"],emits:["update:modelValue"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],hasSelected:false}},watch:{q(e,t){this.$emit("update:modelValue",e);if(!this.awaitingSearch){if(empty(e)){return false}if(this.q.length>20){return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},setData(e){this.clearData();this.q=e.description;
1936this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:` 1937 <div class="position-relative search-geocomplete"> 1938 <div v-if="!awaitingSearch" class="img-20 m-auto pin_placeholder icon"></div> 1939 <div v-if="awaitingSearch" class="icon" data-loader="circle"></div> 1940 1941 <input @click="showList" v-model="q" class="form-control form-control-text" 1942 :placeholder="label.enter_address" > 1943 1944 <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div> 1945 1946 </div> 1947 1948 <div class="search-geocomplete-results" v-if="show_list"> 1949 <ul class="list-unstyled m-0 border"> 1950 <li v-for="items in data"> 1951 <a href="javascript:;" @click="setData(items)" > 1952 <h6 class="m-0">{{items.description}}</h6> 1953 </a> 1954 </li> 1955 </ul> 1956 </div> 1957 `};const Qa=Vue.createApp({components:{"component-auto-complete":Ha,"component-phone":e,"vue-recaptcha":Ne},data(){return{data:[],loading:false,mobile_prefixes:[],restaurant_name:"",address:"",contact_email:"",mobile_prefix:"",mobile_number:"",membership_type:"",membership_list:[],response:[],recaptcha_response:"",show_recaptcha:true,membership_commission:[],services_list:[],services:[],currency_list:[],currency:""}},mounted(){this.getSignupAttributes()},computed:{checkForm(){if(empty(this.restaurant_name)){return true}if(empty(this.address)){return true}if(empty(this.contact_email)){return true}if(!this.validEmail(this.contact_email)){return true}if(empty(this.mobile_number)){return true}if(empty(this.mobile_prefix)){return true}if(empty(this.membership_type)){return true}return false}},methods:{getSignupAttributes(){var e;var t=g();e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getSignupAttributes",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.mobile_prefixes=e.details.mobile_prefixes;this.membership_list=e.details.membership_list;this.show_recaptcha=e.details.capcha;this.membership_commission=e.details.membership_commission;this.services_list=e.details.services_list;this.currency_list=e.details.currency_list}else{this.mobile_prefixes=[];this.membership_list="";this.show_recaptcha=false;this.membership_commission=[];this.services_list=[];this.currency_list=[]}})},verifyForms(){if(this.show_recaptcha){this.verifyRecaptcha()}else{this.submit()}},verifyRecaptcha(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),recaptcha_response:this.recaptcha_response};var t=11;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyRecaptcha",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.submit()}else if(e.code==3){this.recaptchaExpired();this.response.code=2;this.response.msg=e.msg}else{this.response=e}});n[t].always(e=>{this.loading=false})},submit(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),restaurant_name:this.restaurant_name,address:this.address,contact_email:this.contact_email,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,membership_type:this.membership_type,services:this.services,currency:this.currency};var t=22;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/CreateAccountMerchant",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.response=e;if(e.code==1){window.location.href=e.details.redirect}});n[t].always(e=>{this.loading=false})},validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){this.$refs.vueRecaptcha.reset()},recaptchaFailed(){},replaceText(e,t,a){let s=e.replace("{transaction_type}",t);s=s.replace("{site_name}",a);return s}}});Qa.use(Maska);Qa.use(ElementPlus);const Xa=Qa.mount("#vue-merchant-signup");const es=Vue.createApp({components:{"component-phone":e,"vue-rec
1957aptcha":Ne},data(){return{is_loading:false,show_password:false,agree_terms:false,password_type:"password",first_name:"",last_name:"",contact_email:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false,merchant_uuid:"",username:""}},mounted(){this.merchant_uuid=_merchant_uuid},computed:{DataValid(){if(!empty(this.first_name)&&empty(!this.last_name)&&empty(!this.contact_email)&&empty(!this.mobile_number)&&empty(!this.password)&&empty(!this.cpassword)&&empty(!this.username)){return true}return false}},methods:{showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){this.is_loading=true;this.error=[];axios({method:"PUT",url:ajaxurl+"/createMerchantUser",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),username:this.username,password:this.password,cpassword:this.cpassword,first_name:this.first_name,last_name:this.last_name,contact_email:this.contact_email,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,merchant_uuid:this.merchant_uuid},timeout:c}).then(e=>{if(e.data.code==1){window.location.href=e.data.details.redirect}else{this.data=[];this.error=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});es.use(Maska);const ts=es.mount("#vue-merchant-user");const as={props:["label","payment_type","ajax_url","actions"],data(){return{is_loading:false,data:[],payment_code:""}},mounted(){this.getPaymentMethod()},methods:{getPaymentMethod(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/"+this.actions,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},isActive(e){return{"border-vertical-green":e.payment_code==this.payment_code}},setPayment(e){this.payment_code=e;this.$emit("setPayment",this.payment_code)}},template:` 1958 <!--PAYMENT METHODS--> 1959 <div class="card mb-3" > 1960 <div class="card-body"> 1961 1962 <h4 class="mb-3">{{label.select_payment}}</h4> 1963 1964 <a v-for="payment in data" 1965 @click="setPayment(payment.payment_code)" 1966 :class="isActive(payment)" 1967 class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 1968 <div class="flexcol mr-2 payment-logo-wrap"> 1969 <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i> 1970 <img v-else class="img-35" :src="payment.logo_image" /> 1971 </div> 1972 1973 <div class="flexcol" > 1974 <span class="mr-1">{{payment.payment_name}}</span> 1975 </div> 1976 </a> 1977 1978 </div> <!--card body--> 1979 </div> <!--card--> 1980 <!--END PAYMENT METHODS--> 1981 `};const ss=Vue.createApp({data(){return{data:[],plan_details:[],is_loading:true}},mounted(){this.getPlan()},methods:{getPlan(){this.is_loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:site_url+"/apisubscriptions/getsubscriptionlist",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"¤cy_code="+e}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.plan_details=e.data.details.plan_details}else{this.data=[];this.plan_details=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setChoosePlan(e){this.is_loading=true;let t="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&subscriber_id="+subscriber_id+"&package_id="+e;t+="&subscription_type="+subscription_type;t+="&success_url="+success_url;t+="&failed_url="+failed_url;axios({method:"POST",url:site_url+"/apisubscriptions/createPaymentPlan",data:t}).then(e=>{if(e.data.code==1){window.location.href=payment_url+"?payment_id="+e.data.details.payment_id}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});ss.use(ElementPlus);const is=ss.mount("#vue-subscription");const os=Vue.createApp({data(){return{data:[],loading:false,merchant_uuid:null,package_uuid:null,plan_details:[],payment_list:[],payment_code:"",subscriber_id:null,payment_id:null,
1981subscription_type:null}},mounted(){if(typeof payment_id!=="undefined"&&payment_id!==null){this.payment_id=payment_id}if(typeof subscription_type!=="undefined"&&subscription_type!==null){this.subscription_type=subscription_type}this.getSelectPaymentPlan()},computed:{hasPaymentSelected(){return empty(this.payment_code)?false:true}},methods:{isActive(e){return this.payment_code==e?true:false},getSelectPaymentPlan(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"GET",url:site_url+"/apisubscriptions/getCreatePayment?payment_id="+payment_id+"¤cy_code="+e}).then(e=>{if(e.data.code==1){this.plan_details=e.data.details.plan_details;this.payment_list=e.data.details.payment_list}else{this.plan_details=[];this.payment_list=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},showPayment(){console.log("this.payment_code",this.payment_code);console.log("this.subscription_type",this.subscription_type);try{this.$refs[this.payment_code][this.subscription_type]()}catch(e){console.log("error",e);ElementPlus.ElNotification({title:"",message:"This payment is not available for plan",position:"bottom-right",type:"warning"})}},showLoader(){this.loading=true},closeLoader(){this.loading=false},errorMessage(e){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){os.component(e,t)})}os.use(ElementPlus);const rs=os.mount("#payment-plan");const ds=Vue.createApp({components:{"component-phone":e,"component-change-phoneverify":ua},data(){return{is_loading:false,data:[],first_name:"",last_name:"",email_address:"",mobile_prefix:"",mobile_number:"",original_email_address:"",original_mobile_number:"",error:[],success:"",original_mobile_prefix:"",custom_fields:{}}},computed:{DataValid(){if(!empty(this.first_name)&&empty(!this.last_name)&&empty(!this.email_address)&&empty(!this.mobile_number)){return true}return false}},mounted(){this.getProfile()},methods:{getProfile(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=11;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getProfile",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.first_name=e.details.first_name;this.last_name=e.details.last_name;this.email_address=e.details.email_address;this.mobile_prefix=e.details.mobile_prefix;this.mobile_number=e.details.mobile_number;this.original_mobile_prefix=e.details.mobile_prefix;this.original_email_address=e.details.email_address;this.original_mobile_number=e.details.mobile_number;const a=e.details.custom_fields;if(a){Object.keys(a).forEach(e=>{const t=a[e];this.addCustomField(e,t)})}}else{this.msg=e.msg}});n[t].always(e=>{this.is_loading=false})},addCustomField(e,t){this.custom_fields[e]=t},checkForm(){var e=false;if(this.email_address!=this.original_email_address){e=true}if(this.mobile_number!=this.original_mobile_number){e=true}if(this.original_mobile_prefix!=this.mobile_prefix){e=true}this.success="";this.error=[];console.log("_change",e);if(e){this.$refs.cphoneverify.show({mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,message:_message});this.$refs.cphoneverify.resendCode()}else{this.saveProfile("")}},saveProfile(t){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:t,first_name:this.first_name,last_name:this.last_name,email_address:this.email_address,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,custom_fields:this.custom_fields};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/saveProfile",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!empty(t)){this.$refs.cphoneverify.is_loading=true}else{this.is_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();this.success=e.msg;this.original_email_address=this.email_address;this.original_mobile_number=this.mobile_number}else{if(!empty(t)){this.$refs.cphoneverify.error=e.msg}else this.error=e.msg}});n[a].always(e=>{if(!empty(t)){this.$refs.cphoneverify.is_loading=false}else{this.is_loading=false}})}}});ds.mixin({methods:{uploadCustomFieldFile(e,t,a){const i=e.target.files[0];if(!i)return;let s=new FormData;s.append("YII_CSRF_TOKEN",p("meta[name=YII_CSRF_TOKEN]").attr("content"));s.append("file",i);s.append("field_type",a);axios.post(ajaxurl+"/uploadCustomFieldFile",s,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{if(e.data.code==1){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};this.custom_fields[t]=Object.assign({},a,e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}}).catch(e=>{})},setCustomFieldExpiration(e,t){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};a.expires_at=e.target.value;this.custom_fields[t]=a}}});ds.use(Maska);ds.use(ElementPlus);const ls=ds.mount("#vue-update-profile");const ns=Vue.createApp({components:{"component-change-phoneverify":ua},data(){return{is_loading:false,data:[],error:[],success:"",old_password:"",new_password:"",confirm_password:""}},computed:{DataValid(){if(!empty(this.old_password)&&empty(!this.new_password)&&empty(!this.confirm_password)){return true}return false}},methods:{updatePassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),old_password:this.old_password,new_password:this.new_password,confirm_password:this.confirm_password};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/updatePassword",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error="";this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.old_password="";this.new_password="";this.confirm_password=""}else this.error=e.msg});n[t].always(e=>{this.is_loading=false})}}}).mount("#vue-update-password");const cs=Vue.createApp({components:{"component-change-phoneverify":ua},data(){return{is_loading:false,error:[],success:"",steps:1,steps_request_data:1}},methods:{requestArchive(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestData",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.steps_request_data=1;this.error="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps_request_data=2}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},confirm(){this.$refs.cphoneverify.show({mobile_prefix:_phone_prefix,mobile_number:_contact_phone,message:_message});this.$refs.cphoneverify.resendCode()},verifyAccountDelete(t){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:t};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/verifyAccountDelete",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.cphoneverify.is_loading=true;this.$refs.cphoneverify.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();D.confirm().then(e=>{if(e){this.deleteAccount(t)}})}else this.$refs.cphoneverify.error=e.msg});n[a].always(e=>{this.$refs.cphoneverify.is_loading=false})},deleteAccount(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/deleteAccount",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error="";this.success="";if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.steps=2;setTimeout(()=>{window.location.href=e.details.redirect},4e3)}else D.alert(e.msg,{})});n[a].always(e=>{this.is_loading=false})}}});cs.use(Maska);const ms=cs.mount("#vue-manage-account");const us={components:{Cropper:VueAdvancedCropper.Cropper},props:["label"],data(){return{upload_images:"",filename:"",required_message:[],is_loading:false,error:[],steps:1,photo:undefined}},mounted(){this.initDropZone(this.label,this)},methods:{show(){this.steps=1;p("#photoModal").modal("show")},close(){p("#photoModal").modal("hide")},closeReset(){this.reset();p("#photoModal").modal("hide")},reset(){Dropzone.forElement("#dropzone_multiple").removeAllFiles(true);this.removeUpload(this.filename);this.upload_images=[];this.filename="";this.error=[]},initDropZone(t,e){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};Dropzone.autoDiscover=false;Ae=p(this.$refs.profile_dropzone).dropzone({dictDefaultMessage:t.dictDefaultMessage,dictFallbackMessage:t.dictFallbackMessage,dictFallbackText:t.dictFallbackText,dictFileTooBig:t.dictFileTooBig,dictInvalidFileType:t.dictInvalidFileType,dictResponseError:t.dictResponseError,dictCancelUpload:t.dictCancelUpload,dictCancelUploadConfirmation:t.dictCancelUploadConfirmation,dictRemoveFile:t.dictRemoveFile,dictMaxFilesExceeded:t.dictMaxFilesExceeded,paramName:"file",url:ajaxurl+"/uploadProfilePhoto",maxFiles:20,params:a,addRemoveLinks:true,maxFiles:2,init:function(){this.on("maxfilesexceeded",function(e){D.alert(t.max_file_exceeded,{})});this.on("removedfile",function(e){})},success:(e,t)=>{var a=JSON.parse(t);if(a.code==1){this.upload_images=a.details.url_image;this.filename=a.details.filename;this.steps=2}else{D.alert(a.msg,{});this.reset()}}})},removeUpload(i){return new Promise((t,e)=>{var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:i};var s=g();n[s]=p.ajax({url:ajaxurl+"/removeProfilePhoto",method:"PUT",dataType:"json",data:JSON.stringify(a),c
1981ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[s]!=null){n[s].abort();this.is_loading=false}}});n[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});n[s].always(e=>{this.is_loading=false})})},change({coordinates:e,canvas:t}){this.photo=t.toDataURL("image/png")},save(){this.$emit("onSave",this.photo,this.filename)}},template:` 1982 <div class="modal" id="photoModal" tabindex="-1" role="dialog" aria-labelledby="photoModal" aria-hidden="true" 1983 data-backdrop="static" data-keyboard="false" > 1984 <div class="modal-dialog modal-dialog-centered" role="document"> 1985 <div class="modal-content"> 1986 1987 <div class="modal-body" style="overflow-y:inherit !important;" > 1988 1989 <a href="javascript:;" @click="closeReset" 1990 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1991 1992 <template :class="{ 'd-block': steps==1 }"> 1993 <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5> 1994 <div class="mb-3"> 1995 <div class="dropzone dropzone_container" id="dropzone_multiple" ref="profile_dropzone" > 1996 <div class="dz-default dz-message"> 1997 <i class="fas fa-cloud-upload-alt"></i> 1998 <p>{{label.drop_files_here}}</p> 1999 </div> 2000 </div> 2001 </div> 2002 </template> 2003 2004 <template v-if="steps==2"> 2005 <h5 class="m-0 mt-3 mb-2">{{label.crop_photo}}</h5> 2006 2007 <div class="crop-images-wrap"> 2008 <cropper 2009 :src="upload_images" 2010 @change="change" 2011 :stencil-props="{ 2012 handlers: {}, 2013 movable: false, 2014 scalable: false, 2015 }" 2016 :stencil-size="{ 2017 width: 120, 2018 height: 120 2019 }" 2020 image-restriction="stencil" 2021 ></cropper> 2022 </div> 2023 2024 </template> 2025 2026 2027 </div> <!--modal body--> 2028 2029 <template v-if="steps==2"> 2030 2031 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 2032 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 2033 </div> 2034 2035 <div class="modal-footer justify-content-start"> 2036 <button class="btn btn-green w-100" @click="save" :class="{ loading: is_loading }" > 2037 <span class="label">{{label.save_photo}}</span> 2038 <div class="m-auto circle-loader" data-loader="circle-side"></div> 2039 </button> 2040 </div> <!--footer--> 2041 </template> 2042 2043 </div> <!--content--> 2044 </div> <!--dialog--> 2045 </div> <!--modal--> 2046 `};const hs=Vue.createApp({components:{"components-profile-photo":us},data(){return{avatar:""}},methods:{showUpload(){this.$refs.profile_photo.show()},SavePhoto(e,t){var a;var s=1;a="photo="+e;a+="&filename="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/saveProfilePhoto",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.profile_photo.is_loading=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.$refs.profile_photo.close();this.avatar=e.details.url_image;this.updateImage()}else{this.$refs.profile_photo.error=e.msg}});n[s].always(e=>{this.$refs.profile_photo.is_loading=false})},updateImage(){var e=this.$refs.refavatar.getElementsByTagName("img");e[0].src=this.avatar}}});hs.use(ElementPlus);const _s=hs.mount("#vue-profile-photo");const ps=Vue.createApp({components:{"component-select-time":pt},data(){return{store_close:false,time_required:false,time_required_message:"",time_selection:1,store_open_data:null}},mounted(){},methods:{checkStoreOpen(){var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:e,cart_uuid:getCookie("cart_uuid"),choosen_delivery:t};var s=g();a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/checkStoreOpen",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}}).done(e=>{if(e.code==1){this.store_open_data=e.details;if(e.details.merchant_open_status<=0){this.store_close=true;vue_cart.error.push(e.msg)}else{this.store_close=false}this.time_required=e.details.time_required;this.time_selection=e.details.time_selection;if(this.time_required){vue_cart.error.push(e.details.time_required_message)}if(e.details.time_already_passed){setCookie("choosen_delivery",[],30)}}else{this.store_close=true;vue_cart.error.push(e.msg)}}).always(e=>{})},show(){this.$refs.select_time.show()},afterSaveTransOptions(e){this.$refs.select_time.close();if(typeof a!=="undefined"&&a!==null){a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time;a.Search(false)}
2046if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){if(vm_widget_nav.$refs.transaction_info){vm_widget_nav.$refs.transaction_info.whento_deliver=e.whento_deliver;vm_widget_nav.$refs.transaction_info.delivery_datetime=e.delivery_datetime}}},storeAvailable(){var e="";if(typeof merchant_uuid!=="undefined"&&merchant_uuid!==null){e=merchant_uuid}axios({method:"POST",url:ajaxurl+"/storeAvailable",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_uuid="+e,timeout:c}).then(e=>{if(e.data.code==1){}else{vue_cart.error.push(e.data.msg)}})["catch"](e=>{}).then(e=>{})}}}).mount("#vue-schedule-order");const fs=Vue.createApp({data(){return{visible:false,include_utensils:false,is_loading:false}},watch:{include_utensils(e,t){U("include_utensils",e);this.setUtensils(e)}},mounted(){this.setUtensils(B("include_utensils"))},methods:{setTransaction(e){if(e=="delivery"){this.visible=true}else this.visible=false},setUtensils(e){e=empty(e)?false:e;this.include_utensils=e}}}).mount("#vue-utensils");const gs={props:["title","merchant_id","settings","image_use","responsive"],components:{"money-format":Ye},data(){return{owl:undefined,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qty:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",transaction_type:"",item_loading:false,item_gallery:[],image_featured:"",money_config:""}},mounted(){this.itemSuggestion()},updated(){if(this.item_addons_load==true){this.ItemSummary();p(".item_s .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})}if(typeof ca!=="undefined"&&ca!==null){this.transaction_type=ca.transaction_type}},computed:{getItemGallery(){return this.item_gallery}},methods:{itemSuggestion(){let e=getCookie("currency_code");e=!empty(e)?e:"";var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,image_use:this.image_use,currency_code:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/geStoreMenu",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}}).done(e=>{if(e.code==1){var t=e.details.data.category;var a=e.details.data.items;var s=[];var i=[];if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){i.push(a[t])});s.push({cat_id:t.cat_id,category_name:t.category_name,category_uiid:t.category_uiid,items:i});i=[]})}this.menu_data=s;setTimeout(()=>{this.RenderCarousel()},10)}else this.menu_data=[]}).always(e=>{this.is_loading=false})},RenderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p("#item-suggestion-list").owlCarousel({items:parseInt(this.settings.items),lazyLoad:this.settings.lazyLoad=="1"?true:false,loop:this.settings.loop=="1"?true:false,margin:parseInt(this.settings.margin),nav:this.settings.nav=="1"?true:false,dots:this.settings.dots=="1"?true:false,stagePadding:parseInt(this.settings.stagePadding),autoWidth:true,rtl:e})},SlideNext(){this.owl.trigger("next.owl.carousel")},SlidePrev(){this.owl.trigger("prev.owl.carousel",[300])},viewItem(e){this.item_loading=true;NProgress.start();let t=getCookie("currency_code");t=!empty(t)?t:"";var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,item_uuid:e.item_uuid,cat_id:e.cat_id,currency_code:t};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/getMenuItem",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}}).done(e=>{if(e.code==1){C=e.details.data.items;O=e.details.data.addons;j=e.details.data.addon_items;$t=e.details.data.items.item_addons;this.money_config=e.details.money_config;this.item_gallery=e.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var t=e.details.data.meta;var i=e.details.data.meta_details;var o={cooking_ref:[],ingredients:[],dish:[]};let s=e.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(i[a])){if(!empty(i[a][t])){let e=false;if(a=="ingredients"&&s){e=true}o[a].push({meta_id:i[a][t].meta_id,meta_name:i[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=o;
2046this.getSizeData(r);this.sold_out_options=e.details.sold_out_options;p(this.$refs.modal_item_details).modal("show");this.updateImage()}}).always(e=>{this.item_loading=false;NProgress.done()})},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({loop:false,margin:10,nav:false,dots:false,rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},updateImage(){h()},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;this.getSizeData(t)},getSizeData(a){Yt=[];var s=[];if(!empty($t[a])){p.each($t[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})});Yt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Yt;this.item_addons_load=true},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}u("item_total=>"+w);this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;var o=[];var r=[];if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},CheckaddCartItems(){this.addCartItems()},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:(parseInt(this.item_qty)>0?parseInt(this.item_qty):1),item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:this.transaction_type,if_sold_out:this.if_sold_out};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){p(this.$refs.modal_item_details).modal("hide");vue_cart.loadcart()}});n[a].always(e=>{this.add_to_cart=false})}},template:"#item_suggestion"};const vs=Vue.createApp({components:{"components-item-suggestion":gs},data(){return{data:[]}}});vs.use(ElementPlus);const ys=vs.mount("#vue-item-suggestion");const bs=Vue.createApp({components:{"component-change-address":je,"components-address-form":Ue,"components-select-address":qe},data(){return{addresses:[],address_needed:false,out_of_range:false,location_data:[],deliveryAddress:[],address_component:[]}},created(){this.addressNeeded()},methods:{addressNeeded(){axios({method:"POST",url:ajaxurl+"/addressNeeded",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+merchant_id+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.address_needed=e.data.details.address_needed}else{this.address_needed=false}})["catch"](e=>{}).then(e=>{})},show(){this.$refs.address.showModal()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{u("not guest");this.location_data=e}},onSavelocation(t,e){console.log("onSavelocation here1",t);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:t,location_name:e.location_name,delivery_instructions:e.delivery_instructions,delivery_options:e.delivery_options,address_label:e.address_label,formatted_address:e.formatted_address,address1:e.address1,address2:e.address2,postal_code:e.postal_code,company:e.company};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){i(StoreMapName,"selectedAddress",t);this.address_needed=false;this.$refs.address_form.close();this.refreshWidget()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},afterPointaddress(e){console.log("afterPointaddress",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.address_needed=false;this.refreshWidget();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},refreshWidget(){if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterSetAddress()}else{if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}}},afterChangeAddressOLD(e){this.location_data=e;this.visible=false;this.$refs.address.closeModal();if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}}}});bs.use(ElementPlus);const M=bs.mount("#vue-address-needed");const ws={template:"#xtemplate_webpushsettings",props:["ajax_url","settings","iterest_list","message"],data(){return{beams:undefined,is_loading:false,is_submitted:false,webpush_enabled:"",interest:[],device_id:""}},mounted(){this.initBeam()},methods:{initBeam(){this.beams=new PusherPushNotifications.Client({instanceId:this.settings.instance_id});this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getwebnotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.webpush_enabled=e.data.details.enabled==1?true:false;this.device_id=e.data.details.device_token;this.interest=e.data.details.interest}else{this.webpush_enabled=false;this.device_id="";this.interest=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},enabledWebPush(){this.is_loading=true;if(this.webpush_enabled){this.beams.start().then(()=>{u("start");this.beams.getDeviceId().then(e=>{this.device_id=e})})["catch"](e=>{f(this.message.notification_start,"error")}).then(e=>{this.is_loading=false})}else{this.beams.stop().then(()=>{u("stop");this.device_id=""})["catch"](e=>{f(this.message.notification_stop,"error")}).then(e=>{this.is_loading=false})}},saveWebNotifications(){this.is_submitted=true;axios({method:"PUT",url:this.ajax_url+"/savewebnotifications",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),webpush_enabled:this.webpush_enabled,interest:this.interest,device_id:this.device_id},timeout:c}).then(e=>{if(e.data.code==1){f(e.data.msg)}
2046else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{this.is_submitted=false})}}};const xs=Vue.createApp({components:{"components-web-pusher":ws}});const Ss=xs.mount("#vue-webpush-settings");const Ts=Vue.createApp({data(){return{is_loading:false,data:[],page:0,show_next_page:false}},mounted(){this.getData(this.page)},computed:{hasData(){if(this.data.length>0){return true}return false},isFirstLoad(){if(this.is_loading&&this.page<=0){return true}return false}},methods:{getData(e){this.is_loading=true;axios({method:"POST",url:ajaxurl+"/notificationList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data.push(e.data.details.data);this.show_next_page=e.data.details.show_next_page;this.page=e.data.details.page}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});Ts.use(ElementPlus);const ks=Ts.mount("#vue-notifications-list");const Is={props:["ajax_url","label","payment_type"],data(){return{data:[],is_loading:true,error_message:""}},mounted(){this.getPaymentList()},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{getPaymentList(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getPaymentList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_type="+this.payment_type,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.error_message=""}else{this.data=[];this.error_message=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})}},template:` 2047 <DIV class="position-relative"> 2048 <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center"> 2049 <div> 2050 <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 2051 </div> 2052 </div> 2053 2054 <h5 class="mb-3 mt-4">Add New Payment Method</h5> 2055 2056 <template v-if="!is_loading && hasData"> 2057 here 2058 <a v-for="items in data" @click="$emit('afterClickpayment',items.payment_code)" 2059 class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 2060 <div class="flexcol mr-2 payment-logo-wrap"> 2061 <i v-if="items.logo_type=='icon'" :class="items.logo_class"></i> 2062 <img v-else class="img-35" :src="items.logo_image" /> 2063 </div> 2064 <div class="flexcol"> 2065 <span class="mr-1">{{items.payment_name}}</span> 2066 </div> 2067 </a> 2068 </template> 2069 2070 <template v-if="!is_loading && !hasData"> 2071 <div class="alert alert-warning mb-2" role="alert"> 2072 <p class="m-0">{{error_message}}</p> 2073 </div> 2074 </template> 2075 2076 2077 </DIV> 2078 `};const Cs={props:["ajax_url","merchant_uuid"],data(){return{data:[],default_payment_uuid:"",is_loading:false,message:""}},computed:{hasData(){if(this.data.length>0){return true}return false}},mounted(){this.MerchantSavedPayment()},methods:{MerchantSavedPayment(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/MerchantSavedPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_uuid="+this.merchant_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.default_payment_uuid=e.data.details.default_payment_uuid;this.$emit("setDefaultpayment",e.data.details.default_payment)}else{this.data=[];this.message=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setDefaultPayment(e){axios({method:"POST",url:this.ajax_url+"/MerchantsetDefaultPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_uuid="+e.payment_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.MerchantSavedPayment()}else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{})},deleteSavedPaymentMethod(e){axios({method:"POST",url:this.ajax_url+"/MerchantDeleteSavedPaymentMethod",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_uuid="+e.payment_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.MerchantSavedPayment()}else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{})}},template:` 2079 <DIV class="position-relative"> 2080 2081 <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center"> 2082 <div> 2083 <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 2084 </div> 2085 </div> 2086 2087 <template v-if="hasData"> 2088 <h5 class="mb-3">Saved Payment Methods</h5> 2089 2090 <div v-for="saved_payment in data" class="row no-gutters align-items-center chevron-section medium rounded mb-2" :class="{ selected: saved_payment.as_default==1 }" > 2091 2092 <div class="col-md-8 d-flex align-items-center"> 2093 <div class="flexcol mr-2 payment-logo-wrap"> 2094 <i v-if="saved_payment.logo_type=='icon'" :class="saved_payment.logo_class"></i> 2095 <img v-else class="img-35" :src="saved_payment.logo_image" /> 2096 </div> <!--flex-col--> 2097 <div class="flexcol" >
2098 <span class=" mr-1">{{saved_payment.attr1}}</span> 2099 <p class="m-0 text-muted">{{saved_payment.attr2}}</p> 2100 </div> 2101 </div> <!--col--> 2102 <div class="col-md-4 d-flex align-items-center justify-content-end"> 2103 2104 <template v-if="saved_payment.as_default==1"> 2105 <div class="mr-1"><i class="zmdi zmdi-check text-success"></i></div> 2106 <div class="mr-3"><p class="m-0">Default</p></div> 2107 </template> 2108 2109 <div class="dropdown"> 2110 <a href="javascript:;" class="rounded-pill rounded-button-icon d-inline-block" 2111 id="dropdownMenuLink" data-toggle="dropdown" > 2112 <i class="zmdi zmdi-more" style="font-size: inherit;"></i> 2113 </a> 2114 <div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> 2115 <a v-if="saved_payment.as_default!=1" 2116 @click="setDefaultPayment(saved_payment)" 2117 class="dropdown-item a-12" href="javascript:;">Set Default</a> 2118 <a @click="deleteSavedPaymentMethod(saved_payment)" class="dropdown-item a-12" href="javascript:;"> 2119 Delete 2120 </a> 2121 </div> 2122 </div> <!--dropdown--> 2123 2124 </div> <!--col--> 2125 </div> <!--row--> 2126 </template> 2127 </DIV> 2128 `};const Os={props:["ajax_url","amount","label","default_payment","merchant_uuid"],data(){return{data:[],is_loading:false}},computed:{ValidAmount(){if(this.amount<=0){return true}if(empty(this.default_payment.payment_uuid)){return true}return false}},mounted(){u(this.amount)},methods:{DoCashin(){bootbox.confirm({size:"small",title:this.label.confirm,message:this.label.are_you_sure,centerVertical:true,animate:false,buttons:{cancel:{label:this.label.cancel,className:"btn btn-black small pl-4 pr-4"},confirm:{label:this.label.yes,className:"btn btn-green small pl-4 pr-4"}},callback:e=>{if(e){var t={payment_uuid:this.default_payment.payment_uuid,payment_code:this.default_payment.payment_code,merchant_uuid:this.merchant_uuid,amount:this.amount};try{Es.$refs[this.default_payment.payment_code].DoPaymentRender(t,"PaymentIntentCashin")}catch(a){f(a.message,"error")}}}})}},template:` 2129 <button class="btn btn-green w-100 pointer mt-3" 2130 :disabled="ValidAmount" 2131 @click="DoCashin" 2132 > 2133 <span class="label">{{label.continue}}</span> 2134 <div class="m-auto circle-loader" data-loader="circle-side"></div> 2135 </button> 2136 `};const js=Vue.createApp({data(){return{data:[],default_payment:""}},mounted(){u(this.amount_cashin)},methods:{afterClickpayment(e){try{this.$refs[e].showPaymentForm()}catch(t){f(t.message,"error")}},SavedPaymentList(){this.$refs.merchant_saved_payment.MerchantSavedPayment()},setDefaultpayment(e){this.default_payment=e},showLoadingBox(e){if(!empty(e)){Be.$refs.box.setMessage(e)}Be.$refs.box.show()},closeLoadingBox(){Be.$refs.box.close()},Alert(e){f(e,"error")}}});js.component("components-payment-list",Is);js.component("components-merchant-saved-payment",Cs);js.component("components-cashin-payment",Os);if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){js.component(e,t)})}const Es=js.mount("#vue-cashin");const Ps=Vue.createApp({components:{"component-carousel":We}}).mount("#vue-carousel");const Fs={props:["data","index_selected"],data(){return{owl:undefined}},mounted(){setTimeout(()=>{this.renderCarousel()},1)},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.menu).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})}},template:` 2137 <div ref="menu" class="owl-carousel owl-theme menu-carousel"> 2138 <div v-for="(item, index) in data" class="mr-2"> 2139 <a :href="item.url" class="d-block" 2140 :class="{active : index==index_selected }" 2141 > 2142 {{item.label}} 2143 </a> 2144 </div> 2145 </div> 2146 `};const Ns=Vue.createApp({components:{"component-profile-menu":Fs}}).mount("#vue-profile-menu");const Rs=Vue.createApp({data(){return{recaptcha_response:""}},components:{"components-recapcha":Ne},methods:{recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.$refs.vueRecaptcha.is_enabled){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}}).mount("#vue-captcha");const Ds=Vue.createApp({components:{"component-phone":e,"vue-rec
2146aptcha":Ne},data(){return{loading:false,ready:false,show_password:false,agree_terms:false,password_type:"password",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false}},mounted(){u("mounted");this.redirect=redirect_to;this.next_url=next_url;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}},updated(){this.validate()},methods:{uploadCustomFieldFile(e,t,a){const i=e.target.files[0];if(!i)return;let s=new FormData;s.append("YII_CSRF_TOKEN",p("meta[name=YII_CSRF_TOKEN]").attr("content"));s.append("file",i);s.append("field_type",a);axios.post(ajaxurl+"/uploadCustomFieldFile",s,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{if(e.data.code==1){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};this.custom_fields[t]=Object.assign({},a,e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}}).catch(e=>{})},setCustomFieldExpiration(e,t){let a=this.custom_fields[t]&&typeof this.custom_fields[t]=="object"?this.custom_fields[t]:{};a.expires_at=e.target.value;this.custom_fields[t]=a},validate(){if(!empty(this.firstname)&&!empty(this.lastname)&&!empty(this.mobile_number)){this.ready=true}else this.ready=false},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,password:this.password,cpassword:this.cpassword,redirect:this.redirect,recaptcha_response:this.recaptcha_response};n[t]=p.ajax({url:ajaxurl+"/registerGuestUser",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}});Ds.use(Maska);const Ms=Ds.mount("#vue-guest-register");const As=Vue.createApp({components:{"components-maps":Le,"components-select-address":qe,"components-saveaddress":Ve},data(){return{loading:false,loading_save:false,data:[],address1:"",location_name:"",delivery_options:"Leave it at my door",delivery_instructions:"",address_label:"Home",markers:[],address_data:[],address_found:false,address_uuid:"",isEdit:false,isAdd:false,formatted_address:"",save_address_data:[],default_address:[],count_address:0,address_needed:true,address_label_list:[],address2:"",postal_code:"",company:"",custom_field1:"",custom_field2:"",formattedAddress:""}},created(){this.addressNeeded()},computed:{hasDeliveryAddress(){if(Object.keys(this.address_data).length>0){return true}return false},deliveryAddress(){return this.address_data},hasSavedAddress(){return this.address_found},hasAddressList(){return this.count_address>0?true:false},isAddressNeeded(){return this.address_needed},getAddressLabel(){return this.address_label_list}},watch:{address_data(e,t){this.setMarker(e.latitude,e.longitude)}},methods:{addressNeeded(){this.loading=true;axios({method:"POST",url:ajaxurl+"/checkoutAddressNeeded",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+merchant_id+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.address_needed=e.data.details.address_needed;this.getAddress()}else{this.address_needed=false}})["catch"](e=>{}).then(e=>{this.loading=false})},setMarker(e,t){this.markers=[{id:0,lat:parseFloat(e),lng:parseFloat(t),draggable:false}]},afterClosemodal(e){console.debug("afterClosemodal xx",e);if(e=="yandex"){if(T){T.destroy();T=null}this.$refs.maps.renderMap()}},getAddress(){this.loading=true;
2146axios({method:"POST",url:ajaxurl+"/getAddressDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details;this.address_found=e.data.details.address_found;this.address_data=e.data.details.data;this.default_address=this.address_data;this.save_address_data=this.address_data;this.address_uuid=e.data.details.data.address_uuid;this.count_address=e.data.details.count_address;this.address_label_list=e.data.details.address_label;this.formattedAddress=this.address_data?.address?.formattedAddress??this.address_data?.address?.formatted_address}else{this.data=e.data.details;this.address_data=e.data.details.data;this.default_address=this.address_data;this.save_address_data="";this.formatted_address=this.address_data?.parsed_address?.street_name;this.address1=this.address_data?.parsed_address?.street_number;this.formattedAddress=this.address_data?.parsed_address?.formatted_address??this.formatted_address;this.address_found=e.data.details.address_found;this.count_address=e.data.details.count_address;this.address_label_list=e.data.details.address_label}if(Object.keys(this.data).length>0){if(!empty(this.data.custom_field1_data)){this.custom_field1=Object.keys(this.data.custom_field1_data)[0]}}})["catch"](e=>{}).then(e=>{this.loading=false})},saveAddress(){this.loading_save=true;axios({method:"PUT",url:ajaxurl+"/SaveAddress",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:this.address_uuid,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,latitude:this.address_data.latitude,longitude:this.address_data.longitude,address1:this.address1,formatted_address:this.formatted_address,formattedAddress:this.formattedAddress,set_place_id:this.address_data.place_id,data:this.address_data,address2:this.address2,postal_code:this.postal_code,company:this.company,custom_field1:this.custom_field1,custom_field2:this.custom_field2},timeout:c}).then(e=>{if(e.data.code==1){if(T){T.destroy();T=null}ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});if(typeof redirect_to!=="undefined"&&redirect_to!==null){window.location.href=redirect_to}else{this.isEdit=false;this.isAdd=false;this.getAddress();this.$refs.save_address.getSavedAddress();if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}}}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading_save=false})},showSelectAddress(){u("showSelectAddress");this.$refs.address_modal.setInitialMarker();this.$refs.address_modal.visible=true},afterChangeaddress(e){console.debug("afterChangeaddress xx1",e);if(T){T.destroy();T=null}this.address_data=e;this.formatted_address=this.address_data?.parsed_address?.street_name??"";this.address1=this.address_data?.parsed_address?.street_number??"";this.formattedAddress=this.address_data?.parsed_address?.formatted_address??"";this.$refs.address_modal.visible=false},editSaveAddress(){this.isEdit=true;this.address_data=this.save_address_data;this.address_uuid=this.save_address_data.address_uuid;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.location_name=this.address_data.attributes.location_name;this.delivery_options=this.address_data.attributes.delivery_options;this.delivery_instructions=this.address_data.attributes.delivery_instructions;this.address_label=this.address_data.attributes.address_label;this.address2=this.address_data.address.address2;this.postal_code=this.address_data.address.postal_code;this.company=this.address_data.address.company;this.custom_field1=this.address_data.attributes.custom_field1;this.custom_field2=this.address_data.attributes.custom_field2},CancelEdit(){if(T){T.destroy();T=null}this.isEdit=false;this.address_data=this.default_address;this.formatted_address="";this.address1="";this.location_name="";this.delivery_options="";this.delivery_instructions="";this.address_label="";this.address2="";this.postal_code="";this.company=""},AddNewAddress(){this.isAdd=true;this.address_data=this.default_address;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.address_uuid="";this.location_name="";this.delivery_instructions="";this.address2="";this.postal_code="";this.company=""},CanceAdd(){console.log("CanceAdd");this.isAdd=false;this.address_data=this.default_address},afterSelectaddress(e){this.setPlaceID(e.place_id);this.address_found=true;this.save_address_data=e;this.address_data=this.save_address_data;this.address_uuid=this.save_address_data.address_uuid;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.location_name=this.address_data.attributes.location_name;this.delivery_options=this.address_data.attributes.delivery_options;this.delivery_instructions=this.address_data.attributes.delivery_instructions;this.address_label=this.address_data.attributes.address_label},setPlaceID(e){axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e,timeout:c}).then(e=>
2146{if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}})["catch"](e=>{}).then(e=>{})},confirmDelete(e){let t=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(t.confirm_delete_address,t["delete"],{confirmButtonText:t.delete_adress,cancelButtonText:t.cancel,type:"info"}).then(()=>{this.deleteAddress(e)})["catch"](()=>{})},deleteAddress(e){axios({method:"POST",url:ajaxurl+"/deleteAddress",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&address_uuid="+e,timeout:c}).then(e=>{this.getAddress();this.$refs.save_address.getSavedAddress()})["catch"](e=>{}).then(e=>{})}}});As.use(ElementPlus);const $s=As.mount("#vm_delivery_details");const Ys=Vue.createApp({components:{"component-auto-complete":ze,"components-select-address":qe,"components-address-form":Ue},data(){return{deliveryAddress:[],location_data:[]}},methods:{afterChoose(e){console.log("afterChoosexx",e);const t=e?.provider??null;console.log("provider",t);let a=e.id;if(t=="mapbox"){a=`${e?.longitude},${e?.latitude}`}this.$refs.auto_complete.setLoading(true);axios({method:"POST",url:ajaxurl+"/getLocationDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&id="+a+"&saveplace=0"+"&description="+e.description,timeout:c}).then(e=>{if(e.data.code==1){this.$refs.auto_complete.setAddressData(e.data.details.data)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.$refs.auto_complete.setLoading(false)})},afterFormclose(){u("afterFormclose");this.location_data=[]},afterGetcurrentlocation(e){console.log("afterGetcurrentlocation",e);console.log("isGuest=>"+isGuest);if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{this.afterPointaddress(e)}},afterPointaddress(e){this.$refs.address_modal.setLoading(true);i(StoreMapName,"selectedAddress",e);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{window.location.href=next_url})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},onSavelocation(e,t){console.log("onSavelocation",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,latitude:e.latitude,longitude:e.longitude,formatted_address:t.formatted_address,address1:t.address1,address2:t.address2,postal_code:t.postal_code,company:t.company,address_format_use:t.address_format_use,custom_field1:t.custom_field1,custom_field2:t.custom_field2};axios({method:"PUT",url:ajaxurl+"/SaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=next_url}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})}}});Ys.use(ElementPlus);const Ks=Ys.mount("#vm_home_search");const Ls=Vue.createApp({components:{"component-notification-cart":Ma},methods:{afterReceiveitemupdate(e){axios({method:"POST",url:ajaxurl+"/validateCartItems",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&item_id="+e.item_id,timeout:c}).then(t=>{if(t.data.code==1){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.alert(t.data.msg,"",{confirmButtonText:e.ok,callback:e=>{if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof ys!=="undefined"&&ys!==null){ys.$refs.ref_item_suggestion.itemSuggestion()}}})}})["catch"](e=>{}).then(e=>{})}}});Ls.use(ElementPlus);const zs=Ls.mount("#vue-notification-cart");const qs={props:["resend_counter","uuid","label"],data(){return{loading:false,counter:0,timer:undefined}},created(){this.startTimer()},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.counter=this.resend_counter;this.stopTimer();this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},resendCode(){this.loading=true;axios({method:"POST",url:ajaxurl+"/ResendRiderverificationcode",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&uuid="+this.uuid,timeout:c}).then(e=>{if(e.data.code==1){this.startTimer();ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:` 2147 <div class="d-flex justify-content-between align-items-center"> 2148 <div><b>{{label.resend_code}} {{ counter }}</b></div> 2149 <div> 2150 <el-button type="text" 2151 :loading="loading" 2152 :disabled="counter != 0" 2153 @click="resendCode" 2154 > 2155 {{label.resend}} 2156 </el-button> 2157 </div> 2158 </div> 2159 `};const Vs=Vue.createApp({components:{"component-phone":e,"component-rider-verifycode":qs},data(){return{loading:false,mobile_number:"",mobile_prefix:"",first_name:"",last_name:"",email:"",address:"",password:"",cpassword:"",show_password:false,password_type:"password"}},computed:{validForm(){if(empty(this.first_name)){return false}if(empty(this.last_name)){return false}if(empty(this.email)){return false}if(empty(this.password)){return false}if(empty(this.cpassword)){return false}if(empty(this.address)){return false}return true}},methods:{onRegister(){this.loading=true;let e="&mobile_prefix="+this.mobile_prefix;e+="&mobile_number="+this.mobile_number;e+="&first_name="+this.first_name;e+="&last_name="+this.last_name;e+="&email="+this.email;e+="&address="+this.address;e+="&password="+this.password;e+="&cpassword="+this.cpassword;axios({method:"POST",url:ajaxurl+"/riderRegistration",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e,timeout:c}).then(e=>{if(e.data.code==1){this.loading=true;ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"}}});Vs.use(Maska);Vs.use(ElementPlus);const Us=Vs.mount("#vue-rider-registration");const Bs={data(){return{total:0,total_animated:0,loading:true}},watch:{total(e){gsap.to(this.$data,{duration:.6,total_animated:e})}},computed:{animatedTotal(){return this.total_animated.toFixed(0)}},mounted(){this.getAvailablePoints()},methods:{getAvailablePoints(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAvailablePoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{this.total=e.data.details.total})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`{{animatedTotal}}`};const Js=Vue.createApp({components:{"component-available-points":Bs},data(){return{loading:false,data:[],has_data:false,show_next:false,tab:"transaction",loading1:false,data1:[],show_next1:false,page:1,page2:1,loading_next:false,loading_next1:false}},created(){this.getPointsTransaction(false)},mounted(){this.getPointsTransactionMerchant(false)},computed:{hasData(){return this.has_data},getData(){return this.data},showNext(){return this.show_next},getData1(){return this.data1},showNext1(){return this.show_next1}},methods:{getPointsTransaction(e){this.has_data=false;if(e){this.loading_next=true}else this.loading=true;axios({method:"POST",url:ajaxurl+"/getPointsTransaction",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page,timeout:c}).then(e=>{this.data.push(e.data.details.data);this.has_data=true;this.show_next=e.data.details.show_next_page;this.page=e.data.details.page})["catch"](e=>{}).then(e=>{this.loading=false;this.loading_next=false})},getPointsTransactionMerchant(e){if(e){this.loading_next1=true}else this.loading1=true;axios({method:"POST",url:ajaxurl+"/getPointsTransactionMerchant",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page2,timeout:c}).then(e=>{this.data1.push(e.data.details.data);this.show_next1=e.data.details.show_next_page;this.page2=e.data.details.page})["catch"](e=>{}).then(e=>{this.loading1=false;this.loading_next1=false})},nextPage(e){this.getPointsTransaction(true)},nextPage2(e){this.getPointsTransactionMerchant(true)}}});Js.use(ElementPlus);const Gs=Js.mount("#vue-my-points");const Ws=e=>e===100?"Full":`${e}%`;const Zs={props:["title","is_mobile","apply_text","enter_points","data","use_thresholds"],data(){return{points:0,is_submit:false,points_tab:undefined,data_points:[],balance:0,points_id:0,loading:false}},computed:{hasData(){if(this.points>0){return false}return true}},watch:{points_tab(e,t){u(this.balance+"=>"+e.points);if(this.balance>e.points){this.points=e.points;this.points_id=e.id}else{this.points=0;this.points_id=0}}},created(){},methods:{showModal(e){if(e){p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}if(this.use_thresholds&&e){this.getPointsthresholds()}},applyPoints(){this.is_submit=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/applyPoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&points="+this.points+"&cart_uuid="+getCookie("cart_uuid")+"¤cy_code="+e+"&points_id="+this.points_id,timeout:c}).then(e=>{if(e.data.code==1){this.showModal(false);this.$emit("afterApplypoints")}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.is_submit=false})},getPointsthresholds(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getPointsthresholds",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"¤cy_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data_points=e.data.details.data;this.balance=e.data.details.balance}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:` 2160 <div class="modal" ref="modal" tabindex="-1" role="dialog" 2161 aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" > 2162 <div class="modal-dialog" role="document"> 2163 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 2164 2165 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 2166 <h5 class="modal-title" id="exampleModalLongTitle"> 2167 {{title}} 2168 </h5> 2169 <div class="close"> 2170 <a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 2171 </div>
2172 </div> 2173 2174 <div class="modal-body"> 2175 2176 <form class="forms mt-2 apply-points-form" @submit.prevent="applyCode" > 2177 2178 2179 <template v-if="use_thresholds"> 2180 2181 <div v-loading="loading"> 2182 2183 <el-tabs 2184 v-model="points_tab" 2185 stretch 2186 > 2187 <template v-for="items in data_points" :keys="items"> 2188 <el-tab-pane label="User" :name="items" > 2189 <template #label> 2190 <Div v-if="balance < items.points" class="disabled-class"></Div> 2191 <span class="custom-tabs-label"> 2192 <div class="font13 font-weight-light">{{ items.label }}</div> 2193 <div class="font-weight-bold font20">{{ items.amount }}</div> 2194 <div> 2195 <el-progress 2196 :text-inside="true" 2197 :stroke-width="20" 2198 :percentage=" ((balance / items.points)*100)>100?100: (balance / items.points)*100 " 2199 :status="balance >= items.points ? 'success' : 'primary'" 2200 > 2201 <span> 2202 <template v-if="balance >= items.points"> 2203 REDEEM 2204 </template> 2205 </span> 2206 </el-progress> 2207 </div> 2208 </span> 2209 </template> 2210 </el-tab-pane> 2211 </template> 2212 </el-tabs> 2213 2214 </div> 2215 2216 </template> 2217 <template v-else> 2218 <div class="form-label-group"> 2219 <input v-model="points" class="form-control form-control-text" placeholder="" 2220 id="points" type="text" maxlength="20" > 2221 <label for="points" class="required">{{enter_points}}</label> 2222 </div> 2223 </template> 2224 2225 </form> <!--forms--> 2226 2227 </div> <!--modal body--> 2228 2229 <div class="modal-footer"> 2230 <button type="button" class="btn btn-black pl-4 pr-4" @click="showModal(false)" >Cancel</button> 2231 <button type="button" class="btn btn btn-green pl-4 pr-4" 2232 @click="applyPoints" :class="{ loading: is_submit }" :disabled="hasData" 2233 > 2234 <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div> 2235 </button> 2236 </div> 2237 2238 </div> <!--content--> 2239 </div> <!--dialog--> 2240 </div> <!--modal--> 2241 `};const Hs=Vue.createApp({components:{"components-apply-points":Zs},data(){return{loading:true,loading_remove:false,data:[]}},created(){this.getAvailablePoints()},methods:{getAvailablePoints(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getCartpoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"¤cy_code="+e,timeout:c}).then(e=>{this.data=e.data.details})["catch"](e=>{}).then(e=>{this.loading=false})},showApplyPoints(){this.$refs.apply_points.showModal(true)},afterApplypoints(){if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.getAvailablePoints()},removePoints(){this.loading_remove=true;axios({method:"POST",url:ajaxurl+"/removePoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.getAvailablePoints()})["catch"](e=>{}).then(e=>{this.loading_remove=false})}}});Hs.use(ElementPlus);const Qs=Hs.mount("#vue-checkout-points");const Xs={props:["label"],data(){return{q:"",data:[]}},computed:{hasSearch(){if(this.q==""){return false}return true}},methods:{async querySearch(e,t){axios({method:"POST",url:ajaxurl+"/SearchSuggestion",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){t(e.data.details)}else{t([])}})["catch"](e=>{t([])}).then(e=>{})},handleSelect(e){this.$emit("afterSuggestion",e.name)}},template:` 2242 <el-autocomplete 2243 v-model="q" 2244 :fetch-suggestions="querySearch" 2245 @select="handleSelect" 2246 @input="$emit('afterSuggestion',$event)" 2247 :placeholder="label.search" 2248 :trigger-on-focus="false" 2249 :fit-input-width="false" 2250 class="w-100" 2251 size="large" 2252 value-key="name" 2253 :clearable="true" 2254 :select-when-unmatched="false" 2255 :highlight-first-item="true" 2256 > 2257 <template #default="{ item }"> 2258 <div class="value" v-html="item.name"></div> 2259 </template> 2260 </el-autocomplete> 2261 `};const ei={props:["data","items_not_available","category_not_available"],template:"#xtemplate_item_list",methods:{viewItem(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false}}};const ti={props:["q"],components:{"components-item-list":ei},data(){return{tabs:"searchFood",search_timer:null,loading:false,food_list:[],merchant_list:[],total_food:0,merchant_data:[],total_merchant:0,cuisine:[],items_not_available:[],category_not_available:[]}},watch:{q(e,t){clearTimeout(this.search_timer);if(empty(e)){this.clearData();this.$emit("setSearch",false);return}this.search_timer=setTimeout(()=>this.doSearch(e,this.tabs),250)}}
2261,computed:{hasDataFood(){if(Object.keys(this.food_list).length>0){return true}return false},getFood(){return this.food_list},getFoodCount(){return this.total_food},hasQ(){return!empty(this.q)?true:false},hasMerchant(){if(Object.keys(this.merchant_data).length>0){return true}return false},getMerchant(){return this.merchant_data},getMerchantCount(){return this.total_merchant}},methods:{tabClick(e,t){this.doSearch(this.q,e.paneName)},doSearch(e,t){let a=getCookie("currency_code");a=!empty(a)?a:"";this.loading=true;axios({method:"POST",url:ajaxurl+"/"+t,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+encodeURIComponent(e)+"¤cy_code="+a,timeout:c}).then(e=>{if(e.data.code==1){if(t=="searchFood"){this.food_list=e.data.details.food_list;this.merchant_list=e.data.details.merchant_list;this.total_food=e.data.details.total;this.items_not_available=e.data.details.items_not_available;this.category_not_available=e.data.details.category_not_available}else{this.merchant_data=e.data.details.merchant_data;this.cuisine=e.data.details.cuisine;this.total_merchant=e.data.details.total}this.$emit("setSearch",true)}else{this.clearData()}})["catch"](e=>{this.clearData()}).then(e=>{this.loading=false})},clearData(){this.food_list=[];this.merchant_list=[];this.total_food=0;this.merchant_data=[];this.total_merchant=0;this.cuisine=[];this.items_not_available=[];this.category_not_available=[]},handleView(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})}},template:"#xtemplate_search_food_result"};const ai={template:"#xtemplate_item_details",components:{"money-format":Ye},data(){return{merchant_id:0,menu_loading:true,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qty:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",view_data:[],item_loading:false,item_in_cart:0,merchant_data:[],items_not_available:[],category_not_available:[],menu_layout:"list",q:"",search_menu_data:[],allergen:[],allergen_data:[],item_gallery:[],image_featured:"",title:"",new_order_label:"",money_config:[]}},mounted(){let e=JSON.parse(some_words);if(Object.keys(e).length>0){this.title=e.created_new_order+"?";this.new_order_label=e.new_order_label}},updated(){if(this.item_addons_load==true){this.ItemSummary()}},computed:{getAllergen(){return this.allergen},hasAllergen(){if(Object.keys(this.allergen).length>0){return true}return false},getItemGallery(){return this.item_gallery}},methods:{getMenuItem(e){let t=getCookie("currency_code");t=!empty(t)?t:"";let a="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+e.merchant_id;a+="&cat_id="+e.cat_id;a+="&item_uuid="+e.item_uuid;a+="¤cy_code="+t;this.item_loading=true;NProgress.start();axios({method:"POST",url:ajaxurl+"/getMenuItem",data:a,timeout:c}).then(e=>{if(e.data.code==1){p("#itemModal").modal("show");C=e.data.details.data.items;O=e.data.details.data.addons;j=e.data.details.data.addon_items;$t=e.data.details.data.items.item_addons;var t=e.data.details.data.meta;this.money_config=e.data.details.money_config;this.item_gallery=e.data.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var i=e.data.details.data.meta_details;var o={cooking_ref:[],ingredients:[],dish:[]};let s=e.data.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(i[a])){if(!empty(i[a][t])){let e=false;if(a=="ingredients"&&s){e=true}o[a].push({meta_id:i[a][t].meta_id,meta_name:i[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=o;this.getSizeData(r);this.sold_out_options=e.data.details.sold_out_options}else{p("#itemModal").modal("hide")}})["catch"](e=>{}).then(e=>{this.item_loading=false;NProgress.done()})},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;
2261this.getSizeData(t)},getSizeData(a){Yt=[];var s=[];if(!empty($t[a])){p.each($t[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){if(typeof j[t]!=="undefined"&&j[t]!==null){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})}});Yt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Yt;this.item_addons_load=true},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({loop:false,margin:10,nav:false,dots:false,rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}var o=[];var r=[];a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},CheckaddCartItems(){if(typeof R!=="undefined"&&R!==null){let e=R.$refs.childref.cart_merchant.merchant_id;if(typeof e!=="undefined"&&e!==null){if(this.items.merchant_id!=R.$refs.childref.cart_merchant.merchant_id){p("#itemModal").modal("hide");ElementPlus.ElMessageBox.confirm(R.$refs.childref.cart_merchant.confirm_add_item,this.title,{confirmButtonText:this.new_order_label,showCancelButton:false,type:"info",buttonSize:"large"}).then(()=>{this.clearCart(R.$refs.childref.cart_uuid)})["catch"](()=>{})}else this.addCartItems()}else this.addCartItems()}else this.addCartItems()},clearCart(e){NProgress.start();axios({method:"POST",url:ajaxurl+"/clearCart",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+e,timeout:c}).then(e=>{if(e.data.code==1){this.addCartItems()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{NProgress.done()})},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:(parseInt(this.item_qty)>0?parseInt(this.item_qty):1),item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:"delivery",if_sold_out:this.if_sold_out};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>
2261{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);p("#itemModal").modal("hide");if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}});n[a].always(e=>{u("always");this.add_to_cart=false})}}};const si={props:["meta_name","sub_title"],components:{"components-item-list":ei},data(){return{loading:false,food_list:[],merchant_list:[],items_not_available:[],category_not_available:[],title:""}},created(){this.getFoodList()},computed:{hasDataFood(){if(Object.keys(this.food_list).length>0){return true}return false},getFood(){return this.food_list}},methods:{getFoodList(){let e=getCookie("currency_code");e=!empty(e)?e:"";this.loading=true;axios({method:"POST",url:ajaxurl+"/getFoodList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&meta_name="+this.meta_name+"¤cy_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.title=e.data.details.title;this.food_list=e.data.details.food_list;this.merchant_list=e.data.details.merchant_list;this.total_food=e.data.details.total;this.items_not_available=e.data.details.items_not_available;this.category_not_available=e.data.details.category_not_available;this.renderSlide()}})["catch"](e=>{}).then(e=>{this.loading=false})},renderSlide(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_slide).owlCarousel({loop:false,margin:10,nav:true,dots:false,navText:[p(this.$refs.owl_next),p(this.$refs.owl_previous)],rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},viewItem(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false}},template:"#xtemplate_food_carousel"};const ii=Vue.createApp({data(){return{searchString:"",isSearch:false}},components:{"components-search-food":Xs,"components-search-food-result":ti,"components-item-details":ai,"components-food-list":si},computed:{getisSearch(){return this.isSearch}},methods:{afterSuggestion(e){this.searchString=e},handleView(e){this.$refs.item_details.getMenuItem(e)},setSearch(e){this.isSearch=e}}});ii.use(ElementPlus);const oi=ii.mount("#vue-search");const ri=Vue.createApp({data(){return{loading:false,room_list:[],table_list:[],room_uuid:"",table_uuid:"",transaction_type:"",guest_number:1,booking_enabled:false}},created(){this.getTableAttributes()},methods:{getTableAttributes(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getTableAttributes",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.room_list=e.data.details.room_list;this.table_list=e.data.details.table_list;this.booking_enabled=e.data.details.booking_enabled;if(e.data.details.default_room_uuid){this.room_uuid=e.data.details.default_room_uuid}}})["catch"](e=>{}).then(e=>{this.loading=false})},clearTableList(){this.table_uuid=""}}});ri.use(ElementPlus);const di=ri.mount("#vue-checkout-booking");const li={data(){return{total:0,total_animated:0,loading:true}},watch:{total(e){gsap.to(this.$data,{duration:.6,total_animated:e})}},computed:{animatedTotal(){return this.total_animated}},mounted(){this.getBalance()},methods:{getBalance(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getWalletBalance",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{this.total=e.data.details.total})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`{{animatedTotal}}`};const ni={props:["data","has_data","loading","show_next"],template:"#xtemplate_wallet_transaction"};const ci={props:["label","topup_minimum","topup_maximum"],data(){return{modal:false,amount:1,loading:false,default_payment:[],loading_submit:false,loading_payment:false}},created(){this.getCustomerDefaultPayment()},computed:{getPayment(){return this.default_payment}},methods:{show(){this.modal=true},close(){this.modal=false},getCustomerDefaultPayment(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getCustomerDefaultPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.default_payment=e.data.details.data}})["catch"](e=>{}).then(e=>{this.loading=false})},onAddfunds(){this.loading_submit=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/prepareAddFunds",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&amount="+this.amount+"&payment_code="+this.default_payment.payment_code+"&payment_uuid="+this.default_payment.payment_uuid+"¤cy_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.$emit("afterPreparepayment",e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading_submit=false})}},template:"#xtemplate_topupform"};const mi={props:["data"],data(){return{modal:false}},template:"#xtemplate_succesful_modal"};const ui={props:["transaction_type"],data(){return{owl:undefined,data:[],loading:false}},mounted(){this.bonusFunds()},computed:{hasData(){if(Object.keys(this.data).length>0){return true}return false}},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{bonusFunds(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getDiscount",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+this.transaction_type,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.carousel_bonusfunds).owlCarousel({loop:true,dots:false,nav:false,autoWidth:true,rtl:e})}},template:` 2262 <div ref="carousel_bonusfunds" class="owl-carousel owl-theme carousel_bonusfunds"> 2263 <div v-for="(items, index) in data" class="mr-2"> 2264 <el-card shadow="hover" class="gradient-yellow-bg" style="max-width:350px;"> 2265 <h6>{{items.title}}</h6> 2266 <div class="mb-1">{{items.discount_details}}</div> 2267 <div class="font-weight-bold">
2267{{items.valid_discount}}</div> 2268 </el-card> 2269 </div> 2270 </div> 2271 `};const hi=Vue.createApp({components:{"component-wallet-balance":li,"components-wallet-transaction":ni,"components-topup-form":ci,"components-succesful-modal":mi,"component-bonusfunds":ui},created(){this.getWalletTransaction()},data(){return{loading:false,tab:"all",data:[],page:1,show_next:false,loading:false,loading_next:false,payment_data:[]}},computed:{hasData(){if(Object.keys(this.data).length>0){return true}return false},getData(){return this.data},showNext(){return this.show_next}},methods:{showFundsForm(){this.$refs.topup.show()},tabChange(){this.data=[];this.page=1;this.getWalletTransaction(false)},nextPage(e){this.getWalletTransaction(true)},showLoadingBox(e){this.$refs.topup.loading_payment=true},closeLoadingBox(){this.$refs.topup.loading_payment=false},closeTopup(){this.$refs.topup.close()},getWalletTransaction(e){if(e){this.loading_next=true}else this.loading=true;axios({method:"POST",url:ajaxurl+"/getWalletTransaction",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page+"&transaction_type="+this.tab,timeout:c}).then(e=>{if(e.data.code==1){this.data.push(e.data.details.data);this.show_next=e.data.details.show_next_page;this.page=e.data.details.page}else{this.show_next=false}})["catch"](e=>{}).then(e=>{this.loading=false;this.loading_next=false})},afterPreparepayment(e){try{this.$refs[e.payment_code].Dopayment(e.data,e)}catch(t){ElementPlus.ElNotification({title:"",message:t,position:"bottom-right",type:"warning"})}},AfterCancelPayment(e){if(!empty(e)){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}},afterSuccessfulpayment(e){this.payment_data=e;this.$refs.topup.close();if(typeof this.$refs.wallet_balance!=="undefined"&&this.$refs.wallet_balance!==null){this.$refs.wallet_balance.getBalance()}if(typeof this.$refs.wallet_balance_mobile!=="undefined"&&this.$refs.wallet_balance_mobile!==null){this.$refs.wallet_balance_mobile.getBalance()}this.$refs.succesful_modal.modal=true;if(this.tab!="all"){this.tab="all"}else{this.tabChange()}}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){hi.component(e,t)})}hi.use(ElementPlus);hi.use(Maska);const _i=hi.mount("#vue-my-wallet");const pi=Vue.createApp({data(){return{email_address:"",loading:false}},methods:{submit(){this.loading=true;axios({method:"POST",url:ajaxurl+"/subscribetoemail",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&email_address="+this.email_address,timeout:c}).then(e=>{if(e.data.code==1){this.email_address="";ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}});pi.use(ElementPlus);const fi=pi.mount("#vue-esubscription");const gi=Vue.createApp({data(){return{loading:false,imageUrl:null,upload_url:site_url+"/api/updateprofilephoto",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")}}},mounted(){if(typeof profileAvatar!=="undefined"&&profileAvatar!==null){this.imageUrl=profileAvatar}},methods:{beforeAvatarUpload(e){this.loading=true},handleAvatarSuccess(e){this.loading=false;if(e.code==1){this.imageUrl=e.details.url_image;ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}}}});gi.use(ElementPlus);const vi=gi.mount("#upload-profile");p(document).ready(function(){let t=JSON.parse(some_words);p(".read-more").on("click",function(){var e=p(this).prev(".description");if(e.hasClass("expanded")){e.removeClass("expanded");p(this).text(t.read_more)}else{e.addClass("expanded");p(this).text(t.read_less)}})});const yi=Vue.createApp({data(){return{amount:null,loading:false,loading_payment:false,loading_addfunds:false,data:null,modal_addfunds:false,payment_data:null,translation:null,is_redirect:false,cart_total:0,payment_processsing:false}},mounted(){this.translation=JSON.parse(some_words)},computed:{hasPayment(){return Object.keys(this.payment_data?.data).length>0},getPayment(){return this.payment_data?.data}},methods:{onInputNumber(e){this.amount=e.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1")},async fetchWallet(a){try{this.cart_total=a;this.loading=true;let e=getCookie("cart_uuid");let t=getCookie("currency_code");const s=new URLSearchParams({cart_total:a,cart_uuid:e,currency_code:t}).toString();const i=await axios.get(`${ajaxurl}/fetchWallet?${s}`);if(i.data.code==1){this.data=i.data.details}else{this.data=null}}catch(e){}finally{this.loading=false}},async fetchPayment(){this.amount=null;this.payment_processsing=false;if(this.payment_data){return}try{this.loading_payment=true;const t=await axios.get(`${ajaxurl}/getCustomerDefaultPayment`);this.payment_data=t.data.details}catch(e){}finally{this.loading_payment=false}},async ConfirmTopup(){if(!this.amount||this.amount<=0){ElementPlus.ElNotification({title:"",message:this.translation.amount_required,position:"bottom-right",type:"warning"});return}if(!this.hasPayment){ElementPlus.ElNotification({title:"",message:this.translation.select_payment_method,position:"bottom-right",type:"warning"});return}try{this.loading_addfunds=true;let e=getCookie("currency_code");e=!empty(e)?e:"";const t=this.getPayment;const a=new URLSearchParams({YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),is_checkout:true,amount:this.amount,currency_code:e,payment_code:t?.payment_code,payment_uuid:t?.payment_uuid}).toString();const s=await axios.post(`${ajaxurl}/prepareAddFunds`,a);if(s.data.code==1){this.afterPreparepayment(s.data.details)}else{ElementPlus.ElNotification({title:"",message:s.data.msg,position:"bottom-right",type:"warning"})}}catch(e){}finally{this.loading_addfunds=false}},afterPreparepayment(e){try{console.debug("afterPreparepayment",e.payment_instructions?.redirect);this.is_redirect=e.payment_instructions?.redirect=="redirect"?true:false;console.debug("is_redirect",this.is_redirect);this.payment_processsing=!this.is_redirect?true:false;const a=e?.payment_code??null;if(a=="paypal"){this.modal_addfunds=false}this.$refs[e.payment_code].Dopayment(e.data,e)}catch(t){ElementPlus.ElNotification({title:"",message:t,position:"bottom-right",type:"warning"})}},AfterCancelPayment(e){console.debug("AfterCancelPayment",e);if(!empty(e)){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}},afterSuccessfulpayment(e){console.debug("afterSuccessfulpayment",e);this.modal_addfunds=false;this.payment_processsing=false;this.fetchWallet(this.cart_total)}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){yi.component(e,t)})}yi.use(ElementPlus);const bi=yi.mount("#vue-wallet")})(jQuery); 2272;window.__modalGuardLoaded=true;(function(){"use strict";document.addEventListener("click",function(e){var b=e.target.closest(".modal.show .modal-footer button");if(!b||b.textContent.trim().toLowerCase()!=="done")return;var m=b.closest(".modal.show");if(!m)return;window.setTimeout(function(){if(!m.classList.contains("show"))return;m.classList.remove("show");m.style.display="none";m.setAttribute("aria-hidden","true");m.removeAttribute("aria-modal");document.querySelectorAll(".modal-backdrop").forEach(function(x){x.remove()});if(!document.querySelector(".modal.show")){document.body.classList.remove("modal-open");document.body.style.removeProperty("padding-right");document.body.style.removeProperty("overflow")}},120)})})(); 2273;(function(){document.documentElement.setAttribute("data-404eats-modal-guard","16");document.addEventListener("click",function(e){var t=e.target&&e.target.nodeType===1?e.target:e.target&&e.target.parentElement;var b=t&&t.closest(".modal.show .modal-footer button");if(!b||b.textContent.trim().toLowerCase()!=="done")return;var m=b.closest(".modal.show");if(!m)return;setTimeout(function(){if(!m.classList.contains("show"))return;m.classList.remove("show");m.style.display="none";m.setAttribute("aria-hidden","true");m.removeAttribute("aria-modal");document.querySelectorAll(".modal-backdrop").forEach(function(x){x.remove()});if(!document.querySelector(".modal.show")){document.body.classList.remove("modal-open");document.body.style.removeProperty("padding-right");document.body.style.removeProperty("overflow")}},160)},true)})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.