${D("readMore")}`);
+ t.onclick = t => {
+ t.stopPropagation(), Vt(e.el), e.postBtnClick && e
+ .postBtnClick(t)
+ }, e.el.append(t)
+ }({
+ el: t,
+ maxHeight: n,
+ postBtnClick: e.postExpandBtnClick
+ }))
+ },
+ r = () => {
+ t && v(t) > n && s()
+ };
+ r(), i && t && function(e, t) {
+ if (!e) return;
+ const n = e.getElementsByTagName("img");
+ if (!n.length) return;
+ let i = n.length;
+ for (let s = 0; s < n.length; s++) n[s].complete ? i-- : n[s].addEventListener(
+ "load", (() => {
+ i--, 0 === i && t()
+ })), 0 === i && t()
+ }(t, (() => r()))
+ }))
+ }
+ const Qt = "atk-height-limit";
+
+ function Vt(e) {
+ e && e.classList.contains(Qt) && (e.classList.remove(Qt), Array.from(e.children).forEach((e => {
+ e.classList.contains("atk-height-limit-btn") && e.remove()
+ })), e.style.height = "", e.style.overflow = "")
+ }
+ const Gt = "atk-height-limit-scroll";
+
+ function Kt(e) {
+ if (e.$headerNick = e.$el.querySelector(".atk-nick"), e.data.link) {
+ const t = y('
');
+ t.innerText = e.data.nick, t.href = E(e.data.link) ? e.data.link : `https://${e.data.link}`, e
+ .$headerNick.append(t)
+ } else e.$headerNick.innerText = e.data.nick
+ }
+
+ function Zt(e) {
+ e.$headerBadgeWrap = e.$el.querySelector(".atk-badge-wrap"), e.$headerBadgeWrap.innerHTML = "";
+ const t = e.data.badge_name,
+ n = e.data.badge_color;
+ if (t) {
+ const i = y('
');
+ i.innerText = t.replace("管理员", e.ctx.$t("admin")), i.style.backgroundColor = n || "", e
+ .$headerBadgeWrap.append(i)
+ }
+ if (e.data.is_pinned) {
+ const t = y(`
${e.ctx.$t("pin")} `);
+ e.$headerBadgeWrap.append(t)
+ }
+ }
+
+ function Yt(e) {
+ const t = e.$el.querySelector(".atk-date");
+ t.innerText = e.comment.getDateFormatted(), t.setAttribute("data-atk-comment-date", String(+new Date(e
+ .data.date)))
+ }
+
+ function Xt(e) {
+ if (!e.ctx.conf.uaBadge && !e.data.ip_region) return;
+ let t = e.$header.querySelector("atk-ua-wrap");
+ if (t || (t = y('
'), e.$header.append(t)), t.innerHTML = "", e.data
+ .ip_region) {
+ const n = y('
');
+ n.innerText = e.data.ip_region, t.append(n)
+ }
+ if (e.ctx.conf.uaBadge) {
+ const {
+ browser: n,
+ os: i
+ } = e.comment.getUserUA();
+ if (String(n).trim()) {
+ const e = y('
');
+ e.innerText = n, t.append(e)
+ }
+ if (String(i).trim()) {
+ const e = y('
');
+ e.innerText = i, t.append(e)
+ }
+ }
+ }
+ class Jt {
+ constructor(e) {
+ g(this, "opts"), g(this, "$el"), g(this, "isLoading", !1), g(this, "msgRecTimer"), g(this,
+ "msgRecTimerFunc"), g(this, "isConfirming", !1), g(this, "confirmRecTimer"), this.$el =
+ y('
'), this.opts = "object" != typeof e ? {
+ text: e
+ } : e, this.$el.innerText = this.getText(), this.opts.adminOnly && this.$el.setAttribute(
+ "atk-only-admin-show", "")
+ }
+ get isMessaging() {
+ return !!this.msgRecTimer
+ }
+ appendTo(e) {
+ return e.append(this.$el), this
+ }
+ getText() {
+ return "string" == typeof this.opts.text ? this.opts.text : this.opts.text()
+ }
+ setClick(e) {
+ this.$el.onclick = t => {
+ if (t.stopPropagation(), !this.isLoading) {
+ if (this.opts.confirm && !this.isMessaging) {
+ const e = () => {
+ this.isConfirming = !1, this.$el.classList.remove("atk-btn-confirm"),
+ this.$el.innerText = this.getText()
+ };
+ if (!this.isConfirming) return this.isConfirming = !0, this.$el.classList.add(
+ "atk-btn-confirm"), this.$el.innerText = this.opts.confirmText || D(
+ "actionConfirm"), void(this.confirmRecTimer = window.setTimeout((
+ () => e()), 5e3));
+ this.confirmRecTimer && window.clearTimeout(this.confirmRecTimer), e()
+ }
+ if (this.msgRecTimer) return this.fireMsgRecTimer(), void this.clearMsgRecTimer();
+ e()
+ }
+ }
+ }
+ updateText(e) {
+ e && (this.opts.text = e), this.setLoading(!1), this.$el.innerText = this.getText()
+ }
+ setLoading(e, t) {
+ this.isLoading !== e && (this.isLoading = e, e ? (this.$el.classList.add("atk-btn-loading"),
+ this.$el.innerText = t || `${D("loading")}...`) : (this.$el.classList.remove(
+ "atk-btn-loading"), this.$el.innerText = this.getText()))
+ }
+ setError(e) {
+ this.setMsg(e, "atk-btn-error")
+ }
+ setWarn(e) {
+ this.setMsg(e, "atk-btn-warn")
+ }
+ setSuccess(e) {
+ this.setMsg(e, "atk-btn-success")
+ }
+ setMsg(e, t, n, i) {
+ this.setLoading(!1), t && this.$el.classList.add(t), this.$el.innerText = e, this
+ .setMsgRecTimer((() => {
+ this.$el.innerText = this.getText(), t && this.$el.classList.remove(t), i && i()
+ }), n || 2500)
+ }
+ setMsgRecTimer(e, t) {
+ this.fireMsgRecTimer(), this.clearMsgRecTimer(), this.msgRecTimerFunc = e, this.msgRecTimer =
+ window.setTimeout((() => {
+ e(), this.clearMsgRecTimer()
+ }), t)
+ }
+ fireMsgRecTimer() {
+ this.msgRecTimerFunc && this.msgRecTimerFunc()
+ }
+ clearMsgRecTimer() {
+ this.msgRecTimer && window.clearTimeout(this.msgRecTimer), this.msgRecTimer = void 0, this
+ .msgRecTimerFunc = void 0
+ }
+ }
+
+ function en(e) {
+ e.ctx.conf.vote && (e.voteBtnUp = new Jt((() => `${e.ctx.$t("voteUp")} (${e.data.vote_up||0})`))
+ .appendTo(e.$actions), e.voteBtnUp.setClick((() => {
+ e.comment.getActions().vote("up")
+ })), e.ctx.conf.voteDown && (e.voteBtnDown = new Jt((() =>
+ `${e.ctx.$t("voteDown")} (${e.data.vote_down||0})`)).appendTo(e.$actions), e.voteBtnDown
+ .setClick((() => {
+ e.comment.getActions().vote("down")
+ }))))
+ }
+
+ function tn(e) {
+ if (!e.data.is_allow_reply) return;
+ const t = y(`
${e.ctx.$t("reply")} `);
+ e.$actions.append(t), t.addEventListener("click", (t => {
+ t.stopPropagation(), e.cConf.onReplyBtnClick ? e.cConf.onReplyBtnClick() : e.ctx
+ .replyComment(e.data, e.$el)
+ }))
+ }
+
+ function nn(e) {
+ const t = new Jt({
+ text: () => e.data.is_collapsed ? e.ctx.$t("expand") : e.ctx.$t("collapse"),
+ adminOnly: !0
+ });
+ t.appendTo(e.$actions), t.setClick((() => {
+ e.comment.getActions().adminEdit("collapsed", t)
+ }))
+ }
+
+ function sn(e) {
+ const t = new Jt({
+ text: () => e.data.is_pending ? e.ctx.$t("pending") : e.ctx.$t("approved"),
+ adminOnly: !0
+ });
+ t.appendTo(e.$actions), t.setClick((() => {
+ e.comment.getActions().adminEdit("pending", t)
+ }))
+ }
+
+ function rn(e) {
+ const t = new Jt({
+ text: () => e.data.is_pinned ? e.ctx.$t("unpin") : e.ctx.$t("pin"),
+ adminOnly: !0
+ });
+ t.appendTo(e.$actions), t.setClick((() => {
+ e.comment.getActions().adminEdit("pinned", t)
+ }))
+ }
+
+ function on(e) {
+ const t = new Jt({
+ text: e.ctx.$t("edit"),
+ adminOnly: !0
+ });
+ t.appendTo(e.$actions), t.setClick((() => {
+ e.ctx.editComment(e.data, e.$el)
+ }))
+ }
+
+ function an(e) {
+ const t = new Jt({
+ text: e.ctx.$t("delete"),
+ confirm: !0,
+ confirmText: e.ctx.$t("deleteConfirm"),
+ adminOnly: !0
+ });
+ t.appendTo(e.$actions), t.setClick((() => {
+ e.comment.getActions().adminDelete(t)
+ }))
+ }
+ const ln = {
+ Avatar: function(e) {
+ const t = e.$el.querySelector(".atk-avatar"),
+ n = y("
"),
+ i = e.conf.avatarURLBuilder;
+ if (n.src = i ? i(e.data) : e.comment.getGravatarURL(), e.data.link) {
+ const i = y('
');
+ i.href = E(e.data.link) ? e.data.link : `https://${e.data.link}`, i.append(n), t.append(
+ i)
+ } else t.append(n)
+ },
+ Header: function(e) {
+ Object.entries({
+ renderNick: Kt,
+ renderVerifyBadge: Zt,
+ renderDate: Yt,
+ renderUABadge: Xt
+ }).forEach((([t, n]) => {
+ n(e)
+ }))
+ },
+ Content: function(e) {
+ if (!e.data.is_collapsed) return e.$content.innerHTML = e.comment.getContentMarked(), void e
+ .$content.classList.remove("atk-hide", "atk-collapsed");
+ e.$content.classList.add("atk-hide", "atk-type-collapsed");
+ const t = y(
+ `\n
\n ${e.ctx.$t("collapsedMsg")} \n ${e.ctx.$t("expand")} \n
`
+ );
+ e.$body.insertAdjacentElement("beforeend", t);
+ const n = t.querySelector(".atk-show-btn");
+ n.addEventListener("click", (t => {
+ t.stopPropagation(), e.$content.classList.contains("atk-hide") ? (e.$content
+ .innerHTML = e.comment.getContentMarked(), e.$content.classList
+ .remove("atk-hide"), Ot(e.$content), n.innerText = e.ctx.$t(
+ "collapse")) : (e.$content.innerHTML = "", e.$content.classList
+ .add("atk-hide"), n.innerText = e.ctx.$t("expand"))
+ }))
+ },
+ ReplyAt: function(e) {
+ e.cConf.isFlatMode || 0 === e.data.rid || e.cConf.replyTo && (e.$replyAt = y(
+ '
'
+ ), e.$replyAt.querySelector(".atk-nick").innerText = `${e.cConf.replyTo.nick}`,
+ e.$replyAt.onclick = () => {
+ e.comment.getActions().goToReplyComment()
+ }, e.$headerBadgeWrap.insertAdjacentElement("afterend", e.$replyAt))
+ },
+ ReplyTo: function(e) {
+ if (!e.cConf.isFlatMode) return;
+ if (!e.cConf.replyTo) return;
+ e.$replyTo = y(
+ `\n
\n
${e.ctx.$t("reply")} :
\n
\n
`
+ );
+ const t = e.$replyTo.querySelector(".atk-nick");
+ t.innerText = `@${e.cConf.replyTo.nick}`, t.onclick = () => {
+ e.comment.getActions().goToReplyComment()
+ };
+ let n = yt(e.cConf.replyTo.content);
+ e.cConf.replyTo.is_collapsed && (n = `[${$(e.ctx.$t("collapsed"))}]`), e.$replyTo
+ .querySelector(".atk-content").innerHTML = n, e.$body.prepend(e.$replyTo)
+ },
+ Pending: function(e) {
+ if (!e.data.is_pending) return;
+ const t = y(`
${e.ctx.$t("pendingMsg")}
`);
+ e.$body.prepend(t)
+ },
+ Actions: function(e) {
+ Object.entries({
+ renderVote: en,
+ renderReply: tn,
+ renderCollapse: nn,
+ renderModerator: sn,
+ renderPin: rn,
+ renderEdit: on,
+ renderDel: an
+ }).forEach((([t, n]) => {
+ n(e)
+ }))
+ }
+ };
+ class cn {
+ constructor(e) {
+ g(this, "comment"), g(this, "$el"), g(this, "$main"), g(this, "$header"), g(this,
+ "$headerNick"), g(this, "$headerBadgeWrap"), g(this, "$body"), g(this, "$content"), g(this,
+ "$childrenWrap"), g(this, "$actions"), g(this, "voteBtnUp"), g(this, "voteBtnDown"), g(
+ this, "$replyTo"), g(this, "$replyAt"), this.comment = e
+ }
+ get ctx() {
+ return this.comment.ctx
+ }
+ get data() {
+ return this.comment.getData()
+ }
+ get conf() {
+ return this.comment.conf
+ }
+ get cConf() {
+ return this.comment.getConf()
+ }
+ render() {
+ var e;
+ return this.$el = y(
+ '\n'
+ ), this.$main = this.$el.querySelector(".atk-main"), this.$header = this.$el
+ .querySelector(".atk-header"), this.$body = this.$el.querySelector(".atk-body"), this
+ .$content = this.$body.querySelector(".atk-content"), this.$actions = this.$el
+ .querySelector(".atk-actions"), this.$el.setAttribute("id", `atk-comment-${this.data.id}`),
+ e = this, Object.entries(ln).forEach((([t, n]) => {
+ n(e)
+ })), this.recoveryChildrenWrap(), this.$el
+ }
+ checkHeightLimit() {
+ const e = this.ctx.conf.heightLimit;
+ if (!e || !e.content || !e.children) return;
+ const t = e.content,
+ n = e.children;
+ Ht({
+ postExpandBtnClick: () => {
+ const e = this.comment.getChildren();
+ 1 === e.length && Vt(e[0].getRender().$content)
+ },
+ scrollable: e.scrollable
+ }, [{
+ el: this.$content,
+ max: t,
+ imgContains: !0
+ }, {
+ el: this.$replyTo,
+ max: t,
+ imgContains: !0
+ }, {
+ el: this.$childrenWrap,
+ max: n,
+ imgContains: !1
+ }])
+ }
+ heightLimitRemoveForChildren() {
+ this.$childrenWrap && Vt(this.$childrenWrap)
+ }
+ playFadeAnim() {
+ Ot(this.comment.getRender().$el)
+ }
+ playFadeAnimForBody() {
+ Ot(this.comment.getRender().$body)
+ }
+ getChildrenWrap() {
+ return this.$childrenWrap
+ }
+ renderChildrenWrap() {
+ return this.$childrenWrap || (this.$childrenWrap = y(
+ ''), this.$main.append(this.$childrenWrap)),
+ this.$childrenWrap
+ }
+ recoveryChildrenWrap() {
+ this.$childrenWrap && this.$main.append(this.$childrenWrap)
+ }
+ setUnread(e) {
+ e ? this.$el.classList.add("atk-unread") : this.$el.classList.remove("atk-unread")
+ }
+ setOpenable(e) {
+ e ? this.$el.classList.add("atk-openable") : this.$el.classList.remove("atk-openable")
+ }
+ setOpenURL(e) {
+ this.setOpenable(!0), this.$el.onclick = t => {
+ t.preventDefault(), window.open(e), this.cConf.openEvt && this.cConf.openEvt()
+ }
+ }
+ setOpenAction(e) {
+ this.setOpenable(!0), this.$el.onclick = t => {
+ t.preventDefault(), e()
+ }
+ }
+ }
+ class dn {
+ constructor(e) {
+ g(this, "comment"), this.comment = e
+ }
+ get ctx() {
+ return this.comment.ctx
+ }
+ get data() {
+ return this.comment.getData()
+ }
+ get cConf() {
+ return this.comment.getConf()
+ }
+ vote(e) {
+ const t = "up" === e ? this.comment.getRender().voteBtnUp : this.comment.getRender()
+ .voteBtnDown;
+ this.ctx.getApi().comment.vote(this.data.id, `comment_${e}`).then((e => {
+ var t, n;
+ this.data.vote_up = e.up, this.data.vote_down = e.down, null == (t = this
+ .comment.getRender().voteBtnUp) || t.updateText(), null == (n = this
+ .comment.getRender().voteBtnDown) || n.updateText()
+ })).catch((e => {
+ null == t || t.setError(this.ctx.$t("voteFail")), console.log(e)
+ }))
+ }
+ adminEdit(e, t) {
+ if (t.isLoading) return;
+ t.setLoading(!0, `${this.ctx.$t("editing")}...`);
+ const n = u({}, this.data);
+ "collapsed" === e ? n.is_collapsed = !n.is_collapsed : "pending" === e ? n.is_pending = !n
+ .is_pending : "pinned" === e && (n.is_pinned = !n.is_pinned), this.ctx.getApi().comment
+ .commentEdit(n).then((e => {
+ t.setLoading(!1), this.comment.setData(e)
+ })).catch((e => {
+ console.error(e), t.setError(this.ctx.$t("editFail"))
+ }))
+ }
+ adminDelete(e) {
+ e.isLoading || (e.setLoading(!0, `${this.ctx.$t("deleting")}...`), this.ctx.getApi().comment
+ .commentDel(this.data.id, this.data.site_name).then((() => {
+ e.setLoading(!1), this.cConf.onDelete && this.cConf.onDelete(this.comment)
+ })).catch((t => {
+ console.error(t), e.setError(this.ctx.$t("deleteFail"))
+ })))
+ }
+ goToReplyComment() {
+ const e = window.location.hash,
+ t = `#atk-comment-${this.data.rid}`;
+ window.location.hash = t, t === e && window.dispatchEvent(new Event("hashchange"))
+ }
+ }
+ class hn extends Dt {
+ constructor(e, t, n) {
+ super(e), g(this, "renderInstance"), g(this, "actionInstance"), g(this, "data"), g(this,
+ "cConf"), g(this, "parent"), g(this, "children", []), g(this, "nestCurt"), g(this,
+ "nestMax"), this.nestMax = e.conf.nestMax || 3, this.cConf = n, this.data = u({}, t),
+ this.data.date = this.data.date.replace(/-/g, "/"), this.parent = null, this.nestCurt = 1,
+ this.actionInstance = new dn(this), this.renderInstance = new cn(this)
+ }
+ render() {
+ const e = this.renderInstance.render();
+ this.$el && this.$el.replaceWith(e), this.$el = e, this.cConf.afterRender && this.cConf
+ .afterRender()
+ }
+ getActions() {
+ return this.actionInstance
+ }
+ getRender() {
+ return this.renderInstance
+ }
+ getData() {
+ return this.data
+ }
+ setData(e) {
+ this.data = e, this.render(), this.getRender().playFadeAnimForBody()
+ }
+ getParent() {
+ return this.parent
+ }
+ getChildren() {
+ return this.children
+ }
+ getNestCurt() {
+ return this.nestCurt
+ }
+ getIsRoot() {
+ return 0 === this.data.rid
+ }
+ getID() {
+ return this.data.id
+ }
+ putChild(e, t = "append") {
+ e.parent = this, e.nestCurt = this.nestCurt + 1, this.children.push(e);
+ const n = this.getChildrenEl();
+ "append" === t ? n.append(e.getEl()) : "prepend" === t && n.prepend(e.getEl()), e.getRender()
+ .playFadeAnim(), e.getRender().checkHeightLimit()
+ }
+ getChildrenEl() {
+ let e = this.getRender().getChildrenWrap();
+ return e || (e = this.nestCurt < this.nestMax ? this.getRender().renderChildrenWrap() : this
+ .parent.getChildrenEl()), e
+ }
+ getParents() {
+ const e = [],
+ t = n => {
+ n.parent && (e.push(n.parent), t(n.parent))
+ };
+ return t(this), e
+ }
+ getEl() {
+ return this.$el
+ }
+ getGravatarURL() {
+ return `${(e={mirror:this.ctx.conf.gravatar.mirror,params:this.ctx.conf.gravatar.params,emailMD5:this.data.email_encrypted}).mirror.replace(/\/$/,"")}/${e.emailMD5}?${e.params.replace(/^\?/,"")}`;
+ var e
+ }
+ getContentMarked() {
+ return yt(this.data.content)
+ }
+ getDateFormatted() {
+ return C(new Date(this.data.date), this.ctx.$t)
+ }
+ getUserUA() {
+ const e = function(e) {
+ const t = window || {},
+ n = navigator || {},
+ i = String(e || n.userAgent),
+ s = {
+ os: "",
+ osVersion: "",
+ engine: "",
+ browser: "",
+ device: "",
+ language: "",
+ version: ""
+ },
+ r = {
+ Trident: i.includes("Trident") || i.includes("NET CLR"),
+ Presto: i.includes("Presto"),
+ WebKit: i.includes("AppleWebKit"),
+ Gecko: i.includes("Gecko/")
+ },
+ o = {
+ Safari: i.includes("Safari"),
+ Chrome: i.includes("Chrome") || i.includes("CriOS"),
+ IE: i.includes("MSIE") || i.includes("Trident"),
+ Edge: i.includes("Edge") || i.includes("Edg"),
+ Firefox: i.includes("Firefox") || i.includes("FxiOS"),
+ "Firefox Focus": i.includes("Focus"),
+ Chromium: i.includes("Chromium"),
+ Opera: i.includes("Opera") || i.includes("OPR"),
+ Vivaldi: i.includes("Vivaldi"),
+ Yandex: i.includes("YaBrowser"),
+ Kindle: i.includes("Kindle") || i.includes("Silk/"),
+ 360: i.includes("360EE") || i.includes("360SE"),
+ UC: i.includes("UC") || i.includes(" UBrowser"),
+ QQBrowser: i.includes("QQBrowser"),
+ QQ: i.includes("QQ/"),
+ Baidu: i.includes("Baidu") || i.includes("BIDUBrowser"),
+ Maxthon: i.includes("Maxthon"),
+ Sogou: i.includes("MetaSr") || i.includes("Sogou"),
+ LBBROWSER: i.includes("LBBROWSER"),
+ "2345Explorer": i.includes("2345Explorer"),
+ TheWorld: i.includes("TheWorld"),
+ MIUI: i.includes("MiuiBrowser"),
+ Quark: i.includes("Quark"),
+ Qiyu: i.includes("Qiyu"),
+ Wechat: i.includes("MicroMessenger"),
+ Taobao: i.includes("AliApp(TB"),
+ Alipay: i.includes("AliApp(AP"),
+ Weibo: i.includes("Weibo"),
+ Douban: i.includes("com.douban.frodo"),
+ Suning: i.includes("SNEBUY-APP"),
+ iQiYi: i.includes("IqiyiApp")
+ },
+ a = {
+ Windows: i.includes("Windows"),
+ Linux: i.includes("Linux") || i.includes("X11"),
+ macOS: i.includes("Macintosh"),
+ Android: i.includes("Android") || i.includes("Adr"),
+ Ubuntu: i.includes("Ubuntu"),
+ FreeBSD: i.includes("FreeBSD"),
+ Debian: i.includes("Debian"),
+ "Windows Phone": i.includes("IEMobile") || i.includes("Windows Phone"),
+ BlackBerry: i.includes("BlackBerry") || i.includes("RIM"),
+ MeeGo: i.includes("MeeGo"),
+ Symbian: i.includes("Symbian"),
+ iOS: i.includes("like Mac OS X"),
+ "Chrome OS": i.includes("CrOS"),
+ WebOS: i.includes("hpwOS")
+ },
+ l = {
+ Mobile: i.includes("Mobi") || i.includes("iPh") || i.includes("480"),
+ Tablet: i.includes("Tablet") || i.includes("Pad") || i.includes("Nexus 7")
+ };
+ l.Mobile ? l.Mobile = !i.includes("iPad") : o.Chrome && i.includes("Edg") ? (o
+ .Chrome = !1, o.Edge = !0) : t.showModalDialog && t.chrome && (o.Chrome = !1, o[
+ 360] = !0), s.device = "PC", s.language = (() => {
+ const e = (n.browserLanguage || n.language).split("-");
+ return e[1] && (e[1] = e[1].toUpperCase()), e.join("_")
+ })();
+ const c = {
+ engine: r,
+ browser: o,
+ os: a,
+ device: l
+ };
+ Object.entries(c).forEach((([e, t]) => {
+ Object.entries(t).forEach((([t, n]) => {
+ !0 === n && (s[e] = t)
+ }))
+ }));
+ const d = {
+ Windows: () => {
+ const e = i.replace(/^.*Windows NT ([\d.]+);.*$/, "$1");
+ return {
+ 6.4: "10",
+ 6.3: "8.1",
+ 6.2: "8",
+ 6.1: "7",
+ "6.0": "Vista",
+ 5.2: "XP",
+ 5.1: "XP",
+ "5.0": "2000",
+ "10.0": "10",
+ "11.0": "11"
+ } [e] || e
+ },
+ Android: () => i.replace(/^.*Android ([\d.]+);.*$/, "$1"),
+ iOS: () => i.replace(/^.*OS ([\d_]+) like.*$/, "$1").replace(/_/g, "."),
+ Debian: () => i.replace(/^.*Debian\/([\d.]+).*$/, "$1"),
+ "Windows Phone": () => i.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/, "$2"),
+ macOS: () => i.replace(/^.*Mac OS X ([\d_]+).*$/, "$1").replace(/_/g, "."),
+ WebOS: () => i.replace(/^.*hpwOS\/([\d.]+);.*$/, "$1")
+ };
+ s.osVersion = "", d[s.os] && (s.osVersion = d[s.os](), s.osVersion === i && (s
+ .osVersion = ""));
+ const h = {
+ Safari: () => i.replace(/^.*Version\/([\d.]+).*$/, "$1"),
+ Chrome: () => i.replace(/^.*Chrome\/([\d.]+).*$/, "$1").replace(
+ /^.*CriOS\/([\d.]+).*$/, "$1"),
+ IE: () => i.replace(/^.*MSIE ([\d.]+).*$/, "$1").replace(/^.*rv:([\d.]+).*$/,
+ "$1"),
+ Edge: () => i.replace(/^.*(Edge|Edg|Edg[A-Z]{1})\/([\d.]+).*$/, "$2"),
+ Firefox: () => i.replace(/^.*Firefox\/([\d.]+).*$/, "$1").replace(
+ /^.*FxiOS\/([\d.]+).*$/, "$1"),
+ "Firefox Focus": () => i.replace(/^.*Focus\/([\d.]+).*$/, "$1"),
+ Chromium: () => i.replace(/^.*Chromium\/([\d.]+).*$/, "$1"),
+ Opera: () => i.replace(/^.*Opera\/([\d.]+).*$/, "$1").replace(
+ /^.*OPR\/([\d.]+).*$/, "$1"),
+ Vivaldi: () => i.replace(/^.*Vivaldi\/([\d.]+).*$/, "$1"),
+ Yandex: () => i.replace(/^.*YaBrowser\/([\d.]+).*$/, "$1"),
+ Kindle: () => i.replace(/^.*Version\/([\d.]+).*$/, "$1"),
+ Maxthon: () => i.replace(/^.*Maxthon\/([\d.]+).*$/, "$1"),
+ QQBrowser: () => i.replace(/^.*QQBrowser\/([\d.]+).*$/, "$1"),
+ QQ: () => i.replace(/^.*QQ\/([\d.]+).*$/, "$1"),
+ Baidu: () => i.replace(/^.*BIDUBrowser[\s/]([\d.]+).*$/, "$1"),
+ UC: () => i.replace(/^.*UC?Browser\/([\d.]+).*$/, "$1"),
+ Sogou: () => i.replace(/^.*SE ([\d.X]+).*$/, "$1").replace(
+ /^.*SogouMobileBrowser\/([\d.]+).*$/, "$1"),
+ "2345Explorer": () => i.replace(/^.*2345Explorer\/([\d.]+).*$/, "$1"),
+ TheWorld: () => i.replace(/^.*TheWorld ([\d.]+).*$/, "$1"),
+ MIUI: () => i.replace(/^.*MiuiBrowser\/([\d.]+).*$/, "$1"),
+ Quark: () => i.replace(/^.*Quark\/([\d.]+).*$/, "$1"),
+ Qiyu: () => i.replace(/^.*Qiyu\/([\d.]+).*$/, "$1"),
+ Wechat: () => i.replace(/^.*MicroMessenger\/([\d.]+).*$/, "$1"),
+ Taobao: () => i.replace(/^.*AliApp\(TB\/([\d.]+).*$/, "$1"),
+ Alipay: () => i.replace(/^.*AliApp\(AP\/([\d.]+).*$/, "$1"),
+ Weibo: () => i.replace(/^.*weibo__([\d.]+).*$/, "$1"),
+ Douban: () => i.replace(/^.*com.douban.frodo\/([\d.]+).*$/, "$1"),
+ Suning: () => i.replace(/^.*SNEBUY-APP([\d.]+).*$/, "$1"),
+ iQiYi: () => i.replace(/^.*IqiyiVersion\/([\d.]+).*$/, "$1")
+ };
+ return s.version = "", h[s.browser] && (s.version = h[s.browser](), s.version === i && (
+ s.version = "")), s.version.indexOf(".") && (s.version = s.version.substring(0,
+ s.version.indexOf("."))), "iOS" === s.os && i.includes("iPad") ? s.os =
+ "iPadOS" : "Edge" !== s.browser || i.includes("Edg") ? "MIUI" === s.browser ? s.os =
+ "Android" : "Chrome" === s.browser && Number(s.version) > 27 || "Opera" === s
+ .browser && Number(s.version) > 12 || "Yandex" === s.browser ? s.engine = "Blink" :
+ void 0 === s.browser && (s.browser = "Unknow App") : s.engine = "EdgeHTML", s
+ }(this.data.ua);
+ return {
+ browser: `${e.browser} ${e.version}`,
+ os: `${e.os} ${e.osVersion}`
+ }
+ }
+ getConf() {
+ return this.cConf
+ }
+ }
+ class un {
+ constructor(e) {
+ g(this, "opts"), g(this, "$el"), g(this, "$loading"), g(this, "$text"), g(this, "offset", 0), g(
+ this, "total", 0), g(this, "origText", "Load More"), this.opts = e, this.origText = this
+ .opts.text || this.origText, this.$el = y(
+ `
`
+ ), this.$loading = this.$el.querySelector(".atk-loading-icon"), this.$text = this.$el
+ .querySelector(".atk-text"), this.$el.onclick = () => {
+ this.click()
+ }
+ }
+ get hasMore() {
+ return this.total > this.offset + this.opts.pageSize
+ }
+ click() {
+ this.hasMore && this.opts.onClick(this.offset + this.opts.pageSize), this.checkDisabled()
+ }
+ show() {
+ this.$el.style.display = ""
+ }
+ hide() {
+ this.$el.style.display = "none"
+ }
+ setLoading(e) {
+ this.$loading.style.display = e ? "" : "none", this.$text.style.display = e ? "none" : ""
+ }
+ showErr(e) {
+ this.setLoading(!1), this.$text.innerText = e, this.$el.classList.add("atk-err"), window
+ .setTimeout((() => {
+ this.$text.innerText = this.origText, this.$el.classList.remove("atk-err")
+ }), 2e3)
+ }
+ update(e, t) {
+ this.offset = e, this.total = t, this.checkDisabled()
+ }
+ checkDisabled() {
+ this.hasMore ? this.show() : this.hide()
+ }
+ }
+ class pn {
+ constructor() {
+ g(this, "instance"), g(this, "onReachedBottom", null), g(this, "opt")
+ }
+ create(e) {
+ return this.opt = e, this.instance = new un({
+ pageSize: e.pageSize,
+ onClick: t => k(this, null, (function*() {
+ e.ctx.fetch({
+ offset: t
+ })
+ })),
+ text: D("loadMore")
+ }), e.readMoreAutoLoad && (this.onReachedBottom = () => {
+ this.instance.hasMore && !this.opt.ctx.getData().getLoading() && this.instance
+ .click()
+ }, this.opt.ctx.on("list-reach-bottom", this.onReachedBottom)), this.instance.$el
+ }
+ setLoading(e) {
+ this.instance.setLoading(e)
+ }
+ update(e, t) {
+ this.instance.update(e, t)
+ }
+ showErr(e) {
+ this.instance.showErr(e)
+ }
+ next() {
+ this.instance.click()
+ }
+ getHasMore() {
+ return this.instance.hasMore
+ }
+ getIsClearComments(e) {
+ return 0 === e.offset
+ }
+ dispose() {
+ this.onReachedBottom && this.opt.ctx.off("list-reach-bottom", this.onReachedBottom), this
+ .instance.$el.remove()
+ }
+ }
+ class gn {
+ constructor(e, t) {
+ g(this, "opts"), g(this, "total"), g(this, "$el"), g(this, "$input"), g(this, "inputTimer"), g(
+ this, "$prevBtn"), g(this, "$nextBtn"), g(this, "page", 1), this.total = e, this.opts =
+ t, this.$el = y(
+ ''
+ ), this.$input = this.$el.querySelector(".atk-input"), this.$input.value =
+ `${this.page}`, this.$input.oninput = () => this.input(), this.$input.onkeydown = e => this
+ .keydown(e), this.$prevBtn = this.$el.querySelector(".atk-btn-prev"), this.$nextBtn = this
+ .$el.querySelector(".atk-btn-next"), this.$prevBtn.onclick = () => this.prev(), this
+ .$nextBtn.onclick = () => this.next(), this.checkDisabled()
+ }
+ get pageSize() {
+ return this.opts.pageSize
+ }
+ get offset() {
+ return this.pageSize * (this.page - 1)
+ }
+ get maxPage() {
+ return Math.ceil(this.total / this.pageSize)
+ }
+ update(e, t) {
+ this.page = Math.ceil(e / this.pageSize) + 1, this.total = t, this.setInput(this.page), this
+ .checkDisabled()
+ }
+ setInput(e) {
+ this.$input.value = `${e}`
+ }
+ input(e = !1) {
+ window.clearTimeout(this.inputTimer);
+ const t = this.$input.value.trim(),
+ n = () => {
+ if ("" === t) return void this.setInput(this.page);
+ let e = Number(t);
+ Number.isNaN(e) || e < 1 ? this.setInput(this.page) : (e > this.maxPage && (this
+ .setInput(this.maxPage), e = this.maxPage), this.change(e))
+ };
+ e ? n() : this.inputTimer = window.setTimeout((() => n()), 800)
+ }
+ prev() {
+ const e = this.page - 1;
+ e < 1 || this.change(e)
+ }
+ next() {
+ const e = this.page + 1;
+ e > this.maxPage || this.change(e)
+ }
+ getHasMore() {
+ return this.page + 1 <= this.maxPage
+ }
+ change(e) {
+ this.page = e, this.opts.onChange(this.offset), this.setInput(e), this.checkDisabled()
+ }
+ checkDisabled() {
+ this.page + 1 > this.maxPage ? this.$nextBtn.classList.add("atk-disabled") : this.$nextBtn
+ .classList.remove("atk-disabled"), this.page - 1 < 1 ? this.$prevBtn.classList.add(
+ "atk-disabled") : this.$prevBtn.classList.remove("atk-disabled")
+ }
+ keydown(e) {
+ const t = e.keyCode || e.which;
+ if (38 === t) {
+ const e = Number(this.$input.value) + 1;
+ if (e > this.maxPage) return;
+ this.setInput(e), this.input()
+ } else if (40 === t) {
+ const e = Number(this.$input.value) - 1;
+ if (e < 1) return;
+ this.setInput(e), this.input()
+ } else 13 === t && this.input(!0)
+ }
+ setLoading(e) {
+ e ? Tt(this.$el) : _t(this.$el)
+ }
+ }
+ class mn {
+ constructor() {
+ g(this, "instance")
+ }
+ create(e) {
+ return this.instance = new gn(e.total, {
+ pageSize: e.pageSize,
+ onChange: t => k(this, null, (function*() {
+ e.ctx.editorResetState(), e.ctx.fetch({
+ offset: t,
+ onSuccess: () => {
+ e.ctx.listGotoFirst()
+ }
+ })
+ }))
+ }), this.instance.$el
+ }
+ setLoading(e) {
+ this.instance.setLoading(e)
+ }
+ update(e, t) {
+ this.instance.update(e, t)
+ }
+ next() {
+ this.instance.next()
+ }
+ getHasMore() {
+ return this.instance.getHasMore()
+ }
+ getIsClearComments() {
+ return !0
+ }
+ dispose() {
+ this.instance.$el.remove()
+ }
+ }
+
+ function fn(e) {
+ const t = e.getData().getListLastFetch(),
+ n = {
+ offset: 0,
+ total: 0
+ };
+ return t ? (n.offset = t.params.offset, t.data && (n.total = t.params.flatMode ? t.data.total : t.data
+ .total_roots), n) : n
+ }
+ const kn = e => {
+ let t = null;
+ e.on("conf-loaded", (n => {
+ const i = e.get("list");
+ t && t.dispose(), t = function(e) {
+ return e.pagination.readMore ? new pn : new mn
+ }(n);
+ const {
+ offset: s,
+ total: r
+ } = fn(e), o = t.create({
+ ctx: e,
+ pageSize: n.pagination.pageSize,
+ total: r,
+ readMoreAutoLoad: n.pagination.autoLoad
+ });
+ i.$commentsWrap.after(o), null == t || t.update(s, r)
+ })), e.on("list-loaded", (n => {
+ const {
+ offset: i,
+ total: s
+ } = fn(e);
+ null == t || t.update(i, s)
+ })), e.on("list-fetch", (n => {
+ e.getData().getComments().length > 0 && (null == t ? void 0 : t.getIsClearComments(
+ n)) && e.getData().clearComments()
+ })), e.on("list-error", (() => {
+ var e;
+ null == (e = null == t ? void 0 : t.showErr) || e.call(t, D("loadFail"))
+ })), e.on("list-fetch", (e => {
+ null == t || t.setLoading(!0)
+ })), e.on("list-fetched", (({
+ params: e
+ }) => {
+ null == t || t.setLoading(!1)
+ }))
+ };
+ class yn extends Dt {
+ constructor(e) {
+ super(e), g(this, "$commentsWrap"), g(this, "commentNodes", []), this.$el = y(
+ '
\n'
+ ), this.$commentsWrap = this.$el.querySelector(".atk-list-comments-wrap"), kn(e), this
+ .initCrudEvents()
+ }
+ getCommentsWrapEl() {
+ return this.$commentsWrap
+ }
+ getCommentNodes() {
+ return this.commentNodes
+ }
+ getListLayout() {
+ return new Nt({
+ $commentsWrap: this.$commentsWrap,
+ nestSortBy: this.ctx.conf.nestSort,
+ nestMax: this.ctx.conf.nestMax,
+ flatMode: this.ctx.conf.flatMode,
+ createCommentNode: (e, t) => {
+ const n = function(e, t, n) {
+ var i;
+ const s = new hn(e, t, {
+ isFlatMode: null == (i = e.getData()
+ .getListLastFetch()) ? void 0 : i.params.flatMode,
+ afterRender: () => {
+ e.trigger("comment-rendered", s)
+ },
+ onDelete: t => {
+ e.getData().deleteComment(t.getID())
+ },
+ replyTo: t.rid ? n.find((e => e.id === t.rid)) : void 0
+ });
+ return s.render(), s
+ }(this.ctx, e, t);
+ return this.commentNodes.push(n), n
+ },
+ findCommentNode: e => this.commentNodes.find((t => t.getID() === e)),
+ getCommentDataList: () => this.ctx.getData().getComments()
+ })
+ }
+ initCrudEvents() {
+ this.ctx.on("list-load", (e => {
+ this.getListLayout().import(e)
+ })), this.ctx.on("list-loaded", (e => {
+ 0 === e.length && (this.$commentsWrap.innerHTML = "")
+ })), this.ctx.on("comment-inserted", (e => {
+ this.getListLayout().insert(e)
+ })), this.ctx.on("comment-deleted", (e => {
+ const t = this.commentNodes.find((t => t.getID() === e.id));
+ t ? (t.getEl().remove(), this.commentNodes = this.commentNodes.filter((t => t
+ .getID() !== e.id))) : console.error(
+ `comment node id=${e.id} not found`)
+ })), this.ctx.on("comment-updated", (e => {
+ const t = this.commentNodes.find((t => t.getID() === e.id));
+ t && t.setData(e)
+ }))
+ }
+ }
+ let vn, $n;
+
+ function bn() {
+ return {
+ init() {
+ vn = document.body.style.overflow, $n = document.body.style.paddingRight
+ },
+ unlock() {
+ document.body.style.overflow = vn, document.body.style.paddingRight = $n
+ },
+ lock() {
+ document.body.style.overflow = "hidden";
+ const e = parseInt(window.getComputedStyle(document.body, null).getPropertyValue(
+ "padding-right"), 10);
+ document.body.style.paddingRight =
+ `${function(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),document.body.removeChild(t),n-i}()+e||0}px`
+ }
+ }
+ }
+ class wn {
+ constructor() {
+ g(this, "$wrap"), g(this, "$mask"), g(this, "allowMaskClose", !0), g(this, "items", []), this
+ .$wrap = y(
+ '
'
+ ), this.$mask = this.$wrap.querySelector(".atk-layer-mask")
+ }
+ createItem(e, t) {
+ return t || ((t = document.createElement("div")).classList.add("atk-layer-item"), t
+ .setAttribute("data-layer-name", e), t.style.display = "none"), this.$wrap.appendChild(
+ t), this.items.push(t), t
+ }
+ getWrap() {
+ return this.$wrap
+ }
+ getMask() {
+ return this.$mask
+ }
+ setMaskClose(e) {
+ this.allowMaskClose = e
+ }
+ show() {
+ this.$wrap.style.display = "block", this.$mask.style.display = "block", this.$mask.classList
+ .add("atk-fade-in"), this.$mask.onclick = () => {
+ this.allowMaskClose && this.hide()
+ }, bn().lock()
+ }
+ hide(e) {
+ if (this.items.filter((e => e.isConnected && "none" !== e.style.display)).length > 1)
+ return void(e && e());
+ const t = () => {
+ this.$wrap.style.display = "none", this.$wrap.classList.remove("atk-fade-out"), e &&
+ e(), bn().unlock(), this.$wrap.onanimationend = null
+ };
+ this.$wrap.classList.add("atk-fade-out"), "none" !== window.getComputedStyle(this.$wrap)[
+ "animation-name"] ? this.$wrap.onanimationend = () => t() : t()
+ }
+ }
+ class xn {
+ constructor(e, t, n) {
+ g(this, "$el"), g(this, "wrap"), g(this, "onAfterHide"), this.wrap = e, this.$el = this.wrap
+ .createItem(t, n)
+ }
+ setOnAfterHide(e) {
+ this.onAfterHide = e
+ }
+ getEl() {
+ return this.$el
+ }
+ show() {
+ this.$el.style.display = "", this.wrap.show()
+ }
+ hide() {
+ this.wrap.hide((() => {
+ this.$el.style.display = "none", this.onAfterHide && this.onAfterHide()
+ }))
+ }
+ destroy() {
+ this.wrap.hide((() => {
+ this.$el.remove(), this.onAfterHide && this.onAfterHide()
+ }))
+ }
+ }
+ class Cn {
+ constructor(e) {
+ g(this, "wrap"), g(this, "ctx"), this.ctx = e, this.wrap = new wn, document.body.appendChild(
+ this.wrap.getWrap()), e.on("destroy", (() => {
+ this.wrap.getWrap().remove()
+ })), bn().init()
+ }
+ getEl() {
+ return this.wrap.getWrap()
+ }
+ create(e, t) {
+ return new xn(this.wrap, e, t)
+ }
+ }
+ const Sn = "ArtalkUser";
+ class En {
+ constructor(e) {
+ g(this, "data"), this.opts = e;
+ const t = JSON.parse(window.localStorage.getItem(Sn) || "{}");
+ this.data = {
+ nick: t.nick || "",
+ email: t.email || "",
+ link: t.link || "",
+ token: t.token || "",
+ isAdmin: t.isAdmin || !1
+ }
+ }
+ getData() {
+ return this.data
+ }
+ update(e = {}) {
+ Object.entries(e).forEach((([e, t]) => {
+ this.data[e] = t
+ })), window.localStorage.setItem(Sn, JSON.stringify(this.data)), this.opts.onUserChanged &&
+ this.opts.onUserChanged(this.data)
+ }
+ logout() {
+ this.update({
+ token: "",
+ isAdmin: !1
+ })
+ }
+ checkHasBasicUserInfo() {
+ return !!this.data.nick && !!this.data.email
+ }
+ }
+ const Tn = {
+ i18n(e) {
+ U(e.conf.locale), e.on("conf-loaded", (() => {
+ U(e.conf.locale)
+ }))
+ },
+ user: e => new En({
+ onUserChanged: t => {
+ e.trigger("user-changed", t)
+ }
+ }),
+ layerManager: e => new Cn(e),
+ checkerLauncher: e => new Ut({
+ getCtx: () => e,
+ getApi: () => e.getApi(),
+ getIframeURLBase: () => e.conf.server,
+ onReload: () => e.reload()
+ }),
+ editor(e) {
+ const t = new Wt(e);
+ return e.$root.appendChild(t.$el), t
+ },
+ list(e) {
+ const t = new yn(e);
+ return e.$root.appendChild(t.$el), t
+ },
+ sidebarLayer: e => new jt(e),
+ editorPlugs() {}
+ };
+
+ function _n(e) {
+ const t = y(`
${e.errMsg},${D("listLoadFailMsg")} `);
+ if (e.retryFn) {
+ const n = y(`
${D("listRetry")} `);
+ n.onclick = () => e.retryFn && e.retryFn(), t.appendChild(n)
+ }
+ if (e.onOpenSidebar) {
+ const n = y(
+ `
| ${D("open")+D("ctrlCenter")} `
+ );
+ t.appendChild(n), n.onclick = () => e.onOpenSidebar && e.onOpenSidebar()
+ }
+ Pt(e.$err, t)
+ }
+
+ function Ln(e) {
+ e.getApi().system.conf().then((t => {
+ let n = {
+ apiVersion: t.version.version
+ };
+ if (e.conf.useBackendConf) {
+ if (!t.frontend_conf) throw new Error(
+ "The remote backend does not respond to the frontend conf, but `useBackendConf` conf is enabled"
+ );
+ n = u(u({}, n), function(e) {
+ const t = ["el", "pageKey", "pageTitle", "server", "site", "darkMode"];
+ return Object.keys(e).forEach((n => {
+ t.includes(n) && delete e[n]
+ })), e.emoticons && "string" == typeof e.emoticons && (e.emoticons =
+ e.emoticons.trim(), e.emoticons.startsWith("[") || e.emoticons
+ .startsWith("{") ? e.emoticons = JSON.parse(e.emoticons) :
+ "false" === e.emoticons && (e.emoticons = !1)), e
+ }(t.frontend_conf))
+ }
+ e.conf.remoteConfModifier && e.conf.remoteConfModifier(n), e.updateConf(n)
+ })).catch((t => {
+ var n;
+ e.updateConf({});
+ let i = "";
+ if (null == (n = t.data) ? void 0 : n.err_no_site) {
+ const t = {
+ create_name: e.conf.site,
+ create_urls: `${window.location.protocol}//${window.location.host}`
+ };
+ i = `sites|${JSON.stringify(t)}`
+ }
+ throw _n({
+ $err: e.get("list").$el,
+ errMsg: t.msg || String(t),
+ errData: t.data,
+ retryFn: () => Ln(e),
+ onOpenSidebar: e.get("user").getData().isAdmin ? () => e.showSidebar({
+ view: i
+ }) : void 0
+ }), t
+ })).then((() => {
+ e.conf.remoteConfModifier || e.fetch({
+ offset: 0
+ })
+ })).catch((() => {}))
+ }
+ const An = "ArtalkContent";
+ class On {
+ constructor(e) {
+ this.kit = e
+ }
+ reqAdd() {
+ return k(this, null, (function*() {
+ return yield this.kit.useApi().comment.add(u({}, this.getSubmitAddParams()))
+ }))
+ }
+ getSubmitAddParams() {
+ const {
+ nick: e,
+ email: t,
+ link: n
+ } = this.kit.useUser().getData(), i = this.kit.useConf();
+ return {
+ content: this.kit.useEditor().getContentFinal(),
+ nick: e,
+ email: t,
+ link: n,
+ rid: 0,
+ page_key: i.pageKey,
+ page_title: i.pageTitle,
+ site_name: i.site
+ }
+ }
+ postSubmitAdd(e) {
+ this.kit.useGlobalCtx().getData().insertComment(e)
+ }
+ }
+ class Pn extends qt {
+ constructor(e) {
+ super(e), g(this, "customs", []), g(this, "defaultPreset"), this.defaultPreset = new On(this
+ .kit);
+ const t = () => this.do();
+ this.kit.useMounted((() => {
+ this.kit.useGlobalCtx().on("editor-submit", t)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useGlobalCtx().off("editor-submit", t)
+ }))
+ }
+ registerCustom(e) {
+ this.customs.push(e)
+ }
+ do() {
+ return k(this, null, (function*() {
+ if ("" === this.kit.useEditor().getContentFinal().trim()) return void this.kit
+ .useEditor().focus();
+ const e = this.customs.find((e => e.activeCond()));
+ this.kit.useEditor().showLoading();
+ try {
+ let t;
+ (null == e ? void 0 : e.pre) && e.pre(), t = (null == e ? void 0 : e.req) ?
+ yield e.req(): yield this.defaultPreset.reqAdd(), (null == e ? void 0 :
+ e.post) ? e.post(t) : this.defaultPreset.postSubmitAdd(t)
+ } catch (t) {
+ return console.error(t), void this.kit.useEditor().showNotify(
+ `${D("commentFail")},${t.msg||String(t)}`, "e")
+ } finally {
+ this.kit.useEditor().hideLoading()
+ }
+ this.kit.useEditor().reset(), this.kit.useGlobalCtx().trigger(
+ "editor-submitted")
+ }))
+ }
+ }
+ class Rn extends qt {
+ constructor(e) {
+ super(e), g(this, "emoticons", []), g(this, "loadingTask", null), g(this, "$grpWrap"), g(this,
+ "$grpSwitcher"), g(this, "isListLoaded", !1), g(this, "isImgLoaded", !1), this.kit
+ .useMounted((() => {
+ this.usePanel('
'), this.useBtn(D(
+ "emoticon"))
+ })), this.kit.useUnmounted((() => {})), this.useContentTransformer((e => this
+ .transEmoticonImageText(e))), this.usePanelShow((() => {
+ (() => {
+ k(this, null, (function*() {
+ yield this.loadEmoticonsData(), this.isImgLoaded || (
+ this.initEmoticonsList(), this.isImgLoaded = !0
+ ), setTimeout((() => {
+ this.changeListHeight()
+ }), 30)
+ }))
+ })()
+ })), this.usePanelHide((() => {
+ this.$panel.parentElement.style.height = ""
+ })), window.setTimeout((() => {
+ this.loadEmoticonsData()
+ }), 1e3)
+ }
+ loadEmoticonsData() {
+ return k(this, null, (function*() {
+ this.isListLoaded || (null === this.loadingTask ? (this.loadingTask = (() => k(
+ this, null, (function*() {
+ Tt(this.$panel), this.emoticons = yield this
+ .handleData(this.kit.useConf().emoticons),
+ _t(this.$panel), this.loadingTask = null,
+ this.isListLoaded = !0
+ })))(), yield this.loadingTask) : yield this.loadingTask)
+ }))
+ }
+ handleData(e) {
+ return k(this, null, (function*() {
+ if (!Array.isArray(e) && ["object", "string"].includes(typeof e) && (e = [e]), !
+ Array.isArray(e)) return Pt(this.$panel, "表情包数据必须为 Array/Object/String 类型"),
+ _t(this.$panel), [];
+ const t = t => {
+ "object" == typeof t && (t.name && e.find((e => e.name === t.name)) || e
+ .push(t))
+ },
+ n = e => k(this, null, (function*() {
+ yield Promise.all(e.map(((e, i) => k(this, null, (function*() {
+ if ("object" != typeof e || Array
+ .isArray(e)) {
+ if (Array.isArray(e)) yield n(
+ e);
+ else if ("string" == typeof e) {
+ const i = yield this
+ .remoteLoad(e);
+ Array.isArray(i) ? yield n(
+ i): "object" ==
+ typeof i && t(i)
+ }
+ } else t(e)
+ })))))
+ }));
+ return yield n(e), e.forEach((e => {
+ if (this.isOwOFormat(e)) {
+ this.convertOwO(e).forEach((e => {
+ t(e)
+ }))
+ } else Array.isArray(e) && e.forEach((e => {
+ t(e)
+ }))
+ })), e = e.filter((e => "object" == typeof e && !Array.isArray(e) && !!
+ e && !!e.name)), this.solveNullKey(e), this.solveSameKey(e), e
+ }))
+ }
+ remoteLoad(e) {
+ return k(this, null, (function*() {
+ if (!e) return [];
+ try {
+ const t = yield fetch(e);
+ return yield t.json()
+ } catch (t) {
+ return _t(this.$panel), console.error("[Emoticons] Load Failed:", t), Pt(
+ this.$panel, `${D("emoticon")}${D("loadFail")} ${String(t)}`), []
+ }
+ }))
+ }
+ solveNullKey(e) {
+ e.forEach((e => {
+ e.items.forEach(((t, n) => {
+ t.key || (t.key = `${e.name} ${n+1}`)
+ }))
+ }))
+ }
+ solveSameKey(e) {
+ const t = {};
+ e.forEach((e => {
+ e.items.forEach((e => {
+ e.key && "" !== String(e.key).trim() && (t[e.key] ? t[e.key]++ :
+ t[e.key] = 1, t[e.key] > 1 && (e.key =
+ `${e.key} ${t[e.key]}`))
+ }))
+ }))
+ }
+ isOwOFormat(e) {
+ try {
+ return "object" == typeof e && !!Object.values(e).length && Array.isArray(Object.keys(Object
+ .values(e)[0].container)) && Object.keys(Object.values(e)[0].container[0]).includes(
+ "icon")
+ } catch (t) {
+ return !1
+ }
+ }
+ convertOwO(e) {
+ const t = [];
+ return Object.entries(e).forEach((([e, n]) => {
+ const i = {
+ name: e,
+ type: n.type,
+ items: []
+ };
+ n.container.forEach(((t, n) => {
+ const s = t.icon;
+ if (/<(img|IMG)/.test(s)) {
+ const e = /src=["'](.*?)["']/.exec(s);
+ e && e.length > 1 && (t.icon = e[1])
+ }
+ i.items.push({
+ key: t.text || `${e} ${n+1}`,
+ val: t.icon
+ })
+ })), t.push(i)
+ })), t
+ }
+ initEmoticonsList() {
+ this.$grpWrap = y('
'), this.$panel.append(this.$grpWrap), this
+ .emoticons.forEach(((e, t) => {
+ const n = y('
');
+ this.$grpWrap.append(n), n.setAttribute("data-index", String(t)), n
+ .setAttribute("data-grp-name", e.name), n.setAttribute("data-type", e.type),
+ e.items.forEach((t => {
+ const i = y('
');
+ if (n.append(i), t.key && !new RegExp(
+ `^(${e.name})?\\s?[0-9]+$`).test(t.key) && i
+ .setAttribute("title", t.key), "image" === e.type) {
+ const e = document.createElement("img");
+ e.src = t.val, e.alt = t.key, i.append(e)
+ } else i.innerText = t.val;
+ i.onclick = () => {
+ "image" === e.type ? this.kit.useEditor().insertContent(
+ `:[${t.key}]`) : this.kit.useEditor()
+ .insertContent(t.val || "")
+ }
+ }))
+ })), this.emoticons.length > 1 && (this.$grpSwitcher = y(
+ '
'), this.$panel.append(this.$grpSwitcher), this
+ .emoticons.forEach(((e, t) => {
+ const n = y("
");
+ n.innerText = e.name, n.setAttribute("data-index", String(t)), n.onclick =
+ () => this.openGrp(t), this.$grpSwitcher.append(n)
+ }))), this.emoticons.length > 0 && this.openGrp(0)
+ }
+ openGrp(e) {
+ var t, n, i;
+ Array.from(this.$grpWrap.children).forEach((t => {
+ const n = t;
+ n.getAttribute("data-index") !== String(e) ? n.style.display = "none" : n.style
+ .display = ""
+ })), null == (t = this.$grpSwitcher) || t.querySelectorAll("span.active").forEach((e => e
+ .classList.remove("active"))), null == (i = null == (n = this.$grpSwitcher) ? void 0 : n
+ .querySelector(`span[data-index="${e}"]`)) || i.classList.add("active"), this
+ .changeListHeight()
+ }
+ changeListHeight() {}
+ transEmoticonImageText(e) {
+ return this.emoticons && Array.isArray(this.emoticons) ? (this.emoticons.forEach((t => {
+ "image" === t.type && Object.entries(t.items).forEach((([t, n]) => {
+ e = e.split(`:[${n.key}]`).join(
+ `
`)
+ }))
+ })), e) : e
+ }
+ }
+ const Mn = ["png", "jpg", "jpeg", "gif", "bmp", "svg", "webp"];
+ class In extends qt {
+ constructor(e) {
+ super(e), g(this, "$imgUploadInput"), this.kit.useMounted((() => this.init())), this
+ .initDragImg()
+ }
+ init() {
+ this.$imgUploadInput = document.createElement("input"), this.$imgUploadInput.type = "file", this
+ .$imgUploadInput.style.display = "none", this.$imgUploadInput.accept = Mn.map((e =>
+ `.${e}`)).join(",");
+ const e = this.useBtn(`${D("image")}`);
+ e.after(this.$imgUploadInput), e.onclick = () => {
+ const e = this.$imgUploadInput;
+ e.onchange = () => {
+ (() => {
+ k(this, null, (function*() {
+ if (!e.files || 0 === e.files.length) return;
+ const t = e.files[0];
+ this.uploadImg(t)
+ }))
+ })()
+ }, e.click()
+ }, this.kit.useConf().imgUpload || this.$btn.setAttribute("atk-only-admin-show", "")
+ }
+ initDragImg() {
+ const e = e => {
+ if (e)
+ for (let t = 0; t < e.length; t++) {
+ const n = e[t];
+ this.uploadImg(n)
+ }
+ },
+ t = e => {
+ e.stopPropagation(), e.preventDefault()
+ },
+ n = t => {
+ var n;
+ const i = null == (n = t.dataTransfer) ? void 0 : n.files;
+ (null == i ? void 0 : i.length) && (t.preventDefault(), e(i))
+ },
+ i = t => {
+ var n;
+ const i = null == (n = t.clipboardData) ? void 0 : n.files;
+ (null == i ? void 0 : i.length) && (t.preventDefault(), e(i))
+ };
+ this.kit.useMounted((() => {
+ this.kit.useUI().$textarea.addEventListener("dragover", t), this.kit.useUI()
+ .$textarea.addEventListener("drop", n), this.kit.useUI().$textarea
+ .addEventListener("paste", i)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useUI().$textarea.removeEventListener("dragover", t), this.kit.useUI()
+ .$textarea.removeEventListener("drop", n), this.kit.useUI().$textarea
+ .removeEventListener("paste", i)
+ }))
+ }
+ uploadImg(e) {
+ return k(this, null, (function*() {
+ const t = /[^.]+$/.exec(e.name);
+ if (!t || !Mn.includes(t[0])) return;
+ if (!this.kit.useUser().checkHasBasicUserInfo()) return void this.kit
+ .useEditor().showNotify(D("uploadLoginMsg"), "w");
+ let n = "\n";
+ "" === this.kit.useUI().$textarea.value.trim() && (n = "");
+ const i = `${n}![](Uploading ${e.name}...)`;
+ let s;
+ this.kit.useEditor().insertContent(i);
+ try {
+ const t = this.kit.useConf().imgUploader;
+ s = t ? {
+ img_url: yield t(e)
+ } : yield this.kit.useApi().upload.imgUpload(e)
+ } catch (r) {
+ console.error(r), this.kit.useEditor().showNotify(
+ `${D("uploadFail")},${r.msg}`, "e")
+ }
+ if (s && s.img_url) {
+ let e = s.img_url;
+ E(e) || (e = T({
+ base: this.kit.useConf().server,
+ path: e
+ })), this.kit.useEditor().setContent(this.kit.useUI().$textarea.value
+ .replace(i, `${n}![](${e})`))
+ } else this.kit.useEditor().setContent(this.kit.useUI().$textarea.value.replace(
+ i, ""))
+ }))
+ }
+ }
+ class Un extends qt {
+ constructor(e) {
+ super(e), g(this, "isPlugPanelShow", !1), this.kit.useMounted((() => {
+ this.usePanel('
');
+ let e = D("preview");
+ kt() && (e +=
+ '
'
+ ), this.useBtn(e)
+ })), this.kit.useUnmounted((() => {})), this.kit.useEvents().on("content-updated", (e => {
+ this.isPlugPanelShow && this.updateContent()
+ })), this.usePanelShow((() => {
+ this.isPlugPanelShow = !0, this.updateContent()
+ })), this.usePanelHide((() => {
+ this.isPlugPanelShow = !1
+ }))
+ }
+ updateContent() {
+ this.$panel.innerHTML = this.kit.useEditor().getContentMarked()
+ }
+ }
+ const Dn = [class extends qt {
+ constructor(e) {
+ super(e);
+ const t = () => {
+ this.save()
+ };
+ this.kit.useMounted((() => {
+ const e = window.localStorage.getItem(An) || "";
+ "" !== e.trim() && (this.kit.useEditor().showNotify(D("restoredMsg"),
+ "i"), this.kit.useEditor().setContent(e)), this.kit.useEvents()
+ .on("content-updated", t)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useEvents().off("content-updated", t)
+ }))
+ }
+ save() {
+ window.localStorage.setItem(An, this.kit.useEditor().getContentRaw().trim())
+ }
+ }, class extends qt {
+ get $inputs() {
+ return this.kit.useEditor().getHeaderInputEls()
+ }
+ constructor(e) {
+ super(e);
+ const t = {},
+ n = {},
+ i = (e, t, n) => () => {
+ this.kit.useEvents().trigger(e, {
+ field: n,
+ $input: t
+ })
+ };
+ this.kit.useMounted((() => {
+ Object.entries(this.$inputs).forEach((([e, s]) => {
+ s.addEventListener("input", t[e] = i("header-input", s, e)),
+ s.addEventListener("change", n[e] = i("header-change",
+ s, e))
+ }))
+ })), this.kit.useUnmounted((() => {
+ Object.entries(this.$inputs).forEach((([e, i]) => {
+ i.removeEventListener("input", t[e]), i.removeEventListener(
+ "change", n[e])
+ }))
+ }))
+ }
+ }, class extends qt {
+ constructor(e) {
+ super(e), g(this, "query", {
+ timer: null,
+ abortFn: null
+ });
+ const t = ({
+ $input: e,
+ field: t
+ }) => {
+ "edit" !== this.kit.useEditor().getState() && (this.kit.useUser().update({
+ [t]: e.value.trim()
+ }), "nick" !== t && "email" !== t || this.fetchUserInfo())
+ };
+ this.kit.useMounted((() => {
+ Object.entries(this.kit.useEditor().getHeaderInputEls()).forEach((([e,
+ t]) => {
+ t.placeholder = `${D(e)}`, t.value = this.kit.useUser()
+ .getData()[e] || ""
+ })), this.kit.useEvents().on("header-input", t)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useEvents().off("header-input", t)
+ }))
+ }
+ fetchUserInfo() {
+ this.kit.useUser().logout(), this.query.timer && window.clearTimeout(this.query.timer),
+ this.query.abortFn && this.query.abortFn(), this.query.timer = window.setTimeout((
+ () => {
+ this.query.timer = null;
+ const {
+ req: e,
+ abort: t
+ } = this.kit.useApi().user.userGet(this.kit.useUser().getData().nick,
+ this.kit.useUser().getData().email);
+ this.query.abortFn = t, e.then((e => this.onUserInfoFetched(e))).catch((
+ e => {})).finally((() => {
+ this.query.abortFn = null
+ }))
+ }), 400)
+ }
+ onUserInfoFetched(e) {
+ var t;
+ e.is_login || this.kit.useUser().logout(), this.kit.useGlobalCtx().getData()
+ .updateUnreads(e.unread), this.kit.useUser().checkHasBasicUserInfo() && !e
+ .is_login && (null == (t = e.user) ? void 0 : t.is_admin) && this.kit.useGlobalCtx()
+ .checkAdmin({
+ onSuccess: () => {}
+ }), e.user && e.user.link && (this.kit.useUI().$link.value = e.user.link, this.kit
+ .useUser().update({
+ link: e.user.link
+ }))
+ }
+ }, class extends qt {
+ constructor(e) {
+ super(e);
+ const t = ({
+ field: e
+ }) => {
+ "link" === e && this.onLinkInputChange()
+ };
+ this.kit.useMounted((() => {
+ this.kit.useEvents().on("header-change", t)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useEvents().off("header-change", t)
+ }))
+ }
+ onLinkInputChange() {
+ const e = this.kit.useUI().$link.value.trim();
+ e && !/^(http|https):\/\//.test(e) && (this.kit.useUI().$link.value = `https://${e}`,
+ this.kit.useUser().update({
+ link: this.kit.useUI().$link.value
+ }))
+ }
+ }, class extends qt {
+ constructor(e) {
+ super(e);
+ const t = e => this.onKeydown(e),
+ n = () => this.onInput();
+ this.kit.useMounted((() => {
+ this.kit.useUI().$textarea.placeholder = this.kit.useConf()
+ .placeholder || D("placeholder"), this.kit.useUI().$textarea
+ .addEventListener("keydown", t), this.kit.useUI().$textarea
+ .addEventListener("input", n)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useUI().$textarea.removeEventListener("keydown", t), this.kit
+ .useUI().$textarea.removeEventListener("input", n)
+ })), this.kit.useEvents().on("content-updated", (() => {
+ window.setTimeout((() => {
+ this.adaptiveHeightByContent()
+ }), 80)
+ }))
+ }
+ onKeydown(e) {
+ 9 === (e.keyCode || e.which) && (e.preventDefault(), this.kit.useEditor().insertContent(
+ "\t"))
+ }
+ onInput() {
+ this.kit.useEvents().trigger("content-updated", this.kit.useEditor().getContentRaw())
+ }
+ adaptiveHeightByContent() {
+ const e = this.kit.useUI().$textarea.offsetHeight - this.kit.useUI().$textarea
+ .clientHeight;
+ this.kit.useUI().$textarea.style.height = "0px", this.kit.useUI().$textarea.style
+ .height = `${this.kit.useUI().$textarea.scrollHeight+e}px`
+ }
+ }, Pn, class extends qt {
+ constructor(e) {
+ super(e);
+ const t = () => {
+ this.kit.useEditor().submit()
+ };
+ this.kit.useMounted((() => {
+ this.kit.useUI().$submitBtn.innerText = this.kit.useConf().sendBtn || D(
+ "send"), this.kit.useUI().$submitBtn.addEventListener("click",
+ t)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useUI().$submitBtn.removeEventListener("click", t)
+ }))
+ }
+ }, Ft, class extends qt {
+ constructor(e) {
+ super(e), g(this, "comment"), this.useEditorStateEffect("reply", (e => (this.setReply(
+ e), () => {
+ this.cancelReply()
+ }))), this.kit.useEvents().on("mounted", (() => {
+ const e = this.kit.useDeps(Pn);
+ if (!e) throw Error("SubmitPlug not initialized");
+ const t = new On(this.kit);
+ e.registerCustom({
+ activeCond: () => !!this.comment,
+ req: () => k(this, null, (function*() {
+ if (!this.comment) throw new Error(
+ "reply comment cannot be empty");
+ return yield this.kit.useApi().comment.add(
+ p(u({}, t
+ .getSubmitAddParams()), {
+ rid: this.comment.id,
+ page_key: this.comment
+ .page_key,
+ page_title: void 0,
+ site_name: this.comment
+ .site_name
+ }))
+ })),
+ post: e => {
+ const n = this.kit.useConf();
+ e.page_key !== n.pageKey && window.open(
+ `${e.page_url}#atk-comment-${e.id}`), t
+ .postSubmitAdd(e)
+ }
+ })
+ }))
+ }
+ setReply(e) {
+ const t = this.kit.useUI();
+ t.$sendReply || (t.$sendReply = y(
+ `
${D("reply")} ×
`
+ ), t.$sendReply.querySelector(".atk-text").innerText = `@${e.nick}`, t
+ .$sendReply.addEventListener("click", (() => {
+ this.kit.useEditor().resetState()
+ })), t.$textareaWrap.append(t.$sendReply)), this.comment = e, t.$textarea
+ .focus()
+ }
+ cancelReply() {
+ if (!this.comment) return;
+ const e = this.kit.useUI();
+ e.$sendReply && (e.$sendReply.remove(), e.$sendReply = void 0), this.comment = void 0
+ }
+ }, class extends qt {
+ constructor(e) {
+ super(e), g(this, "comment"), g(this, "originalSubmitBtnText", "Send"), this
+ .useEditorStateEffect("edit", (e => (this.edit(e), () => {
+ this.cancelEdit()
+ }))), this.kit.useMounted((() => {
+ const e = this.kit.useDeps(Pn);
+ if (!e) throw Error("SubmitPlug not initialized");
+ e.registerCustom({
+ activeCond: () => !!this.comment,
+ req: () => k(this, null, (function*() {
+ const e = {
+ content: this.kit.useEditor()
+ .getContentFinal(),
+ nick: this.kit.useUI().$nick.value,
+ email: this.kit.useUI().$email
+ .value,
+ link: this.kit.useUI().$link.value
+ };
+ return yield this.kit.useApi().comment
+ .commentEdit(u(u({}, this.comment),
+ e))
+ })),
+ post: e => {
+ this.kit.useGlobalCtx().getData().updateComment(e)
+ }
+ })
+ }))
+ }
+ edit(e) {
+ const t = this.kit.useUI();
+ if (!t.$editCancelBtn) {
+ const e = y(
+ `
${D("editCancel")} ×
`
+ );
+ e.onclick = () => {
+ this.kit.useEditor().resetState()
+ }, t.$textareaWrap.append(e), t.$editCancelBtn = e
+ }
+ this.comment = e, t.$header.style.display = "none", t.$nick.value = e.nick || "", t
+ .$email.value = e.email || "", t.$link.value = e.link || "", this.kit.useEditor()
+ .setContent(e.content), t.$textarea.focus(), this.updateSubmitBtnText(D("save"))
+ }
+ cancelEdit() {
+ if (!this.comment) return;
+ const e = this.kit.useUI();
+ e.$editCancelBtn && (e.$editCancelBtn.remove(), e.$editCancelBtn = void 0), this
+ .comment = void 0;
+ const {
+ nick: t,
+ email: n,
+ link: i
+ } = this.kit.useUser().getData();
+ e.$nick.value = t, e.$email.value = n, e.$link.value = i, this.kit.useEditor()
+ .setContent(""), this.restoreSubmitBtnText(), e.$header.style.display = ""
+ }
+ updateSubmitBtnText(e) {
+ this.originalSubmitBtnText = this.kit.useUI().$submitBtn.innerText, this.kit.useUI()
+ .$submitBtn.innerText = e
+ }
+ restoreSubmitBtnText() {
+ this.kit.useUI().$submitBtn.innerText = this.originalSubmitBtnText
+ }
+ }, class extends qt {
+ constructor(e) {
+ super(e);
+ const t = () => this.open(),
+ n = () => this.close();
+ this.kit.useMounted((() => {
+ this.kit.useEvents().on("editor-open", t), this.kit.useEvents().on(
+ "editor-close", n)
+ })), this.kit.useUnmounted((() => {
+ this.kit.useEvents().off("editor-open", t), this.kit.useEvents().off(
+ "editor-close", n)
+ }))
+ }
+ open() {
+ var e;
+ null == (e = this.kit.useUI().$textareaWrap.querySelector(".atk-comment-closed")) || e
+ .remove(), this.kit.useUI().$textarea.style.display = "", this.kit.useUI().$bottom
+ .style.display = ""
+ }
+ close() {
+ this.kit.useUI().$textareaWrap.querySelector(".atk-comment-closed") || this.kit.useUI()
+ .$textareaWrap.prepend(y(
+ ``)), this.kit
+ .useUser().getData().isAdmin ? (this.kit.useUI().$textarea.style.display = "", this
+ .kit.useUI().$bottom.style.display = "") : (this.kit.useUI().$textarea.style
+ .display = "none", this.kit.useEvents().trigger("panel-close"), this.kit.useUI()
+ .$bottom.style.display = "none")
+ }
+ }, Rn, In, Un];
+ class Bn {
+ constructor(e) {
+ this.plugs = e
+ }
+ useEditor() {
+ return this.plugs.editor
+ }
+ useGlobalCtx() {
+ return this.plugs.editor.ctx
+ }
+ useConf() {
+ return this.plugs.editor.ctx.conf
+ }
+ useApi() {
+ return this.plugs.editor.ctx.getApi()
+ }
+ useUser() {
+ return this.plugs.editor.ctx.get("user")
+ }
+ useUI() {
+ return this.plugs.editor.getUI()
+ }
+ useEvents() {
+ return this.plugs.getEvents()
+ }
+ useMounted(e) {
+ this.useEvents().on("mounted", e)
+ }
+ useUnmounted(e) {
+ this.useEvents().on("unmounted", e)
+ }
+ useDeps(e) {
+ return this.plugs.get(e)
+ }
+ }
+ class qn {
+ constructor(e) {
+ g(this, "plugs", []), g(this, "openedPlug", null), g(this, "events", new bt), this.editor = e;
+ let t = !1;
+ this.editor.ctx.on("conf-loaded", (() => {
+ t && this.getEvents().trigger("unmounted"), this.clear();
+ const e = (n = this.editor.ctx.conf, [{
+ k: In,
+ v: n.imgUpload
+ }, {
+ k: Rn,
+ v: n.emoticons
+ }, {
+ k: Un,
+ v: n.preview
+ }, {
+ k: Ft,
+ v: n.editorTravel
+ }].filter((e => !e.v)).flatMap((e => e.k)));
+ var n;
+ Dn.filter((t => !e.includes(t))).forEach((e => {
+ const t = new Bn(this);
+ this.plugs.push(new e(t))
+ })), this.getEvents().trigger("mounted"), t = !0, this.loadPluginUI()
+ })), this.events.on("panel-close", (() => this.closePlugPanel()))
+ }
+ getPlugs() {
+ return this.plugs
+ }
+ getEvents() {
+ return this.events
+ }
+ clear() {
+ this.plugs = [], this.events = new bt, this.openedPlug && this.closePlugPanel()
+ }
+ loadPluginUI() {
+ this.editor.getUI().$plugPanelWrap.innerHTML = "", this.editor.getUI().$plugPanelWrap.style
+ .display = "none", this.editor.getUI().$plugBtnWrap.innerHTML = "", this.plugs.forEach((e =>
+ this.loadPluginItem(e)))
+ }
+ loadPluginItem(e) {
+ const t = e.$btn;
+ if (!t) return;
+ this.editor.getUI().$plugBtnWrap.appendChild(t), !t.onclick && (t.onclick = () => {
+ this.editor.getUI().$plugBtnWrap.querySelectorAll(".active").forEach((e => e
+ .classList.remove("active"))), e !== this.openedPlug ? (this.openPlugPanel(
+ e), t.classList.add("active")) : this.closePlugPanel()
+ });
+ const n = e.$panel;
+ n && (n.style.display = "none", this.editor.getUI().$plugPanelWrap.appendChild(n))
+ }
+ get(e) {
+ return this.plugs.find((t => t instanceof e))
+ }
+ openPlugPanel(e) {
+ this.plugs.forEach((t => {
+ const n = t.$panel;
+ n && (t === e ? (n.style.display = "", this.events.trigger("panel-show", e)) : (
+ n.style.display = "none", this.events.trigger("panel-hide", e)))
+ })), this.editor.getUI().$plugPanelWrap.style.display = "", this.openedPlug = e
+ }
+ closePlugPanel() {
+ this.openedPlug && (this.editor.getUI().$plugPanelWrap.style.display = "none", this.events
+ .trigger("panel-hide", this.openedPlug), this.openedPlug = null)
+ }
+ getTransformedContent(e) {
+ let t = e;
+ return this.plugs.forEach((e => {
+ e.contentTransformer && (t = e.contentTransformer(t))
+ })), t
+ }
+ }
+ const Fn = "2.7.3";
+
+ function zn(e) {
+ return k(this, null, (function*() {
+ e.countEl && document.querySelector(e.countEl) && Wn(e, {
+ query: "page_comment",
+ numEl: e.countEl
+ });
+ const t = e.pvAdd ? {
+ [e.pageKey]: yield e.getApi().page.pv()
+ } : void 0;
+ e.pvEl && document.querySelector(e.pvEl) && Wn(e, {
+ query: "page_pv",
+ numEl: e.pvEl,
+ data: t
+ })
+ }))
+ }
+
+ function Wn(e, t) {
+ return k(this, null, (function*() {
+ let n = t.data || {},
+ i = Array.from(document.querySelectorAll(t.numEl)).map((t => t.getAttribute(
+ "data-page-key") || e.pageKey)).filter((e => "number" != typeof n[e]));
+ if (i = [...new Set(i)], i.length > 0) {
+ const s = yield e.getApi().page.stat(t.query, i);
+ n = u(u({}, n), s)
+ }! function(e, t, n) {
+ document.querySelectorAll(e).forEach((e => {
+ const i = e.getAttribute("data-page-key"),
+ s = Number(i ? t[i] : n);
+ e.innerHTML = `${s}`
+ }))
+ }(t.numEl, n, n[e.pageKey])
+ }))
+ }
+ let jn = !1;
+ let Nn;
+
+ function Hn(e, t) {
+ const n = "atk-dark-mode";
+ e.forEach((e => {
+ t ? e.classList.add(n) : e.classList.remove(n)
+ }))
+ }
+ const Qn = [...[e => {
+ e.on("inited", (() => {
+ !1 !== e.conf.immediateFetch && e.trigger("conf-fetch")
+ })), e.on("conf-fetch", (() => {
+ Ln(e)
+ }))
+ }, e => {
+ ! function() {
+ try {
+ if (!Ee.name) return
+ } catch (e) {
+ return
+ }
+ Ee.setOptions(u({
+ renderer: ht()
+ }, ft)), gt = Ee
+ }(), e.on("conf-loaded", (e => {
+ var t;
+ e.markedReplacers && (t = e.markedReplacers, mt = t)
+ }))
+ }, e => {
+ const t = e.get("editor"),
+ n = new qn(t);
+ e.inject("editorPlugs", n)
+ }, e => {
+ const t = () => {
+ var t;
+ t = e.get("user").getData().isAdmin,
+ function(e) {
+ const t = [];
+ e.$root.querySelectorAll("[atk-only-admin-show]").forEach((e => t.push(e)));
+ const n = document.querySelector(".atk-sidebar");
+ return n && n.querySelectorAll("[atk-only-admin-show]").forEach((e => t
+ .push(e))), t
+ }({
+ $root: e.$root
+ }).forEach((e => {
+ t ? e.classList.remove("atk-hide") : e.classList.add("atk-hide")
+ }))
+ };
+ e.on("list-loaded", (() => {
+ t()
+ })), e.on("user-changed", (e => {
+ t()
+ }))
+ }, ...[e => {
+ e.on("list-fetch", (t => {
+ if (e.getData().getLoading()) return;
+ e.getData().setLoading(!0);
+ const n = u({
+ offset: 0,
+ limit: e.conf.pagination.pageSize,
+ flatMode: e.conf.flatMode,
+ paramsModifier: e.conf.listFetchParamsModifier
+ }, t);
+ e.getData().setListLastFetch({
+ params: n
+ }), e.getApi().comment.get(n.offset, n.limit, n.flatMode, n
+ .paramsModifier).then((t => {
+ e.getData().setListLastFetch({
+ params: n,
+ data: t
+ }), e.getData().loadComments(t.comments), e
+ .getData().updatePage(t.page), e.getData()
+ .updateUnreads(t.unread || []), n.onSuccess && n
+ .onSuccess(t), e.trigger("list-fetched", {
+ params: n,
+ data: t
+ })
+ })).catch((t => {
+ const i = {
+ msg: t.msg || String(t),
+ data: t.data
+ };
+ throw n.onError && n.onError(i), e.trigger("list-error",
+ i), e.trigger("list-fetched", {
+ params: n,
+ error: i
+ }), t
+ })).finally((() => {
+ e.getData().setLoading(!1)
+ }))
+ }))
+ }, e => {
+ e.on("list-fetch", (t => {
+ const n = e.get("list");
+ 0 === t.offset && Lt(!0, n.$el)
+ })), e.on("list-fetched", (() => {
+ Lt(!1, e.get("list").$el)
+ }))
+ }, e => {
+ e.on("comment-rendered", (t => {
+ if (!0 === e.conf.listUnreadHighlight) {
+ const n = e.getData().getUnreads(),
+ i = n.find((e => e.comment_id === t.getID()));
+ i ? (t.getRender().setUnread(!0), t.getRender().setOpenAction((
+ () => {
+ window.open(i.read_link), e.getData()
+ .updateUnreads(n.filter((e => e
+ .comment_id !== t.getID())))
+ }))) : t.getRender().setUnread(!1)
+ }
+ })), e.on("list-goto", (t => {
+ const n = b("atk_notify_key");
+ n && e.getApi().user.markRead(t, n).then((() => {
+ e.getData().updateUnreads(e.getData().getUnreads()
+ .filter((e => e.comment_id !== t)))
+ }))
+ }))
+ }, e => {
+ let t;
+ e.on("inited", (() => {
+ const n = e.get("list");
+ t = n.$el.querySelector('[data-action="admin-close-comment"]'), t
+ .addEventListener("click", (() => {
+ const t = e.getData().getPage();
+ if (!t) throw new Error("Page data not found");
+ t.admin_only = !t.admin_only,
+ function(e, t) {
+ e.editorShowLoading(), e.getApi().page.pageEdit(
+ t).then((t => {
+ e.getData().updatePage(t)
+ })).catch((t => {
+ e.editorShowNotify(
+ `${D("editFail")}: ${t.msg||String(t)}`,
+ "e")
+ })).finally((() => {
+ e.editorHideLoading()
+ }))
+ }(e, t)
+ }))
+ })), e.on("page-loaded", (n => {
+ var i, s;
+ const r = e.get("editor");
+ !0 === (null == n ? void 0 : n.admin_only) ? (null == (i = r
+ .getPlugs()) || i.getEvents().trigger("editor-close"), t && (t
+ .innerText = D("openComment"))) : (null == (s = r
+ .getPlugs()) || s.getEvents().trigger("editor-open"), t && (t
+ .innerText = D("closeComment")))
+ })), e.on("list-loaded", (t => {
+ e.editorResetState()
+ }))
+ }, e => {
+ e.on("list-loaded", (() => {
+ (() => {
+ var t, n;
+ const i = e.get("list").$el.querySelector(
+ ".atk-comment-count .atk-text");
+ if (!i) return;
+ const s = $(D("counter", {
+ count: `${Number(null==(n=null==(t=e.getData().getListLastFetch())?void 0:t.data)?void 0:n.total)||0}`
+ }));
+ i.innerHTML = s.replace(/(\d+)/,
+ '')
+ })()
+ })), e.on("comment-inserted", (() => {
+ const t = e.getData().getListLastFetch();
+ (null == t ? void 0 : t.data) && (t.data.total += 1)
+ })), e.on("comment-deleted", (() => {
+ const t = e.getData().getListLastFetch();
+ (null == t ? void 0 : t.data) && (t.data.total -= 1)
+ }))
+ }, e => {
+ let t = null;
+ const n = () => {
+ if (!t) return;
+ const n = e.get("user").getData();
+ if (n.nick && n.email) {
+ t.classList.remove("atk-hide");
+ const e = t.querySelector(".atk-text");
+ e && (e.innerText = n.isAdmin ? D("ctrlCenter") : D("msgCenter"))
+ } else t.classList.add("atk-hide")
+ };
+ e.on("conf-loaded", (() => {
+ const i = e.get("list");
+ t = i.$el.querySelector('[data-action="open-sidebar"]'), t && (t
+ .onclick = () => {
+ e.showSidebar()
+ }, n())
+ })), e.on("user-changed", (e => {
+ n()
+ }))
+ }, e => {
+ let t = null;
+ e.on("conf-loaded", (() => {
+ const n = e.get("list");
+ t = n.$el.querySelector(".atk-unread-badge")
+ })), e.on("unreads-updated", (e => {
+ var n;
+ n = e.length || 0, t && (n > 0 ? (t.innerText = `${Number(n||0)}`, t
+ .style.display = "block") : t.style.display = "none")
+ }))
+ }, e => {
+ const t = t => {
+ e.conf.listFetchParamsModifier = t, e.reload()
+ },
+ n = e => {
+ ! function(e) {
+ const {
+ $dropdownWrap: t,
+ dropdownList: n
+ } = e;
+ if (t.querySelector(".atk-dropdown")) return;
+ t.classList.add("atk-dropdown-wrap"), t.append(y(
+ '
'));
+ let i = 0;
+ const s = (e, t, n, s) => {
+ s(), i = e, r.querySelectorAll(".active").forEach((e => {
+ e.classList.remove("active")
+ })), t.classList.add("active"), r.style.display = "none",
+ setTimeout((() => {
+ r.style.display = ""
+ }), 80)
+ },
+ r = y('
');
+ n.forEach(((e, t) => {
+ const n = e[0],
+ o = e[1],
+ a = y(
+ '
'),
+ l = a.querySelector("span");
+ l.innerText = n, l.onclick = () => {
+ s(t, a, n, o)
+ }, r.append(a), t === i && a.classList.add("active")
+ })), t.append(r)
+ }({
+ $dropdownWrap: e,
+ dropdownList: [
+ [D("sortLatest"), () => {
+ t((e => {
+ e.sort_by = "date_desc"
+ }))
+ }],
+ [D("sortBest"), () => {
+ t((e => {
+ e.sort_by = "vote"
+ }))
+ }],
+ [D("sortOldest"), () => {
+ t((e => {
+ e.sort_by = "date_asc"
+ }))
+ }],
+ [D("sortAuthor"), () => {
+ t((e => {
+ e.view_only_admin = !0
+ }))
+ }]
+ ]
+ })
+ };
+ e.on("conf-loaded", (() => {
+ const t = e.get("list").$el.querySelector(".atk-comment-count");
+ t && (e.conf.listSort ? n(t) : function(e) {
+ var t, n;
+ const {
+ $dropdownWrap: i
+ } = e;
+ i.classList.remove("atk-dropdown-wrap"), null == (t = i
+ .querySelector(".atk-arrow-down-icon")) || t
+ .remove(), null == (n = i.querySelector(
+ ".atk-dropdown")) || n.remove()
+ }({
+ $dropdownWrap: t
+ }))
+ }))
+ }, e => {
+ let t = !0;
+ const n = () => {
+ const n = function() {
+ let e = Number(b("atk_comment"));
+ if (!e) {
+ const t = window.location.hash.match(/#atk-comment-([0-9]+)/);
+ if (!t || !t[1] || Number.isNaN(Number(t[1]))) return null;
+ e = Number(t[1])
+ }
+ return e || null
+ }();
+ n && (e.trigger("list-goto", n), t = !0)
+ },
+ i = () => {
+ t = !1, n()
+ };
+ e.on("inited", (() => {
+ window.addEventListener("hashchange", i), e.on("list-loaded", n)
+ })), e.on("destroy", (() => {
+ window.removeEventListener("hashchange", i), e.off("list-loaded", n)
+ }));
+ let s = 0;
+ e.on("list-goto", (n => {
+ if (s === n) return;
+ const i = e.get("list").getCommentNodes().find((e => e.getID() === n));
+ if (!i) return;
+ s = n, i.getParents().forEach((e => {
+ e.getRender().heightLimitRemoveForChildren()
+ }));
+ const r = () => {
+ At(i.getEl(), !1), i.getEl().classList.remove("atk-flash-once"),
+ window.setTimeout((() => {
+ i.getEl().classList.add("atk-flash-once")
+ }), 150)
+ };
+ t ? window.setTimeout((() => r()), 350) : r()
+ }))
+ }, e => {
+ e.on("list-loaded", (t => {
+ const n = e.get("list"),
+ i = t.length <= 0;
+ let s = n.getCommentsWrapEl().querySelector(".atk-list-no-comment");
+ i ? s || (s = y(''), s
+ .innerHTML = at(n.ctx.conf.noComment || n.ctx.$t("noComment")),
+ n.getCommentsWrapEl().appendChild(s)) : null == s || s.remove()
+ }))
+ }, e => {
+ e.on("conf-loaded", (() => {
+ const t = e.get("list").$el.querySelector(".atk-copyright");
+ t && (t.innerHTML =
+ `Powered By
Artalk `
+ )
+ }))
+ }, e => {
+ let t = null;
+ e.on("inited", (() => {
+ t = window.setInterval((() => {
+ e.get("list").$el.querySelectorAll(
+ "[data-atk-comment-date]").forEach((t => {
+ const n = t.getAttribute(
+ "data-atk-comment-date");
+ t.innerText = C(new Date(Number(n)), e
+ .$t)
+ }))
+ }), 3e4)
+ })), e.on("destroy", (() => {
+ t && window.clearInterval(t)
+ }))
+ }, e => {
+ e.on("list-fetch", (() => {
+ Pt(e.get("list").$el, null)
+ })), e.on("list-error", (t => {
+ _n({
+ $err: e.get("list").$el,
+ errMsg: t.msg,
+ errData: t.data,
+ retryFn: () => e.fetch({
+ offset: 0
+ })
+ })
+ }))
+ }, e => {
+ const t = document;
+ let n = null;
+ const i = () => {
+ null == n || n.disconnect(), n = null
+ };
+ e.on("list-loaded", (() => {
+ i();
+ const s = e.get("list").getCommentsWrapEl().querySelector(
+ ".atk-comment-wrap:nth-last-child(3)");
+ s && ("IntersectionObserver" in window ? (s => {
+ n = new IntersectionObserver((([t]) => {
+ t.isIntersecting && (i(), e.trigger(
+ "list-reach-bottom"))
+ }), {
+ root: t
+ }), n.observe(s)
+ })(s) : console.warn("IntersectionObserver api not supported"))
+ })), e.on("destroy", (() => {
+ i()
+ }))
+ }, e => {
+ const t = () => {
+ const t = e.get("list"),
+ n = e.conf.scrollRelativeTo && e.conf.scrollRelativeTo();
+ (n || window).scroll({
+ top: w(t.$el, n).top,
+ left: 0
+ })
+ };
+ e.on("inited", (() => {
+ e.on("list-goto-first", t)
+ })), e.on("destroy", (() => {
+ e.off("list-goto-first", t)
+ }))
+ }], e => {
+ e.on("conf-loaded", (() => {
+ zn({
+ getApi: () => e.getApi(),
+ pageKey: e.conf.pageKey,
+ countEl: e.conf.countEl,
+ pvEl: e.conf.pvEl,
+ pvAdd: !0
+ })
+ }))
+ }, e => {
+ e.on("conf-loaded", (() => {
+ const t = e.get("list");
+ e.conf.apiVersion && e.conf.versionCheck && !jn && function(e, t, n) {
+ const i = function(e, t) {
+ const n = e.split("."),
+ i = t.split(".");
+ for (let s = 0; s < 3; s++) {
+ const e = Number(n[s]),
+ t = Number(i[s]);
+ if (e > t) return 1;
+ if (t > e) return -1;
+ if (!Number.isNaN(e) && Number.isNaN(t)) return 1;
+ if (Number.isNaN(e) && !Number.isNaN(t)) return -1
+ }
+ return 0
+ }(t, n);
+ if (0 === i) return;
+ const s = y(
+ `
${D("updateMsg",{name:D(i<0?"frontend":"backend")})}${D("currentVersion")}: ${D("frontend")} ${t} / ${D("backend")} ${n}
`
+ ),
+ r = y(`
${D("ignore")} `);
+ r.onclick = () => {
+ Pt(e.$el.parentElement, null), jn = !0, e.ctx.fetch({
+ offset: 0
+ })
+ }, s.append(r), Pt(e.$el.parentElement, s,
+ '
Artalk Warn ')
+ }(t, Fn, e.conf.apiVersion)
+ }))
+ }, e => {
+ let t;
+ const n = n => {
+ const i = [e.$root, e.get("layerManager").getEl()];
+ Nn || (Nn = window.matchMedia("(prefers-color-scheme: dark)")), "auto" === n ? (t ||
+ (t = e => Hn(i, e.matches), Nn.addEventListener("change", t)), Hn(i, Nn
+ .matches)) : (t && (Nn.removeEventListener("change", t), t = void 0),
+ Hn(i, n))
+ };
+ e.on("inited", (() => n(e.conf.darkMode))), e.on("conf-loaded", (e => n(e.darkMode))), e.on(
+ "dark-mode-changed", (e => n(e))), e.on("destroy", (() => {
+ t && (null == Nn || Nn.removeEventListener("change", t)), t = void 0
+ }))
+ }]];
+ class Vn {
+ constructor(e) {
+ g(this, "ctx"), g(this, "plugins", [...Qn]);
+ const t = xt(e, !0);
+ this.ctx = new St(t), Object.entries(Tn).forEach((([e, t]) => {
+ const n = t(this.ctx);
+ n && this.ctx.inject(e, n)
+ })), this.plugins.forEach((e => {
+ "function" == typeof e && e(this.ctx)
+ })), this.ctx.trigger("inited")
+ }
+ getConf() {
+ return this.ctx.getConf()
+ }
+ getEl() {
+ return this.ctx.$root
+ }
+ update(e) {
+ return this.ctx.updateConf(e), this
+ }
+ reload() {
+ this.ctx.reload()
+ }
+ destroy() {
+ this.ctx.trigger("destroy"), this.ctx.$root.remove()
+ }
+ on(e, t) {
+ this.ctx.on(e, t)
+ }
+ off(e, t) {
+ this.ctx.off(e, t)
+ }
+ trigger(e, t) {
+ this.ctx.trigger(e, t)
+ }
+ setDarkMode(e) {
+ this.ctx.setDarkMode(e)
+ }
+ static init(e) {
+ return new Vn(e)
+ }
+ static use(e) {
+ Qn.includes(e) || Qn.push(e)
+ }
+ static loadCountWidget(e) {
+ const t = xt(e, !0);
+ zn({
+ getApi: () => new W(Ct(t)),
+ pageKey: t.pageKey,
+ countEl: t.countEl,
+ pvEl: t.pvEl,
+ pvAdd: !1
+ })
+ }
+ get $root() {
+ return this.ctx.$root
+ }
+ get conf() {
+ return this.ctx.getConf()
+ }
+ }
+ const Gn = Vn.init,
+ Kn = Vn.use,
+ Zn = Vn.loadCountWidget;
+ e.default = Vn, e.init = Gn, e.loadCountWidget = Zn, e.use = Kn, Object.defineProperties(e, {
+ __esModule: {
+ value: !0
+ },
+ [Symbol.toStringTag]: {
+ value: "Module"
+ }
+ })
+}));
//# sourceMappingURL=Artalk.js.map
\ No newline at end of file
diff --git a/templates/assets/zhheo/custom.css b/templates/assets/zhheo/custom.css
index 06b3b62..a9da2d9 100644
--- a/templates/assets/zhheo/custom.css
+++ b/templates/assets/zhheo/custom.css
@@ -279,10 +279,37 @@ i.haofont.hao-icon-arrow-right.banner-righticon{
--hao-gl-size: 16px !important;
}
#aside-content .card-announcement .item-headline i{
- color: red;
+ color: palevioletred;
+ margin-left: -6px;
}
/* 小板报 */
+#aside-content .card-ad .item-headline i{
+ color: orangered;
+ margin-left: -6px;
+}
+
+#aside-content .card-power .item-headline i{
+ color: mediumpurple;
+ margin-right: 5px;
+}
+
+#aside-content .card-categories .item-headline i{
+ color: burlywood;
+ margin-right: 2px;
+}
+
+#aside-content .card-toc .item-headline i{
+ color: green;
+}
+
+#aside-content .card-comment .item-headline i{
+ color: rosybrown;
+}
+
+#aside-content .card-article .item-headline i{
+ color: cornflowerblue;
+}
/* Steam卡片 */
#aside-content .item-headline-steam {
diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css
index e583f72..9835ab1 100644
--- a/templates/assets/zhheo/zhheoblog.css
+++ b/templates/assets/zhheo/zhheoblog.css
@@ -2064,7 +2064,7 @@ blockquote footer cite::before {
#aside-content .card-archives ul.card-archive-list,
#aside-content .card-categories ul.card-category-list {
- margin: 0px;
+ margin: 8px 0 0 0;
padding: 0px;
list-style: none;
}
@@ -7438,7 +7438,7 @@ span.fund_name {
}
#aside-content .card-widget.card-power .power-charge {
- margin-left: auto;
+ margin-left: 4.8rem;
color: var(--heo-secondtext);
font-size: 14px;
line-height: 1
@@ -7491,7 +7491,7 @@ a#power-star {
flex-wrap: nowrap;
justify-content: flex-start;
position: relative;
- margin: 12px 0;
+ margin: 12px 10px;
background: var(--heo-secondbg);
transition: .3s ease-out
}
@@ -11557,15 +11557,15 @@ blockquote p {
#article-container .headerlink {
float: right;
- opacity: 0.08;
+ opacity: 0.5;
border-bottom-style: none;
border-bottom: none;
position: relative;
padding: 0px;
border: none;
border-radius: 8px !important;
- line-height: 1;
- font-size: 1rem;
+ /* line-height: 1; */
+ /* font-size: 1rem; */
}
#article-container .headerlink:hover {
@@ -18930,4 +18930,10 @@ body[data-type=neodb] .type-button-group button {
.ad-img {
margin: 12px 0 0 0;
border-radius: 8px;
+}
+
+.ad-img:hover {
+ -webkit-backface-visibility: hidden;
+ -webkit-transform-style: preserve-3d;
+ transform: scale(1.05)
}
\ No newline at end of file
diff --git a/templates/modules/widgets/aside/adbox.html b/templates/modules/widgets/aside/adbox.html
index ecc1b5b..449a18f 100644
--- a/templates/modules/widgets/aside/adbox.html
+++ b/templates/modules/widgets/aside/adbox.html
@@ -16,8 +16,8 @@
-