{"version":3,"sources":["../../lib/assets/javascripts/os-time.js","../../lib/assets/javascripts/os-shared.js","../../lib/assets/javascripts/os-notifications.js","../../lib/assets/javascripts/os-actions.js","../../lib/assets/javascripts/main_front.js"],"names":["latepoint_is_timeframe_in_periods","timeframe_start","timeframe_end","periods_arr","is_inside","arguments","length","undefined","i","period_start","period_end","buffer_before","buffer_after","period_info","split","parseFloat","latepoint_is_period_inside_another","latepoint_is_period_overlapping","period_one_start","period_one_end","period_two_start","period_two_end","latepoint_minutes_to_hours_preferably","time","army_clock","latepoint_is_army_clock","hours","Math","floor","minutes","latepoint_minutes_to_hours","latepoint_am_or_pm","latepoint_hours_and_minutes_to_minutes","hours_and_minutes","ampm","hours_and_minutes_arr","parseInt","latepoint_get_time_system","latepoint_helper","time_system","latepoint_minutes_to_hours_and_minutes","format","sprintf","latepoint_mask_timefield","$elem","jQuery","inputmask","mask","placeholder","latepoint_mask_phone","latepoint_is_phone_masking_enabled","latepoint_get_phone_format","phone_format","enable_phone_masking","latepoint_show_booking_end_time","show_booking_end_time","latepoint_init_form_masks","latepoint_get_paypal_payment_amount","$booking_form_element","payment_portion","payment_amount","find","val","data","latepoint_add_notification","message","message_type","wrapper","append","remove","latepoint_generate_form_message_html","messages","status","message_html","Array","isArray","forEach","latepoint_clear_form_messages","$form","latepoint_show_data_in_lightbox","extra_classes","lightbox_css_classes","addClass","latepoint_init_payment_method_actions","payment_method","_jQuery","callbacks_list","is_last_step","trigger","removeClass","when","apply","_toConsumableArray","map","callback","action","done","show","latepoint_show_next_btn","clear_step_services","latepoint_update_summary_field","clear_sub_step_attendies","clear_sub_step_duration","clear_step_service_extras","clear_step_locations","clear_step_agents","clear_step_datepicker","latepoint_hide_next_btn","latepoint_show_prev_btn","latepoint_hide_prev_btn","latepoint_show_capacity_selector","$item","closest","max_capacity","min_capacity","text","latepoint_show_durations","latepoint_apply_coupon","$coupon_input","form_params","serialize","route_action","route_name","params","layout","return_format","ajax","type","dataType","url","ajaxurl","success","latepoint_show_message_inside_element","latepoint_reload_step","latepoint_remove_coupon","fadeOut","step_name","index","className","match","join","nextAll","submit","latepoint_get_payment_sub_step","current_sub_step","prev","offset","payment_sub_steps","push","selected_payment_method","indexOf","sub_step","latepoint_reset_password_from_booking_init","hide","on","html","field_name","value","$summary_holder","String","trim","hasClass","slideDown","fadeIn","slideUp","latepoint_password_changed_show_login","response","latepoint_hide_message_inside_element","prepend","latepoint_add_action","priority","sort","a","b","document","ready","$","e","$this","this","confirm","setTimeout","location","reload","window","replace","before","after","func_name","includes","func_arr","alert","preventDefault","form_data","record_id","documentElement","body","animate","scrollTop","top","form_values_to_update","each","name","latepoint_init_step","latepoint_init_step_selectable_items","latepoint_init_step_category_items","latepoint_init_step_datepicker","latepoint_init_step_contact","latepoint_init_step_agents","latepoint_init_step_services","latepoint_init_step_payment","latepoint_init_step_verify","latepoint_init_step_confirmation","day_timeslots","$day","service_duration","interval","work_start_minutes","work_end_minutes","total_work_minutes","bookable_minutes","available_capacities_of_bookable_minute","attr","toString","bookable_minutes_with_capacity","Number","work_minutes","$timeslots","prev_minutes","current_minutes","timeslot_class","timeslot_available_capacity","time_pick_style","off_label","off_width","tick_html","capacity_html","timeslot_label","spaces_message","end_minutes","end_minutes_ampm","many_spaces_message","single_space_message","msg_not_available","$scrollable_wrapper","stop","scrollHeight","os_init_timeslots","selected_timeslot_time","timeshift_minutes","start_date","Date","setDate","getDate","toISOString","os_init_monthly_calendar_navigation","next_month_route_name","next","latepoint_calendar_set_month_label","$btn","$calendar_element","last","calendar_year","calendar_month","booking_info","target_date_string","location_id","agent_id","service_id","duration","total_attendies","timezone_name","latepoint_calendar_show_or_hide_prev_next_buttons","latepoint_format_minutes_to_time","formatted_time","latepoint_format_price","toFixed","which","focus","$payment_step","portion","$category_wrapper","$main_parent","parent","off","latepoint_selectable_item_clicked","latepoint_selectable_item_quantity_keyup","latepoint_calculate_total_price","$booking_form","calculate_price_route","price","is_free","latepoint_update_quantity_for_selectable_items","ids","get","event","new_value","max_quantity","stopPropagation","stopImmediatePropagation","target","current_value","summary_value","latepoint_trigger_next_btn","currency_symbol_before","currency_symbol_after","min","max","add_value","latepoint_init_step_locations","account_nonse","password","password_confirmation","param","latepoint_init_customer_dashboard","$select_box","latepoint_init_customer_dashboard_login","$login_form_wrapper","FB","login","authResponse","token","accessToken","latepoint_step_content_change_start","latepoint_step_content_change_end","scope","google","googleUser","$login_form_wrappers","accounts","id","initialize","client_id","social_login_google_client_id","latepoint_process_google_login","renderButton","theme","size","get_customer_name","$wrapper","customer_name","first_name","last_name","latepoint_init_facebook_login","latepoint_init_google_login","latepoint_validate_fields","email","new_content","replaceWith","credential","social_login_google_route","$booking_form_elements","latepoint_change_step_desc","$step_progress","prevAll","side_panel_desc","top_header_desc","latepoint_progress_prev","latepoint_progress_next","latepoint_next_step_description","latepoint_prev_step_description","$fields","is_valid","latepoint_submit_booking_form","is_pre_last_step","css","show_next_btn","show_prev_btn","send_to_step","latepoint_init_booking_form","_jQuery2","current_step","is_final_submit","direction","fail","error","URLSearchParams","search","has","delete","history","replaceState","hash","is_timezone_selected","tzid","Intl","DateTimeFormat","resolvedOptions","timeZone","change","_jQuery3","$next_btn","$current_step","new_sub_step","$services_step","parents","$current_active_step","$back_btn","$new_current_step","new_current_step_name","start_from_booking_intent_key","start_from_booking_intent_route","booking_intent_key","lightbox_class","cancel_booking_prompt","$booking_box","route","$tabs_wrapper","booking_button_route","restrictions","show_service_categories","show_locations","show_services","show_agents","selected_location","selected_agent","selected_service","selected_service_category","selected_start_date","selected_start_time","calendar_start_date","isEmptyObject","step"],"mappings":"aAAA,SAASA,kCAAkCC,EAAiBC,EAAeC,EAA3E,GAGE,IAFA,IAAIC,EAAYC,UAAUC,OAAS,QAAsBC,IAD3D,GAAA,EAGWC,EAAI,EAAGA,EAAIL,EAAYG,OAAQE,IAAK,CAE3C,IAAIC,EAAe,EACfC,EAAa,EACbC,EAAgB,EAChBC,EAAe,EAEfC,EAAcV,EAAYK,GAAGM,MAAM,KAU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E,QAAS,SAAAA,EAASpE,GAChB,GAAmB,YAAhBA,EAAKS,OAAqB,CAC3B,IAAI2U,EAAiB,GACY,OAA9BjO,EAAMnH,KAAK,kBAA0BoV,GAAiB,2BACrB,OAAjCjO,EAAMnH,KAAK,qBAA6BoV,GAAiB,8BAC5DpU,gCAAgChB,EAAKE,QAASkV,GAC9ClC,IACA,IAAIvT,EAAwBb,OAAO,yDACnC8J,EAAoB5I,EAAKuW,KAAM5W,GAC/BsH,EAAE,QAAQ9F,SAAS,6BACnBgG,EAAMzF,YAAY,mBAGlByF,EAAMzF,YAAY,kBAMjB,QA75Cb,CAq6CK5C","sourcesContent":["function latepoint_is_timeframe_in_periods(timeframe_start, timeframe_end, periods_arr) {\n var is_inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n for (var i = 0; i < periods_arr.length; i++) {\n\n var period_start = 0;\n var period_end = 0;\n var buffer_before = 0;\n var buffer_after = 0;\n\n var period_info = periods_arr[i].split(':');\n if (period_info.length == 2) {\n period_start = period_info[0];\n period_end = period_info[1];\n } else {\n buffer_before = period_info[2];\n buffer_after = period_info[3];\n period_start = parseFloat(period_info[0]) - parseFloat(buffer_before);\n period_end = parseFloat(period_info[1]) + parseFloat(buffer_after);\n }\n if (is_inside) {\n if (latepoint_is_period_inside_another(timeframe_start, timeframe_end, period_start, period_end)) {\n return true;\n }\n } else {\n if (latepoint_is_period_overlapping(timeframe_start, timeframe_end, period_start, period_end)) {\n return true;\n }\n }\n };\n return false;\n}\n\nfunction latepoint_is_period_overlapping(period_one_start, period_one_end, period_two_start, period_two_end) {\n // https://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap/\n return period_one_start < period_two_end && period_two_start < period_one_end;\n}\nfunction latepoint_is_period_inside_another(period_one_start, period_one_end, period_two_start, period_two_end) {\n return period_one_start >= period_two_start && period_one_end <= period_two_end;\n}\n\n\n// Converts time in minutes to hours if possible, if minutes also exists - shows minutes too\nfunction latepoint_minutes_to_hours_preferably(time) {\n var army_clock = latepoint_is_army_clock();\n\n var hours = Math.floor(time / 60);\n if (!army_clock && hours > 12) hours = hours - 12;\n\n var minutes = time % 60;\n if(minutes > 0) hours = hours + ':' + minutes;\n return hours;\n}\n\n\nfunction latepoint_minutes_to_hours(time) {\n var army_clock = latepoint_is_army_clock();\n\n var hours = Math.floor(time / 60);\n if (!army_clock && hours > 12) hours = hours - 12;\n return hours;\n}\n\n\nfunction latepoint_am_or_pm(minutes) {\n if(latepoint_is_army_clock()) return '';\n return (minutes < 720 || minutes == 1440) ? 'am' : 'pm';\n}\n\nfunction latepoint_hours_and_minutes_to_minutes(hours_and_minutes, ampm) {\n var hours_and_minutes_arr = hours_and_minutes.split(':');\n var hours = hours_and_minutes_arr[0];\n var minutes = hours_and_minutes_arr[1];\n if(ampm == \"pm\" && hours<12) hours = parseInt(hours)+12;\n if(ampm == \"am\" && hours==12) hours = 0;\n minutes = parseInt(minutes) + (hours * 60);\n return minutes;\n}\n\nfunction latepoint_get_time_system(){\n return latepoint_helper.time_system;\n}\n\nfunction latepoint_is_army_clock(){\n return (latepoint_get_time_system() == '24');\n}\n\nfunction latepoint_minutes_to_hours_and_minutes(minutes) {\n var army_clock = latepoint_is_army_clock();\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '%02d:%02d';\n\n var hours = Math.floor(minutes / 60);\n if(!army_clock && (hours > 12)) hours = hours - 12;\n if(!army_clock && hours == 0) hours = 12;\n var minutes = minutes % 60;\n return sprintf(format, hours, minutes);\n}\n","function latepoint_mask_timefield($elem){\n\tif(jQuery().inputmask){\n\t $elem.inputmask({\n\t 'mask': '99:99',\n\t 'placeholder': 'HH:MM'\n\t });\n\t}\n}\n\nfunction latepoint_mask_phone($elem){\n\tif(latepoint_is_phone_masking_enabled() && jQuery().inputmask) $elem.inputmask(latepoint_get_phone_format());\n}\n\n\nfunction latepoint_get_phone_format(){\n return latepoint_helper.phone_format;\n}\n\nfunction latepoint_is_phone_masking_enabled(){\n\treturn (latepoint_helper.enable_phone_masking == 'yes');\n}\n\nfunction latepoint_show_booking_end_time(){\n\treturn (latepoint_helper.show_booking_end_time == 'yes');\n}\n\nfunction latepoint_init_form_masks(){\n\tif(latepoint_is_phone_masking_enabled()) latepoint_mask_phone(jQuery('.os-mask-phone'));\n}\n\nfunction latepoint_get_paypal_payment_amount($booking_form_element){\n\tvar payment_portion = $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val();\n\tvar payment_amount = (payment_portion == 'deposit') ? $booking_form_element.find('.lp-paypal-btn-trigger').data('deposit-amount') : $booking_form_element.find('.lp-paypal-btn-trigger').data('full-amount');\n\treturn payment_amount;\n}","function latepoint_add_notification(message, message_type = 'success'){\n\tvar wrapper = jQuery('body').find('.os-notifications');\n\tif(!wrapper.length){\n\t\tjQuery('body').append('
');\n\t\twrapper = jQuery('body').find('.os-notifications');\n\t}\n\tif(wrapper.find('.item').length > 0) wrapper.find('.item:first-child').remove();\n\twrapper.append('
' + message + '
');\n}","function latepoint_generate_form_message_html(messages, status){\n var message_html = '
';\n return message_html;\n}\n\nfunction latepoint_clear_form_messages($form){\n $form.find('.os-form-message-w').remove();\n}\n\nfunction latepoint_show_data_in_lightbox(message, extra_classes = ''){\n jQuery('.latepoint-lightbox-w').remove();\n var lightbox_css_classes = 'latepoint-lightbox-w latepoint-w ';\n if(extra_classes) lightbox_css_classes+= extra_classes;\n jQuery('body').append('
' + message + '
');\n jQuery('body').addClass('latepoint-lightbox-active');\n}\n\n\n\n// DOCUMENT READY\njQuery(document).ready(function( $ ) {\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /* \n Ajax buttons action\n */\n $('.latepoint').on('click', 'button[data-os-action], a[data-os-action], div[data-os-action], span[data-os-action], tr[data-os-action]', function(e){\n var $this = $(this);\n if($this.data('os-prompt') && !confirm($this.data('os-prompt'))) return false;\n var params = $(this).data('os-params');\n if($(this).data('os-source-of-params')){\n params = $($(this).data('os-source-of-params')).find('select, input, textarea').serialize();\n }\n var return_format = $this.data('os-return-format') ? $this.data('os-return-format') : 'json'\n var data = { action: 'latepoint_route_call', route_name: $(this).data('os-action'), params: params, return_format: return_format } \n $this.addClass('os-loading');\n if($this.data('os-output-target') == 'side-panel'){\n $('.latepoint-side-panel-w').remove();\n $('body').append('
');\n }\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(response){\n if(response.status === \"success\"){\n if($this.data('os-output-target') == 'lightbox'){\n latepoint_show_data_in_lightbox(response.message, $this.data('os-lightbox-classes'));\n }else if($this.data('os-output-target') == 'side-panel'){\n $('.latepoint-side-panel-i').html(response.message);\n setTimeout(function(){\n $('.latepoint-side-panel-w').removeClass('os-loading');\n }, 100);\n }else if($this.data('os-success-action') == 'reload'){\n latepoint_add_notification(response.message);\n location.reload();\n return;\n }else if($this.data('os-success-action') == 'redirect'){\n if($this.data('os-redirect-to')){\n latepoint_add_notification(response.message);\n window.location.replace($this.data('os-redirect-to'));\n }else{\n window.location.replace(response.message); \n }\n return;\n }else if($this.data('os-output-target') && $($this.data('os-output-target')).length){\n if($this.data('os-output-target-do') == 'append'){\n $($this.data('os-output-target')).append(response.message);\n }else{\n $($this.data('os-output-target')).html(response.message);\n }\n }else{\n switch($this.data('os-before-after')){\n case 'before':\n $this.before(response.message);\n break;\n case 'after':\n $this.after(response.message);\n break;\n case 'none':\n break;\n default:\n latepoint_add_notification(response.message);\n }\n }\n if($this.data('os-after-call')){\n var func_name = $this.data('os-after-call');\n var callback = false;\n if(func_name.includes('.')){\n var func_arr = func_name.split('.');\n if($this.data('os-pass-this') && $this.data('os-pass-response')){\n window[func_arr[0]][func_arr[1]]($this, response);\n }else if($this.data('os-pass-this')){\n window[func_arr[0]][func_arr[1]]($this);\n }else if($this.data('os-pass-response')){\n window[func_arr[0]][func_arr[1]](response);\n }else{\n window[func_arr[0]][func_arr[1]]();\n }\n }else{\n if($this.data('os-pass-this') && $this.data('os-pass-response')){\n window[func_name]($this, response);\n }else if($this.data('os-pass-this')){\n window[func_name]($this);\n }else if($this.data('os-pass-response')){\n window[func_name](response);\n }else{\n window[func_name]();\n }\n }\n }\n $this.removeClass('os-loading');\n }else{\n $this.removeClass('os-loading');\n if($this.data('os-output-target') && $($this.data('os-output-target')).length){\n $($this.data('os-output-target')).prepend(latepoint_generate_form_message_html(response.message, 'error'));\n }else{\n alert(response.message);\n }\n }\n }\n });\n return false;\n });\n\n\n $('.latepoint').on('click', 'form[data-os-action] button[type=\"submit\"]', function(e){\n $(this).addClass('os-loading');\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /* \n Form ajax submit action\n */\n $('.latepoint').on('submit', 'form[data-os-action]', function(e){\n e.preventDefault(); // prevent native submit\n var $form = $(this);\n var form_data = $form.serialize();\n var data = { action: 'latepoint_route_call', route_name: $(this).data('os-action'), params: form_data, return_format: 'json' }\n $form.find('button[type=\"submit\"]').addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(response){\n $form.find('button[type=\"submit\"].os-loading').removeClass('os-loading');\n latepoint_clear_form_messages($form);\n if(response.status === \"success\"){\n if($form.data('os-success-action') == 'reload'){\n latepoint_add_notification(response.message);\n location.reload();\n return;\n }else if($form.data('os-success-action') == 'redirect'){\n if($form.data('os-redirect-to')){\n latepoint_add_notification(response.message);\n window.location.replace($form.data('os-redirect-to'));\n }else{\n window.location.replace(response.message);\n }\n return;\n }else if($form.data('os-output-target') && $($form.data('os-output-target')).length){\n $($form.data('os-output-target')).html(response.message);\n }else{\n if(response.message == 'redirect'){\n window.location.replace(response.url);\n }else{\n latepoint_add_notification(response.message);\n $form.prepend(latepoint_generate_form_message_html(response.message, 'success'));\n }\n }\n if($form.data('os-record-id-holder') && response.record_id){\n $form.find('[name=\"' + $form.data('os-record-id-holder') + '\"]').val(response.record_id)\n }\n if($form.data('os-after-call')){\n var func_name = $form.data('os-after-call');\n if($form.data('os-pass-response')){\n window[func_name](response);\n }else{\n window[func_name]();\n }\n }\n $('button.os-loading').removeClass('os-loading');\n }else{\n $('button.os-loading').removeClass('os-loading');\n if($form.data('os-show-errors-as-notification')){\n latepoint_add_notification(response.message, 'error');\n }else{\n $form.prepend(latepoint_generate_form_message_html(response.message, 'error'));\n $([document.documentElement, document.body]).animate({\n scrollTop: ($form.find(\".os-form-message-w\").offset().top - 30)\n }, 200);\n }\n }\n if(response.form_values_to_update){\n $.each(response.form_values_to_update, function(name, value){\n $form.find('[name=\"'+ name +'\"]').val(value);\n });\n }\n }\n });\n return false;\n });\n});","// @codekit-prepend \"os-time.js\"\n// @codekit-prepend \"os-shared.js\"\n// @codekit-prepend \"os-notifications.js\";\n// @codekit-prepend \"os-actions.js\"\n\n\n\n\n function latepoint_init_payment_method_actions($booking_form_element, payment_method){\n var callbacks_list = [];\n var is_last_step = $booking_form_element.data('next-submit-is-last') == 'yes';\n $booking_form_element.trigger('latepoint:initPaymentMethod', [{ payment_method: payment_method, \n callbacks_list: callbacks_list, \n is_last_step: is_last_step }]);\n $booking_form_element.removeClass('step-content-loaded').addClass('step-content-loading');\n jQuery.when(...callbacks_list.map(callback => callback.action()))\n .done(() => {\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-loaded').find('.lp-payment-method-content[data-payment-method=\"' + payment_method + '\"]').show();\n });\n }\n\n function latepoint_show_next_btn($booking_form_element){\n $booking_form_element.find('.latepoint-next-btn').removeClass('disabled');\n $booking_form_element.removeClass('hidden-buttons');\n }\n\n function clear_step_services($booking_form_element){\n latepoint_update_summary_field($booking_form_element, 'service', '');\n clear_sub_step_attendies($booking_form_element);\n }\n\n function clear_sub_step_attendies($booking_form_element){\n $booking_form_element.find('.latepoint_total_attendies').val(1);\n latepoint_update_summary_field($booking_form_element, 'total-attendies', '');\n clear_sub_step_duration($booking_form_element);\n }\n\n function clear_sub_step_duration($booking_form_element){\n $booking_form_element.find('.latepoint_duration').val('');\n latepoint_update_summary_field($booking_form_element, 'duration', '');\n }\n\n function clear_step_service_extras($booking_form_element){\n latepoint_update_summary_field($booking_form_element, 'service-extras', '');\n }\n\n function clear_step_locations($booking_form_element){\n latepoint_update_summary_field($booking_form_element, 'location', '');\n }\n\n function clear_step_agents($booking_form_element){\n latepoint_update_summary_field($booking_form_element, 'agent', '');\n }\n\n function clear_step_datepicker($booking_form_element){\n latepoint_update_summary_field($booking_form_element, 'time', '');\n latepoint_update_summary_field($booking_form_element, 'date', '');\n }\n\n function latepoint_hide_next_btn($booking_form_element){\n $booking_form_element.find('.latepoint-next-btn').addClass('disabled');\n if($booking_form_element.find('.latepoint-prev-btn.disabled').length) $booking_form_element.addClass('hidden-buttons');\n }\n\n\n function latepoint_show_prev_btn($booking_form_element){\n $booking_form_element.find('.latepoint-prev-btn').removeClass('disabled');\n $booking_form_element.removeClass('hidden-buttons');\n }\n\n function latepoint_hide_prev_btn($booking_form_element){\n $booking_form_element.find('.latepoint-prev-btn').addClass('disabled');\n if($booking_form_element.find('.latepoint-next-btn.disabled').length) $booking_form_element.addClass('hidden-buttons');\n }\n\n\nfunction latepoint_show_capacity_selector($item){\n var $booking_form_element = $item.closest('.latepoint-booking-form-element');\n var max_capacity = $item.data('max-capacity');\n var min_capacity = $item.data('min-capacity');\n $booking_form_element.find('.sta-sub-label span').text(max_capacity);\n $booking_form_element.find('.step-services-w').removeClass('selecting-service-duration');\n $booking_form_element.find('.total-attendies-selector-w').data('max-capacity', max_capacity);\n $booking_form_element.find('.total-attendies-selector-w').data('min-capacity', min_capacity);\n $item.closest('.step-services-w').addClass('selecting-total-attendies');\n $booking_form_element.find('.total-attendies-selector-input').val(min_capacity);\n latepoint_show_prev_btn($booking_form_element);\n latepoint_show_next_btn($booking_form_element);\n}\n\n\nfunction latepoint_show_durations($item){\n var $booking_form_element = $item.closest('.latepoint-booking-form-element');\n $item.closest('.step-services-w').addClass('selecting-service-duration');\n latepoint_show_prev_btn($booking_form_element);\n latepoint_hide_next_btn($booking_form_element);\n}\n\nfunction latepoint_apply_coupon($elem){\n var $booking_form_element = $elem.closest('.latepoint-booking-form-element');\n\n var $coupon_input = $elem;\n $coupon_input.closest('.coupon-code-input-w').addClass('os-loading');\n var form_params = $booking_form_element.find('.latepoint-form').serialize();\n var data = { action: latepoint_helper.route_action, route_name: $elem.data('route'), params: form_params, layout: 'none', return_format: 'json' }\n jQuery.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $coupon_input.closest('.coupon-code-input-w').removeClass('os-loading');\n if(data.status === \"success\"){\n $booking_form_element.find('input[name=\"booking[coupon_code]\"]').val($coupon_input.val());\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.latepoint-body'), 'success');\n $booking_form_element.find('.step-payment-w input[name=\"booking[payment_method]\"]').val('');\n $booking_form_element.find('input[name=\"booking[payment_token]\"]').val('');\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val('');\n latepoint_reload_step($booking_form_element);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.latepoint-body'), 'error');\n }\n }\n });\n}\n\nfunction latepoint_remove_coupon($elem){\n $elem.closest('.applied-coupon-code').fadeOut();\n var $booking_form_element = $elem.closest('.latepoint-booking-form-element');\n $booking_form_element.find('input[name=\"booking[coupon_code]\"]').val('');\n latepoint_reload_step($booking_form_element);\n}\n\nfunction latepoint_reload_step($booking_form_element, step_name = false){\n\n if(step_name){\n $booking_form_element.find('.latepoint_current_step').val(step_name);\n $booking_form_element.removeClass(function (index, className) { return (className.match (/(^|\\s)current-step-\\S+/g) || []).join(' '); }).addClass('current-step-' + step_name);\n if($booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ step_name +'\"]')){\n $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ step_name +'\"]').nextAll('.latepoint-step-content').remove();\n $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ step_name +'\"]').remove();\n }\n }\n\n $booking_form_element.find('.latepoint_step_direction').val('specific');\n $booking_form_element.find('.latepoint-form').submit();\n\n return false;\n}\n\nfunction latepoint_get_payment_sub_step($booking_form_element, current_sub_step, prev = false){\n var offset = prev ? -1 : 1;\n var payment_sub_steps = [];\n if($booking_form_element.find('.step-payment-w .lp-payment-times-w').length) payment_sub_steps.push('payment-times');\n if($booking_form_element.find('.step-payment-w .lp-payment-methods-w').length) payment_sub_steps.push('payment-methods');\n if($booking_form_element.find('.step-payment-w .lp-payment-portions-w').length) payment_sub_steps.push('payment-portions');\n\n var selected_payment_method = $booking_form_element.find('input[name=\"booking[payment_method]\"]').val();\n if(selected_payment_method) payment_sub_steps.push('payment-method-content');\n\n var index = payment_sub_steps.indexOf(current_sub_step) + offset;\n if(index >= 0 && index < payment_sub_steps.length){\n var sub_step = payment_sub_steps[index];\n if(sub_step == 'payment-method-content'){\n latepoint_init_payment_method_actions($booking_form_element, selected_payment_method);\n // if no content exists for payment method - do not change sub step\n if(!$booking_form_element.find('.lp-payment-method-content[data-payment-method=\"' + selected_payment_method + '\"]').length) sub_step = current_sub_step;\n }\n return sub_step;\n }else{\n return current_sub_step;\n }\n}\n\n\nfunction latepoint_reset_password_from_booking_init(){\n jQuery('.os-step-existing-customer-login-w').hide();\n jQuery('.os-password-reset-form-holder').on('click', '.password-reset-back-to-login', function(){\n jQuery('.os-password-reset-form-holder').html('');\n jQuery('.os-step-existing-customer-login-w').show();\n return false;\n });\n}\n\nfunction latepoint_update_summary_field($form, field_name, value = ''){\n var $summary_holder = $form.closest('.latepoint-with-summary');\n if(!$summary_holder.length) return;\n value = value ? String(value).trim() : false;\n if(value){\n $form.find('.os-summary-value-'+field_name).html(value).closest('.os-summary-line').addClass('os-has-value');\n if($summary_holder.hasClass('latepoint-summary-is-open')){\n $form.find('.os-summary-line.os-has-value').slideDown(150);\n }else{\n $form.find('.os-summary-line.os-has-value').fadeIn(200);\n }\n $summary_holder.addClass('latepoint-summary-is-open');\n }else{\n $form.find('.os-summary-value-'+field_name).text('').closest('.os-summary-line').slideUp(150).removeClass('os-has-value');\n }\n}\n\nfunction latepoint_password_changed_show_login(response){\n jQuery('.os-step-existing-customer-login-w').show();\n jQuery('.os-password-reset-form-holder').html('');\n latepoint_show_message_inside_element(response.message, jQuery('.os-step-existing-customer-login-w'), 'success');\n}\n\nfunction latepoint_hide_message_inside_element($elem = jQuery('.latepoint-body')){\n if($elem.length && $elem.find('.latepoint-message').length){\n $elem.find('.latepoint-message').remove();\n }\n}\n\nfunction latepoint_show_message_inside_element(message, $elem = jQuery('.latepoint-body'), message_type = 'error'){\n if($elem.length){\n if($elem.find('.latepoint-message').length){\n $elem.find('.latepoint-message').removeClass('latepoint-message-success').removeClass('latepoint-message-error').addClass('latepoint-message-'+ message_type +'').html(message).show();\n }else{\n $elem.prepend('
' + message + '
');\n }\n }\n}\n\nfunction latepoint_add_action(callbacks_list, action, priority = 10){\n callbacks_list.push({priority: priority, action: action});\n callbacks_list.sort((a,b) => a.priority - b.priority);\n return callbacks_list;\n}\n\n\n( function( $ ) {\n \"use strict\";\n\n function latepoint_init_step(step_name, $booking_form_element){\n latepoint_init_step_selectable_items();\n latepoint_init_step_category_items(step_name);\n switch(step_name){\n case 'datepicker':\n latepoint_init_step_datepicker();\n break;\n case 'contact':\n latepoint_init_step_contact();\n break;\n case 'agents':\n latepoint_init_step_agents();\n break;\n case 'locations':\n latepoint_init_step_locations();\n break;\n case 'services':\n latepoint_init_step_services();\n break;\n case 'payment':\n latepoint_init_step_payment($booking_form_element);\n break;\n case 'verify':\n latepoint_init_step_verify($booking_form_element);\n break;\n case 'confirmation':\n latepoint_init_step_confirmation();\n break;\n }\n\n $booking_form_element.trigger(\"latepoint:initStep\", [{step_name: step_name}]);\n $booking_form_element.trigger(\"latepoint:initStep:\" + step_name);\n }\n\n\n\n function day_timeslots($day){\n var $booking_form_element = $day.closest('.latepoint-booking-form-element');\n $day.addClass('selected');\n\n var service_duration = $day.data('service-duration');\n var interval = $day.data('interval');\n var work_start_minutes = $day.data('work-start-time');\n var work_end_minutes = $day.data('work-end-time');\n var total_work_minutes = $day.data('total-work-minutes');\n var bookable_minutes = [];\n var available_capacities_of_bookable_minute = [];\n if($day.attr('data-bookable-minutes')){\n if($day.data('bookable-minutes').toString().indexOf(':') > -1){\n // has capacity information embedded into bookable minutes string\n let bookable_minutes_with_capacity = $day.data('bookable-minutes').toString().split(',');\n for(let i = 0; i < bookable_minutes_with_capacity.length; i++){\n bookable_minutes.push(parseInt(bookable_minutes_with_capacity[i].split(':')[0]));\n available_capacities_of_bookable_minute.push(parseInt(bookable_minutes_with_capacity[i].split(':')[1]));\n }\n }else{\n bookable_minutes = $day.data('bookable-minutes').toString().split(',').map(Number);\n }\n }\n var work_minutes = $day.data('work-minutes').toString().split(',').map(Number);\n\n var $timeslots = $booking_form_element.find('.timeslots');\n $timeslots.html('');\n\n if(total_work_minutes > 0 && bookable_minutes.length && work_minutes.length){\n var prev_minutes = false;\n work_minutes.forEach(function(current_minutes){\n var ampm = latepoint_am_or_pm(current_minutes);\n \n var timeslot_class = 'dp-timepicker-trigger';\n var timeslot_available_capacity = 0;\n if(latepoint_helper.time_pick_style == 'timeline'){\n timeslot_class+= ' dp-timeslot';\n }else{\n timeslot_class+= ' dp-timebox';\n }\n\n if(prev_minutes !== false && ((current_minutes - prev_minutes) > service_duration)){\n // show interval that is off between two work periods\n var off_label = latepoint_minutes_to_hours_and_minutes(prev_minutes + service_duration)+' '+ latepoint_am_or_pm(prev_minutes + service_duration) + ' - ' + latepoint_minutes_to_hours_and_minutes(current_minutes)+' '+latepoint_am_or_pm(current_minutes);\n var off_width = (((current_minutes - prev_minutes - service_duration) / total_work_minutes) * 100);\n $timeslots.append('
' + off_label + '
');\n }\n\n if(!bookable_minutes.includes(current_minutes)){\n timeslot_class+= ' is-booked';\n }else{\n if(available_capacities_of_bookable_minute.length) timeslot_available_capacity = available_capacities_of_bookable_minute[bookable_minutes.indexOf(current_minutes)];\n }\n var tick_html = '';\n var capacity_html = '';\n if(((current_minutes % 60) == 0) || (interval >= 60)){\n timeslot_class+= ' with-tick';\n tick_html = ''+latepoint_minutes_to_hours_preferably(current_minutes)+''+' '+ampm+'';\n }\n var timeslot_label = latepoint_minutes_to_hours_and_minutes(current_minutes)+' '+ampm;\n if(latepoint_show_booking_end_time()){\n var end_minutes = current_minutes + service_duration;\n if(end_minutes > 1440) end_minutes = end_minutes - 1440;\n var end_minutes_ampm = latepoint_am_or_pm(end_minutes);\n timeslot_label+= ' - ' + latepoint_minutes_to_hours_and_minutes(end_minutes)+' '+end_minutes_ampm + '';\n }\n if(timeslot_available_capacity){\n var spaces_message = timeslot_available_capacity > 1 ? latepoint_helper.many_spaces_message : latepoint_helper.single_space_message;\n capacity_html = ''+ timeslot_available_capacity + ' ' + spaces_message +'';\n }\n timeslot_label = timeslot_label.trim();\n $timeslots.removeClass('slots-not-available').append('
'+ timeslot_label +''+tick_html+ capacity_html + '
');\n prev_minutes = current_minutes;\n });\n }else{\n // No working hours this day\n $timeslots.addClass('slots-not-available').append('
' + latepoint_helper.msg_not_available + \"
\");\n }\n $('.times-header-label span').text($day.data('nice-date'));\n $booking_form_element.find('.time-selector-w').slideDown(200, function(){\n var $scrollable_wrapper = $booking_form_element.find('.latepoint-body');\n $scrollable_wrapper.stop().animate({\n scrollTop: $scrollable_wrapper[0].scrollHeight\n }, 200);\n });\n }\n\n\n\n\n function os_init_timeslots(){\n $('.dp-timepicker-trigger').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n if($(this).hasClass('is-booked') || $(this).hasClass('is-off')){\n // Show error message that you cant select a booked period\n }else{\n if($(this).hasClass('selected')){\n $(this).removeClass('selected');\n $(this).find('.dp-success-label').remove();\n $booking_form_element.find('.latepoint_start_time').val('');\n latepoint_hide_next_btn($booking_form_element);\n latepoint_update_summary_field($booking_form_element, 'time', '');\n }else{\n $booking_form_element.find('.dp-timepicker-trigger.selected').removeClass('selected').find('.dp-success-label').remove();\n var selected_timeslot_time = $(this).find('.dp-label').html();\n $(this).addClass('selected').find('.dp-label').html('' + $booking_form_element.find('.latepoint-form').data('selected-label') + '' + selected_timeslot_time);\n\n var minutes = parseInt($(this).data('minutes'));\n var timeshift_minutes = parseInt($booking_form_element.find('.latepoint_timeshift_minutes').val());\n // we substract timeshift minutes because its timeshift minutes that the business is running in, in opposite of what we do when we generate a calendar for a client\n if(timeshift_minutes) minutes = minutes - timeshift_minutes;\n var start_date = new Date($booking_form_element.find('.os-day.selected').data('date'));\n if(minutes < 0){\n // business minutes are in previous day\n minutes = 24*60 + minutes;\n // move start date back 1 day\n start_date.setDate(start_date.getDate() - 1);\n }else if(minutes >= 24*60){\n // business minutes are in next day\n minutes = minutes - 24*60;\n start_date.setDate(start_date.getDate() + 1);\n }\n $booking_form_element.find('.latepoint_start_date').val(start_date.toISOString().split('T')[0])\n $booking_form_element.find('.latepoint_start_time').val(minutes);\n latepoint_show_next_btn($booking_form_element);\n latepoint_update_summary_field($booking_form_element, 'time', selected_timeslot_time);\n }\n }\n return false;\n });\n }\n\n function os_init_monthly_calendar_navigation(){\n $('.os-month-next-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var next_month_route_name = $(this).data('route');\n if($booking_form_element.find('.os-monthly-calendar-days-w.active + .os-monthly-calendar-days-w').length){\n $booking_form_element.find('.os-monthly-calendar-days-w.active').removeClass('active').next('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_element);\n }else{\n // TODO add condition to check maximum number months to call into the future\n if(true){\n var $btn = $(this);\n $btn.addClass('os-loading');\n var $calendar_element = $booking_form_element.find('.os-monthly-calendar-days-w').last();\n var calendar_year = $calendar_element.data('calendar-year');\n var calendar_month = $calendar_element.data('calendar-month');\n if(calendar_month == 12){\n calendar_year = calendar_year + 1;\n calendar_month = 1;\n }else{\n calendar_month = calendar_month + 1;\n }\n var booking_info = { target_date_string: calendar_year + '-' + calendar_month + '-1', \n location_id: $booking_form_element.find('.latepoint_location_id').val(), \n agent_id: $booking_form_element.find('.latepoint_agent_id').val(), \n service_id: $booking_form_element.find('.latepoint_service_id').val(),\n duration: $booking_form_element.find('input[name=\"booking[duration]\"]').val(),\n total_attendies: $booking_form_element.find('input[name=\"booking[total_attendies]\"]').val(),\n timezone_name: $booking_form_element.find('.latepoint_timezone_name').val()};\n var data = { action: latepoint_helper.route_action, route_name: next_month_route_name, params: booking_info, layout: 'none', return_format: 'json' }\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $btn.removeClass('os-loading');\n if(data.status === \"success\"){\n $booking_form_element.find('.os-months').append(data.message);\n $booking_form_element.find('.os-monthly-calendar-days-w.active').removeClass('active').next('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_element);\n }else{\n // console.log(data.message);\n }\n }\n });\n }\n }\n latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_element);\n return false;\n });\n $('.os-month-prev-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n if($booking_form_element.find('.os-monthly-calendar-days-w.active').prev('.os-monthly-calendar-days-w').length){\n $booking_form_element.find('.os-monthly-calendar-days-w.active').removeClass('active').prev('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_element);\n }\n latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_element);\n return false;\n });\n }\n\n function latepoint_calendar_set_month_label($booking_form_element){\n $booking_form_element.find('.os-current-month-label .current-year').text($booking_form_element.find('.os-monthly-calendar-days-w.active').data('calendar-year'));\n $booking_form_element.find('.os-current-month-label .current-month').text($booking_form_element.find('.os-monthly-calendar-days-w.active').data('calendar-month-label'));\n }\n\n\n function latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_element){\n $booking_form_element.find('.os-current-month-label .current-year').text($booking_form_element.find('.os-monthly-calendar-days-w.active .os-monthly-calendar-days').data('calendar-year'));\n $booking_form_element.find('.os-current-month-label .current-month').text($booking_form_element.find('.os-monthly-calendar-days-w.active .os-monthly-calendar-days').data('calendar-month-label'));\n\n if($booking_form_element.find('.os-monthly-calendar-days-w.active').prev('.os-monthly-calendar-days-w').length){\n $booking_form_element.find('.os-month-prev-btn').removeClass('disabled');\n }else{\n $booking_form_element.find('.os-month-prev-btn').addClass('disabled');\n }\n }\n\n function latepoint_format_minutes_to_time(minutes, service_duration){\n var ampm = latepoint_am_or_pm(minutes);\n var formatted_time = latepoint_minutes_to_hours_and_minutes(minutes)+' '+ampm;\n if(latepoint_show_booking_end_time()){\n var end_minutes = minutes + service_duration;\n var end_minutes_ampm = latepoint_am_or_pm(end_minutes);\n formatted_time+= ' - ' + latepoint_minutes_to_hours_and_minutes(end_minutes)+' '+end_minutes_ampm;\n }\n formatted_time = formatted_time.trim();\n return formatted_time;\n }\n\n function latepoint_init_step_datepicker(){\n os_init_timeslots();\n os_init_monthly_calendar_navigation();\n $('.os-months').on('click', '.os-day', function(){\n if($(this).hasClass('os-day-passed')) return false;\n if($(this).hasClass('os-not-in-allowed-period')) return false;\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n if($(this).closest('.os-monthly-calendar-days-w').hasClass('hide-if-single-slot')){\n\n // HIDE TIMESLOT IF ONLY ONE TIMEPOINT\n if($(this).hasClass('os-not-available')){\n // clicked on a day that has no available timeslots\n // do nothing\n }else{\n $booking_form_element.find('.os-day.selected').removeClass('selected');\n $(this).addClass('selected');\n // set date\n $booking_form_element.find('.latepoint_start_date').val($(this).data('date'));\n latepoint_update_summary_field($booking_form_element, 'date', $(this).data('nice-date'));\n if($(this).hasClass('os-one-slot-only')){\n // clicked on a day that has only one slot available\n var selected_timeslot_time = latepoint_format_minutes_to_time($(this).data('bookable-minutes'), $(this).data('service-duration'));\n $booking_form_element.find('.latepoint_start_time').val($(this).data('bookable-minutes'));\n latepoint_show_next_btn($booking_form_element);\n latepoint_update_summary_field($booking_form_element, 'time', selected_timeslot_time);\n }else{\n // regular day with more than 1 timeslots available\n // build timeslots\n day_timeslots($(this));\n // initialize timeslots events\n os_init_timeslots();\n // clear time and hide next btn\n $booking_form_element.find('.latepoint_start_time').val('');\n latepoint_hide_next_btn($booking_form_element);\n }\n }\n }else{\n \n // SHOW TIMESLOTS EVEN IF ONLY ONE TIMEPOINT\n $booking_form_element.find('.latepoint_start_date').val($(this).data('date'));\n latepoint_update_summary_field($booking_form_element, 'date', $(this).data('nice-date'));\n $booking_form_element.find('.os-day.selected').removeClass('selected');\n $(this).addClass('selected');\n\n // build timeslots\n day_timeslots($(this));\n // initialize timeslots events\n os_init_timeslots();\n // clear time and hide next btn\n latepoint_update_summary_field($booking_form_element, 'time', '');\n $booking_form_element.find('.latepoint_start_time').val('');\n latepoint_hide_next_btn($booking_form_element);\n }\n\n\n return false;\n });\n }\n\n\n function latepoint_init_step_verify($booking_form_element = false){\n if(!$booking_form_element) return;\n\n $booking_form_element.closest('.latepoint-summary-is-open').removeClass('latepoint-summary-is-open');\n }\n\n\n function latepoint_init_step_payment($booking_form_element = false){\n if($booking_form_element.find('.step-payment-w').data('full-amount') > 0){\n latepoint_update_summary_field($booking_form_element, 'price', latepoint_format_price(($booking_form_element.find('.step-payment-w').data('full-amount') * 100 / 100).toFixed(2)));\n }\n if($booking_form_element && ($booking_form_element.find('.step-payment-w').data('default-portion') == 'deposit')){\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val('deposit');\n }\n\n // activate payment method content if method and portion are set and no selection is needed\n var selected_payment_method = $booking_form_element.find('input[name=\"booking[payment_method]\"]').val();\n if(selected_payment_method && !$('.lp-payment-times-w').length && !$('.lp-payment-methods-w').length && !$('.lp-payment-portions-w').length){\n latepoint_init_payment_method_actions($booking_form_element, selected_payment_method);\n }\n\n $('.latepoint-booking-form-element .coupon-code-input-submit').on('click', function(e){\n latepoint_apply_coupon($(this).closest('.coupon-code-input-w').find('.coupon-code-input'));\n return false;\n });\n\n $('.latepoint-booking-form-element .coupon-code-clear').on('click', function(e){\n latepoint_remove_coupon($(this));\n return false;\n });\n\n $('.latepoint-booking-form-element input.coupon-code-input').on('keyup', function(e){\n if(e.which === 13){\n latepoint_apply_coupon($(this));\n return false;\n }\n });\n\n\n $('.latepoint-booking-form-element .coupon-code-trigger-w a').on('click', function(e){\n $(this).closest('.payment-total-info').addClass('entering-coupon').find('.coupon-code-input').focus();\n return false;\n });\n\n\n // Pay later button click\n $('.latepoint-booking-form-element .lp-payment-trigger-later').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n $booking_form_element.find('input[name=\"booking[payment_method]\"]').val($(this).data('method'));\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val('');\n $booking_form_element.find('.latepoint-form').submit();\n });\n\n\n // Selecting Payment Time\n $('.latepoint-booking-form-element .lp-payment-trigger-payment-time-selector').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var $payment_step = $booking_form_element.find('.step-payment-w');\n\n latepoint_hide_next_btn($booking_form_element);\n latepoint_show_prev_btn($booking_form_element);\n $payment_step.attr('data-sub-step', latepoint_get_payment_sub_step($booking_form_element, $payment_step.attr('data-sub-step')));\n return false;\n });\n\n // Selecting Payment Method\n $('.latepoint-booking-form-element .lp-payment-trigger-payment-method-selector').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var selected_payment_method = $(this).data('method');\n $booking_form_element.find('input[name=\"booking[payment_method]\"]').val(selected_payment_method);\n\n var $payment_step = $booking_form_element.find('.step-payment-w');\n latepoint_hide_next_btn($booking_form_element);\n latepoint_show_prev_btn($booking_form_element);\n $payment_step.attr('data-sub-step', latepoint_get_payment_sub_step($booking_form_element, $payment_step.attr('data-sub-step')));\n });\n\n $('.latepoint-booking-form-element .lp-payment-trigger-payment-portion-selector').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var portion = jQuery(this).data('portion');\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val(portion);\n if(portion == 'deposit'){\n $booking_form_element.find('.payment-total-info').addClass('paying-deposit');\n }else{\n $booking_form_element.find('.payment-total-info').removeClass('paying-deposit');\n }\n\n var $payment_step = $booking_form_element.find('.step-payment-w');\n latepoint_hide_next_btn($booking_form_element);\n latepoint_show_prev_btn($booking_form_element);\n $payment_step.attr('data-sub-step', latepoint_get_payment_sub_step($booking_form_element, $payment_step.attr('data-sub-step')));\n });\n\n\n }\n\n\n function latepoint_init_step_category_items(step_name){\n $('.latepoint-step-content[data-step-name=\"' + step_name + '\"] .os-item-category-info').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n latepoint_show_prev_btn($booking_form_element);\n $(this).closest('.latepoint-step-content').addClass('selecting-item-category');\n var $category_wrapper = $(this).closest('.os-item-category-w');\n var $main_parent = $(this).closest('.os-item-categories-main-parent');\n if($category_wrapper.hasClass('selected')){\n $category_wrapper.removeClass('selected');\n if($category_wrapper.parent().closest('.os-item-category-w').length){\n $category_wrapper.parent().closest('.os-item-category-w').addClass('selected');\n }else{\n $main_parent.removeClass('show-selected-only');\n }\n }else{\n $main_parent.find('.os-item-category-w.selected').removeClass('selected');\n $main_parent.addClass('show-selected-only');\n $category_wrapper.addClass('selected');\n }\n return false;\n });\n }\n\n\n function latepoint_init_step_selectable_items(){\n $('.os-selectable-items .os-selectable-item').off('click', latepoint_selectable_item_clicked);\n $('.os-selectable-items .os-selectable-item').on('click', latepoint_selectable_item_clicked);\n\n $('.os-selectable-items .os-selectable-item .item-quantity-selector-input').off('keyup', latepoint_selectable_item_quantity_keyup);\n $('.os-selectable-items .os-selectable-item .item-quantity-selector-input').on('keyup', latepoint_selectable_item_quantity_keyup);\n }\n\n\n function latepoint_calculate_total_price($booking_form_element){\n $booking_form_element.find('.os-summary-value.os-summary-value-price').addClass('os-loading');\n var $booking_form = $booking_form_element.find('.latepoint-form');\n var form_data = $booking_form.serialize();\n var data = { action: latepoint_helper.route_action, route_name: latepoint_helper.calculate_price_route, params: form_data, layout: 'none', return_format: 'json'}\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n var price = data.is_free ? '' : data.price;\n latepoint_update_summary_field($booking_form_element, 'price', price);\n $booking_form_element.find('.os-summary-value.os-summary-value-price').removeClass('os-loading');\n }\n }\n });\n return;\n }\n\n function latepoint_update_quantity_for_selectable_items($item){\n var ids = $item.closest('.os-selectable-items')\n .find('.os-selectable-item.selected')\n .map(function(){ \n if($(this).hasClass('has-quantity')){\n return $(this).data('item-id') + ':' + $(this).find('input.item-quantity-selector-input').val();\n }else{\n return $(this).data('item-id');\n }\n }).get();\n $item.closest('.latepoint-booking-form-element').find($item.data('id-holder')).val(ids);\n }\n\n function latepoint_selectable_item_quantity_keyup(event){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var $item = $(this).closest('.os-selectable-item');\n var new_value = $(this).val();\n if(new_value && new_value.match(/^\\d+$/)){\n var max_quantity = $item.data('max-quantity');\n if(max_quantity && (new_value > max_quantity)) new_value = max_quantity;\n }else{\n new_value = 0;\n }\n $(this).val(new_value);\n\n if(( $item.hasClass('selected') && (new_value > 0) ) || (!$item.hasClass('selected') && (new_value == 0))){\n latepoint_update_quantity_for_selectable_items($item);\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }else{\n $item.trigger('click');\n }\n }\n\n function latepoint_selectable_item_clicked(event){\n event.stopPropagation();\n event.stopImmediatePropagation();\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n if($(this).hasClass('has-quantity')){\n if($(event.target).hasClass('item-quantity-selector')){\n var current_value = parseInt($(this).find('input.item-quantity-selector-input').val());\n var new_value = ($(event.target).data('sign') == 'minus') ? current_value - 1 : current_value + 1;\n var max_quantity = $(this).data('max-quantity');\n if(new_value < 0) new_value = 0;\n if(max_quantity && (new_value > max_quantity)) new_value = max_quantity;\n $(this).find('input.item-quantity-selector-input').val(new_value);\n if(( $(this).hasClass('selected') && (new_value > 0) ) || (!$(this).hasClass('selected') && (new_value == 0))){\n latepoint_update_quantity_for_selectable_items($(this));\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }\n }\n if($(event.target).hasClass('item-quantity-selector-input')){\n latepoint_update_quantity_for_selectable_items($(this));\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }\n }\n var summary_value = '';\n if($(this).hasClass('os-allow-multiselect')){\n if($(this).hasClass('selected')){\n $(this).removeClass('selected');\n if($(this).hasClass('has-quantity')) $(this).find('input.item-quantity-selector-input').val(0);\n }else{\n $(this).addClass('selected');\n if($(this).hasClass('has-quantity') && !($(this).find('input.item-quantity-selector-input').val() > 0)){\n $(this).find('input.item-quantity-selector-input').val(1);\n }\n }\n latepoint_update_quantity_for_selectable_items($(this));\n summary_value = String($(this).closest('.os-selectable-items').find('.os-selectable-item.selected').map(function(){ return (' ' + $(this).data('summary-value')); }).get()).trim();\n latepoint_show_next_btn($booking_form_element);\n }else{\n if(!$(this).hasClass('os-duration-item')) $(this).closest('.os-item-categories-main-parent').find('.os-selectable-item.selected').removeClass('selected');\n $(this).closest('.os-selectable-items').find('.os-selectable-item.selected').removeClass('selected');\n $(this).addClass('selected');\n $booking_form_element.find($(this).data('id-holder')).val($(this).data('item-id'));\n summary_value = $(this).data('summary-value');\n if($(this).data('os-call-func')){\n window[$(this).data('os-call-func')]($(this));\n }\n if($(this).data('activate-sub-step')){\n window[$(this).data('activate-sub-step')]($(this));\n }else{\n latepoint_trigger_next_btn($booking_form_element);\n }\n }\n latepoint_update_summary_field($booking_form_element, $(this).data('summary-field-name'), summary_value);\n if($(this).hasClass('os-priced-item')){\n latepoint_calculate_total_price($booking_form_element);\n }\n }\n\n\n function latepoint_format_price(price){\n return latepoint_helper.currency_symbol_before + String(price) + latepoint_helper.currency_symbol_after;\n }\n\n\n function latepoint_init_step_services(){\n $('.total-attendies-selector-input').on('change', function(){\n var max_capacity = $(this).closest('.total-attendies-selector-w').data('max-capacity');\n var min_capacity = $(this).closest('.total-attendies-selector-w').data('min-capacity');\n var new_value = $(this).val();\n new_value = Math.min(Number(max_capacity), Number(new_value));\n new_value = Math.max(Number(min_capacity), Number(new_value));\n $(this).val(new_value);\n\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n latepoint_update_summary_field($booking_form_element, 'total-attendies', new_value);\n latepoint_calculate_total_price($booking_form_element);\n });\n $('.total-attendies-selector').on('click', function(){\n var add_value = ($(this).hasClass('total-attendies-selector-plus')) ? 1 : -1;\n var max_capacity = $(this).closest('.total-attendies-selector-w').data('max-capacity');\n var min_capacity = $(this).closest('.total-attendies-selector-w').data('min-capacity');\n var current_value = $(this).closest('.total-attendies-selector-w').find('input.total-attendies-selector-input').val();\n var new_value = (Number(current_value) > 0) ? Math.max((Number(current_value) + add_value), 1) : 1;\n new_value = Math.min(Number(max_capacity), new_value);\n new_value = Math.max(Number(min_capacity), new_value);\n $(this).closest('.total-attendies-selector-w').find('input').val(new_value).trigger('change');\n return false;\n });\n }\n\n\n function latepoint_trigger_next_btn($booking_form_element){\n $booking_form_element.find('.latepoint_step_direction').val('next');\n $booking_form_element.find('.latepoint-form').submit();\n }\n\n function latepoint_init_step_locations(){\n }\n\n function latepoint_init_step_agents(){\n $('.os-items .os-item-details-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var agent_id = $(this).data('agent-id');\n $booking_form_element.find('.os-agent-bio-popup.active').removeClass('active');\n $booking_form_element.find('#osAgentBioPopup' + agent_id).addClass('active');\n return false;\n });\n $('.os-agent-bio-close').on('click', function(){\n $(this).closest('.os-agent-bio-popup').removeClass('active');\n return false;\n });\n }\n\n\n function latepoint_init_step_confirmation(){\n\n $('.latepoint-booking-form-element').on('click', '.set-customer-password-btn', function(){\n var $btn = $(this);\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n\n $btn.addClass('os-loading');\n var params = { account_nonse: $('input[name=\"account_nonse\"]').val(), password: $('input[name=\"customer[password]\"]').val(), password_confirmation: $('input[name=\"customer[password_confirmation]\"]').val()}\n var data = { action: latepoint_helper.route_action, route_name: $(this).data('btn-action'), params: $.param(params), layout: 'none', return_format: 'json' }\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $btn.removeClass('os-loading');\n if(data.status === \"success\"){\n $booking_form_element.find('.step-confirmation-set-password').html('').hide();\n $booking_form_element.find('.confirmation-cabinet-info').show();\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.step-confirmation-set-password'), 'error');\n }\n }\n });\n return false;\n });\n\n $('.latepoint-booking-form-element').on('click', '.qr-show-trigger', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n $booking_form_element.find('.qr-code-on-confirmation').addClass('show-vevent-qr-code');\n return false;\n });\n\n $('.latepoint-booking-form-element').on('click', '.show-set-password-fields', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n\n $booking_form_element.find('.step-confirmation-set-password').show();\n $booking_form_element.find('#customer_password').focus();\n $(this).closest('.info-box').hide();\n return false;\n });\n }\n\n function latepoint_init_customer_dashboard(){\n $('.latepoint-customer-timezone-selector-w select').on('change', function(e){\n var $select_box = $(this);\n $select_box.closest('.latepoint-customer-timezone-selector-w').addClass('os-loading');\n var data = { action: latepoint_helper.route_action, route_name: $(this).closest('.latepoint-customer-timezone-selector-w').data('route-name'), params: { timezone_name: $(this).val()}, layout: 'none', return_format: 'json'}\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $select_box.closest('.latepoint-customer-timezone-selector-w').removeClass('os-loading');\n if(data.status === \"success\"){\n location.reload();\n }else{\n\n }\n }\n });\n });\n }\n\n function latepoint_init_customer_dashboard_login(){\n if($('.latepoint-login-form-w #facebook-signin-btn').length && $('.latepoint-login-form-w').length){\n $('.latepoint-login-form-w #facebook-signin-btn').on('click', function(){\n var $login_form_wrapper = $(this).closest('.latepoint-login-form-w');\n FB.login(function(response){\n if (response.status === 'connected' && response.authResponse) {\n var params = { token: response.authResponse.accessToken};\n var data = { action: latepoint_helper.route_action, route_name: $login_form_wrapper.find('#facebook-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($login_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n location.reload();\n }else{\n latepoint_show_message_inside_element(data.message, $login_form_wrapper);\n latepoint_step_content_change_end(false, $login_form_wrapper);\n }\n }\n });\n } else {\n \n }\n }, {scope: 'public_profile,email'});\n });\n }\n\n if($('.latepoint-login-form-w #google-signin-btn').length && $('.latepoint-login-form-w').length && typeof google !== 'undefined'){\n // INIT GOOGLE LOGIN\n var googleUser = {};\n\n var $login_form_wrappers = $('.latepoint-login-form-w');\n $login_form_wrappers.each(function(){\n var $login_form_wrapper = $(this);\n google.accounts.id.initialize({\n client_id: latepoint_helper.social_login_google_client_id,\n callback: latepoint_process_google_login\n });\n google.accounts.id.renderButton(\n $login_form_wrapper.find('#google-signin-btn')[0],\n {theme: \"outline\", size: \"medium\"} // customization attributes\n );\n });\n }\n }\n\n function get_customer_name($wrapper){\n var customer_name = '';\n var first_name = $wrapper.find('input[name=\"customer[first_name]\"]').val();\n var last_name = $wrapper.find('input[name=\"customer[last_name]\"]').val();\n if(first_name) customer_name+= first_name;\n if(last_name) customer_name+= ' ' + last_name;\n return customer_name.trim();\n }\n\n function latepoint_init_step_contact(){\n latepoint_init_facebook_login();\n latepoint_init_google_login();\n latepoint_init_form_masks();\n\n $('.step-contact-w').each(function(){\n latepoint_update_summary_field($(this).closest('.latepoint-booking-form-element'), 'customer', get_customer_name($(this)));\n });\n\n $('.step-contact-w').on('keyup', 'input[name=\"customer[first_name]\"], input[name=\"customer[last_name]\"]', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n latepoint_update_summary_field($booking_form_element, 'customer', get_customer_name($booking_form_element));\n });\n\n $('.step-contact-w').on('keyup', '.os-form-control.required', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n if(latepoint_validate_fields($booking_form_element.find('.step-contact-w .os-form-control.required'))){\n }else{\n }\n });\n\n // Init Logout button\n $('.step-customer-logout-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var data = { action: latepoint_helper.route_action, route_name: $(this).data('btn-action'), layout: 'none', return_format: 'json' }\n latepoint_step_content_change_start($booking_form_element);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n latepoint_reload_step($booking_form_element);\n }\n });\n return false;\n });\n\n // Init Login Existing Customer Button\n $('.step-login-existing-customer-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var params = { email: $booking_form_element.find('.os-step-existing-customer-login-w input[name=\"customer_login[email]\"]').val(), password: $booking_form_element.find('.os-step-existing-customer-login-w input[name=\"customer_login[password]\"]').val()}\n var data = { action: latepoint_helper.route_action, route_name: $(this).data('btn-action'), params: $.param(params), layout: 'none', return_format: 'json' }\n latepoint_step_content_change_start($booking_form_element);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_reload_step($booking_form_element);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.os-step-existing-customer-login-w'));\n latepoint_step_content_change_end(false, $booking_form_element);\n }\n }\n });\n return false;\n });\n }\n\n function latepoint_step_content_change_start($booking_form_element){\n $booking_form_element.removeClass('step-content-loaded').addClass('step-content-loading');\n }\n\n // TODO\n function latepoint_step_content_change_end(new_content, $booking_form_element){\n if(new_content) $booking_form_element.find('.latepoint-body .latepoint-step-content').replaceWith(new_content);\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-mid-loading');\n setTimeout(function(){\n $booking_form_element.removeClass('step-content-mid-loading').addClass('step-content-loaded');\n }, 50);\n }\n\n function latepoint_init_facebook_login(){\n if(!$('#facebook-signin-btn').length || !$('.latepoint-booking-form-element').length) return;\n $('#facebook-signin-btn').on('click', function(){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n FB.login(function(response){\n if (response.status === 'connected' && response.authResponse) {\n var params = { token: response.authResponse.accessToken};\n var data = { action: latepoint_helper.route_action, route_name: $booking_form_element.find('#facebook-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($booking_form_element);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_reload_step($booking_form_element);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.os-step-existing-customer-login-w '));\n latepoint_step_content_change_end(false, $booking_form_element);\n }\n }\n });\n } else {\n \n }\n }, {scope: 'public_profile,email'});\n });\n }\n\n function latepoint_process_google_login(response, $booking_form_element = false){\n\n var params = {\n token: response.credential\n };\n var data = {\n action: latepoint_helper.route_action,\n route_name: latepoint_helper.social_login_google_route,\n params: $.param(params),\n layout: 'none',\n return_format: 'json'\n };\n if($booking_form_element) latepoint_step_content_change_start($booking_form_element);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n if($booking_form_element){\n latepoint_reload_step($booking_form_element);\n }else{\n location.reload();\n }\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.os-step-existing-customer-login-w '));\n latepoint_step_content_change_end(false, $booking_form_element);\n }\n }\n });\n }\n\n function latepoint_init_google_login(){\n if(!$('#google-signin-btn').length || !$('.latepoint-booking-form-element').length || typeof google === 'undefined') return;\n var googleUser = {};\n\n var $booking_form_elements = $('.latepoint-booking-form-element');\n $booking_form_elements.each(function(){\n var $booking_form_element = $(this);\n google.accounts.id.initialize({\n client_id: latepoint_helper.social_login_google_client_id,\n callback: (response) => latepoint_process_google_login(response, $booking_form_element)\n });\n google.accounts.id.renderButton(\n $booking_form_element.find('#google-signin-btn')[0],\n {theme: \"outline\", size: \"medium\"} // customization attributes\n );\n });\n }\n\n function latepoint_change_step_desc($booking_form_element, step_name){\n $booking_form_element.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n // Progress bar\n var $step_progress = $booking_form_element.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n // Side panel\n var side_panel_desc = $booking_form_element.find('.latepoint-step-desc-library[data-step-name=\"' + step_name + '\"]').html();\n $booking_form_element.find('.latepoint-step-desc').html(side_panel_desc);\n\n // Top header\n var top_header_desc = $booking_form_element.find('.os-heading-text-library[data-step-name=\"' + step_name + '\"]').html();\n $booking_form_element.find('.os-heading-text').html(top_header_desc);\n setTimeout(function(){\n $booking_form_element.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n\n\n function latepoint_progress_prev($booking_form_element, step_name){\n var $step_progress = $booking_form_element.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n }\n\n\n function latepoint_progress_next($booking_form_element, step_name){\n var $step_progress = $booking_form_element.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n }\n\n\n function latepoint_next_step_description($booking_form_element, step_name){\n $booking_form_element.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n $booking_form_element.find('.latepoint-step-desc').html($booking_form_element.find('.latepoint-step-desc-library.active').removeClass('active').next('.latepoint-step-desc-library').addClass('active').html());\n $booking_form_element.find('.os-heading-text').html($booking_form_element.find('.os-heading-text-library.active').removeClass('active').next('.os-heading-text-library').addClass('active').html());\n setTimeout(function(){\n $booking_form_element.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n function latepoint_prev_step_description($booking_form_element, step_name){\n $booking_form_element.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n $booking_form_element.find('.latepoint-step-desc').html($booking_form_element.find('.latepoint-step-desc-library.active').removeClass('active').prev('.latepoint-step-desc-library').addClass('active').html());\n $booking_form_element.find('.os-heading-text').html($booking_form_element.find('.os-heading-text-library.active').removeClass('active').prev('.os-heading-text-library').addClass('active').html());\n setTimeout(function(){\n $booking_form_element.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n\n\n function latepoint_validate_fields($fields){\n var is_valid = true;\n $fields.each(function(index){\n if($(this).val() == ''){\n is_valid = false;\n return false;\n }\n });\n return is_valid;\n }\n\n function latepoint_submit_booking_form($booking_form){\n var $booking_form_element = $booking_form.closest('.latepoint-booking-form-element');\n var form_data = $booking_form.serialize();\n var data = { action: latepoint_helper.route_action, route_name: $booking_form.data('route-name'), params: form_data, layout: 'none', return_format: 'json'}\n $booking_form_element.removeClass('step-content-loaded').addClass('step-content-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_hide_message_inside_element($booking_form_element.find('.latepoint-body'));\n if($booking_form_element.data('flash-error')){\n latepoint_show_message_inside_element($booking_form_element.data('flash-error'), $booking_form_element.find('.latepoint-body'));\n $booking_form_element.data('flash-error', '');\n }\n $booking_form_element.find('.latepoint_current_step').val(data.step_name);\n $booking_form_element.removeClass(function (index, className) { return (className.match (/(^|\\s)current-step-\\S+/g) || []).join(' '); }).addClass('current-step-' + data.step_name);\n setTimeout(function(){\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-mid-loading');\n $booking_form_element.find('.latepoint-body').find('.latepoint-step-content').addClass('is-hidden');\n if($booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ data.step_name +'\"]')){\n $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ data.step_name +'\"]').remove();\n }\n $booking_form_element.find('.latepoint-body').append(data.message);\n\n latepoint_init_step(data.step_name, $booking_form_element);\n setTimeout(function(){\n $booking_form_element.removeClass('step-content-mid-loading').addClass('step-content-loaded');\n $booking_form_element.find('.latepoint-next-btn, .latepoint-prev-btn').removeClass('os-loading');\n }, 50);\n }, 500);\n\n if(data.is_pre_last_step){\n $booking_form_element.data('next-submit-is-last', 'yes');\n $booking_form_element.find('.latepoint-next-btn span').text($booking_form_element.find('.latepoint-next-btn').data('pre-last-step-label'));\n }else{\n $booking_form_element.data('next-submit-is-last', 'no');\n $booking_form_element.find('.latepoint-next-btn span').text($booking_form_element.find('.latepoint-next-btn').data('label'));\n }\n if(data.is_last_step){\n $booking_form_element.addClass('hidden-buttons').find('.latepoint-footer').remove();\n $booking_form_element.find('.latepoint-progress').css( 'opacity', 0 );\n $booking_form_element.closest('.latepoint-summary-is-open').removeClass('latepoint-summary-is-open');\n $booking_form_element.addClass('is-final-step');\n }else{\n if(data.show_next_btn === true){\n latepoint_show_next_btn($booking_form_element);\n }else{\n latepoint_hide_next_btn($booking_form_element);\n }\n if(data.show_prev_btn === true){\n latepoint_show_prev_btn($booking_form_element);\n }else{\n latepoint_hide_prev_btn($booking_form_element);\n }\n }\n latepoint_change_step_desc($booking_form_element, data.step_name);\n }else{\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-loaded');\n $booking_form_element.find('.latepoint-next-btn, .latepoint-prev-btn').removeClass('os-loading');\n if(data.send_to_step && $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ data.send_to_step +'\"]').length){\n $booking_form_element.data('flash-error', data.message);\n latepoint_reload_step($booking_form_element, data.send_to_step);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_element.find('.latepoint-body'));\n latepoint_show_prev_btn($booking_form_element);\n }\n }\n $booking_form.find('.latepoint_step_direction').val('next');\n }\n });\n }\n\n function latepoint_init_booking_form(){\n\n $('.latepoint-booking-form-element .latepoint-form').on('submit', function(e){\n e.preventDefault();\n var $booking_form = $(this);\n var $booking_form_element = $booking_form.closest('.latepoint-booking-form-element');\n latepoint_hide_prev_btn($booking_form_element);\n var current_step = $booking_form_element.find('.latepoint_current_step').val();\n var callbacks_list = [];\n $booking_form_element.trigger('latepoint:submitBookingForm', [{ current_step: current_step, \n callbacks_list: callbacks_list, \n is_final_submit: $booking_form_element.data('next-submit-is-last') == 'yes',\n direction: $booking_form_element.find('.latepoint_step_direction').val()}]);\n jQuery.when(...callbacks_list.map(callback => callback.action()))\n .done(() => {\n latepoint_submit_booking_form($booking_form);\n })\n .fail((error) => {\n if(error.send_to_step && $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+ error.send_to_step +'\"]').length){\n latepoint_reload_step($booking_form_element, error.send_to_step);\n $booking_form_element.data('flash-error', error.message);\n }\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-loaded');\n latepoint_show_message_inside_element(error.message, $booking_form_element.find('.latepoint-body'), 'error');\n $booking_form_element.find('.latepoint-next-btn').removeClass('os-loading');\n if($booking_form_element.find('.latepoint-step-content:last-child').prev('.latepoint-step-content').length) latepoint_show_prev_btn($booking_form_element);\n });\n });\n\n $('.latepoint-lightbox-close').on('click', function(){\n\n let params = new URLSearchParams(location.search);\n if(params.has('latepoint_booking_intent_key')){\n params.delete('latepoint_booking_intent_key');\n history.replaceState(null, '', '?' + params + location.hash);\n }\n\n $('body').removeClass('latepoint-lightbox-active');\n $('.latepoint-lightbox-w').remove();\n return false;\n });\n\n\n\n $('.latepoint-timezone-selector-w select').on('change', function(e){\n var $select_box = $(this);\n $select_box.closest('.latepoint-timezone-selector-w').addClass('os-loading');\n var data = { action: latepoint_helper.route_action, route_name: $(this).closest('.latepoint-timezone-selector-w').data('route-name'), params: { timezone_name: $(this).val()}, layout: 'none', return_format: 'json'}\n var $booking_form_element = $select_box.closest('.latepoint-booking-form-element');\n $booking_form_element.removeClass('step-content-loaded').addClass('step-content-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $select_box.closest('.latepoint-timezone-selector-w').removeClass('os-loading');\n $booking_form_element.removeClass('step-content-loading');\n if(data.status === \"success\"){\n // reload datepicker if its the step\n if($select_box.closest('.latepoint-booking-form-element').hasClass('current-step-datepicker')){\n latepoint_reload_step($select_box.closest('.latepoint-booking-form-element'));\n }\n }else{\n\n }\n }\n });\n });\n\n if(!latepoint_helper.is_timezone_selected){\n const tzid = Intl.DateTimeFormat().resolvedOptions().timeZone;\n if(tzid){\n if(tzid != $('.latepoint-timezone-selector-w select').val()) $('.latepoint-timezone-selector-w select').val(tzid).change();\n }\n }\n\n \n\n $('.latepoint-booking-form-element').on('click', '.lp-option', function(){\n $(this).closest('.lp-options').find('.lp-option.selected').removeClass('selected');\n $(this).addClass('selected');\n });\n\n\n\n\n // Next Step button Click\n $('.latepoint-booking-form-element .latepoint-next-btn').on('click', function(e){\n if($(this).hasClass('disabled') || $(this).hasClass('os-loading')) return false;\n var $next_btn = $(this); \n $next_btn.addClass('os-loading');\n var $booking_form = $(this).closest('.latepoint-form');\n var $booking_form_element = $booking_form.closest('.latepoint-booking-form-element');\n\n var current_step = $booking_form_element.find('.latepoint_current_step').val();\n\n $booking_form.find('.latepoint_step_direction').val('next');\n var callbacks_list = [];\n $booking_form_element.trigger('latepoint:nextStepClicked', [{current_step: current_step, callbacks_list: callbacks_list}]);\n latepoint_hide_prev_btn($booking_form_element);\n jQuery.when(...callbacks_list.map(callback => callback.action()))\n .done(() => {\n $booking_form.submit();\n })\n .fail((error) => {\n latepoint_show_message_inside_element(error.message, $booking_form_element.find('.latepoint-body'), 'error');\n $next_btn.removeClass('os-loading');\n // if previous step exists - show prev button\n if($booking_form_element.find('.latepoint-step-content:last-child').prev('.latepoint-step-content').length) latepoint_show_prev_btn($booking_form_element);\n });\n return false;\n });\n\n\n // Previous Step button Click\n $('.latepoint-booking-form-element .latepoint-prev-btn').on('click', function(e){\n if($(this).hasClass('disabled') || $(this).hasClass('os-loading')) return false;\n var $booking_form = $(this).closest('.latepoint-form');\n var $booking_form_element = $booking_form.closest('.latepoint-booking-form-element');\n\n var current_step = $booking_form_element.find('.latepoint_current_step').val();\n var $current_step = $booking_form_element.find('.latepoint-step-content[data-step-name=\"'+current_step+'\"]');\n\n if(current_step == 'locations'){\n }\n if(current_step == 'agents'){\n }\n if(current_step == 'payment'){\n var $payment_step = $booking_form_element.find('.step-payment-w');\n if($payment_step.length){\n $payment_step.find('.lp-option.selected').removeClass('selected');\n var new_sub_step = latepoint_get_payment_sub_step($booking_form_element, $payment_step.attr('data-sub-step'), true);\n // hide all payment method content blocks\n if(new_sub_step != $payment_step.attr('data-sub-step')){\n $payment_step.find('.lp-payment-method-content').hide();\n $payment_step.attr('data-sub-step', new_sub_step);\n latepoint_hide_next_btn($booking_form_element);\n return false;\n }\n }\n }\n if(current_step == 'services'){\n var $services_step = $booking_form_element.find('.step-services-w');\n if($services_step.hasClass('selecting-service-duration')){\n $services_step.removeClass('selecting-service-duration');\n $services_step.find('.os-services > .os-item.selected').removeClass('selected');\n clear_sub_step_duration($booking_form_element);\n if(($booking_form_element.find('.latepoint-step-content').length <= 1) && !$services_step.hasClass('selecting-item-category')){\n latepoint_hide_prev_btn($booking_form_element)\n }\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }\n if($services_step.hasClass('selecting-total-attendies')){\n $services_step.removeClass('selecting-total-attendies');\n if($services_step.find('.os-services > .os-item.selected').hasClass('has-multiple-durations')){\n // multiple durations\n $services_step.find('.os-services > .os-item.selected .os-service-durations .os-selectable-item.selected').removeClass('selected');\n $services_step.addClass('selecting-service-duration');\n latepoint_hide_next_btn($booking_form_element);\n }else{\n $services_step.find('.os-services > .os-item.selected').removeClass('selected');\n }\n clear_sub_step_attendies($booking_form_element);\n if(($booking_form_element.find('.latepoint-step-content').length <= 1) && !$services_step.hasClass('selecting-item-category')){\n latepoint_hide_prev_btn($booking_form_element);\n }\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }\n }\n\n // handle categories\n if($current_step.hasClass('selecting-item-category')){\n if($current_step.find('.os-item-category-w .os-item-category-w.selected').length){\n $current_step.find('.os-item-category-w .os-item-category-w.selected').parents('.os-item-category-w').addClass('selected').find('.os-item-category-w.selected').removeClass('selected');\n }else{\n $current_step.removeClass('selecting-item-category').find('.os-item-category-w.selected').removeClass('selected');\n $current_step.removeClass('selecting-item-category').find('.os-item-categories-holder.show-selected-only').removeClass('show-selected-only');\n }\n if(($booking_form_element.find('.latepoint-step-content').length <= 1) && !$current_step.hasClass('selecting-item-category')){\n latepoint_hide_prev_btn($booking_form_element);\n }\n latepoint_calculate_total_price($booking_form_element);\n return false;\n }\n\n var $current_active_step = $booking_form_element.find('.latepoint-step-content:last-child');\n if($current_active_step.data('clear-action')){\n window[$current_active_step.data('clear-action')]($booking_form_element);\n }\n\n var $back_btn = $(this);\n $back_btn.addClass('os-loading');\n $booking_form_element.removeClass('step-content-loaded').addClass('step-content-loading');\n var $new_current_step = $booking_form_element.find('.latepoint-step-content.is-hidden').last();\n var new_current_step_name = $new_current_step.data('step-name');\n latepoint_change_step_desc($booking_form_element, new_current_step_name);\n setTimeout(function(){\n $new_current_step.removeClass('is-hidden');\n $current_active_step.remove();\n $booking_form_element.find('.latepoint_current_step').val(new_current_step_name);\n $booking_form_element.removeClass(function (index, className) { return (className.match (/(^|\\s)current-step-\\S+/g) || []).join(' '); }).addClass('current-step-' + new_current_step_name);\n $booking_form_element.find('.latepoint-next-btn span').text($booking_form_element.find('.latepoint-next-btn').data('label'));\n $booking_form_element.data('next-submit-is-last', 'no');\n latepoint_show_next_btn($booking_form_element);\n $back_btn.removeClass('os-loading');\n if($booking_form_element.find('.latepoint-step-content').length <= 1){\n if($new_current_step.hasClass('selecting-item-category')){\n\n }\n if(new_current_step_name == 'services'){\n var $services_step = $booking_form_element.find('.step-services-w');\n if($services_step.hasClass('selecting-service-duration') || $services_step.hasClass('selecting-total-attendies') || $services_step.hasClass('selecting-item-category')){\n if($services_step.find('.os-services > .os-item.selected').hasClass('is-preselected')){\n // if service is preselected check if there are both multiple durations and quantity selector and only then show prev button\n if($services_step.hasClass('selecting-total-attendies') && $services_step.find('.os-services > .os-item.selected').hasClass('has-multiple-durations')){\n // if selecting attendies and there are multiple durations - show prev button\n latepoint_show_prev_btn($booking_form_element);\n }else{\n latepoint_hide_prev_btn($booking_form_element);\n }\n }else{\n latepoint_show_prev_btn($booking_form_element);\n }\n }else{\n latepoint_hide_prev_btn($booking_form_element);\n }\n }else{\n if(!$new_current_step.hasClass('selecting-item-category')){\n latepoint_hide_prev_btn($booking_form_element);\n }\n }\n }\n $booking_form_element.removeClass('step-content-loading').addClass('step-content-mid-loading');\n setTimeout(function(){\n $booking_form_element.removeClass('step-content-mid-loading').addClass('step-content-loaded');\n latepoint_hide_message_inside_element($booking_form_element.find('.latepoint-body'));\n latepoint_calculate_total_price($booking_form_element);\n }, 150);\n }, 700);\n return false;\n });\n }\n\n // DOCUMENT READY\n $( function() {\n\n latepoint_init_customer_dashboard_login();\n latepoint_init_customer_dashboard();\n\n if(latepoint_helper.start_from_booking_intent_key){\n\n var data = { \n action: latepoint_helper.route_action,\n route_name: latepoint_helper.start_from_booking_intent_route, \n params: { booking_intent_key: latepoint_helper.start_from_booking_intent_key }, \n layout: 'none', \n return_format: 'json' \n }\n\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n var lightbox_class = '';\n latepoint_show_data_in_lightbox(data.message, data.lightbox_class);\n latepoint_init_booking_form();\n var $booking_form_element = jQuery('.latepoint-lightbox-w .latepoint-booking-form-element');\n $booking_form_element.find('.latepoint-step-content').addClass('is-hidden').last().removeClass('is-hidden');\n if($booking_form_element.find('.latepoint-step-content').length > 1) latepoint_show_prev_btn($booking_form_element);\n var $booking_form_element = jQuery('.latepoint-lightbox-w .latepoint-booking-form-element');\n $booking_form_element.find('.latepoint-step-content').each(function(){\n latepoint_init_step($(this).data('step-name'), $booking_form_element);\n });\n $('body').addClass('latepoint-lightbox-active');\n }else{\n // console.log(data.message);\n }\n }\n });\n }\n\n if($('.latepoint-booking-form-element').length){\n latepoint_init_booking_form();\n $('.latepoint-booking-form-element').each(function(){\n latepoint_init_step($(this).find('.latepoint_current_step').val(), $(this));\n });\n }\n\n $('.latepoint-request-booking-cancellation').on('click', function(){\n if(!confirm(latepoint_helper.cancel_booking_prompt)) return false;\n var $this = $(this);\n var $booking_box = $this.closest('.customer-booking');\n\n var route = $(this).data('route');\n var params = {id: $booking_box.data('id')};\n\n var data = { action: latepoint_helper.route_action, route_name: route, params: params, layout: 'none', return_format: 'json' }\n $this.addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n location.reload();\n $this.remove();\n }else{\n $this.removeClass('os-loading');\n }\n }\n });\n return false;\n });\n\n\n $('body').on('click', '.os-step-tabs .os-step-tab', function(){\n $(this).closest('.os-step-tabs').find('.os-step-tab').removeClass('active');\n $(this).addClass('active');\n var target = $(this).data('target');\n $(this).closest('.os-step-tabs-w').find('.os-step-tab-content').hide();\n $(target).show();\n });\n\n $('body').on('keyup', '.os-form-group .os-form-control', function(){\n if($(this).val()){\n $(this).closest('.os-form-group').addClass('has-value');\n }else{\n $(this).closest('.os-form-group').removeClass('has-value');\n }\n });\n\n $('.latepoint-tab-triggers').on('click', '.latepoint-tab-trigger', function(){\n var $tabs_wrapper = $(this).closest('.latepoint-tabs-w')\n $tabs_wrapper.find('.latepoint-tab-trigger.active').removeClass('active');\n $tabs_wrapper.find('.latepoint-tab-content').removeClass('active');\n $(this).addClass('active');\n $tabs_wrapper.find('.latepoint-tab-content' + $(this).data('tab-target')).addClass('active');\n return false;\n });\n\n\n // Main Button to trigger lightbox opening\n $('.latepoint-book-button, .os_trigger_booking').on('click', function(){\n var $this = $(this);\n var route = latepoint_helper.booking_button_route;\n var params = {};\n var restrictions = {};\n if($this.data('show-service-categories')) restrictions.show_service_categories = $this.data('show-service-categories');\n if($this.data('show-locations')) restrictions.show_locations = $this.data('show-locations');\n if($this.data('show-services')) restrictions.show_services = $this.data('show-services');\n if($this.data('show-agents')) restrictions.show_agents = $this.data('show-agents');\n if($this.data('selected-location')) restrictions.selected_location = $this.data('selected-location');\n if($this.data('selected-agent')) restrictions.selected_agent = $this.data('selected-agent');\n if($this.data('selected-service')) restrictions.selected_service = $this.data('selected-service');\n if($this.data('selected-service-category')) restrictions.selected_service_category = $this.data('selected-service-category');\n if($this.data('selected-start-date')) restrictions.selected_start_date = $this.data('selected-start-date');\n if($this.data('selected-start-time')) restrictions.selected_start_time = $this.data('selected-start-time');\n if($this.data('calendar-start-date')) restrictions.calendar_start_date = $this.data('calendar-start-date');\n\n if($.isEmptyObject(restrictions) == false) params.restrictions = restrictions;\n\n var data = { action: latepoint_helper.route_action, route_name: route, params: params, layout: 'none', return_format: 'json' }\n $this.addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n var lightbox_class = '';\n if($this.data('hide-summary') != 'yes') lightbox_class+= ' latepoint-with-summary';\n if($this.data('hide-side-panel') == 'yes') lightbox_class+= ' latepoint-hide-side-panel';\n latepoint_show_data_in_lightbox(data.message, lightbox_class);\n latepoint_init_booking_form();\n var $booking_form_element = jQuery('.latepoint-lightbox-w .latepoint-booking-form-element');\n latepoint_init_step(data.step, $booking_form_element);\n $('body').addClass('latepoint-lightbox-active');\n $this.removeClass('os-loading');\n \n }else{\n $this.removeClass('os-loading');\n // console.log(data.message);\n }\n }\n });\n\n return false;\n });\n\n\n\n });\n\n\n} )( jQuery );\n"]}