File: /home/kbdhpghp/atenaleaders.com.br/wp-content/plugins/fluid-checkout/js/country-select-323.min.js
jQuery(function(p){if("undefined"==typeof wc_country_select_params)return!1;var m=window.TomSelect&&window.fcSettings&&fcSettings.use_enhanced_select&&"yes"===fcSettings.use_enhanced_select,e=(m&&window.FCEnhancedSelect&&p(document.body).on("country_to_state_changed",function(){FCEnhancedSelect.enhanceFields("select.state_select")}),p().selectWoo&&!m&&((e=function(){requestAnimationFrame(function(){p("select.country_select, select.state_select").each(function(){var n=p(this),e=n.attr("id"),t=document.querySelector(".select2-container--open"),c=null!=t&&null!=t.querySelector("#select2-"+e+"-results"),t=(n.off("select2:select"),n.parent().find(".select2-container").remove(),p.extend({placeholder:n.attr("data-placeholder")||n.attr("placeholder")||"",label:n.attr("data-label")||null,width:"100%"},{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(e){e=e.input.length-e.maximum;return 1==e?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(e){e=e.minimum-e.input.length;return 1==e?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(e){return 1===e.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",e.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}}));p(this).on("select2:select",function(){p(this).trigger("focus")}).selectWoo(t),FCUtils.maybeRefocusElement(window.fcCurrentFocusedElement,window.fcCurrentFocusedElementValue),setTimeout(function(){if(c&&"function"==typeof n.selectWoo){for(var e=document.querySelectorAll(".select2-container--open"),t=0;t<e.length;t++)e[t].remove();n.selectWoo("open")}},50)})})})(),p(document.body).on("country_to_state_changed",e),p(document.body).on("updated_checkout",e),p(document.body).on("wc_fragments_refreshed",e)),wc_country_select_params.countries.replace(/"/g,'"')),h=JSON.parse(e),f=".woocommerce-billing-fields,.woocommerce-shipping-fields,.woocommerce-address-fields,.woocommerce-shipping-calculator";p(document.body).on("change refresh","select.country_to_state, input.country_to_state",function(){var e,t,n,c=p(this).closest(f),o=(FCUtils.maybeSetCurrentFocusedElementGlobalVariablesRelativeSelect2(),c.length||(c=p(this).closest(".form-row").parent()),p(this).val()),s=c.find("#state, #billing_state, #shipping_state, #calc_shipping_state"),a=s.closest(".form-row"),r=s.attr("name"),l=s.attr("id"),i=s.attr("data-input-classes"),u=s.val(),_=s.attr("placeholder")||s.attr("data-placeholder")||"",d=["fc-select-field--hidden","fc-select-field--text","fc-select-field--select"];m&&(n=s.get(0),0<s.length)&&n.tomselect&&n.tomselect.destroy(),h[o]?(p.isEmptyObject(h[o])?(e=p('<input type="hidden" />').prop("id",l).prop("name",r).prop("placeholder",_).attr("data-input-classes",i).addClass("hidden "+i),a.hide().find(".select2-container").remove(),s.replaceWith(e),a.removeClass(d).addClass("fc-select-field--hidden")):(t=h[o],n=p('<option value=""></option>').text(wc_country_select_params.i18n_select_state_text),_=_||wc_country_select_params.i18n_select_state_text,a.show(),s.is("input")&&(e=p("<select></select>").prop("id",l).prop("name",r).data("placeholder",_).attr("data-input-classes",i).addClass("state_select "+i),s.replaceWith(e),s=c.find("#state, #billing_state, #shipping_state, #calc_shipping_state")),s.empty().append(n),p.each(t,function(e){e=p("<option></option>").prop("value",e).text(t[e]);s.append(e)}),s.val(u).trigger("change"),a.removeClass(d).addClass("fc-select-field--select")),p(document.body).trigger("country_to_state_changed",[o,c])):s.is('select, input[type="hidden"]')&&(e=p('<input type="text" />').prop("id",l).prop("name",r).prop("placeholder",_).attr("data-input-classes",i).addClass("input-text "+i),a.show().find(".select2-container").remove(),s.replaceWith(e),a.removeClass(d).addClass("fc-select-field--text"),p(document.body).trigger("country_to_state_changed",[o,c])),FCUtils.maybeRefocusElement(window.fcCurrentFocusedElement,window.fcCurrentFocusedElementValue),p(document.body).trigger("country_to_state_changing",[o,c])}),p(document.body).on("wc_address_i18n_ready",function(){p(f).each(function(){var e=p(this).find("#country, #billing_country, #shipping_country, #calc_shipping_country");0!==e.length&&0!==e.val().length&&e.trigger("refresh")})})});
//# sourceMappingURL=maps/country-select-323.min.js.map