User:Casualdejekyll/convenientDiscussions.js
/*!
* For documentation and feedback, see the script's homepage:
* https://commons.wikimedia.org/wiki/User:Jack_who_built_the_house/Convenient_Discussions
* For license information, see
* https://commons.wikimedia.org/wiki/User:Jack_who_built_the_house/convenientDiscussions.js.LICENSE.js
*/
/*!
"}function g(e,t,n){return n.indexOf(e)===t}function p(e){const t=document.createElement("span");t.style.color=e;return(e=t.style.color).includes("rgba")?e.replace(/\d+(?=\))/,"0"):e.replace("rgb","rgba").replace(")",", 0)")}function b(e,t){if(t&&e.nodeType===Node.TEXT_NODE)return!0;if(e.nodeType!==Node.ELEMENT_NODE)return null;if(r.a.g.POPULAR_INLINE_ELEMENTS.includes(e.tagName))return!0;else if(r.a.g.POPULAR_NOT_INLINE_ELEMENTS.includes(e.tagName))return!1;else if("undefined"!=typeof window){console.warn("Expensive operation: isInline() called for:",e);return window.getComputedStyle(e).display.startsWith("inline")}else return null}function v(e){const t=e[0];if(!t)return"";const n=t.toUpperCase(),i=t.toLowerCase();return(n!==i?"["+n+i+"]":mw.util.escapeRegExp(t))+mw.util.escapeRegExp(e.slice(1)).replace(/[ _]+/g,"[ _]+")}function y(e,t){var n,i;return(t%2==1||(null===(n=r.a.g.PAGE_WHITELIST_REGEXP)||void 0===n?void 0:n.test(e))||!r.a.g.PAGE_WHITELIST_REGEXP&&r.a.config.customTalkNamespaces.includes(t))&&!(null!==(i=r.a.g.PAGE_BLACKLIST_REGEXP)&&void 0!==i&&i.test(e))}function w(e){return e&&(e.includes(`${r.a.s("es-edit")} ${r.a.s("es-reply-genitive")}`)||e.includes(`${r.a.s("es-edit")} ${r.a.s("es-addition-genitive")}`))}function E(e){return e&&r.a.config.undoTexts.some(t=>e.includes(t))}function C(e){return void 0!==e}function T(e,t,n=!1){return n?e.slice(t+1).concat(e.slice(0,t+1)).reverse():e.slice(t).concat(e.slice(0,t))}function x(e){return[].concat(...e)}function k(e,t){if(Array.isArray(e))[e,t]=e;throw"http"===e?new s.a({type:"network"}):new s.a({type:"api",code:"error",apiData:t})}function S(e){return e.replace(/_/g," ")}function O(e){return e.replace(/ /g,"_")}function N(e){return e.replace(/ {2,}/g," ")}function _(e){return e.length?function(e){if(""===r.a.g.PHP_CHAR_TO_UPPER_JSON[e])return e;else return r.a.g.PHP_CHAR_TO_UPPER_JSON[e]||e.toUpperCase()}(e[0])+e.slice(1):""}function A(e){return e.map(e=>r.a.g.contentLanguageMessages[e])}function P(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return null}function I(){return $(":focus:input").length||$(":focus").prop("isContentEditable")}function L(e){if(!e)return null;const t=e.map(e=>e.source||e).join("|");return t?new RegExp(`(${t})`):null}function M(e,t,n,i){return e.replace(t,(e,t,o)=>{if("number"==typeof t){t=null;o=null}return(t||"")+("table"===i?"\x03":"\x01")+n.push(o||e)+(i?"_"+i:"")+("table"===i?"\x04":"\x02")})}function j(e,t,n){const i=n?new RegExp(`(?:\\x01|\\x03)(\\d+)(?:_${n})?(?:\\x02|\\x04)`,"g"):/(?:\x01|\x03)(\d+)(?:_\w+)?(?:\x02|\x04)/g;for(;i.test(e);)e=e.replace(i,(e,n)=>t[n-1]);return e}function D(e=null,t=window.scrollY){if(e&&r.a.g.$toc.length&&r.a.g.$toc.offset().top+r.a.g.$toc.outerHeight()>t)B(e.saveTocHeight);else{l.element=null;l.elementTop=null;l.touchesBottom=!1;l.offsetBottom=document.documentElement.scrollHeight-(t+window.innerHeight);if(l.offsetBottom<100)l.touchesBottom=!0;else if(0!==t&&r.a.g.rootElement.getBoundingClientRect().top<=0){const e=new c.b(r.a.g.rootElement.firstElementChild);for(;;){if(!b(e.currentNode)){const t=e.currentNode.getBoundingClientRect();if(t.bottom>=0&&0!==t.height){l.element=e.currentNode;l.elementTop=t.top;if(e.firstChild())continue;else break}}if(!e.nextSibling())break}}}}function R(e=!1){if(e&&null!==l.offset)F();else if(l.touchesBottom&&0!==window.scrollY){const e=document.documentElement.scrollHeight-window.innerHeight-l.offsetBottom;window.scrollTo(0,e)}else if(l.element){const e=l.element.getBoundingClientRect();if(oe(e))window.scrollTo(0,window.scrollY+e.top-l.elementTop)}}function H(e,t){if(l.element&&e===l.element)l.element=t}function B(e=!0){l.offset=window.scrollY;l.tocHeight=(e||l.tocHeight)&&r.a.g.$toc.length&&!r.a.g.isTocFloating&&0!==window.scrollY&&window.scrollY+window.innerHeight>r.a.g.$toc.offset().top+r.a.g.$toc.outerHeight()?r.a.g.$toc.outerHeight():null}function F(e=!0){if(null!==l.offset){if(l.tocHeight)l.offset+=(r.a.g.$toc.outerHeight()||0)-l.tocHeight;window.scrollTo(0,l.offset);l.offset=null;if(e)l.tocHeight=null}}function U(e){return Y.apply(this,arguments)}function Y(){return(Y=o()((function*(e){const t={};return Promise.race([e,t]).then(e=>e===t?"pending":"resolved",()=>"rejected")}))).apply(this,arguments)}function W(e){if("loading"===mw.loader.getState(e)){const e=d(r.a.sParse("error-needreloadpage"),{callbacks:{"cd-notification-reloadPage":()=>{location.reload()}}}).$wrapper;mw.notify(e,{type:"error"});return!0}return!1}function q(e){if(void 0===e.convenientDiscussionsMarginTop){const t=window.getComputedStyle(e);e.convenientDiscussionsMarginTop=parseFloat(t.marginTop);e.convenientDiscussionsMarginBottom=parseFloat(t.marginBottom);e.convenientDiscussionsMarginLeft=parseFloat(t.marginLeft);e.convenientDiscussionsMarginRight=parseFloat(t.marginRight)}const t=e.getBoundingClientRect(),n=oe(t);return{top:t.top,bottom:t.bottom,left:t.left,right:t.right,width:t.width,height:t.height,outerTop:t.top-(n?e.convenientDiscussionsMarginTop:0),outerBottom:t.bottom+(n?e.convenientDiscussionsMarginBottom:0),outerLeft:t.left-(n?e.convenientDiscussionsMarginLeft:0),outerRight:t.right+(n?e.convenientDiscussionsMarginRight:0)}}function G(e,t,n=!1){const i=e=>null!==e&&"object"==typeof e&&!(e instanceof RegExp||e instanceof Date||"function"==typeof Node&&e instanceof Node||"function"==typeof Worker&&e instanceof Worker),o=e=>e instanceof RegExp||e instanceof Date?e.toString():e;if(!i(e)||!i(t))return o(e)===o(t);const a=Object.keys(e).filter(t=>void 0!==e[t]),s=Object.keys(t).filter(e=>void 0!==t[e]);return(a.length===s.length||n)&&a.every(n=>G(e[n],t[n]))}function z(e){const t=mw.storage.getObject("convenientDiscussions-"+e);if(!1===t)console.error("Storage is unavailable.");return t||{}}function V(e,t){mw.storage.setObject("convenientDiscussions-"+e,t)}function K(e,t){return e.replace(/[\u200e\u200f]/g,t?" ":"")}function X(e,t){ee(e);if(!document.execCommand("insertText",!1,t))e.insertContent(t)}function Z(e,t=[],n=[]){const i=Object.assign({},e);Object.keys(i).forEach(e=>{if(n.includes(e)){delete i[e];return}const o=i[e];if("object"==typeof o&&null!==o&&!(o instanceof RegExp||o instanceof Date))try{if(!G(o,JSON.parse(JSON.stringify(o))))delete i[e]}catch(t){delete i[e]}else if("function"==typeof o)if(t.includes(e))i[e]=o.toString();else delete i[e]});return i}function J(e,t){const n=new RegExp(`[${r.a.g.LETTER_PATTERN}]{2,}`,"g"),i=(e.match(n)||[]).filter(g),o=(t.match(n)||[]).filter(g);if(!i.length||!o.length)return 0;let a=o.length,s=0;i.forEach(e=>{if(o.some(t=>t===e))s++;else a++});return s/a}function Q(e,t,n=[]){return e.keyCode===t&&["ctrl","shift","alt","meta"].every(t=>n.includes(t)===e[t+"Key"])}function ee(e){e.$input.get(0).focus()}function te(e){return $(e[r.a.g.SKIN]||e.default||e.vector)}function ne(e,t){if(void 0!==t&&!e.includes(t))e.push(t)}function ie(e,t){if(void 0!==t&&e.includes(t))e.splice(e.indexOf(t),1)}function oe(...e){return!e.some(e=>0===e.left&&0===e.height)}function ae(e,t){let n={};if(t)n.oldid=mw.config.get("wgRevisionId");const i=decodeURI(r.a.page.getUrl(n));return`${r.a.g.SERVER}${i}#${e}`}function se(e){const t=e.map(e=>e.getGender());let n;if(t.every(e=>"female"===e))n="female";else if(t.every(e=>"female"!==e))n="male";else n="unknown";return n}function re(e,t){let n;for(let i=e;i;i=i.parentNode)if(i.contains(t)){n=i;break}const i=[e];if(!e.contains(t)){const o=new c.b(e);for(;o.currentNode.parentNode!==n;){for(;o.nextSibling();)i.push(o.currentNode);o.parentNode()}o.nextSibling();for(;!o.currentNode.contains(t);){i.push(o.currentNode);o.nextSibling()}for(;o.currentNode!==t;){o.firstChild();for(;!o.currentNode.contains(t);){i.push(o.currentNode);o.nextSibling()}}i.push(t)}return i}function ce(e,t,n={}){const i=mw.notification.notify(e,t);u.push(Object.assign(n,{notification:i}));return i}function le(){return u}function ue(e=!0){u.forEach(t=>{if(!e)t.notification.$notification.hide();t.notification.close()});u=[]}},function(e,t){function n(e,t,n,i,o,a,s){try{var r=e[a](s),c=r.value}catch(e){n(e);return}if(r.done)t(c);else Promise.resolve(c).then(i,o)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise((function(o,a){var s=e.apply(t,i);function r(e){n(s,o,a,r,c,"next",e)}function c(e){n(s,o,a,r,c,"throw",e)}r(void 0)}))}};e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";class CdError extends Error{constructor(e){let t;if(e){var n,i;t=e.type;if(e.code)t+="/"+e.code;if(null!=e&&null!==(n=e.apiData)&&void 0!==n&&null!==(i=n.error)&&void 0!==i&&i.code)t+="/"+e.apiData.error.code}else t="";super(t);this.name="CdError";this.data=e}}t.a=CdError},function(e,t,n){"use strict";n.d(t,"p",(function(){return _}));n.d(t,"g",(function(){return A}));n.d(t,"n",(function(){return I}));n.d(t,"j",(function(){return L}));n.d(t,"o",(function(){return M}));n.d(t,"c",(function(){return j}));n.d(t,"f",(function(){return B}));n.d(t,"q",(function(){return z}));n.d(t,"d",(function(){return V}));n.d(t,"i",(function(){return K}));n.d(t,"h",(function(){return X}));n.d(t,"k",(function(){return J}));n.d(t,"e",(function(){return ee}));n.d(t,"m",(function(){return te}));n.d(t,"l",(function(){return ne}));n.d(t,"s",(function(){return ie}));n.d(t,"b",(function(){return ae}));n.d(t,"a",(function(){return le}));n.d(t,"r",(function(){return de}));var i=n(2),o=n.n(i),a=n(7),s=n(13),r=n(27),c=n(14),l=n(15),u=n(43),d=n.n(u);function h(){return d()('/*! \n * For documentation and feedback, see the script\'s homepage:\n * https://commons.wikimedia.org/wiki/User:Jack_who_built_the_house/Convenient_Discussions\n * For license information, see\n * https://commons.wikimedia.org/wiki/User:Jack_who_built_the_house/convenientDiscussions-worker.js.LICENSE.js\n */\n!function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};e[r].call(n.exports,n,n.exports,i);n.l=!0;return n.exports}i.m=e;i.c=t;i.d=function(e,t,r){if(!i.o(e,t))Object.defineProperty(e,t,{enumerable:!0,get:r})};i.r=function(e){if("undefined"!=typeof Symbol&&Symbol.toStringTag)Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};i.t=function(e,t){if(1&t)e=i(e);if(8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);i.r(r);Object.defineProperty(r,"default",{enumerable:!0,value:e});if(2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r};i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};i.d(t,"a",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p="";i(i.s=30)}([function(e,t,i){"use strict";const r="undefined"==typeof window?self:window;r.convenientDiscussions=r.convenientDiscussions||{};if("object"!=typeof r.convenientDiscussions)r.convenientDiscussions={};t.a=r.convenientDiscussions},function(e,t,i){"use strict";i.d(t,"k",(function(){return n}));i.d(t,"g",(function(){return s}));i.d(t,"a",(function(){return a}));i.d(t,"c",(function(){return o}));i.d(t,"j",(function(){return l}));i.d(t,"i",(function(){return c}));i.d(t,"b",(function(){return u}));i.d(t,"d",(function(){return d}));i.d(t,"f",(function(){return h}));i.d(t,"h",(function(){return f}));i.d(t,"e",(function(){return p}));i(22);i(4);var cd=i(0),r=i(2);function n(e,t,i){return i.indexOf(e)===t}function s(e,t){if(t&&e.nodeType===Node.TEXT_NODE)return!0;if(e.nodeType!==Node.ELEMENT_NODE)return null;if(cd.a.g.POPULAR_INLINE_ELEMENTS.includes(e.tagName))return!0;else if(cd.a.g.POPULAR_NOT_INLINE_ELEMENTS.includes(e.tagName))return!1;else if("undefined"!=typeof window){console.warn("Expensive operation: isInline() called for:",e);return window.getComputedStyle(e).display.startsWith("inline")}else return null}function a(e){return void 0!==e}function o(e){return[].concat(...e)}function l(e){return e.replace(/_/g," ")}function c(e){return e.replace(/ /g,"_")}function u(e){return e.length?function(e){if(""===cd.a.g.PHP_CHAR_TO_UPPER_JSON[e])return e;else return cd.a.g.PHP_CHAR_TO_UPPER_JSON[e]||e.toUpperCase()}(e[0])+e.slice(1):""}function d(e){return e.map(e=>cd.a.g.contentLanguageMessages[e])}function h(e,t,i,r){return e.replace(t,(e,t,n)=>{if("number"==typeof t){t=null;n=null}return(t||"")+("table"===r?"\\x03":"\\x01")+i.push(n||e)+(r?"_"+r:"")+("table"===r?"\\x04":"\\x02")})}function f(e,t){return e.replace(/[\\u200e\\u200f]/g,t?" ":"")}function p(e,t){let i;for(let r=e;r;r=r.parentNode)if(r.contains(t)){i=r;break}const n=[e];if(!e.contains(t)){const s=new r.b(e);for(;s.currentNode.parentNode!==i;){for(;s.nextSibling();)n.push(s.currentNode);s.parentNode()}s.nextSibling();for(;!s.currentNode.contains(t);){n.push(s.currentNode);s.nextSibling()}for(;s.currentNode!==t;){s.firstChild();for(;!s.currentNode.contains(t);){n.push(s.currentNode);s.nextSibling()}}n.push(t)}return n}},function(e,t,i){"use strict";i.d(t,"c",(function(){return TreeWalker}));i.d(t,"b",(function(){return ElementsTreeWalker}));i.d(t,"a",(function(){return ElementsAndTextTreeWalker}));var r=i(0);class TreeWalker{constructor(e,t,i=!1,r=e){this.acceptNode=t;this.root=e;this.currentNode=r;if(i){this.firstChildProp="firstElementChild";this.lastChildProp="lastElementChild";this.previousSiblingProp="previousElementSibling";this.nextSiblingProp="nextElementSibling"}else{this.firstChildProp="firstChild";this.lastChildProp="lastChild";this.previousSiblingProp="previousSibling";this.nextSiblingProp="nextSibling"}}tryMove(e){let t=this.currentNode;if(t===this.root&&!e.includes("Child"))return null;do{t=t[e]}while(t&&this.acceptNode&&!this.acceptNode(t));if(t)this.currentNode=t;return t||null}parentNode(){return this.tryMove("parentNode")}firstChild(){return this.tryMove(this.firstChildProp)}lastChild(){return this.tryMove(this.lastChildProp)}previousSibling(){return this.tryMove(this.previousSiblingProp)}nextSibling(){return this.tryMove(this.nextSiblingProp)}nextNode(){let e=this.currentNode;do{if(e[this.firstChildProp])e=e[this.firstChildProp];else{for(;e&&!e[this.nextSiblingProp]&&e.parentNode!==this.root;)e=e.parentNode;if(e)e=e[this.nextSiblingProp]}}while(e&&this.acceptNode&&!this.acceptNode(e));if(e)this.currentNode=e;return e}previousNode(){let e=this.currentNode;if(e!==this.root){do{if(e[this.previousSiblingProp]){e=e[this.previousSiblingProp];for(;e[this.lastChildProp];)e=e[this.lastChildProp]}else e=e.parentNode}while(e&&this.acceptNode&&!this.acceptNode(e));if(e)this.currentNode=e;return e}}}class ElementsTreeWalker extends TreeWalker{constructor(e,t=r.a.g.rootElement){super(t,null,!0);if(e)this.currentNode=e}}class ElementsAndTextTreeWalker extends TreeWalker{constructor(e,t=r.a.g.rootElement){super(t,e=>e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE);if(e)this.currentNode=e}}},function(e,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){if(void 0===r)r=i;Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,r){if(void 0===r)r=i;e[r]=t[i]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i))r(t,e,i);n(t,e);return t},a=this&&this.__exportStar||function(e,t){for(var i in e)if("default"!==i&&!Object.prototype.hasOwnProperty.call(t,i))r(t,e,i)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});t.RssHandler=t.DefaultHandler=t.DomUtils=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DomHandler=t.Parser=void 0;var l=i(12);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return l.Parser}});var c=i(6);Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return c.DomHandler}});Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return c.DomHandler}});function u(e,t){var i=new c.DomHandler(void 0,t);new l.Parser(i,t).end(e);return i.root}t.parseDocument=u;t.parseDOM=function(e,t){return u(e,t).children};t.createDomStream=function(e,t,i){var r=new c.DomHandler(e,t,i);return new l.Parser(r,t)};var d=i(13);Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return o(d).default}});var h=s(i(8));t.ElementType=h;a(i(17),t);t.DomUtils=s(i(18));var f=i(17);Object.defineProperty(t,"RssHandler",{enumerable:!0,get:function(){return f.FeedHandler}})},function(e,t,i){"use strict";class CdError extends Error{constructor(e){let t;if(e){var i,r;t=e.type;if(e.code)t+="/"+e.code;if(null!=e&&null!==(i=e.apiData)&&void 0!==i&&null!==(r=i.error)&&void 0!==r&&r.code)t+="/"+e.apiData.error.code}else t="";super(t);this.name="CdError";this.data=e}}t.a=CdError},function(e,t,i){"use strict";i.d(t,"b",(function(){return x}));i.d(t,"c",(function(){return N}));i.d(t,"a",(function(){return C}));i.d(t,"d",(function(){return w}));i.d(t,"e",(function(){return O}));i(7),i(25),i(26);var r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function n(e){return function(t){var i=t||{},r=i.width?String(i.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var s={date:n({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:n({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:n({formats:{full:"{{date}} \'at\' {{time}}",long:"{{date}} \'at\' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},a={lastWeek:"\'last\' eeee \'at\' p",yesterday:"\'yesterday at\' p",today:"\'today at\' p",tomorrow:"\'tomorrow at\' p",nextWeek:"eeee \'at\' p",other:"P"};function o(e){return function(t,i){var r,n=i||{};if("formatting"===(n.context?String(n.context):"standalone")&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n.width?String(n.width):s;r=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function l(e){return function(t,i){var r=String(t),n=i||{},s=n.width,a=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],o=r.match(a);if(!o)return null;var l,c=o[0],u=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth];if("[object Array]"===Object.prototype.toString.call(u))l=function(e,t){for(var i=0;i").attr("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewQAAHsEBw2lUUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAK7SURBVGiB3Zq/axRBFMc/60VioQgW1yjEiwa0tdXiCkH9AwLaKCLY+Aek9CxUbGw9/wMbrYQgCIrEpEgUAimNmCAqapWAGL2wFrPr7R374739kZ3ZL7ziuHlv3mdndufN7MJQHaAPbAIDwK/ZBkEufeA4BXQB2LIAKMm2ghzV6lgOFgXsaOEeW5C41PpauE0LkpbahgbMw9y4LY1TjdoFJqSNPcwVcUmetOE+ZeA/wAqwhBnxvPoBvAY+FoghknS+vwNORPymgVWFf2h3gf1BDA+4Buwo/EuH+x3AjGsG+KtI7HlCDvfqhFtK8V9RJHY9IcaZKuCk99xOyn+aDtPiaNVlCJxYqkmn5bGYDk6iq0OfJSR6XxEjDi5qI6WaNOgyMBUJnveB0mN0rbqK7r7NggsBOxq4cAQXgQWK7Ry+Ai+BDzl8JXA+QamWN8G6TAq3oV3EXdLRJsO1pEXoe2C9ykyAi8ChsoNK5vmLsjsd02lMxV/mPecjDOgDZ6tj46kij1BdSVtp0E/AkQrAbipyqAzOB9YYXciL6gZmG2UFnA/8BG4x3Lbk0TS6qbhncKF9Ax4Cl4DDGTAecAozUvMUq27EcGUeM3wHvmBG1g+AJoE2ZiofKKmf8JihC7xKayg+bBGoHZg1cq1C2dU0dg3us6axa3DzmsYuwW0DDyK/J7McXIHbBmYxVVKoGYlj3vWmahtg3g08Iv793BtBDHFnPcmV2iNdQbjguwj2C0HekkX8DkO482VnKtQE5ij/MnBO45hGf1vR1kYTgzUGrhcDBnZ85VAILgkMzKO57oRzw6WBgTnFrTvhXHBZYGAWUxc+6xiBk4CFsv2DnP/WwuxsNXDrwBPMzroNHMSdGtV6zaGYli5KCuisJIBOKwvQeaUBNkJJgI1RHGCjNA7YOEUBG6k5gvKriXoLeP8AAFe0oEsY7eMAAAAASUVORK5CYII=").appendTo(e);$(document.body).append(q)}else q.show()}function V(e=!0){if(e){cd.a.state.isFirstRun=!1;cd.a.state.isPageFirstParsed=!1;cd.a.state.isPageBeingReloaded=!1}if(q&&!G())q.hide()}function K(){return cd.a.state.isFirstRun||cd.a.state.isPageBeingReloaded}function X(){return mw.config.get("wgRevisionId")>=mw.config.get("wgCurRevisionId")}function Z(e){const t=new mw.Uri,n=t.query;if((t.fragment||n.diff||n.oldid)&&!e.isPageReloadedExternally){delete n.title;delete n.curid;let e;if(n.diff||n.oldid){e="pushState";delete n.diff;delete n.oldid;delete n.diffmode;delete n.type;cd.a.g.$content.children(".mw-revslider-container, .ve-init-mw-diffPage-diffMode, .diff, .oo-ui-element-hidden, .diff-hr, .diff-currentversion-title").remove();$(".mw-revision").remove();$("#firstHeading").text(cd.a.page.name);$(window).on("popstate",()=>{if(mw.util.getParamValue("diff")||mw.util.getParamValue("oldid"))location.reload()});cd.a.g.isDiffPage=!1}else e="replaceState";history[e](history.state,"",cd.a.page.getUrl(n))}}function J(){return Q.apply(this,arguments)}function Q(){return(Q=o()((function*(e={}){var t;if(!cd.a.state.isPageBeingReloaded){cd.a.comments.forEach(e=>{var t;null===(t=e.$animatedBackground)||void 0===t||t.add(e.$marker).stop(!0,!0)});if(e.isPageReloadedExternally)a.a.resetLayers();if(X())te();if(!e.commentAnchor&&!e.sectionAnchor)Object(y.Q)();Object(y.f)(null!==(t=e.closeNotificationsSmoothly)&&void 0!==t?t:!0);cd.a.debug.init();cd.a.debug.startTimer("total time");cd.a.debug.startTimer("getting HTML");z(!0);Object(x.h)().catch(e=>{console.warn(e)});if(!e.isPageReloadedExternally){let t;try{t=yield cd.a.page.parse(null,!1,!0)}catch(t){V();if(e.wasCommentFormSubmitted)throw t;else{mw.notify(cd.a.s("error-reloadpage"),{type:"error"});console.warn(t);return}}e.html=t.text;mw.config.set({wgRevisionId:t.revid,wgCurRevisionId:t.revid});mw.loader.load(t.modules);mw.loader.load(t.modulestyles);mw.config.set(t.jsconfigvars)}r.a.reset();cd.a.commentForms.forEach(e=>{e.$outermostElement.detach()});e.unseenCommentAnchors=U();Z(e);cd.a.state.hasPageBeenReloaded=!0;b.a.updatePageTitle(0,!1);yield Y(e);p.a.possiblyHide();if(!e.commentAnchor&&!e.sectionAnchor)Object(y.O)(!1)}}))).apply(this,arguments)}function ee(e){if(e.is("#mw-content-text")){const t=e.children(".mw-parser-output");if(t.length&&!t.data("cd-parsed"))J({isPageReloadedExternally:!0})}}function te(e){const t=()=>{const e=cd.a.commentForms.filter(e=>e.isAltered()).map(e=>{var t,n,i,o,s,r;let c;const u=e.target;if(e.target instanceof a.a)c={anchor:u.anchor};else if(u instanceof l.a){var d;c={headline:u.headline,oldestCommentAnchor:null===(d=u.oldestComment)||void 0===d?void 0:d.anchor,id:u.id,anchor:u.anchor,ancestors:u.getAncestors().map(e=>e.headline)}}return{mode:e.mode,targetData:c,preloadConfig:e.preloadConfig,isNewTopicOnTop:e.isNewTopicOnTop,headline:null===(t=e.headlineInput)||void 0===t?void 0:t.getValue(),comment:e.commentInput.getValue(),summary:e.summaryInput.getValue(),minor:null===(n=e.minorCheckbox)||void 0===n?void 0:n.isSelected(),watch:null===(i=e.watchCheckbox)||void 0===i?void 0:i.isSelected(),watchSection:null===(o=e.watchSectionCheckbox)||void 0===o?void 0:o.isSelected(),omitSignature:null===(s=e.omitSignatureCheckbox)||void 0===s?void 0:s.isSelected(),delete:null===(r=e.deleteCheckbox)||void 0===r?void 0:r.isSelected(),originalHeadline:e.originalHeadline,originalComment:e.originalComment,isSummaryAltered:e.isSummaryAltered,lastFocused:e.lastFocused}}),t=Date.now(),n=e.length?{commentForms:e,saveUnixTime:t}:{},i=Object(y.r)("commentForms");i[mw.config.get("wgPageName")]=n;Object(y.R)("commentForms",i);N=Date.now()},n=Date.now()-(N||0);clearTimeout(O);if(e)t();else O=setTimeout(t,Math.max(0,5e3-n))}function ne(e){if(cd.a.state.isFirstRun||e){cd.a.commentForms=[];const e=function(e){const t=Object.assign({},e),n=60*cd.a.g.SECONDS_IN_DAY*1e3;Object.keys(t).forEach(e=>{var i;if(null===(i=t[e].commentForms)||void 0===i||!i.length||t[e].saveUnixTime
").attr("width",626).attr("height",67).attr("src","//upload.wikimedia.org/wikipedia/commons/0/08/Convenient_Discussions_comment_-_old_format.png").addClass("cd-rc-img"),o=$("
").attr("width",30).attr("height",30).attr("src","data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.58 8.59L11 14.17L11 2L9 2L9 14.17L3.41 8.59L2 10L10 18L18 10L16.58 8.59Z' fill='black'/%3E%3C/svg%3E").addClass("cd-rc-img cd-rc-arrow"),a=$("
").attr("width",626).attr("height",118).attr("src","//upload.wikimedia.org/wikipedia/commons/d/da/Convenient_Discussions_comment_-_new_format.png").addClass("cd-rc-img"),s=$("
").append(e)}i.addClass("cd-section-button-container cd-thread-newCommentsNote").insertAfter(e)}}var v={underlays:[],layersContainers:[],configureAndAddLayers(e){let t;if(e.length)t=cd.a.g.floatingElements.map(u.q);e.forEach(e=>{e.configureLayers({add:!1,update:!1,floatingRects:t})});e.forEach(e=>{e.addLayers()})},redrawLayersIfNecessary(e=!1,t=!1,n){if(Object(g.i)()||document.hidden&&!t)return;this.layersContainers.forEach(e=>{e.cdCouldHaveMoved=!0});const i=[],o=cd.a.g.$root.get(0).getBoundingClientRect().bottom+window.scrollY;let a=0;cd.a.comments.slice().reverse().some(s=>{const r=!s.isCollapsed&&(s.isNew||s.isOwn||s.isTarget||s.isHovered||s.isDeleted||s.isLineGapped),c=s.offset&&s.offset.bottom>o;if(s.underlay&&!r&&(e||c))s.removeLayers();else if(r&&!s.editForm){n=n||cd.a.g.floatingElements.map(u.q);const e=s.configureLayers({add:!0,update:!1,floatingRects:n});if(e||t){a=0;i.push(s)}else if(null===e)s.removeLayers();else if(!s.getLayersContainer().parentNode.parentNode.closest(".cd-commentLayersContainer-parent")){a++;if(3===a)return!0}}return!1});i.forEach(e=>{e.updateLayersOffset()})},resetLayers(){this.underlays=[];this.layersContainers.forEach(e=>{e.innerHTML=""})},registerSeen(){if(document.hidden)return;const e=O.findInViewport();if(!e)return;const t=e=>{const t=e.isInViewport();if(t){e.registerSeen();return!1}else if(!1===t)return!0};cd.a.comments.slice(0,e.id).reverse().some(t);cd.a.comments.slice(e.id).some(t);h.a.updateFirstUnseenButton()},groupBySection(e){const t=new Map;e.forEach(e=>{let n;if(e instanceof O)n=e.section;else if(e.section)n=e.section.match||e.section.anchor;else n=null;if(!t.get(n))t.set(n,[]);t.get(n).push(e)});return t},findInViewport(e){cd.a.comments.forEach(e=>{delete e.roughOffset});const t=window.scrollY+cd.a.g.BODY_SCROLL_PADDING_TOP,n=t+window.innerHeight,i=e=>{e.getOffset({set:!0});return Boolean(e.roughOffset)},o=(e,t=0)=>Object(u.L)(cd.a.comments,t,"backward"===e).find(i)||null,a=o("forward"),s=o("backward",cd.a.comments.length-1);if(!a)return null;let r,c={top:a,bottom:s},l=c.top;const d=(e,t,n=!1)=>{if(e){const i="forward"===e&&n||"backward"===e&&!n?t.top.id:t.bottom.id;return o(e,i)}return null};for(let i=0;i
]*class="[^"]*\bdiff-empty\b[^"]*"[^>]*>\s*<\/td>\s* ]*class="[^"]*\bdiff-marker\b[^"]*"[^>]*>\s*<\/td>\s* ]*class="[^"]*\bdiff-addedline\b[^"]*"[^>]*>\s*
.*$/gim,e=>e.replace(/
(?![:*#;])\n? */gi,()=>"\n")).replace(/\n([:*#]*[:*])([ \t]*)/g,(e,t,i)=>{let o;if(t.length>=n.length){o=t.slice(n.length);if(t.length>n.length)o+=i}else o=t+i;return"\n"+o});i=Object(u.W)(i,e);if(cd.a.config.paragraphTemplates.length){const e=`\\{\\{(?:${cd.a.config.paragraphTemplates.map(u.m).join("|")})\\}\\}`,t=new RegExp(e,"g"),n=new RegExp("^(?![:*#]).*"+e,"gm");i=i.replace(n,e=>e.replace(t,"\n\n"))}if(0!==this.level)i=i.replace(/\n\n+/g,"\n\n");return i.trim()}adjustCommentBeginning({code:e,startIndex:t}){let n="",i="",o=t;const a=e.match(/(^[^]*(?:^|\n))((=+)(.*?)\3[ \t\x01\x02]*\n)/);let s,r,c,l;if(a){s=a[2];r=t+a[1].length;c=a[3].length;l=a[4].trim();t+=a[0].length;e=e.slice(a[0].length);o=this.isOpeningSection?r:t}else{[cd.a.config.signatureEndingRegexp,cd.a.g.TIMEZONE_REGEXP].filter(e=>null!==e).forEach(n=>{const i=new RegExp(n.source+"$","m"),a=/^(.+)\n/gm;let s,r;for(;s=a.exec(e);){const t=s[1].replace(/\[\[:?(?:[^|[\]<>\n]+\|)?(.+?)\]\]/g,"$1");if(i.test(t)){const t=s.index+s[0].length;if(t===e.length)break;else r=t}}if(r){e=e.slice(r);t+=r;o+=r}});cd.a.g.BAD_COMMENT_BEGINNINGS.forEach(n=>{if("^"!==n.source[0])console.debug('Regexps in cd.config.customBadCommentBeginnings should have "^" as the first character.');const i=e.match(n);if(i){e=e.slice(i[0].length);o=t+i[0].lastIndexOf("\n")+1;t+=i[0].length}})}if(this.level>0){const a=(a,s,r,c="")=>{if("number"==typeof c)c="";let l="",u=r,d=a.length;if(!s&&e.includes("\n")&&u.endsWith("#")){u=u.slice(0,-1);n=u;if(u.length
/g," ").replace(/<\w+(?: [\w ]+(?:=[^<>]+?)?| *\/?)>/g,"").replace(/<\/\w+(?: [\w ]+)? *>/g,"").replace(/ {2,}/g," ").trim()}function m(e){return p(e).replace(/\s+/g," ").trim()}function f(e){return e.replace(/<(\w+(?: [\w ]+(?:=[^<>]+?)?| *\/?)|\/\w+(?: [\w ]+)? *)>/g,"%3C$1%3E").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/\{/g,"%7B").replace(/\|/g,"%7C").replace(/\}/g,"%7D").replace(/\s+/g," ")}function g(e){const t=u(e).replace(a.a.g.QUOTE_REGEXP,(e,t,n,i)=>t+" ".repeat(n.length)+i).replace(a.a.g.COMMENT_ANTIPATTERNS_REGEXP,e=>" ".repeat(e.length));let n=function(e,t){const n=new RegExp(`^((.*)(${a.a.g.CONTENT_TIMESTAMP_REGEXP.source})(?!["\xbb])(?:\\}\\}|)?).*(?:\n*|$)`,"igm"),i=new RegExp(`^(((.*)${a.a.g.CAPTURE_USER_NAME_PATTERN}.{1,251})(${a.a.g.CONTENT_TIMESTAMP_REGEXP.source})(?:\\}\\}|)?.*)(?:\n*|$)`,"igm"),o=new RegExp(a.a.g.CAPTURE_USER_NAME_PATTERN,"ig");let r,c=[];for(;r=n.exec(e);){const e=r[0];i.lastIndex=0;const n=i.exec(e);let a,l,u,d,h,m;if(n){a=s.a.getUser(p(n[4]));const e=r.index+n[2].length,i=e+n[6].length;l=t.slice(e,i);u=r.index+n[3].length;d=r.index+n[1].length;m=t.slice(u,d);h=r.index+n[0].length;let c;o.lastIndex=0;let f=e-r.index-251;f=Math.max(0,f);const g=n[0].slice(f);for(;c=o.exec(g);){if(c[2])continue;if(s.a.getUser(p(c[1]))===a){u=r.index+f+c.index;m=t.slice(u,d);break}}}else{u=r.index+r[2].length;d=r.index+r[1].length;m=t.slice(u,d);const e=u+r[3].length;l=t.slice(u,e);h=r.index+r[0].length}c.push({author:a,timestamp:l,startIndex:u,endIndex:d,dirtyCode:m,nextCommentStartIndex:h})}return c}(t,e);const i=function(e,t,n){const i=[];if(a.a.g.UNSIGNED_TEMPLATES_REGEXP){let o;for(;o=a.a.g.UNSIGNED_TEMPLATES_REGEXP.exec(e);){let e,r;if(a.a.g.CONTENT_TIMESTAMP_NO_TZ_REGEXP.test(o[2])){r=o[2];e=o[3]}else if(a.a.g.CONTENT_TIMESTAMP_NO_TZ_REGEXP.test(o[3])){r=o[3];e=o[2]}else e=o[2];e=e&&s.a.getUser(p(e));if(r&&!a.a.g.CONTENT_TIMESTAMP_REGEXP.test(r)){r+=" (UTC)";if(!e)e="{e=Object(r.x)(e,n,t,i)},i=(e,t)=>{e.forEach(e=>{n(new RegExp(`<${e}(?: [^>]+)?>[\\s\\S]+?<\\/${e}>`,"gi"),t)})};i(["pre","source","syntaxhighlight"],"block");i(["gallery"],"table");i(["nowiki"],"inline");(()=>{n(/\{\{(?:[^{]\{?)+?\}\}/g,"template");({code:e,hidden:t}=b(e,t))})();n(/^(:* *)(\{\|[^]*?\n\|\})/gm,"table");return{code:e,hidden:t}}function y(e){return e.replace(/([^\n])\n?$/,"$1\n\n")}},function(e,t,n){"use strict";n.d(t,"i",(function(){return g}));n.d(t,"j",(function(){return p}));n.d(t,"h",(function(){return b}));n.d(t,"b",(function(){return v}));n.d(t,"a",(function(){return w}));n.d(t,"l",(function(){return x}));n.d(t,"k",(function(){return S}));n.d(t,"g",(function(){return N}));n.d(t,"f",(function(){return A}));n.d(t,"d",(function(){return P}));n.d(t,"e",(function(){return I}));n.d(t,"c",(function(){return L}));var i=n(2),o=n.n(i),a=n(30),s=n.n(a),r=n(3),c=n(0),l=n(16),u=n(4),d=n(1),h=n(10);let m,f;function g(e,t="post"){return new Promise((n,i)=>{c.a.g.mwApi[t](e,{success:e=>{if(e.error)i(["api",e]);else n(e)},error:(e,t)=>{i(["http",t])}})})}function p(e,t){const n={action:"parse",text:e,contentmodel:"wikitext",prop:["text","modules","jsconfigvars"],pst:!0,disabletoc:!0,disablelimitreport:!0,disableeditsection:!0},i=Object.assign({},n,t);return c.a.g.mwApi.post(i).then(e=>{var n;const i=null===(n=e.parse)||void 0===n?void 0:n.text;if(i){mw.loader.load(e.parse.modules);mw.loader.load(e.parse.modulestyles)}else throw new r.a({type:"api",code:"noData"});const o=e.parse.parsedsummary;if(null!=t&&t.summary&&!o)throw new r.a({type:"api",code:"noData"});return{html:i,parsedSummary:o}},d.w)}function b(e=!1){if(e&&m)return m;Object(u.c)();m=c.a.g.mwApi.post({action:"query",meta:"userinfo",uiprop:["options","rights"]}).then(e=>{var t;const n=null===(t=e.query)||void 0===t?void 0:t.userinfo,i=null==n?void 0:n.options,o=null==n?void 0:n.rights;if(!i||!o)throw new r.a({type:"api",code:"noData"});const a=i[c.a.g.VISITS_OPTION_NAME],l=a?s.a.decompressFromEncodedURIComponent(a):"",u=Object(h.h)(l),d=i[c.a.g.WATCHED_SECTIONS_OPTION_NAME],m=d?s.a.decompressFromEncodedURIComponent(d):"",f=Object(h.i)(m);c.a.g.USER_RIGHTS=o;return{options:i,visits:u,watchedSections:f,rights:o}},d.w);return m}function v(e){return y.apply(this,arguments)}function y(){return(y=o()((function*(e){var t;const n=[],i=null!==(t=c.a.g.USER_RIGHTS)&&void 0!==t&&t.includes("apihighlimits")?500:50;let o;for(;o=e.splice(0,i).join("|");){const e=yield c.a.g.mwApi.post({action:"query",pageids:o}).catch(d.w);if(e.error)throw new r.a({type:"api",code:"error",apiData:e});const t=e.query,i=null==t?void 0:t.pages;if(!i)throw new r.a({type:"api",code:"noData"});n.push(...i)}return n}))).apply(this,arguments)}function w(e){return E.apply(this,arguments)}function E(){return(E=o()((function*(e){var t;const n=[],i=[],o=[],a=null!==(t=c.a.g.USER_RIGHTS)&&void 0!==t&&t.includes("apihighlimits")?500:50;let s;for(;s=e.splice(0,a).join("|");){const e=yield c.a.g.mwApi.post({action:"query",titles:s,redirects:!0}).catch(d.w);if(e.error)throw new r.a({type:"api",code:"error",apiData:e});const t=e.query,a=null==t?void 0:t.pages;if(!a)throw new r.a({type:"api",code:"noData"});n.push(...t.normalized||[]);i.push(...t.redirects||[]);o.push(...a)}return{normalized:n,redirects:i,pages:o}}))).apply(this,arguments)}function C(e,t,n){return T.apply(this,arguments)}function T(){return(T=o()((function*(e,t,n){if(t&&t.length>65535)throw new r.a({type:"internal",code:"sizeLimit",details:{action:n}});const i=yield g(c.a.g.mwApi.assertCurrentUser({action:n,optionname:e,optionvalue:void 0===t&&"globalpreferences"===n?"":t}),"postWithEditToken").catch(d.w);if(!i||"success"!==i[n])throw new r.a({type:"api",code:"noSuccess",details:{action:n}})}))).apply(this,arguments)}function x(e,t){return k.apply(this,arguments)}function k(){return(k=o()((function*(e,t){yield C(e,t,"options")}))).apply(this,arguments)}function S(e,t){return O.apply(this,arguments)}function O(){return(O=o()((function*(e,t){if(c.a.config.useGlobalPreferences)try{yield C(e,t,"globalpreferences")}catch(n){if(n instanceof r.a&&n.data.apiData&&"badvalue"===n.data.apiData.error.code)yield x(e,t);else throw n}else yield x(e,t)}))).apply(this,arguments)}function N(e){return _.apply(this,arguments)}function _(){return(_=o()((function*(e,t=!1){var n;const i=e.filter(e=>!e.getGender()&&e.isRegistered()).filter(d.X).map(e=>e.name),o=null!==(n=c.a.g.USER_RIGHTS)&&void 0!==n&&n.includes("apihighlimits")?500:50;let a;for(;a=i.splice(0,o).join("|");){var s;const e={action:"query",list:"users",ususers:a,usprop:"gender"},n=t?g(e):c.a.g.mwApi.post(e),i=null===(s=(yield n.catch(d.w)).query)||void 0===s?void 0:s.users;if(!i)throw new r.a({type:"api",code:"noData"});i.filter(e=>e.gender).forEach(e=>{l.a.getUser(e.name).setGender(e.gender)})}}))).apply(this,arguments)}function A(e){e=Object(d.j)(e);const t=new Promise((n,i)=>{setTimeout(o()((function*(){try{var o;if(t!==f)throw new r.a;const i=null===(o=(yield c.a.g.mwApi.get({action:"opensearch",search:e,namespace:3,redirects:"resolve",limit:10}).catch(d.w))[1])||void 0===o?void 0:o.map(e=>(e.match(c.a.g.USER_NAMESPACES_REGEXP)||[])[1]).filter(d.h).filter(e=>!e.includes("/"));if(!i)throw new r.a({type:"api",code:"noData"});if(i.length)n(i);else{var a,s;const t=yield c.a.g.mwApi.get({action:"query",list:"allusers",auprefix:e}).catch(d.w),i=null==t?void 0:null===(a=t.query)||void 0===a?void 0:null===(s=a.allusers)||void 0===s?void 0:s.map(e=>e.name);if(!i)throw new r.a({type:"api",code:"noData"});n(i)}}catch(e){i(e)}})),100)});f=t;return t}function P(e){let t=!1;if(c.a.g.COLON_NAMESPACES_PREFIX_REGEXP.test(e)){e=e.slice(1);t=!0}const n=new Promise((i,o)=>{setTimeout(()=>{try{if(n!==f)throw new r.a;c.a.g.mwApi.get({action:"opensearch",search:e,redirects:"return",limit:10}).then(n=>{var o;const a=new RegExp("^"+mw.util.escapeRegExp(e[0]),"i"),s=null===(o=n[1])||void 0===o?void 0:o.map(n=>n.replace(a,()=>e[0]).replace(/^/,t?":":""));if(!s)throw new r.a({type:"api",code:"noData"});i(s)},e=>{Object(d.w)(e)})}catch(e){o(e)}},100)});f=n;return n}function I(e){const t=new Promise((n,i)=>{setTimeout(()=>{try{if(t!==f)throw new r.a;c.a.g.mwApi.get({action:"opensearch",search:e.startsWith(":")?e.slice(1):"Template:"+e,redirects:"return",limit:10}).then(t=>{var i;const o=new RegExp("^"+mw.util.escapeRegExp(e[0]),"i"),a=null===(i=t[1])||void 0===i?void 0:i.filter(e=>!/(\/doc|\.css)$/.test(e)).map(t=>e.startsWith(":")?t:t.slice(t.indexOf(":")+1)).map(t=>t.replace(o,()=>e[0]));if(!a)throw new r.a({type:"api",code:"noData"});n(a)},e=>{Object(d.w)(e)})}catch(e){i(e)}},100)});f=t;return t}function L(e){return M.apply(this,arguments)}function M(){return(M=o()((function*(e){var t;const n={},i=[],o=[],a=e.slice(),s=null!==(t=c.a.g.USER_RIGHTS)&&void 0!==t&&t.includes("apihighlimits")?500:50;let l;for(;l=a.splice(0,s).join("|");){const e=yield c.a.g.mwApi.post({action:"query",titles:l}).catch(d.w);if(e.error)throw new r.a({type:"api",code:"error",apiData:e});const t=e.query,n=null==t?void 0:t.pages;if(!n)throw new r.a({type:"api",code:"noData"});i.push(...t.normalized||[]);o.push(...n)}const u={};i.forEach(e=>{u[e.to]=e.from});o.forEach(e=>{n[u[e.title]||e.title]={exists:!e.missing,normalized:e.title}});return n}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"h",(function(){return m}));n.d(t,"i",(function(){return g}));n.d(t,"b",(function(){return p}));n.d(t,"a",(function(){return v}));n.d(t,"e",(function(){return y}));n.d(t,"c",(function(){return E}));n.d(t,"f",(function(){return x}));n.d(t,"d",(function(){return S}));n.d(t,"g",(function(){return N}));var i=n(2),o=n.n(i),a=n(30),s=n.n(a),r=n(3),c=n(0),l=n(1),u=n(9),d=n(4);function h(e){return Object.keys(e).map(t=>`${t},${e[t].join(",")}\n`).join("").trim()}function m(e){const t={},n=/^(\d+), *(.+)$/gm;let i;for(;i=n.exec(e);)t[i[1]]=i[2].split(",");return t}function f(e){return Object.keys(e).filter(t=>e[t].length).map(t=>` ${t} ${e[t].join("\n")}\n`).join("").trim()}function g(e){const t={},n=e.split(/(?:^|\n )(\d+) /).slice(1);let i;for(let e=0,o=!0;e
")}}},codeBlock:{label:cd.a.s("cf-codeblock-tooltip"),type:"button",icon:`/w/load.php?modules=oojs-ui.styles.icons-editing-advanced&image=markup&lang=${a}&skin=vector`,action:{type:"encapsulate",options:{pre:'",peri:cd.a.s("cf-strikethrough-placeholder"),post:""}}}}});e.wikiEditor("addToToolbar",{section:"main",groups:{"convenient-discussions":{tools:{mention:{label:cd.a.s("cf-mention-tooltip"),type:"button",icon:`/w/load.php?modules=oojs-ui.styles.icons-user&image=userAvatar&lang=${a}&skin=vector`,action:{type:"callback",execute:()=>{}}}}}}});this.$element.find('.tool-button[rel="mention"]').off("click").on("click",e=>{this.mention(e.ctrlKey)});this.$element.find('.tool[rel="link"] a, .tool[rel="file"] a').on("click",e=>{const t=e.currentTarget.parentNode.getAttribute("rel"),n=$(`#wikieditor-toolbar-${t}-dialog`);if(n.length){const e=n.data("context");if(e)e.$textarea=e.$focusedElem=this.commentInput.$input;n.parent().data("dialogaction",!1)}});if(e.is(":focus")){e.blur();Object(l.l)(this.commentInput)}e.data("wikiEditor-context").instance=5;$.wikiEditor.instances=Array(5);mw.hook("convenientDiscussions.commentFormToolbarReady").fire(this,cd.a)})}addInsertButton(e,t){const n=[];e=Object(l.x)(e,/\\[+;\\]/g,n);let[,i,o]=e.match(/^(.*?)(?:\+(.*))?$/)||[];if(!i)return;o=o||"";const a=e=>e.replace(/\\([+;\\])/g,"$1");i=a(Object(l.W)(i,n));o=a(Object(l.W)(o,n));t=t?a(t):i+o;const r=new s.a({label:t,classes:["cd-insertButtons-button"],action:()=>{this.encapsulateSelection({pre:i,post:o})}});this.$insertButtons.append(r.element," ")}addInsertButtons(){if(cd.a.settings.insertButtons.length){this.$insertButtons=$("{if(Object(l.G)(e,13,["ctrl"]))this.submit();if(Object(l.G)(e,27))this.cancel()}).on("focusin",()=>{this.lastFocused=new Date});if(this.headlineInput){this.headlineInput.on("change",e=>{var t;this.updateAutoSummary(!0,!0);if(e.includes("{{")&&(null===(t=this.preloadConfig)||void 0===t||!t.headline))this.showMessage(cd.a.sParse("cf-reaction-templateinheadline"),{type:"warning",name:"templateInHeadline"});else this.hideMessage("templateInHeadline")}).on("change",t).on("change",e);this.headlineInput.$input.on("keydown",e=>{if(13===e.keyCode&&!cd.a.g.activeAutocompleteMenu)this.submit()})}this.commentInput.on("change",e=>{this.updateAutoSummary(!0,!0);n.forEach(({pattern:t,checkFunc:n,message:i,type:o,name:a})=>{if(t.test(e)&&("function"!=typeof n||n(this)))this.showMessage(i,{type:o,name:a});else this.hideMessage(a)})}).on("change",t).on("change",e);this.commentInput.$input.get(0).addEventListener("tribute-replaced",e=>{if(e.detail.instance.trigger===cd.a.config.mentionCharacter){var t;if("edit"===this.mode){const e=Object(l.Y)(cd.a.sParse("cf-reaction-mention-edit"),{targetBlank:!0});this.showMessage(e,{type:"notice",name:"mentionEdit"})}if(null!==(t=this.omitSignatureCheckbox)&&void 0!==t&&t.isSelected()){const e=Object(l.Y)(cd.a.sParse("cf-reaction-mention-nosignature"),{targetBlank:!0});this.showMessage(e,{type:"notice",name:"mentionNoSignature"})}}});this.summaryInput.on("change",()=>{if(this.summaryInput.$input.is(":focus")){this.isSummaryAltered=!0;this.dontAutopreviewOnSummaryChange=!1}if(!this.dontAutopreviewOnSummaryChange)t()}).on("change",e);this.summaryInput.$input.on("keydown",e=>{if(13===e.keyCode&&!cd.a.g.activeAutocompleteMenu)this.submit()});if(this.minorCheckbox)this.minorCheckbox.on("change",e);this.watchCheckbox.on("change",e);if(this.watchSectionCheckbox)this.watchSectionCheckbox.on("change",e);if(this.omitSignatureCheckbox)this.omitSignatureCheckbox.on("change",()=>{this.preview(!1)}).on("change",e);if(this.deleteCheckbox)this.deleteCheckbox.on("change",e=>{this.updateAutoSummary(!0,!0);this.updateFormOnDeleteCheckboxChange(e)}).on("change",t).on("change",e);this.advancedButton.on("click",()=>{this.toggleAdvanced()});this.settingsButton.on("click",()=>{Object(E.d)()});this.cancelButton.on("click",()=>{this.cancel()});this.viewChangesButton.on("click",()=>{this.viewChanges()});this.previewButton.on("click",()=>{this.preview(!0,!1)});this.submitButton.on("click",()=>{this.submit()})}initAutocomplete(){let e,t=[];if(this.targetSection)t=this.targetSection.getBase().comments;else if("addSection"!==this.mode)cd.a.comments.some(e=>{if(e.section)return!0;else{t.push(e);return!1}});if("edit"===this.mode)t=t.filter(e=>e!==this.target);if(3===cd.a.g.NAMESPACE_NUMBER){const t=(cd.a.page.title.match(/^([^/]+)/)||[])[0];if(t)e=g.a.getUser(t)}let n=t.map(e=>e.author).concat(e).filter(l.h).sort((e,t)=>t.isRegistered()-e.isRegistered()||(t.name>e.name?-1:1)).map(e=>e.name);if(this.targetComment&&"edit"!==this.mode)for(let e=this.targetComment;e;e=e.getParent())if(e.author!==cd.a.user){if(!e.author.isRegistered())break;n.unshift(e.author.name);break}n=n.filter(l.X);this.autocomplete=new a.a({types:["mentions","wikilinks","templates","tags","commentLinks"],inputs:[this.commentInput],comments:t,defaultUserNames:n});if(this.headlineInput)this.headlineAutocomplete=new a.a({types:["mentions","wikilinks","tags"],inputs:[this.headlineInput],comments:t,defaultUserNames:n});this.summaryAutocomplete=new a.a({types:["mentions","wikilinks"],inputs:[this.summaryInput],comments:t,defaultUserNames:n})}toggleAdvanced(){if(this.$advanced.is(":hidden")){this.$advanced.show();const e=this.summaryInput.getValue(),t=e.match(/^.+?\*\/ */);Object(l.l)(this.summaryInput);this.summaryInput.selectRange(t?t[0].length:0,e.length)}else{this.$advanced.hide();Object(l.l)(this.commentInput)}}adjustLabels(){let e=this.$element.width();if(this.$element.hasClass("cd-commentForm-short")){if(e>=this.buttonsTotalWidthStandard+7){this.$element.removeClass("cd-commentForm-short");this.submitButton.setLabel(this.submitButtonLabelStandard);this.previewButton.setLabel(cd.a.s("cf-preview"));this.viewChangesButton.setLabel(cd.a.s("cf-viewchanges"));this.cancelButton.setLabel(cd.a.s("cf-cancel"))}}else{this.buttonsTotalWidthStandard=this.submitButton.$element.outerWidth(!0)+(this.previewButton.$element.is(":visible")?this.previewButton.$element.outerWidth(!0):0)+(this.viewChangesButton.$element.is(":visible")?this.viewChangesButton.$element.outerWidth(!0):0)+this.advancedButton.$element.outerWidth(!0)+this.helpPopupButton.$element.outerWidth(!0)+this.cancelButton.$element.outerWidth(!0);if(e
";else{const t=cd.a.config.spaceAfterIndentationChars?" ":"";e=`$1\n${o}${t}`}c=c.replace(/^(.*)\n\n+(?!:)/gm,e)}const m=new RegExp("^(?:\\x01\\d+_block.*\\x02) *$","i"),f=new RegExp(`^\\[\\[${cd.a.g.FILE_PREFIX_PATTERN}.+\\]\\]$`,"i"),g=new RegExp(`(?:<${cd.a.g.PNIE_PATTERN}(?: [\\w ]+?=[^<>]+?| ?\\/?)>|<\\/${cd.a.g.PNIE_PATTERN}>|\\x04) *$`,"i"),p=new RegExp(`^(?:<\\/${cd.a.g.PNIE_PATTERN}>|<${cd.a.g.PNIE_PATTERN}|\\|)`,"i"),b=/^(=+).*\1[ \t]*$|^----/,v=this.willCommentBeIndented?/^(.+)\n(?!:)(?=(.*))/gm:/^((?![:*#; ]).+)\n(?![\n:*#; \x03])(?=(.*))/gm;c=c.replace(v,(e,t,n)=>{const i=cd.a.config.spaceAfterIndentationChars&&!/^[:*#;]/.test(n)?" ":"",s=this.willCommentBeIndented&&!cd.a.config.paragraphTemplates.length&&!a?`\n${o}${i}`:"
";return t+(m.test(t)||m.test(n)||!this.willCommentBeIndented&&(b.test(t)||b.test(n))||f.test(t)||!this.willCommentBeIndented&&f.test(n)||g.test(t)||p.test(n)?"":s)+(this.willCommentBeIndented?"":"\n")});if(null===(n=this.omitSignatureCheckbox)||void 0===n||!n.isSelected())c=c.replace(/\s*~{3,}$/,"");if(this.willCommentBeIndented&&"preview"!==e&&/^[*#;\x03]/.test(c))i=o;if(this.headlineInput&&("addSection"!==this.mode||!this.submitSection||"submit"!==e)){const e=this.headlineInput.getValue().trim();if(e){let t;if("addSection"===this.mode)t=2;else if("addSubsection"===this.mode)t=this.target.level+1;else t=this.target.inCode.headingLevel;const n="=".repeat(t);if(this.isSectionOpeningCommentEdited&&/^\n/.test(this.target.inCode.code))c="\n"+c;c=`${n} ${e} ${n}\n${c}`}}if("preview"===e&&d)d=`${d}`;if(!this.willCommentBeIndented&&/(^|\n)[ =].*$/.test(c))c+="\n";if(!c||c.endsWith("\n")||c.endsWith(" "))d=d.trimLeft();if(h){let e;if(/^[:*#; ]/.test(c)){e="\n"+(this.willCommentBeIndented?o:"")}else e="";if(cd.a.config.smallDivTemplates.length&&!/^[:*#;]/m.test(c)){const e=[];c=Object(l.x)(c.trim(),/\[\^\]+)/g,n=[];let i;for(;i=t.exec(e);)n.push(i[1]);return n}(t.commentInput.getValue());t.submitSection=Boolean("addSection"===t.mode&&!t.isNewTopicOnTop&&(null===(n=t.headlineInput)||void 0===n?void 0:n.getValue().trim()));try{if(t.targetSection&&null!==t.targetSection.liveSectionNumber&&!i.length)yield t.targetSection.getCode(t);else yield t.targetPage.getCode(0===mw.config.get("wgArticleId"))}catch(e){if(e instanceof r.a){const n=Object.assign({},{message:cd.a.sParse("cf-error-getpagecode")},e.data);t.handleError(n)}else t.handleError({type:"javascript",logMessage:e});return}let o;try{var a;if(!(t.target instanceof h.a||t.target instanceof m.a&&t.submitSection))t.target.locateInCode(t.submitSection);if("replyInSection"===t.mode)t.target.setLastCommentIndentationChars(t);o=t.target.modifyWholeCode({commentCode:t.commentTextToCode(e),action:t.mode,doDelete:null===(a=t.deleteCheckbox)||void 0===a?void 0:a.isSelected(),commentForm:t});o=t.addAnchorsToComments(o,i)}catch(e){if(e instanceof r.a)t.handleError(e.data);else t.handleError({type:"javascript",logMessage:e});return}return o}))()}registerOperation(e,t={},n=!0){const i=Object.assign(t,{type:e});this.operations.push(i);i.isClosed=!1;if("preview"!==i.type||!i.isAuto){if(n)this.$messageArea.empty();this.pushPending(["load","submit"].includes(i.type),i.affectHeadline)}return i}closeOperation(e){if(!e.isClosed){e.isClosed=!0;if("preview"!==e.type||!e.isAuto)this.popPending(["load","submit"].includes(e.type),e.affectHeadline)}}closeOperationIfNecessary(e){if(e.isClosed)return!0;const t=Object(l.i)(this.operations,t=>e!==t&&["preview","viewChanges"].includes(t.type)&&!t.isDelayed);if(null!==t&&t>this.operations.indexOf(e)){this.closeOperation(e);return!0}else return!1}unregisterOperation(e){Object(l.K)(this.operations,e);if("preview"!==e.type||!e.isAuto)this.popPending("submit"===e.type,e.affectHeadline)}isBeingSubmitted(){return this.operations.some(e=>"submit"===e.type&&!e.isClosed)}isContentBeingLoaded(){return this.operations.some(e=>"load"===e.type&&!e.isClosed)}preview(e=!0,t=!0,n){var i=this;return o()((function*(){var o;if(i.isContentBeingLoaded()||!(i.target instanceof h.a)&&!i.target.inCode&&i.checkCodeRequest&&"resolved"===(yield Object(l.s)(i.checkCodeRequest))||i.isBeingSubmitted()||t&&!cd.a.settings.autopreview){if(n)i.closeOperation(n);return}const a=n||i.registerOperation("preview",{isAuto:t});if(t){const t=Date.now()-i.lastPreviewTimestamp<1e3;if(t||i.operations.some(e=>!e.isClosed&&"preview"===e.type&&e!==a)){if(i.previewTimeout)i.unregisterOperation(a);else{a.isDelayed=!0;i.previewTimeout=setTimeout(()=>{i.previewTimeout=null;i.preview(e,!0,a)},t?1e3-(Date.now()-i.lastPreviewTimestamp):100)}return}i.lastPreviewTimestamp=Date.now()}if(i.closeOperationIfNecessary(a))return;if(!(i.target instanceof h.a||i.target.inCode)){yield i.checkCode();if(!i.target.inCode)i.closeOperation(a);if(a.isClosed)return}const s=!(i.commentInput.getValue().trim()||null!==(o=i.headlineInput)&&void 0!==o&&o.getValue().trim());if(s&&!e){i.closeOperation(a);return}const c=i.commentTextToCode("preview");let u,d;try{({html:u,parsedSummary:d}=yield Object(w.j)(c,{title:i.targetPage.name,summary:Object(l.d)({text:i.summaryInput.getValue()})}))}catch(e){if(e instanceof r.a){const t=Object.assign({},e.data,{message:cd.a.sParse("cf-error-preview"),currentOperation:a});i.handleError(t)}else i.handleError({type:"javascript",logMessage:e,currentOperation:a});return}if(!i.closeOperationIfNecessary(a)){if(u){var m;if(t&&s||null!==(m=i.deleteCheckbox)&&void 0!==m&&m.isSelected())i.$previewArea.empty();else{const e=$("e?-1:1;e=i}}n=0===t?this.namespaceId%2==0:t>0}Object.assign(this,{areNewTopicsOnTop:n,firstSectionStartIndex:c})}purge(){var e=this;return o()((function*(){yield s.a.g.mwApi.post({action:"purge",titles:e.name}).catch(()=>{mw.notify(s.a.s("error-purgecache"),{type:"warn"})})}))()}markAsRead(e){var t=this;return o()((function*(){yield s.a.g.mwApi.postWithEditToken({action:"setnotificationtimestamp",titles:t.name,newerthanrevid:e})}))()}}t.a=Page},function(e,t,n){"use strict";var i=n(2),o=n.n(i),a=n(12),s=n(3),r=n(13),c=n(14);class SectionMenuButton_SectionMenuButton extends a.a{constructor(e){super(e);const t=document.createElement("span");t.className="cd-section-menu-button-wrapper cd-section-menu-button-wrapper-"+e.name;t.appendChild(this.element);this.wrapperElement=t;if(!e.visible)this.hide()}hide(){this.wrapperElement.style.display="none";return this}show(){this.wrapperElement.style.display="";return this}}var l=SectionMenuButton_SectionMenuButton,cd=n(0),u=n(18),d=n(1);var h=class{constructor(e,t,n){this.parser=e;this.headingElement=t;this.headlineElement=this.parser.context.getElementByClassName(t,"mw-headline");if(!this.headlineElement)throw new s.a;this.anchor=this.headlineElement.getAttribute("id");this.parseHeadline();const i=t.tagName.match(/^H([1-6])$/);this.level=i&&Number(i[1]);this.sectionNumber=null;let o=this.parser.context.getElementByClassName(t,"mw-editsection");if(!o)o=this.createSectionMenu();const a=Array.from(o.getElementsByTagName("a")).find(e=>{var t;return null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("action=edit")});if(a){const e=cd.a.g.SERVER+a.getAttribute("href");this.editUrl=new URL(e);if(this.editUrl){const e=this.editUrl.searchParams.get("section");if(e.startsWith("T-")){this.sourcePageName=this.editUrl.searchParams.get("title");this.sectionNumber=Number(e.match(/\d+/)[0])}else this.sectionNumber=Number(e);this.editUrl=this.editUrl.href}}this.setContentProperties(n);this.id=cd.a.sections.length}createSectionMenu(){const e=this.parser.context.document.createElement("span");e.setAttribute("class","mw-editsection-bracket");e.textContent="[";const t=this.parser.context.document.createElement("span");t.setAttribute("class","mw-editsection-bracket");t.textContent="]";const n=this.parser.context.document.createElement("span");n.setAttribute("class","mw-editsection");n.appendChild(e);n.appendChild(t);this.headingElement.appendChild(n);return n}setContentProperties(e){const t=new u.c(cd.a.g.rootElement,e=>!["STYLE","LINK"].includes(e.tagName)&&!e.classList.contains("cd-section-button-container"),!0,this.headingElement);this.headingNestingLevel=0;for(;t.parentNode();)this.headingNestingLevel++;let n;if(e){n=Object(d.p)(this.headingElement,e);n.pop()}else{let e=cd.a.g.rootElement.lastElementChild;for(;e.contains(this.headingElement)&&e!==this.headingElement;)e=e.lastElementChild;n=Object(d.p)(this.headingElement,e)}let i,o,a=!1;n.slice(1).some((e,t)=>{if(void 0===this.lastElementInFirstChunk&&/^H[2-6]$/.test(e.tagName)){a=!0;this.lastElementInFirstChunk=n[t];return!0}else return!1});this.lastElementInFirstChunk=this.lastElementInFirstChunk||n[n.length-1];if(n[1]){t.currentNode=n[n.length-1];for(;t.lastChild(););const e=t.currentNode;t.currentNode=n[1];do{if(t.currentNode.classList.contains("cd-comment-part"))i=t.currentNode}while(!i&&t.currentNode!==e&&t.nextNode());t.currentNode=e;do{if(t.currentNode.classList.contains("cd-comment-part"))o=t.currentNode}while(!o&&t.currentNode!==n[1]&&t.previousNode())}if(i){const e=Number(i.getAttribute("data-comment-id")),t=Number(o.getAttribute("data-comment-id"));this.comments=cd.a.comments.slice(e,t+1);if(a){const e=this.comments.findIndex(e=>!(this.parser.context.follows(this.lastElementInFirstChunk,e.elements[0])||this.lastElementInFirstChunk.contains(e.elements[0])));this.commentsInFirstChunk=this.comments.slice(0,e||0)}this.comments.forEach(e=>{if(!this.oldestComment||e.date&&(!this.oldestComment.date||this.oldestComment.date>e.date))this.oldestComment=e});this.comments[0].followsHeading=!0}this.comments=this.comments||[];this.commentsInFirstChunk=this.commentsInFirstChunk||this.comments;this.commentsInFirstChunk.forEach(e=>{e.section=this});this.elements=n}parseHeadline(){const e=["mw-headline-number",...cd.a.config.foreignElementInHeadlineClasses],t=Array.from(this.headlineElement.childNodes).filter(t=>t.nodeType!==Node.ELEMENT_NODE||!e.some(e=>t.classList.contains(e)));this.headline=t.map(e=>e.textContent).join("").trim()}getParent(e=!0){if(e&&this.level<=2)return null;else return cd.a.sections.slice(0,this.id).reverse().find(e=>e.level