From 396b2424a615aaa537968e73677f533486cf2102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rabbi=20Islam=20Rony=20=E2=9A=A1=EF=B8=8F?= <35329385+RabbiIslamRony@users.noreply.github.com> Date: Tue, 10 Feb 2026 14:36:34 +0600 Subject: [PATCH 1/2] =?UTF-8?q?perf:=20optimize=20webpack=20build=20?= =?UTF-8?q?=E2=80=94=20add=20externals,=20splitChunks,=20and=20slim=20prod?= =?UTF-8?q?uction=20zip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add webpack externals for WordPress-provided packages (React, ReactDOM, lodash, @wordpress/element, @wordpress/components, @wordpress/api-fetch, @wordpress/hooks, @wordpress/i18n, @wordpress/dom-ready, @wordpress/dataviews) so they resolve from wp.* globals instead of being re-bundled. - Add optimization.splitChunks to extract shared Vue/Vuex vendor code into a single admin-vue-vendor chunk, eliminating duplication across admin-multi-directory-builder and admin-settings-manager. - Remove redundant dev (unminified) build from webpack.prod.js — dev output now only comes from webpack.dev.js and webpack.dev.vue.js where it belongs. - Restructure FileManagerPlugin copy rules to produce a leaner zip: only minified JS/CSS, icon woff2+css (no SVGs), block build output (no src). - Update PHP script dependencies in scripts.php: register admin-vue-vendor as a shared dep for both Vue admin scripts; declare all externalized WP packages for formgent-integration. Results: formgent-integration.min.js 1,976 KB → 117 KB (−94%) Total minified JS 3.89 MB → 1.87 MB (−52%) Production JS file count 78 → 40 (−49%) Zip size 14 MB → 6.48 MB (−54%) --- assets/js/account.min.js | 2 +- assets/js/add-listing-google-map.min.js | 2 +- assets/js/add-listing.min.js | 2 +- assets/js/admin-builder-archive.min.js | 2 +- assets/js/admin-main.min.js | 2 +- .../js/admin-multi-directory-builder.min.js | 2 +- ...multi-directory-builder.min.js.LICENSE.txt | 12 -- assets/js/admin-settings-manager.min.js | 2 +- .../admin-settings-manager.min.js.LICENSE.txt | 12 -- assets/js/admin-vue-vendor.min.js | 2 + assets/js/admin-vue-vendor.min.js.LICENSE.txt | 11 ++ assets/js/all-authors.min.js | 2 +- assets/js/all-listings.min.js | 2 +- assets/js/author-profile.min.js | 2 +- assets/js/directorist-dashboard.min.js | 2 +- assets/js/formgent-integration.min.js | 67 ++++---- .../formgent-integration.min.js.LICENSE.txt | 82 ---------- assets/js/global-main.min.js | 2 +- assets/js/google-map.min.js | 2 +- assets/js/openstreet-map.min.js | 2 +- assets/js/public-main.min.js | 2 +- assets/js/search-form.min.js | 2 +- assets/js/single-listing.min.js | 2 +- includes/asset-loader/scripts.php | 19 ++- webpack.common.js | 13 ++ webpack.dev.vue.js | 12 ++ webpack.prod.js | 146 +++++++++++++----- 27 files changed, 208 insertions(+), 202 deletions(-) create mode 100644 assets/js/admin-vue-vendor.min.js create mode 100644 assets/js/admin-vue-vendor.min.js.LICENSE.txt diff --git a/assets/js/account.min.js b/assets/js/account.min.js index 8fa1ca99dd..602418f13a 100644 --- a/assets/js/account.min.js +++ b/assets/js/account.min.js @@ -1 +1 @@ -!function(){var t={42665:function(){var t=jQuery;t(document).ready(function(){!function(){t(".atbdp_recovery_pass").on("click",function(e){e.preventDefault(),t("#recover-pass-modal").slideToggle().show()}),t("#atbdp-contact-modal").on("hidden.bs.modal",function(e){t("#atbdp-contact-message").val(""),t("#atbdp-contact-message-display").html("")});var e=new Map;function r(t){if(t&&e.has(t)){var r=e.get(t),i=r.parent;i&&document.body.contains(i)&&(r.nextSibling&&i.contains(r.nextSibling)?i.insertBefore(t,r.nextSibling):i.appendChild(t))}}t("body").on("click",".directorist-btn-modal-js",function(r){r.preventDefault();var i=t(this).attr("data-directorist_target"),o=document.querySelector(".".concat(i));o&&(o.parentElement!==document.body&&(e.has(o)||e.set(o,{parent:o.parentElement,nextSibling:o.nextSibling}),document.body.appendChild(o)),o.classList.add("directorist-show"))}),t("body").on("click",".directorist-modal-close-js",function(e){e.preventDefault();var i=t(this).closest(".directorist-modal-js");i.removeClass("directorist-show"),r(i[0])}),t("body").on("click",".directorist-modal-js",function(e){e.target===this&&t(this).hasClass("directorist-show")&&(t(this).removeClass("directorist-show"),r(this))})}()})},87198:function(){var t;t=jQuery,void 0===window.directorist_alert_executed&&(window.directorist_alert_executed=!0,window.addEventListener("load",function(){var e=window.location.href.replace("notice=1","");null!==t(".directorist-alert__close")&&t(".directorist-alert__close").each(function(r,i){t(i).on("click",function(r){r.preventDefault(),history.pushState({},null,e),t(this).closest(".directorist-alert").remove()})})}))},38827:function(){var t;t=jQuery,void 0===window.directorist_loginjs_executed&&(window.directorist_loginjs_executed=!0,document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".directorist-password-group").forEach(function(t){var e=t.querySelector(".directorist-password-group-input"),r=t.querySelector(".directorist-password-group-toggle"),i=t.querySelector(".directorist-password-group-eyeIcon");e&&r&&r.addEventListener("click",function(){var t="password"===e.getAttribute("type")?"text":"password";e.setAttribute("type",t),i&&(i.innerHTML="text"===t?'\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t':'\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t')})})}),t(".directorist-authentication__btn").on("click",function(){t(".directorist__authentication__signin").each(function(){this.reset()}),t("#directorist__authentication__login p.status").hide().empty()}),window.addEventListener("load",function(){t("form#directorist__authentication__login").on("submit",function(e){e.preventDefault();var r=t(this),i=t(this).find(".directorist-authentication__form__btn");i.addClass("directorist-btn-loading"),t("#directorist__authentication__login p.status").show().html('
'+directorist.loading_message+"
");var o={action:"ajaxlogin",username:r.find("#username").val(),password:r.find("#password").val(),rememberme:r.find("#keep_signed_in").is(":checked")?1:0,security:r.find("#security").val()};t.ajax({type:"POST",dataType:"json",url:directorist.ajax_url,data:o,success:function(e){setTimeout(function(){return i.removeClass("directorist-btn-loading")},1e3),"nonce_faild"in e&&e.nonce_faild&&t("p.status").html('
'+e.message+"
"),1==e.loggedin?(t("p.status").html('
'+e.message+"
"),document.location.href=directorist.redirect_url):t("p.status").html('
'+e.message+"
")},error:function(e){"nonce_faild"in e&&e.nonce_faild&&t("p.status").html('
'+e.message+"
"),t("p.status").show().html('
'+directorist.login_error_message+"
")}}),e.preventDefault()}),t("form#directorist__authentication__login .status").on("click","a",function(e){e.preventDefault(),"#atbdp_recovery_pass"===t(this).attr("href")?(t("#recover-pass-modal").slideDown().show(),window.scrollTo({top:t("#recover-pass-modal").offset().top-100,behavior:"smooth"})):location.href=t(this).attr("href")}),t(".atbdp-require-login, .directorist-action-report-not-loggedin").on("click",function(t){return t.preventDefault(),alert(directorist.login_alert_message),!1});var e=location.href,r=new URL(e);r.searchParams.delete("registration_status"),r.searchParams.delete("errors"),r.searchParams.delete("password_reset"),r.searchParams.delete("confirm_mail"),r.searchParams.delete("verification"),r.searchParams.delete("send_verification_email"),window.history.pushState(null,null,r.toString()),t("body").on("click",".directorist-authentication__btn, .directorist-authentication__toggle",function(e){e.preventDefault(),t(".directorist-login-wrapper").toggleClass("active"),t(".directorist-registration-wrapper").toggleClass("active")})}))},37900:function(){jQuery(function(t){t(".directorist-authentication__btn").on("click",function(){t(".directorist__authentication__signup").each(function(){this.reset()}),t(".directorist-alert ").hide().empty(),t(".directorist-register-error").hide().empty()}),t(".directorist__authentication__signup .directorist-authentication__form__btn").on("click",function(e){e.preventDefault(),$this=t(this),$this.addClass("directorist-btn-loading");var r=$this.closest(".directorist__authentication__signup")[0];if(!r.checkValidity())return r.reportValidity(),void $this.removeClass("directorist-btn-loading");var i=new FormData(r);i.append("action","directorist_register_form"),i.append("params",JSON.stringify(directorist_signin_signup_params)),t.ajax({url:directorist.ajaxurl,type:"POST",data:i,contentType:!1,processData:!1,cache:!1}).done(function(e){var r=e.data,i=e.success;setTimeout(function(){return $this.removeClass("directorist-btn-loading")},1e3),i?(t(".directorist-register-error").hide(),r.message&&t(".directorist-register-error").empty().show().append(r.message).css({color:"#009114","background-color":"#d9efdc"}),r.redirect_url&&setTimeout(function(){return window.location.href=r.redirect_url},500)):t(".directorist-register-error").empty().show().append(r.error)})})})},99867:function(){jQuery(function(t){t(".directorist-ResetPassword").on("submit",function(){var e=t(this);return e.find("#password_1").val()!=e.find("#password_2").val()?(e.find(".password-not-match").show(),!1):(e.find(".password-not-match").hide(),!0)})})}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";r(87198),r(38827),r(99867),r(37900),r(42665)}()}(); \ No newline at end of file +!function(){var t={2665:function(){var t=jQuery;t(document).ready(function(){!function(){t(".atbdp_recovery_pass").on("click",function(e){e.preventDefault(),t("#recover-pass-modal").slideToggle().show()}),t("#atbdp-contact-modal").on("hidden.bs.modal",function(e){t("#atbdp-contact-message").val(""),t("#atbdp-contact-message-display").html("")});var e=new Map;function r(t){if(t&&e.has(t)){var r=e.get(t),i=r.parent;i&&document.body.contains(i)&&(r.nextSibling&&i.contains(r.nextSibling)?i.insertBefore(t,r.nextSibling):i.appendChild(t))}}t("body").on("click",".directorist-btn-modal-js",function(r){r.preventDefault();var i=t(this).attr("data-directorist_target"),o=document.querySelector(".".concat(i));o&&(o.parentElement!==document.body&&(e.has(o)||e.set(o,{parent:o.parentElement,nextSibling:o.nextSibling}),document.body.appendChild(o)),o.classList.add("directorist-show"))}),t("body").on("click",".directorist-modal-close-js",function(e){e.preventDefault();var i=t(this).closest(".directorist-modal-js");i.removeClass("directorist-show"),r(i[0])}),t("body").on("click",".directorist-modal-js",function(e){e.target===this&&t(this).hasClass("directorist-show")&&(t(this).removeClass("directorist-show"),r(this))})}()})},7198:function(){var t;t=jQuery,void 0===window.directorist_alert_executed&&(window.directorist_alert_executed=!0,window.addEventListener("load",function(){var e=window.location.href.replace("notice=1","");null!==t(".directorist-alert__close")&&t(".directorist-alert__close").each(function(r,i){t(i).on("click",function(r){r.preventDefault(),history.pushState({},null,e),t(this).closest(".directorist-alert").remove()})})}))},7900:function(){jQuery(function(t){t(".directorist-authentication__btn").on("click",function(){t(".directorist__authentication__signup").each(function(){this.reset()}),t(".directorist-alert ").hide().empty(),t(".directorist-register-error").hide().empty()}),t(".directorist__authentication__signup .directorist-authentication__form__btn").on("click",function(e){e.preventDefault(),$this=t(this),$this.addClass("directorist-btn-loading");var r=$this.closest(".directorist__authentication__signup")[0];if(!r.checkValidity())return r.reportValidity(),void $this.removeClass("directorist-btn-loading");var i=new FormData(r);i.append("action","directorist_register_form"),i.append("params",JSON.stringify(directorist_signin_signup_params)),t.ajax({url:directorist.ajaxurl,type:"POST",data:i,contentType:!1,processData:!1,cache:!1}).done(function(e){var r=e.data,i=e.success;setTimeout(function(){return $this.removeClass("directorist-btn-loading")},1e3),i?(t(".directorist-register-error").hide(),r.message&&t(".directorist-register-error").empty().show().append(r.message).css({color:"#009114","background-color":"#d9efdc"}),r.redirect_url&&setTimeout(function(){return window.location.href=r.redirect_url},500)):t(".directorist-register-error").empty().show().append(r.error)})})})},8827:function(){var t;t=jQuery,void 0===window.directorist_loginjs_executed&&(window.directorist_loginjs_executed=!0,document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".directorist-password-group").forEach(function(t){var e=t.querySelector(".directorist-password-group-input"),r=t.querySelector(".directorist-password-group-toggle"),i=t.querySelector(".directorist-password-group-eyeIcon");e&&r&&r.addEventListener("click",function(){var t="password"===e.getAttribute("type")?"text":"password";e.setAttribute("type",t),i&&(i.innerHTML="text"===t?'\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t':'\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t')})})}),t(".directorist-authentication__btn").on("click",function(){t(".directorist__authentication__signin").each(function(){this.reset()}),t("#directorist__authentication__login p.status").hide().empty()}),window.addEventListener("load",function(){t("form#directorist__authentication__login").on("submit",function(e){e.preventDefault();var r=t(this),i=t(this).find(".directorist-authentication__form__btn");i.addClass("directorist-btn-loading"),t("#directorist__authentication__login p.status").show().html('
'+directorist.loading_message+"
");var o={action:"ajaxlogin",username:r.find("#username").val(),password:r.find("#password").val(),rememberme:r.find("#keep_signed_in").is(":checked")?1:0,security:r.find("#security").val()};t.ajax({type:"POST",dataType:"json",url:directorist.ajax_url,data:o,success:function(e){setTimeout(function(){return i.removeClass("directorist-btn-loading")},1e3),"nonce_faild"in e&&e.nonce_faild&&t("p.status").html('
'+e.message+"
"),1==e.loggedin?(t("p.status").html('
'+e.message+"
"),document.location.href=directorist.redirect_url):t("p.status").html('
'+e.message+"
")},error:function(e){"nonce_faild"in e&&e.nonce_faild&&t("p.status").html('
'+e.message+"
"),t("p.status").show().html('
'+directorist.login_error_message+"
")}}),e.preventDefault()}),t("form#directorist__authentication__login .status").on("click","a",function(e){e.preventDefault(),"#atbdp_recovery_pass"===t(this).attr("href")?(t("#recover-pass-modal").slideDown().show(),window.scrollTo({top:t("#recover-pass-modal").offset().top-100,behavior:"smooth"})):location.href=t(this).attr("href")}),t(".atbdp-require-login, .directorist-action-report-not-loggedin").on("click",function(t){return t.preventDefault(),alert(directorist.login_alert_message),!1});var e=location.href,r=new URL(e);r.searchParams.delete("registration_status"),r.searchParams.delete("errors"),r.searchParams.delete("password_reset"),r.searchParams.delete("confirm_mail"),r.searchParams.delete("verification"),r.searchParams.delete("send_verification_email"),window.history.pushState(null,null,r.toString()),t("body").on("click",".directorist-authentication__btn, .directorist-authentication__toggle",function(e){e.preventDefault(),t(".directorist-login-wrapper").toggleClass("active"),t(".directorist-registration-wrapper").toggleClass("active")})}))},9867:function(){jQuery(function(t){t(".directorist-ResetPassword").on("submit",function(){var e=t(this);return e.find("#password_1").val()!=e.find("#password_2").val()?(e.find(".password-not-match").show(),!1):(e.find(".password-not-match").hide(),!0)})})}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";r(7198),r(8827),r(9867),r(7900),r(2665)}()}(); \ No newline at end of file diff --git a/assets/js/add-listing-google-map.min.js b/assets/js/add-listing-google-map.min.js index 329b24d078..9a226e3793 100644 --- a/assets/js/add-listing-google-map.min.js +++ b/assets/js/add-listing-google-map.min.js @@ -1 +1 @@ -!function(){"use strict";var e={83371:function(e,t,n){function a(e,t){e=".directorist-dom-data-"+e,t||(t=document);var n=t.querySelector(e);if(!n||!n.dataset.value)return{};var a=directorist&&directorist.script_debugging&&"1"==directorist.script_debugging;try{var o=atob(n.dataset.value);return JSON.parse(o)}catch(e){return a&&console.log(n,e),{}}}n.d(t,{L:function(){return a}})}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var a=n(83371),o=jQuery;function r(){if("undefined"!=typeof google&&google.maps&&google.maps.Geocoder&&o("#gmap").length){var e,t,n,r,l,i,c,s=(0,a.L)("map_data"),g=parseFloat(s.default_latitude),d=parseFloat(s.default_longitude),u=parseFloat(s.manual_lat),m=parseFloat(s.manual_lng),p=parseInt(s.map_zoom_level),v=document.createElement("div");v.className="atbd_map_shape",v.innerHTML='',u=isNaN(u)?g:u,m=isNaN(m)?d:m,l=o("#manual_lat"),i=o("#manual_lng"),c={lat:u,lng:m},r=[],null!==(n=document.getElementById("address"))&&n.addEventListener("focus",L);var f=new google.maps.Geocoder;function _(e){e.addListener("dragend",function(e){var t=e.latLng.lat(),n=e.latLng.lng();l.val(t),i.val(n),k(f,t,n)})}function y(e){if(!e||!e.address_components)return"";var t=e.address_components;return t.length>0&&t[0].long_name&&t[0].long_name.includes("+")&&(t=t.slice(1)),t.map(function(e){return e.long_name}).join(", ")}function k(e,t,a){var o={location:new google.maps.LatLng(t,a)};e.geocode(o,function(e,t){if("OK"===t&&e[0]){var a=y(e[0]);n.value=a}})}function L(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(e){var n={lat:e.coords.latitude,lng:e.coords.longitude},a=new google.maps.Circle({center:n,radius:e.coords.accuracy});t.setBounds(a.getBounds())})}function b(){var e={types:["geocode"],componentRestrictions:{country:directorist.restricted_countries}},a=directorist.countryRestriction?e:{types:[]};(t=new google.maps.places.Autocomplete(n,a)).addListener("place_changed",h)}function h(){var n=t.getPlace();l.val(n.geometry.location.lat()),i.val(n.geometry.location.lng()),e.setCenter(n.geometry.location);var a=new google.maps.marker.AdvancedMarkerElement({map:e,position:n.geometry.location,gmpDraggable:!0,content:v,title:s.marker_title});B(),r.push(a),_(a)}function w(){e=new google.maps.Map(document.getElementById("gmap"),{zoom:p,center:c,mapId:"add_listing_map"});var t=new google.maps.marker.AdvancedMarkerElement({map:e,position:c,gmpDraggable:!0,content:v,title:s.marker_title});r.push(t),document.getElementById("generate_admin_map").addEventListener("click",function(t){t.preventDefault(),E(f,e)}),t.addListener("click",function(t){B();var n=t.latLng.lat(),a=t.latLng.lng();l.val(n),i.val(a),k(f,n,a),N(t.latLng,e)}),_(t)}function E(e,t){var a=parseFloat(document.getElementById("manual_lat").value),o=parseFloat(document.getElementById("manual_lng").value),c=new google.maps.LatLng(a,o),g={location:c};e.geocode(g,function(e,g){if("OK"===g){l.val(a),i.val(o),t.setCenter(c);var d=new google.maps.marker.AdvancedMarkerElement({map:t,position:c,gmpDraggable:!0,content:v,title:s.marker_title});B(),r.push(d);var u=y(e[0]);n.value=u,_(d)}else alert(s.geocode_error_msg+g)})}function N(e,t){var n=new google.maps.marker.AdvancedMarkerElement({map:t,position:e,gmpDraggable:!0,content:v,title:s.marker_title});r.push(n),_(n)}function B(){for(var e=0;e',u=isNaN(u)?g:u,m=isNaN(m)?d:m,l=o("#manual_lat"),i=o("#manual_lng"),c={lat:u,lng:m},r=[],null!==(n=document.getElementById("address"))&&n.addEventListener("focus",L);var f=new google.maps.Geocoder;function _(e){e.addListener("dragend",function(e){var t=e.latLng.lat(),n=e.latLng.lng();l.val(t),i.val(n),k(f,t,n)})}function y(e){if(!e||!e.address_components)return"";var t=e.address_components;return t.length>0&&t[0].long_name&&t[0].long_name.includes("+")&&(t=t.slice(1)),t.map(function(e){return e.long_name}).join(", ")}function k(e,t,a){var o={location:new google.maps.LatLng(t,a)};e.geocode(o,function(e,t){if("OK"===t&&e[0]){var a=y(e[0]);n.value=a}})}function L(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(e){var n={lat:e.coords.latitude,lng:e.coords.longitude},a=new google.maps.Circle({center:n,radius:e.coords.accuracy});t.setBounds(a.getBounds())})}function b(){var e={types:["geocode"],componentRestrictions:{country:directorist.restricted_countries}},a=directorist.countryRestriction?e:{types:[]};(t=new google.maps.places.Autocomplete(n,a)).addListener("place_changed",h)}function h(){var n=t.getPlace();l.val(n.geometry.location.lat()),i.val(n.geometry.location.lng()),e.setCenter(n.geometry.location);var a=new google.maps.marker.AdvancedMarkerElement({map:e,position:n.geometry.location,gmpDraggable:!0,content:v,title:s.marker_title});B(),r.push(a),_(a)}function w(){e=new google.maps.Map(document.getElementById("gmap"),{zoom:p,center:c,mapId:"add_listing_map"});var t=new google.maps.marker.AdvancedMarkerElement({map:e,position:c,gmpDraggable:!0,content:v,title:s.marker_title});r.push(t),document.getElementById("generate_admin_map").addEventListener("click",function(t){t.preventDefault(),E(f,e)}),t.addListener("click",function(t){B();var n=t.latLng.lat(),a=t.latLng.lng();l.val(n),i.val(a),k(f,n,a),N(t.latLng,e)}),_(t)}function E(e,t){var a=parseFloat(document.getElementById("manual_lat").value),o=parseFloat(document.getElementById("manual_lng").value),c=new google.maps.LatLng(a,o),g={location:c};e.geocode(g,function(e,g){if("OK"===g){l.val(a),i.val(o),t.setCenter(c);var d=new google.maps.marker.AdvancedMarkerElement({map:t,position:c,gmpDraggable:!0,content:v,title:s.marker_title});B(),r.push(d);var u=y(e[0]);n.value=u,_(d)}else alert(s.geocode_error_msg+g)})}function N(e,t){var n=new google.maps.marker.AdvancedMarkerElement({map:t,position:e,gmpDraggable:!0,content:v,title:s.marker_title});r.push(n),_(n)}function B(){for(var e=0;et.length)&&(e=t.length);for(var i=0,r=Array(e);i'.concat(r,"");t.append(o)}var c=t.find(".directorist-select2-dropdown-toggle");e(".select2-hidden-accessible").on("select2:open",function(t){e(this).next().find(".directorist-select2-dropdown-toggle").addClass("--is-open")}),e(".select2-hidden-accessible").on("select2:close",function(t){e(this).next().find(".directorist-select2-dropdown-toggle").removeClass("--is-open");var i=e(this).closest(".directorist-search-field");e(this).next().find(".select2-selection__rendered").attr("title")?i.addClass("input-has-value"):i.removeClass("input-is-focused")}),c.on("click",function(t){var i=e(this).hasClass("--is-open"),r=e(this).closest(".select2-container").siblings("select:enabled");i?r.select2("close"):r.select2("open")}),a()}}(),function(){var i=e(".select2-hidden-accessible");if(i||i.length){var r,n=function(e,i){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,i){if(e){if("string"==typeof e)return t(e,i);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(t){throw t},f:n}}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 a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var t=r.next();return c=t.done,t},e:function(t){s=!0,a=t},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}(i);try{for(n.s();!(r=n.n()).done;){var a=r.value;e(a).children("option:selected").val()&&o(a)}}catch(t){n.e(t)}finally{n.f()}}}(),e(".select2-hidden-accessible").on("change",function(t){if(e(this).children("option:selected").val()){o(e(this)),this.parentElement.querySelectorAll(".select2-selection__choice").forEach(function(t){t.childNodes&&t.childNodes.forEach(function(e){if(e.nodeType&&e.nodeType===Node.TEXT_NODE){var i=e.textContent.replace(/^[\s\xa0]+/,"");e.textContent=i,t.title=i}})});var i=this.parentElement.querySelector(".select2-selection__rendered");i.childNodes&&i.childNodes.forEach(function(t){if(t.nodeType&&t.nodeType===Node.TEXT_NODE){var e=t.textContent.replace(/^[\s\xa0]+/,"");t.textContent=e}})}})}function o(t){e(".select2-selection__clear").css({display:"none"});var i=n(t);if(i&&i.length){i.find(".directorist-select2-dropdown-close").remove();var r=directorist.assets_url+"icons/font-awesome/svgs/solid/times.svg",o=directorist.icon_markup.replace("##URL##",r).replace("##CLASS##","");i.prepend(''.concat(o,"")),i.find(".directorist-select2-dropdown-close").on("click",function(t){e(this).closest(".select2-container").siblings("select:enabled").val(null).trigger("change"),i.find(".directorist-select2-dropdown-close").remove(),a()}),a()}}function n(t){var i=t?e(t).next(".select2-container"):e(".select2-container");if((i=e(i).find(".directorist-select2-addons-area")).length||(e(".select2-container").append(''),i=e(".select2-container").find(".directorist-select2-addons-area")),!(i=t?e(t).next(".select2-container"):null))return null;var r=e(i).find(".directorist-select2-addons-area");return r.length?r:(i.append(''),i.find(".directorist-select2-addons-area"))}function a(){var t=e(".select2-container").find(".directorist-select2-addons-area");if(t.length){var i=t.outerWidth();e(".select2-container").find(".select2-selection__rendered").css({"padding-right":i+"px"})}}window.addEventListener("load",i),window.addEventListener("directorist-search-form-nav-tab-reloaded",i),window.addEventListener("directorist-type-change",i),window.addEventListener("directorist-instant-search-reloaded",i)},3563:function(){var t;t=jQuery,void 0===window.directorist_colorPicker_executed&&(window.directorist_colorPicker_executed=!0,window.addEventListener("load",function(){function e(){document.querySelectorAll(".directorist-color-picker-wrap").forEach(function(e){var i=t(e).find(".directorist-color-picker");i&&(t.fn.wpColorPicker?i.wpColorPicker({change:function(t,e){var i=e.color.toString(),r=new CustomEvent("directorist-color-changed",{detail:{color:i,input:t.target,form:t.target.closest("form")}});window.dispatchEvent(r)}}):console.warn("wpColorPicker is NOT available!"))})}e(),window.addEventListener("directorist-instant-search-reloaded",e)}))},28883:function(){var t;t=jQuery,void 0===window.directorist_dropdown_executed&&(window.directorist_dropdown_executed=!0,window.addEventListener("load",function(){var e=document.querySelectorAll(".directorist-dropdown-select"),i=0;null!==e&&e.forEach(function(t){t.querySelector(".directorist-dropdown-select-toggle").addEventListener("click",function(e){e.preventDefault(),++i%2==1?(document.querySelectorAll(".directorist-dropdown-select-items").forEach(function(t){t.classList.remove("directorist-dropdown-select-show")}),t.querySelector(".directorist-dropdown-select-items").classList.add("directorist-dropdown-select-show")):document.querySelectorAll(".directorist-dropdown-select-items").forEach(function(t){t.classList.remove("directorist-dropdown-select-show")})})}),document.body.addEventListener("click",function(t){"directorist-dropdown-select-toggle"!==t.target.getAttribute("data-drop-toggle")&&(i=0,document.querySelectorAll(".directorist-dropdown-select-items").forEach(function(t){t.classList.remove("directorist-dropdown-select-show")}))});var r=document.querySelectorAll(".atbd-drop-select");null!==r&&r.forEach(function(t){t.querySelectorAll(".directorist-dropdown-select-items").forEach(function(e){e.addEventListener("click",function(i){i.preventDefault(),t.querySelector(".directorist-dropdown-select-toggle").textContent=i.target.textContent,t.querySelectorAll(".directorist-dropdown-select-items").forEach(function(t){t.classList.remove("atbd-active")}),e.classList.add("atbd-active")})})}),t("body").on("click",".directorist-dropdown .directorist-dropdown-toggle",function(e){e.preventDefault(),t(this).siblings(".directorist-dropdown-option").toggle()}),t("body").on("click",".directorist-dropdown .directorist-dropdown-option ul li a",function(e){e.preventDefault();var i=t(this).html();t(this).children(".directorist-dropdown-toggle__text").html(i),t(this).closest(".directorist-dropdown-option").siblings(".directorist-dropdown-toggle").children(".directorist-dropdown-toggle__text").html(i),t(".directorist-dropdown-option").hide()}),t(document).bind("click",function(e){t(e.target).parents().hasClass("directorist-dropdown")||t(".directorist-dropdown-option").hide()}),t(document).on("click",".atbd_dropdown",function(e){"atbd_dropdown"===t(this).attr("class")&&(e.preventDefault(),t(this).siblings(".atbd_dropdown").removeClass("atbd_drop--active"),t(this).toggleClass("atbd_drop--active"),e.stopPropagation())}),t(document).on("click",function(e){!1===t(e.target).is(".atbd_dropdown, .atbd_drop--active")&&t(".atbd_dropdown").removeClass("atbd_drop--active")}),t("body").on("click",".atbd_dropdown-toggle",function(t){t.preventDefault()}),t("body").on("click",".directorist-dropdown-js .directorist-dropdown__toggle-js",function(e){e.preventDefault(),t(this).siblings(".directorist-dropdown__links-js").is(":visible")||t(".directorist-dropdown__links").hide(),t(this).siblings(".directorist-dropdown__links-js").toggle()}),t("body").on("click",function(e){e.target.closest(".directorist-dropdown-js")||t(".directorist-dropdown__links-js").hide()})}))},95386:function(){window.addEventListener("load",function(){if(void 0===window.directorist_select_executed){window.directorist_select_executed=!0;var t=document.querySelectorAll(".atbd-drop-select");null!==t&&t.forEach(function(t){t.querySelectorAll(".atbd-dropdown-item").forEach(function(e){e.addEventListener("click",function(i){i.preventDefault(),t.querySelector(".atbd-dropdown-toggle").textContent=e.textContent,t.querySelectorAll(".atbd-dropdown-item").forEach(function(t){t.classList.remove("atbd-active")}),e.classList.add("atbd-active")})})}),document.querySelectorAll(".atbd-drop-select.with-sort").forEach(function(t){t.querySelectorAll(".atbd-dropdown-item").forEach(function(e){var i=t.querySelector(".atbd-dropdown-toggle"),r=e.getAttribute("data-status");e.addEventListener("click",function(t){i.setAttribute("data-status","".concat(r))})})})}})}},e={};function i(r){var o=e[r];if(void 0!==o)return o.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}!function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i