PageSourceSearch

https://natalibolgar.com/local/js/aniart/auth/sms/script.js

js natalibolgar.com collected 2026-09-26 05:50:52 UTC 3,729 bytes, 79 lines download raw bytes

1;($ => {
2
3    let AniartAuthSms = BX.namespace("Aniart.Auth.Sms");
4    let instance = null;
5
6    let phoneNumber = "";
7    let lang = "ua";
8
9    let Manager = (function (params) {
10        params = $.extend(true, {"lang": lang}, params);
11        lang = params.lang;
12    });
13
14    Manager.prototype.prepare = (function () {
15        this.phoneNumber().mask("+38 (099) 999-99-99");
16        this.phoneBtn().off("click.sms").on("click.sms", $.proxy(this.sendSms, this));
17    });
18
19    Manager.prototype.sms = (() => $("div#sms"));
20    Manager.prototype.error = (() => instance.sms().find(".system-error"));
21    Manager.prototype.titlePhoneNumber = (() => instance.sms().find(".sms-title").find(".phone-number"));
22    Manager.prototype.phone = (() => instance.sms().find(".sms-phone"));
23    Manager.prototype.phoneNumber = (() => instance.phone().find(".sms-phone-i"));
24    Manager.prototype.phoneBtn = (() => instance.phone().find(".sms-phone-btn"));
25    Manager.prototype.code = (() => instance.sms().find(".sms-code"));
26    Manager.prototype.codeNumber = (() => instance.code().find(".sms-code-i"));
27    Manager.prototype.codeBtn = (() => instance.code().find(".sms-code-btn"));
28
29    Manager.prototype.sendSms = (function (event) {
30        const number = (!!phoneNumber.length ? phoneNumber : this.phoneNumber().val().replace(/[\s.,\-()+%]/g, ""));
31        if (!!number.length) {
32            const $target = $(event.target);
33            const data = {"phone": number, "LANGUAGE_ID": lang, "action": "smsAuthSetCodeSms"};
34            $target.prop("disabled", true);
35            $.post("/ajax.php", data, function(response) {
36                if (response.ok === true) {
37                    phoneNumber = phoneNumber || number;
38                    instance.error().text("").removeClass("active");
39                    instance.titlePhoneNumber().text(instance.phoneNumber().val());
40                    instance.phone().removeClass("active");
41                    instance.phoneBtn().off("click.sms");
42                    instance.code().addClass("active");
43                    instance.codeBtn().off("click.sms").on("click.sms", $.proxy(instance.checkCode, instance));
44                } else {
45                    instance.error().text(response.error).addClass("active");
46                }
47            }).always(() => $target.prop("disabled", false));
48        }
49    });
50
51    Manager.prototype.checkCode = (function (event) {
52        const code = this.codeNumber().val().replace(/[\s.,\-()+%]/g, "");
53        if (!!code.length) {
54            const $target = $(event.target);
55            const data = {"code": code, "phone": phoneNumber, "LANGUAGE_ID": lang, "action": "smsAuthCheckVerification"};
56            $target.prop("disabled", true);
57            $.post("/ajax.php", data, function(response) {
58                if (response.ok === true) {
59                    if (
60                        (typeof(eS) === "function")
61                        && (typeof(response.dataExt) === "object")
62                        && (typeof(response.dataExt.CustomerData) === "object")
63                    ) {
64                        eS("sendEvent", "CustomerData", {
65                            ...(window.esGeneralInfo && { 'GeneralInfo': window.esGeneralInfo }),
66                            "CustomerData": response.dataExt.CustomerData
67                        });
68                    }
69                    location.reload();
70                } else {
71                    instance.error().text(response.error).addClass("active");
72                }
73            }).always(() => $target.prop("disabled", false));
74        }
75    });
76
77    AniartAuthSms.init = (params => ((instance instanceof Manager) ? instance : (instance = new Manager(params))));
78
79})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.