// source --> https://gbomotorshop.ru/wp-content/plugins/say-what/assets/build/frontend.js?ver=fd31684c45e4d85aeb4e 
(()=>{"use strict";window.wp.hooks;const t={gettext:(e,a,n)=>t.handle(e,a,a,void 0,void 0,n),gettext_with_context:(e,a,n,o)=>t.handle(e,a,a,void 0,n,o),ngettext:(e,a,n,o,i)=>t.handle(e,a,n,o,void 0,i),ngettext_with_context:(e,a,n,o,i,d)=>t.handle(e,a,n,o,i,d),has_translation(e,a,n,o){const i=t.handle(a,a,a,void 0,n,o)!==a;return e||i},handle(t,e,a,n,o,i){void 0===i&&(i=""),void 0===o&&(o="");let d=i+"|"+a+"|"+o;return void 0!==n&&1!==n||(d=i+"|"+e+"|"+o),void 0!==window.say_what_data.replacements[d]?window.say_what_data.replacements[d]:t}};wp.hooks.addFilter("i18n.gettext","say-what",t.gettext,99),wp.hooks.addFilter("i18n.ngettext","say-what",t.ngettext,99),wp.hooks.addFilter("i18n.gettext_with_context","say-what",t.gettext_with_context,99),wp.hooks.addFilter("i18n.ngettext_with_context","say-what",t.ngettext_with_context,99),wp.hooks.addFilter("i18n.has_translation","say-what",t.has_translation,99)})();
// source --> https://gbomotorshop.ru/wp-content/plugins/premmerce/addons/premmerce-product-comparison/assets/frontend/js/premmerce-product-comparison.js?ver=5.7.15 
;
(function ($) {

    /**
     * Add to compare button and change total items in compare
     * scope - "add_to"
     */
    $(document).on('click', '[data-pc-add-to-compare-btn="add"]', function (e) {

        e.preventDefault();
        var button = $(this);
        var scope = button.closest('[data-pc-add-to-compare]');
        var params = JSON.parse(scope.find('[data-pc-add-to-compare-data]').attr('data-pc-add-to-compare-data'));

        $.ajax({
            url: params.url,
            type: 'post',
            data: params,
            beforeSend: function () {
                button.html(button.data('loader'));
            },
            success: function () {
                scope.find('[data-pc-add-to-compare-btn]').toggleClass('hidden');
                $(document.body).trigger('wc_fragment_refresh');
            }
        });

    });

})(jQuery);