!function () { const e = "beforeend", n = "hidden", t = (n, t, i = e) => { t.insertAdjacentHTML(i, n) }, i = e => 1 === String(e).length ? `0${e}` : e; class l { #e = null; #n = null; #t = null; #i = null; #l = null; #a = null; #r = null; #o = null; #s = null; #m = null; #c = null; #p = null; #u = localStorage; constructor(e) { this.#e = e.outerHTML, this.#m = document.querySelector(".gc-main-content") } get templateStyle() { return "\n " } get template() { return `\n \n \n
\n ${this.#e}\n
\n\n
\n
\n ` } get element() { return this.#n || (this.#n = this.template), this.#n } init() { if (t(this.templateStyle, this.#m), t(this.element, this.#m), this.#d(), this.#i = document.querySelector(".ip-banner-full"), this.#l = this.#i.querySelector(".ip-banner-full__close"), this.#a = this.#i.querySelector(".ip-banner-full__content"), this.#r = this.#a.querySelector(".lite-page.block-set"), this.#r.classList.add("ip-banner-full__content-frame"), this.#r.classList.remove("lite-page"), this.#r.classList.remove("block-set"), this.#o = this.#i.querySelector(".ip-banner-full-item"), this.#p = this.#i.querySelectorAll(".image-box img"), this.#o ? (this.#s = this.#o.querySelector(".countdown-el"), this.#t = this.#s.dataset.time, this.#c = this.#o.className.split("ip-banner-full-item-")[1], this.#s && this.#h(this.#t)) : this.#i.classList.add(n), this.#p.length) for (let e of this.#p) e.src = e.dataset.src; this.#l.addEventListener("click", this.#f), this.#i.addEventListener("click", this.#g), document.addEventListener("keydown", this.#b); const e = this.#u.getItem(`ipBannerFullStateId-${this.#c}`); if (console.log(`ipBannerFullStateId-${this.#c}`), e) { const t = JSON.parse(e), i = JSON.parse(e).id, l = JSON.parse(e).count; if (moment((new Date).valueOf()) - moment(t.timeCloseClick).valueOf() >= 216e5 && l < 1) console.log("count < 1"); else { document.querySelector(`.ip-banner-full-item-${i}`).classList.add(n); document.querySelectorAll(".ip-banner-full-item")[0].classList.contains("hidden") && this.#i.classList.add(n), console.log("count > 1") } } } #B(e) { let n = document.createElement("script"); n.setAttribute("src", e), document.body.appendChild(n) } #d() { const e = document.querySelectorAll(".ip-banner-full-item"); if (e.length) { for (const n of e) n.style = "display: none !important"; e[0].style = "display: block !important" } } #h(e) { let n = e.split(" "), t = n[0], l = n[1], a = moment(`${t}T${l}:00Z`), r = moment(new Date), o = a.valueOf() - r.valueOf(), s = 1e3, m = document.querySelector(`.ip-banner-full-item-${this.#c} .countdown-el`); setInterval((function () { o = moment.duration(o - s, "milliseconds"), m.textContent = o - s > 0 ? `\n ${i(o.days())}Д : ${i(o.hours())}Ч : ${i(o.minutes())}М : ${i(o.seconds())}С\n ` : "00Д : 00Ч : 00М : 00С" }), s) } #E = () => { const e = this.#c; if (e >= 1) { const n = moment(new Date), t = this.#u.getItem(`ipBannerFullStateId-${e}`); let i; t && (i = JSON.parse(t).count), this.#u.setItem(`ipBannerFullStateId-${e}`, JSON.stringify({ id: e, count: i ? ++i : 1, timeCloseClick: n })) } }; #f = () => { this.#i.classList.add(n), this.#E(), document.removeEventListener("keydown", this.#b) }; #g = e => { e.target.classList.contains("ip-banner-full") && (this.#i.classList.add(n), this.#E(), document.removeEventListener("keydown", this.#b)) }; #b = e => { "Escape" === e.key && (this.#i.classList.add(n), this.#E(), document.removeEventListener("keydown", this.#b)) } } const a = (() => { const e = location.pathname; return ["/teach/control/stream", "/pl/teach/control/lesson", "/sales/control", "/profile", "/src-main", "/src-library/cases", "/cst-banner-manipulator"].some((n => -1 !== e.indexOf(n))) })(), r = localStorage.getItem("DeleteCSTBanner"); fetch("/cst-banner-full").then((e => e.text())).then((e => (new DOMParser).parseFromString(e, "text/html").querySelector(".lite-page.block-set"))).then((e => { if (a && !r) { new l(e).init() } })).catch((e => console.log("Failed to fetch page: ", e))) }();