%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/c/a/s/casasmonvl/newges4t/wp-content/plugins/chaty/assets/js/
Upload File :
Create Path :
Current File : /home/c/a/s/casasmonvl/newges4t/wp-content/plugins/chaty/assets/js/cht-scripts.min.js

!function (e, t) {
    jQuery.fn[t] = function (e) {
        return e ? this.bind("resize", (o = e, function () {
            var e = this, t = arguments;
            a && clearTimeout(a), a = setTimeout(function () {
                o.apply(e, t), a = null
            }, 100)
        })) : this.trigger(t);
        var o, a
    }
}(jQuery, "smartModalResize"), function (e) {
    "use strict";
    var t = {
        init: function (t) {
            var o = {
                top: "auto",
                left: "auto",
                autoOpen: !1,
                overlayOpacity: .5,
                overlayColor: "#000",
                overlayClose: !0,
                overlayParent: "body",
                closeOnEscape: !0,
                closeButtonClass: ".close",
                transitionIn: "",
                transitionOut: "",
                onOpen: !1,
                onClose: !1,
                zIndex: function () {
                    return (t = Math.max.apply(Math, e.makeArray(e("*").map(function () {
                        return e(this).css("z-index")
                    }).filter(function () {
                        return e.isNumeric(this)
                    }).map(function () {
                        return parseInt(this, 10)
                    })))) === -1 / 0 ? 0 : t + 1;
                    var t
                },
                updateZIndexOnOpen: !0,
                hasVariableWidth: !1
            };
            return t = e.extend(o, t), this.each(function () {
                var o = t, a = e('<div class="lean-overlay"></div>'), n = e(this);
                a.css({
                    display: "none",
                    position: "fixed",
                    "z-index": o.updateZIndexOnOpen ? 0 : o.zIndex(),
                    top: 0,
                    left: 0,
                    height: "100%",
                    width: "100%",
                    background: o.overlayColor,
                    opacity: o.overlayOpacity,
                    overflow: "auto"
                }).appendTo(o.overlayParent), n.css({
                    display: "none",
                    position: "fixed",
                    "z-index": o.updateZIndexOnOpen ? 0 : o.zIndex() + 1,
                    left: parseInt(o.left, 10) > -1 ? o.left + "px" : "50%",
                    top: parseInt(o.top, 10) > -1 ? o.top + "px" : "50%"
                }), n.bind("openModal", function () {
                    var e = o.updateZIndexOnOpen ? o.zIndex() : parseInt(a.css("z-index"), 10), t = e + 1;
                    "" !== o.transitionIn && "" !== o.transitionOut && n.removeClass(o.transitionOut).addClass(o.transitionIn), n.css({
                        display: "block",
                        "margin-left": (parseInt(o.left, 10) > -1 ? 0 : -n.outerWidth() / 2) + "px",
                        "margin-top": (parseInt(o.top, 10) > -1 ? 0 : -n.outerHeight() / 2) + "px",
                        "z-index": t
                    }), a.css({
                        "z-index": e,
                        display: "block"
                    }), o.onOpen && "function" == typeof o.onOpen && o.onOpen(n[0])
                }), n.bind("closeModal", function () {
                    "" !== o.transitionIn && "" !== o.transitionOut ? (n.removeClass(o.transitionIn).addClass(o.transitionOut), n.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function () {
                        n.css("display", "none"), a.css("display", "none")
                    })) : (n.css("display", "none"), a.css("display", "none")), o.onClose && "function" == typeof o.onClose && o.onClose(n[0])
                }), a.click(function () {
                    o.overlayClose && n.trigger("closeModal")
                }), e(document).keydown(function (e) {
                    o.closeOnEscape && 27 === e.keyCode && n.trigger("closeModal")
                }), e(window).smartModalResize(function () {
                    o.hasVariableWidth && n.css({
                        "margin-left": (parseInt(o.left, 10) > -1 ? 0 : -n.outerWidth() / 2) + "px",
                        "margin-top": (parseInt(o.top, 10) > -1 ? 0 : -n.outerHeight() / 2) + "px"
                    })
                }), n.on("click", o.closeButtonClass, function (e) {
                    n.trigger("closeModal"), e.preventDefault()
                }), o.autoOpen && n.trigger("openModal")
            })
        }
    };
    e.fn.easyModal = function (o) {
        return t[o] ? t[o].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof o && o ? void e.error("Method " + o + " does not exist on jQuery.easyModal") : t.init.apply(this, arguments)
    }
}(jQuery), function (e) {
    e(document).ready(function () {
        e("input, .icon, textarea, .btn-cancel ").click(function (e) {
            window.onbeforeunload = function (e) {
                (e = e || window.event).preventDefault = !0, e.cancelBubble = !0, e.returnValue = "Your beautiful goodbye message"
            }
        }), e(document).on("submit", "form", function (e) {
            window.onbeforeunload = null
        }), /*e(".preview").stick_in_parent({offset_top: 200}),*/ e(".upg").click(function (t) {
            e(".valid_domain_input").val(e(".valid_domain_input").val().replace(" ", "")), /^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(e(".valid_domain_input").val()) || (t.preventDefault(), e(".valid_domain").fadeIn().css({display: "block"}))
        }), e(".del_token").click(function (t) {
            e.ajax({
                type: "POST",
                url: ajaxurl,
                data: {action: "del_token", nonce_code: cht_nonce_ajax.cht_nonce},
                success: function (e) {
                    location.reload()
                },
                error: function (e, t, o) {
                }
            })
        }), e(".easy-modal").easyModal({top: 150, overlay: .2}), e(".easy-modal-open").click(function (t) {
            var o = e(this).attr("href");
            e(o).trigger("openModal"), t.preventDefault()
        }), e(".easy-modal-close").click(function (t) {
            t.preventDefault(), e(".easy-modal").trigger("closeModal")
        });
        var t = 1000000003;
        e(".show_up").click(function () {
            t += 10, e("#upgrade-modal").css({"z-index": t, display: "block", "margin-left": "-258px"})
        }), e(".color-picker-btn, .color-picker-btn-close, .color-picker-custom button").on("click", function (t) {
            t.preventDefault(), e(".color-picker").toggle(), e(".color-picker-btn").toggle()
        }), e(".color-picker-radio input").change(function () {
            var t = e(this);
            if (e('.color-picker-custom input[name="cht_custom_color"]').val(""), e(".color-picker-custom .circle").html("?").css({"background-color": "#fff"}), t.prop("checked")) {
                e(".color-picker-radio input").prop("checked", !1), t.prop("checked", !0);
                var o = t.val(), a = t.prop("title")
            } else o = e(".color-picker-custom input").val(), a = "Custom";
            e(".color-picker-btn .circle").css({backgroundColor: o}), e(".color-picker-btn .text").text(a)
        }), e(".color-picker-custom input").change(function () {
            e(".color-picker-radio input").prop("checked", !1);
            var t = e(this).val();
            e(".color-picker-btn .circle").css({backgroundColor: t}), e(".color-picker-btn .text").text("Custom")
        }), e('[name="cht_position"]').change(function () {
            e("#positionCustom").prop("checked") ? e("#positionPro").show() : e("#positionPro").hide()
        }), e(".update_token").on("click", function (t) {
            t.preventDefault();
            var o = e('input[name="cht_license_key"]').val();
            e.ajax({
                type: "POST",
                url: ajaxurl,
                data: {action: "add_token", nonce_code: cht_nonce_ajax.cht_nonce, token: o},
                beforeSend: function (e) {
                },
                success: function (e) {
                    e ? (alert("Your pro plan is activated"), location.reload()) : alert("You`ve entered a wrong token")
                },
                error: function (e, t, o) {
                }
            })
        }), e("textarea[name=cht_cta]").keyup(function (t) {
            e(".tooltiptext span").html(e(this).val()), 0 == e(this).val().length ? (e(".cta").hide(200), e(".tooltiptext span").hide(200)) : (e(".cta").show(300), e(".tooltiptext span").show(200))
        })
    })
}(jQuery), function (e) {
    e(document).ready(function () {
        !function () {
            function t() {
                var t = e("#positionBottom"), o = e("#positionSide"), a = e(".preview .page .chaty-widget"), n = e('[name="cht_position"]:checked').val();
                if ("right" === n)a.css({
                    right: "7px",
                    left: "auto",
                    bottom: "7px"
                }); else if ("left" === n)a.css({left: "7px", right: "auto", bottom: "7px"}); else if ("custom" === n) {
                    if (t.val())var i = t.val() + "px"; else i = "7px";
                    if (o.val())var c = o.val() + "px"; else c = "7px";
                    t.change(function () {
                        i = e("#positionBottom").val() + "px", a.css({bottom: i})
                    }), o.change(function () {
                        var t = e('[name="positionSide"]:checked').val();
                        c = e(this).val() + "px", "right" === t ? (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-left"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-right"), a.css({
                            right: c,
                            left: "auto"
                        })) : "left" === t && (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-right"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-left"), a.css({
                            left: c,
                            right: "auto"
                        }))
                    }), e('[name="positionSide"]').change(function () {
                        var t = e('[name="positionSide"]:checked').val();
                        "right" === t ? (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-left"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-right"), a.css({
                            right: c,
                            left: "auto"
                        })) : "left" === t && (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-right"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-left"), a.css({
                            left: c,
                            right: "auto"
                        }))
                    })
                }
                e('[name="cht_position"]').change(function () {
                    if (e("#positionCustom").prop("checked")) {
                        e("#positionBottom"), e("#positionSide");
                        var t = e(".preview .page .chaty-widget");
                        t.css({bottom: i});
                        var o = e('[name="positionSide"]:checked').val();
                        c = e("#positionSide").val() + "px", "right" === o ? (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-left"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-right"), t.css({
                            right: c,
                            left: "auto"
                        })) : "left" === o && (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-right"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-left"), t.css({
                            left: c,
                            right: "auto"
                        }))
                    }
                })
            }

            e(".color-picker-radio input").change(function () {
                var t = e(this);
                t.prop("checked") ? t.val() : e(".color-picker-custom input").val(), d()
            }), e(".color-picker-custom input").change(function () {
                e(this).val(), d()
            }), function () {
                var t = e("#widgetTooltip"), o = e(".preview .page .icon");

                function a() {
                    e("[name=cht_cta]").val().length >= 1 ? o.removeClass("no-tooltip") : o.addClass("no-tooltip")
                }

                a(), t.change(function () {
                    a()
                })
            }(), t(), e('[name="cht_position"]').change(function () {
                var o = e('[name="cht_position"]:checked').val();
                "right" === o ? (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-left"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-right")) : "left" === o && (e(".page-body .chaty-widget ").removeClass("chaty-widget-icons-right"), e(".page-body .chaty-widget ").addClass("chaty-widget-icons-left")), t()
            })
        }(), e(".popover").hide(), a();
        var t = e(".channels-icons > .icon-sm"), o = e(".social-inputs");

        function a() {
            e("section").is("#pro") || (e(".channels-selected__item").length <= 1 ? (e(".channels-selected__item").hide(), e(".popover").hide()) : e(".channels-selected__item").length >= 2 && e(".channels-selected__item").show())
        }

        e("input[name=cht_custom_color]").keyup(function (t) {
            var o = e(this).val();
            e(".circle").html(""), e(".color-picker-custom .circle").css({"background-color": o}), e(this).val().length < 1 && e(".color-picker-custom .circle").html("?")
        }), t.on("click", function () {
            a();
            var n, i = e(this), c = i.data("social");
            if (o.find(".social-form-group"), i.hasClass("active")) {
                var s = "," + e(this).attr("data-social");
                return n = (n = e(".add_slug").val()).replace(s, ""), e(".add_slug").val(n), n = n.replace(s, ""), e(".add_slug").val(n), n = n.replace(s, ""), e(".add_slug").val(n), n = n.replace(s, ""), e(".add_slug").val(n), void i.toggleClass("active")
            }
            (t.addClass("disabled"), icon = e(this).data("social"), "1" == e(".add_slug").val().indexOf(icon) && "" != e(".add_slug").val()) ? (s = "," + icon, n = (n = e(".add_slug").val()).replace(s, ""), e(".add_slug").val(n), n = n.replace(s, ""), e(".add_slug").val(n), n = n.replace(s, ""), e(".add_slug").val(n)) : e(".add_slug").val(e(".add_slug").val() + "," + e(this).attr("data-social"));
            if (!e("section").is("#pro") && e(".channels-icons > .icon.active").length >= 2)return e(".popover").show().effect("shake", {times: 3}, 600), void t.removeClass("disabled");
            if (i.toggleClass("active"), e("section").is("#pro"))var l = "pro"; else l = "free";
            e.ajax({
                type: "POST",
                dataType: "json",
                url: ajaxurl,
                data: {action: "choose_social", social: c, nonce_code: cht_nonce_ajax.cht_nonce, version: l},
                beforeSend: function (e) {
                },
                success: function (o) {
                    var n = e(o), i = n.find(".icon").data("title");
                    //console.log(i);
                    e('.channels-selected div[data-title="' + i + '"]').length || e("#chaty-social-close").before(n), t.removeClass("disabled"), d(), a(), check_for_close_btn()
                },
                error: function (e, t, o) {
                }
            }), a()
        }), e("body").on("click", ".icon, .btn-cancel", function (t) {
            if (t.preventDefault(), !e(this).hasClass("icon") || !e(this).hasClass("active")) {
                if (icon = e(this).data("social"), e(this).hasClass("btn-cancel"), !e(this).hasClass("close-btn-set")) {
                    if(!e(this).hasClass("close-btn-set")) {
                        e('.icon.active[data-social^="' + icon + '"]').removeClass("active");
                        var o = "," + icon, n = e(".add_slug").val();
                        n = n.replace(o, ""), e(".add_slug").val(n)
                    }
                }
                if(!e(this).hasClass("close-btn-set")) {
                    var i = e('#chaty-social-' + icon);
                    i.remove();
                    var c = e(this).parent(".channels-selected__item"), s = e(this).data("social");
                    check_for_close_btn();
                } else {
                    check_for_close_btn();
                }
            }
        }), e(".btn-help").click(function (e) {
            window.open("https://premio.io/help/chaty/", "_blank")
        }), e(".free-custom-radio, .free-custom-checkbox").on("click", function (e) {
            e.preventDefault()
        });
        var n = e("[name=cht_cta]"), i = e(".preview .tooltip-show");
        n.keyup(function () {
            var t = e(".preview .page .icon");
            n.val().length >= 1 ? t.removeClass("no-tooltip") : t.addClass("no-tooltip"), i.attr("data-title", n.val())
        });
        var c, s, l = '<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n                            <style type="text/css">.st0 {fill: #A886CD;}  .st1 {fill: #FFFFFF;}\n                        </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n                                                    <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n                            C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n                                                    <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n                            C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n                        </svg>', r = document.getElementById("iconWidget");

        function d() {
            var t, o, a = !1;
            h() ? (0 === e(".js-chanel-desktop:checked").length && (t = !1),
            1 === e(".js-chanel-desktop:checked").length && (t = e('.icon[data-title="' + e(".js-chanel-desktop:checked").attr("data-type") + '"]').html()),
            e(".js-chanel-desktop:checked").length > 1 && (t = l, a = !0)) : (0 === e(".js-chanel-desktop:checked").length && (o = !1),
            1 === e(".js-chanel-mobile:checked").length && (o = e('.icon[data-title="' + e(".js-chanel-mobile:checked").attr("data-type") + '"]').html()),
            e(".js-chanel-mobile:checked").length > 1 && (o = l, a = !0)), c = t, s = o, h() ? p(c, a) : p(s, a)
        }

        function p(t, o) {
            if(t == undefined || t == "undefined") {
                t = jQuery(".icon.icon-sm.active").html();
            }
            if (t ? (e(".preview .page .chaty-widget").show(), r.innerHTML = t) : (e(".preview .page .chaty-widget").hide(), r.innerHTML = ""), o) {
                var a = e(".color-picker-custom input").val() ? e(".color-picker-custom input").val() : e(".color-picker-radio input:checked").val();
                e(".preview .page svg circle").css({fill: a})
            }
        }

        function h() {
            return "checked" === e("#previewDesktop").attr("checked")
        }

        jQuery(".color-picker-radio input:checked").val(), e("#testUpload").on("change", function () {
            this.value.length > 0 ? document.querySelector(".js-upload").disabled = !1 : (document.querySelector(".js-upload").disabled = !0, document.getElementById("uploadInput").checked = !1)
        }), e(".js-switch-preview").on("change", function () {
            h() ? e(this).closest(".preview").removeClass("mobiel-view") : e(this).closest(".preview").addClass("mobiel-view"), d()
        }), e(document).on("change", ".js-chanel-icon", function () {
            d()
        }), e(document).on("change", ".js-widget-i", function (t) {
            l = t.target.classList.contains("js-upload") ? e(".file-preview-image").last().parent().html() : e("i[data-type=" + t.target.dataset.type + "]").html(), d()
        }), "chat-image" !== e(".js-widget-i:checked").attr("data-type") && (l = e("i[data-type=" + e(".js-widget-i:checked").attr("data-type") + "]").html(), d());


        /*font family Privew*/
        jQuery('.form-fonts').on( 'change', function() {
            var font_val = jQuery(this).val();
            jQuery('.chaty-google-font').remove();
            if (font_val != "") {
                jQuery('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">');
                jQuery('.preview-section-chaty #admin-preview .page-body').css('font-family', font_val);
            } else {
                jQuery('.preview-section-chaty #admin-preview .page-body').attr("style","");
            }
        });
    });
    jQuery(window).load(function(){
        var font_val = jQuery('.form-fonts').val();
        jQuery('.chaty-google-font').remove();
        if (font_val != "") {
            jQuery('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">');
            jQuery('.preview-section-chaty #admin-preview .page-body').css('font-family', font_val);
        }
    });
}(jQuery);
function toggle_chaty_setting(socId) {
    jQuery("#chaty-social-"+socId).find(".chaty-advance-settings").toggle();
}
jQuery(document).ready(function(){
    jQuery(".chaty-settings.cls-btn, button.btn-cancel.close-btn-set").click(function(){
        jQuery(".cls-btn-settings, .close-btn-set").toggleClass("active");
    });

    jQuery("#channels-selected-list").sortable({
        placeholder: "ui-chaty-state-hl",
        items: "li:not(#chaty-social-close)",
        update: function( event, ui ) {
            set_social_channel_order();
        }
    });
    check_for_close_btn();
    jQuery("#create-rule").click(function(){
        jQuery(".page-options").show();
    });
})

function check_for_close_btn() {
    if(jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length >= 2) {
        jQuery("#chaty-social-close").show();
    } else {
        jQuery("#chaty-social-close").hide();
    }
    var srtString = "";
    jQuery("#channels-selected-list > li").each(function(){
        if(jQuery(this).attr("data-id") != "undefined" && jQuery(this).attr("data-id") != "") {
            srtString += jQuery(this).attr("data-id")+",";
        }
        srtString = srtString.trimRight(",")
    });
    jQuery(".add_slug").val(srtString);
}
function set_social_channel_order() {
    socialString = [];
    jQuery("#channels-selected-list li").each(function(){
        socialString.push(jQuery(this).attr("data-id"));
    });
    socialString = socialString.join(",");
    jQuery("#cht_numb_slug").val(socialString);
    //check_for_chaty_close_button();
}
jQuery(window).scroll(function(){
    check_for_preview_pos();
});
jQuery(document).ready(function(){
    check_for_preview_pos();
});
function check_for_preview_pos() {
    if(jQuery("#custom-rules").length && jQuery("#admin-preview").length) {
        if(jQuery("body").hasClass("has-premio-box")) {
            topPos = jQuery("#custom-rules").offset().top - jQuery(window).scrollTop() - 625;
        } else {
            topPos = jQuery("#custom-rules").offset().top - jQuery(window).scrollTop() - 485;
        }
        if (topPos < 0) {
            topPos = Math.abs(topPos);
            jQuery("#admin-preview").css("margin-top", ((-1)*topPos)+"px");
        } else {
            jQuery("#admin-preview").css("margin-top", "0");
        }
    }
}

Zerion Mini Shell 1.0