(()=>{function e(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==a.return||a.return()}finally{if(s)throw i}}}}function n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}jQuery(document).ready(function(n){function t(t,a){if(1!=a.find(":input").length){var o,i={address_line_1:"",address_line_2:"",city:"",state:"",zip:"",country:""},l=e(t.address_components);try{for(l.s();!(o=l.n()).done;){var s=o.value;switch(s.types[0]){case"street_number":if(r(t.name,s.long_name))break;i.address_line_1="".concat(s.long_name," ").concat(i.address_line_1).trim();break;case"route":if(r(t.name,s.short_name))break;i.address_line_1?i.address_line_1+=" "+s.short_name:i.address_line_1=s.short_name;break;case"postal_code":i.zip="".concat(s.long_name).concat(i.zip);break;case"postal_code_suffix":i.zip="".concat(i.zip,"-").concat(s.long_name);break;case"locality":i.city=s.long_name;break;case"administrative_area_level_2":i.city||(i.city=s.long_name);break;case"administrative_area_level_3":case"administrative_area_level_4":i.address_line_2?i.address_line_2=" "+s.short_name:i.address_line_2=s.short_name;case"administrative_area_level_1":i.state=s.long_name;break;case"country":i.country=s.short_name}}}catch(e){l.e(e)}finally{l.f()}i.address_line_1||(i.address_line_1=t.name),t.name!=i.address_line_1&&void 0!==t.name&&(a.find("input[data-key_name='address_line_2']").length?(i.address_line_2=i.address_line_1,i.address_line_1=t.name):i.address_line_1=t.name+" "+i.address_line_1),a.find(":input").val("").trigger("change"),n.each(i,(function(e,n){n&&("country"==e?a.find("select[data-key_name='"+e+"']").val(n).trigger("change"):a.find("input[data-key_name='"+e+"']").val(n).trigger("change"))}))}}function a(e,a,o){if(void 0!==o.data("ff_with_g_map")){var r=n(e).closest(".ff_map_autocomplete");if($mapDom=r.find(".ff_g_map"),$mapDom.length||(n("<div/>",{class:"ff_g_map",id:"ff_map_elm_"+n(e).attr("id"),style:"height:300px"}).appendTo(r),$mapDom=r.find(".ff_g_map")),document.getElementById($mapDom.attr("id"))){var i=new google.maps.Map(document.getElementById($mapDom.attr("id")),{center:{lat:50.064192,lng:-130.605469},zoom:3}),l=new google.maps.Marker({map:i,draggable:!0,anchorPoint:new google.maps.Point(0,-29)});if(l.setVisible(!1),!a.geometry||!a.geometry.location)return;google.maps.event.addListener(l,"dragend",(function(e){(new google.maps.Geocoder).geocode({latLng:e.latLng},(function(n,a){a==google.maps.GeocoderStatus.OK&&n[0]&&(n[0].latLng=e.latLng,t(n[0],o))}))})),a.geometry.viewport?i.fitBounds(a.geometry.viewport):(i.setCenter(a.geometry.location),i.setZoom(17)),l.setPosition(a.geometry.location),l.setVisible(!0)}}}function o(e,o){navigator.geolocation?navigator.geolocation.getCurrentPosition((function(n){var r={lat:n.coords.latitude,lng:n.coords.longitude};(new google.maps.Geocoder).geocode({latLng:r},(function(n,i){i==google.maps.GeocoderStatus.OK&&n[0]&&(n[0].latLng=r,t(n[0],o),a(e,n[0],o))}))}),(function(){n(e).val("")})):n(e).val("")}function r(e,n){return e&&e.includes(n)}n(document).on("elementor/popup/show",(function(e,n,t){window.fluentform_gmap_callback()})),window.fluentform_gmap_callback=function(){n(".ff_map_autocomplete").each((function(e,r){var i=n(r),l=i.find("input[data-key_name='address_line_1']").attr("id"),s=i.find("#"+l)[0],c=void 0!==i.data("ff_with_auto_locate")&&i.data("ff_with_auto_locate"),d=new google.maps.places.Autocomplete(s,{fields:["formatted_address","name","address_components","geometry","icon"]});if($country=i.find("select[data-key_name='country']"),$country.length){var _=$country.data("autocomplete_restrictions"),m=[];for(var f in _)m.push(_[f]);m.length>0&&d.setComponentRestrictions({country:m})}c&&"no"!=c&&("on_load"==c&&o(s,i),n(s).parent().find(".ff_input-group-append").on("click",(function(){n(s).val("Please wait .."),o(s,i)})));d.addListener("place_changed",(function(){var e=d.getPlace();e.latLng=e.geometry.location,a(s,e,i),t(e,i)}))}))}}(jQuery))})();