// source --> https://boldpublishings.com/wp-content/plugins/solid_affiliate/app/../assets/js/solid-shared.js?ver=13.1.0 
////////////////////////////////////////////////////////////////////////////////////////
// STORE CREDIT
// This is currently being used by the Store Credit addon to enable the
// 'apply store credit' button for logged in affiliates, on the cart and checkout pages.
////////////////////////////////////////////////////////////////////////////////////////
jQuery(document).ready(function () {
    jQuery(".sld-ajax-button").click(function (e) {
        e.preventDefault();
        $this = jQuery(this);
        var ajax_action = $this.data("ajax-action");
        var ajaxurl = sld_affiliate_js_variables.ajaxurl + "?action=" + ajax_action;
        var post_data = $this.data("postdata");

        post_data.action = ajax_action;

        jQuery.ajax({
            url: ajaxurl,
            type: 'POST',
            data: post_data,
            beforeSend: function () {
                $this.prop("disabled", true);
                $this.addClass("sld-ajax-button-loading");
            },
            success: function (response) {
                if (response["success"] && response["data"]["valid"]) {
                    jQuery(document.body).trigger("wc_update_cart");
                    jQuery(document.body).trigger("update_checkout");
                } else if (response["success"] == false) {
                    var msg = response["data"]["error"];
                    console.log("in here: .sld-ajax-button click success == false");
                    alert(msg);
                }
                $this.prop("disabled", false);
                $this.removeClass("sld-ajax-button-loading");
            },
            error: function (response) {
                $this.prop("disabled", false);
                $this.removeClass("sld-ajax-button-loading");
                var msg = response["data"]["error"];
                console.log("in here: .sld-ajax-button click error");
                alert(msg);
            },
        });
    });
});
// source --> https://boldpublishings.com/wp-content/plugins/ultimate-member/assets/js/um-gdpr.min.js?ver=2.11.3 
jQuery(document).on("click","a.um-toggle-gdpr",function(e){var e=jQuery(e.currentTarget),t=e.closest(".um-field-area"),g=t.find(".um-gdpr-content");g.is(":visible")?(t.find("a.um-toggle-gdpr").text(e.data("toggle-show")),g.hide().find("a.um-toggle-gdpr").remove(),e.length&&e.get(0).scrollIntoView()):(t.find("a.um-toggle-gdpr").text(e.data("toggle-hide")),g.show().prepend(e.clone()))});