"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,15794,21374,25432,34271,49897,57490,63154,99127],{8454:(B,T,o)=>{var R,I;R=[o(24962),o(96352),o(52473),o(17459),o(34342),o(49897),o(40027),o(29930),o(91749),o(30076)],I=function(b,k,D,A,C,x,E,c,u,U){const M={};let r=!1;M.init=function(i){r=!1,y(),m(i),b.addShareHandlers(ajaxify.data.titleRaw),C.addVoteHandler(),M.updatePostCount(ajaxify.data.postcount)};function y(){document.querySelector('[component="topic"]')&&$('[component="topic"]').on("show.bs.dropdown",'[component="post/tools"]',function(){const a=$(this),s=a.find(".dropdown-menu"),{top:t}=this.getBoundingClientRect();if(a.toggleClass("dropup",t>window.innerHeight/2),s.attr("data-loaded"))return;s.html(U.generatePlaceholderWave([3,5,9,7,10,"divider",10]));const n=a.parents("[data-pid]"),e=n.attr("data-pid"),h=parseInt(n.attr("data-index"),10);socket.emit("posts.loadPostTools",{pid:e},async(v,f)=>{if(v)return c.error(v);f.posts.display_move_tools=f.posts.display_move_tools&&h!==0;const S=await app.parseAndTranslate("partials/topic/post-menu-list",f),P=o(57576);s.attr("data-loaded","true").html(S),new P("[data-clipboard-text]"),u.fire("action:post.tools.load",{element:s})})})}M.toggle=function(i,a){const s=D.get("post","pid",i);s.find('[component="post/quote"], [component="post/bookmark"], [component="post/reply"], [component="post/flag"], [component="user/chat"]').toggleClass("hidden",a),s.find('[component="post/delete"]').toggleClass("hidden",a).parent().attr("hidden",a?"":null),s.find('[component="post/restore"]').toggleClass("hidden",!a).parent().attr("hidden",a?null:""),s.find('[component="post/purge"]').toggleClass("hidden",!a).parent().attr("hidden",a?null:""),M.removeMenu(s)},M.removeMenu=function(i){i.find('[component="post/tools"] .dropdown-menu').removeAttr("data-loaded").html("")},M.updatePostCount=function(i){D.get("topic/post-count").attr("title",i).html(U.humanReadableNumber(i)),k.setCount(i)};function m(i){const a=D.get("topic");G(),a.on("click",'[component="post/quote"]',function(){g($(this),i)}),a.on("click",'[component="post/reply"]',function(){d($(this),i)}),$(".topic").on("click",'[component="topic/reply"]',function(t){t.preventDefault(),d($(this),i)}),$(".topic").on("click",'[component="topic/reply-as-topic"]',function(){A.translate(`[[topic:link-back, ${ajaxify.data.titleRaw}, ${config.relative_path}/topic/${ajaxify.data.slug}]]`,function(t){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:t})})}),a.on("click",'[component="post/bookmark"]',function(){return l($(this),p($(this),"data-pid"))}),a.on("click",'[component="post/upvote"]',function(){return C.toggleVote($(this),".upvoted",1)}),a.on("click",'[component="post/downvote"]',function(){return C.toggleVote($(this),".downvoted",-1)}),a.on("click",'[component="post/vote-count"]',function(){C.showVotes(p($(this),"data-pid"))}),a.on("click",'[component="post/announce-count"]',function(){C.showAnnouncers(p($(this),"data-pid"))}),a.on("click",'[component="post/flag"]',function(){const t=p($(this),"data-pid");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.showFlagModal({type:"post",id:t})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/already-flagged"]',function(){const t=$(this).data("flag-id");o.e(6574).then(function(){var n=[o(6574)];(function(e){E.confirm("[[flags:modal-confirm-rescind]]",function(h){h&&e.rescind(t)})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/flagUser"]',function(){const t=p($(this),"data-uid");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.showFlagModal({type:"user",id:t})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/flagResolve"]',function(){const t=$(this).attr("data-flagId");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.resolve(t)}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/edit"]',function(){const t=$(this),n=parseInt(p(t,"data-timestamp"),10),e=parseInt(ajaxify.data.postEditDuration,10);s(e,n,"post-edit-duration-expired")&&u.fire("action:composer.post.edit",{pid:p(t,"data-pid")})}),config.enablePostHistory&&ajaxify.data.privileges["posts:history"]&&a.on("click",'[component="post/view-history"], [component="post/edit-indicator"]',function(){const t=$(this);o.e(92747).then(function(){var n=[o(92747)];(function(e){e.open(p(t,"data-pid"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/delete"]',function(){const t=$(this),n=parseInt(p(t,"data-timestamp"),10),e=parseInt(ajaxify.data.postDeleteDuration,10);s(e,n,"post-delete-duration-expired")&&N($(this))});function s(t,n,e){if(!ajaxify.data.privileges.isAdminOrMod&&t&&Date.now()-n>t*1e3){const h=Math.floor(t/86400),v=Math.floor(t%86400/3600),f=Math.floor(t%86400%3600/60),S=t%86400%3600%60;let P="[[error:"+e+", "+t+"]]";return h?v?P="[[error:"+e+"-days-hours, "+h+", "+v+"]]":P="[[error:"+e+"-days, "+h+"]]":v?f?P="[[error:"+e+"-hours-minutes, "+v+", "+f+"]]":P="[[error:"+e+"-hours, "+v+"]]":f&&(S?P="[[error:"+e+"-minutes-seconds, "+f+", "+S+"]]":P="[[error:"+e+"-minutes, "+f+"]]"),c.error(P),!1}return!0}a.on("click",'[component="post/restore"]',function(){N($(this))}),a.on("click",'[component="post/purge"]',function(){K($(this))}),a.on("click",'[component="post/move"]',function(){const t=$(this);o.e(90677).then(function(){var n=[o(90677)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/change-owner"]',function(){const t=$(this);Promise.all([o.e(20056),o.e(17205)]).then(function(){var n=[o(17205)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/manage-editors"]',function(){const t=$(this);Promise.all([o.e(20056),o.e(24459)]).then(function(){var n=[o(24459)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/ban-ip"]',function(){const t=$(this).attr("data-ip");socket.emit("blacklist.addRule",t,function(n){if(n)return c.error(n);c.success("[[admin/manage/blacklist:ban-ip]]")})}),a.on("click",'[component="post/chat"]',function(){V($(this))})}async function d(i,a){const s=await w();Y(async function(){let t=await W(i);(p(i,"data-uid")==="0"||!p(i,"data-userslug"))&&(t="");const n=i.is('[component="post/reply"]')?p(i,"data-pid"):null,e=!n||!s.pid||n===s.pid;s.text&&e?(t=t||s.username,u.fire("action:composer.addQuote",{tid:a,pid:n,title:ajaxify.data.titleRaw,username:t,body:s.text,selectedPid:s.pid})):u.fire("action:composer.post.new",{tid:a,pid:n,title:ajaxify.data.titleRaw,body:t?t+" ":$('[component="topic/quickreply/text"]').val()||""})})}async function g(i,a){const s=await w();Y(async function(){const t=await W(i),n=p(i,"data-pid");function e(v){u.fire("action:composer.addQuote",{tid:a,pid:n,username:t,title:ajaxify.data.titleRaw,text:v})}if(s.text&&n&&n===s.pid)return e(s.text);const{content:h}=await x.get(`/posts/${encodeURIComponent(n)}/raw`);e(h)})}async function w(){let i="",a,s="";const t=window.getSelection?window.getSelection():document.selection.createRange(),n=$('[component="post"] [component="post/content"]');let e;return n.each(function(h,v){t&&t.containsNode&&v&&t.containsNode(v,!0)&&(e=v)}),e&&t&&(i=t.toString(),a=$(e).parents('[component="post"]').attr("data-pid"),s=await W($(e))),{text:i,pid:a,username:s}}function l(i,a){const s=i.attr("data-bookmarked")==="false"?"put":"del";return x[s](`/posts/${encodeURIComponent(a)}/bookmark`,void 0,function(t){if(t)return c.error(t);const n=s==="put"?"bookmark":"unbookmark";u.fire(`action:post.${n}`,{pid:a})}),!1}function p(i,a){return i.parents("[data-pid]").attr(a)}function W(i){return new Promise(a=>{let s="";if(i.attr("component")==="topic/reply"){a(s);return}const t=i.parents("[data-pid]");if(t.length){Promise.all([o.e(53050),o.e(26174)]).then(function(){var n=[o(13230)];(function(e){s=e(t.attr("data-username"),!0),s||(t.attr("data-uid")!=="0"?s="[[global:former-user]]":s="[[global:guest]]"),s&&s!=="[[global:former-user]]"&&s!=="[[global:guest]]"&&(s="@"+s),a(s)}).apply(null,n)}).catch(o.oe);return}a(s)})}function N(i){const a=p(i,"data-pid"),t=D.get("post","pid",a).hasClass("deleted")?"restore":"delete";Q(t,a)}function K(i){Q("purge",p(i,"data-pid"))}async function Q(i,a){({action:i}=await u.fire(`static:post.${i}`,{action:i,pid:a})),i&&E.confirm("[[topic:post-"+i+"-confirm]]",function(s){if(!s)return;const t=i==="purge"?"":"/state";x[i==="restore"?"put":"del"](`/posts/${encodeURIComponent(a)}${t}`).catch(c.error)})}function V(i){const a=i.parents("[data-pid]");return o.e(92619).then(function(){var s=[o(92619)];(function(t){t.newChat(a.attr("data-uid"))}).apply(null,s)}).catch(o.oe),i.parents(".btn-group").find(".dropdown-toggle").click(),!1}function Y(i){if(!parseInt(ajaxify.data.topicStaleDays,10))return i();const s=Math.min(Date.now()-1e3*60*60*24*ajaxify.data.topicStaleDays,864e13);if(r||ajaxify.data.lastposttime>=s)return i();E.dialog({title:"[[topic:stale.title]]",message:"[[topic:stale.warning]]",buttons:{reply:{label:"[[topic:stale.reply-anyway]]",className:"btn-link",callback:function(){r=!0,i()}},create:{label:"[[topic:stale.create]]",className:"btn-primary",callback:function(){A.translate(`[[topic:link-back, ${ajaxify.data.title}, ${config.relative_path}/topic/${ajaxify.data.slug}]]`,function(n){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:n,fromStaleTopic:!0})})}}}}).modal()}const F=utils.debounce(J,250);function G(){ajaxify.data.privileges["topics:reply"]&&(u.onPage("action:posts.loaded",z),$(document).off("selectionchange"),$(document).on("selectionchange",function(){window.getSelection().toString()===""&&$('[component="selection/tooltip"]').addClass("hidden")}),$(document).on("selectionchange",F))}function J(){window.getSelection().toString()===""||z()}async function z(){let i=$('[component="selection/tooltip"]');if(i.addClass("hidden"),i.attr("data-ajaxify")==="1"){i.remove();return}const a=window.getSelection();if(a.focusNode&&a.type==="Range"&&ajaxify.data.template.topic){const s=$(a.focusNode),t=$(a.anchorNode),n=t.parents("[data-pid]").attr("data-pid"),e=s.parents("[data-pid]").attr("data-pid");if(n!==e||!s.parents('[component="post/content"]').length||!t.parents('[component="post/content"]').length)return;const h=s.parents("[data-pid]"),v=a.getRangeAt(0);if(!h.length||v.collapsed)return;const f=v.getClientRects(),S=f[f.length-1];i.length||(i=await app.parseAndTranslate("partials/topic/selection-tooltip",ajaxify.data),$('[component="selection/tooltip"]').remove(),i.addClass("hidden").appendTo("body")),i.off("click").on("click",'[component="selection/tooltip/quote"]',function(){i.addClass("hidden"),g(h.find('[component="post/quote"]'),ajaxify.data.tid)}),i.removeClass("hidden"),$(window).one("action:ajaxify.start",function(){i.attr("data-ajaxify",1).addClass("hidden"),$(document).off("selectionchange",F)});const P=i.outerWidth(!0);i.css({top:S.bottom+$(window).scrollTop(),left:P>S.width?S.left:S.left+S.width-P})}}return M}.apply(T,R),I!==void 0&&(B.exports=I)},24962:(B,T,o)=>{var R,I;R=[o(91749)],I=function(b){const k={},D=window.location.protocol+"//"+window.location.host;k.addShareHandlers=function(x){function E(c,u,U,M){return window.open(c,"_blank","width="+U+",height="+M+",scrollbars=no,status=no"),b.fire("action:share.open",{url:c,urlToPost:u}),!1}$("#content").off("shown.bs.dropdown",".share-dropdown").on("shown.bs.dropdown",".share-dropdown",function(){const c=$(this).find(".post-link");c.val(D+C($(this))),setTimeout(function(){c.putCursorAtEnd().select()},50)}),A(".post-link",function(c){return c.preventDefault(),!1}),A('[component="share/twitter"]',function(){const c=C($(this)),u=`https://twitter.com/intent/tweet?text=${encodeURIComponent(x)}&url=${encodeURIComponent(c)}`;return E(u,c,550,420)}),A('[component="share/facebook"]',function(){const c=C($(this)),u=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(c)}`;return E(u,c,626,436)}),A('[component="share/whatsapp"]',function(){const c=C($(this)),u=encodeURIComponent(x)+" - "+encodeURIComponent(c),U=config.useragent.isMobile?`whatsapp://send?text=${u}`:`https://wa.me/?text=${u}`;return E(U,c,626,436)}),A('[component="share/telegram"]',function(){const c=C($(this)),u=`https://t.me/share/url?text=${encodeURIComponent(x)}&url=${encodeURIComponent(c)}`;return E(u,c,626,436)}),A('[component="share/linkedin"]',function(){const c=C($(this)),u=`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(c)}`;return E(u,c,626,436)}),b.fire("action:share.addHandlers",{openShare:E})};function A(x,E){$("#content").off("click",x).on("click",x,E)}function C(x){const E=parseInt(x.parents("[data-pid]").attr("data-pid"),10),c="/post"+(E?"/"+E:"");return D+config.relative_path+c}return k}.apply(T,R),I!==void 0&&(B.exports=I)},29869:B=>{B.exports=function(T,o,R){o.setGlobal("true",!0),o.setGlobal("false",!1);const I=24*60*60*1e3,b={displayMenuItem:D,buildMetaTag:A,buildLinkTag:C,stringify:x,escape:E,stripTags:c,buildCategoryIcon:u,buildCategoryLabel:U,generateCategoryBackground:M,generateChildrenCategories:r,generateTopicClass:y,membershipBtn:m,spawnPrivilegeStates:d,localeToHTML:g,renderTopicImage:w,renderDigestAvatar:l,userAgentIcons:p,buildAvatar:W,increment:N,generateWroteReplied:K,generateRepliedTo:Q,generateWrote:V,encodeURIComponent:Y,isoTimeToLocaleString:F,shouldHideReplyContainer:G,humanReadableNumber:J,formattedNumber:z,txEscape:i,generatePlaceholderWave:a,register:s,__escape:k};function k(t){return t}function D(t,n){const e=t.navigation[n];return!(!e||e.route.match("/users")&&t.user&&!t.user.privileges["view:users"]||e.route.match("/tags")&&t.user&&!t.user.privileges["view:tags"]||e.route.match("/groups")&&t.user&&!t.user.privileges["view:groups"])}function A(t){const n=t.name?'name="'+t.name+'" ':"",e=t.property?'property="'+t.property+'" ':"",h=t.content?'content="'+t.content.replace(/\n/g," ")+'" ':"";return"
`}function C(t){const n=["link","rel","as","type","href","sizes","title","crossorigin"],[e,h,v,f,S,P,H,L]=n.map(j=>t[j]?`${j}="${t[j]}" `:"");return"
`}function x(t){return JSON.stringify(t).replace(/&/gm,"&").replace(//gm,">").replace(/"/g,""")}function E(t){return T.escapeHTML(t)}function c(t){return T.stripHTMLTags(t)}function u(t,n,e){return t?`${t.icon?``:""}`:""}function U(t,n="a",e=""){if(!t)return"";const h=n==="a"?`href="${R}/category/${t.slug}"`:"";return`<${n} ${h} class="badge px-1 text-truncate text-decoration-none ${e}" style="color: ${t.color};background-color: ${t.bgColor};border-color: ${t.bgColor}!important; max-width: 70vw;">
${t.icon&&t.icon!=="fa-nbb-none"?``:""}
${t.name}
${n}>`}function M(t){if(!t)return"";const n=[];return t.bgColor&&(n.push("background-color: "+t.bgColor),n.push(`border-color: ${t.bgColor}!important`)),t.color&&n.push("color: "+t.color),t.backgroundImage&&(n.push("background-image: url("+t.backgroundImage+")"),t.imageClass&&n.push("background-size: "+t.imageClass)),n.join("; ")+";"}function r(t){let n="";return!t||!t.children||!t.children.length||(t.children.forEach(function(e){if(e&&!e.isSection){const h=e.link?e.link:R+"/category/"+e.slug;n+='