function cspml_ajax_pagination(){jQuery(document).on("click","div[class^=cspml_pagination_] ul li a",function(t){t.preventDefault();var a=jQuery(this).closest("li").attr("data-map-id"),i=jQuery("div.cspml_listings_area_"+a+" input[name=init_post_ids]").val(),s=jQuery("div.cspml_listings_area_"+a+" input[name=count_init_post_ids]").val(),e=jQuery("div[id^="+a+"_listing_item_]").attr("data-view"),l=jQuery("ul.cspml_sort_list[data-map-id="+a+"] li.cspml_active").html(),c=jQuery("ul.cspml_sort_list[data-map-id="+a+"] li.cspml_active").attr("data-sort"),n=jQuery("ul.cspml_sort_list[data-map-id="+a+"] li.cspml_active").attr("data-order"),d=jQuery(this).attr("href");-1===d.indexOf("paginate=true")&&(d+="?paginate=true");var m="div.cspml_listings_area_"+a;jQuery(m).length?jQuery("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+a+"]").offset().top-200},function(){var t=jQuery(".cspml_listing_items_container[data-map-id="+a+"]");t.length&&"function"==typeof t.mCustomScrollbar&&t.mCustomScrollbar("scrollTo","top"),cspml_show_listings_animation(a)}):cspml_show_listings_animation(a),jQuery(m).load(d+" "+m,function(t,d,p){return jQuery("div.cspml_listings_area_"+a+" input[name=init_post_ids]").val(i),jQuery("div.cspml_listings_area_"+a+" input[name=count_init_post_ids]").val(s),"error"==d?alert("An error has been occurred. Please try again later: "+p.status+" "+p.statusText):"success"==d&&(jQuery(m).children(m).unwrap(),"grid"==e?cspml_grid_view_classes(a):cspml_list_view_classes(a),jQuery("div.cspml_sort_list_container[data-map-id="+a+"] span.cspml_sort_val").empty().html(l),jQuery("li[data-map-id="+a+"][data-sort="+c+"][data-order="+n+"]").addClass("cspml_active"),cspml_hide_listings_animation(a)),!1})})}function cspml_filter_listings(t,a,i,s,e,l){var c=jQuery("div.cspml_listings_area_"+t+" input[name=shortcode_page_id]").val(),n=jQuery("div.cspml_listings_area_"+t+" input[name=page_template]").val(),d=jQuery("div.cspml_listings_area_"+t+" input[name=template_tax_query]").val(),m=jQuery("div.cspml_listings_area_"+t+" input[name=init_post_ids]").val(),p=jQuery("div.cspml_listings_area_"+t+" input[name=divider]").val(),r=jQuery("div.cspml_listings_area_"+t+" input[name=show_listings]").val(),o=jQuery("div.cspml_listings_area_"+t+" input[name=optional_latlng]").val(),v=jQuery("div[id^="+t+"_listing_item_]").attr("data-view"),g=jQuery("div.cspml_listings_area_"+t).attr("data-paginate-position"),f=jQuery("div.cspml_listings_area_"+t).attr("data-paginate-align"),h=jQuery("div.cspml_listings_area_"+t).attr("data-posts-per-page"),u=jQuery("div.cspml_listings_area_"+t).attr("data-map-type"),$=jQuery("div.cspml_listings_area_"+t+" input[name=shortcode_page_link]").val(),y=jQuery("ul.cspml_sort_list[data-map-id="+t+"] li.cspml_active").html(),b=jQuery("ul.cspml_sort_list[data-map-id="+t+"] li.cspml_active").attr("data-sort"),_=jQuery("ul.cspml_sort_list[data-map-id="+t+"] li.cspml_active").attr("data-order"),w={action:"cspml_listings_html",map_id:t,shortcode_page_id:c,page_template:n,template_tax_query:d,divider:p,ajax_call:!0,current_view:v,paginate_position:g,paginate_align:f,posts_per_page:h,optional_latlng:o,map_settings:progress_map_vars.map_script_args[t].map_settings,request_type:l,shortcode_page_link:$,init_post_ids:m,post_ids:a};i&&(w.save_session=!0),e&&(w.reset_list=!0),jQuery.post(cspml_vars.ajax_url,w,function(i){if(""==s)var l=""!=m?a.length:"0";else if(e&&"normal_map"!=u)var l="0";else var l=s;"true"==r&&(jQuery("div.cspml_listings_area_"+t).html(i),jQuery("span.cspml_the_count_"+t).empty().html(l),jQuery("div.cspml_sort_list_container[data-map-id="+t+"] span.cspml_sort_val").empty().html(y),jQuery("li[data-map-id="+t+"][data-sort="+b+"][data-order="+_+"]").addClass("cspml_active"),"grid"==v&&cspml_grid_view_classes(t),cspml_hide_listings_animation(t))})}function cspml_show_listings_animation(t){jQuery("div#cspml_loading_container_"+t).fadeIn(),jQuery("div.cspml_listings_area_"+t+" div.cspml_item_holder").removeClass("cspm_animated fadeIn").animate({opacity:"0.5"}),jQuery("div.cspml_transparent_layer_"+t).show()}function cspml_hide_listings_animation(t){jQuery("div.cspml_listings_area_"+t+" div.cspml_item_holder").addClass("cspm_animated fadeIn"),jQuery("div#cspml_loading_container_"+t).fadeOut(),jQuery("div.cspml_transparent_layer_"+t).hide(),setTimeout(function(){cspml_adjust_list_content_height(t)},500)}function cspml_list_view_classes(t){jQuery("div.cspml_options_bar_"+t+" div.list_view a").removeClass("enabled"),jQuery("div.cspml_options_bar_"+t+" div.grid_view a").addClass("enabled");var a=jQuery("div#cspml_listings_container[data-map-id="+t+"]").attr("data-grid-cols");if("cols1"==a)var i="cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12";else if("cols2"==a)var i="cspm-col-lg-6 cspm-col-md-6 cspm-col-sm-6 cspm-col-xs-12";else if("cols4"==a)var i="cspm-col-lg-3 cspm-col-md-3 cspm-col-sm-6 cspm-col-xs-12";else if("cols6"==a)var i="cspm-col-lg-2 cspm-col-md-2 cspm-col-sm-6 cspm-col-xs-12";else var i="cspm-col-lg-4 cspm-col-md-4 cspm-col-sm-6 cspm-col-xs-12";jQuery("div[id^="+t+"_listing_item_]").addClass("cspm_animated fadeIn"),jQuery("div[id^="+t+"_listing_item_]").attr("data-view","list"),jQuery("div[id^="+t+"_listing_item_]").removeClass(i).addClass("cspm-row"),jQuery("div#list_view_holder_"+t).addClass("cspm-col-lg-12 cspm-col-xs-12 cspm-col-sm-12 cspm-col-md-12"),jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").is(":visible")&&jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").removeClass("cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12").addClass("cspm-col-lg-5 cspm-col-md-5 cspm-col-sm-5 cspm-col-xs-12"),jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").is(":visible")?jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container").removeClass("cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12").addClass("cspm-col-lg-7 cspm-col-md-7 cspm-col-sm-7 cspm-col-xs-12").attr("data-view","list"):jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container").attr("data-view","list"),jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container .cspml_details_content").removeClass("grid"),setTimeout(function(){jQuery("div[id^="+t+"_listing_item_]").removeClass("cspm_animated fadeIn")},2e3)}function cspml_grid_view_classes(t){jQuery("div.cspml_options_bar_"+t+" div.grid_view a").removeClass("enabled"),jQuery("div.cspml_options_bar_"+t+" div.list_view a").addClass("enabled");var a=jQuery("div#cspml_listings_container[data-map-id="+t+"]").attr("data-grid-cols");if("cols1"==a)var i="cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12";else if("cols2"==a)var i="cspm-col-lg-6 cspm-col-md-6 cspm-col-sm-6 cspm-col-xs-12";else if("cols4"==a)var i="cspm-col-lg-3 cspm-col-md-3 cspm-col-sm-6 cspm-col-xs-12";else if("cols6"==a)var i="cspm-col-lg-2 cspm-col-md-2 cspm-col-sm-6 cspm-col-xs-12";else var i="cspm-col-lg-4 cspm-col-md-4 cspm-col-sm-6 cspm-col-xs-12";jQuery("div[id^="+t+"_listing_item_]").addClass("cspm_animated fadeIn"),jQuery("div[id^="+t+"_listing_item_]").attr("data-view","grid"),jQuery("div[id^="+t+"_listing_item_]").removeClass("cspm-row").addClass(i),jQuery("div#list_view_holder_"+t).removeClass("cspm-col-lg-12 cspm-col-xs-12 cspm-col-sm-12 cspm-col-md-12"),jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").is(":visible")&&jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").removeClass("cspm-col-lg-5 cspm-col-md-5 cspm-col-sm-5 cspm-col-xs-12").addClass("cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12"),jQuery("div[id^="+t+"_listing_item_] .cspml_thumb_container").is(":visible")?jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container").removeClass("cspm-col-lg-7 cspm-col-md-7 cspm-col-sm-7 cspm-col-xs-12").addClass("cspm-col-lg-12 cspm-col-md-12 cspm-col-sm-12 cspm-col-xs-12").attr("data-view","grid"):jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container").attr("data-view","grid"),jQuery("div[id^="+t+"_listing_item_] div.cspml_details_container .cspml_details_content").addClass("grid"),setTimeout(function(){jQuery("div[id^="+t+"_listing_item_]").removeClass("cspm_animated fadeIn")},2e3)}function cspml_adjust_list_content_height(t){if(null!==t){if(jQuery("div.cspml_thumb_container[data-map-id="+t+"]").is(":visible")){var a=jQuery("div.cspml_thumb_container[data-map-id="+t+"]").innerHeight(),i=jQuery("div.cspml_details_title[data-map-id="+t+"]").innerHeight();"list"==jQuery("div.cspml_details_container[data-map-id="+t+"]").attr("data-view")?(jQuery("div.cspml_details_container[data-map-id="+t+"][data-view=list]").attr("style","height:"+a+"px;"),jQuery("div.cspml_details_container[data-map-id="+t+"][data-view=list] .cspml_details_content").attr("style","height:"+(a-i-40)+"px;")):(jQuery("div.cspml_details_container[data-map-id="+t+"]").removeAttr("style"),jQuery("div.cspml_details_container[data-map-id="+t+"] .cspml_details_content").removeAttr("style"))}}else jQuery("div[class^=cspml_listings_area_]").each(function(t){var a=jQuery(this).attr("data-map-id");if(jQuery("div.cspml_thumb_container[data-map-id="+a+"]").is(":visible")){var i=jQuery("div.cspml_thumb_container[data-map-id="+a+"]").innerHeight(),s=jQuery("div.cspml_details_title[data-map-id="+a+"]").innerHeight();"list"==jQuery("div.cspml_details_container[data-map-id="+a+"]").attr("data-view")?(jQuery("div.cspml_details_container[data-map-id="+a+"][data-view=list]").attr("style","height:"+i+"px;"),jQuery("div.cspml_details_container[data-map-id="+a+"][data-view=list] .cspml_details_content").attr("style","height:"+(i-s-40)+"px;")):(jQuery("div.cspml_details_container[data-map-id="+a+"]").removeAttr("style"),jQuery("div.cspml_details_container[data-map-id="+a+"] .cspml_details_content").removeAttr("style"))}})}function cspml_animate_list_item(t,a){var i=jQuery("div.cspml_item_holder[data-map-id="+t+"][data-post-id="+a+"]"),s=jQuery(i),e=s.attr("data-attr-scrollto");if(jQuery("div.cspml_item_holder[data-map-id="+t+"] .cspml_item").removeClass("cspml_active_item"),"yes"==e){if(s.length){var l=jQuery(".cspml_listing_items_container[data-map-id="+t+"]");l.length&&"function"==typeof l.mCustomScrollbar&&"yes"==l.attr("data-scrollable")?"vertical"==l.attr("data-list-layout")?(l.mCustomScrollbar("scrollTo",i),setTimeout(function(){jQuery("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+t+"]").offset().top-200},function(){jQuery("html").animate({scrollTop:s.offset().top},function(){setTimeout(function(){jQuery("div.cspml_item_holder[data-map-id="+t+"][data-post-id="+a+"] .cspml_item").addClass("cspml_active_item")},100)})})},500)):jQuery("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+t+"]").offset().top-200},function(){l.mCustomScrollbar("scrollTo",i),setTimeout(function(){jQuery("div.cspml_item_holder[data-map-id="+t+"][data-post-id="+a+"] .cspml_item").addClass("cspml_active_item")},100)}):jQuery("html").animate({scrollTop:s.offset().top-100},function(){setTimeout(function(){jQuery("div.cspml_item_holder[data-map-id="+t+"][data-post-id="+a+"] .cspml_item").addClass("cspml_active_item")},100)})}}else jQuery("div.cspml_item_holder[data-map-id="+t+"][data-post-id="+a+"] .cspml_item").addClass("cspml_active_item")}function cspml_reset_filter_fields(t,a){jQuery("form.cspml_filter_form[data-map-id="+t+"] input[type=radio]:checked, form.cspml_filter_form[data-map-id="+t+"] input[type=checkbox]:checked").each(function(){jQuery(this).prop("checked",!1).trigger("change"),jQuery(this).trigger("stateChanged")}),jQuery("form.cspml_filter_form[data-map-id="+t+"] input[type=text]").each(function(){jQuery(this).val("")});var i=jQuery("form.cspml_filter_form[data-map-id="+t+"] input.cspml_fs_slider_range");if(void 0!==i&&i.length>0){var s=i.data("ionRangeSlider");"function"==typeof s.reset&&s.reset()}for(var a=jQuery("select.cspml_fs_selectize[data-map-id="+t+"]"),e=0;e<a.length;e++)a[e].selectize.clear();jQuery("span[id^=clear_date_range_][data-map-id="+t+"]").trigger("click")}!function(t){"use strict";void 0!==t.fn.datepicker&&(t.fn.cspmSyncDatepicker=t.fn.datepicker.noConflict()),t("div.cspml_fs_item_container input[type='radio'], div.cspml_fs_item_container input[type='checkbox']").ionCheckRadio(),t("select.cspml_fs_selectize").selectize(),t("input.cspml_fs_slider_range").ionRangeSlider({grid:!1,skin:"round",prettify_enabled:!0,keyboard:!0,decorate_both:!1,force_edges:!0});var a={autoHideScrollbar:!1,contentTouchScroll:!0,live:!0,mouseWheel:{enable:!0,preventDefault:!0},keyboard:{enable:!0},theme:"dark-2"};t("div.cspml_fs_container").each(function(i){t(this).attr("data-map-id"),"yes"==t(this).attr("data-scrollable")&&(t(this).mCustomScrollbar("destroy"),t(this).mCustomScrollbar(a))}),t("div.cspml_listing_items_container").each(function(i){t(this).attr("data-map-id"),"yes"==t(this).attr("data-scrollable")&&(t(this).mCustomScrollbar("destroy"),t(this).mCustomScrollbar(a))}),t("input[type=text].cspml_fs_number_field").spinner(),setTimeout(function(){t.each(t("a.cspml_reset_spinner"),function(){t(this).trigger("click")})},100),cspml_ajax_pagination(),cspml_adjust_list_content_height(null),t(document).on("click","div.cspml_fs_label span.cspml_toggle_btn",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-field-name"),s=t(this).attr("data-display-location");t("div.cspml_fs_options_list[data-map-id="+a+"][data-field-name="+i+"][data-display-location="+s+"]").slideToggle("fast")}),t(document).on("click","a.cspml_reset_spinner",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-field-name"),s=t(this).attr("data-display-location");t("div.cspml_fs_options_list[data-map-id="+a+"][data-display-location="+s+"] div.cspml_input_container input[type=text][name="+i+"]").val("")}),t.each(t(".cspml_input_symbol_after"),function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-field-name"),s=t(this).innerWidth();t("div.cspml_input_container").find("input[type=text][data-map-id="+a+'][name="'+i+'"]').attr("style","padding-right: "+(s+13)+"px !important;")}),t.each(t(".cspml_input_symbol_before"),function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-field-name"),s=t(this).innerWidth();t("div.cspml_input_container").find("input[type=text][data-map-id="+a+'][name="'+i+'"]').attr("style","padding-left: "+(s+13)+"px !important;")}),t(document).on("click","div.cspml_sort_list_container",function(){var a=t(this).attr("data-map-id");t("ul.cspml_sort_list[data-map-id="+a+"]").addClass("cspm_animated fadeIn").slideToggle(function(){t("ul.cspml_sort_list[data-map-id="+a+"]").mCustomScrollbar("destroy"),t("ul.cspml_sort_list[data-map-id="+a+"]").mCustomScrollbar({autoHideScrollbar:!0,mouseWheel:{enable:!0,preventDefault:!0},theme:"dark-2"})})}),t("ul.cspml_sort_list").each(function(a){var i=t(this).attr("data-map-id");t("ul.cspml_sort_list[data-map-id="+i+"] li").first().addClass("cspml_active")}),t(document).on("click","ul.cspml_sort_list li",function(){var a=t(this).attr("data-sort"),i=t(this).attr("data-order"),s=t(this).attr("data-type"),e=t(this).attr("data-map-id"),l=t("div#cspml_listings_container[data-map-id="+e+"]").attr("data-map-type"),c=t("div#cspml_listings_container[data-map-id="+e+"]").attr("data-first-load");if("normal_map"!=l&&"true"==c)return!1;t("ul.cspml_sort_list[data-map-id="+e+"] li").removeClass("cspml_active"),t(this).addClass("cspml_active"),t("ul.cspml_sort_list[data-map-id="+e+"]").fadeOut("fast");var n=t(this).html();t("div.cspml_sort_list_container[data-map-id="+e+"] span.cspml_sort_val").empty().html(n),cspml_show_listings_animation(e);var d=t("div.cspml_listings_area_"+e+" input[name=init_post_ids]").val(),m=t("div.cspml_listings_area_"+e+" input[name=post_ids]").val(),p=t("div.cspml_listings_area_"+e+" input[name=shortcode_page_id]").val(),r=t("div.cspml_listings_area_"+e+" input[name=divider]").val(),o=t("div[id^="+e+"_listing_item_]").attr("data-view"),v=t("div.cspml_listings_area_"+e+" input[name=page_template]").val(),g=t("div.cspml_listings_area_"+e+" input[name=template_tax_query]").val(),f=jQuery("div.cspml_listings_area_"+e+" input[name=optional_latlng]").val(),h=t("div.cspml_listings_area_"+e).attr("data-paginate-position"),u=t("div.cspml_listings_area_"+e).attr("data-paginate-align"),$=jQuery("div.cspml_listings_area_"+e).attr("data-posts-per-page"),y=jQuery("div.cspml_listings_area_"+e+" input[name=shortcode_page_link]").val(),b=jQuery(".cspml_listing_items_container[data-map-id="+e+"]");b.length&&"function"==typeof b.mCustomScrollbar&&b.mCustomScrollbar("scrollTo","top"),jQuery.post(cspml_vars.ajax_url,{action:"cspml_listings_html",map_id:e,data_sort:a,data_order:i,data_type:s,shortcode_page_id:p,post_ids:m,init_post_ids:d,divider:r,sort_call:!0,current_view:o,page_template:v,template_tax_query:g,paginate_position:h,paginate_align:u,posts_per_page:$,optional_latlng:f,map_settings:progress_map_vars.map_script_args[e].map_settings,request_type:"sort",shortcode_page_link:y},function(s){jQuery("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+e+"]").offset().top-200},function(){t("div.cspml_listings_area_"+e).html(s),"grid"==o&&cspml_grid_view_classes(e),t("div.cspml_sort_list_container[data-map-id="+e+"] span.cspml_sort_val").empty().html(n),t("li[data-map-id="+e+"][data-sort="+a+"][data-order="+i+"]").addClass("cspml_active"),cspml_hide_listings_animation(e)})})}),t(document).on("click","div.view_option a",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-current-view"),s=t(this).attr("data-next-view");t(this).attr("data-current-view",s),t(this).attr("data-next-view",i);var e=t("div.view_option[data-map-id="+a+"] a").attr("title");t("div.view_option[data-map-id="+a+"] a").attr("title",e.replace(s,i)),"grid"==s?(cspml_grid_view_classes(a),t("div.view_option[data-map-id="+a+"] a svg.cspml_list_view").hide(),t("div.view_option[data-map-id="+a+"] a svg.cspml_grid_view").show()):"list"==s&&(cspml_list_view_classes(a),t("div.view_option[data-map-id="+a+"] a svg.cspml_grid_view").hide(),t("div.view_option[data-map-id="+a+"] a svg.cspml_list_view").show()),cspml_adjust_list_content_height(a)}),t(document).on("click","a.cspml_submit_listings_filter, a.cspml_mfs_submit_listings_filter",function(a){var i=t(this).attr("data-map-id"),s=t(this).attr("data-display-location"),e=t(this).attr("data-request-type"),l=t("div.cspml_listings_area_"+i+" input[name=init_post_ids]").val(),c=t("div[id^="+i+"_listing_item_]").attr("data-view"),n=t("div.cspml_listings_area_"+i+" input[name=shortcode_page_id]").val(),d=t("div.cspml_listings_area_"+i+" input[name=page_template]").val(),m=t("div.cspml_listings_area_"+i+" input[name=template_tax_query]").val(),p=t("div.cspml_listings_area_"+i+" input[name=show_listings]").val(),r=jQuery("div.cspml_listings_area_"+i+" input[name=shortcode_page_link]").val();"map"!=s?t("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+i+"]").offset().top-200},function(){var t=jQuery(".cspml_listing_items_container[data-map-id="+i+"]");t.length&&"function"==typeof t.mCustomScrollbar&&t.mCustomScrollbar("scrollTo","top"),cspml_show_listings_animation(i)}):("undefined"!=typeof NProgress&&(NProgress.configure({parent:"div#codespacing_progress_map_div_"+i,showSpinner:!0}),NProgress.start()),"true"==p&&cspml_show_listings_animation(i));var o={},v=[],g=[],f={};f[i]=[],t("form#cspml_"+s+"_filter_form[data-map-id="+i+"] input[type=text], form#cspml_"+s+"_filter_form[data-map-id="+i+"] input[type=radio]:checked, form#cspml_"+s+"_filter_form[data-map-id="+i+"] input[type=checkbox]:checked, form#cspml_"+s+"_filter_form[data-map-id="+i+"] select").each(function(){var a=void 0!==t(this).attr("name")&&t(this).attr("name").replace("[]","");if(a){var e=t("form#cspml_"+s+"_filter_form[data-map-id="+i+"] input[name="+a+"_filter_type]").val();if((g=[]).push(e),t(this).attr("name").indexOf("[]")>-1){var l=t(this).attr("name").split("[]"),c=l[0];if(c in o||(v=[]),2==l.length){if(void 0!==t(this).attr("value")&&t(this).attr("value").indexOf(",")>-1&&t(this).hasClass("cspml_show_all"))for(var n=t(this).attr("value").split(","),d=0;d<n.length;d+=1)v.push(n[d]);else v.push(t(this).val());o[c]=jQuery.merge(g,v)}else g.push(t(this).val()),o[t(this).attr("name")]=g}else{var c=t(this).attr("name");if(void 0!==t(this).attr("value")&&t(this).attr("value").indexOf(",")>-1&&t(this).hasClass("cspml_show_all")){for(var n=t(this).attr("value").split(","),d=0;d<n.length;d+=1)v.push(n[d]);o[c]=jQuery.merge(g,v)}else""!=t(this).val()&&(g.push(t(this).val()),o[c]=g)}}}),jQuery.post(cspml_vars.ajax_url,{action:"cspml_faceted_search_query",map_id:i,init_post_ids:l,filter_args:o,filter_form_call:!0,current_view:c,shortcode_page_id:n,page_template:d,template_tax_query:m,map_settings:progress_map_vars.map_script_args[i].map_settings,request_type:e,shortcode_page_link:r},function(a){f[i]=JSON.parse(a);var s=t("div#codespacing_progress_map_div_"+i);0!=s.length&&cspm_hide_all_markers(s).done(function(){cspm_set_markers_visibility(s,i,null,0,post_ids_and_categories[i],f[i],!0),cspm_simple_clustering(s,i),0==f[i].length?cspm_recenter_map(s,i):s.gmap3({autofit:{}}),"yes"==progress_map_vars.map_script_args[i].show_posts_count&&t("span.the_count_"+i).empty().html(f[i].length),"undefined"!=typeof NProgress&&NProgress.done()}),"true"==p&&(cspml_filter_listings(i,f[i],!1,"",!1,e),t("div#cspml_listings_container[data-map-id="+i+"]").attr("data-first-load","false"))})}),t(document).on("click","a.cspml_reset_lsitings_filter, a.cspml_mfs_reset_lsitings_filter",function(){var a=t(this).attr("data-map-id"),i=t("div#codespacing_progress_map_div_"+a),s=t(this).attr("data-display-location"),e=t(this).attr("data-request-type"),l=t("div.cspml_listings_area_"+a+" input[name=init_post_ids]").val(),c=t("div.cspml_listings_area_"+a+" input[name=count_init_post_ids]").val(),n=t("div.cspml_listings_area_"+a+" input[name=shortcode_page_id]").val(),d=t("div.cspml_listings_area_"+a+" input[name=page_template]").val(),m=t("div.cspml_listings_area_"+a+" input[name=template_tax_query]").val(),p=t("div.cspml_listings_area_"+a+" input[name=show_listings]").val(),r=t("div#cspml_listings_container[data-map-id="+a+"]").attr("data-first-load"),o=jQuery("div.cspml_listings_area_"+a+" input[name=shortcode_page_link]").val();if("true"==r)return!1;"map"!=s?t("html").animate({scrollTop:jQuery("div.cspml_list_and_filter_container[data-map-id="+a+"]").offset().top-200},function(){var t=jQuery(".cspml_listing_items_container[data-map-id="+a+"]");t.length&&"function"==typeof t.mCustomScrollbar&&t.mCustomScrollbar("scrollTo","top"),cspml_show_listings_animation(a)}):cspml_show_listings_animation(a);var v={};v[a]=[],0!=i.length&&("search_map"==progress_map_vars.map_script_args[a].map_type?(cspm_hide_all_markers(i),cspm_simple_clustering(i,a)):(cspm_set_markers_visibility(i,a,null,0,post_ids_and_categories[a],v[a],!1),cspm_simple_clustering(i,a),i.gmap3({autofit:{}}),"yes"==progress_map_vars.map_script_args[a].show_posts_count&&t("span.the_count_"+a).empty().html(v[a].length))),jQuery.post(cspml_vars.ajax_url,{action:"cspml_faceted_search_query",map_id:a,init_post_ids:l,post_ids:v[a],filter_args:[],filter_form_call:!0,shortcode_page_id:n,page_template:d,template_tax_query:m,map_settings:progress_map_vars.map_script_args[a].map_settings,request_type:e,shortcode_page_link:o},function(i){cspml_reset_filter_fields(a),"true"==p&&(cspml_filter_listings(a,v[a],!0,c,!0,e),t("div#cspml_listings_container[data-map-id="+a+"]").attr("data-first-load","true"))}),t("form#search_form_"+a).is(":visible")&&(t("form#search_form_"+a+" input#cspm_address_"+a).val("").trigger("focus"),t("a.cspm_reset_search_form_"+a).removeClass("fadeIn").hide("fast"))}),t(document).on("click",".cspml_fire_pinpoint",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-post-id"),s=t("div#codespacing_progress_map_div_"+a);if(s.length>0){s.gmap3("get");var e=t(this).attr("data-coords").split("_");t("html").animate({scrollTop:t("div#codespacing_progress_map_div_"+a).offset().top-100},500,function(){cspm_center_map_at_point(s,a,e[0],e[1],"zoom"),setTimeout(function(){cspm_animate_marker(s,a,i)},200),"content_style"!=progress_map_vars.infowindow_type&&(t("div.marker_holder div.pin_overlay_content").removeClass("pin_overlay_content-active"),t("div#bubble_"+i+"_"+a+" div.pin_overlay_content").addClass("pin_overlay_content-active"))})}}).css("cursor","pointer"),t(document).on("ifChanged","form.faceted_search_form input",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-show-carousel"),s=t("form#faceted_search_form_"+a).attr("data-ext");"no"==i&&"cspml_list"==s&&cspml_show_listings_animation(a),setTimeout(function(){var e=0;t("div.faceted_search_container_"+a+" form.faceted_search_form input").each(function(){!0==t(this).prop("checked")&&e++});var l=0==e,c=0==e?"reset":"filter";"no"==i&&"cspml_list"==s?void 0!==window.cspm_global_object.posts_to_retrieve[a]&&cspml_filter_listings(a,window.cspm_global_object.posts_to_retrieve[a],!0,"",l,c):cspml_hide_listings_animation(a)},1e3)}),t(document).on("click","a.cspm_search_in_ext_data, a.cspm_reset_ext_data",function(a){a.preventDefault();var i=t(this).attr("data-map-id"),s=t(this).attr("data-show-carousel"),e=t(this).attr("data-ext"),l="filter";t("div#cspml_listings_container[data-map-id="+i+"]").attr("data-first-load","false"),"no"==s&&"cspml_list"==e&&(cspml_show_listings_animation(i),cspml_reset_filter_fields(i));var c=t(this).hasClass("cspm_reset_ext_data");c&&(l="reset",t("div#cspml_listings_container[data-map-id="+i+"]").attr("data-first-load","true")),setTimeout(function(){"no"==s&&"cspml_list"==e&&void 0!==window.cspm_global_object.posts_to_retrieve[i]?cspml_filter_listings(i,window.cspm_global_object.posts_to_retrieve[i],!0,"",c,l):cspml_hide_listings_animation(i)},1e3)}),t(document).on("click","span.cspml_close_fs",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-filter-width");t(".cspml_listing_items_container[data-map-id="+a+"]").attr("data-map-cols"),t(".cspml_listing_items_container[data-map-id="+a+"]").attr("data-list-layout");var s="cspm-col-lg-"+(12-i)+" cspm-col-md-"+(12-i);t(".cspml_fs_container[data-map-id="+a+"]").is(":visible")?t(".cspml_listing_items_container[data-map-id="+a+"]").removeClass(s).addClass("cspm-col-lg-12 cspm-col-md-12"):t(".cspml_listing_items_container[data-map-id="+a+"]").removeClass("cspm-col-lg-12 cspm-col-md-12").addClass(s),t(".cspml_fs_container[data-map-id="+a+"]").toggle(),cspml_adjust_list_content_height(a)}),t(document).on("click",".cspm_expand_map_btn",function(){var a=t(this).attr("data-map-id"),i=t("div.cspml_resize_map[data-map-id="+a+"]").attr("data-map-height"),s=t("div#codespacing_progress_map_div_"+a),e=t('div.cspml_resize_map[data-map-id="'+a+'"] img'),l=e.attr("src");void 0!==i&&void 0!==l&&s.innerHeight()!=i.replace("px","")&&s.animate({height:i},600,function(){e.attr("src",l.replace("expand.svg","collapse.svg"))})}),t(document).on("click","div.cspml_resize_map",function(){var a=t(this).attr("data-map-id"),i=t(this).attr("data-map-height"),s=t('div.cspml_resize_map[data-map-id="'+a+'"] img'),e=s.attr("src"),l=t("div#codespacing_progress_map_div_"+a);void 0!==i&&void 0!==e&&(l.innerHeight()!=i.replace("px","")?l.animate({height:i},600,function(){s.attr("src",e.replace("expand.svg","collapse.svg"))}):l.animate({height:"100px"},600,function(){s.attr("src",e.replace("collapse.svg","expand.svg")),t("div.search_form_container_"+a).is(":visible")&&(t("div.search_form_container_"+a).removeClass("fadeInUp").addClass("cspm_animated slideOutLeft"),setTimeout(function(){t("div.search_form_container_"+a).css({display:"none"})},200)),t("div.faceted_search_container_"+a).is(":visible")&&(t("div.faceted_search_container_"+a).removeClass("slideInLeft").addClass("cspm_animated slideOutLeft"),setTimeout(function(){t("div.faceted_search_container_"+a).css({display:"none"})},200)),t("div.countries_container_"+a).is(":visible")&&(t("div.countries_container_"+a).removeClass("slideInLeft").addClass("cspm_animated slideOutLeft"),setTimeout(function(){t("div.countries_container_"+a).css({display:"none"})},200),t("li.cspm_country_name[data-map-id="+a+"]").removeClass("selected"))}))}),t("input.cspml_keyword").keypress(function(a){if(13==a.keyCode){a.preventDefault();var i=t(this).closest("div.cspml_fs_options_list").attr("data-map-id");""==t(this).val()||t("div#cspml_loading_container_"+i).is(":visible")||t("a.cspml_submit_listings_filter[data-map-id="+i+"]").eq(0).trigger("click")}})}(jQuery);